PMD - pull_request #1548
Annotations
4 errors and 1 warning
|
Use of modifier volatile is not recommended.:
powertools-common/src/test/java/software/amazon/lambda/powertools/common/internal/ClassPreLoaderTest.java#L12
Use of the keyword 'volatile' is generally used to fine tune a Java application, and therefore, requires
a good expertise of the Java Memory Model. Moreover, its range of action is somewhat misknown. Therefore,
the volatile keyword should not be used for maintenance purpose and portability.
AvoidUsingVolatile (Priority: 1, Ruleset: Multithreading)
https://docs.pmd-code.org/snapshot/pmd_rules_java_multithreading.html#avoidusingvolatile
|
|
Use of modifier volatile is not recommended.:
powertools-common/src/test/java/software/amazon/lambda/powertools/common/internal/ClassPreLoaderTest.java#L11
Use of the keyword 'volatile' is generally used to fine tune a Java application, and therefore, requires
a good expertise of the Java Memory Model. Moreover, its range of action is somewhat misknown. Therefore,
the volatile keyword should not be used for maintenance purpose and portability.
AvoidUsingVolatile (Priority: 1, Ruleset: Multithreading)
https://docs.pmd-code.org/snapshot/pmd_rules_java_multithreading.html#avoidusingvolatile
|
|
Use of modifier volatile is not recommended.:
powertools-common/src/test/java/software/amazon/lambda/powertools/common/internal/ClassPreLoaderTest.java#L10
Use of the keyword 'volatile' is generally used to fine tune a Java application, and therefore, requires
a good expertise of the Java Memory Model. Moreover, its range of action is somewhat misknown. Therefore,
the volatile keyword should not be used for maintenance purpose and portability.
AvoidUsingVolatile (Priority: 1, Ruleset: Multithreading)
https://docs.pmd-code.org/snapshot/pmd_rules_java_multithreading.html#avoidusingvolatile
|
|
Ensure that resources like this InputStream object are closed after use:
powertools-common/src/main/java/software/amazon/lambda/powertools/common/internal/ClassPreLoader.java#L59
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.
The property `allowedResourceMethodPatterns` can be used to specify method invocation patterns that return
resources which are managed externally and don't need to be closed by the caller. This is useful for
servlet-related streams like `HttpServletRequest.getReader()` or `HttpServletResponse.getWriter()`,
which are managed by the servlet container. The patterns use InvocationMatcher syntax
(e.g., `javax.servlet.ServletRequest#getReader()`).
CloseResource (Priority: 1, Ruleset: Error Prone)
https://docs.pmd-code.org/snapshot/pmd_rules_java_errorprone.html#closeresource
|
|
pmd_analyse
Node.js 20 is deprecated. The following actions target Node.js 20 but are being forced to run on Node.js 24: pmd/pmd-github-action@d9c1f3c5940cbf5923f1354e83fa858b4496ebaa. For more information see: https://github.blog/changelog/2025-09-19-deprecation-of-node-20-on-github-actions-runners/
|
Artifacts
Produced during runtime
| Name | Size | Digest | |
|---|---|---|---|
|
PMD Report
|
1.55 KB |
sha256:c45d18c43ec1c82f8d93cf8bd4c4c953a57d935bdbe3c271b5dc4e2f6565fe99
|
|