From 51886fb008460fb113978b28f6939bc0f3916d68 Mon Sep 17 00:00:00 2001 From: Peter Dell Date: Tue, 27 Dec 2022 01:06:40 +0100 Subject: [PATCH] Make compiler IDs lower case --- com.wudsn.ide.lng.pas/plugin.xml | 2 +- .../src/com/wudsn/ide/lng/compiler/CompilerDefinition.java | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/com.wudsn.ide.lng.pas/plugin.xml b/com.wudsn.ide.lng.pas/plugin.xml index a5e49da0..8a5331ce 100644 --- a/com.wudsn.ide.lng.pas/plugin.xml +++ b/com.wudsn.ide.lng.pas/plugin.xml @@ -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"> diff --git a/com.wudsn.ide.lng/src/com/wudsn/ide/lng/compiler/CompilerDefinition.java b/com.wudsn.ide.lng/src/com/wudsn/ide/lng/compiler/CompilerDefinition.java index 2df74077..796e968c 100644 --- a/com.wudsn.ide.lng/src/com/wudsn/ide/lng/compiler/CompilerDefinition.java +++ b/com.wudsn.ide.lng/src/com/wudsn/ide/lng/compiler/CompilerDefinition.java @@ -164,7 +164,7 @@ public final class CompilerDefinition implements Comparable /** * Sets the id of the compiler. Called by {@link CompilerRegistry} only. * - * @param id The id of the compiler, not empty and not null. + * @param id The id of the compiler, lower case, not empty and not null. */ final void setId(String id) { if (id == null) { @@ -173,13 +173,16 @@ public final class CompilerDefinition implements Comparable 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 null. + * @return The id of the compiler, lower case, not empty and not null. */ public final String getId() { if (id == null) {