Uploaded image for project: 'Spring Roo'
  1. Spring Roo
  2. ROO-3314

roo cannot work with try - multi-catch

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Blocker
    • Resolution: Invalid
    • Affects Version/s: 1.2.2.RELEASE
    • Fix Version/s: None
    • Component/s: @ ROO SHELL
    • Labels:
      None
    • Environment:
      jdk 1.7

      Description

      I totally got mad about errors on the roo shell like

      Encountered " "|" "| "" at line 130, column 43.
      Was expecting one of:
      <IDENTIFIER> ...
      "..." ...

      see also http://forum.springsource.org/showthread.php?132753-how-to-debug-Encountered-quot-quot-quot-quot-quot-quot-at-line-129-column-43

      So I finally run a bash script over all my files to find out, whats on the given lines...

      It seems Spring Roo cannot accept try -multi-catch statements.
      I had something like

      catch (NoSuchAlgorithmException|IOException e) {

      somewhere and replaced it with two catch clauses and the error on the ROO-shell was gone.

      Is Roo not yet working correctly with Java 7, or needs it only a fix for multi-catch?

        Issue Links

          Activity

          Hide
          menno.j Menno Jansz added a comment -

          I have experienced the same errors with multi-catch blocks. Even with "development mode true" the roo shell does not output the filename where the problem occurs, which does not help.

          A similar error occurs when you have code such as "new ArrayList<>()", which roo also can't handle. We can live with that, but not the crash on multi-catch blocks. It makes roo completely unusable for us if we have to replace all multi-catches.

          Show
          menno.j Menno Jansz added a comment - I have experienced the same errors with multi-catch blocks. Even with "development mode true" the roo shell does not output the filename where the problem occurs, which does not help. A similar error occurs when you have code such as "new ArrayList<>()", which roo also can't handle. We can live with that, but not the crash on multi-catch blocks. It makes roo completely unusable for us if we have to replace all multi-catches.
          Hide
          stewarta Alan Stewart added a comment -

          Please log an issue with a clear title and provide the exact steps to reproduce it. Attach a Roo script and/or a Roo project using the shell's backup command.
          There is not enough information in this ticket nor in the forum post for us to do anything.
          Thanks

          Show
          stewarta Alan Stewart added a comment - Please log an issue with a clear title and provide the exact steps to reproduce it. Attach a Roo script and/or a Roo project using the shell's backup command. There is not enough information in this ticket nor in the forum post for us to do anything. Thanks
          Hide
          menno.j Menno Jansz added a comment -

          Roo simply cannot handle a multi-catch block.

          Add the following code in any class to reproduce:

          try

          { if(true) throw(new InstantiationException()); throw(new IllegalAccessException()); }

          catch(InstantiationException | IllegalAccessException e)
          {
          }

          Add the following code for the second similar error I mentioned:

          new ArrayList<>();

          Show
          menno.j Menno Jansz added a comment - Roo simply cannot handle a multi-catch block. Add the following code in any class to reproduce: try { if(true) throw(new InstantiationException()); throw(new IllegalAccessException()); } catch(InstantiationException | IllegalAccessException e) { } Add the following code for the second similar error I mentioned: new ArrayList<>();
          Hide
          stewarta Alan Stewart added a comment -

          Roo doesn't support Java 7 yet. The type-binding library used is JavaParser which seems a dead project now. We need to find a new type-binding library like Eclipse JDT to support later versions of Java.

          Show
          stewarta Alan Stewart added a comment - Roo doesn't support Java 7 yet. The type-binding library used is JavaParser which seems a dead project now. We need to find a new type-binding library like Eclipse JDT to support later versions of Java.
          Hide
          stewarta Alan Stewart added a comment -

          ROO-3106 was opened to support Java 7 and beyond. Feel free to contribute to Roo as well.

          Show
          stewarta Alan Stewart added a comment - ROO-3106 was opened to support Java 7 and beyond. Feel free to contribute to Roo as well.

            People

            • Assignee:
              stewarta Alan Stewart
              Reporter:
              thetoaster Roman Haag
            • Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: