Use String concatenation instead of StringBuffer/Builder
[yangtools.git] / yang / yang-parser-impl / src / main / java / org / opendaylight / yangtools / yang / parser / stmt / rfc6020 / effective / NotificationEffectiveStatementImpl.java
index b89e34211a1511a5ce5e6cbeafc2d1289d9d8036..1daac3a16e0464c3324eefeb645b10eaa3eb7eb4 100644 (file)
@@ -23,31 +23,24 @@ import org.opendaylight.yangtools.yang.model.api.UnknownSchemaNode;
 import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
 import org.opendaylight.yangtools.yang.model.api.stmt.NotificationStatement;
 import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
-import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.Utils;
 
-public class NotificationEffectiveStatementImpl
-        extends AbstractEffectiveDocumentedDataNodeContainer<QName, NotificationStatement>
-        implements NotificationDefinition {
+public class NotificationEffectiveStatementImpl extends
+        AbstractEffectiveDocumentedDataNodeContainer<QName, NotificationStatement> implements NotificationDefinition {
     private final QName qname;
     private final SchemaPath path;
-    private Set<AugmentationSchema> augmentations;
-    private List<UnknownSchemaNode> unknownNodes;
+    private final Set<AugmentationSchema> augmentations;
+    private final List<UnknownSchemaNode> unknownNodes;
 
     public NotificationEffectiveStatementImpl(
             final StmtContext<QName, NotificationStatement, EffectiveStatement<QName, NotificationStatement>> ctx) {
         super(ctx);
         this.qname = ctx.getStatementArgument();
-        this.path = Utils.getSchemaPath(ctx);
+        this.path = ctx.getSchemaPath().get();
 
-        initSubstatementCollections();
-    }
-
-    private void initSubstatementCollections() {
+        // initSubstatementCollections
         Collection<? extends EffectiveStatement<?, ?>> effectiveSubstatements = effectiveSubstatements();
-
         List<UnknownSchemaNode> unknownNodesInit = new LinkedList<>();
         Set<AugmentationSchema> augmentationsInit = new HashSet<>();
-
         for (EffectiveStatement<?, ?> effectiveStatement : effectiveSubstatements) {
             if (effectiveStatement instanceof UnknownSchemaNode) {
                 UnknownSchemaNode unknownNode = (UnknownSchemaNode) effectiveStatement;
@@ -58,7 +51,6 @@ public class NotificationEffectiveStatementImpl
                 augmentationsInit.add(augmentationSchema);
             }
         }
-
         this.unknownNodes = ImmutableList.copyOf(unknownNodesInit);
         this.augmentations = ImmutableSet.copyOf(augmentationsInit);
     }
@@ -109,8 +101,6 @@ public class NotificationEffectiveStatementImpl
 
     @Override
     public String toString() {
-        StringBuilder sb = new StringBuilder(NotificationEffectiveStatementImpl.class.getSimpleName());
-        sb.append("[qname=").append(qname).append(", path=").append(path).append("]");
-        return sb.toString();
+        return NotificationEffectiveStatementImpl.class.getSimpleName() + "[qname=" + qname + ", path=" + path + "]";
     }
 }