Remove dead code 02/14102/2
authorRobert Varga <rovarga@cisco.com>
Mon, 12 Jan 2015 11:58:03 +0000 (12:58 +0100)
committerRobert Varga <rovarga@cisco.com>
Thu, 15 Jan 2015 10:11:46 +0000 (11:11 +0100)
The moduleIdentity reference is checked for non-null in a preceding condition,
so the entire branch is provably dead. Also removes string
concatenation.

Change-Id: I8c2ad967af53a5216359677b8d7e3975294c942b
Signed-off-by: Robert Varga <rovarga@cisco.com>
opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/ModuleMXBeanEntryBuilder.java

index 2ab60e8c878138e89c1688c4a23678622b66487a..0199e8cd1792a6d714d4968796b1ed4eca45811c 100644 (file)
@@ -249,15 +249,10 @@ final class ModuleMXBeanEntryBuilder {
         String moduleLocalNameFromXPath = matcher.group(1);
         IdentitySchemaNode moduleIdentity = moduleIdentities.get(moduleLocalNameFromXPath);
         unaugmentedModuleIdentities.remove(moduleLocalNameFromXPath);
-        checkState(moduleIdentity != null, "Cannot find identity " + moduleLocalNameFromXPath
-                + " matching augmentation " + augmentation);
+        checkState(moduleIdentity != null, "Cannot find identity %s matching augmentation %s", moduleLocalNameFromXPath, augmentation);
         Map<String, QName> providedServices = findProvidedServices(moduleIdentity, currentModule, qNamesToSIEs,
                 schemaContext);
 
-        if (moduleIdentity == null) {
-            throw new IllegalStateException("Cannot find identity specified by augmentation xpath constraint: "
-                    + moduleLocalNameFromXPath + " of " + augmentation);
-        }
         String javaNamePrefix = TypeProviderWrapper.findJavaNamePrefix(moduleIdentity);
 
         Map<String, AttributeIfc> yangToAttributes = null;