Classload of fails - regression in jdk7u25

Martin Buchholz martinrb at
Thu Sep 19 10:17:27 PDT 2013

Hi, this is a bug report.

Here is a tiny program that does class loading:

public class LoadClass {
    public static void main(String[] args) throws Throwable {
        for (String className : args)
            Class.forName(className, true, null);

If I run this against 1.7.0_21, it succeeds, but if I run it against
1.7.0_25 I get

java LoadClass
Exception in thread "main" java.lang.UnsatisfiedLinkError:
at Method)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName( clearly tries to prevent this from happening by calling
Util.load(), but the problem is that the static block is called too late.
 Those static blocks calling Util.load() need to be at the top of each
source file instead of the bottom, to prevent such failures.

Regression was introduced with this changeset:

changeset:   6272:8dd8266a2f4b
user:        khazra
date:        Thu Mar 14 13:54:32 2013 -0700
summary:     7170730: Improve Windows network stack support.

I think Oracle testing folks should regularly run the above little program
against every single class in the JDK (although it might be too expensive
to run in a jtreg test).

The fix is obvious, but I can provide a webrev if desired.
-------------- next part --------------
An HTML attachment was scrubbed...

More information about the quality-discuss mailing list