kikocis/java-driver public
Changesets · Branches · Tags · Compare
| Changeset | 73a81f732ac54fdd28fdfe976ac0b1e69229f3e3db2a0be0682857de3ca7c56c |
|---|---|
| Author | olim7t <omichallat+github@gmail.com> · 2016-02-25 09:42 +01:00 |
| Committer | olim7t <omichallat+github@gmail.com> · 2016-03-09 22:33 +01:00 |
| Parents | 6ae8ffe222d7 |
4 files changed
modified changelog/README.md +1 −0
| @@ -37,6 +37,7 @@ | ||
| 37 | 37 | - [bug] JAVA-727: Allow monotonic timestamp generators to drift in the future + use microsecond precision when possible. |
| 38 | 38 | - [improvement] JAVA-444: Add Java process information to UUIDs.makeNode() hash. |
| 39 | 39 | - [improvement] JAVA-977: Preserve original cause when BuiltStatement value can't be serialized. |
| 40 | +- [bug] JAVA-1094: Backport TypeCodec parse and format fixes from 3.0. | |
| 40 | 41 | |
| 41 | 42 | Merged from 2.0 branch: |
| 42 | 43 |
modified driver-core/src/main/java/com/datastax/driver/core/ParseUtils.java +68 −0
| @@ -159,4 +159,72 @@ | ||
| 159 | 159 | public static boolean isBlank(int c) { |
| 160 | 160 | return c == ' ' || c == '\t' || c == '\n'; |
| 161 | 161 | } |
| 162 | + | |
| 163 | + /** | |
| 164 | + * Return {@code true} if the given string is surrounded | |
| 165 | + * by single quotes, and {@code false} otherwise. | |
| 166 | + * | |
| 167 | + * @param value The string to inspect. | |
| 168 | + * @return {@code true} if the given string is surrounded | |
| 169 | + * by single quotes, and {@code false} otherwise. | |
| 170 | + */ | |
| 171 | + public static boolean isQuoted(String value) { | |
| 172 | + return value != null && value.length() > 1 && value.charAt(0) == '\'' && value.charAt(value.length() - 1) == '\''; | |
| 173 | + } | |
| 174 | + | |
| 175 | + /** | |
| 176 | + * Quote the given string; single quotes are escaped. | |
| 177 | + * If the given string is null, this method returns a quoted empty string ({@code ''}). | |
| 178 | + * | |
| 179 | + * @param value The value to quote. | |
| 180 | + * @return The quoted string. | |
| 181 | + */ | |
| 182 | + public static String quote(String value) { | |
| 183 | + return '\'' + replaceChar(value, '\'', "''") + '\''; | |
| 184 | + } | |
| 185 | + | |
| 186 | + /** | |
| 187 | + * Unquote the given string if it is quoted; single quotes are unescaped. | |
| 188 | + * If the given string is not quoted, it is returned without any modification. | |
| 189 | + * | |
| 190 | + * @param value The string to unquote. | |
| 191 | + * @return The unquoted string. | |
| 192 | + */ | |
| 193 | + public static String unquote(String value) { | |
| 194 | + if (!isQuoted(value)) | |
| 195 | + return value; | |
| 196 | + return value.substring(1, value.length() - 1).replace("''", "'"); | |
| 197 | + } | |
| 198 | + | |
| 199 | + // Simple method to replace a single character. String.replace is a bit too | |
| 200 | + // inefficient (see JAVA-67) | |
| 201 | + static String replaceChar(String text, char search, String replacement) { | |
| 202 | + if (text == null || text.isEmpty()) | |
| 203 | + return text; | |
| 204 | + | |
| 205 | + int nbMatch = 0; | |
| 206 | + int start = -1; | |
| 207 | + do { | |
| 208 | + start = text.indexOf(search, start + 1); | |
| 209 | + if (start != -1) | |
| 210 | + ++nbMatch; | |
| 211 | + } while (start != -1); | |
| 212 | + | |
| 213 | + if (nbMatch == 0) | |
| 214 | + return text; | |
| 215 | + | |
| 216 | + int newLength = text.length() + nbMatch * (replacement.length() - 1); | |
| 217 | + char[] result = new char[newLength]; | |
| 218 | + int newIdx = 0; | |
| 219 | + for (int i = 0; i < text.length(); i++) { | |
| 220 | + char c = text.charAt(i); | |
| 221 | + if (c == search) { | |
| 222 | + for (int r = 0; r < replacement.length(); r++) | |
| 223 | + result[newIdx++] = replacement.charAt(r); | |
| 224 | + } else { | |
| 225 | + result[newIdx++] = c; | |
| 226 | + } | |
| 227 | + } | |
| 228 | + return new String(result); | |
| 229 | + } | |
| 162 | 230 | } |
modified driver-core/src/main/java/com/datastax/driver/core/TypeCodec.java +79 −46
| @@ -370,47 +370,20 @@ | ||
| 370 | 370 | |
| 371 | 371 | @Override |
| 372 | 372 | public String parse(String value) { |
| 373 | - if (value.charAt(0) != '\'' || value.charAt(value.length() - 1) != '\'') | |
| 373 | + if (value == null || value.isEmpty() || value.equalsIgnoreCase("NULL")) | |
| 374 | + return null; | |
| 375 | + | |
| 376 | + if (!ParseUtils.isQuoted(value)) | |
| 374 | 377 | throw new InvalidTypeException("text values must enclosed by a single quotes"); |
| 375 | 378 | |
| 376 | - return value.substring(1, value.length() - 1).replace("''", "'"); | |
| 379 | + return ParseUtils.unquote(value); | |
| 377 | 380 | } |
| 378 | 381 | |
| 379 | 382 | @Override |
| 380 | 383 | public String format(String value) { |
| 381 | - return '\'' + replace(value, '\'', "''") + '\''; | |
| 382 | - } | |
| 383 | - | |
| 384 | - // Simple method to replace a single character. String.replace is a bit too | |
| 385 | - // inefficient (see JAVA-67) | |
| 386 | - static String replace(String text, char search, String replacement) { | |
| 387 | - if (text == null || text.isEmpty()) | |
| 388 | - return text; | |
| 389 | - | |
| 390 | - int nbMatch = 0; | |
| 391 | - int start = -1; | |
| 392 | - do { | |
| 393 | - start = text.indexOf(search, start + 1); | |
| 394 | - if (start != -1) | |
| 395 | - ++nbMatch; | |
| 396 | - } while (start != -1); | |
| 397 | - | |
| 398 | - if (nbMatch == 0) | |
| 399 | - return text; | |
| 400 | - | |
| 401 | - int newLength = text.length() + nbMatch * (replacement.length() - 1); | |
| 402 | - char[] result = new char[newLength]; | |
| 403 | - int newIdx = 0; | |
| 404 | - for (int i = 0; i < text.length(); i++) { | |
| 405 | - char c = text.charAt(i); | |
| 406 | - if (c == search) { | |
| 407 | - for (int r = 0; r < replacement.length(); r++) | |
| 408 | - result[newIdx++] = replacement.charAt(r); | |
| 409 | - } else { | |
| 410 | - result[newIdx++] = c; | |
| 411 | - } | |
| 412 | - } | |
| 413 | - return new String(result); | |
| 384 | + if (value == null) | |
| 385 | + return "NULL"; | |
| 386 | + return ParseUtils.quote(value); | |
| 414 | 387 | } |
| 415 | 388 | |
| 416 | 389 | @Override |
| @@ -432,7 +405,7 @@ | ||
| 432 | 405 | @Override |
| 433 | 406 | public Long parse(String value) { |
| 434 | 407 | try { |
| 435 | - return Long.parseLong(value); | |
| 408 | + return value == null || value.isEmpty() || value.equalsIgnoreCase("NULL") ? null : Long.parseLong(value); | |
| 436 | 409 | } catch (NumberFormatException e) { |
| 437 | 410 | throw new InvalidTypeException(String.format("Cannot parse 64-bits long value from \"%s\"", value)); |
| 438 | 411 | } |
| @@ -440,6 +413,8 @@ | ||
| 440 | 413 | |
| 441 | 414 | @Override |
| 442 | 415 | public String format(Long value) { |
| 416 | + if (value == null) | |
| 417 | + return "NULL"; | |
| 443 | 418 | return Long.toString(value); |
| 444 | 419 | } |
| 445 | 420 | |
| @@ -474,11 +449,13 @@ | ||
| 474 | 449 | |
| 475 | 450 | @Override |
| 476 | 451 | public ByteBuffer parse(String value) { |
| 477 | - return Bytes.fromHexString(value); | |
| 452 | + return value == null || value.isEmpty() || value.equalsIgnoreCase("NULL") ? null : Bytes.fromHexString(value); | |
| 478 | 453 | } |
| 479 | 454 | |
| 480 | 455 | @Override |
| 481 | 456 | public String format(ByteBuffer value) { |
| 457 | + if (value == null) | |
| 458 | + return "NULL"; | |
| 482 | 459 | return Bytes.toHexString(value); |
| 483 | 460 | } |
| 484 | 461 | |
| @@ -502,6 +479,8 @@ | ||
| 502 | 479 | |
| 503 | 480 | @Override |
| 504 | 481 | public Boolean parse(String value) { |
| 482 | + if (value == null || value.isEmpty() || value.equalsIgnoreCase("NULL")) | |
| 483 | + return null; | |
| 505 | 484 | if (value.equalsIgnoreCase(Boolean.FALSE.toString())) |
| 506 | 485 | return false; |
| 507 | 486 | if (value.equalsIgnoreCase(Boolean.TRUE.toString())) |
| @@ -512,6 +491,8 @@ | ||
| 512 | 491 | |
| 513 | 492 | @Override |
| 514 | 493 | public String format(Boolean value) { |
| 494 | + if (value == null) | |
| 495 | + return "NULL"; | |
| 515 | 496 | return value ? "true" : "false"; |
| 516 | 497 | } |
| 517 | 498 | |
| @@ -545,7 +526,7 @@ | ||
| 545 | 526 | @Override |
| 546 | 527 | public BigDecimal parse(String value) { |
| 547 | 528 | try { |
| 548 | - return new BigDecimal(value); | |
| 529 | + return value == null || value.isEmpty() || value.equalsIgnoreCase("NULL") ? null : new BigDecimal(value); | |
| 549 | 530 | } catch (NumberFormatException e) { |
| 550 | 531 | throw new InvalidTypeException(String.format("Cannot parse decimal value from \"%s\"", value)); |
| 551 | 532 | } |
| @@ -553,6 +534,8 @@ | ||
| 553 | 534 | |
| 554 | 535 | @Override |
| 555 | 536 | public String format(BigDecimal value) { |
| 537 | + if (value == null) | |
| 538 | + return "NULL"; | |
| 556 | 539 | return value.toString(); |
| 557 | 540 | } |
| 558 | 541 | |
| @@ -592,7 +575,7 @@ | ||
| 592 | 575 | @Override |
| 593 | 576 | public Double parse(String value) { |
| 594 | 577 | try { |
| 595 | - return Double.parseDouble(value); | |
| 578 | + return value == null || value.isEmpty() || value.equalsIgnoreCase("NULL") ? null : Double.parseDouble(value); | |
| 596 | 579 | } catch (NumberFormatException e) { |
| 597 | 580 | throw new InvalidTypeException(String.format("Cannot parse 64-bits double value from \"%s\"", value)); |
| 598 | 581 | } |
| @@ -600,6 +583,8 @@ | ||
| 600 | 583 | |
| 601 | 584 | @Override |
| 602 | 585 | public String format(Double value) { |
| 586 | + if (value == null) | |
| 587 | + return "NULL"; | |
| 603 | 588 | return Double.toString(value); |
| 604 | 589 | } |
| 605 | 590 | |
| @@ -635,7 +620,7 @@ | ||
| 635 | 620 | @Override |
| 636 | 621 | public Float parse(String value) { |
| 637 | 622 | try { |
| 638 | - return Float.parseFloat(value); | |
| 623 | + return value == null || value.isEmpty() || value.equalsIgnoreCase("NULL") ? null : Float.parseFloat(value); | |
| 639 | 624 | } catch (NumberFormatException e) { |
| 640 | 625 | throw new InvalidTypeException(String.format("Cannot parse 32-bits float value from \"%s\"", value)); |
| 641 | 626 | } |
| @@ -643,6 +628,8 @@ | ||
| 643 | 628 | |
| 644 | 629 | @Override |
| 645 | 630 | public String format(Float value) { |
| 631 | + if (value == null) | |
| 632 | + return "NULL"; | |
| 646 | 633 | return Float.toString(value); |
| 647 | 634 | } |
| 648 | 635 | |
| @@ -677,11 +664,14 @@ | ||
| 677 | 664 | |
| 678 | 665 | @Override |
| 679 | 666 | public InetAddress parse(String value) { |
| 667 | + if (value == null || value.isEmpty() || value.equalsIgnoreCase("NULL")) | |
| 668 | + return null; | |
| 669 | + | |
| 680 | 670 | value = value.trim(); |
| 681 | - if (value.charAt(0) != '\'' || value.charAt(value.length() - 1) != '\'') | |
| 671 | + if (!ParseUtils.isQuoted(value)) | |
| 682 | 672 | throw new InvalidTypeException(String.format("inet values must be enclosed in single quotes (\"%s\")", value)); |
| 683 | 673 | try { |
| 684 | - return InetAddress.getByName(value.substring(1, value.length() - 1)); | |
| 674 | + return InetAddress.getByName(ParseUtils.unquote(value)); | |
| 685 | 675 | } catch (Exception e) { |
| 686 | 676 | throw new InvalidTypeException(String.format("Cannot parse inet value from \"%s\"", value)); |
| 687 | 677 | } |
| @@ -689,6 +679,8 @@ | ||
| 689 | 679 | |
| 690 | 680 | @Override |
| 691 | 681 | public String format(InetAddress value) { |
| 682 | + if (value == null) | |
| 683 | + return "NULL"; | |
| 692 | 684 | return "'" + value.getHostAddress() + "'"; |
| 693 | 685 | } |
| 694 | 686 | |
| @@ -715,7 +707,7 @@ | ||
| 715 | 707 | @Override |
| 716 | 708 | public Integer parse(String value) { |
| 717 | 709 | try { |
| 718 | - return Integer.parseInt(value); | |
| 710 | + return value == null || value.isEmpty() || value.equalsIgnoreCase("NULL") ? null : Integer.parseInt(value); | |
| 719 | 711 | } catch (NumberFormatException e) { |
| 720 | 712 | throw new InvalidTypeException(String.format("Cannot parse 32-bits int value from \"%s\"", value)); |
| 721 | 713 | } |
| @@ -723,6 +715,8 @@ | ||
| 723 | 715 | |
| 724 | 716 | @Override |
| 725 | 717 | public String format(Integer value) { |
| 718 | + if (value == null) | |
| 719 | + return "NULL"; | |
| 726 | 720 | return Integer.toString(value); |
| 727 | 721 | } |
| 728 | 722 | |
| @@ -801,6 +795,12 @@ | ||
| 801 | 795 | |
| 802 | 796 | @Override |
| 803 | 797 | public Date parse(String value) { |
| 798 | + if (value == null || value.isEmpty() || value.equalsIgnoreCase("NULL")) | |
| 799 | + return null; | |
| 800 | + | |
| 801 | + if (ParseUtils.isQuoted(value)) | |
| 802 | + value = ParseUtils.unquote(value); | |
| 803 | + | |
| 804 | 804 | if (IS_LONG_PATTERN.matcher(value).matches()) { |
| 805 | 805 | try { |
| 806 | 806 | return new Date(Long.parseLong(value)); |
| @@ -818,6 +818,8 @@ | ||
| 818 | 818 | |
| 819 | 819 | @Override |
| 820 | 820 | public String format(Date value) { |
| 821 | + if (value == null) | |
| 822 | + return "NULL"; | |
| 821 | 823 | return Long.toString(value.getTime()); |
| 822 | 824 | } |
| 823 | 825 | |
| @@ -840,7 +842,7 @@ | ||
| 840 | 842 | @Override |
| 841 | 843 | public UUID parse(String value) { |
| 842 | 844 | try { |
| 843 | - return UUID.fromString(value); | |
| 845 | + return value == null || value.isEmpty() || value.equalsIgnoreCase("NULL") ? null : UUID.fromString(value); | |
| 844 | 846 | } catch (IllegalArgumentException e) { |
| 845 | 847 | throw new InvalidTypeException(String.format("Cannot parse UUID value from \"%s\"", value)); |
| 846 | 848 | } |
| @@ -848,6 +850,8 @@ | ||
| 848 | 850 | |
| 849 | 851 | @Override |
| 850 | 852 | public String format(UUID value) { |
| 853 | + if (value == null) | |
| 854 | + return "NULL"; | |
| 851 | 855 | return value.toString(); |
| 852 | 856 | } |
| 853 | 857 | |
| @@ -873,7 +877,7 @@ | ||
| 873 | 877 | @Override |
| 874 | 878 | public UUID parse(String value) { |
| 875 | 879 | UUID id = super.parse(value); |
| 876 | - if (id.version() != 1) | |
| 880 | + if (id != null && id.version() != 1) | |
| 877 | 881 | throw new InvalidTypeException(String.format("Cannot parse type 1 UUID value from \"%s\": represents a type %d UUID", value, id.version())); |
| 878 | 882 | return id; |
| 879 | 883 | } |
| @@ -895,7 +899,7 @@ | ||
| 895 | 899 | @Override |
| 896 | 900 | public BigInteger parse(String value) { |
| 897 | 901 | try { |
| 898 | - return new BigInteger(value); | |
| 902 | + return value == null || value.isEmpty() || value.equalsIgnoreCase("NULL") ? null : new BigInteger(value); | |
| 899 | 903 | } catch (NumberFormatException e) { |
| 900 | 904 | throw new InvalidTypeException(String.format("Cannot parse varint value from \"%s\"", value)); |
| 901 | 905 | } |
| @@ -903,6 +907,8 @@ | ||
| 903 | 907 | |
| 904 | 908 | @Override |
| 905 | 909 | public String format(BigInteger value) { |
| 910 | + if (value == null) | |
| 911 | + return "NULL"; | |
| 906 | 912 | return value.toString(); |
| 907 | 913 | } |
| 908 | 914 | |
| @@ -929,6 +935,9 @@ | ||
| 929 | 935 | |
| 930 | 936 | @Override |
| 931 | 937 | public List<T> parse(String value) { |
| 938 | + if (value == null || value.isEmpty() || value.equalsIgnoreCase("NULL")) | |
| 939 | + return null; | |
| 940 | + | |
| 932 | 941 | int idx = ParseUtils.skipSpaces(value, 0); |
| 933 | 942 | if (value.charAt(idx++) != '[') |
| 934 | 943 | throw new InvalidTypeException(String.format("cannot parse list value from \"%s\", at character %d expecting '[' but got '%c'", value, idx, value.charAt(idx))); |
| @@ -963,6 +972,9 @@ | ||
| 963 | 972 | |
| 964 | 973 | @Override |
| 965 | 974 | public String format(List<T> value) { |
| 975 | + if (value == null) | |
| 976 | + return "NULL"; | |
| 977 | + | |
| 966 | 978 | StringBuilder sb = new StringBuilder(); |
| 967 | 979 | sb.append("["); |
| 968 | 980 | for (int i = 0; i < value.size(); i++) { |
| @@ -1012,6 +1024,9 @@ | ||
| 1012 | 1024 | |
| 1013 | 1025 | @Override |
| 1014 | 1026 | public Set<T> parse(String value) { |
| 1027 | + if (value == null || value.isEmpty() || value.equalsIgnoreCase("NULL")) | |
| 1028 | + return null; | |
| 1029 | + | |
| 1015 | 1030 | int idx = ParseUtils.skipSpaces(value, 0); |
| 1016 | 1031 | if (value.charAt(idx++) != '{') |
| 1017 | 1032 | throw new InvalidTypeException(String.format("cannot parse set value from \"%s\", at character %d expecting '{' but got '%c'", value, idx, value.charAt(idx))); |
| @@ -1046,6 +1061,9 @@ | ||
| 1046 | 1061 | |
| 1047 | 1062 | @Override |
| 1048 | 1063 | public String format(Set<T> value) { |
| 1064 | + if (value == null) | |
| 1065 | + return "NULL"; | |
| 1066 | + | |
| 1049 | 1067 | StringBuilder sb = new StringBuilder(); |
| 1050 | 1068 | sb.append("{"); |
| 1051 | 1069 | int i = 0; |
| @@ -1098,6 +1116,9 @@ | ||
| 1098 | 1116 | |
| 1099 | 1117 | @Override |
| 1100 | 1118 | public Map<K, V> parse(String value) { |
| 1119 | + if (value == null || value.isEmpty() || value.equalsIgnoreCase("NULL")) | |
| 1120 | + return null; | |
| 1121 | + | |
| 1101 | 1122 | int idx = ParseUtils.skipSpaces(value, 0); |
| 1102 | 1123 | if (value.charAt(idx++) != '{') |
| 1103 | 1124 | throw new InvalidTypeException(String.format("cannot parse map value from \"%s\", at character %d expecting '{' but got '%c'", value, idx, value.charAt(idx))); |
| @@ -1149,6 +1170,9 @@ | ||
| 1149 | 1170 | |
| 1150 | 1171 | @Override |
| 1151 | 1172 | public String format(Map<K, V> value) { |
| 1173 | + if (value == null) | |
| 1174 | + return "NULL"; | |
| 1175 | + | |
| 1152 | 1176 | StringBuilder sb = new StringBuilder(); |
| 1153 | 1177 | sb.append("{"); |
| 1154 | 1178 | int i = 0; |
| @@ -1201,11 +1225,15 @@ | ||
| 1201 | 1225 | |
| 1202 | 1226 | @Override |
| 1203 | 1227 | public UDTValue parse(String value) { |
| 1228 | + if (value == null || value.isEmpty() || value.equalsIgnoreCase("NULL")) | |
| 1229 | + return null; | |
| 1204 | 1230 | return definition.parseValue(value); |
| 1205 | 1231 | } |
| 1206 | 1232 | |
| 1207 | 1233 | @Override |
| 1208 | 1234 | public String format(UDTValue value) { |
| 1235 | + if (value == null) | |
| 1236 | + return "NULL"; | |
| 1209 | 1237 | return value.toString(); |
| 1210 | 1238 | } |
| 1211 | 1239 | |
| @@ -1251,6 +1279,9 @@ | ||
| 1251 | 1279 | |
| 1252 | 1280 | @Override |
| 1253 | 1281 | public TupleValue parse(String value) { |
| 1282 | + if (value == null || value.isEmpty() || value.equalsIgnoreCase("NULL")) | |
| 1283 | + return null; | |
| 1284 | + | |
| 1254 | 1285 | TupleValue v = type.newValue(); |
| 1255 | 1286 | |
| 1256 | 1287 | int idx = ParseUtils.skipSpaces(value, 0); |
| @@ -1290,6 +1321,8 @@ | ||
| 1290 | 1321 | |
| 1291 | 1322 | @Override |
| 1292 | 1323 | public String format(TupleValue value) { |
| 1324 | + if (value == null) | |
| 1325 | + return "NULL"; | |
| 1293 | 1326 | return value.toString(); |
| 1294 | 1327 | } |
| 1295 | 1328 |
modified driver-core/src/test/java/com/datastax/driver/core/DataTypeTest.java +15 −0
| @@ -24,6 +24,8 @@ | ||
| 24 | 24 | import java.math.BigInteger; |
| 25 | 25 | import java.net.InetAddress; |
| 26 | 26 | import java.nio.ByteBuffer; |
| 27 | +import java.text.ParseException; | |
| 28 | +import java.text.SimpleDateFormat; | |
| 27 | 29 | import java.util.*; |
| 28 | 30 | |
| 29 | 31 | import static com.datastax.driver.core.Assertions.assertThat; |
| @@ -284,4 +286,17 @@ | ||
| 284 | 286 | .cannotBeDeserializedAs(new TypeToken<Map<Integer, Collection<Integer>>>() { |
| 285 | 287 | }); |
| 286 | 288 | } |
| 289 | + | |
| 290 | + @Test(groups = "unit") | |
| 291 | + public void should_handle_quotes_in_map_elements() throws ParseException { | |
| 292 | + DataType type = DataType.map(DataType.timestamp(), DataType.text()); | |
| 293 | + String text = "{ '2013-9-22 12:01' : 'birthday wishes to Bilbo', '2013-10-1 18:00' : 'Check into Inn of Prancing Pony' }"; | |
| 294 | + @SuppressWarnings("unchecked") | |
| 295 | + Map<Date, String> map = (Map<Date, String>) type.parse(text); | |
| 296 | + | |
| 297 | + SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm"); | |
| 298 | + assertThat(map) | |
| 299 | + .containsEntry(format.parse("2013-9-22 12:01"), "birthday wishes to Bilbo") | |
| 300 | + .containsEntry(format.parse("2013-10-1 18:00"), "Check into Inn of Prancing Pony"); | |
| 301 | + } | |
| 287 | 302 | } |