ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jaikiran <...@git.apache.org>
Subject [GitHub] ant-ivy pull request #62: IVY-1572 - Check for Thread interruption while res...
Date Fri, 09 Feb 2018 04:15:34 GMT
Github user jaikiran commented on a diff in the pull request:

    https://github.com/apache/ant-ivy/pull/62#discussion_r167136873
  
    --- Diff: src/java/org/apache/ivy/plugins/resolver/AbstractPatternsBasedResolver.java
---
    @@ -91,6 +91,9 @@ protected ResolvedResource findResourceUsingPatterns(ModuleRevisionId
moduleRevi
             Set<String> foundRevisions = new HashSet<>();
             boolean dynamic = getSettings().getVersionMatcher().isDynamic(moduleRevision);
             for (String pattern : patternList) {
    +            if (Thread.currentThread().isInterrupted()) {
    +                return null;
    --- End diff --
    
    @apupier I originally intended it to be `InterruptedException` but given that it's a checked
exception you would end up changing the method signature of this method which then causes
issues with callers of this API. Hence I suggested a runtime exception.  Returning null  could
have other (side) effects than what you intend here - i.e. to abort the execution, so throwing
the exception would be the right thing.
    
    I might have some time tonight, I'll see if this check can be moved to a better location
or handle in a better way. 


---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message