Skip to content

Commit

Permalink
Don't use /// comments, whose content must be Markdown in Java 23
Browse files Browse the repository at this point in the history
  • Loading branch information
mernst authored Sep 2, 2024
1 parent cb70fb7 commit c27f651
Show file tree
Hide file tree
Showing 46 changed files with 250 additions and 250 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -426,9 +426,9 @@ public static boolean noStringMatchesAnyRegex(
return true;
}

///
/// Utilities
///
//
// Utilities
//

// This is from CollectionsPlume, but is here to make the file self-contained.

Expand Down
12 changes: 6 additions & 6 deletions checker/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -370,9 +370,9 @@ if (skipDelombok) {
tasks.test.dependsOn('delombok')
}

///
/// Tests of the -Ainfer command-line argument. These are not whole-program inference tests.
///
//
// Tests of the -Ainfer command-line argument. These are not whole-program inference tests.
//

test {
useJUnit {
Expand Down Expand Up @@ -884,9 +884,9 @@ task ainferTest(group: 'Verification') {
dependsOn('ainferResourceLeakAjavaTest')
}

///
/// Whole-program inference tests
///
//
// Whole-program inference tests
//

// This is run as part of the inferenceTests task.
task wpiManyTest(group: 'Verification') {
Expand Down
4 changes: 2 additions & 2 deletions checker/jtreg/nullness/defaultsPersist/ReferenceInfoUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public static List<TypeAnnotation> extendedAnnotationsOf(
return annos;
}

/////////////////// Extract type annotations //////////////////
// /////////////////// Extract type annotations //////////////////
private void findAnnotations(ClassFile cf, List<TypeAnnotation> annos) {
findAnnotations(cf, Attribute.RuntimeVisibleTypeAnnotations, annos);
findAnnotations(cf, Attribute.RuntimeInvisibleTypeAnnotations, annos);
Expand Down Expand Up @@ -130,7 +130,7 @@ private static void findAnnotations(
}
}

/////////////////////// Equality testing /////////////////////
// /////////////////////// Equality testing /////////////////////
private static boolean areEquals(int a, int b) {
return a == b || a == IGNORE_VALUE || b == IGNORE_VALUE;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public static List<Annotation> extendedAnnotationsOf(ClassFile cf) {
return annos;
}

/////////////////// Extract annotations //////////////////
// /////////////////// Extract annotations //////////////////
private static void findAnnotations(ClassFile cf, List<Annotation> annos) {
for (Method m : cf.methods) {
findAnnotations(cf, m, Attribute.RuntimeVisibleAnnotations, annos);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,9 @@ protected boolean commonAssignmentCheck(
}
}

/// TODO: What does "take precedence over" mean? Both are issued, but the
/// "i18nformat.excess.arguments" appears first in the output. Is this meant to not call
/// super.commonAssignmentCheck() if `result` is already false?
// TODO: What does "take precedence over" mean? Both are issued, but the
// "i18nformat.excess.arguments" appears first in the output. Is this meant to not call
// super.commonAssignmentCheck() if `result` is already false?
// By calling super.commonAssignmentCheck() last, any "i18nformat.excess.arguments"
// message issued for a given line of code will take precedence over the "assignment"
// issued by super.commonAssignmentCheck().
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -361,9 +361,9 @@ public List<String> getSameLensFromString(
return AnnotationUtils.getElementValueArray(sameLenAnno, sameLenValueElement, String.class);
}

///
/// Creating @SameLen annotations
///
//
// Creating @SameLen annotations
//

/**
* Creates a @SameLen annotation whose values are the given strings.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ public class Repository {
}


///////////////////////////////////////////////////////////////////////////
/// public static final @Interned String (initialized to constant)
///
// ///////////////////////////////////////////////////////////////////////////
// public static final @Interned String (initialized to constant)
//

package com.sun.imageio.plugins.gif;
public class GIFStreamMetadata {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ void setTwice4(AWSKMS client) {
client.generateDataKey(request);
}

/// Interprocedural
// Interprocedural

void callee2(
AWSKMS client,
Expand Down
3 changes: 1 addition & 2 deletions checker/tests/nonempty/IndexOfNonNegative.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,7 @@ public boolean removeAll(Collection<?> c) {
@Override
public void clear() {}

///////////////////////////////////////////////////////////////////////////

// ///////////////////////////////////////////////////////////////////////////
// iterators

@Override
Expand Down
2 changes: 1 addition & 1 deletion checker/tests/nonempty/SizeInIsEmpty.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public boolean isEmpty3() {
return size() == 0;
}

//// iterators
// iterators

@Override
public @PolyNonEmpty Iterator<E> iterator(@PolyNonEmpty SizeInIsEmpty<E> this) {
Expand Down
6 changes: 3 additions & 3 deletions checker/tests/nullness/AssertIfFalseTest2.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ public static void usePriorityQueue(PriorityQueue1<@NonNull Object> active) {
}
}

///////////////////////////////////////////////////////////////////////////
/// Classes copied from the annotated JDK
///
// ///////////////////////////////////////////////////////////////////////////
// Classes copied from the annotated JDK
//

public class PriorityQueue1<E extends @NonNull Object> {
@EnsuresNonNullIf(
Expand Down
6 changes: 3 additions & 3 deletions checker/tests/nullness/EnsuresNonNullIfTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ public static void fromDirNeg(File1 dbdir) {
}
}

///////////////////////////////////////////////////////////////////////////
/// Classes copied from the annotated JDK
///
// ///////////////////////////////////////////////////////////////////////////
// Classes copied from the annotated JDK
//

// NOTE: These annotations are actually incorrect (& not in the JDK).
// But, the test remains valid in how it exercises nullness checking.
Expand Down
4 changes: 2 additions & 2 deletions checker/tests/nullness/JavaExpressionParsingBug.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

public abstract class JavaExpressionParsingBug {

//// Check that JavaExpressions with explicit and implicit 'this' work
// Check that JavaExpressions with explicit and implicit 'this' work

protected @Nullable JMenuBar menuBar = null;

Expand All @@ -14,7 +14,7 @@ public void addFavorite() {}
@RequiresNonNull("this.menuBar")
public void addFavorite1() {}

//// Check JavaExpressions for static fields with different ways to access the field
// Check JavaExpressions for static fields with different ways to access the field

static @Nullable String i = null;

Expand Down
6 changes: 3 additions & 3 deletions checker/tests/nullness/NNOEStaticFields.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ void test4() {
@NonNull Object f = System.out;
}

///////////////////////////////////////////////////////////////////////////
/// Copied from Daikon's ChicoryPremain
///
// ///////////////////////////////////////////////////////////////////////////
// Copied from Daikon's ChicoryPremain
//

static class ChicoryPremain1 {

Expand Down
6 changes: 3 additions & 3 deletions checker/tests/nullness/NonEmptyCollection.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ public class NonEmptyCollection {
return sm.firstKey();
}

///////////////////////////////////////////////////////////////////////////
/// Helper classes copied from JDK
///
// ///////////////////////////////////////////////////////////////////////////
// Helper classes copied from JDK
//

public class PriorityQueue1<E> {
@SuppressWarnings("purity") // object creation is forbidden in pure methods
Expand Down
24 changes: 12 additions & 12 deletions checker/tests/nullness/ScopingConstruct.java
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,9 @@ ScopingConstruct.Inner.InnerInner sciii() {
throw new Error("not implemented");
}

///
/// Formal parameters
///
//
// Formal parameters
//

void fsn(StaticNested sn) {}

Expand Down Expand Up @@ -247,9 +247,9 @@ void fscsnni(ScopingConstruct.StaticNested.NestedInner scsnni) {}

void fscsnnni(ScopingConstruct.StaticNested.@Nullable NestedInner scsnnni) {}

///
/// Local variables
///
//
// Local variables
//

void lvsn() {
StaticNested sn;
Expand Down Expand Up @@ -334,9 +334,9 @@ void lvscsnnni() {
ScopingConstruct.StaticNested.@Nullable NestedInner scsnnni;
}

///
/// Resource variables
///
//
// Resource variables
//

void rvsn() {
try (StaticNested sn = null) {}
Expand Down Expand Up @@ -421,9 +421,9 @@ void rvscsnnni() {
try (ScopingConstruct.StaticNested.@Nullable NestedInner scsnnni = null) {}
}

///
/// For variables
///
//
// For variables
//

void fvsn() {
for (StaticNested sn = null; ; ) {}
Expand Down
6 changes: 3 additions & 3 deletions checker/tests/resourceleak/ACSocketTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,9 @@ Socket createSocket(boolean b, String address, int port) throws IOException {

// @EnsuresCalledMethodsIf(expression = "#1", methods = {"close"}, result = true)
// void closeSocket(Socket sock) {
//// if (sock == null) {
//// return;
//// }
// // if (sock == null) {
// // return;
// // }
//
// try {
// sock.close();
Expand Down
8 changes: 4 additions & 4 deletions checker/tests/signature/ClassGetNameBinaryName.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class TestGetName {
// :: error: (assignment)
@DotSeparatedIdentifiers String s13 = Inner.class.getName();

/// Primitive types
// Primitive types

@PrimitiveType String prim1 = int.class.getName();

Expand All @@ -45,7 +45,7 @@ class TestGetName {
// :: error: (assignment)
@PrimitiveType String prim6 = void.class.getName();

/// Arrays
// Arrays

// :: error: (assignment)
@DotSeparatedIdentifiers String s6 = int[].class.getName();
Expand Down Expand Up @@ -82,7 +82,7 @@ class TestGetCanonicalName {
// :: error: (assignment)
@CanonicalNameAndBinaryName String s13 = Inner.class.getName();

/// Primitive types
// Primitive types

@PrimitiveType String prim1 = int.class.getCanonicalName();

Expand All @@ -100,7 +100,7 @@ class TestGetCanonicalName {
// :: error: (assignment)
@PrimitiveType String prim6 = void.class.getCanonicalName();

/// Arrays
// Arrays

// :: error: (assignment)
@CanonicalNameAndBinaryName String s6 = int[].class.getCanonicalName();
Expand Down
8 changes: 4 additions & 4 deletions checker/tests/signedness/DefaultsSignedness.java
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public void SignedTest(
sinBoxedByte = testBoxedByte;
//// :: error: (assignment)
// // :: error: (assignment)
conBoxedByte = testBoxedByte;
// Test boxed shorts
Expand All @@ -127,7 +127,7 @@ public void SignedTest(
sinBoxedShort = testBoxedShort;
//// :: error: (assignment)
// // :: error: (assignment)
conBoxedShort = testBoxedShort;
// Test boxed Integers
Expand All @@ -136,7 +136,7 @@ public void SignedTest(
sinBoxedInteger = testBoxedInteger;
//// :: error: (assignment)
// // :: error: (assignment)
conBoxedInteger = testBoxedInteger;
// Test boxed Longs
Expand All @@ -145,7 +145,7 @@ public void SignedTest(
sinBoxedLong = testBoxedLong;
//// :: error: (assignment)
// // :: error: (assignment)
conBoxedLong = testBoxedLong;
*/
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -325,9 +325,9 @@ public String toStringDebug() {
return String.format("%s(%s): %s", getClass().getSimpleName(), type, toString());
}

///
/// Static methods
///
//
// Static methods
//

/**
* Returns the Java expression for a {@link FieldAccessNode}. The result may contain {@link
Expand Down Expand Up @@ -712,9 +712,9 @@ public static List<FormalParameter> getFormalParameters(ExecutableElement method
return parameters;
}

///
/// Obtaining the receiver
///
//
// Obtaining the receiver
//

/**
* Returns the receiver of the given invocation.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public boolean containsModifiableAliasOf(Store<?> store, JavaExpression other) {
return false; // not modifiable
}

/// java.lang.Object methods
// java.lang.Object methods

@Override
public boolean equals(@Nullable Object obj) {
Expand Down
6 changes: 3 additions & 3 deletions docs/examples/errorprone/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
///////////////////////////////////////////////////////////////////////////
/// Checker Framework pluggable type-checking and Error Prone example
///
// ///////////////////////////////////////////////////////////////////////////
// Checker Framework pluggable type-checking and Error Prone example
//

plugins {
id 'java'
Expand Down
6 changes: 3 additions & 3 deletions docs/examples/lombok/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
///////////////////////////////////////////////////////////////////////////
/// Checker Framework pluggable type-checking and Lombok example
///
// ///////////////////////////////////////////////////////////////////////////
// Checker Framework pluggable type-checking and Lombok example
//

plugins {
id 'java'
Expand Down
Loading

0 comments on commit c27f651

Please sign in to comment.