Skip to content
This repository has been archived by the owner on Apr 1, 2024. It is now read-only.

ISSUE-10781: Build failure because of spotbugs #2591

Closed
sijie opened this issue Jun 2, 2021 · 0 comments
Closed

ISSUE-10781: Build failure because of spotbugs #2591

sijie opened this issue Jun 2, 2021 · 0 comments
Labels

Comments

@sijie
Copy link
Member

sijie commented Jun 2, 2021

Original Issue: apache#10781


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?

@sijie sijie added the type/bug label Jun 2, 2021
@sijie sijie closed this as completed Jun 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant