Skip to content

Resolving spotbugs violations #17933

@Atharv3221

Description

@Atharv3221

Blocked by spotbugs/spotbugs#1338

As #1338 was closed expected spotbugs violations where none.
But found:

[ERROR] Medium: Redundant nullcheck of stream, which is known to be non-null in
 com.puppycrawl.tools.checkstyle.Main.loadProperties(File) [com.puppycrawl.tools.checkstyle.Main,
 com.puppycrawl.tools.checkstyle.Main] Redundant null check at Main.java:[line 451]
Another occurrence at Main.java:[line 453] RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE

[ERROR] Medium: Redundant nullcheck of inStream, which is known to be non-null in com.puppycrawl.tools.checkstyle.PropertyCacheFile.load() [com.puppycrawl.tools.checkstyle.PropertyCacheFile, com.puppycrawl.tools.checkstyle.PropertyCacheFile] Redundant null check at PropertyCacheFile.java:[line 124]Another occurrence at PropertyCacheFile.java:[line 131] RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE
[ERROR] Medium: Redundant nullcheck of out, which is known to be non-null in com.puppycrawl.tools.checkstyle.PropertyCacheFile.persist() [com.puppycrawl.tools.checkstyle.PropertyCacheFile, com.puppycrawl.tools.checkstyle.PropertyCacheFile] Redundant null check at PropertyCacheFile.java:[line 151]Another occurrence at PropertyCacheFile.java:[line 153] RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE
[ERROR] Medium: Redundant nullcheck of inStream, which is known to be non-null in com.puppycrawl.tools.checkstyle.ant.CheckstyleAntTask.createOverridingProperties() [com.puppycrawl.tools.checkstyle.ant.CheckstyleAntTask, com.puppycrawl.tools.checkstyle.ant.CheckstyleAntTask] Redundant null check at CheckstyleAntTask.java:[line 425]Another occurrence at CheckstyleAntTask.java:[line 427] RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE
[ERROR] Medium: Redundant nullcheck of inputStream, which is known to be non-null in com.puppycrawl.tools.checkstyle.checks.OrderedPropertiesCheck.processFiltered(File, FileText) [com.puppycrawl.tools.checkstyle.checks.OrderedPropertiesCheck, com.puppycrawl.tools.checkstyle.checks.OrderedPropertiesCheck] Redundant null check at OrderedPropertiesCheck.java:[line 108]Another occurrence at OrderedPropertiesCheck.java:[line 110] RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE
[ERROR] Medium: Redundant nullcheck of inStream, which is known to be non-null in com.puppycrawl.tools.checkstyle.checks.TranslationCheck.getTranslationKeys(File) [com.puppycrawl.tools.checkstyle.checks.TranslationCheck, com.puppycrawl.tools.checkstyle.checks.TranslationCheck] Redundant null check at TranslationCheck.java:[line 507]Another occurrence at TranslationCheck.java:[line 511] RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE
[ERROR] Medium: Redundant nullcheck of inputStream, which is known to be non-null in com.puppycrawl.tools.checkstyle.checks.UniquePropertiesCheck.processFiltered(File, FileText) [com.puppycrawl.tools.checkstyle.checks.UniquePropertiesCheck, com.puppycrawl.tools.checkstyle.checks.UniquePropertiesCheck] Redundant null check at UniquePropertiesCheck.java:[line 90]Another occurrence at UniquePropertiesCheck.java:[line 92] RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE

for first violation:

private static Properties loadProperties(File file)
throws CheckstyleException {
final Properties properties = new Properties();
try (InputStream stream = Files.newInputStream(file.toPath())) {
properties.load(stream);
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions