Uploaded image for project: 'Tools (JBoss Tools)'
  1. Tools (JBoss Tools)
  2. JBIDE-9175

IndexOutOfBoundsExeption dialog when empty DB is used for code gereration

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Blocker
    • Resolution: Done
    • Affects Version/s: 3.3.0.M1
    • Fix Version/s: 4.0.0.Final
    • Component/s: hibernate
    • Labels:
      None
    • Environment:

      JBT 3.3.0.m1, L64, mysql

    • Steps to Reproduce:
      Hide

      EXECUTE: Create Hibernate Configuration with empty or no mysql database defined (dbc:mysql://<ip_only>[/empty])
      EXECUTE: Create Hibernate Code Generation Configuration for it
      EXECUTE: Run it
      ASSERT: It should run without errors or warning explaining that nothing will be generated should be displayed.

      Show
      EXECUTE: Create Hibernate Configuration with empty or no mysql database defined (dbc:mysql://<ip_only> [/empty] ) EXECUTE: Create Hibernate Code Generation Configuration for it EXECUTE: Run it ASSERT: It should run without errors or warning explaining that nothing will be generated should be displayed.

      Description

      java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
      at java.util.ArrayList.RangeCheck(ArrayList.java:547)
      at java.util.ArrayList.remove(ArrayList.java:387)
      at org.hibernate.tool.hbm2x.DocExporter.generatePackageSummary(DocExporter.java:386)
      at org.hibernate.tool.hbm2x.DocExporter.doStart(DocExporter.java:161)
      at org.hibernate.tool.hbm2x.AbstractExporter.start(AbstractExporter.java:95)
      at org.hibernate.eclipse.launch.CodeGenerationLaunchDelegate$1.execute(CodeGenerationLaunchDelegate.java:408)
      at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:63)
      at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:72)
      at org.hibernate.eclipse.launch.CodeGenerationLaunchDelegate.runExporters(CodeGenerationLaunchDelegate.java:383)
      at org.hibernate.eclipse.launch.CodeGenerationLaunchDelegate.launch(CodeGenerationLaunchDelegate.java:310)
      at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:854)
      at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:703)
      at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:925)
      at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1129)
      at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

        Gliffy Diagrams

          Activity

          Hide
          dgeraskov Dmitry Geraskov added a comment -

          Max, please review the patch

          Show
          dgeraskov Dmitry Geraskov added a comment - Max, please review the patch
          Hide
          maxandersen Max Rydahl Andersen added a comment -

          i've merged into hibernate tools core.

          Show
          maxandersen Max Rydahl Andersen added a comment - i've merged into hibernate tools core.
          Hide
          jpeterka Jiri Peterka added a comment -

          Looks good, verified in JBDS 5.0.M5 jbdevstudio-product-universal-5.0.0.v201112090214M-H53-M5.jar

          Show
          jpeterka Jiri Peterka added a comment - Looks good, verified in JBDS 5.0.M5 jbdevstudio-product-universal-5.0.0.v201112090214M-H53-M5.jar
          Show
          dgeraskov Dmitry Geraskov added a comment - I don't see the code applied: branch(3.4) https://github.com/hibernate/hibernate-tools/blob/3.4.x/src/java/org/hibernate/tool/hbm2x/DocExporter.java master(3.5) https://github.com/hibernate/hibernate-tools/blob/master/src/java/org/hibernate/tool/hbm2x/DocExporter.java
          Hide
          koen.aers Koen Aers added a comment -

          pull request 13 was integrated and applied:

          • on 4.0.x with pull request 31
          • on 3.6.x with pull request 30
          • on 3.4.x with pull request 28
          Show
          koen.aers Koen Aers added a comment - pull request 13 was integrated and applied: on 4.0.x with pull request 31 on 3.6.x with pull request 30 on 3.4.x with pull request 28

            People

            • Assignee:
              maxandersen Max Rydahl Andersen
              Reporter:
              jpeterka Jiri Peterka
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development