Make compiler IDs lower case

This commit is contained in:
Peter Dell 2022-12-27 01:06:40 +01:00
parent f5613d6971
commit 51886fb008
2 changed files with 6 additions and 3 deletions

View File

@ -113,7 +113,7 @@
defaultHardware="ATARI8BIT"
defaultParameters="${sourceFilePath} "
homePageURL="https://github.com/tebe6502/Mad-Pascal/releases"
id="MP"
id="mp"
language="PAS"
name="%com.wudsn.ide.lng.pas.compiler.mp.MadPascalCompiler.name"
version="1.6.5">

View File

@ -164,7 +164,7 @@ public final class CompilerDefinition implements Comparable<CompilerDefinition>
/**
* Sets the id of the compiler. Called by {@link CompilerRegistry} only.
*
* @param id The id of the compiler, not empty and not <code>null</code>.
* @param id The id of the compiler, lower case, not empty and not <code>null</code>.
*/
final void setId(String id) {
if (id == null) {
@ -173,13 +173,16 @@ public final class CompilerDefinition implements Comparable<CompilerDefinition>
if (StringUtility.isEmpty(id)) {
throw new IllegalArgumentException("Parameter 'id' must not be empty.");
}
if (id.equals(id.toLowerCase())) {
throw new IllegalArgumentException("Parameter 'id' must not be lower case.");
}
this.id = id;
}
/**
* Gets the id of the compiler.
*
* @return The id of the compiler, not empty and not <code>null</code>.
* @return The id of the compiler, lower case, not empty and not <code>null</code>.
*/
public final String getId() {
if (id == null) {