JavaBuild: fix output path when java tabs have package declaration

This commit is contained in:
Jakub Valtar
2016-05-06 00:19:50 +02:00
parent cbfad51dec
commit 2796026cf6

View File

@@ -523,11 +523,11 @@ public class JavaBuild {
} else {
if (packageMatch == null) {
// use the default package name, since mixing with package-less code will break
packageMatch = new String[] { packageName };
packageMatch = new String[] { "", packageName };
// add the package name to the source before writing it
javaCode = "package " + packageName + ";" + javaCode;
}
File packageFolder = new File(srcFolder, packageMatch[0].replace('.', '/'));
File packageFolder = new File(srcFolder, packageMatch[1].replace('.', File.separatorChar));
packageFolder.mkdirs();
Util.saveFile(javaCode, new File(packageFolder, filename));
}