| Author |
compiler output (.class files) differs if sources were compiled in different directories
|
Piter Octos
Greenhorn
Joined: Jul 01, 2011
Posts: 1
|
|
Hi,
I have following problem: while compiling some set of classes different .class files are generated if compilation was executed in different directories. The diff between generated .class files is following:
1) version:
1062: aload_3
1063: invokevirtual <some_method>
1066: goto 1078
1069: astore 15
1071: aload_3
1072: invokevirtual <some_method>
1075: aload 15
1077: athrow
1078: aload_3
1079: areturn
2) version:
1062: jsr 1076
1065: goto 1084
1068: astore 15
1070: jsr 1076
1073: aload 15
1075: athrow
1076: astore 16
1078: aload_3
1079: invokevirtual <some_method>
1082: ret 16
1084: aload_3
1085: areturn
Above code has the same execution logic. Unfortunately, I have to have explanation why jdk behaves this way. What is strange, sometimes even when compiling in the same directory, the same sources, difference between consecutive compilation occurs (always the same, mentioned above).
Any idea what happens?
Thanks in advance for response!
Cheers,
Octos
|
 |
John Jai
Bartender
Joined: May 31, 2011
Posts: 1778
|
|
Hi,
Is the output you posted is from a Java Decompiler tool? Is there any issue you faced while executing classes created for the same java file placed in different directories? Just curious on what made you to open and view class files!
|
 |
 |
|
|
subject: compiler output (.class files) differs if sources were compiled in different directories
|
|
|