[I had Rene try this on win32, seems to work there]
/home/ovrskeek> java -XX:-Inline HelloException2
new excpetion
new excpetion
[... lots more ...]
new excpetion
new excpetion
Exception in thread "main" NewException
at HelloException2.buildE(HelloException2.java:20)
at HelloException2.blah(HelloException2.java:11)
at HelloException2.main(HelloException2.java:7)
What seems to be happening, is that the compiler
looks at the declared type of e, because it doesn't have
the real type info available.
class HelloException2 extends Object {
static int count = 0;
static Exception e;
public static void main(String[] args) throws Exception {
for(int i=0; i<10001; i++)
blah();
}
public static void blah() throws Exception{
try {
buildE();
throw e;
} catch (NewException e) {
System.out.println("new excpetion");
}
}
public static void buildE() {
e = new NewException();
}
}
class NewException extends Exception {
public NewException() {
super();
}
public NewException(String s) {
super(s);
}
}
/home/ovrskeek> java -XX:-Inline HelloException2
new excpetion
new excpetion
[... lots more ...]
new excpetion
new excpetion
Exception in thread "main" NewException
at HelloException2.buildE(HelloException2.java:20)
at HelloException2.blah(HelloException2.java:11)
at HelloException2.main(HelloException2.java:7)
What seems to be happening, is that the compiler
looks at the declared type of e, because it doesn't have
the real type info available.
class HelloException2 extends Object {
static int count = 0;
static Exception e;
public static void main(String[] args) throws Exception {
for(int i=0; i<10001; i++)
blah();
}
public static void blah() throws Exception{
try {
buildE();
throw e;
} catch (NewException e) {
System.out.println("new excpetion");
}
}
public static void buildE() {
e = new NewException();
}
}
class NewException extends Exception {
public NewException() {
super();
}
public NewException(String s) {
super(s);
}
}