[Unicode]   Common Locale Data Repository : Bug Tracking Home | Site Map | Search
 

Changeset 11502


Ignore:
Timestamp:
04/13/15 16:05:15 (4 years ago)
Author:
emmons
Message:

cldrbug 6480: Don't prevent data entry for errors that come about from cross checks, but make them show up as errors from the beginning.

Location:
trunk/tools/java/org/unicode/cldr/test
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/java/org/unicode/cldr/test/CheckCLDR.java

    r11358 r11502  
    1313import java.util.ArrayList; 
    1414import java.util.Arrays; 
     15import java.util.EnumSet; 
    1516import java.util.HashMap; 
    1617import java.util.Iterator; 
     
    310311                CheckStatus.Type type = item.getType(); 
    311312                if (type.equals(CheckStatus.Type.Error)) { 
    312                     if (item.getSubtype() != Subtype.dateSymbolCollision 
    313                         && item.getSubtype() != Subtype.displayCollision) { 
     313                    if (CheckStatus.crossCheckSubtypes.contains(item.getSubtype())) { 
     314                        return ValueStatus.WARNING; 
     315                    } else { 
    314316                        return ValueStatus.ERROR; 
    315                     } else { 
    316                         return ValueStatus.WARNING; 
    317317                    } 
    318318                } else if (type.equals(CheckStatus.Type.Warning)) { 
     
    717717     */ 
    718718    public static class CheckStatus { 
    719         public static final Type alertType = Type.Comment, 
     719        public static final Type 
     720            alertType = Type.Comment, 
    720721            warningType = Type.Warning, 
    721722            errorType = Type.Error, 
     723            fatalErrorType = Type.Error, 
    722724            exampleType = Type.Example, 
    723725            demoType = Type.Demo; 
     
    766768            static Pattern TO_STRING = Pattern.compile("([A-Z])"); 
    767769        }; 
     770  
     771        public static EnumSet<Subtype> crossCheckSubtypes =  
     772            EnumSet.of( 
     773                Subtype.dateSymbolCollision, 
     774                Subtype.displayCollision, 
     775                Subtype.inconsistentDraftStatus, 
     776                Subtype.incompleteLogicalGroup); 
     777 
    768778 
    769779        private Type type; 
  • trunk/tools/java/org/unicode/cldr/test/CheckDisplayCollisions.java

    r11358 r11502  
    201201 
    202202        Matcher matcher = null; 
    203         String message = getPhase() == Phase.SUBMISSION 
    204             ? "WARNING: Can't have same translation as {0}. This will become an error during the Vetting phase." 
    205             : "Can't have same translation as {0}"; 
     203        String message = "Can't have same translation as {0}"; 
    206204        Matcher currentAttributesToIgnore = attributesToIgnore; 
    207205        Set<String> paths; 
     
    352350        log("CollidingTypes has a size of " + collidingTypes.size()); 
    353351        CheckStatus.Type thisErrorType; 
    354         // Specifically allow display collisions during the submission phase only, so that 
    355         // we don't prevent people from entering stuff properly. 
    356352        // Also only do warnings during the build phase, so that SmokeTest will build. 
    357         if (getPhase() == Phase.SUBMISSION || getPhase() == Phase.BUILD) { 
     353        if (getPhase() == Phase.BUILD) { 
    358354            thisErrorType = CheckStatus.warningType; 
    359355        } else { 
  • trunk/tools/java/org/unicode/cldr/test/CheckLogicalGroupings.java

    r10980 r11502  
    4242        if (logicalGroupingIsEmpty) return this; // skip if the logical grouping is empty 
    4343        if (!getCldrFileToCheck().isHere(path)) { 
    44             CheckStatus.Type showError = CheckStatus.warningType; 
    45             if (this.getPhase() != null && !this.getPhase().equals(Phase.FINAL_TESTING)) { 
     44            CheckStatus.Type showError = CheckStatus.errorType; 
     45            if (this.getPhase().equals(Phase.BUILD)) { 
    4646                showError = CheckStatus.warningType; 
    47             } else { 
    48                 showError = CheckStatus.errorType; 
    4947            } 
    5048            result.add(new CheckStatus().setCause(this).setMainType(showError) 
     
    5654        // contains an error or warning.  See http://unicode.org/cldr/trac/ticket/4943. 
    5755        // I added the option lgWarningCheck so that we don't loop back on ourselves forever. 
    58         if (Phase.VETTING.equals(this.getPhase()) && options.get(Options.Option.lgWarningCheck) != "true") { 
    59             Options checkOptions = options.clone(); 
    60             checkOptions.set("lgWarningCheck", "true"); 
    61             List<CheckStatus> statuses = new ArrayList<CheckStatus>(); 
    62             CompoundCheckCLDR secondaryChecker = CheckCLDR.getCheckAll(CLDRConfig.getInstance().getFullCldrFactory(), ".*"); 
    63             secondaryChecker.setCldrFileToCheck(getCldrFileToCheck(), checkOptions, statuses); 
     56        // JCE: 2015-04-13: I don't think we need this any more, since we implemented  
     57        // http://unicode.org/cldr/trac/ticket/6480, and it really slows things down. 
     58        // I'll just comment it out until we get through a whole release without it. 
     59        // TODO: Remove it completely if we really don't need it. 
     60        //if (Phase.VETTING.equals(this.getPhase()) && options.get(Options.Option.lgWarningCheck) != "true") { 
     61        //    Options checkOptions = options.clone(); 
     62        //    checkOptions.set("lgWarningCheck", "true"); 
     63        //    List<CheckStatus> statuses = new ArrayList<CheckStatus>(); 
     64        //    CompoundCheckCLDR secondaryChecker = CheckCLDR.getCheckAll(CLDRConfig.getInstance().getFullCldrFactory(), ".*"); 
     65        //    secondaryChecker.setCldrFileToCheck(getCldrFileToCheck(), checkOptions, statuses); 
    6466 
    65             for (String apath : paths) { 
    66                 if (apath == path) { 
    67                     continue; 
    68                 } 
    69                 String fPath = getCldrFileToCheck().getFullXPath(apath); 
    70                 if (fPath == null) { 
    71                     continue; 
    72                 } 
    73                 secondaryChecker.check(apath, fPath, getCldrFileToCheck().getWinningValue(apath), checkOptions, statuses); 
    74                 if (CheckStatus.hasType(statuses, Type.Error) || CheckStatus.hasType(statuses, Type.Warning)) { 
    75                     result.add(new CheckStatus().setCause(this).setMainType(CheckStatus.warningType) 
    76                         .setSubtype(Subtype.errorOrWarningInLogicalGroup) 
    77                         .setMessage("Error or warning within this logical group.  May require a change on this item to make the group correct.")); 
    78                     break; 
    79                 } 
    80             } 
    81         } 
     67        //    for (String apath : paths) { 
     68        //        if (apath == path) { 
     69        //            continue; 
     70        //        } 
     71        //        String fPath = getCldrFileToCheck().getFullXPath(apath); 
     72        //        if (fPath == null) { 
     73        //            continue; 
     74        //        } 
     75        //        secondaryChecker.check(apath, fPath, getCldrFileToCheck().getWinningValue(apath), checkOptions, statuses); 
     76        //        if (CheckStatus.hasType(statuses, Type.Error) || CheckStatus.hasType(statuses, Type.Warning)) { 
     77        //            result.add(new CheckStatus().setCause(this).setMainType(CheckStatus.warningType) 
     78        //                .setSubtype(Subtype.errorOrWarningInLogicalGroup) 
     79        //                .setMessage("Error or warning within this logical group.  May require a change on this item to make the group correct.")); 
     80        //            break; 
     81        //        } 
     82        //    } 
     83        //} 
    8284 
    83         if (Phase.FINAL_TESTING.equals(this.getPhase())) { 
     85        //if (Phase.FINAL_TESTING.equals(this.getPhase())) { 
    8486            Factory factory = PathHeader.getFactory(CheckCLDR.getDisplayInformation()); 
    8587            DraftStatus myStatus = null; 
     
    121123                                                                                                                   // arguments 
    122124            } 
    123         } 
     125        // } 
    124126        return this; 
    125127    } 
Note: See TracChangeset for help on using the changeset viewer.