src/share/classes/com/sun/tools/javac/sym/Profiles.java

changeset 2357
689edb64e41c
parent 2356
86ad38a4a0c0
child 2525
2eb010b6cb22
equal deleted inserted replaced
2356:86ad38a4a0c0 2357:689edb64e41c
151 final Map<String, Package> packages = new TreeMap<String, Package>(); 151 final Map<String, Package> packages = new TreeMap<String, Package>();
152 152
153 final int maxProfile = 4; // Three compact profiles plus full JRE 153 final int maxProfile = 4; // Three compact profiles plus full JRE
154 154
155 MakefileProfiles(Properties p) { 155 MakefileProfiles(Properties p) {
156 // consider crypto, only if java/lang package exists
157 boolean foundJavaLang = false;
156 for (int profile = 1; profile <= maxProfile; profile++) { 158 for (int profile = 1; profile <= maxProfile; profile++) {
157 String prefix = (profile < maxProfile ? "PROFILE_" + profile : "FULL_JRE"); 159 String prefix = (profile < maxProfile ? "PROFILE_" + profile : "FULL_JRE");
158 String inclPackages = p.getProperty(prefix + "_RTJAR_INCLUDE_PACKAGES"); 160 String inclPackages = p.getProperty(prefix + "_RTJAR_INCLUDE_PACKAGES");
159 if (inclPackages == null) 161 if (inclPackages == null)
160 break; 162 break;
161 for (String pkg: inclPackages.substring(1).trim().split("\\s+")) { 163 for (String pkg: inclPackages.substring(1).trim().split("\\s+")) {
162 if (pkg.endsWith("/")) 164 if (pkg.endsWith("/"))
163 pkg = pkg.substring(0, pkg.length() - 1); 165 pkg = pkg.substring(0, pkg.length() - 1);
166 if (foundJavaLang == false && pkg.equals("java/lang"))
167 foundJavaLang = true;
164 includePackage(profile, pkg); 168 includePackage(profile, pkg);
165 } 169 }
166 String inclTypes = p.getProperty(prefix + "_RTJAR_INCLUDE_TYPES"); 170 String inclTypes = p.getProperty(prefix + "_RTJAR_INCLUDE_TYPES");
167 if (inclTypes != null) { 171 if (inclTypes != null) {
168 for (String type: inclTypes.replace("$$", "$").split("\\s+")) { 172 for (String type: inclTypes.replace("$$", "$").split("\\s+")) {
183 * because this package exists in jce.jar, and therefore not in 187 * because this package exists in jce.jar, and therefore not in
184 * ct.sym. Note javax/crypto should exist in a profile along with 188 * ct.sym. Note javax/crypto should exist in a profile along with
185 * javax/net/ssl package. Thus, this package is added to compact1, 189 * javax/net/ssl package. Thus, this package is added to compact1,
186 * implying that it should exist in all three profiles. 190 * implying that it should exist in all three profiles.
187 */ 191 */
188 includePackage(1, "javax/crypto"); 192 if (foundJavaLang)
193 includePackage(1, "javax/crypto");
189 } 194 }
190 195
191 @Override 196 @Override
192 public int getProfileCount() { 197 public int getProfileCount() {
193 return maxProfile; 198 return maxProfile;

mercurial