orc-lang / orc

Orc programming language implementation
https://orc.csres.utexas.edu/
BSD 3-Clause "New" or "Revised" License
41 stars 3 forks source link

StringIndexOutOfBoundsException in include path processing when running in plug-in under Windows #76

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Two users have reported StringIndexOutOfBoundsException in 
orc.compile.parse.OrcInputContext$class.looksLikeFilename

Version: Orc & Orc plug-in version version 2.0.0 
Platform: Windows

With the include path changed.  One user's include path was: 
${workspaceLoc}/learning/lib/orcsites;${workspaceLoc}/learning/lib/orc-sites-2.0
.0.jar;

Note lack of "." and Windows-style path list element separators

Exception occurs during include path search for standard prelude.

--------Stack trace:

Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String 
index out of range: 1
at java.lang.String.charAt(Unknown Source)
at scala.collection.immutable.StringLike$class.apply(StringLike.scala:54)
at scala.collection.immutable.StringOps.apply(StringOps.scala:31)
at orc.compile.parse.OrcInputContext$class.looksLikeFilename$1(Input.scala:118)
at orc.compile.parse.OrcInputContext$class.nameToURI$1(Input.scala:120)
at orc.compile.parse.OrcInputContext$$anonfun$resolve$1.apply(Input.scala:121)
at orc.compile.parse.OrcInputContext$$anonfun$resolve$1.apply(Input.scala:121)
at 
scala.collection.IndexedSeqOptimized$class.foldl(IndexedSeqOptimized.scala:64)
at 
scala.collection.IndexedSeqOptimized$class.foldLeft(IndexedSeqOptimized.scala:73
)
at scala.collection.mutable.WrappedArray.foldLeft(WrappedArray.scala:32)
at orc.compile.parse.OrcInputContext$class.resolve(Input.scala:121)
at 
orc.compile.StandardOrcCompiler$OrcNullInputContext$.resolve(OrcCompiler.scala:2
95)
at orc.compile.parse.OrcInputContext$class.newInputFromPath(Input.scala:125)
at 
orc.compile.StandardOrcCompiler$OrcNullInputContext$.newInputFromPath(OrcCompile
r.scala:295)
at 
orc.compile.StandardOrcCompiler$$anonfun$openInclude$2.apply(OrcCompiler.scala:3
15)
at 
orc.compile.StandardOrcCompiler$$anonfun$openInclude$2.apply(OrcCompiler.scala:3
08)
at scala.collection.Iterator$class.foreach(Iterator.scala:631)
at 
scala.collection.JavaConversions$JIteratorWrapper.foreach(JavaConversions.scala:
474)
at scala.collection.IterableLike$class.foreach(IterableLike.scala:79)
at 
scala.collection.JavaConversions$JCollectionWrapper.foreach(JavaConversions.scal
a:495)
at orc.compile.StandardOrcCompiler.openInclude(OrcCompiler.scala:308)
at 
orc.compile.CoreOrcCompiler$$anon$4$$anonfun$apply$6$$anonfun$1.apply(OrcCompile
r.scala:113)
at 
orc.compile.CoreOrcCompiler$$anon$4$$anonfun$apply$6$$anonfun$1.apply(OrcCompile
r.scala:112)
at 
scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:206)
at 
scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:206)
at scala.collection.Iterator$class.foreach(Iterator.scala:631)
at 
scala.collection.JavaConversions$JIteratorWrapper.foreach(JavaConversions.scala:
474)
at scala.collection.IterableLike$class.foreach(IterableLike.scala:79)
at 
scala.collection.JavaConversions$JListWrapper.foreach(JavaConversions.scala:521)
at scala.collection.TraversableLike$class.map(TraversableLike.scala:206)
at scala.collection.JavaConversions$JListWrapper.map(JavaConversions.scala:521)
at 
orc.compile.CoreOrcCompiler$$anon$4$$anonfun$apply$6.apply(OrcCompiler.scala:112
)
at 
orc.compile.CoreOrcCompiler$$anon$4$$anonfun$apply$6.apply(OrcCompiler.scala:105
)
at 
orc.compile.CompilerPhase$$anon$2$$anonfun$apply$2.apply(OrcCompiler.scala:70)
at 
orc.compile.CompilerPhase$$anon$1$$anonfun$apply$1.apply(OrcCompiler.scala:59)
at 
orc.compile.CompilerPhase$$anon$1$$anonfun$apply$1.apply(OrcCompiler.scala:59)
at 
orc.compile.CompilerPhase$$anon$1$$anonfun$apply$1.apply(OrcCompiler.scala:59)
at 
orc.compile.CompilerPhase$$anon$1$$anonfun$apply$1.apply(OrcCompiler.scala:59)
at 
orc.compile.CompilerPhase$$anon$1$$anonfun$apply$1.apply(OrcCompiler.scala:59)
at 
orc.compile.CompilerPhase$$anon$1$$anonfun$apply$1.apply(OrcCompiler.scala:59)
at 
orc.compile.CompilerPhase$$anon$1$$anonfun$apply$1.apply(OrcCompiler.scala:59)
at 
orc.compile.CompilerPhase$$anon$1$$anonfun$apply$1.apply(OrcCompiler.scala:59)
at 
orc.compile.CompilerPhase$$anon$1$$anonfun$apply$1.apply(OrcCompiler.scala:59)
at orc.compile.CoreOrcCompiler.apply(OrcCompiler.scala:256)
at orc.compile.StandardOrcCompiler.apply(OrcCompiler.scala:280)
at orc.compile.StandardOrcCompiler.apply(OrcCompiler.scala:292)
at orc.script.OrcScriptEngine.compile(OrcScriptEngine.java:204)
at orc.Main$.main(Main.scala:60)
at orc.Main.main(Main.scala)

Original issue reported on code.google.com by jthywissen on 11 May 2011 at 6:16

GoogleCodeExporter commented 9 years ago
Looks like Eclipse's org.eclipse.jface.preference.PathEditor writes 
non-portable strings, but the Orc plug-in was using a portable format.

Need to override and fix Eclipse's PathEditor.

Original comment by jthywissen on 11 May 2011 at 7:29

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r2834.

Original comment by jthywissen on 12 May 2011 at 7:56