diff --git a/src/main/java/org/onosproject/yangutils/datamodel/ResolutionType.java b/src/main/java/org/onosproject/yangutils/datamodel/ResolutionType.java
index aa0abbb..e69492a 100644
--- a/src/main/java/org/onosproject/yangutils/datamodel/ResolutionType.java
+++ b/src/main/java/org/onosproject/yangutils/datamodel/ResolutionType.java
@@ -28,5 +28,5 @@
     /**
      * Identifies that resolution is for grouping.
      */
-    GROUPING_RESOLUTION;
+    GROUPING_RESOLUTION
 }
diff --git a/src/main/java/org/onosproject/yangutils/datamodel/YangCase.java b/src/main/java/org/onosproject/yangutils/datamodel/YangCase.java
index 48f5d17..e61d273 100644
--- a/src/main/java/org/onosproject/yangutils/datamodel/YangCase.java
+++ b/src/main/java/org/onosproject/yangutils/datamodel/YangCase.java
@@ -286,7 +286,7 @@
      */
     @Override
     public YangConstructType getYangConstructType() {
-        return YangConstructType.CASE_DATA;
+        return CASE_DATA;
     }
 
     /**
@@ -311,7 +311,7 @@
 
     @Override
     public void detectCollidingChild(String identifierName, YangConstructType dataType) throws DataModelException {
-        if (getParent() == null || !(getParent() instanceof YangChoice)) {
+        if (!(getParent() instanceof YangChoice)) {
             throw new DataModelException("Internal Data Model Tree Error: Invalid/Missing holder in case " +
                     getName());
         }
diff --git a/src/main/java/org/onosproject/yangutils/datamodel/YangChoice.java b/src/main/java/org/onosproject/yangutils/datamodel/YangChoice.java
index 43a486f..f05a11c 100644
--- a/src/main/java/org/onosproject/yangutils/datamodel/YangChoice.java
+++ b/src/main/java/org/onosproject/yangutils/datamodel/YangChoice.java
@@ -277,11 +277,11 @@
     /**
      * Returns the type of the data.
      *
-     * @return returns CHOICE_DATA
+     * @return choice data
      */
     @Override
     public YangConstructType getYangConstructType() {
-        return YangConstructType.CHOICE_DATA;
+        return CHOICE_DATA;
     }
 
     /**
diff --git a/src/main/java/org/onosproject/yangutils/datamodel/YangEntityToResolveInfo.java b/src/main/java/org/onosproject/yangutils/datamodel/YangEntityToResolveInfo.java
index 7e3d819..aa95899 100644
--- a/src/main/java/org/onosproject/yangutils/datamodel/YangEntityToResolveInfo.java
+++ b/src/main/java/org/onosproject/yangutils/datamodel/YangEntityToResolveInfo.java
@@ -72,7 +72,7 @@
         }
 
         String prefix;
-        T entityToResolve = (T) getEntityToResolve();
+        T entityToResolve = getEntityToResolve();
         if (entityToResolve instanceof YangType) {
             prefix = ((YangType<?>) entityToResolve).getPrefix();
         } else if (entityToResolve instanceof YangUses) {
diff --git a/src/main/java/org/onosproject/yangutils/datamodel/YangNodeIdentifier.java b/src/main/java/org/onosproject/yangutils/datamodel/YangNodeIdentifier.java
index 871b683..512b104 100644
--- a/src/main/java/org/onosproject/yangutils/datamodel/YangNodeIdentifier.java
+++ b/src/main/java/org/onosproject/yangutils/datamodel/YangNodeIdentifier.java
@@ -22,10 +22,10 @@
 public class YangNodeIdentifier {
 
     // Name of the node.
-    String name;
+    private String name;
 
     // Prefix of the node.
-    String prefix;
+    private String prefix;
 
     /**
      * Creates an instance of YANG node identifier.
diff --git a/src/main/java/org/onosproject/yangutils/datamodel/YangRangeRestriction.java b/src/main/java/org/onosproject/yangutils/datamodel/YangRangeRestriction.java
index 38b48bd..39c2cb5 100644
--- a/src/main/java/org/onosproject/yangutils/datamodel/YangRangeRestriction.java
+++ b/src/main/java/org/onosproject/yangutils/datamodel/YangRangeRestriction.java
@@ -118,7 +118,7 @@
         if (getAscendingRangeIntervals() == null) {
             throw new DataModelException("No range restriction info");
         }
-        if (getAscendingRangeIntervals().size() == 0) {
+        if (getAscendingRangeIntervals().isEmpty()) {
             throw new DataModelException("No range interval info");
         }
         return getAscendingRangeIntervals().get(0).getStartValue();
@@ -134,7 +134,7 @@
         if (getAscendingRangeIntervals() == null) {
             throw new DataModelException("No range restriction info");
         }
-        if (getAscendingRangeIntervals().size() == 0) {
+        if (getAscendingRangeIntervals().isEmpty()) {
             throw new DataModelException("No range interval info");
         }
         return getAscendingRangeIntervals()
@@ -184,7 +184,7 @@
     public boolean isValidValueString(String valueInString) throws DataModelException {
 
         if (getAscendingRangeIntervals() == null
-                || getAscendingRangeIntervals().size() == 0) {
+                || getAscendingRangeIntervals().isEmpty()) {
             // Throw exception, At least one default range needs to be set in constructor or in linker.
             throw new DataModelException("Range interval missing in range restriction.");
 
diff --git a/src/main/java/org/onosproject/yangutils/datamodel/YangResolutionInfo.java b/src/main/java/org/onosproject/yangutils/datamodel/YangResolutionInfo.java
index 9f54254..1d7fb9a 100644
--- a/src/main/java/org/onosproject/yangutils/datamodel/YangResolutionInfo.java
+++ b/src/main/java/org/onosproject/yangutils/datamodel/YangResolutionInfo.java
@@ -450,8 +450,6 @@
             }
             curNode = curNode.getNextSibling();
         }
-
-        return;
     }
 
     /**
diff --git a/src/main/java/org/onosproject/yangutils/datamodel/YangType.java b/src/main/java/org/onosproject/yangutils/datamodel/YangType.java
index 5b18fac..2a0c878 100644
--- a/src/main/java/org/onosproject/yangutils/datamodel/YangType.java
+++ b/src/main/java/org/onosproject/yangutils/datamodel/YangType.java
@@ -21,6 +21,7 @@
 import org.onosproject.yangutils.utils.YangConstructType;
 
 import static org.onosproject.yangutils.datamodel.ResolvableStatus.INTRA_FILE_RESOLVED;
+import static org.onosproject.yangutils.datamodel.YangDataTypes.DERIVED;
 
 /*
  * Reference:RFC 6020.
@@ -294,20 +295,18 @@
     }
 
     @Override
-    public void resolve() {
+    public void resolve() throws DataModelException {
        /*
        Inherit the Restriction from the referred typedef definition.
         */
-        if (getDataType() != YangDataTypes.DERIVED) {
-            throw new RuntimeException("Resolve should only be called for derrived data types");
+        if (getDataType() != DERIVED) {
+            throw new DataModelException("Resolve should only be called for derived data types");
         }
 
         YangDerivedInfo<?> derrivedInfo = (YangDerivedInfo<?>) getDataTypeExtendedInfo();
         YangType<?> baseType = derrivedInfo.getReferredTypeDef().getTypeDefBaseType();
-        if (YangDataTypes.DERIVED == baseType.getDataType()) {
-            if (baseType.getResolvableStatus() == INTRA_FILE_RESOLVED) {
+        if (DERIVED == baseType.getDataType() && baseType.getResolvableStatus() == INTRA_FILE_RESOLVED) {
                 setResolvableStatus(INTRA_FILE_RESOLVED);
-            }
         }
         //TODO:
     }
diff --git a/src/main/java/org/onosproject/yangutils/parser/impl/listeners/AugmentListener.java b/src/main/java/org/onosproject/yangutils/parser/impl/listeners/AugmentListener.java
index 57eea99..68a1b36 100644
--- a/src/main/java/org/onosproject/yangutils/parser/impl/listeners/AugmentListener.java
+++ b/src/main/java/org/onosproject/yangutils/parser/impl/listeners/AugmentListener.java
@@ -224,6 +224,5 @@
      */
     private static void validateForChildNodes() {
         //TODO: implement with linker.
-        return;
     }
 }
diff --git a/src/main/java/org/onosproject/yangutils/parser/impl/listeners/BaseFileListener.java b/src/main/java/org/onosproject/yangutils/parser/impl/listeners/BaseFileListener.java
index 7b41b77..f08fe6f 100644
--- a/src/main/java/org/onosproject/yangutils/parser/impl/listeners/BaseFileListener.java
+++ b/src/main/java/org/onosproject/yangutils/parser/impl/listeners/BaseFileListener.java
@@ -80,8 +80,8 @@
         checkStackIsNotEmpty(listener, MISSING_HOLDER, YANGBASE_DATA, "", EXIT);
 
         // Data Model tree root node is set.
-        if ((listener.getParsedDataStack().peek() instanceof YangModule)
-                || (listener.getParsedDataStack().peek() instanceof YangSubModule)) {
+        if (listener.getParsedDataStack().peek() instanceof YangModule
+                || listener.getParsedDataStack().peek() instanceof YangSubModule) {
             listener.setRootNode((YangNode) listener.getParsedDataStack().pop());
         } else {
             throw new ParserException(constructListenerErrorMessage(INVALID_CHILD, YANGBASE_DATA, "", EXIT));
diff --git a/src/main/java/org/onosproject/yangutils/parser/impl/listeners/BitListener.java b/src/main/java/org/onosproject/yangutils/parser/impl/listeners/BitListener.java
index ddd08f3..16523c9 100644
--- a/src/main/java/org/onosproject/yangutils/parser/impl/listeners/BitListener.java
+++ b/src/main/java/org/onosproject/yangutils/parser/impl/listeners/BitListener.java
@@ -137,7 +137,7 @@
             switch (tmpNode.getYangConstructType()) {
                 case BITS_DATA: {
                     YangBits yangBits = (YangBits) tmpNode;
-                    if ((ctx.bitBodyStatement() == null) || (ctx.bitBodyStatement().positionStatement() == null)) {
+                    if (ctx.bitBodyStatement() == null || ctx.bitBodyStatement().positionStatement() == null) {
                         int maxPosition = 0;
                         boolean isPositionPresent = false;
 
diff --git a/src/main/java/org/onosproject/yangutils/parser/impl/listeners/EnumListener.java b/src/main/java/org/onosproject/yangutils/parser/impl/listeners/EnumListener.java
index 103a7ee..ad2988d 100644
--- a/src/main/java/org/onosproject/yangutils/parser/impl/listeners/EnumListener.java
+++ b/src/main/java/org/onosproject/yangutils/parser/impl/listeners/EnumListener.java
@@ -131,7 +131,7 @@
             switch (tmpNode.getYangConstructType()) {
                 case ENUMERATION_DATA: {
                     YangEnumeration yangEnumeration = (YangEnumeration) tmpNode;
-                    if ((ctx.enumStatementBody() == null) || (ctx.enumStatementBody().valueStatement() == null)) {
+                    if (ctx.enumStatementBody() == null || ctx.enumStatementBody().valueStatement() == null) {
                         int maxValue = 0;
                         boolean isValuePresent = false;
 
diff --git a/src/main/java/org/onosproject/yangutils/parser/impl/listeners/LengthRestrictionListener.java b/src/main/java/org/onosproject/yangutils/parser/impl/listeners/LengthRestrictionListener.java
index 51a29d5..e3cd47f 100644
--- a/src/main/java/org/onosproject/yangutils/parser/impl/listeners/LengthRestrictionListener.java
+++ b/src/main/java/org/onosproject/yangutils/parser/impl/listeners/LengthRestrictionListener.java
@@ -73,6 +73,8 @@
 
     private static final String PIPE = "|";
     private static final String LENGTH_INTERVAL = "..";
+    private static final int MAX_RANGE_BOUNDARY = 2;
+    private static final int MIN_RANGE_BOUNDARY = 1;
 
     /**
      * Creates a new length restriction listener.
@@ -114,7 +116,8 @@
                                             GeneratedYangParser.LengthStatementContext ctx) {
 
         YangStringRestriction stringRestriction;
-        YangBuiltInDataTypeInfo<?> startValue, endValue;
+        YangBuiltInDataTypeInfo<?> startValue;
+        YangBuiltInDataTypeInfo<?> endValue;
         YangRangeRestriction lengthRestriction = new YangRangeRestriction<>();
 
         if (type.getDataType() != YangDataTypes.STRING && type.getDataType() != YangDataTypes.DERIVED) {
@@ -148,11 +151,12 @@
         String[] rangeArguments = rangeArgument.trim().split(Pattern.quote(PIPE));
 
         for (String rangePart : rangeArguments) {
-            String startInterval, endInterval;
+            String startInterval;
+            String endInterval;
             YangRangeInterval rangeInterval = new YangRangeInterval<>();
             String[] rangeBoundary = rangePart.trim().split(Pattern.quote(LENGTH_INTERVAL));
 
-            if (rangeBoundary.length > 2) {
+            if (rangeBoundary.length > MAX_RANGE_BOUNDARY) {
                 ParserException parserException = new ParserException("YANG file error : " +
                         YangConstructType.getYangConstructType(LENGTH_DATA) + " " + rangeArgument +
                         " is not valid.");
@@ -161,7 +165,7 @@
                 throw parserException;
             }
 
-            if (rangeBoundary.length == 1) {
+            if (rangeBoundary.length == MIN_RANGE_BOUNDARY) {
                 startInterval = rangeBoundary[0];
                 endInterval = rangeBoundary[0];
             } else {
diff --git a/src/main/java/org/onosproject/yangutils/parser/impl/listeners/RangeRestrictionListener.java b/src/main/java/org/onosproject/yangutils/parser/impl/listeners/RangeRestrictionListener.java
index 46bc67a..e4e5485 100644
--- a/src/main/java/org/onosproject/yangutils/parser/impl/listeners/RangeRestrictionListener.java
+++ b/src/main/java/org/onosproject/yangutils/parser/impl/listeners/RangeRestrictionListener.java
@@ -70,6 +70,8 @@
 
     private static final String PIPE = "|";
     private static final String RANGE_INTERVAL = "..";
+    private static final int MAX_RANGE_BOUNDARY = 2;
+    private static final int MIN_RANGE_BOUNDARY = 1;
 
     /**
      * Creates a new range restriction listener.
@@ -110,18 +112,20 @@
     private static void setRangeRestriction(YangType type,
             GeneratedYangParser.RangeStatementContext ctx) {
 
-        YangBuiltInDataTypeInfo<?> startValue, endValue;
+        YangBuiltInDataTypeInfo<?> startValue;
+        YangBuiltInDataTypeInfo<?> endValue;
         YangRangeRestriction rangeRestriction = new YangRangeRestriction();
 
         String rangeArgument = removeQuotesAndHandleConcat(ctx.range().getText());
         String[] rangeArguments = rangeArgument.trim().split(Pattern.quote(PIPE));
 
         for (String rangePart : rangeArguments) {
-            String startInterval, endInterval;
+            String startInterval;
+            String endInterval;
             YangRangeInterval rangeInterval = new YangRangeInterval();
             String[] rangeBoundary = rangePart.trim().split(Pattern.quote(RANGE_INTERVAL));
 
-            if (rangeBoundary.length > 2) {
+            if (rangeBoundary.length > MAX_RANGE_BOUNDARY) {
                 ParserException parserException = new ParserException("YANG file error : " +
                         YangConstructType.getYangConstructType(RANGE_DATA) + " " + rangeArgument +
                         " is not valid.");
@@ -130,7 +134,7 @@
                 throw parserException;
             }
 
-            if (rangeBoundary.length == 1) {
+            if (rangeBoundary.length == MIN_RANGE_BOUNDARY) {
                 startInterval = rangeBoundary[0];
                 endInterval = rangeBoundary[0];
             } else {
diff --git a/src/main/java/org/onosproject/yangutils/parser/impl/listeners/TypeListener.java b/src/main/java/org/onosproject/yangutils/parser/impl/listeners/TypeListener.java
index a2b4531..e93001e 100644
--- a/src/main/java/org/onosproject/yangutils/parser/impl/listeners/TypeListener.java
+++ b/src/main/java/org/onosproject/yangutils/parser/impl/listeners/TypeListener.java
@@ -31,7 +31,6 @@
 import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser;
 import org.onosproject.yangutils.parser.exceptions.ParserException;
 import org.onosproject.yangutils.parser.impl.TreeWalkListener;
-import org.onosproject.yangutils.utils.YangConstructType;
 
 import static org.onosproject.yangutils.datamodel.ResolvableStatus.UNRESOLVED;
 import static org.onosproject.yangutils.datamodel.utils.DataModelUtils.addResolutionInfo;
@@ -89,7 +88,7 @@
         checkStackIsNotEmpty(listener, MISSING_HOLDER, TYPE_DATA, ctx.string().getText(), ENTRY);
 
         // Validate node identifier.
-        YangNodeIdentifier nodeIdentifier = getValidNodeIdentifier(ctx.string().getText(), YangConstructType.TYPE_DATA,
+        YangNodeIdentifier nodeIdentifier = getValidNodeIdentifier(ctx.string().getText(), TYPE_DATA,
                 ctx);
 
         // Obtain the YANG data type.
@@ -107,7 +106,7 @@
         switch (tmpData.getYangConstructType()) {
             case LEAF_DATA:
                 YangLeaf leaf = (YangLeaf) tmpData;
-                leaf.setDataType((YangType<?>) type);
+                leaf.setDataType(type);
 
                 /*
                  * If data type is derived, resolution information to be added
@@ -139,7 +138,7 @@
                 break;
             case LEAF_LIST_DATA:
                 YangLeafList leafList = (YangLeafList) tmpData;
-                leafList.setDataType((YangType<?>) type);
+                leafList.setDataType(type);
 
                 /*
                  * If data type is derived, resolution information to be added
@@ -157,9 +156,6 @@
                                 ctx.string().getText(), EXIT));
                     }
 
-                    // Get the prefix information
-                    String prefix = ((YangType<?>) type).getPrefix();
-
                     // Create empty derived info and attach it to type extended info.
                     YangDerivedInfo<?> yangDerivedInfo = new YangDerivedInfo<>();
                     ((YangType<YangDerivedInfo>) type).setDataTypeExtendedInfo(yangDerivedInfo);
@@ -174,7 +170,7 @@
             case UNION_DATA:
                 YangUnion unionNode = (YangUnion) tmpData;
                 try {
-                    unionNode.addType((YangType<?>) type);
+                    unionNode.addType(type);
                 } catch (DataModelException e) {
                     ParserException parserException = new ParserException(e.getMessage());
                     parserException.setLine(ctx.getStart().getLine());
@@ -188,16 +184,13 @@
                  */
                 if (yangDataTypes == YangDataTypes.DERIVED) {
 
-                    // Get the prefix information
-                    String prefix = ((YangType<?>) type).getPrefix();
-
                     // Create empty derived info and attach it to type extended info.
                     YangDerivedInfo<?> yangDerivedInfo = new YangDerivedInfo<>();
                     ((YangType<YangDerivedInfo>) type).setDataTypeExtendedInfo(yangDerivedInfo);
 
                     // Add resolution information to the list
                     YangResolutionInfo resolutionInfo =
-                            new YangResolutionInfo<YangType>(type, (YangNode) unionNode, errorLine, errorPosition);
+                            new YangResolutionInfo<YangType>(type, unionNode, errorLine, errorPosition);
                     addToResolutionList(resolutionInfo, ctx);
                 }
 
@@ -205,24 +198,20 @@
             case TYPEDEF_DATA:
                 /* Prepare the base type info and set in derived type */
                 YangTypeDef typeDef = (YangTypeDef) tmpData;
-                typeDef.setDataType((YangType<?>) type);
+                typeDef.setDataType(type);
 
                 /*
                  * If data type is derived, resolution information to be added
                  * in resolution list.
                  */
                 if (yangDataTypes == YangDataTypes.DERIVED) {
-
-                    // Get the prefix information
-                    String prefix = ((YangType<?>) type).getPrefix();
-
                     // Create empty derived info and attach it to type extended info.
                     YangDerivedInfo<?> yangDerivedInfo = new YangDerivedInfo<>();
                     ((YangType<YangDerivedInfo>) type).setDataTypeExtendedInfo(yangDerivedInfo);
 
                     // Add resolution information to the list
                     YangResolutionInfo resolutionInfo =
-                            new YangResolutionInfo<YangType>(type, (YangNode) typeDef, errorLine, errorPosition);
+                            new YangResolutionInfo<YangType>(type, typeDef, errorLine, errorPosition);
                     addToResolutionList(resolutionInfo, ctx);
                 }
                 break;
diff --git a/src/main/java/org/onosproject/yangutils/parser/impl/listeners/UnionListener.java b/src/main/java/org/onosproject/yangutils/parser/impl/listeners/UnionListener.java
index 5a25762..1d2a698 100644
--- a/src/main/java/org/onosproject/yangutils/parser/impl/listeners/UnionListener.java
+++ b/src/main/java/org/onosproject/yangutils/parser/impl/listeners/UnionListener.java
@@ -51,7 +51,6 @@
 import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser;
 import org.onosproject.yangutils.parser.exceptions.ParserException;
 import org.onosproject.yangutils.parser.impl.TreeWalkListener;
-import org.onosproject.yangutils.utils.YangConstructType;
 
 import static org.onosproject.yangutils.datamodel.utils.GeneratedLanguage.JAVA_GENERATION;
 import static org.onosproject.yangutils.datamodel.utils.YangDataModelFactory.getYangUnionNode;
@@ -214,7 +213,7 @@
                 curNode.addChild(unionNode);
             } catch (DataModelException e) {
                 throw new ParserException(constructExtendedListenerErrorMessage(UNHANDLED_PARSED_DATA,
-                        YangConstructType.UNION_DATA, "", ENTRY, e.getMessage()));
+                        UNION_DATA, "", ENTRY, e.getMessage()));
             }
         }
     }
diff --git a/src/main/java/org/onosproject/yangutils/plugin/manager/YangUtilManager.java b/src/main/java/org/onosproject/yangutils/plugin/manager/YangUtilManager.java
index 86203c6..5e7f587 100644
--- a/src/main/java/org/onosproject/yangutils/plugin/manager/YangUtilManager.java
+++ b/src/main/java/org/onosproject/yangutils/plugin/manager/YangUtilManager.java
@@ -117,8 +117,6 @@
     private static final String DEFAULT_PKG = SLASH + getPackageDirPathFromJavaJPackage(DEFAULT_BASE_PKG);
 
     private YangUtilsParser yangUtilsParser = new YangUtilsParserManager();
-    private String searchDir;
-    private String codeGenDir;
     private YangNode rootNode;
 
     @Override
@@ -132,12 +130,12 @@
             clean(getDirectory(baseDir, genFilesDir) + DEFAULT_PKG);
             clean(getDirectory(baseDir, outputDirectory));
 
-            searchDir = getDirectory(baseDir, yangFilesDir);
-            codeGenDir = getDirectory(baseDir, genFilesDir) + SLASH;
+            String searchDir = getDirectory(baseDir, yangFilesDir);
+            String codeGenDir = getDirectory(baseDir, genFilesDir) + SLASH;
             YangToJavaNamingConflictUtil conflictResolver = new YangToJavaNamingConflictUtil();
             conflictResolver.setReplacementForPeriod(replacementForPeriod);
             conflictResolver.setReplacementForHyphen(replacementForHyphen);
-            conflictResolver.setReplacementForUnderscore(replacementForHyphen);
+            conflictResolver.setReplacementForUnderscore(replacementForUnderscore);
             List<String> yangFiles = YangFileScanner.getYangFiles(searchDir);
             YangPluginConfig yangPlugin = new YangPluginConfig();
             yangPlugin.setCodeGenDir(codeGenDir);
diff --git a/src/main/java/org/onosproject/yangutils/translator/tojava/JavaCodeGeneratorUtil.java b/src/main/java/org/onosproject/yangutils/translator/tojava/JavaCodeGeneratorUtil.java
index 7e010db..add5504 100644
--- a/src/main/java/org/onosproject/yangutils/translator/tojava/JavaCodeGeneratorUtil.java
+++ b/src/main/java/org/onosproject/yangutils/translator/tojava/JavaCodeGeneratorUtil.java
@@ -132,16 +132,14 @@
 
     /**
      * Free other YANG nodes of data-model tree when error occurs while file generation of current node.
-     *
-     * @throws DataModelException when fails to do datamodel operations
      */
-    public static void freeRestResources() throws DataModelException {
+    public static void freeRestResources() {
 
         YangNode curNode = getCurNode();
         YangNode tempNode = curNode;
         TraversalType curTraversal = ROOT;
 
-        while (!(curNode == tempNode.getParent())) {
+        while (curNode != tempNode.getParent()) {
 
             if (curTraversal != PARENT && curNode.getChild() != null) {
                 curTraversal = CHILD;
diff --git a/src/main/java/org/onosproject/yangutils/translator/tojava/JavaImportData.java b/src/main/java/org/onosproject/yangutils/translator/tojava/JavaImportData.java
index 7d8f4e0..723b937 100644
--- a/src/main/java/org/onosproject/yangutils/translator/tojava/JavaImportData.java
+++ b/src/main/java/org/onosproject/yangutils/translator/tojava/JavaImportData.java
@@ -162,6 +162,29 @@
     }
 
     /**
+     * Returns import for class.
+     *
+     * @return imports for class
+     */
+    public List<String> getImports() {
+        String importString;
+        List<String> imports = new ArrayList<>();
+
+        for (JavaQualifiedTypeInfo importInfo : getImportSet()) {
+            if (!importInfo.getPkgInfo().equals(EMPTY_STRING) && importInfo.getClassInfo() != null
+                    && !importInfo.getPkgInfo().equals(JAVA_LANG)) {
+                importString = IMPORT + importInfo.getPkgInfo() + PERIOD + importInfo.getClassInfo() + SEMI_COLAN
+                        + NEW_LINE;
+
+                imports.add(importString);
+            }
+        }
+
+        sort(imports);
+        return imports;
+    }
+
+    /**
      * Returns import for hash and equals method.
      *
      * @return import for hash and equals method
diff --git a/src/main/java/org/onosproject/yangutils/translator/tojava/JavaQualifiedTypeInfo.java b/src/main/java/org/onosproject/yangutils/translator/tojava/JavaQualifiedTypeInfo.java
index 77170dc..9b0ccca 100644
--- a/src/main/java/org/onosproject/yangutils/translator/tojava/JavaQualifiedTypeInfo.java
+++ b/src/main/java/org/onosproject/yangutils/translator/tojava/JavaQualifiedTypeInfo.java
@@ -110,14 +110,14 @@
          * Current leaves holder is adding a leaf info as a attribute to the
          * current class.
          */
-        String className = AttributesJavaDataType.getJavaImportClass(attrType, isListAttr);
+        String className = getJavaImportClass(attrType, isListAttr);
         if (className != null) {
             /*
              * Corresponding to the attribute type a class needs to be imported,
              * since it can be a derived type or a usage of wrapper classes.
              */
             importInfo.setClassInfo(className);
-            String classPkg = AttributesJavaDataType.getJavaImportPackage(attrType, isListAttr, className);
+            String classPkg = getJavaImportPackage(attrType, isListAttr, className);
             if (classPkg == null) {
                 throw new TranslatorException("import package cannot be null when the class is used");
             }
diff --git a/src/main/java/org/onosproject/yangutils/translator/tojava/TempJavaCodeFragmentFiles.java b/src/main/java/org/onosproject/yangutils/translator/tojava/TempJavaCodeFragmentFiles.java
index cc52daa..10d98c8 100644
--- a/src/main/java/org/onosproject/yangutils/translator/tojava/TempJavaCodeFragmentFiles.java
+++ b/src/main/java/org/onosproject/yangutils/translator/tojava/TempJavaCodeFragmentFiles.java
@@ -29,6 +29,7 @@
 import org.onosproject.yangutils.datamodel.YangLeavesHolder;
 import org.onosproject.yangutils.datamodel.YangNode;
 import org.onosproject.yangutils.datamodel.YangType;
+import org.onosproject.yangutils.datamodel.YangCase;
 import org.onosproject.yangutils.translator.exception.TranslatorException;
 
 import static org.onosproject.yangutils.datamodel.YangNodeType.MODULE_NODE;
@@ -110,6 +111,8 @@
 import static org.onosproject.yangutils.utils.UtilConstants.PACKAGE_INFO_JAVADOC_OF_CHILD;
 import static org.onosproject.yangutils.utils.UtilConstants.PERIOD;
 import static org.onosproject.yangutils.utils.UtilConstants.SLASH;
+import static org.onosproject.yangutils.utils.UtilConstants.IMPORT;
+import static org.onosproject.yangutils.utils.UtilConstants.SEMI_COLAN;
 import static org.onosproject.yangutils.utils.io.impl.FileSystemUtil.createPackage;
 import static org.onosproject.yangutils.utils.io.impl.FileSystemUtil.readAppendFile;
 import static org.onosproject.yangutils.utils.io.impl.JavaDocGen.JavaDocType.GETTER_METHOD;
@@ -393,6 +396,11 @@
     private YangNode curYangNode;
 
     /**
+     * Import info for case.
+     */
+    private JavaQualifiedTypeInfo caseImportInfo;
+
+    /**
      * Current enum's value.
      */
     private int enumValue;
@@ -1130,9 +1138,8 @@
      * Adds build method for interface.
      *
      * @return build method for interface
-     * @throws IOException when fails to append to temporary file
      */
-    public String addBuildMethodForInterface() throws IOException {
+    public String addBuildMethodForInterface() {
         return parseBuilderInterfaceBuildMethodString(generatedJavaClassName);
     }
 
@@ -1140,9 +1147,8 @@
      * Adds build method's implementation for class.
      *
      * @return build method implementation for class
-     * @throws IOException when fails to append to temporary file
      */
-    public String addBuildMethodImpl() throws IOException {
+    public String addBuildMethodImpl() {
         return getBuildString(generatedJavaClassName) + NEW_LINE;
     }
 
@@ -1162,9 +1168,8 @@
      * @param modifier modifier for constructor.
      * @param toAppend string which need to be appended with the class name
      * @return default constructor for class
-     * @throws IOException when fails to append to file
      */
-    public String addDefaultConstructor(String modifier, String toAppend) throws IOException {
+    public String addDefaultConstructor(String modifier, String toAppend) {
         return NEW_LINE + getDefaultConstructorString(generatedJavaClassName + toAppend, modifier);
     }
 
@@ -1172,9 +1177,8 @@
      * Adds default constructor for class.
      *
      * @return default constructor for class
-     * @throws IOException when fails to append to file
      */
-    public String addOfMethod() throws IOException {
+    public String addOfMethod() {
         return getJavaDoc(OF_METHOD, generatedJavaClassName, false)
                 + getOfMethod(generatedJavaClassName, newAttrInfo);
     }
@@ -1380,6 +1384,28 @@
     }
 
     /**
+     * Adds parent's info to current node import list.
+     *
+     * @param curNode current node for which import list needs to be updated
+     */
+    public void addParentInfoInCurNodeTempFile(YangNode curNode) {
+        caseImportInfo = new JavaQualifiedTypeInfo();
+        YangNode parent = getParentNodeInGenCode(curNode);
+        if (!(parent instanceof JavaCodeGenerator)) {
+            throw new TranslatorException("missing parent node to contain current node info in generated file");
+        }
+
+        if (!(curNode instanceof HasJavaFileInfo)) {
+            throw new TranslatorException("missing java file information to get the package details "
+                    + "of attribute corresponding to child node");
+        }
+
+        caseImportInfo.setClassInfo(getCaptialCase(getCamelCase(parent.getName(), null)));
+        caseImportInfo.setPkgInfo(((HasJavaFileInfo) parent).getJavaFileInfo().getPackage());
+        ((HasJavaImportData) curNode).getJavaImportData().addImportInfo(curNode, caseImportInfo);
+    }
+
+    /**
      * Adds leaf attributes in generated files.
      *
      * @param listOfLeaves list of YANG leaf
@@ -1415,7 +1441,7 @@
              * Check if the attribute is of type list, then the java.lang.list
              * needs to be imported.
              */
-            if (listOfLeafList.size() != 0) {
+            if (!listOfLeafList.isEmpty()) {
                 if (!(curNode instanceof HasJavaImportData)) {
                     throw new TranslatorException("missing import info in current data model node");
 
@@ -1651,6 +1677,18 @@
         if ((fileType & INTERFACE_MASK) != 0 | (fileType & BUILDER_INTERFACE_MASK) != 0) {
 
             /**
+             * Adds import for case.
+             */
+            if (curNode instanceof YangCase) {
+                List<String> importData = ((HasJavaImportData) curNode).getJavaImportData().getImports();
+                for (String  importInfo : importData) {
+                    if (!imports.contains(importInfo)) {
+                        imports.add(importInfo);
+                    }
+                }
+            }
+
+            /**
              * Adds import for HasAugmentation class.
              */
             if (isHasAugmentationExtended(getExtendsList())) {
@@ -1689,6 +1727,10 @@
             if (isAugmentedInfoExtended(getExtendsList())) {
                 addAugmentedInfoImport(curNode, imports, false);
             }
+
+            if (curNode instanceof YangCase) {
+                removeCaseImport(imports);
+            }
         }
 
         if ((fileType & BUILDER_CLASS_MASK) != 0 | (fileType & IMPL_CLASS_MASK) != 0) {
@@ -1763,6 +1805,21 @@
     }
 
     /**
+     * Removes case import info from import list.
+     *
+     * @param imports list of imports
+     * @return import for class
+     */
+    private List<String> removeCaseImport(List<String> imports) {
+        if (imports != null && caseImportInfo != null) {
+            String caseImport = IMPORT + caseImportInfo.getPkgInfo() + PERIOD + caseImportInfo.getClassInfo() +
+                    SEMI_COLAN + NEW_LINE;
+            imports.remove(caseImport);
+        }
+        return imports;
+    }
+
+    /**
      * Removes all temporary file handles.
      *
      * @param isErrorOccurred when translator fails to generate java files we need to close
diff --git a/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaCase.java b/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaCase.java
index 26727bd..8729f17 100644
--- a/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaCase.java
+++ b/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaCase.java
@@ -139,8 +139,7 @@
      * Creates a java file using the YANG case info.
      */
     @Override
-    public void generateCodeExit() {
-        // TODO Auto-generated method stub
-
+    public void generateCodeExit() throws IOException  {
+        getTempJavaCodeFragmentFiles().generateJavaFile(GENERATE_INTERFACE_WITH_BUILDER, this);
     }
 }
diff --git a/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaChoice.java b/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaChoice.java
index d5a00d5..0299e6c 100644
--- a/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaChoice.java
+++ b/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaChoice.java
@@ -24,7 +24,7 @@
 import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles;
 import org.onosproject.yangutils.translator.tojava.utils.YangPluginConfig;
 
-import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_INTERFACE_WITH_BUILDER;
+import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.INTERFACE_MASK;
 import static org.onosproject.yangutils.translator.tojava.utils.YangJavaModelUtils.generateCodeOfNode;
 
 /**
@@ -56,7 +56,7 @@
         super();
         setJavaFileInfo(new JavaFileInfo());
         setJavaImportData(new JavaImportData());
-        getJavaFileInfo().setGeneratedFileTypes(GENERATE_INTERFACE_WITH_BUILDER);
+        getJavaFileInfo().setGeneratedFileTypes(INTERFACE_MASK);
     }
 
     /**
@@ -133,15 +133,13 @@
     @Override
     public void generateCodeEntry(YangPluginConfig yangPlugin) throws IOException {
         generateCodeOfNode(this, yangPlugin, false);
-        // TODO:getTempJavaCodeFragmentFiles().addCurNodeLeavesInfoToTempFiles(this);
     }
 
     /**
      * Creates a java file using the YANG choice info.
      */
     @Override
-    public void generateCodeExit() {
-        // TODO Auto-generated method stub
-
+    public void generateCodeExit() throws IOException {
+        getTempJavaCodeFragmentFiles().generateJavaFile(INTERFACE_MASK, this);
     }
 }
diff --git a/src/main/java/org/onosproject/yangutils/translator/tojava/utils/ClassDefinitionGenerator.java b/src/main/java/org/onosproject/yangutils/translator/tojava/utils/ClassDefinitionGenerator.java
index ec58b26..9fa13d4 100644
--- a/src/main/java/org/onosproject/yangutils/translator/tojava/utils/ClassDefinitionGenerator.java
+++ b/src/main/java/org/onosproject/yangutils/translator/tojava/utils/ClassDefinitionGenerator.java
@@ -109,7 +109,7 @@
         }
         String def = PUBLIC + SPACE + INTERFACE + SPACE + yangName + SPACE + EXTEND + SPACE;
         for (String extend : getExtendsList()) {
-            def = def + extend + COMMA;
+            def = def + extend + COMMA + SPACE;
         }
         def = trimAtLast(def, COMMA);
 
diff --git a/src/main/java/org/onosproject/yangutils/translator/tojava/utils/MethodsGenerator.java b/src/main/java/org/onosproject/yangutils/translator/tojava/utils/MethodsGenerator.java
index 03be712..99ab915 100644
--- a/src/main/java/org/onosproject/yangutils/translator/tojava/utils/MethodsGenerator.java
+++ b/src/main/java/org/onosproject/yangutils/translator/tojava/utils/MethodsGenerator.java
@@ -373,7 +373,7 @@
     private static String getReturnType(JavaAttributeInfo attr) {
 
         String returnType = EMPTY_STRING;
-        if (attr.isQualifiedName() && (attr.getImportInfo().getPkgInfo() != null)) {
+        if (attr.isQualifiedName() && attr.getImportInfo().getPkgInfo() != null) {
             returnType = attr.getImportInfo().getPkgInfo() + PERIOD;
         }
         returnType = returnType + attr.getImportInfo().getClassInfo();
diff --git a/src/main/java/org/onosproject/yangutils/translator/tojava/utils/TempJavaCodeFragmentFilesUtils.java b/src/main/java/org/onosproject/yangutils/translator/tojava/utils/TempJavaCodeFragmentFilesUtils.java
index ccb8370..a82d7d4 100644
--- a/src/main/java/org/onosproject/yangutils/translator/tojava/utils/TempJavaCodeFragmentFilesUtils.java
+++ b/src/main/java/org/onosproject/yangutils/translator/tojava/utils/TempJavaCodeFragmentFilesUtils.java
@@ -141,7 +141,7 @@
      */
     public static void prepareJavaFileGeneratorForExtendsList(List<String> extendsList) {
 
-        if (!extendsList.isEmpty() && !extendsList.equals(null)) {
+        if (extendsList != null && !extendsList.isEmpty()) {
             JavaFileGenerator.setExtendsList(extendsList);
             JavaFileGenerator.setIsExtendsList(true);
         } else {
@@ -157,10 +157,7 @@
      * @return true or false
      */
     public static boolean isHasAugmentationExtended(List<String> extendsList) {
-        if (extendsList != null && extendsList.contains(HAS_AUGMENTATION)) {
-            return true;
-        }
-        return false;
+        return (extendsList != null && extendsList.contains(HAS_AUGMENTATION));
     }
 
     /**
@@ -170,10 +167,7 @@
      * @return true or false
      */
     public static boolean isAugmentedInfoExtended(List<String> extendsList) {
-        if (extendsList != null && extendsList.contains(AUGMENTED_INFO)) {
-            return true;
-        }
-        return false;
+        return (extendsList != null && extendsList.contains(AUGMENTED_INFO));
     }
 
     /**
diff --git a/src/main/java/org/onosproject/yangutils/translator/tojava/utils/YangJavaModelUtils.java b/src/main/java/org/onosproject/yangutils/translator/tojava/utils/YangJavaModelUtils.java
index cd6a7cd..4f3cb45 100644
--- a/src/main/java/org/onosproject/yangutils/translator/tojava/utils/YangJavaModelUtils.java
+++ b/src/main/java/org/onosproject/yangutils/translator/tojava/utils/YangJavaModelUtils.java
@@ -39,6 +39,7 @@
 import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getPackageDirPathFromJavaJPackage;
 import static org.onosproject.yangutils.utils.UtilConstants.AUGMENTED_INFO;
 import static org.onosproject.yangutils.utils.UtilConstants.HAS_AUGMENTATION;
+import static org.onosproject.yangutils.utils.UtilConstants.PERIOD;
 import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.getAbsolutePackagePath;
 
 /**
@@ -159,8 +160,10 @@
         updatePackageInfo((HasJavaFileInfo) javaCodeGeneratorInfo, yangPlugin);
         generateTempFiles(javaCodeGeneratorInfo, yangPlugin.getCodeGenDir());
 
-        javaCodeGeneratorInfo.getTempJavaCodeFragmentFiles()
-                .addCurNodeInfoInParentTempFile((YangNode) javaCodeGeneratorInfo, isMultiInstance);
+        if (!(javaCodeGeneratorInfo instanceof YangCase)) {
+            javaCodeGeneratorInfo.getTempJavaCodeFragmentFiles()
+                    .addCurNodeInfoInParentTempFile((YangNode) javaCodeGeneratorInfo, isMultiInstance);
+        }
 
         /**
          * For augmentation of nodes.
@@ -176,6 +179,21 @@
         } else if (javaCodeGeneratorInfo instanceof YangAugment) {
             javaCodeGeneratorInfo.getTempJavaCodeFragmentFiles().addToExtendsList(AUGMENTED_INFO);
         }
+
+        if (javaCodeGeneratorInfo instanceof YangCase) {
+            YangNode parent = ((YangCase) javaCodeGeneratorInfo).getParent();
+            String curNodeName = ((YangCase) javaCodeGeneratorInfo).getName();
+            if (!parent.getName().equals(curNodeName)) {
+                javaCodeGeneratorInfo.getTempJavaCodeFragmentFiles().addToExtendsList(getCaptialCase(getCamelCase(
+                    parent.getName(), null)));
+                javaCodeGeneratorInfo.getTempJavaCodeFragmentFiles().addParentInfoInCurNodeTempFile((YangNode)
+                    javaCodeGeneratorInfo);
+            } else {
+                String parentPackage = ((HasJavaFileInfo) parent).getJavaFileInfo().getPackage();
+                String caseExtendInfo = parentPackage + PERIOD + parent.getName();
+                javaCodeGeneratorInfo.getTempJavaCodeFragmentFiles().addToExtendsList(caseExtendInfo);
+            }
+        }
     }
 
     /**
diff --git a/src/main/java/org/onosproject/yangutils/translator/tojava/utils/YangPluginConfig.java b/src/main/java/org/onosproject/yangutils/translator/tojava/utils/YangPluginConfig.java
index 49be81c..f827698 100644
--- a/src/main/java/org/onosproject/yangutils/translator/tojava/utils/YangPluginConfig.java
+++ b/src/main/java/org/onosproject/yangutils/translator/tojava/utils/YangPluginConfig.java
@@ -22,12 +22,6 @@
 public final class YangPluginConfig {
 
     /**
-     * Creates an object for YANG plugin config.
-     */
-    public YangPluginConfig() {
-    }
-
-    /**
      * Contains the code generation directory.
      */
     private String codeGenDir;
@@ -38,6 +32,12 @@
     private YangToJavaNamingConflictUtil conflictResolver;
 
     /**
+     * Creates an object for YANG plugin config.
+     */
+    public YangPluginConfig() {
+    }
+
+    /**
      * Sets the path of the java code where it has to be generated.
      *
      * @param codeGenDir path of the directory
diff --git a/src/main/java/org/onosproject/yangutils/utils/UtilConstants.java b/src/main/java/org/onosproject/yangutils/utils/UtilConstants.java
index def4cc9..eeee061 100644
--- a/src/main/java/org/onosproject/yangutils/utils/UtilConstants.java
+++ b/src/main/java/org/onosproject/yangutils/utils/UtilConstants.java
@@ -26,12 +26,6 @@
 public final class UtilConstants {
 
     /**
-     * Creates an instance of util constants.
-     */
-    private UtilConstants() {
-    }
-
-    /**
      * JavaDocs for impl class.
      */
     public static final String IMPL_CLASS_JAVA_DOC = " * Represents the implementation of ";
@@ -841,4 +835,10 @@
      * Static attribute for array list.
      */
     public static final String ARRAY_LIST = "ArrayList";
+
+    /**
+     * Creates an instance of util constants.
+     */
+    private UtilConstants() {
+    }
 }
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 ffc36f7..c259a7f 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
@@ -55,10 +55,7 @@
     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()) {
-            return true;
-        }
-        return false;
+        return (pkgDir.exists() && pkgWithFile.isFile());
     }
 
     /**
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 c793cd6..e2fe7fd 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
@@ -376,10 +376,10 @@
      * @return javaDocs
      */
     private static String generateForTypeDefSetter(String attribute) {
-        return (NEW_LINE + FOUR_SPACE_INDENTATION + JAVA_DOC_FIRST_LINE + FOUR_SPACE_INDENTATION
+        return NEW_LINE + FOUR_SPACE_INDENTATION + JAVA_DOC_FIRST_LINE + FOUR_SPACE_INDENTATION
                 + JAVA_DOC_SETTERS_COMMON + attribute + PERIOD + NEW_LINE + FOUR_SPACE_INDENTATION + NEW_LINE_ASTERISK
                 + FOUR_SPACE_INDENTATION + JAVA_DOC_PARAM + VALUE + SPACE + VALUE + SPACE + OF + SPACE + attribute
-                + NEW_LINE + FOUR_SPACE_INDENTATION + JAVA_DOC_END_LINE);
+                + NEW_LINE + FOUR_SPACE_INDENTATION + JAVA_DOC_END_LINE;
     }
 
     /**
@@ -491,10 +491,9 @@
      * @return javaDocs for type constructor
      */
     private static String generateForTypeConstructor(String attribute) {
-
-        return (NEW_LINE + FOUR_SPACE_INDENTATION + JAVA_DOC_FIRST_LINE + FOUR_SPACE_INDENTATION + JAVA_DOC_CONSTRUCTOR
+        return NEW_LINE + FOUR_SPACE_INDENTATION + JAVA_DOC_FIRST_LINE + FOUR_SPACE_INDENTATION + JAVA_DOC_CONSTRUCTOR
                 + attribute + PERIOD + NEW_LINE + FOUR_SPACE_INDENTATION + NEW_LINE_ASTERISK + FOUR_SPACE_INDENTATION
                 + JAVA_DOC_PARAM + VALUE + SPACE + VALUE + SPACE + OF + SPACE + attribute + NEW_LINE
-                + FOUR_SPACE_INDENTATION + JAVA_DOC_END_LINE);
+                + FOUR_SPACE_INDENTATION + JAVA_DOC_END_LINE;
     }
 }
diff --git a/src/main/java/org/onosproject/yangutils/utils/io/impl/YangIoUtils.java b/src/main/java/org/onosproject/yangutils/utils/io/impl/YangIoUtils.java
index baf6929..51ca81c 100644
--- a/src/main/java/org/onosproject/yangutils/utils/io/impl/YangIoUtils.java
+++ b/src/main/java/org/onosproject/yangutils/utils/io/impl/YangIoUtils.java
@@ -223,7 +223,7 @@
 
         for (File file : files) {
             Files.copy(file.toPath(),
-                    (new File(path + file.getName())).toPath(),
+                    new File(path + file.getName()).toPath(),
                     StandardCopyOption.REPLACE_EXISTING);
         }
         Resource rsc = new Resource();
