Skip to content

fix: race-conditions during startup #882

fix: race-conditions during startup

fix: race-conditions during startup #882

Triggered via pull request March 11, 2025 11:42
Status Failure
Total duration 1m 0s
Artifacts 1

ci.yml

on: pull_request
Matrix: build
Fit to window
Zoom out
Zoom in

Annotations

5 errors and 8 warnings
build (ubuntu-latest)
Process completed with exit code 1.
build (windows-latest)
The job was canceled because "ubuntu-latest" failed.
build (windows-latest)
The operation was canceled.
build (macos-latest)
The job was canceled because "ubuntu-latest" failed.
build (macos-latest)
The operation was canceled.
Ensure that resources like this InputStream object are closed after use: plugin/src/main/java/io/snyk/eclipse/plugin/utils/FileDownloadResponseHandler.java#L27
Ensure that resources (like `java.sql.Connection`, `java.sql.Statement`, and `java.sql.ResultSet` objects and any subtype of `java.lang.AutoCloseable`) are always closed after use. Failing to do so might result in resource leaks. Note: It suffices to configure the super type, e.g. `java.lang.AutoCloseable`, so that this rule automatically triggers on any subtype (e.g. `java.io.FileInputStream`). Additionally specifying `java.sql.Connection` helps in detecting the types, if the type resolution / auxclasspath is not correctly setup. Note: Since PMD 6.16.0 the default value for the property `types` contains `java.lang.AutoCloseable` and detects now cases where the standard `java.io.*Stream` classes are involved. In order to restore the old behaviour, just remove "AutoCloseable" from the types. CloseResource (Priority: 3, Ruleset: Error Prone) https://docs.pmd-code.org/pmd-doc-7.11.0/pmd_rules_java_errorprone.html#closeresource
Avoid assignments in operands: plugin/src/main/java/io/snyk/eclipse/plugin/utils/FileDownloadResponseHandler.java#L33
Avoid assignments in operands; this can make code more complicated and harder to read. AssignmentInOperand (Priority: 3, Ruleset: Error Prone) https://docs.pmd-code.org/pmd-doc-7.11.0/pmd_rules_java_errorprone.html#assignmentinoperand
Assigning an Object to null is a code smell. Consider refactoring.: plugin/src/main/java/io/snyk/eclipse/plugin/wizards/SnykWizardAuthenticatePage.java#L73
Assigning a "null" to a variable (outside of its declaration) is usually bad form. Sometimes, this type of assignment is an indication that the programmer doesn't completely understand what is going on in the code. NOTE: This sort of assignment may used in some cases to dereference objects and encourage garbage collection. NullAssignment (Priority: 3, Ruleset: Error Prone) https://docs.pmd-code.org/pmd-doc-7.11.0/pmd_rules_java_errorprone.html#nullassignment
Thrown exception does not preserve the stack trace of exception 'e' on all code paths: plugin/src/main/java/io/snyk/languageserver/download/LsDownloader.java#L107
Reports exceptions that are thrown from within a catch block, yet don't refer to the exception parameter declared by that catch block. The stack trace of the original exception could be lost, which makes the thrown exception less informative. To preserve the stack trace, the original exception may be used as the cause of the new exception, using `Throwable#initCause`, or passed as a constructor argument to the new exception. It may also be preserved using `Throwable#addSuppressed`. The rule actually assumes that any method or constructor that takes the original exception as argument preserves the original stack trace. The rule allows `InvocationTargetException` and `PrivilegedActionException` to be replaced by their cause exception. The discarded part of the stack trace is in those cases only JDK-internal code, which is not very useful. The rule also ignores exceptions whose name starts with `ignored`. PreserveStackTrace (Priority: 3, Ruleset: Best Practices) https://docs.pmd-code.org/pmd-doc-7.11.0/pmd_rules_java_bestpractices.html#preservestacktrace
When doing a String.toLowerCase()/toUpperCase() call, use a Locale: plugin/src/main/java/io/snyk/languageserver/download/LsDownloader.java#L169
When doing `String::toLowerCase()/toUpperCase()` conversions, use an explicit locale argument to specify the case transformation rules. Using `String::toLowerCase()` without arguments implicitly uses `Locale::getDefault()`. The problem is that the default locale depends on the current JVM setup (and usually on the system in which it is running). Using the system default may be exactly what you want (e.g. if you are manipulating strings you got through standard input), but it may as well not be the case (e.g. if you are getting the string over the network or a file, and the encoding is well-defined and independent of the environment). In the latter case, using the default locale makes the case transformation brittle, as it may yield unexpected results on a machine whose locale has other case translation rules. For example, in Turkish, the uppercase form of `i` is `İ` (U+0130, not ASCII) and not `I` (U+0049) as in English. The rule is intended to *force* developers to think about locales when dealing with strings. By taking a conscious decision about the choice of locale at the time of writing, you reduce the risk of surprising behaviour down the line, and communicate your intent to future readers. UseLocaleWithCaseConversions (Priority: 3, Ruleset: Error Prone) https://docs.pmd-code.org/pmd-doc-7.11.0/pmd_rules_java_errorprone.html#uselocalewithcaseconversions
Avoid using literals in if statements: plugin/src/main/java/io/snyk/languageserver/download/LsDownloader.java#L183
Avoid using hard-coded literals in conditional statements. By declaring them as static variables or private members with descriptive names maintainability is enhanced. By default, the literals "-1" and "0" are ignored. More exceptions can be defined with the property "ignoreMagicNumbers". The rule doesn't consider deeper expressions by default, but this can be enabled via the property `ignoreExpressions`. With this property set to false, if-conditions like `i == 1 + 5` are reported as well. Note that in that case, the property ignoreMagicNumbers is not taken into account, if there are multiple literals involved in such an expression. AvoidLiteralsInIfCondition (Priority: 3, Ruleset: Error Prone) https://docs.pmd-code.org/pmd-doc-7.11.0/pmd_rules_java_errorprone.html#avoidliteralsinifcondition
build (windows-latest)
Cache not found for keys: setup-java-Windows-x64-maven-f9a3da0c3f32fa6313510bee638bc6722621eaa5cde458f6d27310594dbccd91
build (macos-latest)
Cache not found for keys: setup-java-macOS-arm64-maven-a311aae086465d2053d22e4760e9bfa61d03463d26f0aa05a6decf4153fc9aea

Artifacts

Produced during runtime
Name Size
PMD Report
2.96 KB