java.lang.StringIndexOutOfBoundsException

tip

Thrown by String methods to indicate that an index is either negative or greater than the size of the string. For some methods such as the charAt method, this exception also is thrown when the index is equal to the size of the string.


rafael

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

  • Tremendous long startup of Eclipse
    via pydev by gernjo
    ,
  • Using createSQLQuery with query like this "select column1, column2 ftom TESTTABLE where columnID=1234" cause an exception "java.lang.StringIndexOutOfBoundsException: String index out of range: 0" if "column1" or "column2" contains has a value '' (void string) so it no null but it contains no chars. The get method CharacterType.get(CharacterType.java:52) is calling java.lang.String.charAt(0) on a String instance with length zero. Steck Trace: java.lang.StringIndexOutOfBoundsException: String index out of range: 0 at java.lang.String.charAt(String.java:687) at org.hibernate.type.CharacterType.get(CharacterType.java:52) at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:184) at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:210) at org.hibernate.loader.custom.CustomLoader$ScalarResultColumnProcessor.extract(CustomLoader.java:497) at org.hibernate.loader.custom.CustomLoader$ResultRowProcessor.buildResultRow(CustomLoader.java:443) at org.hibernate.loader.custom.CustomLoader.getResultColumnOrRow(CustomLoader.java:340) at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:629) at org.hibernate.loader.Loader.doQuery(Loader.java:724) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259) at org.hibernate.loader.Loader.doList(Loader.java:2228) at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2125) at org.hibernate.loader.Loader.list(Loader.java:2120) at org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:312) at org.hibernate.impl.SessionImpl.listCustomQuery(SessionImpl.java:1722) at org.hibernate.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:165) at org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:175)
    via by Luca,
  • Propagation tool error
    via by 788869,
    • java.lang.StringIndexOutOfBoundsException: String index out of range: 0 at java.lang.String.charAt(String.java:687) at org.python.pydev.editor.codecompletion.revisited.javaintegration.AbstractJavaClassModule.createTokens(AbstractJavaClassModule.java:150) at org.python.pydev.editor.codecompletion.revisited.javaintegration.JavaZipModule.<init>(JavaZipModule.java:89) at org.python.pydev.editor.codecompletion.revisited.javaintegration.JythonModulesManagerUtils.createModuleFromJar(JythonModulesManagerUtils.java:19) at org.python.pydev.editor.codecompletion.revisited.ModulesManager.getModule(ModulesManager.java:481) at org.python.pydev.editor.codecompletion.revisited.ModulesManager.getModule(ModulesManager.java:414) at org.python.pydev.editor.codecompletion.revisited.ProjectModulesManager.getModuleInDirectManager(ProjectModulesManager.java:305) at org.python.pydev.editor.codecompletion.revisited.ProjectModulesManager.getModuleAndRelatedModulesManager(ProjectModulesManager.java:278) at org.python.pydev.editor.codecompletion.revisited.ProjectModulesManager.getModule(ProjectModulesManager.java:245) at org.python.pydev.editor.codecompletion.revisited.ProjectModulesManager.getModule(ProjectModulesManager.java:231) at org.python.pydev.editor.codecompletion.revisited.AbstractASTManager.getModule(AbstractASTManager.java:395) at org.python.pydev.editor.codecompletion.revisited.AbstractASTManager.findModuleFromPath(AbstractASTManager.java:1334) at org.python.pydev.editor.codecompletion.revisited.AbstractASTManager.findOnImportedMods(AbstractASTManager.java:1216) at org.python.pydev.editor.codecompletion.revisited.AbstractASTManager.findOnImportedMods(AbstractASTManager.java:1115) at com.python.pydev.analysis.visitors.ImportChecker.visitImportToken(ImportChecker.java:150) at com.python.pydev.analysis.visitors.ImportChecker.visitImportToken(ImportChecker.java:132) at com.python.pydev.analysis.visitors.Scope.addImportTokens(Scope.java:168) at com.python.pydev.analysis.scopeanalysis.AbstractScopeAnalyzerVisitor.visitImportFrom(AbstractScopeAnalyzerVisitor.java:427) at org.python.pydev.parser.jython.ast.ImportFrom.accept(ImportFrom.java:38) at org.python.pydev.parser.jython.ast.Module.traverse(Module.java:34) at com.python.pydev.analysis.scopeanalysis.AbstractScopeAnalyzerVisitor.traverse(AbstractScopeAnalyzerVisitor.java:171) at com.python.pydev.analysis.visitors.OccurrencesVisitor.traverse(OccurrencesVisitor.java:214) at org.python.pydev.parser.jython.ast.VisitorBase.visitModule(VisitorBase.java:8) at org.python.pydev.parser.jython.ast.Module.accept(Module.java:27) at com.python.pydev.analysis.OccurrencesAnalyzer.analyzeDocument(OccurrencesAnalyzer.java:50) at com.python.pydev.analysis.OccurrencesAnalyzer.analyzeDocument(OccurrencesAnalyzer.java:38) at com.python.pydev.analysis.builder.AnalysisBuilderRunnable.doAnalysis(AnalysisBuilderRunnable.java:223) at com.python.pydev.analysis.builder.AbstractAnalysisBuilderRunnable.run(AbstractAnalysisBuilderRunnable.java:125) at com.python.pydev.analysis.builder.AnalysisBuilderVisitor$3.run(AnalysisBuilderVisitor.java:180) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

    Users with the same issue

    linxiaolong
    1 times, last one,
    Hronom
    32257 times, last one,
    balintn
    4 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    30 more bugmates