On 25 April 2014 08:45, Benedikt Ritter <brit...@apache.org> wrote:
> Nice! But you seem to have auto-formating enabled, which leads to unrelated
> changes (see below). For larger changes you should enabled auto-formating
> only for edited lines or make a separate reformat commit.
>
> Regards,
> Benedikt

Thanks for the heads up. This was my first commit after moving from
Eclipse to IntelliJ, so clearly it's doing things I wasn't expecting.
Time to do battle with the settings...

Duncan

>
>
> 2014-04-21 10:37 GMT+02:00 <djo...@apache.org>:
>
>> Author: djones
>> Date: Mon Apr 21 08:37:46 2014
>> New Revision: 1588859
>>
>> URL: http://svn.apache.org/r1588859
>> Log:
>> Use enhanced for loop
>>
>> Modified:
>>
>> commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/time/DurationFormatUtils.java
>>
>> Modified:
>> commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/time/DurationFormatUtils.java
>> URL:
>> http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/time/DurationFormatUtils.java?rev=1588859&r1=1588858&r2=1588859&view=diff
>>
>> ==============================================================================
>> ---
>> commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/time/DurationFormatUtils.java
>> (original)
>> +++
>> commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/time/DurationFormatUtils.java
>> Mon Apr 21 08:37:46 2014
>> @@ -416,9 +416,7 @@ public class DurationFormatUtils {
>>              long milliseconds, final boolean padWithZeros) {
>>          final StringBuilder buffer = new StringBuilder();
>>          boolean lastOutputSeconds = false;
>> -        final int sz = tokens.length;
>> -        for (int i = 0; i < sz; i++) {
>> -            final Token token = tokens[i];
>> +        for (final Token token : tokens) {
>>              final Object value = token.getValue();
>>              final int count = token.getCount();
>>              if (value instanceof StringBuilder) {
>> @@ -443,7 +441,7 @@ public class DurationFormatUtils {
>>                      buffer.append(paddedValue(seconds, padWithZeros,
>> count));
>>                      lastOutputSeconds = true;
>>                  } else if (value == S) {
>> -                    if (lastOutputSeconds) {
>> +                    if (lastOutputSeconds) {
>>
>
> This looks unrelated
>
>
>>                          // ensure at least 3 digits are displayed even if
>> padding is not selected
>>                          int width = padWithZeros ? Math.max(3, count) : 3;
>>                          buffer.append(paddedValue(milliseconds, true,
>> width));
>> @@ -572,9 +570,8 @@ public class DurationFormatUtils {
>>           * @return boolean <code>true</code> if contained
>>           */
>>          static boolean containsTokenWithValue(final Token[] tokens, final
>> Object value) {
>> -            final int sz = tokens.length;
>> -            for (int i = 0; i < sz; i++) {
>> -                if (tokens[i].getValue() == value) {
>> +            for (Token token : tokens) {
>> +                if (token.getValue() == value) {
>>                      return true;
>>                  }
>>              }
>>
>>
>>
>
>
> --
> http://people.apache.org/~britter/
> http://www.systemoutprintln.de/
> http://twitter.com/BenediktRitter
> http://github.com/britter

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org

Reply via email to