Compare commits
No commits in common. "db52346168dc44d0037c564e725538cdaf0148cf" and "ae8010a271e0603cfef898f95adf8dea1a5e64d7" have entirely different histories.
db52346168
...
ae8010a271
4 changed files with 2 additions and 20 deletions
|
@ -321,8 +321,6 @@ public final class Engine extends SubsystemClass {
|
|||
//noinspection DataFlowIssue // the crash call will prevent a NullPointerException
|
||||
subsystemsMutable.add(new DependencySubsystemVector(initializedClass.getDependencyVector(), initializedClass));
|
||||
} catch (Exception exception) {
|
||||
if (exception.getClass() == IllegalStateException.class && exception.getMessage().startsWith("The version string is invalid: "))
|
||||
logger.crash("Failed to initialize subsystem " + clazz.getName() + ": Invalid version string: " + exception.getMessage().replace("The version string is invalid: ", ""));
|
||||
logger.crash("Failed to initialize subsystem " + clazz.getName() + ": Method invocation error", exception);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,7 +22,6 @@ package de.staropensource.sosengine.base.classes;
|
|||
import de.staropensource.sosengine.base.Engine;
|
||||
import de.staropensource.sosengine.base.annotations.EngineSubsystem;
|
||||
import de.staropensource.sosengine.base.annotations.EventListener;
|
||||
import de.staropensource.sosengine.base.exceptions.versioning.InvalidVersionStringException;
|
||||
import de.staropensource.sosengine.base.internal.events.InternalEngineShutdownEvent;
|
||||
import de.staropensource.sosengine.base.logging.LoggerInstance;
|
||||
import de.staropensource.sosengine.base.types.DependencyVector;
|
||||
|
@ -74,7 +73,7 @@ public abstract class SubsystemClass {
|
|||
* @see DependencyVector
|
||||
* @since v1-alpha1
|
||||
*/
|
||||
public abstract @NotNull DependencyVector getDependencyVector() throws InvalidVersionStringException;
|
||||
public abstract @NotNull DependencyVector getDependencyVector();
|
||||
|
||||
/**
|
||||
* Called on engine shutdown.
|
||||
|
|
|
@ -34,7 +34,6 @@ import java.text.SimpleDateFormat;
|
|||
import java.time.ZonedDateTime;
|
||||
import java.util.Date;
|
||||
import java.util.GregorianCalendar;
|
||||
import java.util.Locale;
|
||||
import java.util.Properties;
|
||||
|
||||
/**
|
||||
|
@ -380,7 +379,7 @@ public final class EngineInformation {
|
|||
versioningType = VersionType.valueOf(gradleParser.getString("versioningType").toUpperCase());
|
||||
versioningTyperelease = gradleParser.getInteger("versioningTyperelease", true);
|
||||
versioningFork = gradleParser.getString("versioningFork");
|
||||
versioningString = "v" + versioningVersion + "-" + (versioningType == VersionType.RELEASE_CANDIDATE ? "releasecandidate" : versioningType.name().toLowerCase(Locale.ROOT)) + versioningTyperelease + versioningFork;
|
||||
versioningString = "v" + versioningVersion + "-" + (versioningType == VersionType.RELEASE_CANDIDATE ? "releasecandidate" : versioningType.name()) + versioningTyperelease + versioningFork;
|
||||
|
||||
dependencyJansi = gradleParser.getString("dependencyJansi");
|
||||
dependencyReflections = gradleParser.getString("dependencyReflections");
|
||||
|
|
|
@ -20,13 +20,11 @@
|
|||
package de.staropensource.sosengine.base.types;
|
||||
|
||||
import de.staropensource.sosengine.base.classes.VersioningSystem;
|
||||
import de.staropensource.sosengine.base.exceptions.versioning.InvalidVersionStringException;
|
||||
import de.staropensource.sosengine.base.utility.DependencyResolver;
|
||||
import lombok.Getter;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
|
@ -200,18 +198,6 @@ public class DependencyVector {
|
|||
throw new IllegalStateException("The versioning system is unset");
|
||||
if (version == null || version.isBlank())
|
||||
throw new IllegalStateException("The version is unset");
|
||||
|
||||
// Check if version string is valid
|
||||
try {
|
||||
versioningSystem.getDeclaredConstructor(String.class).newInstance(version);
|
||||
} catch (InvocationTargetException exception) {
|
||||
if (exception.getTargetException().getClass() == InvalidVersionStringException.class)
|
||||
throw new IllegalStateException("The version string is invalid: " + exception.getTargetException().getMessage());
|
||||
else
|
||||
throw new IllegalStateException("Version string validation failed: Constructor threw " + exception.getTargetException().getClass().getName() + ": " + exception.getTargetException().getMessage());
|
||||
} catch (Exception exception) {
|
||||
throw new IllegalStateException("Version string validation failed: Threw " + exception.getClass().getName() + ": " + exception.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue