8009429: Miscellaneous profiles cleanup
authordholmes
Thu, 14 Mar 2013 01:45:44 -0400
changeset 16548 d55a654e2751
parent 16547 3dd72ee2623d
child 16549 1bdeedb5446c
8009429: Miscellaneous profiles cleanup Reviewed-by: jjg, alanb
langtools/src/share/classes/com/sun/tools/javac/sym/Profiles.java
--- a/langtools/src/share/classes/com/sun/tools/javac/sym/Profiles.java	Wed Mar 13 14:47:15 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/sym/Profiles.java	Thu Mar 14 01:45:44 2013 -0400
@@ -149,12 +149,13 @@
         }
 
         final static Map<String, Package> packages = new TreeMap<String, Package>();
-        int maxProfile;
+
+        final int maxProfile = 4;  // Three compact profiles plus full JRE
 
         MakefileProfiles(Properties p) {
-            int profile = 1;
-            while (true) {
-                String inclPackages = p.getProperty("PROFILE_" + profile + "_RTJAR_INCLUDE_PACKAGES");
+            for (int profile = 1; profile <= maxProfile; profile++) {
+                String prefix = (profile < maxProfile ? "PROFILE_" + profile : "FULL_JRE");
+                String inclPackages = p.getProperty(prefix + "_RTJAR_INCLUDE_PACKAGES");
                 if (inclPackages == null)
                     break;
                 for (String pkg: inclPackages.substring(1).trim().split("\\s+")) {
@@ -162,22 +163,20 @@
                         pkg = pkg.substring(0, pkg.length() - 1);
                     includePackage(profile, pkg);
                 }
-                String inclTypes =  p.getProperty("PROFILE_" + profile + "_RTJAR_INCLUDE_TYPES");
+                String inclTypes =  p.getProperty(prefix + "_RTJAR_INCLUDE_TYPES");
                 if (inclTypes != null) {
                     for (String type: inclTypes.replace("$$", "$").split("\\s+")) {
                         if (type.endsWith(".class"))
                             includeType(profile, type.substring(0, type.length() - 6));
                     }
                 }
-                String exclTypes =  p.getProperty("PROFILE_" + profile + "_RTJAR_EXCLUDE_TYPES");
+                String exclTypes =  p.getProperty(prefix + "_RTJAR_EXCLUDE_TYPES");
                 if (exclTypes != null) {
                     for (String type: exclTypes.replace("$$", "$").split("\\s+")) {
                         if (type.endsWith(".class"))
                             excludeType(profile, type.substring(0, type.length() - 6));
                     }
                 }
-                maxProfile = profile;
-                profile++;
             }
         }