Skip to content

Commit

Permalink
DynFields, DynMethods code cleanup (#10543)
Browse files Browse the repository at this point in the history
* Remove unused throws declaration

Avoid a warning in an IDE.

* Mark final fields as such

* Prepare for removal unused DynFields, DynMethods methods
  • Loading branch information
findepi committed Jul 17, 2024
1 parent 206e471 commit 5a562bb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions common/src/main/java/org/apache/iceberg/common/DynFields.java
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,9 @@ public <T> BoundField<T> build(Object target) {
* @return a {@link StaticField} with a valid implementation
* @throws IllegalStateException if the method is not static
* @throws NoSuchFieldException if no implementation was found
* @deprecated since 1.7.0, will be removed in 2.0.0
*/
@Deprecated
public <T> StaticField<T> buildStaticChecked() throws NoSuchFieldException {
return this.<T>buildChecked().asStatic();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ public static class UnboundMethod {
(method == null || method.isVarArgs()) ? -1 : method.getParameterTypes().length;
}

/** @deprecated since 1.7.0, will be removed in 2.0.0 */
@Deprecated // will become private
@SuppressWarnings("unchecked")
public <R> R invokeChecked(Object target, Object... args) throws Exception {
try {
Expand Down Expand Up @@ -126,7 +128,7 @@ public String toString() {
private static final UnboundMethod NOOP =
new UnboundMethod(null, "NOOP") {
@Override
public <R> R invokeChecked(Object target, Object... args) throws Exception {
public <R> R invokeChecked(Object target, Object... args) {
return null;
}

Expand Down Expand Up @@ -313,6 +315,8 @@ public Builder impl(Class<?> targetClass, Class<?>... argClasses) {
return this;
}

/** @deprecated since 1.7.0, will be removed in 2.0.0 */
@Deprecated
public Builder ctorImpl(Class<?> targetClass, Class<?>... argClasses) {
// don't do any work if an implementation has been found
if (method != null) {
Expand All @@ -327,6 +331,8 @@ public Builder ctorImpl(Class<?> targetClass, Class<?>... argClasses) {
return this;
}

/** @deprecated since 1.7.0, will be removed in 2.0.0 */
@Deprecated
public Builder ctorImpl(String className, Class<?>... argClasses) {
// don't do any work if an implementation has been found
if (method != null) {
Expand Down

0 comments on commit 5a562bb

Please sign in to comment.