Has Eclipse (outside of Tomcat) been configured to emit .class files in
a certain format? I'm guessing this hasn't been done for 'ant', so maybe
they need to match each other.
that was one of my guesses, but apart from the compliance level i dont
know of any-
This happens as well under tomcat 5.5.
Changing the ANT build to use the same JDT compiler as eclipse did not
change the problem.
Using javap I checked both compiled versions of the classes and they do
have the same major version.
Really? Hmm. Could you double-check that and post what you get?
It's possible that there's a bug in the compiler that can't read some
particular thing in the class file.
please find javap - verbose output attached. major and minor versions
are the same.
there are differences though. Eclipse sems to include a SourceFile
reference plus Linenumber and LocalVariable Tables.
I wouldn't know how to trigger that in ant though..
public class de.unitb.i18n.Localizer extends java.lang.Object{
public static java.lang.String BASE_NAME;
static {};
Code:
0: ldc #18; //String LocalizedStrings
2: putstatic #20; //Field BASE_NAME:Ljava/lang/String;
5: new #22; //class java/util/HashMap
8: dup
9: invokespecial #24; //Method java/util/HashMap."<init>":()V
12: putstatic #27; //Field localizers:Ljava/util/HashMap;
15: return
public static synchronized de.unitb.i18n.Localizer
getInstance(java.lang.String);
Code:
0: aload_0
1: invokestatic #31; //Method
java/util/Locale.getDefault:()Ljava/util/Locale;
4: invokestatic #37; //Method
getInstance:(Ljava/lang/String;Ljava/util/Locale;)Lde/unitb/i18n/Localizer;
7: areturn
public static synchronized de.unitb.i18n.Localizer
getInstance(java.lang.String, java.util.Locale);
Code:
0: aload_1
1: ifnonnull 14
4: new #40; //class java/lang/IllegalArgumentException
7: dup
8: ldc #42; //String Do not pass empty locale. Call
getInstance(packageName) for default
10: invokespecial #44; //Method
java/lang/IllegalArgumentException."<init>":(Ljava/lang/String;)V
13: athrow
14: aload_0
15: ifnull 27
18: ldc #47; //String
20: aload_0
21: invokevirtual #49; //Method
java/lang/String.equals:(Ljava/lang/Object;)Z
24: ifeq 37
27: new #40; //class java/lang/IllegalArgumentException
30: dup
31: ldc #55; //String Do not pass empty package name.
33: invokespecial #44; //Method
java/lang/IllegalArgumentException."<init>":(Ljava/lang/String;)V
36: athrow
37: new #57; //class java/lang/StringBuilder
40: dup
41: aload_0
42: invokespecial #59; //Method
java/lang/StringBuilder."<init>":(Ljava/lang/String;)V
45: ldc #60; //String .
47: invokevirtual #62; //Method
java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
50: aload_1
51: invokevirtual #66; //Method
java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;
54: astore_2
55: getstatic #27; //Field localizers:Ljava/util/HashMap;
58: aload_2
59: invokevirtual #69; //Method
java/lang/StringBuilder.toString:()Ljava/lang/String;
62: invokevirtual #73; //Method
java/util/HashMap.get:(Ljava/lang/Object;)Ljava/lang/Object;
65: checkcast #1; //class de/unitb/i18n/Localizer
68: astore_3
69: aload_3
70: ifnonnull 95
73: new #1; //class de/unitb/i18n/Localizer
76: dup
77: aload_0
78: aload_1
79: invokespecial #77; //Method
"<init>":(Ljava/lang/String;Ljava/util/Locale;)V
82: astore_3
83: getstatic #27; //Field localizers:Ljava/util/HashMap;
86: aload_2
87: invokevirtual #69; //Method
java/lang/StringBuilder.toString:()Ljava/lang/String;
90: aload_3
91: invokevirtual #80; //Method
java/util/HashMap.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
94: pop
95: aload_3
96: areturn
public java.lang.String getString(java.lang.String);
Code:
0: aload_1
1: ifnull 13
4: ldc #47; //String
6: aload_1
7: invokevirtual #49; //Method
java/lang/String.equals:(Ljava/lang/Object;)Z
10: ifeq 23
13: new #40; //class java/lang/IllegalArgumentException
16: dup
17: ldc #102; //String Do not pass an empty key
19: invokespecial #44; //Method
java/lang/IllegalArgumentException."<init>":(Ljava/lang/String;)V
22: athrow
23: aload_1
24: astore_2
25: aload_0
26: getfield #92; //Field bundle:Ljava/util/ResourceBundle;
29: aload_1
30: invokevirtual #104; //Method
java/util/ResourceBundle.getString:(Ljava/lang/String;)Ljava/lang/String;
33: astore_2
34: goto 38
37: pop
38: aload_2
39: areturn
Exception table:
from to target type
25 34 37 Class java/util/MissingResourceException
public java.lang.String getString(java.lang.String, java.lang.Object[]);
Code:
0: aload_0
1: aload_1
2: invokevirtual #109; //Method
getString:(Ljava/lang/String;)Ljava/lang/String;
5: astore_3
6: aload_3
7: ifnull 29
10: ldc #47; //String
12: aload_3
13: invokevirtual #49; //Method
java/lang/String.equals:(Ljava/lang/Object;)Z
16: ifne 29
19: aload_0
20: getfield #98; //Field locale:Ljava/util/Locale;
23: aload_3
24: aload_2
25: invokestatic #110; //Method
java/lang/String.format:(Ljava/util/Locale;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
28: areturn
29: aload_1
30: areturn
public java.util.Locale getLocale();
Code:
0: aload_0
1: getfield #98; //Field locale:Ljava/util/Locale;
4: areturn
}
Compiled from "Localizer.java"
public class de.unitb.i18n.Localizer extends java.lang.Object{
public static java.lang.String BASE_NAME;
static {};
Code:
0: ldc #18; //String LocalizedStrings
2: putstatic #20; //Field BASE_NAME:Ljava/lang/String;
5: new #22; //class java/util/HashMap
8: dup
9: invokespecial #24; //Method java/util/HashMap."<init>":()V
12: putstatic #27; //Field localizers:Ljava/util/HashMap;
15: return
public static synchronized de.unitb.i18n.Localizer
getInstance(java.lang.String);
Code:
0: aload_0
1: invokestatic #33; //Method
java/util/Locale.getDefault:()Ljava/util/Locale;
4: invokestatic #39; //Method
getInstance:(Ljava/lang/String;Ljava/util/Locale;)Lde/unitb/i18n/Localizer;
7: areturn
public static synchronized de.unitb.i18n.Localizer
getInstance(java.lang.String, java.util.Locale);
Code:
0: aload_1
1: ifnonnull 14
4: new #43; //class java/lang/IllegalArgumentException
7: dup
8: ldc #45; //String Do not pass empty locale. Call
getInstance(packageName) for default
10: invokespecial #47; //Method
java/lang/IllegalArgumentException."<init>":(Ljava/lang/String;)V
13: athrow
14: aload_0
15: ifnull 27
18: ldc #50; //String
20: aload_0
21: invokevirtual #52; //Method
java/lang/String.equals:(Ljava/lang/Object;)Z
24: ifeq 37
27: new #43; //class java/lang/IllegalArgumentException
30: dup
31: ldc #58; //String Do not pass empty package name.
33: invokespecial #47; //Method
java/lang/IllegalArgumentException."<init>":(Ljava/lang/String;)V
36: athrow
37: new #60; //class java/lang/StringBuilder
40: dup
41: aload_0
42: invokespecial #62; //Method
java/lang/StringBuilder."<init>":(Ljava/lang/String;)V
45: ldc #63; //String .
47: invokevirtual #65; //Method
java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
50: aload_1
51: invokevirtual #69; //Method
java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;
54: astore_2
55: getstatic #27; //Field localizers:Ljava/util/HashMap;
58: aload_2
59: invokevirtual #72; //Method
java/lang/StringBuilder.toString:()Ljava/lang/String;
62: invokevirtual #76; //Method
java/util/HashMap.get:(Ljava/lang/Object;)Ljava/lang/Object;
65: checkcast #1; //class de/unitb/i18n/Localizer
68: astore_3
69: aload_3
70: ifnonnull 95
73: new #1; //class de/unitb/i18n/Localizer
76: dup
77: aload_0
78: aload_1
79: invokespecial #80; //Method
"<init>":(Ljava/lang/String;Ljava/util/Locale;)V
82: astore_3
83: getstatic #27; //Field localizers:Ljava/util/HashMap;
86: aload_2
87: invokevirtual #72; //Method
java/lang/StringBuilder.toString:()Ljava/lang/String;
90: aload_3
91: invokevirtual #83; //Method
java/util/HashMap.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
94: pop
95: aload_3
96: areturn
public java.lang.String getString(java.lang.String);
Code:
0: aload_1
1: ifnull 13
4: ldc #50; //String
6: aload_1
7: invokevirtual #52; //Method
java/lang/String.equals:(Ljava/lang/Object;)Z
10: ifeq 23
13: new #43; //class java/lang/IllegalArgumentException
16: dup
17: ldc #110; //String Do not pass an empty key
19: invokespecial #47; //Method
java/lang/IllegalArgumentException."<init>":(Ljava/lang/String;)V
22: athrow
23: aload_1
24: astore_2
25: aload_0
26: getfield #98; //Field bundle:Ljava/util/ResourceBundle;
29: aload_1
30: invokevirtual #112; //Method
java/util/ResourceBundle.getString:(Ljava/lang/String;)Ljava/lang/String;
33: astore_2
34: goto 38
37: astore_3
38: aload_2
39: areturn
Exception table:
from to target type
25 34 37 Class java/util/MissingResourceException
public java.lang.String getString(java.lang.String, java.lang.Object[]);
Code:
0: aload_0
1: aload_1
2: invokevirtual #119; //Method
getString:(Ljava/lang/String;)Ljava/lang/String;
5: astore_3
6: aload_3
7: ifnull 29
10: ldc #50; //String
12: aload_3
13: invokevirtual #52; //Method
java/lang/String.equals:(Ljava/lang/Object;)Z
16: ifne 29
19: aload_0
20: getfield #106; //Field locale:Ljava/util/Locale;
23: aload_3
24: aload_2
25: invokestatic #120; //Method
java/lang/String.format:(Ljava/util/Locale;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
28: areturn
29: aload_1
30: areturn
public java.util.Locale getLocale();
Code:
0: aload_0
1: getfield #106; //Field locale:Ljava/util/Locale;
4: areturn
}
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org