@@ -809,26 +809,21 @@ public static String toString(String sortKey, int level) {
809809 return result .toString ();
810810 }
811811
812- static final int variableBottom = UCA .getPrimary (CE_FFFE ) + 1 ;
813-
814- /*
815- * Produces a human-readable string for a sort key.
816- * removed after unicodetools svn r641
812+ /**
813+ * Start of variable primaries. Primary weight one higher than that for the special U+FFFE.
814+ * https://www.unicode.org/reports/tr35/tr35-collation.html#tailored_noncharacter_weights
817815 */
818- // static public String toStringUCA(String sortKey, String original, int variableTop,
819- // StringBuilder extraComment)
816+ private static final int variableBottom = UCA .getPrimary (CE_FFFE ) + 1 ;
820817
821- public static boolean isVariablePrimary (
822- char primary , int variableTop , boolean lastWasVariable ) {
823- return primary == 0 ? lastWasVariable : primary <= variableTop && variableBottom <= primary ;
818+ private boolean isVariablePrimary (char primary ) {
819+ return variableBottom <= primary && primary <= ucaData .variableHigh ;
824820 }
825821
826- public static String toStringUCA (CEList ceList , int variableTop , StringBuilder extraComment ) {
822+ public String toStringUCA (CEList ceList , StringBuilder extraComment ) {
827823 if (ceList == null || ceList .isEmpty ()) {
828824 return "[.0000.0000.0000]" ;
829825 }
830826 extraComment .setLength (0 );
831- boolean lastWasVariable = false ;
832827 final StringBuffer result = new StringBuffer ();
833828
834829 for (int i = 0 ; i < ceList .length (); ++i ) {
@@ -837,12 +832,8 @@ public static String toStringUCA(CEList ceList, int variableTop, StringBuilder e
837832 final char s = UCA .getSecondary (ce );
838833 final char t = UCA .getTertiary (ce );
839834
840- final boolean isVariable = isVariablePrimary (p , variableTop , lastWasVariable );
841-
842- lastWasVariable = isVariable ;
843-
844835 result .append ("[" )
845- .append (isVariable ? "*" : "." )
836+ .append (isVariablePrimary ( p ) ? "*" : "." )
846837 .append (Utility .hex (p ))
847838 .append ("." )
848839 .append (Utility .hex (s ))
@@ -904,7 +895,7 @@ public static boolean isImplicitLeadCE(int ce) {
904895 * from the UCA data, they are narrowed in. The first three values are used in building; the
905896 * last two in testing.
906897 */
907- private int variableLowCE ; // used for testing against
898+ private static final int variableLowCE = makeKey ( 1 , 0 , 0 ) ; // used for testing against
908899
909900 private int variableHighCE ; // used for testing against
910901
@@ -1452,8 +1443,6 @@ private void cleanup() {
14521443 }
14531444 */
14541445
1455- // fixlater;
1456- variableLowCE = makeKey (1 , 0 , 0 );
14571446 variableHighCE =
14581447 makeKey (
14591448 ucaData .variableHigh ,
0 commit comments