Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hyperlinking to Java method from routes editor throws exception #202

Open
skyluc opened this issue Nov 28, 2013 · 0 comments
Open

Hyperlinking to Java method from routes editor throws exception #202

skyluc opened this issue Nov 28, 2013 · 0 comments

Comments

@skyluc
Copy link
Member

skyluc commented Nov 28, 2013

This problem was made visible by scala-ide/scala-ide#562.

The problem comes from the fact that an askLoadedType is triggered when searching for the Java right method, to create the IHyperlink instance. Before the change in Scala IDE, askLoadedType would fail after the timeout. With the change, an exception is correctly thrown

scala.tools.eclipse.ScalaPresentationCompiler$InvalidThread: Tried to execute `askLoadedType` while inside `ask`
    at scala.tools.eclipse.LoadedTypeAdapter$class.loadedType(ScalaPresentationCompiler.scala:103)
    at scala.tools.eclipse.ScalaPresentationCompiler.loadedType(ScalaPresentationCompiler.scala:113)
    at scala.tools.eclipse.javaelements.ScalaCompilationUnit$$anonfun$reportMatches$1.apply(ScalaCompilationUnit.scala:252)
    at scala.tools.eclipse.javaelements.ScalaCompilationUnit$$anonfun$reportMatches$1.apply(ScalaCompilationUnit.scala:251)
    at scala.tools.eclipse.InteractiveCompilationUnit$$anonfun$doWithSourceFile$1.apply(InteractiveCompilationUnit.scala:60)
    at scala.tools.eclipse.InteractiveCompilationUnit$$anonfun$doWithSourceFile$1.apply(InteractiveCompilationUnit.scala:60)
    at scala.tools.eclipse.ScalaPresentationCompilerProxy$$anonfun$apply$1.apply(ScalaPresentationCompilerProxy.scala:72)
    at scala.tools.eclipse.ScalaPresentationCompilerProxy$$anonfun$apply$1.apply(ScalaPresentationCompilerProxy.scala:72)
    at scala.Option.flatMap(Option.scala:170)
    at scala.tools.eclipse.ScalaPresentationCompilerProxy.apply(ScalaPresentationCompilerProxy.scala:72)
    at scala.tools.eclipse.InteractiveCompilationUnit$class.doWithSourceFile(InteractiveCompilationUnit.scala:60)
    at scala.tools.eclipse.javaelements.ScalaSourceFile.doWithSourceFile(ScalaSourceFile.scala:77)
    at scala.tools.eclipse.javaelements.ScalaCompilationUnit$class.reportMatches(ScalaCompilationUnit.scala:251)
    at scala.tools.eclipse.javaelements.ScalaSourceFile.reportMatches(ScalaSourceFile.scala:77)
    at scala.tools.eclipse.contribution.weaving.jdt.search.SearchAspect.ajc$around$scala_tools_eclipse_contribution_weaving_jdt_search_SearchAspect$2$5ae075ec(SearchAspect.aj:45)
    at org.eclipse.jdt.internal.core.search.matching.MatchLocator.process(MatchLocator.java:1680)
    at org.eclipse.jdt.internal.core.search.matching.MatchLocator.locateMatches(MatchLocator.java:1141)
    at org.eclipse.jdt.internal.core.search.matching.MatchLocator.locateMatches(MatchLocator.java:1182)
    at org.eclipse.jdt.internal.core.search.matching.MatchLocator.locateMatches(MatchLocator.java:1314)
    at org.eclipse.jdt.internal.core.search.JavaSearchParticipant.locateMatches(JavaSearchParticipant.java:95)
    at org.eclipse.jdt.internal.core.search.BasicSearchEngine.findMatches(BasicSearchEngine.java:231)
    at org.eclipse.jdt.internal.core.search.BasicSearchEngine.search(BasicSearchEngine.java:515)
    at org.scalaide.play2.routeeditor.hyperlink.MethodFinder.doSearch(MethodFinder.scala:39)
    at org.scalaide.play2.routeeditor.hyperlink.MethodFinder.searchMethod(MethodFinder.scala:31)
    at org.scalaide.play2.routeeditor.hyperlink.MethodFinder.searchMethod(MethodFinder.scala:27)
    at org.scalaide.play2.routeeditor.hyperlink.RouteHyperlinkComputer$$anonfun$detectHyperlinks$1$$anonfun$2$$anonfun$apply$1$$anonfun$6.apply(RouteHyperlinkComputer.scala:69)
    at org.scalaide.play2.routeeditor.hyperlink.RouteHyperlinkComputer$$anonfun$detectHyperlinks$1$$anonfun$2$$anonfun$apply$1$$anonfun$6.apply(RouteHyperlinkComputer.scala:66)
    at scala.Option.flatMap(Option.scala:170)
    at org.scalaide.play2.routeeditor.hyperlink.RouteHyperlinkComputer$$anonfun$detectHyperlinks$1$$anonfun$2$$anonfun$apply$1.apply(RouteHyperlinkComputer.scala:65)
    at org.scalaide.play2.routeeditor.hyperlink.RouteHyperlinkComputer$$anonfun$detectHyperlinks$1$$anonfun$2$$anonfun$apply$1.apply(RouteHyperlinkComputer.scala:23)
    at scala.tools.nsc.util.InterruptReq.execute(InterruptReq.scala:26)
    at scala.tools.nsc.interactive.Global.pollForWork(Global.scala:339)
    at scala.tools.nsc.interactive.PresentationCompilerThread.run(PresentationCompilerThread.scala:22)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant