Skip to content

Feature/fix nullaway util#5

Merged
Apisapple merged 6 commits intomainfrom
feature/fix-nullaway-util
Mar 14, 2026
Merged

Feature/fix nullaway util#5
Apisapple merged 6 commits intomainfrom
feature/fix-nullaway-util

Conversation

@Apisapple
Copy link
Copy Markdown
Owner

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 getGlibc method's return value handling, making its contract clearer for nullability.

Platform detection improvements:

  • Updated the getGlibc method in PlatformDetector.java to return @Nullable String and now returns null instead of the constant UNKNOWN when the glibc version is unknown, improving clarity and null safety.

Build workflow update:

  • Disabled the NullAway static analysis for the util module compile step in the pre-review.yml workflow, simplifying the build process.

- 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>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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#getGlibc to return @Nullable String and return null when the glibc version is unknown.
  • Updated the pre-review.yml “NullAway util compile” step to drop -PenableNullAway from 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 thread .github/workflows/pre-review.yml Outdated
Comment on lines +104 to +107
with:
cache-disabled: true
- name: NullAway util compile
run: ./gradlew :util:compileJava -PenableNullAway
run: ./gradlew :util:compileJava
@Apisapple Apisapple marked this pull request as draft March 13, 2026 09:05
- 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>
@Apisapple Apisapple marked this pull request as ready for review March 13, 2026 09:11
@Apisapple Apisapple requested a review from Copilot March 13, 2026 09:15
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 String and return null when the detected value is "unknown".
  • Modified .github/workflows/pre-review.yml to change the optional util “NullAway” job name and remove -PenableNullAway from 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 thread .github/workflows/pre-review.yml Outdated
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>
@Apisapple Apisapple marked this pull request as draft March 13, 2026 09:32
Signed-off-by: mykim <kimminyong2034@gmail.com>
@Apisapple Apisapple marked this pull request as ready for review March 14, 2026 02:53
@Apisapple Apisapple requested a review from Copilot March 14, 2026 02:53
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the CI pre-review workflow by removing the previously-defined optional NullAway job for the util module.

Changes:

  • Removed the nullaway-util-optional job from .github/workflows/pre-review.yml.

Comment on lines 84 to 85
- name: Gradle Compile
run: ./gradlew build -x test -x spotlessCheck
@Apisapple Apisapple merged commit 9e69fc3 into main Mar 14, 2026
25 of 31 checks passed
@Apisapple Apisapple deleted the feature/fix-nullaway-util branch March 14, 2026 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants