Rename exception IncompatibleTypeReflection

was i drunk?
This commit is contained in:
JeremyStar™ 2024-07-20 18:22:48 +02:00
parent 85e6cd69de
commit 9f638c486c
Signed by: JeremyStarTM
GPG key ID: E366BAEF67E4704D
2 changed files with 7 additions and 7 deletions

View file

@ -29,7 +29,7 @@ import org.jetbrains.annotations.NotNull;
* @since v1-alpha2 * @since v1-alpha2
*/ */
@SuppressWarnings({ "unused" }) @SuppressWarnings({ "unused" })
public class IncompatibleTypeReflection extends RuntimeException { public class IncompatibleTypeException extends RuntimeException {
/** /**
* Constructs this exception. * Constructs this exception.
* *
@ -37,7 +37,7 @@ public class IncompatibleTypeReflection extends RuntimeException {
* @param requiredClassType class type received by the method * @param requiredClassType class type received by the method
* @param compatibleTypes class types the method is compatible with * @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()); super("The method ReflectionClass#" + methodName + " only applies to type(s) " + ListFormatter.formatArray(compatibleTypes) + ", not " + requiredClassType.name());
} }
} }

View file

@ -20,7 +20,7 @@
package de.staropensource.sosengine.base.reflection; package de.staropensource.sosengine.base.reflection;
import de.staropensource.sosengine.base.exceptions.UnexpectedCheckEndException; 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.InvalidFieldException;
import de.staropensource.sosengine.base.exceptions.reflection.InvalidMethodException; import de.staropensource.sosengine.base.exceptions.reflection.InvalidMethodException;
import de.staropensource.sosengine.base.types.reflection.ClassType; import de.staropensource.sosengine.base.types.reflection.ClassType;
@ -141,9 +141,9 @@ public final class ReflectionClass {
* @return presence of the {@code final} modifier * @return presence of the {@code final} modifier
* @since v1-alpha2 * @since v1-alpha2
*/ */
public boolean isFinal() throws IncompatibleTypeReflection { public boolean isFinal() throws IncompatibleTypeException {
if (getType() != ClassType.CLASS) 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()); return Modifier.isFinal(clazz.getModifiers());
} }
@ -153,9 +153,9 @@ public final class ReflectionClass {
* @return presence of the {@code abstract} modifier * @return presence of the {@code abstract} modifier
* @since v1-alpha2 * @since v1-alpha2
*/ */
public boolean isAbstract() throws IncompatibleTypeReflection { public boolean isAbstract() throws IncompatibleTypeException {
if (getType() != ClassType.CLASS) 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()); return Modifier.isAbstract(clazz.getModifiers());
} }