Skip to content

Commit

Permalink
Do not skip classes with symbolic names in objects
Browse files Browse the repository at this point in the history
We used to skip all classes whose bytecode name contains “$$” under the
assumption that those would be names with synthetic components like
“$$anonfun” but these names can also occur when a class name starting
with a symbolic character is nested inside an object (e.g. “A$$less” is
a class named “<“ inside an “object A”). Instead we need to look at the
decoded names. They still contain synthetic components such as
“$$anonfun” verbatim but no accidental “$$” sequences.

Fixes #158.
  • Loading branch information
szeiger committed Jan 5, 2017
1 parent bed1558 commit 7e00deb
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ abstract class PackageInfo(val owner: PackageInfo) {
def isAccessible(clazz: ClassInfo, prefix: Set[ClassInfo]) = {
def isReachable = {
if (clazz.isSynthetic) false
else if (prefix.isEmpty) clazz.isTopLevel && !clazz.bytecodeName.contains("$$")
else if (prefix.isEmpty) clazz.isTopLevel && !clazz.decodedName.contains("$$")
else prefix.exists(_.innerClasses contains clazz.bytecodeName)
}
clazz.isPublic && !clazz.isLocalClass && isReachable
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
abstract method f()Int in class foo.A#B does not have a correspondent in new version
abstract method f()Int in class foo.A#< does not have a correspondent in new version
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package foo

// See https://github.com/typesafehub/migration-manager/issues/158
// `<` would be filtered out, therefore not reporting the missing method
object A {
abstract class < {
def f: Int
}
abstract class B {
def f: Int
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package foo

object A {
abstract class <
abstract class B
}

0 comments on commit 7e00deb

Please sign in to comment.