diff options
author | Som Snytt <som.snytt@gmail.com> | 2014-05-23 12:29:09 -0700 |
---|---|---|
committer | Som Snytt <som.snytt@gmail.com> | 2014-05-23 12:29:09 -0700 |
commit | fadb21dc107b54e9d1a15abb626a36370bcd3501 (patch) | |
tree | 34381ea72d9bdc9eeabb82e3e3deff3bf701b15f /src | |
parent | 733224093d8fee6f624656ecb9ee7c596fdb5ec2 (diff) | |
download | scala-fadb21dc107b54e9d1a15abb626a36370bcd3501.tar.gz scala-fadb21dc107b54e9d1a15abb626a36370bcd3501.tar.bz2 scala-fadb21dc107b54e9d1a15abb626a36370bcd3501.zip |
SI-8494 Javap filter includes specialized
When filtering javap output, include specialized versions
of methods. For anonfuns, in particular, the apply$sp is
the method of interest.
Diffstat (limited to 'src')
-rw-r--r-- | src/repl/scala/tools/nsc/interpreter/JavapClass.scala | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/src/repl/scala/tools/nsc/interpreter/JavapClass.scala b/src/repl/scala/tools/nsc/interpreter/JavapClass.scala index f3ffea5a9b..3cb6ba11c1 100644 --- a/src/repl/scala/tools/nsc/interpreter/JavapClass.scala +++ b/src/repl/scala/tools/nsc/interpreter/JavapClass.scala @@ -226,15 +226,20 @@ class JavapClass( def isOurMethod = { val lparen = line.lastIndexOf('(') val blank = line.lastIndexOf(' ', lparen) - (blank >= 0 && line.substring(blank+1, lparen) == pattern) - } - filtering = if (filtering) { - // next blank line terminates section - // for -public, next line is next method, more or less - line.trim.nonEmpty && !isAnyMethod - } else { - isAnyMethod && isOurMethod + if (blank < 0) false + else { + val method = line.substring(blank+1, lparen) + (method == pattern || ((method startsWith pattern+"$") && (method endsWith "$sp"))) + } } + filtering = + if (filtering) { + // next blank line terminates section + // for -public, next line is next method, more or less + line.trim.nonEmpty && !isAnyMethod + } else { + isAnyMethod && isOurMethod + } filtering } // do we output this line? |