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

False positives for classes defined inside methods #147

Closed
retronym opened this issue Nov 30, 2016 · 0 comments
Closed

False positives for classes defined inside methods #147

retronym opened this issue Nov 30, 2016 · 0 comments
Labels
Milestone

Comments

@retronym
Copy link
Contributor

The latest release of MiMa, which includes #143, issues these warnings in scala 2.12

    filter {
        problems=[
            {
                matchName="scala.collection.Iterator#Leading#1.hd_="
                problemName=DirectMissingMethodProblem
            },
            {
                matchName="scala.collection.Iterator#Leading#1.hd"
                problemName=DirectMissingMethodProblem
            },
            {
                matchName="scala.collection.Iterator#Leading#1.status_="
                problemName=DirectMissingMethodProblem
            },
            {
                matchName="scala.collection.Iterator#Leading#1.lookahead_="
                problemName=DirectMissingMethodProblem
            },
            {
                matchName="scala.collection.Iterator#Leading#1.status"
                problemName=DirectMissingMethodProblem
            },
            {
                matchName="scala.collection.Iterator#Leading#1.lookahead"
                problemName=DirectMissingMethodProblem
            }
        ]
    }

I believe these are false positives, and we should exclude such classes from analysis by looking at the EnclosingMethod attribute:

scala> :javap scala.collection.Iterator$Leading$1
...
EnclosingMethod: #8.#11                 // scala.collection.Iterator.span
InnerClasses:
     public #12= #2; //Leading$1=class scala/collection/Iterator$Leading$1
@retronym retronym added this to the 0.1.13 milestone Nov 30, 2016
@SethTisue SethTisue changed the title False positives for classes defined methods False positives for classes defined inside methods Nov 30, 2016
@retronym retronym added the bug label Nov 30, 2016
retronym added a commit to retronym/migration-manager that referenced this issue Nov 30, 2016
If a class has the `EnclosingMethod` attribute, we know it was defined
in the body of a method (or a val/var initializer), and is not part of
the API of a class.

Fixes lightbend-labs#147
szeiger added a commit to szeiger/migration-manager that referenced this issue Dec 1, 2016
The existing functional tests are unit / regression tests. They cannot
be expected to cover situations which we haven’t even considered before
(e.g. lightbend-labs#147). This
commit adds a new set of integration tests which consist of different
versions of large codebases that have been previously checked with a
stable version of MiMa, so we know what results to expect.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

1 participant