JDK-8022259 : MakeClasslist tool is buggy and its README is out of date.
Type:Bug
Component:hotspot
Sub-Component:runtime
Affected Version:hs25
Priority:P3
Status:Closed
Resolution:Fixed
Submitted:2013-08-05
Updated:2014-06-27
Resolved:2013-08-14
The Version table provides details related to the release that this issue/RFE will be addressed.
Unresolved : Release in which this issue/RFE will be addressed. Resolved: Release in which this issue/RFE has been resolved. Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.
The Makeclasslist tool has a bug and the README.txt file that explains how to use the MakeClasslist tool is out of date.
Comments
bug in MakeClassList
I'm convinced that this MakeClasslist app is broken. It's looking for
"[Loading foo.bar from /path/to/jre/lib/rt.jar]" strings and when it finds
one it takes the class name, replaces "." with "/" and then puts the
string in an ArrayList<String> called classes. I instrumented the code
and found that it is finding the "[Loading ..." strings in my output and
putting them into that array.
Trying to debug why it's not outputting anything, I found that the classes
array list is never used after the strings are added. When it falls out of
the loop where it's adding the found/converted class names, it then goes
into a loop processing a brand now HashSet with nothing in it:
Set<String> seenClasses = new HashSet<>();
for (String str : seenClasses) {
if (seenClasses.add(str) {
System.out.println(str);
}
}
I think the "for (String str : seenClasses) {" is supposed to be "for (String s
tr: classes) {"
(here is an email I squirreled away - I think this was from Ioi) - hope this helps!
06-08-2013
No, I don't have a fix. In my past experiments I just used the build.tools.addjsum.AddJsum tool to add checksums to a classlist that I generated by my own script.
06-08-2013
Harold - please check with Ioi, I think he has a fix for this. I thought I had asked him to file a bug with the suggested fix for the group that owns the tool.
06-08-2013
The beginning comments in MakeClasslist.java says it processes files creating using -verbose:class. But, it actually processes files created using -XX:+TraceClassLoadingPreorder. Also, the 'for' loop at line 89 is wrong. The code should loop through List 'classes', not Set 'seenClasses'.
File README.txt should say to use -XX:+TraceClassLoadingPreorder, not -verbose:class, Also, it should specify NetBeans50 and JDK 1.8.