Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,7 @@ public static void main(String[] args) throws IOException {
// of the line being inserted onto. This puts the annotation on its own line aligned
// with the contents of the next line.

// Number of whitespace characters preceeding the insertion position on the same line
// Number of whitespace characters preceding the insertion position on the same line
// (tabs count as one).
int indentation = 0;
while ((pos - indentation != 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class AnnotationInsertion extends Insertion {
/**
* The fully-qualified name of the annotation to be inserted.
*
* <p>E.g. Given an annotation {@code com.foo.Bar(baz)}, its fully quailified name would be {@code
* <p>E.g. Given an annotation {@code com.foo.Bar(baz)}, its fully qualified name would be {@code
* com.foo.Bar}.
*/
private final String fullyQualifiedAnnotationName;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public boolean isSatisfiedBy(@Nullable TreePath path) {
path = path.getParentPath();
} while (path != null && path.getLeaf() != null);

// We didn't find the method. Return true if in a varable declarator,
// We didn't find the method. Return true if in a variable declarator,
// which is initialization code that will go in <init> or <clinit>.
boolean result = inDecl && (staticDecl ? "<clinit>()V" : "<init>()V").equals(name);
Criteria.dbug.debug("InMethodCriterion.isSatisfiedBy => %s%n", result);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ private boolean matchTypeParam(
if (!typeParamToClassMap.isEmpty()) {
for (Map.Entry<String, String> p : typeParamToClassMap.entrySet()) {
@SuppressWarnings(
"regex:assignment") // a type parameter name is an identifer, which is a valid regex
"regex:assignment") // a type parameter name is an identifier, which is a valid regex
@Regex String typeParamName = p.getKey();
// Pattern.quote() is gratuitous because key is a type parameter name, which is an
// identifier with no special characters. Matcher.quoteReplacement is gratuitous because
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class NewInsertion extends TypedInsertion {
/**
* Construct a NewInsertion.
*
* <p>If "new" already exists in the initializer, then pass a {@link DeclaredType} thats name is
* <p>If "new" already exists in the initializer, then pass a {@link DeclaredType} whose name is
* the empty String. This will only insert an annotation on the existing type.
*
* <p>To insert the annotation along with "new" and the type (for example, {@code @Anno new Type[]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ public IPair<ASTRecord, Integer> visitNewClass(NewClassTree node, Insertion ins)
// For style 3, we need to count the brackets and get to the right one.
//
// The AST depth of the initializer is correct unless all arrays are
// empty, in which case it is arbitary. This is legal:
// empty, in which case it is arbitrary. This is legal:
// String[][][][][] names4 = new String[][][][][] { { {} } };
//
// Array initializers can also be multi-dimensional, but this is not
Expand Down Expand Up @@ -1179,7 +1179,7 @@ Integer findPosition(TreePath path, Insertion i) {
// created) receiver.
Map<Tree, ASTRecord> astIndex = ASTIndex.indexOf(tree);
ASTRecord insertRecord = astIndex.get(node);
dbug.debug("TreeFinder.scan: node=%s%n critera=%s%n", node, i.getCriteria());
dbug.debug("TreeFinder.scan: node=%s%n criteria=%s%n", node, i.getCriteria());

if (TreePathUtil.hasClassKind(node)
&& i.getCriteria().isOnTypeDeclarationExtendsClause()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ public static boolean isOnNew(Criteria criteria) {
* returns false.
*
* @param criteria the Criteria
* @return true if the Criteria is on a synthethic constructor
* @return true if the Criteria is on an implicit default constructor
*/
private static boolean isOnImplicitDefaultConstructor(Criteria criteria) {
if (!criteria.isOnMethod("<init>()V")) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ public AnnotationDef(
setFieldTypes(fieldTypes);
}

// This ovverride is necessary because AnnotationDef extends AElement, which implements Cloneable.
// This override is necessary because AnnotationDef extends AElement, which implements Cloneable.
@Override
public AnnotationDef clone() {
throw new UnsupportedOperationException("Can't duplicate an AnnotationDef");
Expand Down Expand Up @@ -296,7 +296,7 @@ public boolean equals(AnnotationDef o) {
@Override
public int hashCode() {
return name.hashCode()
// Omit tlAnnotationsHere, becase it should be unique and, more
// Omit tlAnnotationsHere, because it should be unique and, more
// importantly, including it causes an infinite loop.
// + tlAnnotationsHere.hashCode()
+ fieldTypes.hashCode();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,11 @@ public void format(StringBuilder sb, Object o) {
sb.append(o.toString());
sb.append("L");
} else if (type == double.class && Double.isNaN((double) o)) {
// Don't use "Double.NaN" because it is not parseable if the code imports a `Double` class
// Don't use "Double.NaN" because it is not parsable if the code imports a `Double` class
// other than `java.lang.Double`.
sb.append("0.0/0.0");
} else if (type == float.class && Float.isNaN((float) o)) {
// Don't use "Float.NaN" because it is not parseable if the code imports a `Float` class
// Don't use "Float.NaN" because it is not parsable if the code imports a `Float` class
// other than `java.lang.Float`.
sb.append("0.0f/0.0f");
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,11 @@ private int matchNNInteger() throws IOException {
* "java.util.Map" for Map.class
* }</pre>
*
* Thes use fully-qualified names, i.e. "Object" alone won't work.
* These use fully-qualified names, i.e. "Object" alone won't work.
*
* @return the class name that was read, in Class.forName format
* @throws IOException if there is trouble reading
* @throws ParseException if there is trouble parsing
*/
private @ClassGetName String expectClassGetName() throws IOException, ParseException {
int arrays = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ private void printInnerTypes(String indentation, ATypeElement e) {
* and arg are both integers.
*
* @param typePath TypePath to be processed
* @param index dentifies the TypePathEntry to convert
* @param index identifies the TypePathEntry to convert
* @return string representing the TypePathEntry
*/
private String typePathStepToString(TypePath typePath, int index) {
Expand All @@ -197,7 +197,7 @@ private String typePathStepToString(TypePath typePath, int index) {
}

/**
* Outputs a string representaion of a set of AElements to a PrintWriter.
* Outputs a string representation of a set of AElements to a PrintWriter.
*
* @param indentation string containing indentation spaces
* @param descriptor description of Type being printed
Expand All @@ -212,7 +212,7 @@ private void printNumberedAmbigiousElements(
}

/**
* Outputs a string representaion of an AElement to a PrintWriter.
* Outputs a string representation of an AElement to a PrintWriter.
*
* @param indentation string containing indentation spaces
* @param descriptor description of Type being printed
Expand Down Expand Up @@ -502,8 +502,8 @@ private static void formatAnnotation(StringBuilder sb, Annotation a) {
}

/**
* Formats a literal argument of an annotation. Public to permit re-use in stub-based
* whole-program inference.
* Formats a literal argument of an annotation. Public to permit reuse in stub-based whole-program
* inference.
*
* @param sb where to format the arguments to
* @param aft the type of the annotation field
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,15 +243,15 @@ private void ensureVisitSceneClassAnnotations() {

// do type parameter bound annotations
for (Map.Entry<BoundLocation, ATypeElement> e : aClass.bounds.entrySet()) {
BoundLocation bloc = e.getKey();
BoundLocation bLoc = e.getKey();
ATypeElement bound = e.getValue();

TypeReference typeReference =
bloc.boundIndex == -1
bLoc.boundIndex == -1
? TypeReference.newTypeParameterReference(
TypeReference.CLASS_TYPE_PARAMETER, bloc.paramIndex)
TypeReference.CLASS_TYPE_PARAMETER, bLoc.paramIndex)
: TypeReference.newTypeParameterBoundReference(
TypeReference.CLASS_TYPE_PARAMETER_BOUND, bloc.paramIndex, bloc.boundIndex);
TypeReference.CLASS_TYPE_PARAMETER_BOUND, bLoc.paramIndex, bLoc.boundIndex);
Comment thread
mernst marked this conversation as resolved.
for (Annotation tla : bound.tlAnnotationsHere) {
// For ClassVisitor. typeReference has sort: CLASS_TYPE_PARAMETER,
// CLASS_TYPE_PARAMETER_BOUND or CLASS_EXTENDS.
Expand All @@ -262,7 +262,7 @@ private void ensureVisitSceneClassAnnotations() {

typeReference =
TypeReference.newTypeParameterBoundReference(
TypeReference.CLASS_TYPE_PARAMETER_BOUND, bloc.paramIndex, bloc.boundIndex);
TypeReference.CLASS_TYPE_PARAMETER_BOUND, bLoc.paramIndex, bLoc.boundIndex);
for (Map.Entry<List<TypePathEntry>, ATypeElement> e2 : bound.innerTypes.entrySet()) {
TypePath typePath = TypePathEntry.listToTypePath(e2.getKey());
ATypeElement innerType = e2.getValue();
Expand Down Expand Up @@ -876,14 +876,14 @@ private void ensureVisitReturnTypeAnnotations() {
/** Has this visit the annotations on type parameter bounds. */
private void ensureVisitTypeParameterBoundAnnotations() {
for (Map.Entry<BoundLocation, ATypeElement> e : aMethod.bounds.entrySet()) {
BoundLocation bloc = e.getKey();
BoundLocation bLoc = e.getKey();
ATypeElement bound = e.getValue();
TypeReference typeReference =
bloc.boundIndex == -1
bLoc.boundIndex == -1
? TypeReference.newTypeParameterReference(
TypeReference.METHOD_TYPE_PARAMETER, bloc.paramIndex)
TypeReference.METHOD_TYPE_PARAMETER, bLoc.paramIndex)
: TypeReference.newTypeParameterBoundReference(
TypeReference.METHOD_TYPE_PARAMETER_BOUND, bloc.paramIndex, bloc.boundIndex);
TypeReference.METHOD_TYPE_PARAMETER_BOUND, bLoc.paramIndex, bLoc.boundIndex);
visitTypeAnnotationsOnTypeElement(typeReference, bound, false);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ public static void read(AScene scene, InputStream input) throws IOException {
* {@code scene}.
*
* @param scene the scene into which the annotations should be inserted
* @param classReader the ClassReader for the class thet the annotations should be read from
* @param classReader the ClassReader for the class that the annotations should be read from
*/
public static void read(AScene scene, ClassReader classReader) {
ClassAnnotationSceneReader ca =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public ClassVisitor newVisitor() {
* visited a class.
*
* @throws AnnotationMismatchException if the two visitors have not visited two versions of the
* same class that contain idential annotations
* same class that contain identical annotations
*/
public void verify() {
if (!newVisitor.name.equals(originalVisitor.name)) {
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ repositories {
ext {
// Different JDKs may be used to run Gradle, compile the Checker Framework, and run the CF tests.

// Ways to specifiy the JDK used by different tasks/Gradle:
// Ways to specify the JDK used by different tasks/Gradle:
//
// 1. Run Gradle using JDK 21:
// mkdir ~/.gradle && echo "org.gradle.java.home=/usr/lib/jvm/java-21-openjdk-amd64" >> ~/.gradle/gradle.properties
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
/**
* The names of methods that have definitely been called.
*
* @return the names of methods that have definetely been called
* @return the names of methods that have definitely been called
*/
String[] value();
}
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public enum ConversionCategory {

/**
* Use if no object of any type can be passed as parameter. In this case, the only legal value is
* null. This is seldomly needed, and indicates an error in most cases. For example:
* null. This is seldom needed, and indicates an error in most cases. For example:
*
* <pre>
* format("Test %1$f %1$d", null);
Expand All @@ -107,8 +107,8 @@ public enum ConversionCategory {
NULL(null),

/**
* Use if a parameter is not used by the formatter. This is seldomly needed, and indicates an
* error in most cases. For example:
* Use if a parameter is not used by the formatter. This is seldom needed, and indicates an error
* in most cases. For example:
*
* <pre>
* format("Test %1$s %3$s", "a","unused","b");
Expand Down Expand Up @@ -223,7 +223,7 @@ public static boolean isSubsetOf(ConversionCategory a, ConversionCategory b) {
new ConversionCategory[] {CHAR, INT, FLOAT, TIME, CHAR_AND_INT, INT_AND_TIME, NULL};

/**
* Returns the intersection of two categories. This is seldomly needed.
* Returns the intersection of two categories. This is seldom needed.
*
* <blockquote>
*
Expand Down Expand Up @@ -274,7 +274,7 @@ public static ConversionCategory intersect(ConversionCategory a, ConversionCateg
new ConversionCategory[] {NULL, CHAR_AND_INT, INT_AND_TIME, CHAR, INT, FLOAT, TIME};

/**
* Returns the union of two categories. This is seldomly needed.
* Returns the union of two categories. This is seldom needed.
*
* <blockquote>
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* detail that may change in the future, when this type may be used to implement more precise
* refinements.
*
* <p>The usual use case for the {@code LengthOf} annotation is in the defintions of custom
* <p>The usual use case for the {@code LengthOf} annotation is in the definitions of custom
* collections. Consider the signature of java.lang.String#length():
*
* <pre>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
/**
* A wrapper annotation that makes the {@link EnsuresNonEmptyIf} annotation repeatable.
*
* <p>Programmers generally do not need to write ths. It is created by Java when a programmer
* <p>Programmers generally do not need to write this. It is created by Java when a programmer
* writes more than one {@link EnsuresNonEmptyIf} annotation at the same location.
*/
@Retention(RetentionPolicy.RUNTIME)
Expand Down
4 changes: 2 additions & 2 deletions checker/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -917,8 +917,8 @@ tasks.register("wpiManyTest", Exec) {
println("======== end of contents of ${filename} ========")
}
// If any of these files are present, their contents should be an error
// message that might indicate what went wrong. Even their presenence,
// however, is intereseting (even if they are empty).
// message that might indicate what went wrong. Even their presence,
// however, is interesting (even if they are empty).
def cannotRunWpiFiles = fileTree(typecheckFilesDir).matching {
include("**/.cannot-run-wpi")
}
Expand Down
2 changes: 1 addition & 1 deletion checker/jtreg/nullness/issue767/Class1.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* @test
* @summary Test that compliation order doesn't effect typechecking (#767)
* @summary Test that compilation order doesn't effect typechecking (#767)
*
* @compile -Xlint:unchecked -processor org.checkerframework.checker.nullness.NullnessChecker -Anomsgtext Class1.java Class2.java
* @compile -Xlint:unchecked -processor org.checkerframework.checker.nullness.NullnessChecker -Anomsgtext Class2.java Class1.java
Expand Down
2 changes: 1 addition & 1 deletion checker/jtreg/rawtypes/RawTypeFail.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* @test
* @summary Test that raw types sometimes produces unwanted errors
* @ignore Renable once Issue #635 is fixed (https://github.com/typetools/checker-framework/issues/635)
* @ignore Re-enable once Issue #635 is fixed (https://github.com/typetools/checker-framework/issues/635)
*
* @compile/fail/ref=RawTypeFail.out -XDrawDiagnostics -Xlint:unchecked -processor org.checkerframework.checker.nullness.NullnessChecker -Alint -Anomsgtext RawTypeFail.java
* @compile/ref=RawTypeFailIgnored.out -XDrawDiagnostics -Xlint:unchecked -processor org.checkerframework.checker.nullness.NullnessChecker -Alint -Anomsgtext -AignoreRawTypeArguments RawTypeFail.java
Expand Down
2 changes: 1 addition & 1 deletion checker/jtreg/sortwarnings/ErrorOrders.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import org.checkerframework.checker.index.qual.UpperBoundBottom;
import org.checkerframework.common.value.qual.BottomVal;

/** This class tests that errors are issued in order of postion. */
/** This class tests that errors are issued in order of position. */
public class ErrorOrders {

void test2(int i, int[] a) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public static enum InvocationType {
ARRAY,

/**
* A null array is passed to the format method. This happens seldomly.
* A null array is passed to the format method. This happens seldom.
*
* <blockquote>
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ public Effect getComputedEffectAtCallsite(
} else if (methodSelect instanceof IdentifierTree) {
// Tree.Kind.IDENTIFIER, e.g. a direct call like "super()"
if (callerReceiver == null) {
// Not enought information provided to instantiate this type-polymorphic effects
// Not enough information provided to instantiate this type-polymorphic effects
return targetEffect;
}
srcType = callerReceiver;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ public void processMethodTree(String className, MethodTree tree) {
// subclasses a Safe instantiation, all is well. If it subclasses a UI instantiation, then
// the receivers should probably be @UI in both new and override methods, so calls to
// polymorphic methods of the parent class will work correctly. In which case for proving
// anything, the qualifier on sublasses of UI instantiations would always have to be @UI...
// anything, the qualifier on subclasses of UI instantiations would always have to be @UI...
// Need to write down |- t for this system! And the judgments for method overrides and
// inheritance! Those are actually the hardest part of the system.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ private AnnotationMirror getAnnotationForLiteralPlus(int val, AnnotationMirror n
* lit 0 + * &rarr; *
* lit 1 + * &rarr; call promote
* 9. lit &ge; 2 + {gte-1, nn, or pos} &rarr; pos
* let all other lits, including sets, fall through:
* let all other literals, including sets, fall through:
* 10. pos + pos &rarr; pos
* 11. nn + * &rarr; *
* 12. pos + gte-1 &rarr; nn
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1208,12 +1208,12 @@ public Iterable<? extends String> getSequences() {
}

/**
* Generates a new UBQualifer without the given (sequence, offset) pair. Other occurrences of
* Generates a new UBQualifier without the given (sequence, offset) pair. Other occurrences of
* the sequence and the offset may remain in the result, but not together.
*
* @param sequence a Java expression representing a string
* @param offset an integral offset
* @return a new UBQualifer without the given sequence and offset
* @return a new UBQualifier without the given sequence and offset
*/
public UBQualifier removeOffset(String sequence, int offset) {
OffsetEquation offsetEq = OffsetEquation.createOffsetForInt(offset);
Expand Down
Loading