You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "sujin0529 (via GitHub)" <gi...@apache.org> on 2023/09/08 06:56:00 UTC

[GitHub] [commons-lang] sujin0529 opened a new pull request, #1105: add NPE testcase in LockingVisitorsTest

sujin0529 opened a new pull request, #1105:
URL: https://github.com/apache/commons-lang/pull/1105

   Hi, I found the test case triggering the NPE bug in LockingVisitors.
   https://github.com/apache/commons-lang/blob/8c6d874637b2e3342cbc1770c9a61ff184e483b0/src/main/java/org/apache/commons/lang3/concurrent/locks/LockingVisitors.java#L323-L325
   I think this bug needs to be fixed.
   Please check this test case.
   
   Thanks.


-- 
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: issues-unsubscribe@commons.apache.org

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


[GitHub] [commons-lang] sujin0529 commented on pull request #1105: add NPE testcase in LockingVisitorsTest

Posted by "sujin0529 (via GitHub)" <gi...@apache.org>.
sujin0529 commented on PR #1105:
URL: https://github.com/apache/commons-lang/pull/1105#issuecomment-1712976171

   Hi, @garydgregory 
   In this project, the guard conditioning is well done. However, there is no guard for this function `ReadWriteLockVisitor.<init>`. So I thought it would be good to add guard condition in the same way as below.
   https://github.com/apache/commons-lang/blob/14be5e577767aa959510f7ebda8dc9647568a789/src/main/java/org/apache/commons/lang3/ArrayUtils.java#L769-L779
   I think this error is closer to `IllegalArgumentException` than `NullPointerException`.
   
   Thanks.


-- 
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: issues-unsubscribe@commons.apache.org

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


[GitHub] [commons-lang] sujin0529 commented on pull request #1105: add NPE testcase in LockingVisitorsTest

Posted by "sujin0529 (via GitHub)" <gi...@apache.org>.
sujin0529 commented on PR #1105:
URL: https://github.com/apache/commons-lang/pull/1105#issuecomment-1712973650

   Hi, @garydgregory 


-- 
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: issues-unsubscribe@commons.apache.org

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


[GitHub] [commons-lang] garydgregory commented on pull request #1105: add NPE testcase in LockingVisitorsTest

Posted by "garydgregory (via GitHub)" <gi...@apache.org>.
garydgregory commented on PR #1105:
URL: https://github.com/apache/commons-lang/pull/1105#issuecomment-1712536757

   Hello @sujin0529 
   Fix? How? Wouldn't "garbage in, garbage out" apply h we're? What would the behavior be for a null lock?


-- 
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: issues-unsubscribe@commons.apache.org

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


Re: [PR] add NPE testcase in LockingVisitorsTest [commons-lang]

Posted by "garydgregory (via GitHub)" <gi...@apache.org>.
garydgregory closed pull request #1105: add NPE testcase in LockingVisitorsTest
URL: https://github.com/apache/commons-lang/pull/1105


-- 
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: issues-unsubscribe@commons.apache.org

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


Re: [PR] add NPE testcase in LockingVisitorsTest [commons-lang]

Posted by "garydgregory (via GitHub)" <gi...@apache.org>.
garydgregory commented on PR #1105:
URL: https://github.com/apache/commons-lang/pull/1105#issuecomment-1751725997

   Closing: No reply.


-- 
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: issues-unsubscribe@commons.apache.org

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


[GitHub] [commons-lang] garydgregory commented on pull request #1105: add NPE testcase in LockingVisitorsTest

Posted by "garydgregory (via GitHub)" <gi...@apache.org>.
garydgregory commented on PR #1105:
URL: https://github.com/apache/commons-lang/pull/1105#issuecomment-1713725280

   Hello @sujin0529 
   
   >I think this error is closer to IllegalArgumentException than NullPointerException.
   
   I disagree: `NullPointerException` is more _precise_ than `IllegalArgumentException`. Note that `Objects.requireNonNull()` throws NPE.  What I can imagine is a better exception _message_ for the NPE.
   
   You've not replied to: "What would the behavior be for a null lock?"
   Are you arguing that the null input should throw an exception or not?


-- 
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: issues-unsubscribe@commons.apache.org

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