H
HK
First I compile this without error with javac from 1.5.0_04
public class Bla {
public static final int x = Bli.innerX;
private class Bli {
public static final int innerX = 1;
}
}
Then I add an unused type parameter:
public class Bla<T> {
public static final int x = Bli.innerX;
private class Bli {
public static final int innerX = 1;
}
}
and the compilation results in this error:
% ./jdk1.5/bin/javac -source 1.5 Bla.java
Bla.java:4: non-static class Bla.Bli cannot be referenced from a static
context
public static final int x = Bli.innerX;
^
1 error
Is this a bug or a feature?
Harald.
public class Bla {
public static final int x = Bli.innerX;
private class Bli {
public static final int innerX = 1;
}
}
Then I add an unused type parameter:
public class Bla<T> {
public static final int x = Bli.innerX;
private class Bli {
public static final int innerX = 1;
}
}
and the compilation results in this error:
% ./jdk1.5/bin/javac -source 1.5 Bla.java
Bla.java:4: non-static class Bla.Bli cannot be referenced from a static
context
public static final int x = Bli.innerX;
^
1 error
Is this a bug or a feature?
Harald.