Use String concatenation instead of StringBuffer/Builder
[yangtools.git] / yang / yang-parser-impl / src / main / java / org / opendaylight / yangtools / yang / parser / builder / impl / UsesNodeImpl.java
index 3da4263c6b429aee3c0f7ff3aa7a56a6dfb1ef4c..889f2df3e48e57994046a0064c7e3a02e1f2a737 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013-2015 Cisco Systems, Inc. and others.  All rights reserved.
+ * Copyright (c) 20132015 Cisco Systems, Inc. and others.  All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
@@ -12,6 +12,7 @@ import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.ImmutableSet;
 import java.util.List;
 import java.util.Map;
+import java.util.Objects;
 import java.util.Set;
 import org.opendaylight.yangtools.yang.model.api.AugmentationSchema;
 import org.opendaylight.yangtools.yang.model.api.SchemaNode;
@@ -19,6 +20,10 @@ import org.opendaylight.yangtools.yang.model.api.SchemaPath;
 import org.opendaylight.yangtools.yang.model.api.UnknownSchemaNode;
 import org.opendaylight.yangtools.yang.model.api.UsesNode;
 
+/**
+ * @deprecated Pre-Beryllium implementation, scheduled for removal.
+ */
+@Deprecated
 final class UsesNodeImpl implements UsesNode {
     private final SchemaPath groupingPath;
     ImmutableSet<AugmentationSchema> augmentations;
@@ -67,8 +72,8 @@ final class UsesNodeImpl implements UsesNode {
     public int hashCode() {
         final int prime = 31;
         int result = 1;
-        result = prime * result + ((groupingPath == null) ? 0 : groupingPath.hashCode());
-        result = prime * result + ((augmentations == null) ? 0 : augmentations.hashCode());
+        result = prime * result + Objects.hashCode(groupingPath);
+        result = prime * result + Objects.hashCode(augmentations);
         return result;
     }
 
@@ -103,10 +108,8 @@ final class UsesNodeImpl implements UsesNode {
 
     @Override
     public String toString() {
-        StringBuilder sb = new StringBuilder(UsesNodeImpl.class.getSimpleName());
-        sb.append("[groupingPath=");
-        sb.append(groupingPath);
-        sb.append("]");
-        return sb.toString();
+        return UsesNodeImpl.class.getSimpleName() + "[groupingPath=" +
+                groupingPath +
+                "]";
     }
-}
\ No newline at end of file
+}