[CODEC-295] Minor improvements by arturobernalg · Pull Request #67 · apache/commons-codec (original) (raw)

final int l = data.length;
final char[] out = new char[l << 1];
encodeHex(data, 0, data.length, toDigits, out, 0);
encodeHex(data, 0, l, toDigits, out, 0);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No mystery names please, especially "l" which can look just like a "1" depending on your font!

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agree. fixit

inputs = null;
} else {
inputs = new String[args.length -1];
inputs = new String[argsLength -1];

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Formatting.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agree. fixit

if (startsWith && endsWith) {
// exact match
if (content.length() == 0) {
if (contentLength == 0) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just use String#isEmpty() for 0-length checks on Strings.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agree. fixit

}
};
} else if ((startsWith |
} else if ((startsWith |

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See above.

*
* @throws IllegalArgumentException for some failure scenarios.
*/
@Test(expected = IllegalArgumentException.class)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need a local var?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agree. fixit