changeset 2814:e5f5ecfefba8

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
author jlahoda
date Mon, 02 Feb 2015 21:53:36 +0100
parents 2d2baba27992
children 5a2254319314
files make/tools/propertiesparser/gen/ClassGenerator.java
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/make/tools/propertiesparser/gen/ClassGenerator.java	Mon Feb 02 18:52:16 2015 +0530
+++ b/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;
     }