Uploaded image for project: 'Talend Component Kit'
  1. Talend Component Kit
  2. TCOMP-1733

NPE in Studio metadata connection with activeif on different layouts

Apply templateInsert Lucidchart DiagramXMLWordPrintable

    • Hide
      • On studio, deploy a TCK component where in datastore, a property has an activeif that references a property that is not on the same form (see code exemple below to clarify).
      • In metadata : Try to create a new connection

      this will trigger a null pointer exception.

      Show
      On studio, deploy a TCK component where in datastore, a property has an activeif that references a property that is not on the same form (see code exemple below to clarify). In metadata : Try to create a new connection this will trigger a null pointer exception.
    • All
    • Small

      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.

            clesaec Christophe LeSaec
            clesaec Christophe LeSaec
            Christophe LeSaec, Fabien Desiles
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: