[GitHub] [db-jdo] sonarcloud[bot] commented on pull request #75: JDO-823 - Make JDOException immutable
sonarcloud[bot] commented on PR #75: URL: https://github.com/apache/db-jdo/pull/75#issuecomment-1513918820 Kudos, SonarCloud Quality Gate passed! [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=db-jdo=75) [![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=db-jdo=75=false=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=db-jdo=75=false=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=db-jdo=75=false=BUG) [![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=db-jdo=75=false=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=db-jdo=75=false=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=db-jdo=75=false=VULNERABILITY) [![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=db-jdo=75=false=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=db-jdo=75=false=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=db-jdo=75=false=SECURITY_HOTSPOT) [![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=db-jdo=75=false=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=db-jdo=75=false=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=db-jdo=75=false=CODE_SMELL) [![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=db-jdo=75) No Coverage information [![0.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '0.0%')](https://sonarcloud.io/component_measures?id=db-jdo=75=new_duplicated_lines_density=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=db-jdo=75=new_duplicated_lines_density=list) -- 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: jdo-dev-unsubscr...@db.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [db-jdo] tobous opened a new pull request, #75: JDO-823 - Make JDOException immutable
tobous opened a new pull request, #75: URL: https://github.com/apache/db-jdo/pull/75 This PR changes the behavior of `toString()` and `printStackTrace(...)`. To avoid duplication in the `printStackTrace()`, the nested exceptions are no longer printed as part of the `toString()`. If the duplication are acceptable, another alternative keeping the print of nested exceptions as part of the `toString()` is also provided below. Here is a comparison of the behaviors: **Old behavior:** `toString()`: ```java javax.jdo.JDOException: failed NestedThrowables: java.lang.IllegalArgumentException: e1 java.lang.NullPointerException: e2 java.lang.RuntimeException: e3 ``` `printStackTrace(...)`: ```java Exception in thread "main" javax.jdo.JDOException: failed at javax.jdo.util.TestTest.main(TestTest.java:14) NestedThrowablesStackTrace: java.lang.IllegalArgumentException: e1 at javax.jdo.util.TestTest.main(TestTest.java:8) java.lang.NullPointerException: e2 at javax.jdo.util.TestTest.main(TestTest.java:9) java.lang.RuntimeException: e3 at javax.jdo.util.TestTest.main(TestTest.java:10) ``` **New behavior introduced in this PR:** `toString()`: ```java javax.jdo.JDOException: failed ``` `printStackTrace(...)`: ```java Exception in thread "main" javax.jdo.JDOException: failed at javax.jdo.util.TestTest.main(TestTest.java:14) Caused by: java.lang.IllegalArgumentException: e1 at javax.jdo.util.TestTest.main(TestTest.java:8) NestedThrowablesStackTrace: java.lang.NullPointerException: e2 at javax.jdo.util.TestTest.main(TestTest.java:9) java.lang.RuntimeException: e3 at javax.jdo.util.TestTest.main(TestTest.java:10) ``` **Alternative new behavior with duplicate entries:** `toString()`: ```java javax.jdo.JDOException: failed NestedThrowables: java.lang.IllegalArgumentException: e1 java.lang.NullPointerException: e2 java.lang.RuntimeException: e3 ``` `printStackTrace(...)`: ```java Exception in thread "main" javax.jdo.JDOException: failed NestedThrowables: java.lang.IllegalArgumentException: e1 java.lang.NullPointerException: e2 java.lang.RuntimeException: e3 at javax.jdo.util.TestTest.main(TestTest.java:14) Caused by: java.lang.IllegalArgumentException: e1 at javax.jdo.util.TestTest.main(TestTest.java:8) NestedThrowablesStackTrace: java.lang.NullPointerException: e2 at javax.jdo.util.TestTest.main(TestTest.java:9) java.lang.RuntimeException: e3 at javax.jdo.util.TestTest.main(TestTest.java:10) ``` -- 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: jdo-dev-unsubscr...@db.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org