Skip to content

Commit cda6e82

Browse files
committed
Ensure all property values are trimmed
- Trim values of 'name' property and compact CTM 'ctm.*' properties - Always log warning when unknown 'connect' value is provided
1 parent 47d3385 commit cda6e82

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

src/main/java/me/pepperbell/continuity/client/properties/BaseCtmProperties.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -517,6 +517,8 @@ protected void parseName() {
517517
return;
518518
}
519519

520+
nameStr = nameStr.trim();
521+
520522
boolean isPattern;
521523
boolean caseInsensitive;
522524
if (nameStr.startsWith("regex:")) {

src/main/java/me/pepperbell/continuity/client/properties/BasicConnectingCtmProperties.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ protected void parseConnect() {
3939
try {
4040
connectionPredicate = ConnectionType.valueOf(connectStr.trim().toUpperCase(Locale.ROOT));
4141
} catch (IllegalArgumentException e) {
42-
//
42+
ContinuityClient.LOGGER.warn("Unknown 'connect' value '" + connectStr + "' in file '" + resourceId + "' in pack '" + packId + "'");
4343
}
4444
}
4545

src/main/java/me/pepperbell/continuity/client/properties/CompactConnectingCtmProperties.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ protected void parseTileReplacements() {
4747
String valueStr = properties.getProperty(key);
4848
int value;
4949
try {
50-
value = Integer.parseInt(valueStr);
50+
value = Integer.parseInt(valueStr.trim());
5151
} catch (NumberFormatException e) {
5252
ContinuityClient.LOGGER.warn("Invalid '" + key + "' value '" + valueStr + "' in file '" + resourceId + "' in pack '" + packId + "'");
5353
continue;

0 commit comments

Comments
 (0)