2222import java .util .Set ;
2323import java .util .regex .Matcher ;
2424import org .unicode .cldr .draft .FileUtilities ;
25- import org .unicode .cldr .tool .ToolConstants .ChartStatus ;
2625import org .unicode .cldr .util .CLDRConfig ;
2726import org .unicode .cldr .util .CLDRPaths ;
2827import org .unicode .cldr .util .CldrUtility ;
@@ -139,21 +138,22 @@ public void writeContents(FormattedFileWriter pw) throws IOException {
139138 .addColumn ("Attributes" , "class='target'" , null , "class='target'" , true )
140139 .setSpanRows (false );
141140
142- String last = null ;
141+ CldrVersion last = null ;
143142
144- for (String current :
145- ToolConstants .CHART_STATUS != ChartStatus . release
146- ? ToolConstants . CLDR_RELEASE_AND_DEV_VERSION_SET
147- : ToolConstants . CLDR_RELEASE_VERSION_SET ) {
143+ for (CldrVersion current : CldrVersion . CLDR_VERSIONS_ASCENDING ) {
144+ if ( current . compareTo ( CldrVersion . from ( ToolConstants .CHART_VERSION )) > 0 ) {
145+ continue ;
146+ }
148147 System .out .println ("DTD delta: " + current );
149- final boolean finalVersion = current .equals (ToolConstants .DEV_VERSION );
150- String currentName = finalVersion ? ToolConstants .CHART_DISPLAY_VERSION : current ;
148+ final boolean finalVersion =
149+ current .equals (CldrVersion .from (ToolConstants .DEV_VERSION ));
150+ String currentName =
151+ finalVersion ? ToolConstants .CHART_DISPLAY_VERSION : current .toString ();
151152 for (DtdType type : TYPES ) {
152153 String firstVersion = type .firstVersion ; // FIRST_VERSION.get(type);
153154 if (firstVersion != null
154155 && current != null
155- && VersionInfo .getInstance (current )
156- .compareTo (VersionInfo .getInstance (firstVersion ))
156+ && current .getVersionInfo ().compareTo (VersionInfo .getInstance (firstVersion ))
157157 < 0 ) {
158158 // skip if current is too old to have “type”
159159 continue ;
@@ -167,7 +167,7 @@ public void writeContents(FormattedFileWriter pw) throws IOException {
167167 // && ToolConstants.CHART_STATUS !=
168168 // ToolConstants.ChartStatus.release
169169 ? null
170- : current );
170+ : current . toString () );
171171 } catch (Exception e ) {
172172 if (!(e .getCause () instanceof FileNotFoundException )) {
173173 throw e ;
@@ -178,18 +178,15 @@ public void writeContents(FormattedFileWriter pw) throws IOException {
178178 DtdData dtdLast = null ;
179179 if (last != null
180180 && (firstVersion == null
181- || VersionInfo . getInstance ( last )
181+ || last . getVersionInfo ( )
182182 .compareTo (VersionInfo .getInstance (firstVersion ))
183183 >= 0 )) {
184184 // only read if last isn’t too old to have “type”
185- dtdLast = DtdData .getInstance (type , last );
185+ dtdLast = DtdData .getInstance (type , last . toString () );
186186 }
187187 diff (currentName , dtdLast , dtdCurrent );
188188 }
189189 last = current ;
190- if (current .contentEquals (ToolConstants .CHART_VERSION )) {
191- break ;
192- }
193190 }
194191
195192 for (DiffElement datum : data ) {
0 commit comments