MCPcopy Create free account
hub / github.com/ReadyTalk/avian / expectPrefix

Method expectPrefix

classpath/java/text/SimpleDateFormat.java:100–104  ·  view source on GitHub ↗
(String text, int offset, String prefix)

Source from the content-addressed store, hash-verified

98 }
99
100 private static int expectPrefix(String text, int offset, String prefix) throws ParseException {
101 if (text.length() <= offset) throw new ParseException("Short date: " + text, offset);
102 if (! text.substring(offset).startsWith(prefix)) throw new ParseException("Parse error: " + text, offset);
103 return offset + prefix.length();
104 }
105}

Callers 1

parseMethod · 0.95

Calls 3

startsWithMethod · 0.80
lengthMethod · 0.65
substringMethod · 0.45

Tested by

no test coverage detected