commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benedikt Ritter <brit...@apache.org>
Subject Re: svn commit: r1588859 - /commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/time/DurationFormatUtils.java
Date Fri, 25 Apr 2014 07:45:44 GMT
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


2014-04-21 10:37 GMT+02:00 <djones@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

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message