Skip to content

Commit 74227b5

Browse files
committed
Fix ParenPad
1 parent 76e5bdf commit 74227b5

16 files changed

+262
-394
lines changed

src/main/java/org/apache/commons/beanutils/BeanComparator.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public class BeanComparator<T> implements Comparator<T>, Serializable {
7171
* </p>
7272
*/
7373
public BeanComparator() {
74-
this( null );
74+
this(null);
7575
}
7676

7777
/**
@@ -232,7 +232,7 @@ private int internalCompare(final Object val1, final Object val2) {
232232
* @param property String method name to call to compare
233233
* If the property passed in is null then the actual objects will be compared
234234
*/
235-
public void setProperty( final String property ) {
235+
public void setProperty(final String property) {
236236
this.property = property;
237237
}
238238
}

src/main/java/org/apache/commons/beanutils/BeanMap.java

Lines changed: 188 additions & 263 deletions
Large diffs are not rendered by default.

src/main/java/org/apache/commons/beanutils/BeanPredicate.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public boolean evaluate(final Object object) {
6565
boolean evaluation = false;
6666

6767
try {
68-
final Object propValue = PropertyUtils.getProperty( object, propertyName );
68+
final Object propValue = PropertyUtils.getProperty(object, propertyName);
6969
evaluation = predicate.evaluate(propValue);
7070
} catch (final IllegalArgumentException e) {
7171
final String errorMsg = "Problem during evaluation.";

src/main/java/org/apache/commons/beanutils/LazyDynaList.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -514,10 +514,10 @@ public void setElementType(final Class<?> elementType) {
514514
this.elementDynaBeanType = dynaBean.getClass();
515515

516516
// Re-calculate the type
517-
if (WrapDynaBean.class.isAssignableFrom(elementDynaBeanType )) {
518-
this.elementType = ((WrapDynaBean)dynaBean).getInstance().getClass();
519-
} else if (LazyDynaMap.class.isAssignableFrom(elementDynaBeanType )) {
520-
this.elementType = ((LazyDynaMap)dynaBean).getMap().getClass();
517+
if (WrapDynaBean.class.isAssignableFrom(elementDynaBeanType)) {
518+
this.elementType = ((WrapDynaBean) dynaBean).getInstance().getClass();
519+
} else if (LazyDynaMap.class.isAssignableFrom(elementDynaBeanType)) {
520+
this.elementType = ((LazyDynaMap) dynaBean).getMap().getClass();
521521
}
522522

523523
}

src/main/java/org/apache/commons/beanutils/MethodUtils.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -521,9 +521,9 @@ public static Method getMatchingAccessibleMethod(
521521
}
522522
setMethodAccessible(method); // Default access superclass workaround
523523
myCost = getTotalTransformationCost(parameterTypes,method.getParameterTypes());
524-
if ( myCost < bestMatchCost ) {
525-
bestMatch = method;
526-
bestMatchCost = myCost;
524+
if (myCost < bestMatchCost) {
525+
bestMatch = method;
526+
bestMatchCost = myCost;
527527
}
528528
}
529529

@@ -532,11 +532,11 @@ public static Method getMatchingAccessibleMethod(
532532
}
533533
}
534534
}
535-
if ( bestMatch != null ){
536-
cacheMethod(md, bestMatch);
535+
if (bestMatch != null) {
536+
cacheMethod(md, bestMatch);
537537
} else {
538-
// didn't find a match
539-
log.trace("No match found.");
538+
// didn't find a match
539+
log.trace("No match found.");
540540
}
541541

542542
return bestMatch;

src/main/java/org/apache/commons/beanutils/PropertyUtilsBean.java

Lines changed: 10 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1197,58 +1197,43 @@ public Resolver getResolver() {
11971197
* @throws NoSuchMethodException if an accessor method for this
11981198
* propety cannot be found
11991199
*/
1200-
public Object getSimpleProperty(final Object bean, final String name)
1201-
throws IllegalAccessException, InvocationTargetException,
1202-
NoSuchMethodException {
1200+
public Object getSimpleProperty(final Object bean, final String name) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException {
12031201

12041202
if (bean == null) {
12051203
throw new IllegalArgumentException("No bean specified");
12061204
}
12071205
if (name == null) {
1208-
throw new IllegalArgumentException("No name specified for bean class '" +
1209-
bean.getClass() + "'");
1206+
throw new IllegalArgumentException("No name specified for bean class '" + bean.getClass() + "'");
12101207
}
12111208

12121209
// Validate the syntax of the property name
12131210
if (resolver.hasNested(name)) {
1214-
throw new IllegalArgumentException
1215-
("Nested property names are not allowed: Property '" +
1216-
name + "' on bean class '" + bean.getClass() + "'");
1211+
throw new IllegalArgumentException("Nested property names are not allowed: Property '" + name + "' on bean class '" + bean.getClass() + "'");
12171212
}
12181213
if (resolver.isIndexed(name)) {
1219-
throw new IllegalArgumentException
1220-
("Indexed property names are not allowed: Property '" +
1221-
name + "' on bean class '" + bean.getClass() + "'");
1214+
throw new IllegalArgumentException("Indexed property names are not allowed: Property '" + name + "' on bean class '" + bean.getClass() + "'");
12221215
}
12231216
if (resolver.isMapped(name)) {
1224-
throw new IllegalArgumentException
1225-
("Mapped property names are not allowed: Property '" +
1226-
name + "' on bean class '" + bean.getClass() + "'");
1217+
throw new IllegalArgumentException("Mapped property names are not allowed: Property '" + name + "' on bean class '" + bean.getClass() + "'");
12271218
}
12281219

12291220
// Handle DynaBean instances specially
12301221
if (bean instanceof DynaBean) {
1231-
final DynaProperty descriptor =
1232-
((DynaBean) bean).getDynaClass().getDynaProperty(name);
1222+
final DynaProperty descriptor = ((DynaBean) bean).getDynaClass().getDynaProperty(name);
12331223
if (descriptor == null) {
1234-
throw new NoSuchMethodException("Unknown property '" +
1235-
name + "' on dynaclass '" +
1236-
((DynaBean) bean).getDynaClass() + "'" );
1224+
throw new NoSuchMethodException("Unknown property '" + name + "' on dynaclass '" + ((DynaBean) bean).getDynaClass() + "'");
12371225
}
12381226
return ((DynaBean) bean).get(name);
12391227
}
12401228

12411229
// Retrieve the property getter method for the specified property
1242-
final PropertyDescriptor descriptor =
1243-
getPropertyDescriptor(bean, name);
1230+
final PropertyDescriptor descriptor = getPropertyDescriptor(bean, name);
12441231
if (descriptor == null) {
1245-
throw new NoSuchMethodException("Unknown property '" +
1246-
name + "' on class '" + bean.getClass() + "'" );
1232+
throw new NoSuchMethodException("Unknown property '" + name + "' on class '" + bean.getClass() + "'");
12471233
}
12481234
final Method readMethod = getReadMethod(bean.getClass(), descriptor);
12491235
if (readMethod == null) {
1250-
throw new NoSuchMethodException("Property '" + name +
1251-
"' has no getter method in class '" + bean.getClass() + "'");
1236+
throw new NoSuchMethodException("Property '" + name + "' has no getter method in class '" + bean.getClass() + "'");
12521237
}
12531238

12541239
return invokeMethod(readMethod, bean, EMPTY_OBJECT_ARRAY);

src/main/java/org/apache/commons/beanutils/RowSetDynaClass.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ public RowSetDynaClass(final ResultSet resultSet, final int limit) throws SQLExc
243243
protected void copy(final ResultSet resultSet) throws SQLException {
244244

245245
int cnt = 0;
246-
while (resultSet.next() && (limit < 0 || cnt++ < limit) ) {
246+
while (resultSet.next() && (limit < 0 || cnt++ < limit)) {
247247
final DynaBean bean = createDynaBean();
248248
for (final DynaProperty propertie : properties) {
249249
final String name = propertie.getName();

src/main/java/org/apache/commons/beanutils/locale/LocaleConvertUtilsBean.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -417,9 +417,7 @@ protected FastHashMap create(final Locale locale) {
417417
// behaviour of toString and valueOf methods of these classes
418418
converter.put(java.sql.Date.class, new SqlDateLocaleConverter(locale, "yyyy-MM-dd"));
419419
converter.put(java.sql.Time.class, new SqlTimeLocaleConverter(locale, "HH:mm:ss"));
420-
converter.put( java.sql.Timestamp.class,
421-
new SqlTimestampLocaleConverter(locale, "yyyy-MM-dd HH:mm:ss.S")
422-
);
420+
converter.put(java.sql.Timestamp.class, new SqlTimestampLocaleConverter(locale, "yyyy-MM-dd HH:mm:ss.S"));
423421

424422
converter.setFast(true);
425423

src/main/java/org/apache/commons/beanutils/locale/converters/DateLocaleConverter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ private String convertPattern(final String pattern, final String fromChars, fina
282282
quoted = true;
283283
} else if (thisChar >= 'a' && thisChar <= 'z' ||
284284
thisChar >= 'A' && thisChar <= 'Z') {
285-
final int index = fromChars.indexOf(thisChar );
285+
final int index = fromChars.indexOf(thisChar);
286286
if (index == -1) {
287287
throw new IllegalArgumentException(
288288
"Illegal pattern character '" + thisChar + "'");

src/test/java/org/apache/commons/beanutils/BeanPredicateTestCase.java

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,29 +33,25 @@ public BeanPredicateTestCase(final String name) {
3333
}
3434

3535
public void testEqual() {
36-
final BeanPredicate predicate =
37-
new BeanPredicate("stringProperty",new EqualPredicate("foo"));
36+
final BeanPredicate predicate = new BeanPredicate("stringProperty", new EqualPredicate("foo"));
3837
assertTrue(predicate.evaluate(new TestBean("foo")));
3938
assertTrue(!predicate.evaluate(new TestBean("bar")));
4039
}
4140

4241
public void testInstanceOf() {
43-
final BeanPredicate predicate =
44-
new BeanPredicate("stringProperty",new InstanceofPredicate( String.class ));
42+
final BeanPredicate predicate = new BeanPredicate("stringProperty", new InstanceofPredicate(String.class));
4543
assertTrue(predicate.evaluate(new TestBean("foo")));
4644
assertTrue(predicate.evaluate(new TestBean("bar")));
4745
}
4846

4947
public void testNotEqual() {
50-
final BeanPredicate predicate =
51-
new BeanPredicate("stringProperty",new NotPredicate( new EqualPredicate("foo")));
48+
final BeanPredicate predicate = new BeanPredicate("stringProperty", new NotPredicate(new EqualPredicate("foo")));
5249
assertTrue(!predicate.evaluate(new TestBean("foo")));
5350
assertTrue(predicate.evaluate(new TestBean("bar")));
5451
}
5552

5653
public void testNull() {
57-
final BeanPredicate predicate =
58-
new BeanPredicate("stringProperty", NullPredicate.INSTANCE);
54+
final BeanPredicate predicate = new BeanPredicate("stringProperty", NullPredicate.INSTANCE);
5955
final String nullString = null;
6056
assertTrue(predicate.evaluate(new TestBean(nullString)));
6157
assertTrue(!predicate.evaluate(new TestBean("bar")));

0 commit comments

Comments
 (0)