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

Resolve violations from IDEA 20191.3 #6821

Closed
romani opened this issue Jun 15, 2019 · 4 comments
Closed

Resolve violations from IDEA 20191.3 #6821

romani opened this issue Jun 15, 2019 · 4 comments

Comments

@romani
Copy link
Member

romani commented Jun 15, 2019

TC upgraded version of IDEA inspection engine, and as always there is no previous version of engine for selection in settings
we need to resolve all issue to unblock our PR merge process.

Violations:
https://teamcity.jetbrains.com/viewLog.html?buildId=2366627&tab=Inspection&buildTypeId=Checkstyle_IdeaInspectionsMaster

BashSupport
Convert to a quoted or unquoted string
Simple use of array variable
Simple variable usage
Unresolved variable

General
Redundant suppression

Java
Declaration redundancy
Stream API call chain can be simplified
Wrapper type may be primitive
Inheritance issues
Method is identical to its super method

JUnit
JUnit test method without any assertions
Simplifiable JUnit assertion

Performance
Call to 'Arrays.asList()' with too few arguments

Probable bugs
Cast conflicts with 'instanceof'
Verbose or redundant code constructs
Duplicate branches in 'switch'

JavaScript
ECMAScript 6 migration aids
'var' used instead of 'let' or 'const'

====

violations on local:

YAML
  Validation by JSON Schema
     .travis.yml
Schema validation: Property 'apt' is not allowed
Schema validation: Incompatible types. Required: string. Actual: null.

and

BashSupport
Convert to a quoted or unquoted string
Simple use of array variable
Simple variable usage
Unresolved variable

bash is postponed till some time in future. Related issue #5826

@romani
Copy link
Member Author

romani commented Jun 16, 2019

JavaScript
ECMAScript 6 migration aids
'var' used instead of 'let' or 'const'

We are not web project, no need for us to use modern JS approaches standards. We do not have babel running to convert it multiplatform JS.
https://stackoverflow.com/questions/2356830/what-browsers-currently-support-javascripts-let-keyword

romani added a commit that referenced this issue Jun 16, 2019
romani added a commit that referenced this issue Jun 16, 2019
romani added a commit that referenced this issue Jun 16, 2019
@romani
Copy link
Member Author

romani commented Jun 16, 2019

Property 'apt' is not allowed

should be removed, explanation - travis-ci/travis-ci#5876 (comment)
There is no such property at https://docs.travis-ci.com/user/caching

romani added a commit that referenced this issue Jun 16, 2019
romani added a commit that referenced this issue Jun 16, 2019
@romani
Copy link
Member Author

romani commented Jun 16, 2019

Schema validation: Incompatible types. Required: string. Actual: null.

removal of install cause to build problems it is not clear why it happens:

[INFO] Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/xbean/xbean-reflect/3.7/xbean-reflect-3.7.jar (148 kB at 297 kB/s)
[INFO] Downloaded from central: https://repo.maven.apache.org/maven2/org/slf4j/slf4j-api/1.8.0-beta2/slf4j-api-1.8.0-beta2.jar (44 kB at 86 kB/s)
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.codehaus.groovy.vmplugin.v7.Java7$1 (file:/home/travis/.m2/repository/org/codehaus/groovy/groovy/2.5.5/groovy-2.5.5-indy.jar) to constructor java.lang.invoke.MethodHandles$Lookup(java.lang.Class,int)
WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.vmplugin.v7.Java7$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
[INFO] Fork Value is true
     [java] Warnings generated: 6
[INFO] Done SpotBugs Analysis....
[INFO] 
[INFO] <<< spotbugs-maven-plugin:3.1.11:check (default) < :spotbugs @ checkstyle <<<
[INFO] 
[INFO] 
[INFO] --- spotbugs-maven-plugin:3.1.11:check (default) @ checkstyle ---
[INFO] BugInstance size is 6
[INFO] Error size is 0
[INFO] Total bugs: 6
[ERROR] 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 413]Another occurrence at Main.java:[line 415] RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE
[ERROR] 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 123]Another occurrence at PropertyCacheFile.java:[line 130] RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE
[ERROR] Nullcheck of is at line 309 of value previously dereferenced in com.puppycrawl.tools.checkstyle.PropertyCacheFile.loadExternalResource(String) [com.puppycrawl.tools.checkstyle.PropertyCacheFile, com.puppycrawl.tools.checkstyle.PropertyCacheFile] At PropertyCacheFile.java:[line 309]Redundant null check at PropertyCacheFile.java:[line 310] RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE
[ERROR] 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 432]Another occurrence at CheckstyleAntTask.java:[line 434] RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE
[ERROR] 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 476]Another occurrence at TranslationCheck.java:[line 480] RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE
[ERROR] 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 70]Another occurrence at UniquePropertiesCheck.java:[line 72] RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE
[INFO] 


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

workaround is provided in separate commit, to address this some time in future.

romani added a commit that referenced this issue Jun 16, 2019
…. Required: string. Actual: null.' and let Travis not fail build
@romani romani added this to the 8.22 milestone Jun 16, 2019
@romani
Copy link
Member Author

romani commented Jun 16, 2019

all fixes are merged.

@romani romani closed this as completed Jun 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant