Skip to content

Commit b4d1454

Browse files
author
Daniel D. Daugherty
committed
8332740: [BACKOUT] JDK-8331081 'internal proprietary API' diagnostics if --system is configured to an earlier JDK version
Reviewed-by: mikael, prr, jlahoda
1 parent 37c4778 commit b4d1454

File tree

2 files changed

+9
-141
lines changed

2 files changed

+9
-141
lines changed

src/jdk.compiler/share/classes/com/sun/tools/javac/code/ClassFinder.java

+9-14
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ protected ClassFinder(Context context) {
241241
* available from the module system.
242242
*/
243243
long getSupplementaryFlags(ClassSymbol c) {
244-
if (c.name == names.module_info) {
244+
if (jrtIndex == null || !jrtIndex.isInJRT(c.classfile) || c.name == names.module_info) {
245245
return 0;
246246
}
247247

@@ -257,22 +257,17 @@ long getSupplementaryFlags(ClassSymbol c) {
257257
try {
258258
ModuleSymbol owningModule = packge.modle;
259259
if (owningModule == syms.noModule) {
260-
if (jrtIndex != null && jrtIndex.isInJRT(c.classfile)) {
261-
JRTIndex.CtSym ctSym = jrtIndex.getCtSym(packge.flatName());
262-
Profile minProfile = Profile.DEFAULT;
263-
if (ctSym.proprietary)
264-
newFlags |= PROPRIETARY;
265-
if (ctSym.minProfile != null)
266-
minProfile = Profile.lookup(ctSym.minProfile);
267-
if (profile != Profile.DEFAULT && minProfile.value > profile.value) {
268-
newFlags |= NOT_IN_PROFILE;
269-
}
260+
JRTIndex.CtSym ctSym = jrtIndex.getCtSym(packge.flatName());
261+
Profile minProfile = Profile.DEFAULT;
262+
if (ctSym.proprietary)
263+
newFlags |= PROPRIETARY;
264+
if (ctSym.minProfile != null)
265+
minProfile = Profile.lookup(ctSym.minProfile);
266+
if (profile != Profile.DEFAULT && minProfile.value > profile.value) {
267+
newFlags |= NOT_IN_PROFILE;
270268
}
271269
} else if (owningModule.name == names.jdk_unsupported) {
272270
newFlags |= PROPRIETARY;
273-
} else {
274-
// don't accumulate user modules in supplementaryFlags
275-
return 0;
276271
}
277272
} catch (IOException ignore) {
278273
}

test/langtools/tools/javac/options/system/SystemSunProprietary.java

-127
This file was deleted.

0 commit comments

Comments
 (0)