Catch blocks should not be generated inline.

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Won't Fix
    • Priority: P5
    • None
    • Affects Version/s: 1.2.0
    • Component/s: tools
    • generic
    • solaris_2.5.1

      The catch blocks for try-catch statements are generated inline. This means
      that we can end up with a goto in the middle of a loop that does
      a try-catch. This penalizes the use of try-catch even when it is not used.

      Don't believe me? Compile and disassemble the following code:

      public class TryLoop {
          public static void foobar() throws Exception {
      System.out.println("hello");
          }

          public static void main(String[] args) {
      for (int i = 0; i < 10; i++) {
      System.out.println(i);
      try {
      foobar();
      } catch (Exception ee) {
      System.out.println("Exception");
      }
      System.out.println(i);
      }
          }
      }

            Assignee:
            Neal Gafter (Inactive)
            Reporter:
            Todd Turnidge (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: