StringIndexOutOfBoundsException while loading sources
Migrated from http://lampsvn.epfl.ch/trac/scala/ticket/1331
Reporter raboof
From the builder in the Eclipse plugin, I get:
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.<init>(String.java:222)
at scala.tools.nsc.util.BatchSourceFile.identifier(SourceFile.scala:74)
at scala.tools.editor.TypersPresentations$ProjectImpl$Compiler$$anonfun$loadSource$1.apply(TypersPresentations.scala:93)
at scala.tools.editor.TypersPresentations$ProjectImpl$Compiler$$anonfun$loadSource$1.apply(TypersPresentations.scala:93)
at scala.tools.nsc.symtab.SymbolWalker$class.f$1(SymbolWalker.scala:49)
at scala.tools.nsc.symtab.SymbolWalker$class.walk(SymbolWalker.scala:251)
at scala.tools.editor.TypersPresentations$ProjectImpl$walker$.walk(TypersPresentations.scala:130)
at scala.tools.editor.TypersPresentations$ProjectImpl$Compiler$class.loadSource(TypersPresentations.scala:93)
at scala.tools.eclipse.ScalaPlugin$ProjectImpl$compiler0$.loadSource(ScalaPlugin.scala:148)
at scala.tools.editor.TypersPresentations$ProjectImpl$$anonfun$scala$tools$editor$TypersPresentations$ProjectImpl$$loadSource$1.apply(TypersPresentations.scala:141)
at scala.tools.editor.TypersPresentations$ProjectImpl$$anonfun$scala$tools$editor$TypersPresentations$ProjectImpl$$loadSource$1.apply(TypersPresentations.scala:140)
at lampion.presentation.Presentations$ProjectImpl$class.tryLockTyper(Presentations.scala:319)
at scala.tools.eclipse.Driver$Project.tryLockTyper(Driver.scala:16)
at scala.tools.editor.TypersPresentations$ProjectImpl$class.scala$tools$editor$TypersPresentations$ProjectImpl$$loadSource(TypersPresentations.scala:140)
at scala.tools.editor.TypersPresentations$ProjectImpl$FileImpl$class.unloadedBody(TypersPresentations.scala:241)
at scala.tools.eclipse.Driver$Project$File.unloadedBody(Driver.scala:21)
at scala.tools.eclipse.ScalaUIPlugin$ProjectImpl$FileImpl$class.$init$(ScalaUIPlugin.scala:122)
at scala.tools.eclipse.Driver$Project$File.<init>(Driver.scala:21)
at scala.tools.eclipse.Driver$Project.File(Driver.scala:20)
at scala.tools.eclipse.Driver$Project.File(Driver.scala:16)
at lampion.eclipse.Plugin$ProjectImpl$$anon$2.default(Plugin.scala:210)
at lampion.eclipse.Plugin$ProjectImpl$$anon$2.default(Plugin.scala:207)
at scala.collection.Map$class.apply(Map.scala:80)
at scala.collection.jcl.LinkedHashMap.apply(LinkedHashMap.scala:18)
at lampion.eclipse.Plugin$ProjectImpl$class.fileSafe(Plugin.scala:218)
at scala.tools.eclipse.Driver$Project.fileSafe(Driver.scala:16)
at lampion.eclipse.Builder$$anonfun$build$3$$anon$3.visit(Builder.scala:71)
at org.eclipse.core.internal.resources.Resource$2.visit(Resource.java:106)
at org.eclipse.core.internal.resources.Resource$1.visitElement(Resource.java:58)
at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:81)
at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:85)
at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:85)
at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:85)
at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:85)
at org.eclipse.core.internal.watson.ElementTreeIterator.iterate(ElementTreeIterator.java:126)
at org.eclipse.core.internal.resources.Resource.accept(Resource.java:68)
at org.eclipse.core.internal.resources.Resource.accept(Resource.java:104)
at org.eclipse.core.internal.resources.Resource.accept(Resource.java:88)
at lampion.eclipse.Builder$$anonfun$build$3.apply(Builder.scala:67)
at lampion.eclipse.Builder$$anonfun$build$3.apply(Builder.scala:67)
at scala.Iterator$class.foreach(Iterator.scala:410)
at scala.runtime.BoxedArray$$anon$2.foreach(BoxedArray.scala:45)
at scala.Iterable$class.foreach(Iterable.scala:256)
at scala.runtime.BoxedArray.foreach(BoxedArray.scala:24)
at lampion.eclipse.Builder.build(Builder.scala:67)
at scala.tools.eclipse.Builder.build(Builder.scala:30)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:633)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:170)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:201)
at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:253)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:256)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:309)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:341)
at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:140)
at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:238)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Unfortunately the project is pretty big, for other projects the issue doesn't seem to be hit.
Not sure whether this should be a 'Compiler' or 'Eclipse plugin' issue, but the trace seems to go sufficiently 'deep down' that Compiler is warranted.
Reporter raboof
From the builder in the Eclipse plugin, I get:
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.<init>(String.java:222)
at scala.tools.nsc.util.BatchSourceFile.identifier(SourceFile.scala:74)
at scala.tools.editor.TypersPresentations$ProjectImpl$Compiler$$anonfun$loadSource$1.apply(TypersPresentations.scala:93)
at scala.tools.editor.TypersPresentations$ProjectImpl$Compiler$$anonfun$loadSource$1.apply(TypersPresentations.scala:93)
at scala.tools.nsc.symtab.SymbolWalker$class.f$1(SymbolWalker.scala:49)
at scala.tools.nsc.symtab.SymbolWalker$class.walk(SymbolWalker.scala:251)
at scala.tools.editor.TypersPresentations$ProjectImpl$walker$.walk(TypersPresentations.scala:130)
at scala.tools.editor.TypersPresentations$ProjectImpl$Compiler$class.loadSource(TypersPresentations.scala:93)
at scala.tools.eclipse.ScalaPlugin$ProjectImpl$compiler0$.loadSource(ScalaPlugin.scala:148)
at scala.tools.editor.TypersPresentations$ProjectImpl$$anonfun$scala$tools$editor$TypersPresentations$ProjectImpl$$loadSource$1.apply(TypersPresentations.scala:141)
at scala.tools.editor.TypersPresentations$ProjectImpl$$anonfun$scala$tools$editor$TypersPresentations$ProjectImpl$$loadSource$1.apply(TypersPresentations.scala:140)
at lampion.presentation.Presentations$ProjectImpl$class.tryLockTyper(Presentations.scala:319)
at scala.tools.eclipse.Driver$Project.tryLockTyper(Driver.scala:16)
at scala.tools.editor.TypersPresentations$ProjectImpl$class.scala$tools$editor$TypersPresentations$ProjectImpl$$loadSource(TypersPresentations.scala:140)
at scala.tools.editor.TypersPresentations$ProjectImpl$FileImpl$class.unloadedBody(TypersPresentations.scala:241)
at scala.tools.eclipse.Driver$Project$File.unloadedBody(Driver.scala:21)
at scala.tools.eclipse.ScalaUIPlugin$ProjectImpl$FileImpl$class.$init$(ScalaUIPlugin.scala:122)
at scala.tools.eclipse.Driver$Project$File.<init>(Driver.scala:21)
at scala.tools.eclipse.Driver$Project.File(Driver.scala:20)
at scala.tools.eclipse.Driver$Project.File(Driver.scala:16)
at lampion.eclipse.Plugin$ProjectImpl$$anon$2.default(Plugin.scala:210)
at lampion.eclipse.Plugin$ProjectImpl$$anon$2.default(Plugin.scala:207)
at scala.collection.Map$class.apply(Map.scala:80)
at scala.collection.jcl.LinkedHashMap.apply(LinkedHashMap.scala:18)
at lampion.eclipse.Plugin$ProjectImpl$class.fileSafe(Plugin.scala:218)
at scala.tools.eclipse.Driver$Project.fileSafe(Driver.scala:16)
at lampion.eclipse.Builder$$anonfun$build$3$$anon$3.visit(Builder.scala:71)
at org.eclipse.core.internal.resources.Resource$2.visit(Resource.java:106)
at org.eclipse.core.internal.resources.Resource$1.visitElement(Resource.java:58)
at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:81)
at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:85)
at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:85)
at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:85)
at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:85)
at org.eclipse.core.internal.watson.ElementTreeIterator.iterate(ElementTreeIterator.java:126)
at org.eclipse.core.internal.resources.Resource.accept(Resource.java:68)
at org.eclipse.core.internal.resources.Resource.accept(Resource.java:104)
at org.eclipse.core.internal.resources.Resource.accept(Resource.java:88)
at lampion.eclipse.Builder$$anonfun$build$3.apply(Builder.scala:67)
at lampion.eclipse.Builder$$anonfun$build$3.apply(Builder.scala:67)
at scala.Iterator$class.foreach(Iterator.scala:410)
at scala.runtime.BoxedArray$$anon$2.foreach(BoxedArray.scala:45)
at scala.Iterable$class.foreach(Iterable.scala:256)
at scala.runtime.BoxedArray.foreach(BoxedArray.scala:24)
at lampion.eclipse.Builder.build(Builder.scala:67)
at scala.tools.eclipse.Builder.build(Builder.scala:30)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:633)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:170)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:201)
at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:253)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:256)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:309)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:341)
at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:140)
at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:238)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Unfortunately the project is pretty big, for other projects the issue doesn't seem to be hit.
Not sure whether this should be a 'Compiler' or 'Eclipse plugin' issue, but the trace seems to go sufficiently 'deep down' that Compiler is warranted.
Leave a comment
on 2008-09-10 00:23 *
By tracImporter
Trac author: raboof
I just noticed there are non-UTF-8 characters in some of the Java files in this project, will verify if this is causing the problem.
I just noticed there are non-UTF-8 characters in some of the Java files in this project, will verify if this is causing the problem.
on 2008-09-10 01:27 *
By tracImporter
Trac author: raboof
Indeed, after removing the last non-UTF-8-character from my Java files the error seems to have disappeared.
It would be nice if this problem was reported more clearly (e.g., in what file did the failure occur, what are possible causes, etc), and recovered from by continuing parsing any other files instead of bailing out the entire process.
Indeed, after removing the last non-UTF-8-character from my Java files the error seems to have disappeared.
It would be nice if this problem was reported more clearly (e.g., in what file did the failure occur, what are possible causes, etc), and recovered from by continuing parsing any other files instead of bailing out the entire process.
on 2008-09-12 16:45 *
By tracImporter
Trac author: raboof
Either somebody fixed this or it's not reliably reproducable yet: now I get a proper error message...
'IO error while decoding ... with UTF-8 Please try specifying another one using the -encoding option'
Either somebody fixed this or it's not reliably reproducable yet: now I get a proper error message...
'IO error while decoding ... with UTF-8 Please try specifying another one using the -encoding option'
on 2008-11-01 07:36 *
By tracImporter
Trac author: mcdirmid
Note that encoding is not set by -encoding in Eclipse, instead set the encoding for a file in the file/folder/project properties tabs. The error message should be different in the Eclipse plugin to reflect this, can someone in devteam do that?
Note that encoding is not set by -encoding in Eclipse, instead set the encoding for a file in the file/folder/project properties tabs. The error message should be different in the Eclipse plugin to reflect this, can someone in devteam do that?
Updating tickets (#1000069, #1000195, #1000213, #1000223, #1000006, #1000021, #1000038, #1000048, #1000051, #1000052, #1000075, #1000103, #1000109, #1000115, #1000119, #1000156, #1000186, #1000207, #1000238, #1000262, #1000263, #380, #389, #683, #1238, #1331, #1635, #1645, #1715, #1729, #1744, #1783, #1839, #1869, #1885, #1890, #1902, #1918, #1919, #1924, #1925, #1946, #1964, #1991, #2131, #2233, #2342, #2348, #2408, #2459, #2499, #2523, #2572, #2582, #2602, #2614, #2615, #2675, #2710, #2745, #2763, #2816, #2830, #2834, #2878, #2879, #2887, #2888, #2901, #2911, #2912, #2922, #2937, #2938, #2942, #2951, #2955, #2957, #2961, #2964, #2965, #2974, #2975, #2989, #2990, #3002, #3055, #3070, #3087, #3135, #3139, #3173, #3182, #3184, #3200, #3213, #3214, #3221, #3243, #3251)
on 2011-03-24 19:18 *
By Iulian Dragos
Updating tickets (#1000199, #1000200, #1000201, #1000204, #1000205, #1000209, #1000210, #1000211, #1000212, #1000215, #1000217, #1000218, #1000220, #1000222, #1000226, #1000227, #1000228, #1000230, #1000231, #1000232, #1000233, #1000235, #1000236, #1000237, #1000239, #1000240, #1000241, #1000242, #1000243, #1000244, #1000248, #1000249, #1000252, #1000253, #1000254, #1000255, #1000256, #1000258, #1000259, #1000032, #1000059, #1000062, #1000163, #1000197, #1000216, #1000221, #1000224, #1000121, #1000175, #1000219, #1000251, #1000069, #1000195, #1000213, #1000223, #1000006, #1000021, #1000038, #1000048, #1000051, #1000052, #1000075, #1000103, #1000109, #1000115, #1000119, #1000156, #1000186, #1000207, #1000238, #1000262, #1000263, #380, #389, #683, #1238, #1331, #1635, #1645, #1715, #1729, #1744, #1783, #1839, #1869, #1885, #1890, #1902, #1918, #1919, #1924, #1925, #1946, #1964, #1991, #2131, #2233, #2342, #2348, #2408)
on 2012-01-23 13:05 *
By skyluc
Type changed from Defect to Enhancement
Version set to 2.0.0-final-29
Eclipse version set to All
Assigned to changed from login to -none-
Component changed from None to builder
Milestone changed from Backlog to Enhancements
Permission type changed from None to Public
Status changed from New to Accepted
The error message is not really useful in the context of Scala IDE.
It should be swap with a better one if a clean way to tweak compiler messages is created.
It should be swap with a better one if a clean way to tweak compiler messages is created.
Probably fixed long ago.