ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bodewig <>
Subject [GitHub] ant pull request #58: Use StringBuilder instead of StringBuffer as it offers...
Date Tue, 06 Feb 2018 08:34:59 GMT
Github user bodewig commented on a diff in the pull request:
    --- Diff: src/main/org/apache/tools/ant/taskdefs/ ---
    @@ -377,7 +377,7 @@ public synchronized void run() {
             // now did any of the threads throw an exception
    -        exceptionMessage = new StringBuffer();
    +        exceptionMessage = new StringBuilder();
    --- End diff --
    Looking through the class I don't think `exceptionMessage` needs to be an instance field
at all, it could be a local variable in `spinThreads` and get passed as an argument to `processExceptions`
without doing any harm. To me it seems it is only ever used by a single thread.
    Most probably a further refactoring could get rid of the `first*` instance fields as well
and have `processExceptions` return all their values nicely encapsulated in a single object
- including the accumulated messages.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message