Skip to content

Commit 4a3232d

Browse files
committed
Sort imports
Fix Javadoc warnings
1 parent d7006dc commit 4a3232d

File tree

57 files changed

+184
-184
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+184
-184
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,9 @@ public BaseDynaBeanMapDecorator(final DynaBean dynaBean, final boolean readOnly)
125125

126126

127127
/**
128-
* clear() operation is not supported.
128+
* Always throws UnsupportedOperationException because this operation is unsupported.
129129
*
130-
* @throws UnsupportedOperationException
130+
* @throws UnsupportedOperationException Always thrown.
131131
*/
132132
@Override
133133
public void clear() {
@@ -334,11 +334,11 @@ public void putAll(final Map<? extends K, ? extends Object> map) {
334334
}
335335

336336
/**
337-
* remove() operation is not supported.
337+
* Always throws UnsupportedOperationException because this operation is unsupported.
338338
*
339-
* @param key The {@link DynaBean}'s property name
340-
* @return the value removed
341-
* @throws UnsupportedOperationException
339+
* @param key The {@link DynaBean}'s property name.
340+
* @return the value removed.
341+
* @throws UnsupportedOperationException Always thrown.
342342
*/
343343
@Override
344344
public Object remove(final Object key) {

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

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,16 @@
4848
public class BeanComparator<T> implements Comparator<T>, Serializable {
4949

5050
private static final long serialVersionUID = 1L;
51+
52+
/**
53+
* Method name to call to compare.
54+
*/
5155
private String property;
56+
57+
/**
58+
* BeanComparator will pass the values of the specified bean property to this Comparator. If your bean property is not a comparable or contains null values,
59+
* a suitable comparator may be supplied in this constructor.
60+
*/
5261
private final Comparator<?> comparator;
5362

5463
/**
@@ -83,8 +92,8 @@ public BeanComparator() {
8392
* property. See {@link PropertyUtilsBean} for property query language syntax.
8493
* If the property passed in is null then the actual objects will be compared
8594
*/
86-
public BeanComparator( final String property ) {
87-
this( property, ComparableComparator.getInstance() );
95+
public BeanComparator(final String property) {
96+
this(property, ComparableComparator.getInstance());
8897
}
8998

9099
/**
@@ -103,8 +112,8 @@ public BeanComparator( final String property ) {
103112
* contains null values, a suitable comparator
104113
* may be supplied in this constructor.
105114
*/
106-
public BeanComparator( final String property, final Comparator<?> comparator ) {
107-
setProperty( property );
115+
public BeanComparator(final String property, final Comparator<?> comparator) {
116+
setProperty(property);
108117
if (comparator != null) {
109118
this.comparator = comparator;
110119
} else {
@@ -121,30 +130,26 @@ public BeanComparator( final String property, final Comparator<?> comparator ) {
121130
* @return int negative or positive based on order
122131
*/
123132
@Override
124-
public int compare( final T o1, final T o2 ) {
133+
public int compare(final T o1, final T o2) {
125134

126-
if ( property == null ) {
135+
if (property == null) {
127136
// compare the actual objects
128-
return internalCompare( o1, o2 );
137+
return internalCompare(o1, o2);
129138
}
130139

131140
try {
132-
final Object value1 = PropertyUtils.getProperty( o1, property );
133-
final Object value2 = PropertyUtils.getProperty( o2, property );
134-
return internalCompare( value1, value2 );
135-
}
136-
catch ( final IllegalAccessException iae ) {
137-
throw new RuntimeException( "IllegalAccessException: " + iae.toString() );
138-
}
139-
catch ( final InvocationTargetException ite ) {
140-
throw new RuntimeException( "InvocationTargetException: " + ite.toString() );
141-
}
142-
catch ( final NoSuchMethodException nsme ) {
143-
throw new RuntimeException( "NoSuchMethodException: " + nsme.toString() );
141+
final Object value1 = PropertyUtils.getProperty(o1, property);
142+
final Object value2 = PropertyUtils.getProperty(o2, property);
143+
return internalCompare(value1, value2);
144+
} catch (final IllegalAccessException iae) {
145+
throw new RuntimeException("IllegalAccessException: " + iae.toString());
146+
} catch (final InvocationTargetException ite) {
147+
throw new RuntimeException("InvocationTargetException: " + ite.toString());
148+
} catch (final NoSuchMethodException nsme) {
149+
throw new RuntimeException("NoSuchMethodException: " + nsme.toString());
144150
}
145151
}
146152

147-
148153
/**
149154
* Two <code>BeanComparator</code>'s are equals if and only if
150155
* the wrapped comparators and the property names to be compared

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

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -263,32 +263,29 @@ private Class<?> readAnyClass(final ObjectInputStream in) throws IOException, Cl
263263

264264

265265
/**
266-
* Reads field values for this object safely.
267-
* There are issues with serializing primitive class types on certain JVM versions
268-
* (including java 1.3).
269-
* This method provides a workaround.
266+
* Reads field values for this object safely. There are issues with serializing primitive class types on certain JVM versions (including java 1.3). This
267+
* method provides a workaround.
270268
*
271-
* @throws StreamCorruptedException when the stream data values are outside expected range
269+
* @param in the content source.
270+
* @throws IOException when the stream data values are outside expected range
271+
* @throws ClassNotFoundException Class of a serialized object cannot be found.
272272
*/
273273
private void readObject(final ObjectInputStream in) throws IOException, ClassNotFoundException {
274-
275274
this.type = readAnyClass(in);
276-
277275
if (isMapped() || isIndexed()) {
278276
this.contentType = readAnyClass(in);
279277
}
280-
281278
// read other values
282279
in.defaultReadObject();
283280
}
284281

285282
/**
286283
* Return a String representation of this Object.
284+
*
287285
* @return a String representation of the dyna property
288286
*/
289287
@Override
290288
public String toString() {
291-
292289
final StringBuilder sb = new StringBuilder("DynaProperty[name=");
293290
sb.append(this.name);
294291
sb.append(",type=");
@@ -302,7 +299,9 @@ public String toString() {
302299
}
303300

304301
/**
305-
* Write a class using safe encoding to workaround java 1.3 serialization bug.
302+
* Writes a class using safe encoding to workaround java 1.3 serialization bug.
303+
*
304+
* @throws IOException if I/O errors occur while writing to the underlying stream.
306305
*/
307306
private void writeAnyClass(final Class<?> clazz, final ObjectOutputStream out) throws IOException {
308307
// safely write out any class
@@ -324,7 +323,6 @@ private void writeAnyClass(final Class<?> clazz, final ObjectOutputStream out) t
324323
} else if (Short.TYPE.equals(clazz)) {
325324
primitiveType = SHORT_TYPE;
326325
}
327-
328326
if (primitiveType == 0) {
329327
// then it's not a primitive type
330328
out.writeBoolean(false);
@@ -338,19 +336,17 @@ private void writeAnyClass(final Class<?> clazz, final ObjectOutputStream out) t
338336

339337

340338
/**
341-
* Writes this object safely.
342-
* There are issues with serializing primitive class types on certain JVM versions
343-
* (including java 1.3).
344-
* This method provides a workaround.
339+
* Writes this object safely. There are issues with serializing primitive class types on certain JVM versions (including java 1.3). This method provides a
340+
* workaround.
341+
*
342+
* @param out Where to write.
343+
* @throws IOException if I/O errors occur while writing to the underlying stream.
345344
*/
346345
private void writeObject(final ObjectOutputStream out) throws IOException {
347-
348346
writeAnyClass(this.type,out);
349-
350347
if (isMapped() || isIndexed()) {
351348
writeAnyClass(this.contentType,out);
352349
}
353-
354350
// write out other values
355351
out.defaultWriteObject();
356352
}

src/main/java/org/apache/commons/beanutils/converters/AbstractConverter.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
import java.lang.reflect.Array;
2020
import java.util.Collection;
2121

22-
import org.apache.commons.beanutils.BeanUtils;
2322
import org.apache.commons.beanutils.ConversionException;
2423
import org.apache.commons.beanutils.ConvertUtils;
2524
import org.apache.commons.beanutils.Converter;

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@
2222
import java.util.HashMap;
2323
import java.util.Map;
2424

25-
import junit.framework.Test;
26-
import junit.textui.TestRunner;
27-
2825
import org.apache.commons.beanutils.bugs.other.Jira87BeanFactory;
2926
import org.apache.commons.collections.BulkTest;
3027
import org.apache.commons.collections.Transformer;
3128
import org.apache.commons.collections.map.AbstractTestMap;
3229

30+
import junit.framework.Test;
31+
import junit.textui.TestRunner;
32+
3333
/**
3434
* Test cases for BeanMap
3535
*

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@
1717

1818
package org.apache.commons.beanutils;
1919

20-
import junit.framework.TestCase;
21-
2220
import org.apache.commons.collections.functors.EqualPredicate;
2321
import org.apache.commons.collections.functors.InstanceofPredicate;
2422
import org.apache.commons.collections.functors.NotPredicate;
2523
import org.apache.commons.collections.functors.NullPredicate;
2624

25+
import junit.framework.TestCase;
26+
2727
/**
2828
*/
2929
public class BeanPredicateTestCase extends TestCase {

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@
2424
import java.util.Locale;
2525
import java.util.Map;
2626

27+
import org.apache.commons.beanutils.converters.ArrayConverter;
28+
import org.apache.commons.beanutils.converters.DateConverter;
29+
2730
import junit.framework.Test;
2831
import junit.framework.TestCase;
2932
import junit.framework.TestSuite;
3033

31-
import org.apache.commons.beanutils.converters.ArrayConverter;
32-
import org.apache.commons.beanutils.converters.DateConverter;
33-
3434

3535
/**
3636
* <p>

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@
2222
import java.util.Map;
2323
import java.util.WeakHashMap;
2424

25+
import org.apache.commons.logging.LogFactory;
26+
2527
import junit.framework.Test;
2628
import junit.framework.TestCase;
2729
import junit.framework.TestSuite;
2830

29-
import org.apache.commons.logging.LogFactory;
30-
3131
/**
3232
* <p>
3333
* Test Case for changes made during Beanutils Beanification

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@
2525
import java.text.SimpleDateFormat;
2626
import java.util.Locale;
2727

28+
import org.apache.commons.beanutils.converters.DateConverter;
29+
2830
import junit.framework.Test;
2931
import junit.framework.TestCase;
3032
import junit.framework.TestSuite;
3133

32-
import org.apache.commons.beanutils.converters.DateConverter;
33-
3434

3535
/**
3636
* <p>

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@
2121
import java.lang.reflect.Method;
2222
import java.lang.reflect.Modifier;
2323

24+
import org.apache.commons.beanutils.priv.PrivateBeanFactory;
25+
import org.apache.commons.beanutils.priv.PublicSubBean;
26+
2427
import junit.framework.Test;
2528
import junit.framework.TestCase;
2629
import junit.framework.TestSuite;
2730

28-
import org.apache.commons.beanutils.priv.PrivateBeanFactory;
29-
import org.apache.commons.beanutils.priv.PublicSubBean;
30-
3131
/**
3232
* <p> Test case for <code>MethodUtils</code> </p>
3333
*

0 commit comments

Comments
 (0)