Community
Participate
Working Groups
Build Identifier: 2.3.0.v201203201034 ILinkingDiagnosticMessageProvider.getUnresolvedProxyMessage may return null if it is ok to have an unresolved reference. When using Linker (as opposed to LazyLinker), the returned value is used as producer.addDiagnostic(message); where the producer expects a non-null message, causing an error further on. So either Linker should check the value, or the IDiagnosticProducer should accept nulls. Reproducible: Always Steps to Reproduce: 1. Start with the arithmetics examples 2. Bind these in the guice module: @Override public Class<? extends ILinker> bindILinker() { return DemoLinker.class; } public Class<? extends ILinkingDiagnosticMessageProvider.Extended> bindILinkingDiagnosticMessageProvider() { return DemoLinkingDiagnosticMessageProvider.class; } 3. Define public class DemoLinker extends Linker { } and public class DemoLinkingDiagnosticMessageProvider extends LinkingDiagnosticMessageProvider { @Override public DiagnosticMessage getUnresolvedProxyMessage( ILinkingDiagnosticContext context) { return null; } } 4. Build and run and create a .calc file with an unresolved reference module v def x: zzz+3; 5. There will be a NPE causing trouble
this is still valid. i guess the preferred way to implement this is org.eclipse.xtext.linking.impl.Linker.isNullValidResult(EObject, EReference, INode) so we should change the javadoc right?
seems lazy linker and linker behave differently here