question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hey. I just tried 0.3.1-RC2 and am seeing a new error:

[error] java.lang.StackOverflowError
[error] 	at scala.meta.internal.semanticdb.Scala$ScalaSymbolOps.isNone(Scala.scala:38)
[error] 	at scalafix.v1.Symbol.isNone(Symbol.scala:13)
[error] 	at scalafix.internal.v1.InternalSemanticDoc.info(InternalSemanticDoc.scala:65)
[error] 	at scalafix.v1.SemanticDocument.info(SemanticDocument.scala:38)
[error] 	at scalafix.v1.Symbol.info(Symbol.scala:21)
[error] 	at fix.OrganizeImports$SymbolSafeInfo.$anonfun$safeInfo$1(OrganizeImports.scala:631)
[error] 	at scala.util.Try$.apply(Try.scala:213)
[error] 	at fix.OrganizeImports$SymbolSafeInfo.safeInfo(OrganizeImports.scala:631)
[error] 	at fix.OrganizeImports.toRef$1(OrganizeImports.scala:223)
[error] 	at fix.OrganizeImports.toRef$1(OrganizeImports.scala:225)
[error] 	at fix.OrganizeImports.toRef$1(OrganizeImports.scala:225)
[error] 	at fix.OrganizeImports.toRef$1(OrganizeImports.scala:225)
[error] 	at fix.OrganizeImports.toRef$1(OrganizeImports.scala:225)
[error] 	at fix.OrganizeImports.toRef$1(OrganizeImports.scala:225)
[error] 	at fix.OrganizeImports.toRef$1(OrganizeImports.scala:225)
[error] 	at fix.OrganizeImports.toRef$1(OrganizeImports.scala:225)
[error] 	at fix.OrganizeImports.toRef$1(OrganizeImports.scala:225)
[error] 	at fix.OrganizeImports.toRef$1(OrganizeImports.scala:225)
[error] 	at fix.OrganizeImports.toRef$1(OrganizeImports.scala:225)
[error] 	at fix.OrganizeImports.toRef$1(OrganizeImports.scala:225)
[error] 	at fix.OrganizeImports.toRef$1(OrganizeImports.scala:225)
[error] 	at fix.OrganizeImports.toRef$1(OrganizeImports.scala:225)
[error] 	at fix.OrganizeImports.toRef$1(OrganizeImports.scala:225)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:11 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
lianchengcommented, Jun 21, 2020

@japgolly, the reason why a fully-qualified importer was still passed into expandRelative is that the isFullyQualifed function didn’t take care of Symbols.None, and therefore treated those imports as relative ones. Made a minor adjustment in https://github.com/liancheng/scalafix-organize-imports/commit/d4ac2f673d13ac59525898fbdf8506b9dfcfd75a to make it clearer.

That being said, it’s still not clear to me why sometimes the symbol information is not available and whether it’s safe to always assume that the importer is fully-qualified. But since all the cases you hit are fully-qualified imports, we can tentatively assume that is true.

1reaction
japgollycommented, Jun 10, 2020

Unfortunately I can’t share the code but I printed some debugging info out when these cases occur:

=====================================================================================================
importer = scalaz.{Equal, Order}
importer.ref = scalaz

symbol = <no symbol>
symbol.displayName = 
symbol.isNone = true
symbol.isEmptyPackage = false

owner = <no symbol>

symbol.infoNoThrow exists (_.isPackageObject) = false

SemanticDocument(/home/golly/BeardedLogic/projects/shipreq/Code/webapp-macro/shared/src/main/scala/shipreq/webapp/base/util/GenericData.scala)
=====================================================================================================
[info] Running scalafix on 5 Scala sources
[info] Running scalafix on 4 Scala sources
[info] Running scalafix on 23 Scala sources
[info] Running scalafix on 4 Scala sources
=====================================================================================================
importer = shipreq.base.util.ErrorMsg
importer.ref = shipreq.base.util

symbol = <no symbol>
symbol.displayName = 
symbol.isNone = true
symbol.isEmptyPackage = false

owner = <no symbol>

symbol.infoNoThrow exists (_.isPackageObject) = false

SemanticDocument(/home/golly/BeardedLogic/projects/shipreq/Code/webapp-base-test/js/src/main/scala/shipreq/webapp/base/protocol/websocket/WebSocketServerHelper.scala)
=====================================================================================================
=====================================================================================================
importer = shipreq.base.util.IndexLabel._
importer.ref = shipreq.base.util.IndexLabel

symbol = <no symbol>
symbol.displayName = 
symbol.isNone = true
symbol.isEmptyPackage = false

owner = <no symbol>

symbol.infoNoThrow exists (_.isPackageObject) = false

SemanticDocument(/home/golly/BeardedLogic/projects/shipreq/Code/base-test/shared/src/main/scala/shipreq/base/test/UseCaseStepUtils.scala)
=====================================================================================================
[info] Running scalafix on 4 Scala sources
[info] Running scalafix on 29 Scala sources
[info] Running scalafix on 43 Scala sources
[info] Running scalafix on 9 Scala sources
=====================================================================================================
importer = shipreq.webapp.base.util.ReqCodeTreeItem
importer.ref = shipreq.webapp.base.util

symbol = <no symbol>
symbol.displayName = 
symbol.isNone = true
symbol.isEmptyPackage = false

owner = <no symbol>

symbol.infoNoThrow exists (_.isPackageObject) = false

SemanticDocument(/home/golly/BeardedLogic/projects/shipreq/Code/webapp-base-member/shared/src/main/scala/shipreq/webapp/base/text/PlainText.scala)
=====================================================================================================
=====================================================================================================
importer = shipreq.webapp.base.protocol.websocket.ProjectSpaProtocols.WsReqRes.{ProjectNameSet => _, _}
importer.ref = shipreq.webapp.base.protocol.websocket.ProjectSpaProtocols.WsReqRes

symbol = <no symbol>
symbol.displayName = 
symbol.isNone = true
symbol.isEmptyPackage = false

owner = <no symbol>

symbol.infoNoThrow exists (_.isPackageObject) = false

SemanticDocument(/home/golly/BeardedLogic/projects/shipreq/Code/webapp-server-logic/shared/src/main/scala/shipreq/webapp/server/logic/MakeEvent.scala)
=====================================================================================================
=====================================================================================================
importer = shipreq.webapp.base.util.CharSubset.EscapeChars
importer.ref = shipreq.webapp.base.util.CharSubset

symbol = <no symbol>
symbol.displayName = 
symbol.isNone = true
symbol.isEmptyPackage = false

owner = <no symbol>

symbol.infoNoThrow exists (_.isPackageObject) = false

SemanticDocument(/home/golly/BeardedLogic/projects/shipreq/Code/webapp-base/shared/src/main/scala/shipreq/webapp/base/util/CharSubset.scala)
=====================================================================================================

What’s interesting about this is that I tried taking these files and turning them into tests but they don’t throw in isolation. Even outside of tests, if I run scalafix on just a single module (instead of from the root module where it does everything) the error doesn’t occur.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Infinite Loop - Apple Store
Apple Store Infinite Loop store hours, contact information, and weekly calendar of events. ... Apple Infinite Loop. Opens at 10:00 a.m.. Shop by...
Read more >
Infinite loop
In computer programming, an infinite loop (or endless loop) is a sequence of instructions that, as written, will continue endlessly, unless an external ......
Read more >
Infinite Loop
Infinite Loop Music and Sound Production, Soundtracks, Sound Design, Recording Studio, Event Sound, Theatre Sound Design, Advertising, Commercials, ...
Read more >
What is infinite loop (endless loop)? | Definition from ...
An infinite loop (sometimes called an endless loop ) is a piece of coding that lacks a functional exit so that it repeats...
Read more >
Infinite Loop in C
An infinite loop is a looping construct that does not terminate the loop and executes the loop forever. It is also called an...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found