Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Normalization changes when class is compiled with -g:none #33

Open
fweimer opened this issue Aug 4, 2014 · 2 comments
Open

Normalization changes when class is compiled with -g:none #33

fweimer opened this issue Aug 4, 2014 · 2 comments

Comments

@fweimer
Copy link
Contributor

fweimer commented Aug 4, 2014

If the class file does not contain any debugging information (if it was compiled with -g:none, or if it was stripped later), the normalization changes because BCEL replaces the source file name with <Unknown>. I think this is not desirable at all. javac code generation might change in corner cases depending on whether debugging information is generated or not (I haven't checked this), but this direct dependency on the debugging information is unnecessary.

@fweimer fweimer changed the title Normalization changes when class is compiled with -g:none Normalization changes when class is compiled with -g:none Aug 4, 2014
@abn abn added the enhancement label Aug 9, 2014
@abn
Copy link
Member

abn commented Aug 9, 2014

@fweimer do you have a patch for this?

@abn abn added triage labels Aug 9, 2014
@fweimer
Copy link
Contributor Author

fweimer commented Aug 11, 2014

@abn, not yet. Until the next great hashing bump, is probably best to create an artificial value for the SourceFile attribute if it is missing, derived from the class name, i.e. for a class named org/example/Toplevel$Nested, the SourceFile attribute value would be "Toplevel.java". This will be the correct file name almost all the time, except when a single .java file defines multiple top-level classes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants