Enforce checkstyle
- fix checkstyle errors
Change-Id: Icbe8769a22d7173fea54fa627097c7906315aef2
diff --git a/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangTranslatorOperatorNode.java b/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangTranslatorOperatorNode.java
index 424173f..a192d4b 100644
--- a/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangTranslatorOperatorNode.java
+++ b/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/YangTranslatorOperatorNode.java
@@ -1,4 +1,3 @@
-
/*
* Copyright 2016-present Open Networking Foundation
*
diff --git a/compiler/base/translator/src/main/java/org/onosproject/yang/compiler/translator/tojava/TempJavaFragmentFiles.java b/compiler/base/translator/src/main/java/org/onosproject/yang/compiler/translator/tojava/TempJavaFragmentFiles.java
index 783fcc3..46020f4 100644
--- a/compiler/base/translator/src/main/java/org/onosproject/yang/compiler/translator/tojava/TempJavaFragmentFiles.java
+++ b/compiler/base/translator/src/main/java/org/onosproject/yang/compiler/translator/tojava/TempJavaFragmentFiles.java
@@ -737,6 +737,7 @@
* @param attr attribute
* @param type type
* @param tempFiles temp fragment file
+ * @throws IOException on IO error
*/
static void addBitsHandler(JavaAttributeInfo attr, YangType type,
TempJavaFragmentFiles tempFiles)
diff --git a/compiler/base/translator/src/main/java/org/onosproject/yang/compiler/translator/tojava/YangJavaModelUtils.java b/compiler/base/translator/src/main/java/org/onosproject/yang/compiler/translator/tojava/YangJavaModelUtils.java
index 563ef1a..9924e49 100644
--- a/compiler/base/translator/src/main/java/org/onosproject/yang/compiler/translator/tojava/YangJavaModelUtils.java
+++ b/compiler/base/translator/src/main/java/org/onosproject/yang/compiler/translator/tojava/YangJavaModelUtils.java
@@ -532,6 +532,7 @@
*
* @param curNode current java node whose package string needs to be set
* @return returns the root package string
+ * @throws TranslatorException on error
*/
public static String getCurNodePackage(YangNode curNode)
throws TranslatorException {
diff --git a/compiler/base/translator/src/main/java/org/onosproject/yang/compiler/translator/tojava/utils/MethodsGenerator.java b/compiler/base/translator/src/main/java/org/onosproject/yang/compiler/translator/tojava/utils/MethodsGenerator.java
index 95f4f82..ba3e947 100644
--- a/compiler/base/translator/src/main/java/org/onosproject/yang/compiler/translator/tojava/utils/MethodsGenerator.java
+++ b/compiler/base/translator/src/main/java/org/onosproject/yang/compiler/translator/tojava/utils/MethodsGenerator.java
@@ -1171,6 +1171,7 @@
* Returns of method for enum class.
*
* @param className class name
+ * @param enumeration in yang
* @param type method body type
* @return of method
*/
@@ -1573,6 +1574,7 @@
* Returns to string method for typedef.
*
* @param attr attribute name
+ * @param type in yang
* @return to string method for typedef
*/
static String getToStringForType(String attr, YangType type) {
diff --git a/compiler/base/translator/src/main/java/org/onosproject/yang/compiler/translator/tojava/utils/StringGenerator.java b/compiler/base/translator/src/main/java/org/onosproject/yang/compiler/translator/tojava/utils/StringGenerator.java
index 7f0a2f3..7db59af 100644
--- a/compiler/base/translator/src/main/java/org/onosproject/yang/compiler/translator/tojava/utils/StringGenerator.java
+++ b/compiler/base/translator/src/main/java/org/onosproject/yang/compiler/translator/tojava/utils/StringGenerator.java
@@ -1060,8 +1060,9 @@
/**
* Returns string for service class.
*
- * @param name1 name of even listener class
- * @param name2 name of even class
+ * @param name1 name of event listener class
+ * @param type name of service
+ * @param name2 name of event class
* @return listener service string for service class
*/
static String getEventExtendsString(String name1, String type,
@@ -1090,6 +1091,7 @@
* Returns static modifier string.
*
* @param modifier modifier
+ * @param keyWord keyword
* @return static modifier string
*/
static String getSpecificModifier(String modifier, String keyWord) {
@@ -1377,6 +1379,7 @@
* @param name class name
* @param attrName attribute name
* @param attrType attribute type
+ * @param genType java file generation type
* @return setter string
*/
static String getSetterInterfaceString(String name,
diff --git a/compiler/plugin/utils/src/main/java/org/onosproject/yang/compiler/plugin/utils/package-info.java b/compiler/plugin/utils/src/main/java/org/onosproject/yang/compiler/plugin/utils/package-info.java
index 3ed076c..9804c50 100644
--- a/compiler/plugin/utils/src/main/java/org/onosproject/yang/compiler/plugin/utils/package-info.java
+++ b/compiler/plugin/utils/src/main/java/org/onosproject/yang/compiler/plugin/utils/package-info.java
@@ -1,9 +1,17 @@
/*
- * Copyright (c) 2017. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
- * Morbi non lorem porttitor neque feugiat blandit. Ut vitae ipsum eget quam lacinia accumsan.
- * Etiam sed turpis ac ipsum condimentum fringilla. Maecenas magna.
- * Proin dapibus sapien vel ante. Aliquam erat volutpat. Pellentesque sagittis ligula eget metus.
- * Vestibulum commodo. Ut rhoncus gravida arcu.
+ * Copyright 2017-present Open Networking Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
/**
diff --git a/compiler/plugin/utils/src/test/java/org/onosproject/yang/compiler/plugin/utils/ModelIdValidatorTest.java b/compiler/plugin/utils/src/test/java/org/onosproject/yang/compiler/plugin/utils/ModelIdValidatorTest.java
index f3e3c60..12ea1bc 100644
--- a/compiler/plugin/utils/src/test/java/org/onosproject/yang/compiler/plugin/utils/ModelIdValidatorTest.java
+++ b/compiler/plugin/utils/src/test/java/org/onosproject/yang/compiler/plugin/utils/ModelIdValidatorTest.java
@@ -1,11 +1,18 @@
/*
- * Copyright (c) 2017. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
- * Morbi non lorem porttitor neque feugiat blandit. Ut vitae ipsum eget quam lacinia accumsan.
- * Etiam sed turpis ac ipsum condimentum fringilla. Maecenas magna.
- * Proin dapibus sapien vel ante. Aliquam erat volutpat. Pellentesque sagittis ligula eget metus.
- * Vestibulum commodo. Ut rhoncus gravida arcu.
+ * Copyright 2017-present Open Networking Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
-
package org.onosproject.yang.compiler.plugin.utils;
import org.junit.Test;
diff --git a/model/src/main/java/org/onosproject/yang/model/RpcInput.java b/model/src/main/java/org/onosproject/yang/model/RpcInput.java
index af86cb1..a127314 100644
--- a/model/src/main/java/org/onosproject/yang/model/RpcInput.java
+++ b/model/src/main/java/org/onosproject/yang/model/RpcInput.java
@@ -33,7 +33,7 @@
*/
private DataNode data;
- /**
+ /*
* TODO
* Any other meta data or contextual information
* to help the RPC execution can be here.
diff --git a/model/src/test/java/org/onosproject/yang/model/ResourceIdTest.java b/model/src/test/java/org/onosproject/yang/model/ResourceIdTest.java
index f6fb475..fd203aa 100644
--- a/model/src/test/java/org/onosproject/yang/model/ResourceIdTest.java
+++ b/model/src/test/java/org/onosproject/yang/model/ResourceIdTest.java
@@ -1,11 +1,18 @@
/*
- * Copyright (c) 2016. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
- * Morbi non lorem porttitor neque feugiat blandit. Ut vitae ipsum eget quam lacinia accumsan.
- * Etiam sed turpis ac ipsum condimentum fringilla. Maecenas magna.
- * Proin dapibus sapien vel ante. Aliquam erat volutpat. Pellentesque sagittis ligula eget metus.
- * Vestibulum commodo. Ut rhoncus gravida arcu.
+ * Copyright 2016-present Open Networking Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
-
package org.onosproject.yang.model;
import org.junit.Before;
diff --git a/pom.xml b/pom.xml
index 598d3ea..0a06f06 100644
--- a/pom.xml
+++ b/pom.xml
@@ -30,7 +30,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <onos-build-conf.version>1.3</onos-build-conf.version>
+ <onos-build-conf.version>1.12.0</onos-build-conf.version>
<guava.version>22.0</guava.version>
</properties>
@@ -126,13 +126,14 @@
<testSourceDirectory>${project.build.testSourceDirectory}
</testSourceDirectory>
<!-- end: workaround for unexpected NullPointerException on Eclipse -->
- <configLocation>onos/checkstyle.xml</configLocation>
+ <configLocation>onos/checkstyle-mvn.xml</configLocation>
<suppressionsLocation>onos/suppressions.xml
</suppressionsLocation>
<failsOnError>false</failsOnError>
<logViolationsToConsole>true</logViolationsToConsole>
<includeTestSourceDirectory>true
</includeTestSourceDirectory>
+ <headerLocation>onos/apache2-java.header</headerLocation>
</configuration>
<executions>
<execution>
diff --git a/runtime/src/main/java/org/onosproject/yang/runtime/SerializerHelper.java b/runtime/src/main/java/org/onosproject/yang/runtime/SerializerHelper.java
index ecd1c3c..ee8de3d 100644
--- a/runtime/src/main/java/org/onosproject/yang/runtime/SerializerHelper.java
+++ b/runtime/src/main/java/org/onosproject/yang/runtime/SerializerHelper.java
@@ -540,6 +540,7 @@
* @param name name of the child node
* @param namespace namespace of the child node
* @return schema context
+ * @throws IllegalArgumentException on argument error
*/
public static SchemaContext getChildSchemaContext(
SchemaContext context, String name, String namespace)
diff --git a/runtime/src/main/java/org/onosproject/yang/runtime/impl/DataTreeBuilderHelper.java b/runtime/src/main/java/org/onosproject/yang/runtime/impl/DataTreeBuilderHelper.java
index 80fc2f3..6d88dbc 100644
--- a/runtime/src/main/java/org/onosproject/yang/runtime/impl/DataTreeBuilderHelper.java
+++ b/runtime/src/main/java/org/onosproject/yang/runtime/impl/DataTreeBuilderHelper.java
@@ -132,6 +132,7 @@
* @param curSchema current root node schema
* @param builder data node builder
* @param obj current root object
+ * @return data node builder
*/
DataNode.Builder getDataTree(YangSchemaNode curSchema, DataNode.Builder builder,
Object obj) {
@@ -903,6 +904,7 @@
*
* @param leafListVal set of values
* @param leafList YANG leaf list
+ * @return node builders for leaf list or null
*/
List<DataNode.Builder> addLeafList(Set<Object> leafListVal,
YangLeafList leafList) {
@@ -965,6 +967,7 @@
*
* @param yangLeaf YANG leaf
* @param val value for the leaf
+ * @return datanode builder created
*/
DataNode.Builder createLeafNode(YangLeaf yangLeaf, Object val) {
String valNamespace = getValNamespace(val, yangLeaf);
diff --git a/runtime/src/main/java/org/onosproject/yang/runtime/impl/ModIdToRscIdConverter.java b/runtime/src/main/java/org/onosproject/yang/runtime/impl/ModIdToRscIdConverter.java
index 06e19eb..3ebf5c4 100644
--- a/runtime/src/main/java/org/onosproject/yang/runtime/impl/ModIdToRscIdConverter.java
+++ b/runtime/src/main/java/org/onosproject/yang/runtime/impl/ModIdToRscIdConverter.java
@@ -145,6 +145,7 @@
* the module schema fetchNode from model registry.
*
* @param pkg package for child node
+ * @return first matching module schema
*/
YangSchemaNode fetchModuleNode(String pkg) {
YangSchemaNode modNode;
diff --git a/runtime/src/main/java/org/onosproject/yang/runtime/impl/ModelConverterUtil.java b/runtime/src/main/java/org/onosproject/yang/runtime/impl/ModelConverterUtil.java
index 8a9cfa2..ade1435 100644
--- a/runtime/src/main/java/org/onosproject/yang/runtime/impl/ModelConverterUtil.java
+++ b/runtime/src/main/java/org/onosproject/yang/runtime/impl/ModelConverterUtil.java
@@ -260,6 +260,7 @@
*
* @param holder leaf/leaf-list holder
* @param holderObj leaf/leaf-list holder object
+ * @param leaf leaf schema object?
* @param name leaf/leaf-list name
* @param fieldObj object of the leaf/leaf-list field
* @param dataType type of the leaf/leaf-list
diff --git a/runtime/src/main/java/org/onosproject/yang/runtime/impl/YobLeafListNodeHandler.java b/runtime/src/main/java/org/onosproject/yang/runtime/impl/YobLeafListNodeHandler.java
index 04d2d51..4157a06 100644
--- a/runtime/src/main/java/org/onosproject/yang/runtime/impl/YobLeafListNodeHandler.java
+++ b/runtime/src/main/java/org/onosproject/yang/runtime/impl/YobLeafListNodeHandler.java
@@ -57,8 +57,10 @@
/**
* Builds the object.
*
+ * @param curWorkbench current work bench
* @param registry YANG schema registry
*/
+ @Override
void buildObject(YobWorkBench curWorkbench,
YangModelRegistry registry) {
// For multi instance leaf no need to build an object.
diff --git a/runtime/src/main/java/org/onosproject/yang/runtime/impl/YobLeafNodeHandler.java b/runtime/src/main/java/org/onosproject/yang/runtime/impl/YobLeafNodeHandler.java
index 51eea48..2079b1d 100644
--- a/runtime/src/main/java/org/onosproject/yang/runtime/impl/YobLeafNodeHandler.java
+++ b/runtime/src/main/java/org/onosproject/yang/runtime/impl/YobLeafNodeHandler.java
@@ -54,8 +54,10 @@
/**
* Builds the object.
*
+ * @param curWorkbench current workbench
* @param registry YANG schema registry
*/
+ @Override
void buildObject(YobWorkBench curWorkbench,
YangModelRegistry registry) {
// For single instance leaf no need to build an object.
diff --git a/runtime/src/main/java/org/onosproject/yang/runtime/impl/YobListener.java b/runtime/src/main/java/org/onosproject/yang/runtime/impl/YobListener.java
index 714c5a5..9dd69a7 100644
--- a/runtime/src/main/java/org/onosproject/yang/runtime/impl/YobListener.java
+++ b/runtime/src/main/java/org/onosproject/yang/runtime/impl/YobListener.java
@@ -63,6 +63,7 @@
/**
* Creates an instance of YANG object builder listener.
*
+ * @param node last index schema node
* @param reg YANG model registry
*/
public YobListener(YangSchemaNode node, DefaultYangModelRegistry reg) {
diff --git a/runtime/src/main/java/org/onosproject/yang/runtime/impl/YobUtils.java b/runtime/src/main/java/org/onosproject/yang/runtime/impl/YobUtils.java
index 3f10d34..529e728 100644
--- a/runtime/src/main/java/org/onosproject/yang/runtime/impl/YobUtils.java
+++ b/runtime/src/main/java/org/onosproject/yang/runtime/impl/YobUtils.java
@@ -674,6 +674,7 @@
* Returns key leaf schema.
*
* @param keyleaf key leaf
+ * @param node to look in
* @return node YANG schema node
*/
static YangLeaf getKeyLeafSchema(KeyLeaf keyleaf, YangSchemaNode
@@ -699,6 +700,8 @@
* @param node YANG node
* @param key node key
* @return model object id builder
+ * @param <T> list class type
+ * @param <K> key type
*/
static <T extends InnerModelObject & MultiInstanceObject<K>,
K extends KeyInfo<T>> ModelObjectId.Builder handleListKey(
diff --git a/runtime/src/test/java/org/onosproject/yang/runtime/impl/serializerhelper/CheckEnumKeyValidationTest.java b/runtime/src/test/java/org/onosproject/yang/runtime/impl/serializerhelper/CheckEnumKeyValidationTest.java
index 9f85ff7..11cff99 100644
--- a/runtime/src/test/java/org/onosproject/yang/runtime/impl/serializerhelper/CheckEnumKeyValidationTest.java
+++ b/runtime/src/test/java/org/onosproject/yang/runtime/impl/serializerhelper/CheckEnumKeyValidationTest.java
@@ -1,3 +1,18 @@
+/*
+ * Copyright 2017-present Open Networking Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.onosproject.yang.runtime.impl.serializerhelper;
import org.junit.Test;
diff --git a/runtime/src/test/java/org/onosproject/yang/runtime/impl/serializerhelper/CheckEnumValidationTest.java b/runtime/src/test/java/org/onosproject/yang/runtime/impl/serializerhelper/CheckEnumValidationTest.java
index 0870025..0e93b29 100644
--- a/runtime/src/test/java/org/onosproject/yang/runtime/impl/serializerhelper/CheckEnumValidationTest.java
+++ b/runtime/src/test/java/org/onosproject/yang/runtime/impl/serializerhelper/CheckEnumValidationTest.java
@@ -1,3 +1,18 @@
+/*
+ * Copyright 2017-present Open Networking Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.onosproject.yang.runtime.impl.serializerhelper;
import org.junit.Test;
diff --git a/serializers/utils/src/main/java/org/onosproject/yang/serializers/utils/package-info.java b/serializers/utils/src/main/java/org/onosproject/yang/serializers/utils/package-info.java
index 65d177b..257fe99 100644
--- a/serializers/utils/src/main/java/org/onosproject/yang/serializers/utils/package-info.java
+++ b/serializers/utils/src/main/java/org/onosproject/yang/serializers/utils/package-info.java
@@ -1,9 +1,17 @@
/*
- * Copyright (c) 2017. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
- * Morbi non lorem porttitor neque feugiat blandit. Ut vitae ipsum eget quam lacinia accumsan.
- * Etiam sed turpis ac ipsum condimentum fringilla. Maecenas magna.
- * Proin dapibus sapien vel ante. Aliquam erat volutpat. Pellentesque sagittis ligula eget metus.
- * Vestibulum commodo. Ut rhoncus gravida arcu.
+ * Copyright 2017-present Open Networking Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
/**
diff --git a/serializers/xml/src/main/java/org/onosproject/yang/serializers/xml/XmlSerializerHandler.java b/serializers/xml/src/main/java/org/onosproject/yang/serializers/xml/XmlSerializerHandler.java
index 214eda1..3a0ee25 100644
--- a/serializers/xml/src/main/java/org/onosproject/yang/serializers/xml/XmlSerializerHandler.java
+++ b/serializers/xml/src/main/java/org/onosproject/yang/serializers/xml/XmlSerializerHandler.java
@@ -35,7 +35,9 @@
/**
* Sets the namespace and tag name in element tree maintained in stack.
*
+ * @param dataNode data node
* @param elementStack element tree stack
+ * @return Element
*/
Element processXmlContext(DataNode dataNode,
Stack<Element> elementStack) {
@@ -49,6 +51,7 @@
* Returns the new element name by updating tag name and namespace.
*
* @param node YDT context node
+ * @param elementStack dom elements
* @return new element name by updating tag name and namespace
*/
Element updateNameAndNamespace(DataNode node,
diff --git a/serializers/xml/src/main/java/org/onosproject/yang/serializers/xml/XmlSerializerListener.java b/serializers/xml/src/main/java/org/onosproject/yang/serializers/xml/XmlSerializerListener.java
index 67832d3..2391a84 100644
--- a/serializers/xml/src/main/java/org/onosproject/yang/serializers/xml/XmlSerializerListener.java
+++ b/serializers/xml/src/main/java/org/onosproject/yang/serializers/xml/XmlSerializerListener.java
@@ -71,7 +71,7 @@
}
/**
- * Sets the composite data node builder.
+ * Returns the composite data node builder.
*
* @return composite data builder
*/
@@ -80,9 +80,9 @@
}
/**
- * Returns composite data builder.
+ * Sets composite data builder.
*
- * @return composite data builder
+ * @param cBuilder composite data builder
*/
public void cBuilder(CompositeData.Builder cBuilder) {
this.cBuilder = cBuilder;