(String first, String second)
| 1013 | * occur in pairs as above |
| 1014 | */ |
| 1015 | private boolean equalsHexCaseInsensitive(String first, String second) { |
| 1016 | if (first.indexOf('%') != second.indexOf('%')) { |
| 1017 | return first.equals(second); |
| 1018 | } |
| 1019 | |
| 1020 | int index = 0, previndex = 0; |
| 1021 | while ((index = first.indexOf('%', previndex)) != -1 |
| 1022 | && second.indexOf('%', previndex) == index) { |
| 1023 | boolean match = first.substring(previndex, index).equals( |
| 1024 | second.substring(previndex, index)); |
| 1025 | if (!match) { |
| 1026 | return false; |
| 1027 | } |
| 1028 | |
| 1029 | match = first.substring(index + 1, index + 3).equalsIgnoreCase( |
| 1030 | second.substring(index + 1, index + 3)); |
| 1031 | if (!match) { |
| 1032 | return false; |
| 1033 | } |
| 1034 | |
| 1035 | index += 3; |
| 1036 | previndex = index; |
| 1037 | } |
| 1038 | return first.substring(previndex).equals(second.substring(previndex)); |
| 1039 | } |
| 1040 | |
| 1041 | /** |
| 1042 | * Compares this URI instance with the given argument {@code o} and |
no test coverage detected