Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build failure because of spotbugs #10781

Closed
Jason918 opened this issue Jun 2, 2021 · 0 comments · Fixed by #10792
Closed

Build failure because of spotbugs #10781

Jason918 opened this issue Jun 2, 2021 · 0 comments · Fixed by #10792
Labels
type/bug The PR fixed a bug or issue reported a bug

Comments

@Jason918
Copy link
Contributor

Jason918 commented Jun 2, 2021

Describe the bug
Build failed with cmd mvn clean install -DskipTests when building Pulsar Functions :: Instance 2.8.0-SNAPSHOT [35/127]
Here is the main error logs:

[INFO] --- spotbugs-maven-plugin:4.2.2:check (check) @ pulsar-functions-instance ---
[INFO] BugInstance size is 1
[INFO] Error size is 0
[INFO] Total bugs: 1
[ERROR] Medium: Load of known null value in org.apache.pulsar.functions.instance.state.BKStateStoreImpl.lambda$getAsync$1(ByteBuf) [org.apache.pulsar.functions.instance.state.BKStateStoreImpl] At BKStateStoreImpl.java:[line 175] NP_LOAD_OF_KNOWN_NULL_VALUE
[INFO]

To see bug detail using the Spotbugs GUI, use the following command "mvn spotbugs:gui"

To Reproduce
Steps to reproduce the behavior:

  1. clone repo from github.
  2. mvn clean install -DskipTests
  3. BUILD FAILURE

Expected behavior
build success

Desktop (please complete the following information):

pulsar git:(master) mvn -version
Apache Maven 3.8.1 (05c21c65bdfed0f71a2f2ada8b84da59348c4c5d)
Maven home: /Users/jason/apache-maven-3.8.1
Java version: 1.8.0_91, vendor: Oracle Corporation, runtime: /Library/Java/JavaVirtualMachines/jdk1.8.0_91.jdk/Contents/Home/jre
Default locale: zh_CN, platform encoding: UTF-8
OS name: "mac os x", version: "10.15.7", arch: "x86_64", family: "mac"

Additional context
I have tried these approaches:

  1. update mvn version from 3.6.1 to the latest 3.8.1
  2. clear mvn local cache in .m2/repository
  3. change spotbugs plugin-version to 4.2.3 and 4.2.0
    Not working.

Although, It can be solved by add a null check in BKStateStoreImpl.java:[line 175] according to the error log.
But I can build in a clean linux server.
So it must have something to do with my labtop settings.

Any suggestions?

@Jason918 Jason918 added the type/bug The PR fixed a bug or issue reported a bug label Jun 2, 2021
Jason918 pushed a commit to Jason918/pulsar that referenced this issue Jun 3, 2021
sijie pushed a commit that referenced this issue Jun 25, 2021
Fixes #10781 

### Motivation

solving build failure case causing by spotbugs issue which is explained in #10781 

### Modifications

Small modification: add a null check in BKStateStoreImpl.java:[line 175]
codelipenghui pushed a commit that referenced this issue Jul 7, 2021
Fixes #10781 

### Motivation

solving build failure case causing by spotbugs issue which is explained in #10781 

### Modifications

Small modification: add a null check in BKStateStoreImpl.java:[line 175]

(cherry picked from commit 296ba76)
bharanic-dev pushed a commit to bharanic-dev/pulsar that referenced this issue Mar 18, 2022
Fixes apache#10781 

### Motivation

solving build failure case causing by spotbugs issue which is explained in apache#10781 

### Modifications

Small modification: add a null check in BKStateStoreImpl.java:[line 175]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug The PR fixed a bug or issue reported a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant