8072054: Cannot build langtools if checked-out in a directory ending with \"com\"
authorjlahoda
Mon, 02 Feb 2015 21:53:36 +0100
changeset 28801 2f1c998c3fcc
parent 28800 35f9042d53b3
child 28802 79aa3efa3c84
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
langtools/make/tools/propertiesparser/gen/ClassGenerator.java
--- 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;
     }