Skip to content

Commit

Permalink
Format viewpoint test annotations (#940)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ao-senXiong authored Oct 9, 2024
1 parent 0c0f279 commit d5dceb5
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 15 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ allprojects {

googleJavaFormat().aosp()
importOrder('com', 'jdk', 'lib', 'lombok', 'org', 'java', 'javax')
formatAnnotations().addTypeAnnotation("PolyInitialized")
formatAnnotations().addTypeAnnotation("PolyInitialized").addTypeAnnotation("PolyVP").addTypeAnnotation("ReceiverDependentQual")
}

groovyGradle {
Expand Down
3 changes: 1 addition & 2 deletions framework/tests/viewpointtest/PolyConstructor.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ public class PolyConstructor {

static class MyClass {
@SuppressWarnings({"inconsistent.constructor.type", "super.invocation.invalid"})
@PolyVP
MyClass(@PolyVP Object o) {
@PolyVP MyClass(@PolyVP Object o) {
throw new RuntimeException(" * You are filled with DETERMINATION."); // stub
}
}
Expand Down
3 changes: 1 addition & 2 deletions framework/tests/viewpointtest/PolyWithVPA.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

public class PolyWithVPA {
static class PolyClass {
@ReceiverDependentQual
Object foo(@PolyVP Object o) {
@ReceiverDependentQual Object foo(@PolyVP Object o) {
return null;
}
}
Expand Down
6 changes: 2 additions & 4 deletions framework/tests/viewpointtest/TestGetAnnotatedLhs.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,15 @@
import viewpointtest.quals.ReceiverDependentQual;
import viewpointtest.quals.Top;

@ReceiverDependentQual
class TestGetAnnotatedLhs {
@ReceiverDependentQual class TestGetAnnotatedLhs {
@ReceiverDependentQual Object f;

@SuppressWarnings({
"inconsistent.constructor.type",
"super.invocation.invalid",
"cast.unsafe.constructor.invocation"
})
@ReceiverDependentQual
TestGetAnnotatedLhs() {
@ReceiverDependentQual TestGetAnnotatedLhs() {
this.f = new @ReceiverDependentQual Object();
}

Expand Down
3 changes: 1 addition & 2 deletions framework/tests/viewpointtest/VPAExamples.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
public class VPAExamples {

static class RDContainer {
@ReceiverDependentQual
Object get() {
@ReceiverDependentQual Object get() {
return null;
}

Expand Down
6 changes: 2 additions & 4 deletions framework/tests/viewpointtest/VarargsConstructor.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ public class VarargsConstructor {
VarargsConstructor(String str, Object... args) {}

@SuppressWarnings({"inconsistent.constructor.type", "super.invocation.invalid"})
@ReceiverDependentQual
VarargsConstructor(@ReceiverDependentQual Object... args) {}
@ReceiverDependentQual VarargsConstructor(@ReceiverDependentQual Object... args) {}

void foo() {
VarargsConstructor a = new VarargsConstructor("testStr", new Object());
Expand All @@ -26,8 +25,7 @@ void invokeConstructor(@A Object aObj, @B Object bObj, @Top Object topObj) {

class Inner {
@SuppressWarnings({"inconsistent.constructor.type", "super.invocation.invalid"})
@ReceiverDependentQual
Inner(@ReceiverDependentQual Object... args) {}
@ReceiverDependentQual Inner(@ReceiverDependentQual Object... args) {}

void foo() {
Inner a = new Inner();
Expand Down

0 comments on commit d5dceb5

Please sign in to comment.