Skip to content

Commit af2431d

Browse files
committed
Clarify where getTrueSet() can't be called
1 parent dd2e6b5 commit af2431d

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

UnicodeJsps/src/main/java/org/unicode/jsp/UnicodeProperty.java

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public abstract class UnicodeProperty extends UnicodeLabel {
6969
.add(SAMPLE_PRIVATE_USE_AREA_A)
7070
.add(SAMPLE_PRIVATE_USE_AREA_B)
7171
.freeze();
72-
72+
7373
public static final UnicodeSet STUFF_TO_TEST_WITH_UNASSIGNED = new UnicodeSet(STUFF_TO_TEST).addAll(UNASSIGNED).freeze();
7474

7575
public static boolean DEBUG = false;
@@ -90,7 +90,7 @@ public abstract class UnicodeProperty extends UnicodeLabel {
9090

9191
/*
9292
* Name: Unicode_1_Name Name: ISO_Comment Name: Name Name: Unicode_1_Name
93-
*
93+
*
9494
*/
9595

9696
public static final int UNKNOWN = 0, BINARY = 2, EXTENDED_BINARY = 3,
@@ -268,10 +268,11 @@ public int getMaxWidth(boolean getShortest) {
268268
return maxFirstValueAliasWidth;
269269
return maxValueWidth;
270270
}
271-
271+
272272
public final UnicodeSet getTrueSet() {
273273
if (!isType(BINARY)) {
274-
throw new IllegalArgumentException("Only applicable to binary (boolean) properties");
274+
throw new IllegalArgumentException("Only applicable to binary (boolean) properties, not " + getName() +
275+
" which is of type " + getTypeName());
275276
}
276277
return getSet("Yes", null);
277278
}
@@ -331,7 +332,7 @@ public UnicodeSet getSet(PatternMatcher matcher, UnicodeSet result) {
331332
/*
332333
* public UnicodeSet getMatchSet(UnicodeSet result) { if (result == null)
333334
* result = new UnicodeSet(); addAll(matchIterator, result); return result; }
334-
*
335+
*
335336
* public void setMatchSet(UnicodeSet set) { matchIterator = new
336337
* UnicodeSetIterator(set); }
337338
*/
@@ -460,7 +461,7 @@ protected UnicodeMap _getUnicodeMap() {
460461
}
461462

462463
UnicodeSet sameValueRanges = null;
463-
464+
464465
private UnicodeSet getSameValueRanges(boolean uniformUnassigned) {
465466
if (sameValueRanges == null) {
466467
sameValueRanges = new UnicodeSet();
@@ -515,7 +516,7 @@ public int compare(Object o1, Object o2) {
515516

516517
/**
517518
* Utility for managing property & non-string value aliases
518-
*
519+
*
519520
*/
520521
// TODO optimize
521522
public static boolean equalNames(String a, String b) {
@@ -649,7 +650,7 @@ public static String regularize(String source, boolean titlecaseStart) {
649650
/**
650651
* Utility function for comparing codepoint to string without generating new
651652
* string.
652-
*
653+
*
653654
* @param codepoint
654655
* @param other
655656
* @return true if the codepoint equals the string
@@ -677,7 +678,7 @@ public static final <T extends Object> boolean equals(T a, T b) {
677678

678679
/**
679680
* Utility that should be on UnicodeSet
680-
*
681+
*
681682
* @param source
682683
* @param result
683684
*/
@@ -1147,7 +1148,7 @@ public static abstract class BaseProperty extends UnicodeProperty {
11471148
private static final String[] YES_VALUES = {"Yes", "Y", "T", "True"};
11481149

11491150
/**
1150-
*
1151+
*
11511152
*/
11521153
private static final String[][] YES_NO_ALIASES = new String[][] {YES_VALUES, NO_VALUES};
11531154

@@ -1351,7 +1352,7 @@ public UnicodeMapProperty set(UnicodeMap map) {
13511352
unicodeMap = map.freeze();
13521353
return this;
13531354
}
1354-
1355+
13551356
@Override
13561357
protected UnicodeMap _getUnicodeMap() {
13571358
return unicodeMap;
@@ -1407,7 +1408,7 @@ public static UnicodeSet addUntested(UnicodeSet result, boolean uniformUnassigne
14071408
if (uniformUnassigned && result.contains(UnicodeProperty.SAMPLE_UNASSIGNED)) {
14081409
result.addAll(UnicodeProperty.UNASSIGNED);
14091410
}
1410-
1411+
14111412
if (result.contains(UnicodeProperty.SAMPLE_HIGH_SURROGATE)) {
14121413
result.addAll(UnicodeProperty.HIGH_SURROGATES);
14131414
}
@@ -1417,7 +1418,7 @@ public static UnicodeSet addUntested(UnicodeSet result, boolean uniformUnassigne
14171418
if (result.contains(UnicodeProperty.SAMPLE_LOW_SURROGATE)) {
14181419
result.addAll(UnicodeProperty.LOW_SURROGATES);
14191420
}
1420-
1421+
14211422
if (result.contains(UnicodeProperty.SAMPLE_PRIVATE_USE_AREA)) {
14221423
result.addAll(UnicodeProperty.PRIVATE_USE_AREA);
14231424
}
@@ -1465,7 +1466,7 @@ public boolean isDefault(int cp) {
14651466
return equals(cp, value);
14661467
}
14671468
String defaultValue = getValue(SAMPLE_UNASSIGNED);
1468-
return defaultValue == null ? value == null : defaultValue.equals(value);
1469+
return defaultValue == null ? value == null : defaultValue.equals(value);
14691470
}
14701471

14711472
public boolean hasUniformUnassigned() {

0 commit comments

Comments
 (0)