From 8cda7f7d4a47df33bf1b1ce1f86642680a1f09f6 Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Tue, 11 Sep 2018 10:56:20 +0200 Subject: [PATCH] Fix warnings in rfc8040 support This fixes warnings reported in rfc8040-model-api and rfc8040-parser-support, and enables findbugs enforcement. Change-Id: I4ee91b65cc7f6ae11fffbdd3181d6470d9214c04 Signed-off-by: Robert Varga --- yang/rfc8040-model-api/pom.xml | 7 +++++++ yang/rfc8040-parser-support/pom.xml | 7 +++++++ .../rfc8040/parser/YangDataExtensionTest.java | 20 +++++++++---------- 3 files changed, 24 insertions(+), 10 deletions(-) diff --git a/yang/rfc8040-model-api/pom.xml b/yang/rfc8040-model-api/pom.xml index 92b2e99524..c4647ebb80 100644 --- a/yang/rfc8040-model-api/pom.xml +++ b/yang/rfc8040-model-api/pom.xml @@ -60,6 +60,13 @@ checkstyle.violationSeverity=error + + org.codehaus.mojo + findbugs-maven-plugin + + true + + diff --git a/yang/rfc8040-parser-support/pom.xml b/yang/rfc8040-parser-support/pom.xml index c3e785f8ae..cb86373ec5 100644 --- a/yang/rfc8040-parser-support/pom.xml +++ b/yang/rfc8040-parser-support/pom.xml @@ -66,6 +66,13 @@ checkstyle.violationSeverity=error + + org.codehaus.mojo + findbugs-maven-plugin + + true + + diff --git a/yang/rfc8040-parser-support/src/test/java/org/opendaylight/yangtools/rfc8040/parser/YangDataExtensionTest.java b/yang/rfc8040-parser-support/src/test/java/org/opendaylight/yangtools/rfc8040/parser/YangDataExtensionTest.java index 396de474c8..934e442b98 100644 --- a/yang/rfc8040-parser-support/src/test/java/org/opendaylight/yangtools/rfc8040/parser/YangDataExtensionTest.java +++ b/yang/rfc8040-parser-support/src/test/java/org/opendaylight/yangtools/rfc8040/parser/YangDataExtensionTest.java @@ -129,12 +129,12 @@ public class YangDataExtensionTest { final ContainerSchemaNode contInYangData = myYangDataNode.getContainerSchemaNode(); assertNotNull(contInYangData); assertTrue(contInYangData.isConfiguration()); - final ContainerSchemaNode innerCont = (ContainerSchemaNode) contInYangData.getDataChildByName( - QName.create(baz.getQNameModule(), "inner-cont")); + final ContainerSchemaNode innerCont = (ContainerSchemaNode) contInYangData.findDataChildByName( + QName.create(baz.getQNameModule(), "inner-cont")).get(); assertNotNull(innerCont); assertTrue(innerCont.isConfiguration()); - final ContainerSchemaNode grpCont = (ContainerSchemaNode) contInYangData.getDataChildByName( - QName.create(baz.getQNameModule(), "grp-cont")); + final ContainerSchemaNode grpCont = (ContainerSchemaNode) contInYangData.findDataChildByName( + QName.create(baz.getQNameModule(), "grp-cont")).get(); assertNotNull(grpCont); assertTrue(grpCont.isConfiguration()); } @@ -156,11 +156,11 @@ public class YangDataExtensionTest { final ContainerSchemaNode contInYangData = myYangDataNode.getContainerSchemaNode(); assertNotNull(contInYangData); - final ContainerSchemaNode innerCont = (ContainerSchemaNode) contInYangData.getDataChildByName( - QName.create(foobar.getQNameModule(), "inner-cont")); + final ContainerSchemaNode innerCont = (ContainerSchemaNode) contInYangData.findDataChildByName( + QName.create(foobar.getQNameModule(), "inner-cont")).get(); assertNotNull(innerCont); - final ContainerSchemaNode grpCont = (ContainerSchemaNode) contInYangData.getDataChildByName( - QName.create(foobar.getQNameModule(), "grp-cont")); + final ContainerSchemaNode grpCont = (ContainerSchemaNode) contInYangData.findDataChildByName( + QName.create(foobar.getQNameModule(), "grp-cont")).get(); assertNotNull(grpCont); } @@ -173,8 +173,8 @@ public class YangDataExtensionTest { assertNotNull(schemaContext); final Module bar = schemaContext.findModule("bar", REVISION).get(); - final ContainerSchemaNode cont = (ContainerSchemaNode) bar.getDataChildByName( - QName.create(bar.getQNameModule(), "cont")); + final ContainerSchemaNode cont = (ContainerSchemaNode) bar.findDataChildByName( + QName.create(bar.getQNameModule(), "cont")).get(); assertNotNull(cont); final Set extensions = schemaContext.getExtensions(); -- 2.36.6