From 8e8fc1536152ded28d7d9070021525f429483819 Mon Sep 17 00:00:00 2001 From: Michael Ernst Date: Sun, 9 Aug 2026 08:51:18 -0700 Subject: [PATCH 1/3] Comment --- gradle/libs.versions.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 804d9c91..289a4053 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -8,7 +8,6 @@ jacoco = "0.8.15" junit-jupiter = "6.1.3" -# The Kotlin formatter, which Spotless applies to .gradle.kts files. ktfmt = "0.54" pmd = "7.26.0" From 5d0a02a46d157fa753bca48389ba6ddfd60ede99 Mon Sep 17 00:00:00 2001 From: Michael Ernst Date: Sun, 9 Aug 2026 10:49:36 -0700 Subject: [PATCH 2/3] Drop support for JDK 17 --- .github/workflows/gradle.yml | 2 +- build.gradle.kts | 4 +- gradle/libs.versions.toml | 2 +- settings.gradle.kts | 11 +- src/main/java/org/plumelib/lookup/Lookup.java | 270 ++++++++++++++---- 5 files changed, 220 insertions(+), 69 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 0c172550..577dacd6 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -9,7 +9,7 @@ jobs: strategy: matrix: - java: ['17', '21', '25', '26'] + java: ['21', '25', '26'] steps: - uses: actions/checkout@v7 diff --git a/build.gradle.kts b/build.gradle.kts index b6133f7d..80077e13 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -80,7 +80,7 @@ java { } tasks.withType().configureEach { - options.release = 17 + options.release = 21 // Gradle compiles in a worker process whenever the toolchain above differs // from the JVM that runs Gradle. That worker does not inherit the @@ -100,7 +100,7 @@ tasks.withType().configureEach { // default: it runs Gradle under Java 21 in every job and selects the test JVM by passing // `-PtestJavaVersion`. // Override with, for example: -// ./gradlew test -PtestJavaVersion=17 +// ./gradlew test -PtestJavaVersion=21 val testJavaVersionProperty = project.findProperty("testJavaVersion") if (testJavaVersionProperty != null && testJavaVersionProperty.toString().isEmpty()) { diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 289a4053..bb8af8f5 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -2,7 +2,7 @@ checker-framework = "4.2.2" -google-java-format = "1.28.0" +google-java-format = "1.36.1" jacoco = "0.8.15" diff --git a/settings.gradle.kts b/settings.gradle.kts index a713efeb..82b3373e 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,5 +1,12 @@ -// No explicit check of the Gradle JVM's version is needed here. Gradle 9 requires a JVM between -// 17 and 26 to run, and reports a clear error on an unsupported JVM. +val minimumJavaVersion = JavaVersion.VERSION_21 + +if (JavaVersion.current() < minimumJavaVersion) { + throw GradleException( + "This build requires Gradle to run under Java $minimumJavaVersion or later," + + " but Gradle is running under Java ${JavaVersion.current()}" + + " from ${System.getProperty("java.home")}." + ) +} plugins { // Downloads a JDK if the Java toolchain that build.gradle.kts requests is not installed locally. diff --git a/src/main/java/org/plumelib/lookup/Lookup.java b/src/main/java/org/plumelib/lookup/Lookup.java index 8c423551..ed0e350a 100644 --- a/src/main/java/org/plumelib/lookup/Lookup.java +++ b/src/main/java/org/plumelib/lookup/Lookup.java @@ -56,74 +56,218 @@ * *
    *
  • What to search for - *
      - *
    • -e - * --regular-expressions=boolean. Specifies that keywords are regular - * expressions. If false, keywords are text matches. [default: false] - *
    • -c --case-sensitive=boolean. If true, - * keyword matching is case sensitive. By default, both regular expressions and text - * keywords are case-insensitive. [default: false] - *
    • -w --word-match=boolean. If true, match a - * keyword or regular expression only as a separate word, not as a substring of a word. - * This option may be supplied together with {@code --regular-expressions}. - *

      A search term whose first or last character is not a word character matches almost - * nothing, because a word boundary that is adjacent to a non-word character requires a - * word character on its other side. For example, {@code #define} would match - * "abc#define" but not "#define X". Lookup reports an error rather than performing such - * a search. [default: false] - *

    + *
      + *
    • -e + * --regular-expressions=boolean. + * Specifies that + * keywords are + * regular + * expressions. If + * false, keywords + * are text matches. + * [default: false] + *
    • -c + * --case-sensitive=boolean. + * If true, keyword + * matching is case + * sensitive. By default, + * both regular + * expressions and text + * keywords are + * case-insensitive. + * [default: false] + *
    • -w + * --word-match=boolean. + * If true, match a keyword + * or regular expression only + * as a separate word, not as + * a substring of a word. + * This option may be + * supplied together with + * {@code + * --regular-expressions}. + *

      A search term whose + * first or last character is + * not a word character + * matches almost nothing, + * because a word boundary + * that is adjacent to a + * non-word character + * requires a word character + * on its other side. For + * example, {@code #define} + * would match "abc#define" + * but not "#define X". + * Lookup reports an error + * rather than performing + * such a search. [default: + * false] + *

    *
  • How to print matches - *
      - *
    • -a --print-all=boolean. By default, if - * multiple entries are matched, only a synopsis of each entry is printed. If - * 'print_all' is selected then the body of each matching entry is printed. [default: - * false] - *
    • -i --item-num=integer. Specifies which item - * to print when there are multiple matches. The index is 1-based; that is, it starts - * counting at 1. - *
    • -l --show-location=boolean. If true, - * show the filename/line number of each matching entry in the output. [default: false] - *
    + *
      + *
    • -a + * --print-all=boolean. + * By default, if multiple + * entries are matched, only + * a synopsis of each entry + * is printed. If + * 'print_all' is selected + * then the body of each + * matching entry is + * printed. [default: false] + *
    • -i + * --item-num=integer. + * Specifies which item to + * print when there are + * multiple matches. The + * index is 1-based; that is, + * it starts counting at 1. + *
    • -l + * --show-location=boolean. + * If true, show the + * filename/line number + * of each matching + * entry in the output. + * [default: false] + *
    *
  • Customizing format of files to - * be searched - *
      - *
    • --two-blank-lines=boolean. If true, entries - * are separated by two blank lines. [default: false] - *
    • --code-fences=boolean. If true, code fences are - * supported: blank lines within ```...``` do not end an entry. [default: false] - *
    • --entry-start-re=regex. Matches the start of - * a long entry. [default: ^>entry *()] - *
    • --entry-stop-re=regex. Matches the end of a - * long entry. [default: ^<entry] - *
    • --description-re=regex. Matches the - * description for a long entry. - *
    • --comment-re=string. Matches an entire - * single-line comment (not just a comment start). - *
    • + *
    • --two-blank-lines=boolean. + * If + * true, + * entries + * are + * separated + * by + * two + * blank + * lines. + * [default: + * false] + *
    • --code-fences=boolean. + * If + * true, + * code + * fences + * are + * supported: + * blank + * lines + * within + * ```...``` + * do + * not + * end + * an + * entry. + * [default: + * false] + *
    • --entry-start-re=regex. + * Matches + * the + * start + * of + * a + * long + * entry. + * [default: + * ^>entry + * *()] + *
    • --entry-stop-re=regex. + * Matches + * the + * end + * of + * a + * long + * entry. + * [default: + * ^<entry] + *
    • --description-re=regex. + * Matches + * the + * description + * for + * a + * long + * entry. + *
    • --comment-re=string. + * Matches + * an + * entire + * single-line + * comment + * (not + * just + * a + * comment + * start). + *
    • --multiline-comment-start-re=string. - * Matches the start of a possibly multi-line comment. - *
    • --multiline-comment-end-re=string. - * Matches the end of a possibly multi-line comment. - *
    • --include-re=string. Matches an include - * directive; group 1 is the file name. [default: \\include\{(.*)\}] - *
    + * Matches + * the + * start + * of + * a + * possibly + * multi-line + * comment. + *
  • --multiline-comment-end-re=string. + * Matches + * the + * end + * of + * a + * possibly + * multi-line + * comment. + *
  • --include-re=string. + * Matches + * an + * include + * directive; + * group + * 1 + * is + * the + * file + * name. + * [default: + * \\include\{(.*)\}] + *
*
  • Getting help - *
      - *
    • -h --help=boolean. Show detailed help - * information and exit. [default: false] - *
    • -v --verbose=boolean. Print progress - * information. [default: false] - *
    + *
      + *
    • -h + * --help=boolean. Show + * detailed help information and exit. + * [default: false] + *
    • -v + * --verbose=boolean. + * Print progress information. + * [default: false] + *
    * * * From 70248eeb7f72b5b14839decb3884e1d516714158 Mon Sep 17 00:00:00 2001 From: Michael Ernst Date: Mon, 10 Aug 2026 06:51:45 -0700 Subject: [PATCH 3/3] Update Travis configuration --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 76d48128..47a497b2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,7 +11,6 @@ cache: - $HOME/.m2/ jdk: - - openjdk17 - openjdk21 - openjdk25