Project

Profile

Help

Revision cb8de86b

Added by Michael Kay almost 13 years ago

Fix bug 2509794 - exception when parsing date '-'

View differences:

latest9.1/bj/net/sf/saxon/value/DateTimeValue.java
171 171
            return badDate("Date must not start with '+' sign", s);
172 172
        } else if ("-".equals(part)) {
173 173
            era = -1;
174
            if (!tok.hasMoreElements()) {
175
                return badDate("No year after '-'", s);
176
            }
174 177
            part = (String)tok.nextElement();
175 178
        }
176 179
        int value = DurationValue.simpleInteger(part);
latest9.1/bj/net/sf/saxon/value/GDateValue.java
117 117
                return badDate("Date may not start with '+' sign", s);
118 118
            } else if ("-".equals(part)) {
119 119
                era = -1;
120
                if (!tok.hasMoreElements()) {
121
                    return badDate("No year after '-'", s);
122
                }
120 123
                part = (String)tok.nextElement();
121 124
            }
122 125

  

Also available in: Unified diff