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

insert-annotations-to-source may add irrelevant import statements #111

Closed
pbsf opened this issue Jan 18, 2016 · 0 comments
Closed

insert-annotations-to-source may add irrelevant import statements #111

pbsf opened this issue Jan 18, 2016 · 0 comments

Comments

@pbsf
Copy link
Contributor

pbsf commented Jan 18, 2016

Consider the content of two Java classes C1 and C2, each on a separate .java file:

public class C1<T extends Object> {
  public <A extends Object> C1<A> foo(A a) {
      return null;
  }
}
public class C2 {}

Consider the following content of a .jaif file for the class C1:

package org.checkerframework.checker.nullness.qual:
annotation @Nullable:

package :
class C1:

    method foo(Ljava/lang/Object;)Lplume/C1;:
        return:
        parameter #0:
            type: @org.checkerframework.checker.nullness.qual.Nullable

After running
$ insert-annotations-to-source C1.java C2.java C1.jaif

the annotated C2.java should have stayed the same, but instead it imports Nullable:

import org.checkerframework.checker.nullness.qual.Nullable;
public class C2 {}

The files used to reproduce this bug are attached.

bug.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant