|
1 | 1 | /*
|
2 |
| - * Copyright 2002-2018 the original author or authors. |
| 2 | + * Copyright 2002-2019 the original author or authors. |
3 | 3 | *
|
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
5 | 5 | * you may not use this file except in compliance with the License.
|
|
22 | 22 | import java.lang.reflect.Method;
|
23 | 23 | import java.lang.reflect.Modifier;
|
24 | 24 | import java.lang.reflect.UndeclaredThrowableException;
|
25 |
| -import java.sql.SQLException; |
26 | 25 | import java.util.ArrayList;
|
27 | 26 | import java.util.Arrays;
|
28 | 27 | import java.util.List;
|
|
46 | 45 | */
|
47 | 46 | public abstract class ReflectionUtils {
|
48 | 47 |
|
49 |
| - /** |
50 |
| - * Pre-built MethodFilter that matches all non-bridge methods. |
51 |
| - * @since 3.0 |
52 |
| - * @deprecated as of 5.0.11, in favor of a custom {@link MethodFilter} |
53 |
| - */ |
54 |
| - @Deprecated |
55 |
| - public static final MethodFilter NON_BRIDGED_METHODS = |
56 |
| - (method -> !method.isBridge()); |
57 |
| - |
58 | 48 | /**
|
59 | 49 | * Pre-built MethodFilter that matches all non-bridge non-synthetic methods
|
60 | 50 | * which are not declared on {@code java.lang.Object}.
|
@@ -251,52 +241,6 @@ public static Object invokeMethod(Method method, @Nullable Object target, @Nulla
|
251 | 241 | throw new IllegalStateException("Should never get here");
|
252 | 242 | }
|
253 | 243 |
|
254 |
| - /** |
255 |
| - * Invoke the specified JDBC API {@link Method} against the supplied target |
256 |
| - * object with no arguments. |
257 |
| - * @param method the method to invoke |
258 |
| - * @param target the target object to invoke the method on |
259 |
| - * @return the invocation result, if any |
260 |
| - * @throws SQLException the JDBC API SQLException to rethrow (if any) |
261 |
| - * @see #invokeJdbcMethod(java.lang.reflect.Method, Object, Object[]) |
262 |
| - * @deprecated as of 5.0.11, in favor of custom SQLException handling |
263 |
| - */ |
264 |
| - @Deprecated |
265 |
| - @Nullable |
266 |
| - public static Object invokeJdbcMethod(Method method, @Nullable Object target) throws SQLException { |
267 |
| - return invokeJdbcMethod(method, target, new Object[0]); |
268 |
| - } |
269 |
| - |
270 |
| - /** |
271 |
| - * Invoke the specified JDBC API {@link Method} against the supplied target |
272 |
| - * object with the supplied arguments. |
273 |
| - * @param method the method to invoke |
274 |
| - * @param target the target object to invoke the method on |
275 |
| - * @param args the invocation arguments (may be {@code null}) |
276 |
| - * @return the invocation result, if any |
277 |
| - * @throws SQLException the JDBC API SQLException to rethrow (if any) |
278 |
| - * @see #invokeMethod(java.lang.reflect.Method, Object, Object[]) |
279 |
| - * @deprecated as of 5.0.11, in favor of custom SQLException handling |
280 |
| - */ |
281 |
| - @Deprecated |
282 |
| - @Nullable |
283 |
| - public static Object invokeJdbcMethod(Method method, @Nullable Object target, @Nullable Object... args) |
284 |
| - throws SQLException { |
285 |
| - try { |
286 |
| - return method.invoke(target, args); |
287 |
| - } |
288 |
| - catch (IllegalAccessException ex) { |
289 |
| - handleReflectionException(ex); |
290 |
| - } |
291 |
| - catch (InvocationTargetException ex) { |
292 |
| - if (ex.getTargetException() instanceof SQLException) { |
293 |
| - throw (SQLException) ex.getTargetException(); |
294 |
| - } |
295 |
| - handleInvocationTargetException(ex); |
296 |
| - } |
297 |
| - throw new IllegalStateException("Should never get here"); |
298 |
| - } |
299 |
| - |
300 | 244 | /**
|
301 | 245 | * Handle the given reflection exception. Should only be called if no
|
302 | 246 | * checked exception is expected to be thrown by the target method.
|
|
0 commit comments