Tools (JBoss Tools)
  1. Tools (JBoss Tools)
  2. JBIDE-7991

HQL Editor - StringIndexOutOfBoundsException

    Details

    • Workaround:
      Workaround Exists
    • Workaround Description:
      Hide

      do not use tabs in HQL editor

      Show
      do not use tabs in HQL editor
    • Similar Issues:
      Show 10 results 

      Description

      select[\t] [\t]t1.[cursor is here] from org.small.jpa.bbb t1
      Press Ctrl+Space for context help.

      initial source: https://forum.hibernate.org/viewtopic.php?f=6&t=1008359

      Error in Error Log:

      Error while performing HQL completion

      An exception stack trace is not available.

      java.lang.StringIndexOutOfBoundsException: String index out of range: 39

      java.lang.StringIndexOutOfBoundsException: String index out of range: 39
      at java.lang.String.<init>(String.java:211)
      at java.lang.String.valueOf(String.java:2865)
      at org.hibernate.tool.ide.completion.HQLAnalyzer.getSubQueries(HQLAnalyzer.java:206)
      at org.hibernate.tool.ide.completion.HQLAnalyzer.getVisibleSubQueries(HQLAnalyzer.java:130)
      at org.hibernate.tool.ide.completion.HQLAnalyzer.getVisibleEntityNames(HQLAnalyzer.java:142)
      at org.hibernate.tool.ide.completion.HQLCodeAssist.codeComplete(HQLCodeAssist.java:41)
      at org.hibernate.eclipse.hqleditor.HQLCompletionProcessor.computeProposals(HQLCompletionProcessor.java:138)
      at org.hibernate.eclipse.hqleditor.HQLCompletionProcessor.computeCompletionProposals(HQLCompletionProcessor.java:81)
      at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1834)
      at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:556)
      at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:553)
      at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:488)
      at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
      at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:482)
      at org.eclipse.jface.text.contentassist.ContentAssistant.showPossibleCompletions(ContentAssistant.java:1660)
      at org.hibernate.eclipse.hqleditor.HQLSourceViewer.doOperation(HQLSourceViewer.java:58)
      at org.eclipse.ui.texteditor.TextOperationAction$1.run(TextOperationAction.java:131)
      at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
      at org.eclipse.ui.texteditor.TextOperationAction.run(TextOperationAction.java:129)
      at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
      at org.eclipse.ui.commands.ActionHandler.execute(ActionHandler.java:185)
      at org.eclipse.ui.internal.handlers.LegacyHandlerWrapper.execute(LegacyHandlerWrapper.java:109)
      at org.eclipse.core.commands.Command.executeWithChecks(Command.java:476)
      at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508)
      at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:169)
      at org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeCommand(WorkbenchKeyboard.java:468)
      at org.eclipse.ui.internal.keys.WorkbenchKeyboard.press(WorkbenchKeyboard.java:786)
      at org.eclipse.ui.internal.keys.WorkbenchKeyboard.processKeyEvent(WorkbenchKeyboard.java:885)
      at org.eclipse.ui.internal.keys.WorkbenchKeyboard.filterKeySequenceBindings(WorkbenchKeyboard.java:567)
      at org.eclipse.ui.internal.keys.WorkbenchKeyboard.access$3(WorkbenchKeyboard.java:508)
      at org.eclipse.ui.internal.keys.WorkbenchKeyboard$KeyDownFilter.handleEvent(WorkbenchKeyboard.java:123)
      at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
      at org.eclipse.swt.widgets.Display.filterEvent(Display.java:1253)
      at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1052)
      at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1077)
      at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1062)
      at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1103)
      at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1099)
      at org.eclipse.swt.widgets.Widget.wmChar(Widget.java:1508)
      at org.eclipse.swt.widgets.Control.WM_CHAR(Control.java:4268)
      at org.eclipse.swt.widgets.Canvas.WM_CHAR(Canvas.java:345)
      at org.eclipse.swt.widgets.Control.windowProc(Control.java:4160)
      at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:341)
      at org.eclipse.swt.widgets.Display.windowProc(Display.java:4873)
      at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
      at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2459)
      at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3655)
      at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2629)
      at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2593)
      at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2427)
      at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:670)
      at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
      at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:663)
      at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
      at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
      at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
      at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
      at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
      at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
      at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619)
      at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
      at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
      at org.eclipse.equinox.launcher.Main.main(Main.java:1383)

      java.lang.StringIndexOutOfBoundsException: String index out of range: 39

      java.lang.StringIndexOutOfBoundsException: String index out of range: 39
      at java.lang.String.<init>(String.java:211)
      at java.lang.String.valueOf(String.java:2865)
      at org.hibernate.tool.ide.completion.HQLAnalyzer.getSubQueries(HQLAnalyzer.java:206)
      at org.hibernate.tool.ide.completion.HQLAnalyzer.getVisibleSubQueries(HQLAnalyzer.java:130)
      at org.hibernate.tool.ide.completion.HQLAnalyzer.getVisibleEntityNames(HQLAnalyzer.java:142)
      at org.hibernate.tool.ide.completion.HQLCodeAssist.codeComplete(HQLCodeAssist.java:41)
      at org.hibernate.eclipse.hqleditor.HQLCompletionProcessor.computeProposals(HQLCompletionProcessor.java:138)
      at org.hibernate.eclipse.hqleditor.HQLCompletionProcessor.computeCompletionProposals(HQLCompletionProcessor.java:81)
      at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1834)
      at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:556)
      at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:553)
      at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:488)
      at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
      at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:482)
      at org.eclipse.jface.text.contentassist.ContentAssistant.showPossibleCompletions(ContentAssistant.java:1660)
      at org.hibernate.eclipse.hqleditor.HQLSourceViewer.doOperation(HQLSourceViewer.java:58)
      at org.eclipse.ui.texteditor.TextOperationAction$1.run(TextOperationAction.java:131)
      at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
      at org.eclipse.ui.texteditor.TextOperationAction.run(TextOperationAction.java:129)
      at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
      at org.eclipse.ui.commands.ActionHandler.execute(ActionHandler.java:185)
      at org.eclipse.ui.internal.handlers.LegacyHandlerWrapper.execute(LegacyHandlerWrapper.java:109)
      at org.eclipse.core.commands.Command.executeWithChecks(Command.java:476)
      at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508)
      at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:169)
      at org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeCommand(WorkbenchKeyboard.java:468)
      at org.eclipse.ui.internal.keys.WorkbenchKeyboard.press(WorkbenchKeyboard.java:786)
      at org.eclipse.ui.internal.keys.WorkbenchKeyboard.processKeyEvent(WorkbenchKeyboard.java:885)
      at org.eclipse.ui.internal.keys.WorkbenchKeyboard.filterKeySequenceBindings(WorkbenchKeyboard.java:567)
      at org.eclipse.ui.internal.keys.WorkbenchKeyboard.access$3(WorkbenchKeyboard.java:508)
      at org.eclipse.ui.internal.keys.WorkbenchKeyboard$KeyDownFilter.handleEvent(WorkbenchKeyboard.java:123)
      at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
      at org.eclipse.swt.widgets.Display.filterEvent(Display.java:1253)
      at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1052)
      at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1077)
      at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1062)
      at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1103)
      at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1099)
      at org.eclipse.swt.widgets.Widget.wmChar(Widget.java:1508)
      at org.eclipse.swt.widgets.Control.WM_CHAR(Control.java:4268)
      at org.eclipse.swt.widgets.Canvas.WM_CHAR(Canvas.java:345)
      at org.eclipse.swt.widgets.Control.windowProc(Control.java:4160)
      at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:341)
      at org.eclipse.swt.widgets.Display.windowProc(Display.java:4873)
      at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
      at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2459)
      at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3655)
      at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2629)
      at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2593)
      at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2427)
      at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:670)
      at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
      at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:663)
      at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
      at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
      at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
      at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
      at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
      at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
      at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619)
      at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
      at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
      at org.eclipse.equinox.launcher.Main.main(Main.java:1383)

      1. JBIDE-7991_20101228.txt
        0.4 kB
        Vitali Yemialyanchyk
      2. JBIDE-7991_20110105_junit_test.txt
        1 kB
        Vitali Yemialyanchyk
      1. screenshot-1.jpg
        131 kB
      2. screenshot-2.jpg
        180 kB
      3. screenshot-3.jpg
        172 kB

        Activity

        Hide
        Dmitry Geraskov
        added a comment -

        Assign to me to review.

        Show
        Dmitry Geraskov
        added a comment - Assign to me to review.
        Hide
        Dmitry Geraskov
        added a comment -

        The patch fixed the problem and junit was povided.
        Max, could you please take a look, probably we would like to have this in 3.2.1?

        Show
        Dmitry Geraskov
        added a comment - The patch fixed the problem and junit was povided. Max, could you please take a look, probably we would like to have this in 3.2.1?
        Hide
        Max Rydahl Andersen
        added a comment -

        create a pull request and i'll review/merge it in.

        Show
        Max Rydahl Andersen
        added a comment - create a pull request and i'll review/merge it in.
        Hide
        Dmitry Geraskov
        added a comment -

        It shouldn't be fixed. This is hibernate tools issue and I sent pull request yesterday to apply the attached patch. Could you point me to the code you mentioned?

        Show
        Dmitry Geraskov
        added a comment - It shouldn't be fixed. This is hibernate tools issue and I sent pull request yesterday to apply the attached patch. Could you point me to the code you mentioned?
        Hide
        Jiri Peterka
        added a comment -

        Verified in jbds-eap-4.1.0.cr1-h527, L64

        Show
        Jiri Peterka
        added a comment - Verified in jbds-eap-4.1.0.cr1-h527, L64

          People

          • Assignee:
            Dmitry Geraskov
            Reporter:
            Vitali Yemialyanchyk
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: