Skip to content

Commit 01b2da3

Browse files
committed
Javadoc
Add @throws and @see tags for SecurityException and SecurityManager respectively
1 parent b62fc00 commit 01b2da3

File tree

6 files changed

+144
-29
lines changed

6 files changed

+144
-29
lines changed

src/main/java/org/apache/commons/lang3/builder/ReflectionDiffBuilder.java

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,12 @@ private boolean accept(final Field field) {
193193
return !field.isAnnotationPresent(DiffExclude.class);
194194
}
195195

196+
/**
197+
* Appends fields using reflection.
198+
*
199+
* @throws SecurityException if an underlying accessible object's method denies the request.
200+
* @see SecurityManager#checkPermission
201+
*/
196202
private void appendFields(final Class<?> clazz) {
197203
for (final Field field : FieldUtils.getAllFields(clazz)) {
198204
if (accept(field)) {
@@ -207,6 +213,12 @@ private void appendFields(final Class<?> clazz) {
207213
}
208214
}
209215

216+
/**
217+
* {@inheritDoc}
218+
*
219+
* @throws SecurityException if an underlying accessible object's method denies the request.
220+
* @see SecurityManager#checkPermission
221+
*/
210222
@Override
211223
public DiffResult<T> build() {
212224
if (getLeft().equals(getRight())) {
@@ -234,6 +246,21 @@ private T getRight() {
234246
return diffBuilder.getRight();
235247
}
236248

249+
/**
250+
* Reads a {@link Field}, forcing access if needed.
251+
*
252+
* @param field
253+
* the field to use
254+
* @param target
255+
* the object to call on, may be {@code null} for {@code static} fields
256+
* @return the field value
257+
* @throws NullPointerException
258+
* if the field is {@code null}
259+
* @throws IllegalAccessException
260+
* if the field is not made accessible
261+
* @throws SecurityException if an underlying accessible object's method denies the request.
262+
* @see SecurityManager#checkPermission
263+
*/
237264
private Object readField(final Field field, final Object target) throws IllegalAccessException {
238265
return FieldUtils.readField(field, target, true);
239266
}

src/main/java/org/apache/commons/lang3/event/EventUtils.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ private boolean hasMatchingParametersMethod(final Method method) {
6868
* @param method the method to be invoked
6969
* @param parameters the parameters for the method invocation
7070
* @return the result of the method call
71+
* @throws SecurityException if an underlying accessible object's method denies the request.
72+
* @see SecurityManager#checkPermission
7173
* @throws Throwable if an error occurs
7274
*/
7375
@Override

src/main/java/org/apache/commons/lang3/reflect/ConstructorUtils.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ public static <T> Constructor<T> getAccessibleConstructor(final Constructor<T> c
103103
* @param parameterTypes find method with compatible parameters
104104
* @return the constructor, null if no matching accessible constructor found
105105
* @throws NullPointerException if {@code cls} is {@code null}
106+
* @throws SecurityException if an underlying accessible object's method denies the request.
107+
* @see SecurityManager#checkPermission
106108
*/
107109
public static <T> Constructor<T> getMatchingAccessibleConstructor(final Class<T> cls,
108110
final Class<?>... parameterTypes) {
@@ -157,6 +159,8 @@ public static <T> Constructor<T> getMatchingAccessibleConstructor(final Class<T>
157159
* @throws IllegalAccessException if invocation is not permitted by security
158160
* @throws InvocationTargetException if an error occurs on invocation
159161
* @throws InstantiationException if an error occurs on instantiation
162+
* @throws SecurityException if an underlying accessible object's method denies the request.
163+
* @see SecurityManager#checkPermission
160164
* @see #invokeConstructor(Class, Object[], Class[])
161165
*/
162166
public static <T> T invokeConstructor(final Class<T> cls, Object... args)
@@ -183,6 +187,8 @@ public static <T> T invokeConstructor(final Class<T> cls, Object... args)
183187
* @throws IllegalAccessException if invocation is not permitted by security
184188
* @throws InvocationTargetException if an error occurs on invocation
185189
* @throws InstantiationException if an error occurs on instantiation
190+
* @throws SecurityException if an underlying accessible object's method denies the request.
191+
* @see SecurityManager#checkPermission
186192
* @see Constructor#newInstance
187193
*/
188194
public static <T> T invokeConstructor(final Class<T> cls, Object[] args, Class<?>[] parameterTypes)

0 commit comments

Comments
 (0)