Only use static imports to import assert methods in tests

This commit is contained in:
Gary Gregory 2023-04-13 20:20:19 -04:00
parent 2694f28774
commit c7d7a20767
2 changed files with 6 additions and 9 deletions

View File

@ -16,8 +16,6 @@
*/
package org.apache.commons.lang3.builder;
import static org.apache.commons.lang3.reflect.FieldUtils.readField;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
@ -110,11 +108,11 @@ public class ReflectionDiffBuilder<T> implements Builder<DiffResult<T>> {
for (final Field field : FieldUtils.getAllFields(clazz)) {
if (accept(field)) {
try {
diffBuilder.append(field.getName(), readField(field, left, true),
readField(field, right, true));
diffBuilder.append(field.getName(), FieldUtils.readField(field, left, true),
FieldUtils.readField(field, right, true));
} catch (final IllegalAccessException ex) {
//this can't happen. Would get a Security exception instead
//throw a runtime exception in case the impossible happens.
// this can't happen. Would get a Security exception instead
// throw a runtime exception in case the impossible happens.
throw new InternalError("Unexpected IllegalAccessException: " + ex.getMessage());
}
}

View File

@ -16,9 +16,8 @@
*/
package org.apache.commons.lang3.text;
import static java.util.FormattableFlags.LEFT_JUSTIFY;
import java.util.Formattable;
import java.util.FormattableFlags;
import java.util.Formatter;
import org.apache.commons.lang3.ObjectUtils;
@ -141,7 +140,7 @@ public class FormattableUtils {
final CharSequence actualEllipsis = ObjectUtils.defaultIfNull(ellipsis, StringUtils.EMPTY);
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++) {
buf.insert(leftJustify ? i : 0, padChar);
}