Fix YangModuleInfoImpl generation on windows 53/4853/1
authorRobert Varga <rovarga@cisco.com>
Mon, 27 Jan 2014 10:51:50 +0000 (11:51 +0100)
committerRobert Varga <rovarga@cisco.com>
Mon, 27 Jan 2014 10:51:50 +0000 (11:51 +0100)
Turns out the generated module name contains backslashes on Windows.
Convert them to slashes before emitting the string.

Change-Id: I0e09bdcec769a82b3c72ccf6fcc4910c615f736f
Signed-off-by: Prasanna Huddar <prasanna.huddar@ericsson.com>
Signed-off-by: Robert Varga <rovarga@cisco.com>
code-generator/binding-java-api-generator/src/main/java/org/opendaylight/yangtools/sal/java/api/generator/YangModuleInfoTemplate.xtend

index 8cb900c1952e78adbd2be08e2b715b1e6a6acbb0..b805fb232358244205842c4aa87b6c103941a2fb 100644 (file)
@@ -97,7 +97,7 @@ class YangModuleInfoTemplate {
                 importedModules = «Collections.importedName».emptySet();
             «ENDIF»
 
-            «val path = m.moduleSourcePath»
+            «val path = m.moduleSourcePath.replace(java.io.File.separatorChar, '/')»
             «InputStream.importedName» stream = «CLASS».class.getResourceAsStream("«path»");
             if (stream == null) {
                 throw new IllegalStateException("Resource «path» is missing");