Committed by
Janani B-Huawei
[ONOS-4876] Defect fix for notification, when grouping is first child of module.
Change-Id: I14a69f8ecced4ca1ae6a2a63be05ba740bed5511
Showing
1 changed file
with
7 additions
and
1 deletions
| ... | @@ -22,6 +22,7 @@ import java.util.ArrayList; | ... | @@ -22,6 +22,7 @@ import java.util.ArrayList; |
| 22 | import java.util.List; | 22 | import java.util.List; |
| 23 | 23 | ||
| 24 | import org.onosproject.yangutils.datamodel.YangNode; | 24 | import org.onosproject.yangutils.datamodel.YangNode; |
| 25 | +import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaGrouping; | ||
| 25 | import org.onosproject.yangutils.translator.tojava.utils.JavaExtendsListHolder; | 26 | import org.onosproject.yangutils.translator.tojava.utils.JavaExtendsListHolder; |
| 26 | import org.onosproject.yangutils.utils.io.impl.YangPluginConfig; | 27 | import org.onosproject.yangutils.utils.io.impl.YangPluginConfig; |
| 27 | 28 | ||
| ... | @@ -501,8 +502,13 @@ public class TempJavaEventFragmentFiles | ... | @@ -501,8 +502,13 @@ public class TempJavaEventFragmentFiles |
| 501 | throws IOException { | 502 | throws IOException { |
| 502 | 503 | ||
| 503 | JavaFileInfo parentInfo = ((JavaFileInfoContainer) curNode).getJavaFileInfo(); | 504 | JavaFileInfo parentInfo = ((JavaFileInfoContainer) curNode).getJavaFileInfo(); |
| 504 | - JavaFileInfo childInfo = ((JavaFileInfoContainer) curNode.getChild()).getJavaFileInfo(); | 505 | + YangNode childNode = curNode.getChild(); |
| 505 | 506 | ||
| 507 | + // Skip grouping, as it wont have the package name. | ||
| 508 | + while (childNode instanceof YangJavaGrouping) { | ||
| 509 | + childNode = childNode.getNextSibling(); | ||
| 510 | + } | ||
| 511 | + JavaFileInfo childInfo = ((JavaFileInfoContainer) childNode).getJavaFileInfo(); | ||
| 506 | return getFileObject(getDirPath(parentInfo), name, JAVA_FILE_EXTENSION, | 512 | return getFileObject(getDirPath(parentInfo), name, JAVA_FILE_EXTENSION, |
| 507 | childInfo.getBaseCodeGenPath()); | 513 | childInfo.getBaseCodeGenPath()); |
| 508 | } | 514 | } | ... | ... |
-
Please register or login to post a comment