Skip to content

Commit

Permalink
Makes HasQualifierParameter an inherited type; Fixes typetools#3831
Browse files Browse the repository at this point in the history
  • Loading branch information
t-rasmud committed Oct 25, 2020
1 parent 4baef83 commit 63c3d20
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 11 deletions.
4 changes: 0 additions & 4 deletions checker/tests/tainting/ExtendHasQual.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ static class Super {
@HasQualifierParameter(Tainted.class)
static class Buffer extends Super {}

// :: error: (missing.has.qual.param)
static class MyBuffer1 extends Buffer {}

@HasQualifierParameter(Tainted.class)
Expand All @@ -28,18 +27,15 @@ static class MyBuffer4 extends Buffer {}
@HasQualifierParameter(Tainted.class)
interface BufferInterface {}

// :: error: (missing.has.qual.param)
static class ImplementsBufferInterface1 implements BufferInterface {}

@HasQualifierParameter(Tainted.class)
static class ImplementsBufferInterface2 implements BufferInterface {}

// :: error: (missing.has.qual.param)
static class Both1 extends Buffer implements BufferInterface {}

@HasQualifierParameter(Tainted.class)
static class Both2 extends Buffer implements BufferInterface {}

// :: error: (missing.has.qual.param)
static class Both3 extends Super implements BufferInterface {}
}
18 changes: 18 additions & 0 deletions checker/tests/tainting/InnerHasQualifierParameter.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import org.checkerframework.checker.tainting.qual.Tainted;
import org.checkerframework.framework.qual.HasQualifierParameter;

@HasQualifierParameter(Tainted.class)
public class InnerHasQualifierParameter {

@HasQualifierParameter(Tainted.class)
interface TestInterface {
public void testMethod();
}

public void test() {
TestInterface test =
new TestInterface() {
public void testMethod() {}
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ public class TestNoQualifierParameterConflicting {
static class Super {}

@NoQualifierParameter(Tainted.class)
// :: error: (missing.has.qual.param)
// :: error: (conflicting.qual.param)
static class Sup extends Super {}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
package org.checkerframework.framework.qual;

import java.lang.annotation.Annotation;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.lang.annotation.*;

/**
* This is a declaration annotation that applies to type declarations and packages. On a type, it
Expand Down Expand Up @@ -63,6 +58,7 @@
*
* @see NoQualifierParameter
*/
@Inherited
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE, ElementType.PACKAGE})
Expand Down

0 comments on commit 63c3d20

Please sign in to comment.