Skip to content

Commit 6f1e8c2

Browse files
committed
Add @Identifier annotations
1 parent e26ec17 commit 6f1e8c2

File tree

5 files changed

+18
-13
lines changed

5 files changed

+18
-13
lines changed

README-typetools.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ This is a version of BCEL that is annotated with type annotations for the Checke
44
To build this project
55
---------------------
66

7+
Use a Java 8 JDK.
8+
79
```
810
mvn -B -Dmaven.test.skip=true package
911
```

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@
117117
<configuration>
118118
<excludes>
119119
<exclude>README-typetools.txt</exclude>
120-
<exclude>TAGS</exclude>
120+
<exclude>**/TAGS</exclude>
121121
<exclude>cfMavenCentral.xml</exclude>
122122
<exclude>src/test/resources/**</exclude>
123123
<exclude>docs/*.bib</exclude>

src/main/java/org/apache/bcel/classfile/FieldOrMethod.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,17 @@
1616
*/
1717
package org.apache.bcel.classfile;
1818

19+
import org.checkerframework.checker.index.qual.NonNegative;
20+
import org.checkerframework.checker.signature.qual.Identifier;
21+
import org.checkerframework.dataflow.qual.Pure;
22+
import org.checkerframework.framework.qual.AnnotatedFor;
23+
1924
import java.io.DataInput;
2025
import java.io.DataInputStream;
2126
import java.io.DataOutputStream;
2227
import java.io.IOException;
2328
import java.util.Arrays;
2429

25-
import org.checkerframework.checker.index.qual.NonNegative;
26-
import org.checkerframework.dataflow.qual.Pure;
27-
import org.checkerframework.framework.qual.AnnotatedFor;
28-
2930
/**
3031
* Abstract super class for fields and methods.
3132
*/
@@ -212,7 +213,7 @@ public final String getGenericSignature() {
212213
/**
213214
* @return Name of object, i.e., method name or field name
214215
*/
215-
public final String getName() {
216+
public final @Identifier String getName() {
216217
return constant_pool.getConstantUtf8(name_index).getBytes();
217218
}
218219

src/main/java/org/apache/bcel/generic/FieldGenOrMethodGen.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import org.apache.bcel.classfile.Attribute;
2626

2727
import org.checkerframework.checker.nullness.qual.EnsuresNonNull;
28+
import org.checkerframework.checker.signature.qual.Identifier;
2829
import org.checkerframework.dataflow.qual.Pure;
2930

3031
/**
@@ -116,7 +117,7 @@ public ConstantPoolGen getConstantPool() {
116117
*/
117118
@Override
118119
@Pure
119-
public String getName() {
120+
public @Identifier String getName() {
120121
return name;
121122
}
122123

@@ -164,7 +165,7 @@ public void setConstantPool(final ConstantPoolGen cp) { // TODO could be package
164165
}
165166

166167
@Override
167-
public void setName(final String name) { // TODO could be package-protected?
168+
public void setName(final @Identifier String name) { // TODO could be package-protected?
168169
this.name = name;
169170
}
170171

src/main/java/org/apache/bcel/generic/InvokeInstruction.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@
1616
*/
1717
package org.apache.bcel.generic;
1818

19+
import org.checkerframework.checker.index.qual.NonNegative;
20+
import org.checkerframework.checker.signature.qual.ClassGetName;
21+
import org.checkerframework.checker.signature.qual.Identifier;
22+
import org.checkerframework.framework.qual.AnnotatedFor;
23+
1924
import java.util.StringTokenizer;
2025

2126
import org.apache.bcel.Const;
@@ -24,10 +29,6 @@
2429
import org.apache.bcel.classfile.ConstantPool;
2530
import org.apache.bcel.classfile.Utility;
2631

27-
import org.checkerframework.checker.index.qual.NonNegative;
28-
import org.checkerframework.checker.signature.qual.ClassGetName;
29-
import org.checkerframework.framework.qual.AnnotatedFor;
30-
3132
/**
3233
* Super class for the INVOKExxx family of instructions.
3334
*/
@@ -91,7 +92,7 @@ public Type[] getArgumentTypes(final ConstantPoolGen cpg) {
9192
/**
9293
* @return name of referenced method.
9394
*/
94-
public String getMethodName(final ConstantPoolGen cpg) {
95+
public @Identifier String getMethodName(final ConstantPoolGen cpg) {
9596
return getName(cpg);
9697
}
9798

0 commit comments

Comments
 (0)