2

If I execute javap on my main application class across compiles (no source change), sometimes the order of functions differs. This is especially true if the build was executed in different environments.

Consider this output from two builds. Build 1:

...
static {};
public com.example.MyApplication();
...

Build 2:

...
public com.example.MyApplication();
static {};
...

This difference causes tools like pkgdiff to believe the class has changed between builds.

Is there a way to force the compiler to produce a stable output order?

Chris Betti
  • 2,721
  • 2
  • 27
  • 36
  • 5
    The order is not defined nor controllable. I suggest writing a tool to "sort" the output of javap to make it easier to compare them. – Peter Lawrey Mar 01 '16 at 17:31

0 Answers0