Conversation
- Return null to account for existing code that expects and handles null values. Signed-off-by: mykim <kimminyong2034@gmail.com>
- Remove the unnecessary -PenableNullAway flag Signed-off-by: mykim <kimminyong2034@gmail.com>
There was a problem hiding this comment.
Pull request overview
Updates platform detection nullability semantics for glibc version reporting and adjusts the pre-review workflow’s util compile invocation.
Changes:
- Changed
PlatformDetector#getGlibcto return@Nullable Stringand returnnullwhen the glibc version is unknown. - Updated the
pre-review.yml“NullAway util compile” step to drop-PenableNullAwayfrom the Gradle invocation.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| util/src/main/java/org/hyperledger/besu/util/platform/PlatformDetector.java | Makes getGlibc() nullable and maps the internal "unknown" sentinel to null. |
| .github/workflows/pre-review.yml | Adjusts the util compile command used by the optional NullAway job. |
Comment on lines
+97
to
+111
| return null; | ||
| } | ||
|
|
||
| return _glibc; |
Comment on lines
+104
to
+107
| with: | ||
| cache-disabled: true | ||
| - name: NullAway util compile | ||
| run: ./gradlew :util:compileJava -PenableNullAway | ||
| run: ./gradlew :util:compileJava |
- Update the Javadoc to reflect the actual behavior of the getGlibc function. Signed-off-by: mykim <kimminyong2034@gmail.com>
Signed-off-by: mykim <kimminyong2034@gmail.com>
There was a problem hiding this comment.
Pull request overview
This PR adjusts platform detection behavior in util and tweaks the pre-review GitHub Actions workflow, with the intent of clarifying glibc “unknown” handling and simplifying (or disabling) a NullAway-related CI check.
Changes:
- Updated
PlatformDetector.getGlibc()to return@Nullable Stringand returnnullwhen the detected value is"unknown". - Modified
.github/workflows/pre-review.ymlto change the optional util “NullAway” job name and remove-PenableNullAwayfrom the util compile invocation.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| util/src/main/java/org/hyperledger/besu/util/platform/PlatformDetector.java | Changes getGlibc() contract to nullable and maps sentinel "unknown" to null. |
| .github/workflows/pre-review.yml | Alters the optional util/NullAway job naming and the Gradle command used in that job. |
Comment on lines
100
to
112
| * @return the Glibc version, or {@code null} if the version is unknown or cannot be detected. | ||
| */ | ||
| public static String getGlibc() { | ||
| public static @Nullable String getGlibc() { | ||
| if (_glibc == null) { | ||
| detectGlibc(); | ||
| } | ||
|
|
||
| return _glibc == null ? UNKNOWN : _glibc; | ||
| if (UNKNOWN.equals(_glibc)) { | ||
| return null; | ||
| } | ||
|
|
||
| return _glibc; | ||
| } |
Comment on lines
+86
to
+107
| @@ -104,7 +104,7 @@ jobs: | |||
| with: | |||
| cache-disabled: true | |||
| - name: NullAway util compile | |||
| run: ./gradlew :util:compileJava -PenableNullAway | |||
| run: ./gradlew :util:compileJava | |||
Signed-off-by: mykim <kimminyong2034@gmail.com>
Signed-off-by: mykim <kimminyong2034@gmail.com>
Comment on lines
84
to
85
| - name: Gradle Compile | ||
| run: ./gradlew build -x test -x spotlessCheck |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request includes minor adjustments to the build workflow and a method signature update in the platform detection utility. The most notable change is the improvement of the
getGlibcmethod's return value handling, making its contract clearer for nullability.Platform detection improvements:
getGlibcmethod inPlatformDetector.javato return@Nullable Stringand now returnsnullinstead of the constantUNKNOWNwhen the glibc version is unknown, improving clarity and null safety.Build workflow update:
NullAwaystatic analysis for theutilmodule compile step in thepre-review.ymlworkflow, simplifying the build process.