Results 1 to 4 of 4
  1. #1
    Octos is offline Member
    Join Date
    Jul 2011
    Posts
    2
    Rep Power
    0

    Default compiler output (.class files) differs if sources were compiled in different director

    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

  2. #2
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,023
    Blog Entries
    7
    Rep Power
    20

    Default

    Strange ... can you show us that source of the code that produces different compiler output?

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  3. #3
    Octos is offline Member
    Join Date
    Jul 2011
    Posts
    2
    Rep Power
    0

    Default

    The problematic method is something like:

    public Object methodName() {
    try {
    // something about 250 lines of code, no catch
    } finally {
    var.method();
    }

    return var;
    }

  4. #4
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,023
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by Octos View Post
    The problematic method is something like:

    public Object methodName() {
    try {
    // something about 250 lines of code, no catch
    } finally {
    var.method();
    }

    return var;
    }
    So no checked Exceptions are thrown in those 250 lines of code? (otherwise your code wouldn't compile). I'v never seen behaviour as you described ...

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

Similar Threads

  1. Compiler and files question
    By amro in forum New To Java
    Replies: 0
    Last Post: 10-31-2010, 06:08 PM
  2. Compiler Output Window Issue
    By sweetpea123 in forum New To Java
    Replies: 2
    Last Post: 04-10-2010, 05:56 PM
  3. Replies: 2
    Last Post: 10-01-2009, 11:02 AM
  4. Java to build a GUI for a web-director-cabin
    By adrjork in forum New To Java
    Replies: 0
    Last Post: 08-11-2009, 08:36 AM
  5. Where can I find the Compiler Output?
    By hannehomuth in forum Advanced Java
    Replies: 1
    Last Post: 10-03-2008, 01:06 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •