Skip to content
This repository has been archived by the owner on Jun 22, 2023. It is now read-only.

Exception in plugin: String index out of range: -1 #9

Closed
egaga opened this issue Jun 1, 2016 · 1 comment
Closed

Exception in plugin: String index out of range: -1 #9

egaga opened this issue Jun 1, 2016 · 1 comment
Assignees
Labels

Comments

@egaga
Copy link
Member

egaga commented Jun 1, 2016

Got the following exception. Not sure what was the actual sql that caused the exception.

Version 0.4.0 (2015-11-27)

String index out of range: -1
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
    at java.lang.String.substring(String.java:1967)
    at fi.evident.dalesbred.plugin.idea.utils.SqlUtils.normalizeAlias(SqlUtils.java:195)
    at fi.evident.dalesbred.plugin.idea.utils.SqlUtils.parseSelectItem(SqlUtils.java:156)
    at fi.evident.dalesbred.plugin.idea.utils.SqlUtils.parseSelectList(SqlUtils.java:144)
    at fi.evident.dalesbred.plugin.idea.utils.SqlUtils.selectList(SqlUtils.java:69)
    at fi.evident.dalesbred.plugin.idea.utils.SqlUtils.selectVariables(SqlUtils.java:47)
    at fi.evident.dalesbred.plugin.idea.inspections.DalesbredInstantiationInspection.verifyFind(DalesbredInstantiationInspection.java:101)
    at fi.evident.dalesbred.plugin.idea.inspections.DalesbredInstantiationInspection.access$300(DalesbredInstantiationInspection.java:45)
    at fi.evident.dalesbred.plugin.idea.inspections.DalesbredInstantiationInspection$1.visitMethodCallExpression(DalesbredInstantiationInspection.java:70)
    at com.intellij.psi.impl.source.tree.java.PsiMethodCallExpressionImpl.accept(PsiMethodCallExpressionImpl.java:142)
    at com.intellij.codeInspection.InspectionEngine.acceptElements(InspectionEngine.java:81)
    at com.intellij.codeInspection.InspectionEngine.createVisitorAndAcceptElements(InspectionEngine.java:69)
    at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.a(LocalInspectionsPass.java:294)
    at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.access$200(LocalInspectionsPass.java:73)
    at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass$2.process(LocalInspectionsPass.java:261)
    at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass$2.process(LocalInspectionsPass.java:256)
    at com.intellij.concurrency.ApplierCompleter.c(ApplierCompleter.java:128)
    at com.intellij.concurrency.ApplierCompleter.access$000(ApplierCompleter.java:44)
    at com.intellij.concurrency.ApplierCompleter$1.run(ApplierCompleter.java:91)
    at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1178)
    at com.intellij.concurrency.ApplierCompleter$2.run(ApplierCompleter.java:100)
    at com.intellij.openapi.progress.impl.CoreProgressManager.a(CoreProgressManager.java:446)
    at com.intellij.openapi.progress.impl.CoreProgressManager.a(CoreProgressManager.java:443)
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:392)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:54)
    at com.intellij.concurrency.ApplierCompleter.a(ApplierCompleter.java:112)
    at com.intellij.concurrency.ApplierCompleter.compute(ApplierCompleter.java:88)
    at jsr166e.CountedCompleter.exec(CountedCompleter.java:684)
    at jsr166e.ForkJoinTask.doExec(ForkJoinTask.java:260)
    at jsr166e.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:858)
    at jsr166e.ForkJoinPool.scan(ForkJoinPool.java:1687)
    at jsr166e.ForkJoinPool.runWorker(ForkJoinPool.java:1642)
    at jsr166e.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:108)
@egaga egaga added the bug label Jun 1, 2016
@komu
Copy link
Member

komu commented Jun 1, 2016

Perhaps you were in the middle of writing a statement because it seems that parsing select a as " will thrown an exception.

@komu komu closed this as completed in a0c8311 Jun 1, 2016
@komu komu self-assigned this Jun 1, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants