Sonarqube is not covering the NULL pointer check

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube Server / Community Build, Scanner, Plugin, and any relevant extension)
  • how is SonarQube deployed: zip, Docker, Helm
  • what are you trying to achieve
  • what have you tried so far to achieve this

Hi. l using SONAR QUBER sonarqube:9.9.7-community

MAC book DOCKER

I have activated NULL pointer check rules in the sonar. But still it is not detecting the NULL pointer check. Will you please help how to handle this?

I hope " float pivotX = curCellScreen.getEditModePinchingPivotX();" can check null pointer

  @Nullable
    public CellScreen getCurrentCellScreen() {
        if (getCurrentScreen() == null) {
            return (CellScreen)getCurrentScreen();
        } else {
            return null;
        }
    }

    private int updateDockAndSearchProgress(float scaleValue) {
        int[] location = new int[2];

        CellScreen curCellScreen =  getCurrentCellScreen();
        float pivotX = curCellScreen.getEditModePinchingPivotX();
        float pivotY = location[1] + curCellScreen.getEditModePinchingPivotY();

        // @kenefe 双指进入编辑模式的动画
        mScreenSeekBar.getLocationInWindow(location);
        mScreenSeekBar.setPivotY(pivotY - location[1]);
        mScreenSeekBar.setPivotX(pivotX);
        mScreenSeekBar.setScaleX(scaleValue);
        mScreenSeekBar.setScaleY(scaleValue);
        return 0;
    }

Hey there.

I’ve moved your post to the section for reporting false-positives.

Can you please provide a complete, compilable code sample that reproduces the issue? We can’t really work off of screenshots of code.