diff --git a/flow-plugins/flow-maven-plugin/src/main/java/com/vaadin/flow/plugin/maven/Fragment.java b/flow-plugins/flow-maven-plugin/src/main/java/com/vaadin/flow/plugin/maven/Fragment.java index 3fcce08b2cb..9a939d1e576 100644 --- a/flow-plugins/flow-maven-plugin/src/main/java/com/vaadin/flow/plugin/maven/Fragment.java +++ b/flow-plugins/flow-maven-plugin/src/main/java/com/vaadin/flow/plugin/maven/Fragment.java @@ -23,7 +23,9 @@ * * @author Vaadin Ltd * @since 1.0. + * @deprecated Unused. Will be removed without replacement */ +@Deprecated(forRemoval = true) public class Fragment { protected String name; protected final Set files = new HashSet<>(); diff --git a/flow-server/src/main/java/com/vaadin/flow/internal/ReflectTools.java b/flow-server/src/main/java/com/vaadin/flow/internal/ReflectTools.java index e49c0368a1c..736f659fabe 100644 --- a/flow-server/src/main/java/com/vaadin/flow/internal/ReflectTools.java +++ b/flow-server/src/main/java/com/vaadin/flow/internal/ReflectTools.java @@ -68,6 +68,33 @@ public class ReflectTools implements Serializable { private static final Predicate IS_SYNTHETIC = Method::isSynthetic; + /** + * Locates the method in the given class. Returns null if the method is not + * found. Throws an ExceptionInInitializerError if there is a problem + * locating the method as this is mainly called from static blocks. + * + * @param cls + * Class that contains the method + * @param methodName + * The name of the method + * @param parameterTypes + * The parameter types for the method. + * @return A reference to the method + * @throws ExceptionInInitializerError + * Wraps any exception in an {@link ExceptionInInitializerError} + * so this method can be called from a static initializer. + * @deprecated Unused. Will be removed without replacement. + */ + @Deprecated(forRemoval = true) + public static Method findMethod(Class cls, String methodName, + Class... parameterTypes) throws ExceptionInInitializerError { + try { + return cls.getDeclaredMethod(methodName, parameterTypes); + } catch (Exception e) { + throw new ExceptionInInitializerError(e); + } + } + /** * Returns the value of the java field. *