Reformat Producing Altered Class Files

Should I be surprised that when I use reformat, the newly produced class files are slightly different than the previous class files?

The basic idea being that source files that are merely reformatted should produce the same output class files, and thus is "safe" to do. I am sure the logic is flawed at this point, but I need something to back up why it is safe to use IntelliJ to reformat our existing source files to upper management.

Thanks for the help!

2 comments

Do you have debug info in your class files? Perhaps the line numbers
changed?
What if you turn it off?

"John Ragan" <jiveadmin@jetbrains.com> wrote in message
news:15013890.1048542743518.JavaMail.jrun@is.intellij.net...

Should I be surprised that when I use reformat, the newly produced class

files are slightly different than the previous class files?
>

The basic idea being that source files that are merely reformatted should

produce the same output class files, and thus is "safe" to do. I am sure
the logic is flawed at this point, but I need something to back up why it is
safe to use IntelliJ to reformat our existing source files to upper
management.
>

Thanks for the help!



0

In article <15013890.1048542743518.JavaMail.jrun@is.intellij.net>,
jiveadmin@jetbrains.com says...

Should I be surprised that when I use reformat, the newly produced class files are slightly different than the previous class files?

The basic idea being that source files that are merely reformatted should produce the same output class files, and thus is "safe" to do. I am sure the logic is flawed at this point, but I need something to back up why it is safe to use IntelliJ to reformat our existing source files to upper management.

Thanks for the help!

If reformatting changes the import statements (which it might, depending
on your Code Style settings), then the .class files wouldn't be byte-
for-byte equivalent with the old ones. There might be other reasons for
inequality, but this is one I can think of easily.

- Danny

0

Please sign in to leave a comment.