Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
*/
package org.mapstruct.ap.internal.util;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import javax.lang.model.element.ExecutableElement;
import javax.lang.model.element.Modifier;

Expand All @@ -21,19 +19,6 @@
*/
public class Executables {

private static final Method DEFAULT_METHOD;

static {
Method method;
try {
method = ExecutableElement.class.getMethod( "isDefault" );
}
catch ( NoSuchMethodException e ) {
method = null;
}
DEFAULT_METHOD = method;
}

private Executables() {
}

Expand All @@ -54,12 +39,7 @@ public static boolean isFinal(Accessor accessor) {
}

public static boolean isDefaultMethod(ExecutableElement method) {
try {
return DEFAULT_METHOD != null && Boolean.TRUE.equals( DEFAULT_METHOD.invoke( method ) );
}
catch ( IllegalAccessException | InvocationTargetException e ) {
return false;
}
return method.isDefault();
}

/**
Expand Down
Loading