mbien commented on code in PR #7097:
URL: https://github.com/apache/netbeans/pull/7097#discussion_r1522359901


##########
ide/languages.hcl/src/org/netbeans/modules/languages/hcl/ast/HCLConditionalOperation.java:
##########
@@ -25,25 +25,15 @@
  *
  * @author lkishalmi
  */
-public final class HCLConditionalOperation extends HCLExpression {
-
-    final HCLExpression condition;
-    final HCLExpression trueValue;
-    final HCLExpression falseValue;
-
-    public HCLConditionalOperation(HCLExpression condition, HCLExpression 
trueValue, HCLExpression falseValue) {
-        this.condition = condition;
-        this.trueValue = trueValue;
-        this.falseValue = falseValue;
-    }
+public record HCLConditionalOperation(HCLExpression condition, HCLExpression 
trueValue, HCLExpression falseValue) implements HCLExpression {
 
     @Override
     public String asString() {
         return condition.toString() + "?" + trueValue.toString() + ":" + 
falseValue.toString();
     }
 
     @Override
-    public List<? extends HCLExpression> getChildren() {
+    public List<? extends HCLExpression> elements() {
         return Arrays.asList(condition, trueValue, falseValue);

Review Comment:
   `List.of`would make this immutable and better compatible with `List.copyOf` 
which I saw somewhere else. Another match would be in `HCLLanguage` L236.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to