Skip to content

findbugs:NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE does not consider null validation #651

@alixwar

Description

@alixwar

Problem: A violation is triggered at the last line, saying that args may be null. This is clearly validated the line before (using org.apache.commons.lang3.Validate)

Affected version: 3.1.2 (SpotBugs)
Seen in: SonarQube (FindBugs plugin 3.7)

Reproducible code example (from an Android app):

@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   final Bundle args = getArguments();
   Validate.notNull(args);
   email = args.getString(ARG_EMAIL);
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions