Skip to content

Commit 19ed638

Browse files
committed
Fix Javadoc generation on Java 8 and up
1 parent 1493333 commit 19ed638

37 files changed

+208
-473
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,9 +258,10 @@ protected DynaProperty getDynaProperty(final String name) {
258258

259259
/**
260260
* Return a Map representation of this DynaBean.
261-
* </p>
261+
* <p>
262262
* This, for example, could be used in JSTL in the following way to access
263263
* a DynaBean's <code>fooProperty</code>:
264+
* </p>
264265
* <ul><li><code>${myDynaBean.<strong>map</strong>.fooProperty}</code></li></ul>
265266
*
266267
* @return a Map representation of this DynaBean

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

Lines changed: 1 addition & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,13 @@
1515
* limitations under the License.
1616
*/
1717

18-
1918
package org.apache.commons.beanutils;
2019

21-
2220
import java.io.Serializable;
2321
import java.lang.reflect.Constructor;
2422
import java.lang.reflect.InvocationTargetException;
2523
import java.util.HashMap;
2624

27-
2825
/**
2926
* <p>Minimal implementation of the <code>DynaClass</code> interface. Can be
3027
* used as a convenience base class for more sophisticated implementations.</p> *
@@ -34,88 +31,68 @@
3431
* used to associate the DynaBean instance with this DynaClass.</p>
3532
*
3633
*/
37-
3834
public class BasicDynaClass implements DynaClass, Serializable {
3935

40-
41-
42-
4336
private static final long serialVersionUID = 1L;
4437

45-
4638
/**
4739
* The method signature of the constructor we will use to create
4840
* new DynaBean instances.
4941
*/
5042
protected static Class<?>[] constructorTypes = { DynaClass.class };
5143

52-
5344
/**
5445
* The constructor of the <code>dynaBeanClass</code> that we will use
5546
* for creating new instances.
5647
*/
5748
protected transient Constructor<?> constructor = null;
5849

59-
6050
/**
6151
* The argument values to be passed to the constructore we will use
6252
* to create new DynaBean instances.
6353
*/
6454
protected Object[] constructorValues = { this };
6555

66-
67-
68-
6956
/**
7057
* The <code>DynaBean</code> implementation class we will use for
7158
* creating new instances.
7259
*/
7360
protected Class<?> dynaBeanClass = BasicDynaBean.class;
7461

75-
7662
/**
7763
* The "name" of this DynaBean class.
7864
*/
7965
protected String name = this.getClass().getName();
8066

81-
8267
/**
8368
* The set of dynamic properties that are part of this DynaClass.
8469
*/
8570
protected DynaProperty[] properties = {};
8671

87-
8872
/**
8973
* The set of dynamic properties that are part of this DynaClass,
9074
* keyed by the property name. Individual descriptor instances will
9175
* be the same instances as those in the <code>properties</code> list.
9276
*/
9377
protected HashMap<String, DynaProperty> propertiesMap = new HashMap<>();
9478

95-
9679
/**
9780
* Construct a new BasicDynaClass with default parameters.
9881
*/
9982
public BasicDynaClass() {
100-
10183
this(null, null, null);
102-
10384
}
10485

105-
10686
/**
10787
* Construct a new BasicDynaClass with the specified parameters.
10888
*
10989
* @param name Name of this DynaBean class
11090
* @param dynaBeanClass The implementation class for new instances
11191
*/
11292
public BasicDynaClass(final String name, final Class<?> dynaBeanClass) {
113-
11493
this(name, dynaBeanClass, null);
115-
11694
}
11795

118-
11996
/**
12097
* Construct a new BasicDynaClass with the specified parameters.
12198
*
@@ -125,7 +102,6 @@ public BasicDynaClass(final String name, final Class<?> dynaBeanClass) {
125102
*/
126103
public BasicDynaClass(final String name, Class<?> dynaBeanClass,
127104
final DynaProperty[] properties) {
128-
129105
if (name != null) {
130106
this.name = name;
131107
}
@@ -136,12 +112,8 @@ public BasicDynaClass(final String name, Class<?> dynaBeanClass,
136112
if (properties != null) {
137113
setProperties(properties);
138114
}
139-
140115
}
141116

142-
143-
144-
145117
/**
146118
* Return the Class object we will use to create new instances in the
147119
* <code>newInstance()</code> method. This Class <strong>MUST</strong>
@@ -150,12 +122,9 @@ public BasicDynaClass(final String name, Class<?> dynaBeanClass,
150122
* @return The class of the {@link DynaBean}
151123
*/
152124
public Class<?> getDynaBeanClass() {
153-
154125
return this.dynaBeanClass;
155-
156126
}
157127

158-
159128
/**
160129
* <p>Return an array of <code>ProperyDescriptors</code> for the properties
161130
* currently defined in this DynaClass. If no properties are defined, a
@@ -169,12 +138,9 @@ public Class<?> getDynaBeanClass() {
169138
*/
170139
@Override
171140
public DynaProperty[] getDynaProperties() {
172-
173141
return properties;
174-
175142
}
176143

177-
178144
/**
179145
* Return a property descriptor for the specified property, if it exists;
180146
* otherwise, return <code>null</code>.
@@ -186,34 +152,26 @@ public DynaProperty[] getDynaProperties() {
186152
*/
187153
@Override
188154
public DynaProperty getDynaProperty(final String name) {
189-
190155
if (name == null) {
191156
throw new IllegalArgumentException
192157
("No property name specified");
193158
}
194159
return propertiesMap.get(name);
195-
196160
}
197161

198-
199162
/**
200163
* Return the name of this DynaClass (analogous to the
201-
* <code>getName()</code> method of <code>java.lang.Class</code), which
164+
* <code>getName()</code> method of <code>java.lang.Class</code>), which
202165
* allows the same <code>DynaClass</code> implementation class to support
203166
* different dynamic classes, with different sets of properties.
204167
*
205168
* @return the name of the DynaClass
206169
*/
207170
@Override
208171
public String getName() {
209-
210172
return this.name;
211-
212173
}
213174

214-
215-
216-
217175
/**
218176
* Instantiate and return a new DynaBean instance, associated
219177
* with this DynaClass.
@@ -228,7 +186,6 @@ public String getName() {
228186
@Override
229187
public DynaBean newInstance()
230188
throws IllegalAccessException, InstantiationException {
231-
232189
try {
233190
// Refind the constructor after a deserialization (if needed)
234191
if (constructor == null) {
@@ -240,12 +197,8 @@ public DynaBean newInstance()
240197
throw new InstantiationException
241198
(e.getTargetException().getMessage());
242199
}
243-
244200
}
245201

246-
247-
248-
249202
/**
250203
* Set the Class object we will use to create new instances in the
251204
* <code>newInstance()</code> method. This Class <strong>MUST</strong>
@@ -256,7 +209,6 @@ public DynaBean newInstance()
256209
* implement the <code>DynaBean</code> interface
257210
*/
258211
protected void setDynaBeanClass(final Class<?> dynaBeanClass) {
259-
260212
// Validate the argument type specified
261213
if (dynaBeanClass.isInterface()) {
262214
throw new IllegalArgumentException
@@ -268,7 +220,6 @@ protected void setDynaBeanClass(final Class<?> dynaBeanClass) {
268220
("Class " + dynaBeanClass.getName() +
269221
" does not implement DynaBean");
270222
}
271-
272223
// Identify the Constructor we will use in newInstance()
273224
try {
274225
this.constructor = dynaBeanClass.getConstructor(constructorTypes);
@@ -278,24 +229,19 @@ protected void setDynaBeanClass(final Class<?> dynaBeanClass) {
278229
" does not have an appropriate constructor");
279230
}
280231
this.dynaBeanClass = dynaBeanClass;
281-
282232
}
283233

284-
285234
/**
286235
* Set the list of dynamic properties supported by this DynaClass.
287236
*
288237
* @param properties List of dynamic properties to be supported
289238
*/
290239
protected void setProperties(final DynaProperty[] properties) {
291-
292240
this.properties = properties;
293241
propertiesMap.clear();
294242
for (final DynaProperty propertie : properties) {
295243
propertiesMap.put(propertie.getName(), propertie);
296244
}
297-
298245
}
299246

300-
301247
}

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -253,22 +253,22 @@ public void clear() {
253253
* <ul>
254254
* <li>If there is no underlying bean, return a cloned BeanMap without a
255255
* bean.
256-
*
256+
* </li>
257257
* <li>Since there is an underlying bean, try to instantiate a new bean of
258258
* the same type using Class.newInstance().
259-
*
259+
* </li>
260260
* <li>If the instantiation fails, throw a CloneNotSupportedException
261-
*
261+
* </li>
262262
* <li>Clone the bean map and set the newly instantiated bean as the
263263
* underlying bean for the bean map.
264-
*
264+
* </li>
265265
* <li>Copy each property that is both readable and writable from the
266266
* existing object to a cloned bean map.
267-
*
267+
* </li>
268268
* <li>If anything fails along the way, throw a
269269
* CloneNotSupportedException.
270-
*
271-
* <ul>
270+
* </li>
271+
* </ul>
272272
*
273273
* @return a cloned instance of this bean map
274274
* @throws CloneNotSupportedException if the underlying bean

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

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,35 +33,36 @@
3333
* what property will be updated and with what value.
3434
* <dl>
3535
* <dt>
36-
* <b><code>
37-
* <pre>public BeanPropertyValueChangeClosure( String propertyName, Object propertyValue )</pre>
38-
* </code></b>
36+
* <b>
37+
* <code>public BeanPropertyValueChangeClosure(String propertyName, Object propertyValue)</code>
38+
* </b>
3939
* </dt>
4040
* <dd>
4141
* Will create a <code>Closure</code> that will update an object by setting the property
4242
* specified by <code>propertyName</code> to the value specified by <code>propertyValue</code>.
4343
* </dd>
4444
* </dl>
4545
*
46-
* <p/>
46+
* <p>
4747
* <strong>Note:</strong> Property names can be a simple, nested, indexed, or mapped property as defined by
4848
* <code>org.apache.commons.beanutils.PropertyUtils</code>. If any object in the property path
4949
* specified by <code>propertyName</code> is <code>null</code> then the outcome is based on the
5050
* value of the <code>ignoreNull</code> attribute.
51-
*
52-
* <p/>
51+
* </p>
52+
* <p>
5353
* A typical usage might look like:
54-
* <code><pre>
54+
* </p>
55+
* <pre>
5556
* // create the closure
5657
* BeanPropertyValueChangeClosure closure =
5758
* new BeanPropertyValueChangeClosure( "activeEmployee", Boolean.TRUE );
5859
*
5960
* // update the Collection
6061
* CollectionUtils.forAllDo( peopleCollection, closure );
61-
* </pre></code>
62-
* <p/>
63-
*
62+
* </pre>
63+
* <p>
6464
* This would take a <code>Collection</code> of person objects and update the
65+
* </p>
6566
* <code>activeEmployee</code> property of each object in the <code>Collection</code> to
6667
* <code>true</code>. Assuming...
6768
* <ul>

0 commit comments

Comments
 (0)