Rename fix InvalidMethodSignatureException naming

This commit is contained in:
JeremyStar™ 2024-09-20 18:35:59 +02:00
parent c473c27298
commit c14e34cd81
Signed by: JeremyStarTM
GPG key ID: E366BAEF67E4704D
3 changed files with 8 additions and 8 deletions

View file

@ -26,13 +26,13 @@ import org.jetbrains.annotations.NotNull;
*
* @since v1-alpha2
*/
public class InvalidMethodSignature extends Exception {
public class InvalidMethodSignatureException extends Exception {
/**
* Constructs this exception.
*
* @param methodName method name
*/
public InvalidMethodSignature(@NotNull String methodName) {
public InvalidMethodSignatureException(@NotNull String methodName) {
super("Method " + methodName + " has a different method signature");
}
}

View file

@ -23,7 +23,7 @@ import de.staropensource.sosengine.base.EngineConfiguration;
import de.staropensource.sosengine.base.annotation.EventListener;
import de.staropensource.sosengine.base.event.LogEvent;
import de.staropensource.sosengine.base.exception.reflection.InstanceMethodFromStaticContextException;
import de.staropensource.sosengine.base.exception.reflection.InvalidMethodSignature;
import de.staropensource.sosengine.base.exception.reflection.InvalidMethodSignatureException;
import de.staropensource.sosengine.base.exception.reflection.NoAccessException;
import de.staropensource.sosengine.base.exception.reflection.StaticInitializerException;
import de.staropensource.sosengine.base.implementable.Event;
@ -145,7 +145,7 @@ public final class EventHelper {
method.invoke(arguments);
} catch (NoAccessException exception) {
logger.warn("Event listener method " + method.getName() + " could not be called as the method could not be accessed");
} catch (InvalidMethodSignature exception) {
} catch (InvalidMethodSignatureException exception) {
logger.warn("Event listener method " + method.getName() + " has an invalid method signature");
} catch (InvocationTargetException exception) {
logger.crash("Event listener method " + method.getName() + " threw a throwable", exception.getTargetException(), true);

View file

@ -21,7 +21,7 @@ package de.staropensource.sosengine.base.reflection;
import de.staropensource.sosengine.base.exception.UnexpectedCheckEndException;
import de.staropensource.sosengine.base.exception.reflection.InstanceMethodFromStaticContextException;
import de.staropensource.sosengine.base.exception.reflection.InvalidMethodSignature;
import de.staropensource.sosengine.base.exception.reflection.InvalidMethodSignatureException;
import de.staropensource.sosengine.base.exception.reflection.NoAccessException;
import de.staropensource.sosengine.base.exception.reflection.StaticInitializerException;
import de.staropensource.sosengine.base.internal.reflection.ReflectionAccessWidener;
@ -347,13 +347,13 @@ public final class ReflectionMethod {
* @param args arguments to pass
* @return method return value
* @throws NoAccessException if access to the method has been denied
* @throws InvalidMethodSignature if the method signature is incorrect
* @throws InvalidMethodSignatureException if the method signature is incorrect
* @throws InvocationTargetException covers exceptions thrown by the method
* @throws InstanceMethodFromStaticContextException when the target method is non-static and called from a static context
* @throws StaticInitializerException when an the static initializer fails
* @since v1-alpha2
*/
public @Nullable Object invoke(Object... args) throws NoAccessException, InvalidMethodSignature, InvocationTargetException, InstanceMethodFromStaticContextException, StaticInitializerException {
public @Nullable Object invoke(Object... args) throws NoAccessException, InvalidMethodSignatureException, InvocationTargetException, InstanceMethodFromStaticContextException, StaticInitializerException {
Object returnValue;
// Allow access to method
@ -365,7 +365,7 @@ public final class ReflectionMethod {
} catch (IllegalAccessException exception) {
throw new NoAccessException("method", getName());
} catch (IllegalArgumentException exception) {
throw new InvalidMethodSignature(getName());
throw new InvalidMethodSignatureException(getName());
} catch (NullPointerException exception) {
throw new InstanceMethodFromStaticContextException(getName());
} catch (ExceptionInInitializerError exception) {