You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "lhotari (via GitHub)" <gi...@apache.org> on 2023/01/24 06:35:10 UTC

[GitHub] [pulsar] lhotari opened a new pull request, #19315: [improve][build] Upgrade Spotbugs to a version with JDK 17 compatibility

lhotari opened a new pull request, #19315:
URL: https://github.com/apache/pulsar/pull/19315

   ### Motivation
   
   Build log contains warning messages such as
   ```
   (file:/home/runner/.m2/repository/com/github/spotbugs/spotbugs/4.2.2/spotbugs-4.2.2.jar)
        [java] WARNING: Please consider reporting this to the maintainers of edu.umd.cs.findbugs.ba.jsr305.TypeQualifierValue
        [java] WARNING: System::setSecurityManager will be removed in a future release
        [java] WARNING: A terminally deprecated method in java.lang.System has been called
        [java] WARNING: System::setSecurityManager has been called by edu.umd.cs.findbugs.ba.jsr305.TypeQualifierValue
   ```
   This is fixed by https://github.com/spotbugs/spotbugs/pull/1983 in 4.7.0
   
   ### Modifications
   
   Upgrade Spotbugs to 4.7.3.
   
   Spotbugs 4.7.3 release notes:
   https://github.com/spotbugs/spotbugs/releases/tag/4.7.3
   
   ### Documentation
   
   <!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
   
   - [ ] `doc` <!-- Your PR contains doc changes. Please attach the local preview screenshots (run `sh start.sh` at `pulsar/site2/website`) to your PR description, or else your PR might not get merged. -->
   - [ ] `doc-required` <!-- Your PR changes impact docs and you will update later -->
   - [x] `doc-not-needed` <!-- Your PR changes do not impact docs -->
   - [ ] `doc-complete` <!-- Docs have been already added -->


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] nicoloboschi merged pull request #19315: [improve][build] Upgrade Spotbugs to a version with JDK 17 compatibility

Posted by "nicoloboschi (via GitHub)" <gi...@apache.org>.
nicoloboschi merged PR #19315:
URL: https://github.com/apache/pulsar/pull/19315


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] cbornet commented on a diff in pull request #19315: [improve][build] Upgrade Spotbugs to a version with JDK 17 compatibility

Posted by "cbornet (via GitHub)" <gi...@apache.org>.
cbornet commented on code in PR #19315:
URL: https://github.com/apache/pulsar/pull/19315#discussion_r1085356953


##########
pulsar-common/src/main/java/org/apache/pulsar/common/naming/NamespaceName.java:
##########
@@ -89,6 +90,7 @@ public static Optional<NamespaceName> getIfValid(String namespace) {
         return Optional.of(get(namespace));
     }
 
+    @SuppressFBWarnings("DCN_NULLPOINTER_EXCEPTION")

Review Comment:
   Would it be possible to fix instead ?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] lhotari commented on pull request #19315: [improve][build] Upgrade Spotbugs to a version with JDK 17 compatibility

Posted by "lhotari (via GitHub)" <gi...@apache.org>.
lhotari commented on PR #19315:
URL: https://github.com/apache/pulsar/pull/19315#issuecomment-1491387923

   Adding a comment here so that we have some documentation about handling EI_EXPOSE_REP Spotbugs errors.
   
   This is the [spotbugs description for EI_EXPOSE_REP](https://spotbugs.readthedocs.io/en/stable/bugDescriptions.html#ei-may-expose-internal-representation-by-returning-reference-to-mutable-object-ei-expose-rep)
   > EI: May expose internal representation by returning reference to mutable object (EI_EXPOSE_REP)
   Returning a reference to a mutable object value stored in one of the object's fields exposes the internal representation of the object. If instances are accessed by untrusted code, and unchecked changes to the mutable object would compromise security or other important properties, you will need to do something different. Returning a new copy of the object is better approach in many situations.
   
   Newer versions of Spotbugs enable this rule by default. One possibility is to ignore the error.
   
   There are 2 ways to ignore the error: with an annotation or with an XML file. Since there was a lot of locations where this is happening, I used the XML file in this PR. Having the rule is useful since we should be thinking of the implications of thread safety and so on when a mutable object is shared.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] cbornet commented on a diff in pull request #19315: [improve][build] Upgrade Spotbugs to a version with JDK 17 compatibility

Posted by "cbornet (via GitHub)" <gi...@apache.org>.
cbornet commented on code in PR #19315:
URL: https://github.com/apache/pulsar/pull/19315#discussion_r1085356953


##########
pulsar-common/src/main/java/org/apache/pulsar/common/naming/NamespaceName.java:
##########
@@ -89,6 +90,7 @@ public static Optional<NamespaceName> getIfValid(String namespace) {
         return Optional.of(get(namespace));
     }
 
+    @SuppressFBWarnings("DCN_NULLPOINTER_EXCEPTION")

Review Comment:
   Would it be possible to fix instead ?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] cbornet commented on a diff in pull request #19315: [improve][build] Upgrade Spotbugs to a version with JDK 17 compatibility

Posted by "cbornet (via GitHub)" <gi...@apache.org>.
cbornet commented on code in PR #19315:
URL: https://github.com/apache/pulsar/pull/19315#discussion_r1085359121


##########
pulsar-common/src/main/java/org/apache/pulsar/common/naming/TopicName.java:
##########
@@ -101,6 +102,7 @@ public static boolean isValid(String topic) {
         }
     }
 
+    @SuppressFBWarnings("DCN_NULLPOINTER_EXCEPTION")

Review Comment:
   Would it be possible to fix instead ?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org