• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Is compiling anonymous classes in jdk1.5.0 beta different?

 
Keith Thompson
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am compiling a java program with jdk1.5.0 beta.

I get a compiled class file with this name ==>
className+1.class

(And YES - it executes fine. My question is just related to the naming convention for compiled class names in jdk1.5.0).

I guess the "+1" means there is an anonymous class somewhere within my program?

Didn't anonymous class files used to be compiled with a naming convention that ended with a dollar sign "$" like this? ==>
className$.class

thanks,
Keith
[ May 31, 2004: Message edited by: Keith Thompson ]
 
Stefan Wagner
Ranch Hand
Posts: 1923
Linux Postgres Database Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
shouldn't you know by a look at your source code, whether you use a anonymous class?

Perhaps it's used for some autoboxing-issues or generic class?
 
Keith Thompson
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I guess I worded my question wrong. Yes - I am using an anonymous class.

I was just curious if other people agreed with my observations? This has nothing to do with generics or other new features of jdk1.5.0, it is just a plain & simple anonymous class compilation.

This is my observation about anonymous class compilation with jdk1.5.0 beta - >>
///////////////////////

This is the naming convention for compiled anonymous classes with jdk1.4.2:
className.java
className.class
className$1.class


This is the naming convention for compiled anonymous classes WITH jdk1.5.0 beta:
className.java
className.class
className+1.class


do other people agree with this?

thanks,
Keith
[ May 31, 2004: Message edited by: Keith Thompson ]
 
Nick George
Ranch Hand
Posts: 815
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As long as we're on the topic of naming conventions, shouldn't it be ClassName.class?
 
Jeroen Wenting
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes, the $ in the filenames for inner classes (or maybe just for anonymous ones) as generated by J2SDK 1.5.0 has been changed into a + from the filenames generated by earlier versions.
 
Keith Thompson
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks!


Do you know of any documentation for this? I looked all over but I could not find anything.

thanks!
Keith
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic