When create a new connection on metadata of Studio from tck component,
when a property from a form has an activeIf annotations that references a property from another form, it lead to NPE :
Caused by: java.lang.NullPointerException at java.util.stream.Collectors.lambda$toMap$58(Collectors.java:1320) at java.util.stream.ReduceOps$3ReducingSink.accept(ReduceOps.java:169) at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1382) at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:580) at java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:270) at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1382) at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482) at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472) at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708) at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499) at org.talend.sdk.component.studio.model.parameter.SettingVisitor.lambda$7(SettingVisitor.java:188) at java.util.LinkedHashMap.forEach(LinkedHashMap.java:684) at org.talend.sdk.component.studio.model.parameter.SettingVisitor.getSettings(SettingVisitor.java:178)
For example, a property visible on "Advanced" form has a @ActiveIf on a property that is only on "Main' form.
@Data @DataStore("MyDS") @GridLayout({ // @GridLayout.Row({ "propMain" }), // }) @GridLayout(names = GridLayout.FormType.ADVANCED, // value = { @GridLayout.Row({ "advanced" }), // }) @Documentation("...") public class XDataStore implements Serializable { @Option @Documentation("...") private String propMain = ""; @Option @Documentation("...") @ActiveIf(target = "propMain", value = "XXX") private String advanced; }
will trigger the exception.