> pls, what's command in shell to view src code of a compiled class? I
> have a class that's giving me an extra ("__$1.class") when I compile,
> even though I don't have any inner classes inside class... I would
> like to know what's inside this __$1.class... thank you..
> Frances
Do you have any code like
addActionListener(new ActionListener() {
...
});
The $1 etc. classes are synthesized nested anonymous classes generated
from stuff like that. But they can be hard to notice sometimes simply
because they're "inline" in the source code.
Other than that, try e.g.
javap -c -classpath whatever __.1
to disassemble it.
Frances - 12 Sep 2005 17:23 GMT
>>pls, what's command in shell to view src code of a compiled class? I
>>have a class that's giving me an extra ("__$1.class") when I compile,
[quoted text clipped - 17 lines]
>
> to disassemble it.
Thank you very much.. no, I don't have the ActionListener code you
mention.. but I do have this:
public void start() {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
I think this is what's doing it.. (this is for a signed applet, and on
this '$' class get error that "__$1's signer's ID is wrong" or something
like that, when in fact this class is signed (and jarred) the same as
other classes..) also get a thread error.. (I don't get threads,
threads are driving me nuts..)
thanks again.. Frances
Roedy Green - 12 Sep 2005 21:18 GMT
>public void start() {
> SwingUtilities.invokeLater(new Runnable() {
> public void run() {
this defines a new class without a name that implements Runnable with
a run method defined in a new way. Since it has not get a name, Javac
makes one up e.g. $1

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.
>pls, what's command in shell to view src code of a compiled class? I
>have a class that's giving me an extra ("__$1.class") when I compile,
>even though I don't have any inner classes inside class... I would like
>to know what's inside this __$1.class... thank you..
>Frances
you want a decompiler or disassembler. See
http://mindprod.com/jgloss/decompiler.html
http://mindprod.com/disassembler.html
When you peek, you will discover that code is for anonymous inner
classes.
See http://mindprod.com/jgloss/nestedclasses.html

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.