gaurav-narula opened a new pull request, #15994:
URL: https://github.com/apache/kafka/pull/15994

   ConfigException's constructor doesn't follow the usual convention of 
accepting a `Throwable` as a cause. Instead, the constructor accepts an Object 
type for the config's value and crafts a message using it.
   
   This makes it difficult to debug cases where the cause would prove useful. 
As an example, consider the flakey test in 
`DynamicBrokerReconfigurationTest::testTrustStoreAlter` [0] which masks the 
cause of the certificate validation failure.
   
   Since the existing constructor is public, this change introduces another 
constructor which accepts a `Throwable` as the second argument. JLS ยง15.12.2.5 
[1] ensures the more specific constructor is chosen. Caution must be taken when 
passing `null` as the value of the second argument as the constructor with 
`Throwable` as the second argument would be invoked since it's more specific 
[2].
   
   [[0]]: 
https://ge.apache.org/s/bhdpknkevz37g/tests/task/:core:test/details/kafka.server.DynamicBrokerReconfigurationTest/testTrustStoreAlter(String)%5B2%5D?expanded-stacktrace=WyIwIl0&top-execution=1
   [[1]]: 
https://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.12.2.5
   [[2]]: https://stackoverflow.com/a/1572499
   
   ### Committer Checklist (excluded from commit message)
   - [ ] Verify design and implementation 
   - [ ] Verify test coverage and CI build status
   - [ ] Verify documentation (including upgrade notes)
   


-- 
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: jira-unsubscr...@kafka.apache.org

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

Reply via email to