Use String concatenation instead of StringBuffer/Builder
[yangtools.git] / yang / yang-parser-impl / src / main / java / org / opendaylight / yangtools / yang / parser / stmt / rfc6020 / effective / LeafListEffectiveStatementImpl.java
index 6d9a5f6f42d90801b7c2ac84f1f680372a2aa15b..de1322110d1db580e560bc9133714a1447976713 100644 (file)
@@ -35,10 +35,9 @@ public final class LeafListEffectiveStatementImpl extends AbstractEffectiveDataS
         this.original = ctx.getOriginalCtx() == null ? null : (LeafListSchemaNode) ctx.getOriginalCtx()
                 .buildEffective();
 
-        final TypeEffectiveStatement<?> typeStmt = firstSubstatementOfType(TypeEffectiveStatement.class);
-        if (typeStmt == null) {
-            throw new SourceException("Leaf-list is missing a 'type' statement", ctx.getStatementSourceReference());
-        }
+        final TypeEffectiveStatement<?> typeStmt = SourceException.throwIfNull(
+            firstSubstatementOfType(TypeEffectiveStatement.class), ctx.getStatementSourceReference(),
+            "Leaf-list is missing a 'type' statement");
 
         final ConcreteTypeBuilder<?> builder = ConcreteTypes.concreteTypeBuilder(typeStmt.getTypeDefinition(),
             ctx.getSchemaPath().get());
@@ -106,10 +105,8 @@ public final class LeafListEffectiveStatementImpl extends AbstractEffectiveDataS
 
     @Override
     public String toString() {
-        StringBuilder sb = new StringBuilder(LeafListEffectiveStatementImpl.class.getSimpleName());
-        sb.append("[");
-        sb.append(getQName());
-        sb.append("]");
-        return sb.toString();
+        return LeafListEffectiveStatementImpl.class.getSimpleName() + "[" +
+                getQName() +
+                "]";
     }
 }