Changing git branch should not result in lots of `CoreException: File not found exception` being logged
We need to do a better job in the way we handle resources. For instance, changing my working branch from release/scala-ide-2.0.x to master (Scala IDE project), resulted in lots of exceptions reported in the Error Log similar to the following one
org.eclipse.core.runtime.CoreException: File not found: /Users/mirco/Projects/ide/codebase/org.scala-ide.sdt.core/src/scala/tools/eclipse/properties/SyntaxColouringPreferencePage.scala.
at org.eclipse.core.internal.filesystem.Policy.error(Policy.java:55)
at org.eclipse.core.internal.filesystem.local.LocalFile.openInputStream(LocalFile.java:371)
at org.eclipse.core.internal.localstore.FileSystemResourceManager.read(FileSystemResourceManager.java:797)
at org.eclipse.core.internal.resources.File.getContents(File.java:289)
at org.eclipse.jdt.internal.core.util.Util.getResourceContentsAsCharArray(Util.java:1187)
at org.eclipse.jdt.internal.core.CompilationUnit.getContents(CompilationUnit.java:649)
at scala.tools.eclipse.javaelements.ScalaSourceFile.getContents(ScalaSourceFile.scala:109)
at scala.tools.eclipse.javaelements.ScalaCompilationUnit$class.createSourceFile(ScalaCompilationUnit.scala:63)
at scala.tools.eclipse.javaelements.ScalaSourceFile.createSourceFile(ScalaSourceFile.scala:38)
at scala.tools.eclipse.ScalaPresentationCompiler$$anon$1.default(ScalaPresentationCompiler.scala:49)
at scala.tools.eclipse.ScalaPresentationCompiler$$anon$1.default(ScalaPresentationCompiler.scala:47)
at scala.collection.MapLike$class.apply(MapLike.scala:135)
at scala.collection.mutable.HashMap.apply(HashMap.scala:45)
at scala.tools.eclipse.ScalaPresentationCompiler.withSourceFile(ScalaPresentationCompiler.scala:90)
at scala.tools.eclipse.ScalaProject$$anonfun$withSourceFile$1.apply(ScalaProject.scala:488)
at scala.tools.eclipse.ScalaProject$$anonfun$withSourceFile$1.apply(ScalaProject.scala:487)
at scala.tools.eclipse.ScalaProject$$anonfun$withPresentationCompiler$1.apply(ScalaProject.scala:481)
at scala.tools.eclipse.ScalaProject$$anonfun$withPresentationCompiler$1.apply(ScalaProject.scala:480)
at scala.tools.eclipse.util.Cached$class.apply(Cached.scala:41)
at scala.tools.eclipse.ScalaProject$$anon$1.apply(ScalaProject.scala:67)
at scala.tools.eclipse.ScalaProject.withPresentationCompiler(ScalaProject.scala:480)
at scala.tools.eclipse.ScalaProject.withSourceFile(ScalaProject.scala:489)
at scala.tools.eclipse.javaelements.ScalaCompilationUnit$class.doWithSourceFile(ScalaCompilationUnit.scala:48)
at scala.tools.eclipse.javaelements.ScalaSourceFile.doWithSourceFile(ScalaSourceFile.scala:38)
at scala.tools.eclipse.javaelements.ScalaCompilationUnit$class.addToIndexer(ScalaCompilationUnit.scala:130)
at scala.tools.eclipse.javaelements.ScalaSourceFile.addToIndexer(ScalaSourceFile.scala:38)
at scala.tools.eclipse.ScalaSourceIndexer$$anonfun$indexDocument$2.apply(ScalaSourceIndexer.scala:23)
at scala.tools.eclipse.ScalaSourceIndexer$$anonfun$indexDocument$2.apply(ScalaSourceIndexer.scala:23)
at scala.Option.map(Option.scala:133)
at scala.tools.eclipse.ScalaSourceIndexer.indexDocument(ScalaSourceIndexer.scala:23)
at scala.tools.eclipse.contribution.weaving.jdt.indexerprovider.IndexerProviderAspect.ajc$around$scala_tools_eclipse_contribution_weaving_jdt_indexerprovider_IndexerProviderAspect$1$16276a3c(IndexerProviderAspect.aj:30)
at org.eclipse.jdt.internal.core.search.JavaSearchParticipant.indexDocument(JavaSearchParticipant.java:68)
at org.eclipse.jdt.internal.core.search.indexing.IndexManager.indexDocument(IndexManager.java:453)
at org.eclipse.jdt.internal.core.search.indexing.IndexManager$1.execute(IndexManager.java:853)
at org.eclipse.jdt.internal.core.search.processing.JobManager.run(JobManager.java:405)
at java.lang.Thread.run(Thread.java:680)
Caused by: java.io.FileNotFoundException: /Users/mirco/Projects/ide/codebase/org.scala-ide.sdt.core/src/scala/tools/eclipse/properties/SyntaxColouringPreferencePage.scala (No such file or directory)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:120)
at org.eclipse.core.internal.filesystem.local.LocalFile.openInputStream(LocalFile.java:362)
Leave a comment
on 2012-07-04 14:19 *
By Mirko Stocker
Could this somehow be related to #1001105?
on 2012-07-04 14:20 *
By Mirko Stocker
I mean, not the error directly, but just how changes in resources are handled.
on 2012-07-04 14:34 *
By Mirco Dotta
It's hard to say, should be investigated...
on 2012-07-11 15:18 *
By Iulian Dragos
Does it still happen if you have enable 'General/Workspace/Refresh using native hooks or polling'? I change branches quite often but I haven't seen this one.
on 2012-07-11 15:52 *
By Mirco Dotta
I should try that. But even then, we should fail more gracely, shouldn't we?