Race condition when trying to rename variable
When trying to rename
class Bug {
def f = {
val tryRenameMeInMethod = 0
println(tryRenameMeInMethod)
}
}
tryRenameMe
in the code above, I getCaused by: java.lang.AssertionError: assertion failed: Race condition detected: You are running a presentation compiler method outside the PC thread.[phase: <no phase>] Please file a ticket with the current stack trace at https://www.assembla.com/spaces/scala-ide/support/tickets
at scala.tools.nsc.interactive.Global.assertCorrectThread(Global.scala:535)
at scala.reflect.internal.Symbols$Symbol.rawInfo(Symbols.scala:1565)
at scala.reflect.internal.Symbols$Symbol.info(Symbols.scala:1499)
at scala.reflect.internal.Types$TypeRef.decls(Types.scala:2219)
at scala.reflect.internal.Types$NullaryMethodType.decls(Types.scala:2468)
at scala.reflect.internal.Types$Type.findDecl(Types.scala:971)
at scala.reflect.internal.Types$Type.decl(Types.scala:566)
at scala.reflect.internal.Symbols$Symbol.getterIn(Symbols.scala:2402)
at scala.reflect.internal.Symbols$Symbol.getter(Symbols.scala:2398)
at scala.tools.refactoring.implementations.Rename.getter$1(Rename.scala:32)
[...]
at org.scalaide.util.eclipse.EditorUtils$.withCurrentEditor(EditorUtils.scala:161)
at org.scalaide.util.eclipse.EditorUtils$.withScalaFileAndSelection(EditorUtils.scala:181)
at org.scalaide.refactoring.internal.rename.Rename.isLocalRename(Rename.scala:39)
at org.scalaide.refactoring.internal.rename.Rename.getRenameRefactoring(Rename.scala:31)
at org.scalaide.refactoring.internal.rename.Rename.perform(Rename.scala:27)
at org.scalaide.refactoring.internal.RefactoringHandler$class.execute(RefactoringHandler.scala:13)
at org.scalaide.refactoring.internal.rename.Rename.execute(Rename.scala:24)
at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:294)
at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:90)
[...]
most of the time, but not always. Note that I'm having this issue on box with 4 cores and 8 hardware threads.
Leave a comment
on 2015-10-10 10:22 *
By Simon Schäfer
Do not call refactoring.prepare outside of PC thread
This fixes the race condition described in the ticket.
Fixes #1002562
Branch: master
Commit: scala-ide:fbe0670b82
This fixes the race condition described in the ticket.
Fixes #1002562
Branch: master
Commit: scala-ide:fbe0670b82