Whitebox issue fix
Change-Id: I856266e26d2686affb9271c460927ba3e0e07db2
diff --git a/src/main/java/org/onosproject/yangutils/utils/io/impl/FileSystemUtil.java b/src/main/java/org/onosproject/yangutils/utils/io/impl/FileSystemUtil.java
index 3765f71..ffc36f7 100644
--- a/src/main/java/org/onosproject/yangutils/utils/io/impl/FileSystemUtil.java
+++ b/src/main/java/org/onosproject/yangutils/utils/io/impl/FileSystemUtil.java
@@ -53,7 +53,6 @@
* @return existence status of package
*/
public static boolean doesPackageExist(String pkg) {
-
File pkgDir = new File(getPackageDirPathFromJavaJPackage(pkg));
File pkgWithFile = new File(pkgDir + SLASH + "package-info.java");
if (pkgDir.exists() && pkgWithFile.isFile()) {
@@ -70,7 +69,6 @@
* @throws IOException any IO exception
*/
public static void createPackage(String pkg, String pkgInfo) throws IOException {
-
if (!doesPackageExist(pkg)) {
try {
File pack = createDirectories(pkg);
@@ -92,9 +90,7 @@
* @throws IOException any IO errors
*/
public static void appendFileContents(File toAppend, File srcFile) throws IOException {
-
updateFileHandle(srcFile, NEW_LINE + readAppendFile(toAppend.toString(), FOUR_SPACE_INDENTATION), false);
- return;
}
/**
@@ -106,7 +102,6 @@
* @throws IOException when fails to convert to string
*/
public static String readAppendFile(String toAppend, String spaces) throws IOException {
-
FileReader fileReader = new FileReader(toAppend);
BufferedReader bufferReader = new BufferedReader(fileReader);
try {
@@ -114,8 +109,8 @@
String line = bufferReader.readLine();
while (line != null) {
- if (line.equals(SPACE) | line.equals(EMPTY_STRING) | line.equals(EIGHT_SPACE_INDENTATION)
- | line.equals(MULTIPLE_NEW_LINE)) {
+ if (line.equals(SPACE) || line.equals(EMPTY_STRING) || line.equals(EIGHT_SPACE_INDENTATION)
+ || line.equals(MULTIPLE_NEW_LINE)) {
stringBuilder.append(NEW_LINE);
} else if (line.equals(FOUR_SPACE_INDENTATION)) {
stringBuilder.append(EMPTY_STRING);
@@ -142,7 +137,6 @@
* does not exist but cannot be created, or cannot be opened for any other reason
*/
public static void updateFileHandle(File inputFile, String contentTobeAdded, boolean isClose) throws IOException {
-
FileWriter fileWriter = new FileWriter(inputFile, true);
PrintWriter outputPrintWriter = new PrintWriter(fileWriter, true);
if (!isClose) {
diff --git a/src/main/java/org/onosproject/yangutils/utils/io/impl/JavaDocGen.java b/src/main/java/org/onosproject/yangutils/utils/io/impl/JavaDocGen.java
index 982cbc4..c76ecad 100644
--- a/src/main/java/org/onosproject/yangutils/utils/io/impl/JavaDocGen.java
+++ b/src/main/java/org/onosproject/yangutils/utils/io/impl/JavaDocGen.java
@@ -17,7 +17,6 @@
package org.onosproject.yangutils.utils.io.impl;
import org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax;
-import org.onosproject.yangutils.utils.UtilConstants;
import static org.onosproject.yangutils.utils.UtilConstants.BUILDER;
import static org.onosproject.yangutils.utils.UtilConstants.BUILDER_CLASS_JAVA_DOC;
@@ -62,7 +61,7 @@
/**
* JavaDocs types.
*/
- public static enum JavaDocType {
+ public enum JavaDocType {
/**
* For class.
@@ -141,7 +140,7 @@
public static String getJavaDoc(JavaDocType type, String name, boolean isList) {
name = JavaIdentifierSyntax.getSmallCase(JavaIdentifierSyntax.getCamelCase(name, null));
- String javaDoc = UtilConstants.EMPTY_STRING;
+ String javaDoc;
if (type.equals(JavaDocType.IMPL_CLASS)) {
javaDoc = generateForImplClass(name);
} else if (type.equals(JavaDocType.BUILDER_CLASS)) {