diff --git a/base/src/main/java/de/staropensource/sosengine/base/exceptions/reflection/IncompatibleTypeReflection.java b/base/src/main/java/de/staropensource/sosengine/base/exceptions/reflection/IncompatibleTypeException.java similarity index 88% rename from base/src/main/java/de/staropensource/sosengine/base/exceptions/reflection/IncompatibleTypeReflection.java rename to base/src/main/java/de/staropensource/sosengine/base/exceptions/reflection/IncompatibleTypeException.java index 52e18408..06cb7752 100644 --- a/base/src/main/java/de/staropensource/sosengine/base/exceptions/reflection/IncompatibleTypeReflection.java +++ b/base/src/main/java/de/staropensource/sosengine/base/exceptions/reflection/IncompatibleTypeException.java @@ -29,7 +29,7 @@ import org.jetbrains.annotations.NotNull; * @since v1-alpha2 */ @SuppressWarnings({ "unused" }) -public class IncompatibleTypeReflection extends RuntimeException { +public class IncompatibleTypeException extends RuntimeException { /** * Constructs this exception. * @@ -37,7 +37,7 @@ public class IncompatibleTypeReflection extends RuntimeException { * @param requiredClassType class type received by the method * @param compatibleTypes class types the method is compatible with */ - public IncompatibleTypeReflection(@NotNull String methodName, @NotNull ClassType requiredClassType, @NotNull ClassType[] compatibleTypes) { + public IncompatibleTypeException(@NotNull String methodName, @NotNull ClassType requiredClassType, @NotNull ClassType[] compatibleTypes) { super("The method ReflectionClass#" + methodName + " only applies to type(s) " + ListFormatter.formatArray(compatibleTypes) + ", not " + requiredClassType.name()); } } diff --git a/base/src/main/java/de/staropensource/sosengine/base/reflection/ReflectionClass.java b/base/src/main/java/de/staropensource/sosengine/base/reflection/ReflectionClass.java index e23268c9..6490155d 100644 --- a/base/src/main/java/de/staropensource/sosengine/base/reflection/ReflectionClass.java +++ b/base/src/main/java/de/staropensource/sosengine/base/reflection/ReflectionClass.java @@ -20,7 +20,7 @@ package de.staropensource.sosengine.base.reflection; import de.staropensource.sosengine.base.exceptions.UnexpectedCheckEndException; -import de.staropensource.sosengine.base.exceptions.reflection.IncompatibleTypeReflection; +import de.staropensource.sosengine.base.exceptions.reflection.IncompatibleTypeException; import de.staropensource.sosengine.base.exceptions.reflection.InvalidFieldException; import de.staropensource.sosengine.base.exceptions.reflection.InvalidMethodException; import de.staropensource.sosengine.base.types.reflection.ClassType; @@ -141,9 +141,9 @@ public final class ReflectionClass { * @return presence of the {@code final} modifier * @since v1-alpha2 */ - public boolean isFinal() throws IncompatibleTypeReflection { + public boolean isFinal() throws IncompatibleTypeException { if (getType() != ClassType.CLASS) - throw new IncompatibleTypeReflection("isFinal", getType(), new ClassType[]{ ClassType.CLASS }); + throw new IncompatibleTypeException("isFinal", getType(), new ClassType[]{ ClassType.CLASS }); return Modifier.isFinal(clazz.getModifiers()); } @@ -153,9 +153,9 @@ public final class ReflectionClass { * @return presence of the {@code abstract} modifier * @since v1-alpha2 */ - public boolean isAbstract() throws IncompatibleTypeReflection { + public boolean isAbstract() throws IncompatibleTypeException { if (getType() != ClassType.CLASS) - throw new IncompatibleTypeReflection("isAbstract", getType(), new ClassType[]{ClassType.CLASS}); + throw new IncompatibleTypeException("isAbstract", getType(), new ClassType[]{ClassType.CLASS}); return Modifier.isAbstract(clazz.getModifiers()); }