Changeset 10133 in josm for trunk/src


Ignore:
Timestamp:
2016-04-10T13:37:15+02:00 (8 years ago)
Author:
Don-vip
Message:

increase code coverage

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/tools/date/DateUtils.java

    r9997 r10133  
    3030public final class DateUtils {
    3131
    32     private DateUtils() {
     32    protected DateUtils() {
    3333        // Hide default constructor for utils classes
    3434    }
     
    170170
    171171    private static boolean checkLayout(String text, String pattern) {
    172         if (text.length() != pattern.length()) return false;
     172        if (text.length() != pattern.length())
     173            return false;
    173174        for (int i = 0; i < pattern.length(); i++) {
    174175            char pc = pattern.charAt(i);
    175176            char tc = text.charAt(i);
    176             if (pc == 'x' && tc >= '0' && tc <= '9') continue;
    177             else if (pc == 'x' || pc != tc) return false;
     177            if (pc == 'x' && Character.isDigit(tc))
     178                continue;
     179            else if (pc == 'x' || pc != tc)
     180                return false;
    178181        }
    179182        return true;
Note: See TracChangeset for help on using the changeset viewer.