Skip to content

Commit e6174f2

Browse files
committed
Use spaces, not tabs
1 parent 4386e19 commit e6174f2

File tree

2 files changed

+34
-43
lines changed

2 files changed

+34
-43
lines changed

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

Lines changed: 25 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -30,26 +30,24 @@
3030
*/
3131
public class FluentPropertyBeanIntrospectorTestCase extends TestCase {
3232
public static final class CapsBean {
33-
private URI mURI;
33+
private URI mURI;
3434

35-
public URI getURI() {
36-
return mURI;
37-
}
35+
public URI getURI() {
36+
return mURI;
37+
}
3838

39-
public void setURI(final URI theURI) {
40-
mURI = theURI;
41-
}
42-
}
39+
public void setURI(final URI theURI) {
40+
mURI = theURI;
41+
}
42+
}
4343

4444
/**
45-
* Puts all property descriptors into a map so that they can be accessed by
46-
* property name.
45+
* Puts all property descriptors into a map so that they can be accessed by property name.
4746
*
4847
* @param descs the array with descriptors
4948
* @return a map with property names as keys
5049
*/
51-
private static Map<String, PropertyDescriptor> createDescriptorMap(
52-
final PropertyDescriptor[] descs) {
50+
private static Map<String, PropertyDescriptor> createDescriptorMap(final PropertyDescriptor[] descs) {
5351
final Map<String, PropertyDescriptor> map = new HashMap<>();
5452
for (final PropertyDescriptor pd : descs) {
5553
map.put(pd.getName(), pd);
@@ -58,15 +56,13 @@ private static Map<String, PropertyDescriptor> createDescriptorMap(
5856
}
5957

6058
/**
61-
* Convenience method for obtaining a specific property descriptor and
62-
* checking whether it exists.
59+
* Convenience method for obtaining a specific property descriptor and checking whether it exists.
6360
*
6461
* @param props the map with property descriptors
65-
* @param name the name of the desired descriptor
62+
* @param name the name of the desired descriptor
6663
* @return the descriptor from the map
6764
*/
68-
private static PropertyDescriptor fetchDescriptor(
69-
final Map<String, PropertyDescriptor> props, final String name) {
65+
private static PropertyDescriptor fetchDescriptor(final Map<String, PropertyDescriptor> props, final String name) {
7066
assertTrue("Property not found: " + name, props.containsKey(name));
7167
return props.get(name);
7268
}
@@ -90,8 +86,7 @@ public void testIntrospection() throws IntrospectionException {
9086
final PropertyUtilsBean pu = new PropertyUtilsBean();
9187
final FluentPropertyBeanIntrospector introspector = new FluentPropertyBeanIntrospector();
9288
pu.addBeanIntrospector(introspector);
93-
final Map<String, PropertyDescriptor> props = createDescriptorMap(pu
94-
.getPropertyDescriptors(FluentIntrospectionTestBean.class));
89+
final Map<String, PropertyDescriptor> props = createDescriptorMap(pu.getPropertyDescriptors(FluentIntrospectionTestBean.class));
9590
PropertyDescriptor pd = fetchDescriptor(props, "name");
9691
assertNotNull("No read method for name", pd.getReadMethod());
9792
assertNotNull("No write method for name", pd.getWriteMethod());
@@ -100,29 +95,26 @@ public void testIntrospection() throws IntrospectionException {
10095
assertNull("Read method for fluentProperty", pd.getReadMethod());
10196
assertNotNull("No write method for fluentProperty", pd.getWriteMethod());
10297
pd = fetchDescriptor(props, "fluentGetProperty");
103-
assertNotNull("No read method for fluentGetProperty",
104-
pd.getReadMethod());
105-
assertNotNull("No write method for fluentGetProperty",
106-
pd.getWriteMethod());
98+
assertNotNull("No read method for fluentGetProperty", pd.getReadMethod());
99+
assertNotNull("No write method for fluentGetProperty", pd.getWriteMethod());
107100
}
108101

109-
public void testIntrospectionCaps() throws Exception {
110-
final PropertyUtilsBean pu = new PropertyUtilsBean();
102+
public void testIntrospectionCaps() throws Exception {
103+
final PropertyUtilsBean pu = new PropertyUtilsBean();
111104

112105
final FluentPropertyBeanIntrospector introspector = new FluentPropertyBeanIntrospector();
113106

114-
pu.addBeanIntrospector(introspector);
107+
pu.addBeanIntrospector(introspector);
115108

116-
final Map<String, PropertyDescriptor> props = createDescriptorMap(
117-
pu.getPropertyDescriptors(CapsBean.class));
109+
final Map<String, PropertyDescriptor> props = createDescriptorMap(pu.getPropertyDescriptors(CapsBean.class));
118110

119-
final PropertyDescriptor aDescriptor = fetchDescriptor(props, "URI");
111+
final PropertyDescriptor aDescriptor = fetchDescriptor(props, "URI");
120112

121-
assertNotNull("missing property", aDescriptor);
113+
assertNotNull("missing property", aDescriptor);
122114

123-
assertNotNull("No read method for uri", aDescriptor.getReadMethod());
124-
assertNotNull("No write method for uri", aDescriptor.getWriteMethod());
115+
assertNotNull("No read method for uri", aDescriptor.getReadMethod());
116+
assertNotNull("No write method for uri", aDescriptor.getWriteMethod());
125117

126-
assertNull("Should not find mis-capitalized property", props.get("uRI"));
118+
assertNull("Should not find mis-capitalized property", props.get("uRI"));
127119
}
128120
}

src/test/java/org/apache/commons/beanutils/bugs/Jira493TestCase.java

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,16 @@
2727
*
2828
* @see <a href="https://issues.apache.org/jira/browse/BEANUTILS-493">BEANUTILS-493</a>
2929
*/
30-
3130
public class Jira493TestCase {
3231

33-
@Test
34-
public void testIndexedProperties() throws Exception {
35-
final LazyDynaBean lazyDynaBean = new LazyDynaBean();
36-
final BeanUtilsBean beanUtilsBean = BeanUtilsBean.getInstance();
37-
beanUtilsBean.setProperty(lazyDynaBean, "x[0]", "x1");
38-
beanUtilsBean.setProperty(lazyDynaBean, "x[1]", "x2");
39-
final Object x = lazyDynaBean.get("x");
40-
assertEquals("[x1, x2]", x.toString());
41-
}
32+
@Test
33+
public void testIndexedProperties() throws Exception {
34+
final LazyDynaBean lazyDynaBean = new LazyDynaBean();
35+
final BeanUtilsBean beanUtilsBean = BeanUtilsBean.getInstance();
36+
beanUtilsBean.setProperty(lazyDynaBean, "x[0]", "x1");
37+
beanUtilsBean.setProperty(lazyDynaBean, "x[1]", "x2");
38+
final Object x = lazyDynaBean.get("x");
39+
assertEquals("[x1, x2]", x.toString());
40+
}
4241

4342
}

0 commit comments

Comments
 (0)