8072054: Cannot build langtools if checked-out in a directory ending with \"com\"
Summary: Making sure a proper package name is used when generating Properties classes
Reviewed-by: mcimadamore
--- a/langtools/make/tools/propertiesparser/gen/ClassGenerator.java Mon Feb 02 18:52:16 2015 +0530
+++ b/langtools/make/tools/propertiesparser/gen/ClassGenerator.java Mon Feb 02 21:53:36 2015 +0100
@@ -192,8 +192,8 @@
*/
String packageName(File file) {
String path = file.getAbsolutePath();
- int begin = path.indexOf("com" + File.separatorChar);
- String packagePath = path.substring(begin, path.lastIndexOf(File.separatorChar));
+ int begin = path.lastIndexOf(File.separatorChar + "com" + File.separatorChar);
+ String packagePath = path.substring(begin + 1, path.lastIndexOf(File.separatorChar));
String packageName = packagePath.replace(File.separatorChar, '.');
return packageName;
}