Only use static imports to import assert methods in tests
This commit is contained in:
parent
2694f28774
commit
c7d7a20767
|
@ -16,8 +16,6 @@
|
||||||
*/
|
*/
|
||||||
package org.apache.commons.lang3.builder;
|
package org.apache.commons.lang3.builder;
|
||||||
|
|
||||||
import static org.apache.commons.lang3.reflect.FieldUtils.readField;
|
|
||||||
|
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.lang.reflect.Modifier;
|
import java.lang.reflect.Modifier;
|
||||||
|
|
||||||
|
@ -110,11 +108,11 @@ public class ReflectionDiffBuilder<T> implements Builder<DiffResult<T>> {
|
||||||
for (final Field field : FieldUtils.getAllFields(clazz)) {
|
for (final Field field : FieldUtils.getAllFields(clazz)) {
|
||||||
if (accept(field)) {
|
if (accept(field)) {
|
||||||
try {
|
try {
|
||||||
diffBuilder.append(field.getName(), readField(field, left, true),
|
diffBuilder.append(field.getName(), FieldUtils.readField(field, left, true),
|
||||||
readField(field, right, true));
|
FieldUtils.readField(field, right, true));
|
||||||
} catch (final IllegalAccessException ex) {
|
} catch (final IllegalAccessException ex) {
|
||||||
//this can't happen. Would get a Security exception instead
|
// this can't happen. Would get a Security exception instead
|
||||||
//throw a runtime exception in case the impossible happens.
|
// throw a runtime exception in case the impossible happens.
|
||||||
throw new InternalError("Unexpected IllegalAccessException: " + ex.getMessage());
|
throw new InternalError("Unexpected IllegalAccessException: " + ex.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,9 +16,8 @@
|
||||||
*/
|
*/
|
||||||
package org.apache.commons.lang3.text;
|
package org.apache.commons.lang3.text;
|
||||||
|
|
||||||
import static java.util.FormattableFlags.LEFT_JUSTIFY;
|
|
||||||
|
|
||||||
import java.util.Formattable;
|
import java.util.Formattable;
|
||||||
|
import java.util.FormattableFlags;
|
||||||
import java.util.Formatter;
|
import java.util.Formatter;
|
||||||
|
|
||||||
import org.apache.commons.lang3.ObjectUtils;
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
|
@ -141,7 +140,7 @@ public class FormattableUtils {
|
||||||
final CharSequence actualEllipsis = ObjectUtils.defaultIfNull(ellipsis, StringUtils.EMPTY);
|
final CharSequence actualEllipsis = ObjectUtils.defaultIfNull(ellipsis, StringUtils.EMPTY);
|
||||||
buf.replace(precision - actualEllipsis.length(), seq.length(), actualEllipsis.toString());
|
buf.replace(precision - actualEllipsis.length(), seq.length(), actualEllipsis.toString());
|
||||||
}
|
}
|
||||||
final boolean leftJustify = (flags & LEFT_JUSTIFY) == LEFT_JUSTIFY;
|
final boolean leftJustify = (flags & FormattableFlags.LEFT_JUSTIFY) == FormattableFlags.LEFT_JUSTIFY;
|
||||||
for (int i = buf.length(); i < width; i++) {
|
for (int i = buf.length(); i < width; i++) {
|
||||||
buf.insert(leftJustify ? i : 0, padChar);
|
buf.insert(leftJustify ? i : 0, padChar);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue