Fixed CHANGELOG retrieving

This commit is contained in:
Luca Frosini 2020-12-14 09:21:14 +01:00
parent 619dd586c1
commit 745bb9eb3e
2 changed files with 3 additions and 2 deletions

View File

@ -48,7 +48,7 @@ public class TypeImpl implements Type {
static {
DEFAULT_CHANGELOG_MAP = new HashMap<>();
DEFAULT_CHANGELOG_MAP.put(new TypeVersion("1.0.0"), "First Version");
DEFAULT_CHANGELOG_MAP.put(new TypeVersion(TypeVersion.MINIMAL_VERSION_STRING), "First Version");
}
protected Header header;
@ -154,7 +154,6 @@ public class TypeImpl implements Type {
this.version = new TypeVersion(versionString);
this.changelog = TypeMapper.getStaticFieldByName(clz, CHANGELOG, DEFAULT_CHANGELOG_MAP);
if(!changelog.containsKey(version)) {
throw new RuntimeException("The Type " + name + " does not provided the appropriated changelog Map");
}

View File

@ -14,6 +14,8 @@ public class TypeVersion implements Comparable<TypeVersion> {
public static final String MINIMAL_VERSION_STRING = "1.0.0";
public static final TypeVersion MINIMAL_VERSION;
public static final String MINIMAL_VERSION_DESCRIPTION = "First Version";
static {
TYPE_VERSION_PATTERN = Pattern.compile(TYPE_VERSION_REGEX);
MINIMAL_VERSION = new TypeVersion(MINIMAL_VERSION_STRING);