File tree 1 file changed +13
-0
lines changed
src/jdk.jdeps/share/classes/com/sun/tools/javap
1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -860,6 +860,19 @@ private JavaFileObject getClassFileObject(String className) throws IOException {
860
860
if (moduleLocation != null ) {
861
861
fo = fileManager .getJavaFileForInput (moduleLocation , className , JavaFileObject .Kind .CLASS );
862
862
} else {
863
+ if (className .indexOf ('.' ) > 0 ) {
864
+ //search for classes with a named package in the JDK modules specifed by --system option first
865
+ try {
866
+ for (Set <Location > locations : fileManager .listLocationsForModules (StandardLocation .SYSTEM_MODULES )) {
867
+ for (Location systemModule : locations ) {
868
+ fo = fileManager .getJavaFileForInput (systemModule , className , JavaFileObject .Kind .CLASS );
869
+ if (fo != null ) return fo ;
870
+ }
871
+ }
872
+ } catch (UnsupportedOperationException e ) {
873
+ //skip when listLocationsForModules is not supported
874
+ }
875
+ }
863
876
fo = fileManager .getJavaFileForInput (StandardLocation .PLATFORM_CLASS_PATH , className , JavaFileObject .Kind .CLASS );
864
877
if (fo == null )
865
878
fo = fileManager .getJavaFileForInput (StandardLocation .CLASS_PATH , className , JavaFileObject .Kind .CLASS );
You can’t perform that action at this time.
0 commit comments