- Timestamp:
- 2018-08-05T21:43:31+02:00 (6 years ago)
- Location:
- trunk
- Files:
-
- 1 deleted
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/.classpath
r14092 r14093 63 63 </attributes> 64 64 </classpathentry> 65 <classpathentry kind="lib" path="test/lib/unitils-core/unitils-core-3.4.6.jar">66 <attributes>67 <attribute name="test" value="true"/>68 </attributes>69 </classpathentry>70 65 <classpathentry kind="lib" path="test/lib/commons-testing/commons-testing-2.1.0.jar"> 71 66 <attributes> … … 89 84 </attributes> 90 85 </classpathentry> 91 <classpathentry kind="lib" path="test/lib/unitils-core/commons-collections-3.2.2.jar"> 92 <attributes> 93 <attribute name="test" value="true"/> 94 </attributes> 95 </classpathentry> 96 <classpathentry kind="lib" path="test/lib/unitils-core/commons-lang-2.6.jar"> 97 <attributes> 98 <attribute name="test" value="true"/> 99 </attributes> 100 </classpathentry> 101 <classpathentry kind="lib" path="test/lib/unitils-core/commons-logging-1.1.3.jar"> 102 <attributes> 103 <attribute name="test" value="true"/> 104 </attributes> 105 </classpathentry> 106 <classpathentry kind="lib" path="test/lib/unitils-core/ognl-2.6.9.jar"> 86 <classpathentry kind="lib" path="tools/pmd/commons-lang3-3.7.jar"> 107 87 <attributes> 108 88 <attribute name="test" value="true"/> -
trunk/build.xml
r14065 r14093 501 501 <junit printsummary="yes" fork="true" forkmode="once"> 502 502 <jvmarg value="-Dfile.encoding=UTF-8"/> 503 <jvmarg value="-javaagent:${test.dir}/lib/jmockit-1.4 0.jar"/>503 <jvmarg value="-javaagent:${test.dir}/lib/jmockit-1.41.jar"/> 504 504 <jvmarg value="--add-modules" if:set="isJava9" unless:set="isJava11" /> 505 505 <jvmarg value="java.activation,java.se.ee" if:set="isJava9" unless:set="isJava11" /> -
trunk/netbeans/nbproject/project.properties
r14092 r14093 32 32 endorsed.classpath= 33 33 excludes=org/apache/commons/compress/compressors/CompressorException.java,org/apache/commons/compress/compressors/CompressorStreamFactory.java,org/apache/commons/compress/compressors/CompressorStreamProvider.java,org/apache/commons/compress/compressors/FileNameUtil.java,org/apache/commons/compress/compressors/brotli/**,org/apache/commons/compress/compressors/bzip2/BZip2Utils.java,org/apache/commons/compress/compressors/deflate/**,org/apache/commons/compress/compressors/gzip/**,org/apache/commons/compress/compressors/lz4/**,org/apache/commons/compress/compressors/lz77support/**,org/apache/commons/compress/compressors/lzma/**,org/apache/commons/compress/compressors/pack200/**,org/apache/commons/compress/compressors/snappy/**,org/apache/commons/compress/compressors/xz/XZUtils.java,org/apache/commons/compress/compressors/z/**,org/apache/commons/compress/compressors/zstandard/**,org/apache/commons/compress/utils/ArchiveUtils.java,org/apache/commons/jcs/JCS.java,org/apache/commons/jcs/access/GroupCacheAccess.java,org/apache/commons/jcs/access/PartitionedCacheAccess.java,org/apache/commons/jcs/access/behavior/IGroupCacheAccess.java,org/apache/commons/jcs/access/exception/InvalidGroupException.java,org/apache/commons/jcs/admin/servlet/**,org/apache/commons/jcs/auxiliary/AbstractAuxiliaryCacheMonitor.java,org/apache/commons/jcs/auxiliary/disk/jdbc/**,org/apache/commons/jcs/auxiliary/lateral/**,org/apache/commons/jcs/auxiliary/remote/AbstractRemoteAuxiliaryCache.java,org/apache/commons/jcs/auxiliary/remote/AbstractRemoteCacheListener.java,org/apache/commons/jcs/auxiliary/remote/AbstractRemoteCacheNoWaitFacade.java,org/apache/commons/jcs/auxiliary/remote/RemoteCache.java,org/apache/commons/jcs/auxiliary/remote/RemoteCacheFactory.java,org/apache/commons/jcs/auxiliary/remote/RemoteCacheFailoverRunner.java,org/apache/commons/jcs/auxiliary/remote/RemoteCacheListener.java,org/apache/commons/jcs/auxiliary/remote/RemoteCacheManager.java,org/apache/commons/jcs/auxiliary/remote/RemoteCacheMonitor.java,org/apache/commons/jcs/auxiliary/remote/RemoteCacheNoWait.java,org/apache/commons/jcs/auxiliary/remote/RemoteCacheNoWaitFacade.java,org/apache/commons/jcs/auxiliary/remote/RemoteCacheRestore.java,org/apache/commons/jcs/auxiliary/remote/http/**,org/apache/commons/jcs/auxiliary/remote/server/RemoteCacheStartupServlet.java,org/apache/commons/jcs/auxiliary/remote/server/TimeoutConfigurableRMISocketFactory.java,org/apache/commons/jcs/engine/CacheAdaptor.java,org/apache/commons/jcs/engine/CacheGroup.java,org/apache/commons/jcs/engine/CacheWatchRepairable.java,org/apache/commons/jcs/engine/ZombieCacheService.java,org/apache/commons/jcs/engine/ZombieCacheServiceNonLocal.java,org/apache/commons/jcs/engine/ZombieCacheWatch.java,org/apache/commons/jcs/engine/logging/CacheEventLoggerDebugLogger.java,org/apache/commons/jcs/utils/access/**,org/apache/commons/jcs/utils/discovery/**,org/apache/commons/jcs/utils/net/**,org/apache/commons/jcs/utils/props/**,org/apache/commons/jcs/utils/servlet/**,org/apache/commons/logging/impl/AvalonLogger.java,org/apache/commons/logging/impl/Jdk13LumberjackLogger.java,org/apache/commons/logging/impl/Log4JLogger.java,org/apache/commons/logging/impl/LogKitLogger.java,org/apache/commons/logging/impl/ServletContextCleaner.java,org/openstreetmap/gui/jmapviewer/Demo.java,org/openstreetmap/gui/jmapviewer/JMapViewerTree.java,org/openstreetmap/gui/jmapviewer/checkBoxTree/**,org/apache/commons/compress/archivers/**,org/apache/commons/compress/changes/**,org/apache/commons/compress/parallel/**,org/apache/commons/compress/PasswordRequiredException.java 34 file.reference.commons-collections-3.2.2.jar=../test/lib/unitils-core/commons-collections-3.2.2.jar 35 file.reference.commons-lang-2.6.jar=../test/lib/unitils-core/commons-lang-2.6.jar 36 file.reference.commons-logging-1.1.3.jar=../test/lib/unitils-core/commons-logging-1.1.3.jar 34 file.reference.commons-lang-3.7.jar=../tools/pmd/commons-lang-3.7.jar 37 35 file.reference.commons-testing-2.1.0.jar=../test/lib/commons-testing/commons-testing-2.1.0.jar 38 36 file.reference.core-src=../src … … 45 43 file.reference.jmockit-1.41.jar=../test/lib/jmockit-1.41.jar 46 44 file.reference.junit-4.12.jar=../test/lib/junit/junit-4.12.jar 47 file.reference.ognl-2.6.9.jar=../test/lib/unitils-core/ognl-2.6.9.jar48 45 file.reference.reflections-0.9.10.jar=../test/lib/reflections/reflections-0.9.10.jar 49 46 file.reference.test-functional=../test/functional 50 47 file.reference.test-performance=../test/performance 51 48 file.reference.test-unit=../test/unit 52 file.reference.unitils-core-3.4.6.jar=../test/lib/unitils-core/unitils-core-3.4.6.jar53 49 file.reference.system-rules-1.16.1.jar=../test/lib/system-rules-1.16.1.jar 54 50 file.reference.wiremock-standalone-2.18.0.jar=../test/lib/wiremock-standalone-2.18.0.jar … … 76 72 ${file.reference.javassist-3.21.0-GA.jar}:\ 77 73 ${file.reference.reflections-0.9.11.jar}:\ 78 ${file.reference.commons-collections-3.2.2.jar}:\ 79 ${file.reference.commons-lang-2.6.jar}:\ 80 ${file.reference.commons-logging-1.1.3.jar}:\ 81 ${file.reference.ognl-2.6.9.jar}:\ 82 ${file.reference.unitils-core-3.4.6.jar}:\ 74 ${file.reference.commons-lang-3.7.jar}:\ 83 75 ${file.reference.system-rules-1.16.1.jar}:\ 84 76 ${file.reference.wiremock-standalone-2.18.0.jar}:\ -
trunk/src/org/openstreetmap/josm/data/osm/search/SearchCompiler.java
r13887 r14093 322 322 return match; 323 323 } 324 325 @Override 326 public int hashCode() { 327 return 31 + ((match == null) ? 0 : match.hashCode()); 328 } 329 330 @Override 331 public boolean equals(Object obj) { 332 if (this == obj) 333 return true; 334 if (obj == null || getClass() != obj.getClass()) 335 return false; 336 UnaryMatch other = (UnaryMatch) obj; 337 if (match == null) { 338 if (other.match != null) 339 return false; 340 } else if (!match.equals(other.match)) 341 return false; 342 return true; 343 } 324 344 } 325 345 … … 361 381 return '(' + m.toString() + ')'; 362 382 } 383 384 @Override 385 public int hashCode() { 386 final int prime = 31; 387 int result = 1; 388 result = prime * result + ((lhs == null) ? 0 : lhs.hashCode()); 389 result = prime * result + ((rhs == null) ? 0 : rhs.hashCode()); 390 return result; 391 } 392 393 @Override 394 public boolean equals(Object obj) { 395 if (this == obj) 396 return true; 397 if (obj == null || getClass() != obj.getClass()) 398 return false; 399 AbstractBinaryMatch other = (AbstractBinaryMatch) obj; 400 if (lhs == null) { 401 if (other.lhs != null) 402 return false; 403 } else if (!lhs.equals(other.lhs)) 404 return false; 405 if (rhs == null) { 406 if (other.rhs != null) 407 return false; 408 } else if (!rhs.equals(other.rhs)) 409 return false; 410 return true; 411 } 363 412 } 364 413 … … 435 484 public String toString() { 436 485 return key + '?'; 486 } 487 488 @Override 489 public int hashCode() { 490 final int prime = 31; 491 int result = 1; 492 result = prime * result + (defaultValue ? 1231 : 1237); 493 result = prime * result + ((key == null) ? 0 : key.hashCode()); 494 return result; 495 } 496 497 @Override 498 public boolean equals(Object obj) { 499 if (this == obj) 500 return true; 501 if (obj == null || getClass() != obj.getClass()) 502 return false; 503 BooleanMatch other = (BooleanMatch) obj; 504 if (defaultValue != other.defaultValue) 505 return false; 506 if (key == null) { 507 if (other.key != null) 508 return false; 509 } else if (!key.equals(other.key)) 510 return false; 511 return true; 437 512 } 438 513 } … … 700 775 return key + '=' + value; 701 776 } 777 778 @Override 779 public int hashCode() { 780 final int prime = 31; 781 int result = 1; 782 result = prime * result + (caseSensitive ? 1231 : 1237); 783 result = prime * result + ((key == null) ? 0 : key.hashCode()); 784 result = prime * result + ((keyPattern == null) ? 0 : keyPattern.hashCode()); 785 result = prime * result + ((value == null) ? 0 : value.hashCode()); 786 result = prime * result + ((valuePattern == null) ? 0 : valuePattern.hashCode()); 787 return result; 788 } 789 790 @Override 791 public boolean equals(Object obj) { 792 if (this == obj) 793 return true; 794 if (obj == null || getClass() != obj.getClass()) 795 return false; 796 KeyValue other = (KeyValue) obj; 797 if (caseSensitive != other.caseSensitive) 798 return false; 799 if (key == null) { 800 if (other.key != null) 801 return false; 802 } else if (!key.equals(other.key)) 803 return false; 804 if (keyPattern == null) { 805 if (other.keyPattern != null) 806 return false; 807 } else if (!keyPattern.equals(other.keyPattern)) 808 return false; 809 if (value == null) { 810 if (other.value != null) 811 return false; 812 } else if (!value.equals(other.value)) 813 return false; 814 if (valuePattern == null) { 815 if (other.valuePattern != null) 816 return false; 817 } else if (!valuePattern.equals(other.valuePattern)) 818 return false; 819 return true; 820 } 702 821 } 703 822 … … 747 866 public String toString() { 748 867 return key + (compareMode == -1 ? "<" : compareMode == +1 ? ">" : "") + referenceValue; 868 } 869 870 @Override 871 public int hashCode() { 872 final int prime = 31; 873 int result = 1; 874 result = prime * result + compareMode; 875 result = prime * result + ((key == null) ? 0 : key.hashCode()); 876 result = prime * result + ((referenceNumber == null) ? 0 : referenceNumber.hashCode()); 877 result = prime * result + ((referenceValue == null) ? 0 : referenceValue.hashCode()); 878 return result; 879 } 880 881 @Override 882 public boolean equals(Object obj) { 883 if (this == obj) 884 return true; 885 if (obj == null || getClass() != obj.getClass()) 886 return false; 887 ValueComparison other = (ValueComparison) obj; 888 if (compareMode != other.compareMode) 889 return false; 890 if (key == null) { 891 if (other.key != null) 892 return false; 893 } else if (!key.equals(other.key)) 894 return false; 895 if (referenceNumber == null) { 896 if (other.referenceNumber != null) 897 return false; 898 } else if (!referenceNumber.equals(other.referenceNumber)) 899 return false; 900 if (referenceValue == null) { 901 if (other.referenceValue != null) 902 return false; 903 } else if (!referenceValue.equals(other.referenceValue)) 904 return false; 905 return true; 749 906 } 750 907 } … … 883 1040 return key + '=' + value; 884 1041 } 1042 1043 @Override 1044 public int hashCode() { 1045 final int prime = 31; 1046 int result = 1; 1047 result = prime * result + ((key == null) ? 0 : key.hashCode()); 1048 result = prime * result + ((keyPattern == null) ? 0 : keyPattern.hashCode()); 1049 result = prime * result + ((mode == null) ? 0 : mode.hashCode()); 1050 result = prime * result + ((value == null) ? 0 : value.hashCode()); 1051 result = prime * result + ((valuePattern == null) ? 0 : valuePattern.hashCode()); 1052 return result; 1053 } 1054 1055 @Override 1056 public boolean equals(Object obj) { 1057 if (this == obj) 1058 return true; 1059 if (obj == null || getClass() != obj.getClass()) 1060 return false; 1061 ExactKeyValue other = (ExactKeyValue) obj; 1062 if (key == null) { 1063 if (other.key != null) 1064 return false; 1065 } else if (!key.equals(other.key)) 1066 return false; 1067 if (keyPattern == null) { 1068 if (other.keyPattern != null) 1069 return false; 1070 } else if (!keyPattern.equals(other.keyPattern)) 1071 return false; 1072 if (mode != other.mode) 1073 return false; 1074 if (value == null) { 1075 if (other.value != null) 1076 return false; 1077 } else if (!value.equals(other.value)) 1078 return false; 1079 if (valuePattern == null) { 1080 if (other.valuePattern != null) 1081 return false; 1082 } else if (!valuePattern.equals(other.valuePattern)) 1083 return false; 1084 return true; 1085 } 885 1086 } 886 1087 … … 954 1155 return search; 955 1156 } 1157 1158 @Override 1159 public int hashCode() { 1160 final int prime = 31; 1161 int result = 1; 1162 result = prime * result + (caseSensitive ? 1231 : 1237); 1163 result = prime * result + ((search == null) ? 0 : search.hashCode()); 1164 result = prime * result + ((searchRegex == null) ? 0 : searchRegex.hashCode()); 1165 return result; 1166 } 1167 1168 @Override 1169 public boolean equals(Object obj) { 1170 if (this == obj) 1171 return true; 1172 if (obj == null || getClass() != obj.getClass()) 1173 return false; 1174 Any other = (Any) obj; 1175 if (caseSensitive != other.caseSensitive) 1176 return false; 1177 if (search == null) { 1178 if (other.search != null) 1179 return false; 1180 } else if (!search.equals(other.search)) 1181 return false; 1182 if (searchRegex == null) { 1183 if (other.searchRegex != null) 1184 return false; 1185 } else if (!searchRegex.equals(other.searchRegex)) 1186 return false; 1187 return true; 1188 } 956 1189 } 957 1190 … … 973 1206 public String toString() { 974 1207 return "type=" + type; 1208 } 1209 1210 @Override 1211 public int hashCode() { 1212 return 31 + ((type == null) ? 0 : type.hashCode()); 1213 } 1214 1215 @Override 1216 public boolean equals(Object obj) { 1217 if (this == obj) 1218 return true; 1219 if (obj == null || getClass() != obj.getClass()) 1220 return false; 1221 ExactType other = (ExactType) obj; 1222 if (type != other.type) 1223 return false; 1224 return true; 975 1225 } 976 1226 } … … 1001 1251 public String toString() { 1002 1252 return "user=" + (user == null ? "" : user); 1253 } 1254 1255 @Override 1256 public int hashCode() { 1257 return 31 + ((user == null) ? 0 : user.hashCode()); 1258 } 1259 1260 @Override 1261 public boolean equals(Object obj) { 1262 if (this == obj) 1263 return true; 1264 if (obj == null || getClass() != obj.getClass()) 1265 return false; 1266 UserMatch other = (UserMatch) obj; 1267 if (user == null) { 1268 if (other.user != null) 1269 return false; 1270 } else if (!user.equals(other.user)) 1271 return false; 1272 return true; 1003 1273 } 1004 1274 } … … 1037 1307 public String toString() { 1038 1308 return "role=" + role; 1309 } 1310 1311 @Override 1312 public int hashCode() { 1313 return 31 + ((role == null) ? 0 : role.hashCode()); 1314 } 1315 1316 @Override 1317 public boolean equals(Object obj) { 1318 if (this == obj) 1319 return true; 1320 if (obj == null || getClass() != obj.getClass()) 1321 return false; 1322 RoleMatch other = (RoleMatch) obj; 1323 if (role == null) { 1324 if (other.role != null) 1325 return false; 1326 } else if (!role.equals(other.role)) 1327 return false; 1328 return true; 1039 1329 } 1040 1330 } … … 1085 1375 return "Nth{nth=" + nth + ", modulo=" + modulo + '}'; 1086 1376 } 1377 1378 @Override 1379 public int hashCode() { 1380 final int prime = 31; 1381 int result = 1; 1382 result = prime * result + (modulo ? 1231 : 1237); 1383 result = prime * result + nth; 1384 return result; 1385 } 1386 1387 @Override 1388 public boolean equals(Object obj) { 1389 if (this == obj) 1390 return true; 1391 if (obj == null || getClass() != obj.getClass()) 1392 return false; 1393 Nth other = (Nth) obj; 1394 if (modulo != other.modulo) 1395 return false; 1396 if (nth != other.nth) 1397 return false; 1398 return true; 1399 } 1087 1400 } 1088 1401 … … 1120 1433 public String toString() { 1121 1434 return getString() + '=' + min + '-' + max; 1435 } 1436 1437 @Override 1438 public int hashCode() { 1439 final int prime = 31; 1440 int result = 1; 1441 result = prime * result + (int) (max ^ (max >>> 32)); 1442 result = prime * result + (int) (min ^ (min >>> 32)); 1443 return result; 1444 } 1445 1446 @Override 1447 public boolean equals(Object obj) { 1448 if (this == obj) 1449 return true; 1450 if (obj == null || getClass() != obj.getClass()) 1451 return false; 1452 RangeMatch other = (RangeMatch) obj; 1453 if (max != other.max) 1454 return false; 1455 if (min != other.min) 1456 return false; 1457 return true; 1122 1458 } 1123 1459 } … … 1237 1573 public boolean match(OsmPrimitive osm) { 1238 1574 return osm instanceof Relation && ((Relation) osm).getMemberRoles().contains(role); 1575 } 1576 1577 @Override 1578 public int hashCode() { 1579 return 31 + ((role == null) ? 0 : role.hashCode()); 1580 } 1581 1582 @Override 1583 public boolean equals(Object obj) { 1584 if (this == obj) 1585 return true; 1586 if (obj == null || getClass() != obj.getClass()) 1587 return false; 1588 HasRole other = (HasRole) obj; 1589 if (role == null) { 1590 if (other.role != null) 1591 return false; 1592 } else if (!role.equals(other.role)) 1593 return false; 1594 return true; 1239 1595 } 1240 1596 } … … 1490 1846 return false; 1491 1847 } 1848 1849 @Override 1850 public int hashCode() { 1851 return 31 + (all ? 1231 : 1237); 1852 } 1853 1854 @Override 1855 public boolean equals(Object obj) { 1856 if (this == obj) 1857 return true; 1858 if (obj == null || getClass() != obj.getClass()) 1859 return false; 1860 InArea other = (InArea) obj; 1861 if (all != other.all) 1862 return false; 1863 return true; 1864 } 1492 1865 } 1493 1866 … … 1599 1972 return false; 1600 1973 } 1974 } 1975 1976 @Override 1977 public int hashCode() { 1978 return 31 + ((presets == null) ? 0 : presets.hashCode()); 1979 } 1980 1981 @Override 1982 public boolean equals(Object obj) { 1983 if (this == obj) 1984 return true; 1985 if (obj == null || getClass() != obj.getClass()) 1986 return false; 1987 Preset other = (Preset) obj; 1988 if (presets == null) { 1989 if (other.presets != null) 1990 return false; 1991 } else if (!presets.equals(other.presets)) 1992 return false; 1993 return true; 1601 1994 } 1602 1995 } -
trunk/src/org/openstreetmap/josm/tools/template_engine/CompoundTemplateEntry.java
r13003 r14093 1 1 // License: GPL. For details, see LICENSE file. 2 2 package org.openstreetmap.josm.tools.template_engine; 3 4 import java.util.Arrays; 3 5 4 6 /** … … 54 56 return result.toString(); 55 57 } 58 59 @Override 60 public int hashCode() { 61 return 31 + Arrays.hashCode(entries); 62 } 63 64 @Override 65 public boolean equals(Object obj) { 66 if (this == obj) 67 return true; 68 if (obj == null || getClass() != obj.getClass()) 69 return false; 70 CompoundTemplateEntry other = (CompoundTemplateEntry) obj; 71 if (!Arrays.equals(entries, other.entries)) 72 return false; 73 return true; 74 } 56 75 } -
trunk/src/org/openstreetmap/josm/tools/template_engine/Condition.java
r13173 r14093 71 71 return sb.toString(); 72 72 } 73 74 @Override 75 public int hashCode() { 76 return 31 + ((entries == null) ? 0 : entries.hashCode()); 77 } 78 79 @Override 80 public boolean equals(Object obj) { 81 if (this == obj) 82 return true; 83 if (obj == null || getClass() != obj.getClass()) 84 return false; 85 Condition other = (Condition) obj; 86 if (entries == null) { 87 if (other.entries != null) 88 return false; 89 } else if (!entries.equals(other.entries)) 90 return false; 91 return true; 92 } 73 93 } -
trunk/src/org/openstreetmap/josm/tools/template_engine/ContextSwitchTemplate.java
r12656 r14093 49 49 50 50 abstract List<OsmPrimitive> getPrimitives(OsmPrimitive root); 51 52 @Override 53 public int hashCode() { 54 return 31 + ((condition == null) ? 0 : condition.hashCode()); 55 } 56 57 @Override 58 public boolean equals(Object obj) { 59 if (this == obj) 60 return true; 61 if (obj == null || getClass() != obj.getClass()) 62 return false; 63 ContextProvider other = (ContextProvider) obj; 64 if (condition == null) { 65 if (other.condition != null) 66 return false; 67 } else if (!condition.equals(other.condition)) 68 return false; 69 return true; 70 } 51 71 } 52 72 … … 83 103 } 84 104 return result; 105 } 106 107 @Override 108 public int hashCode() { 109 return 31 * super.hashCode() + ((childCondition == null) ? 0 : childCondition.hashCode()); 110 } 111 112 @Override 113 public boolean equals(Object obj) { 114 if (this == obj) 115 return true; 116 if (!super.equals(obj) || getClass() != obj.getClass()) 117 return false; 118 ParentSet other = (ParentSet) obj; 119 if (childCondition == null) { 120 if (other.childCondition != null) 121 return false; 122 } else if (!childCondition.equals(other.childCondition)) 123 return false; 124 return true; 85 125 } 86 126 } … … 127 167 return result; 128 168 } 169 170 @Override 171 public int hashCode() { 172 return 31 * super.hashCode() + ((parentCondition == null) ? 0 : parentCondition.hashCode()); 173 } 174 175 @Override 176 public boolean equals(Object obj) { 177 if (this == obj) 178 return true; 179 if (!super.equals(obj) || getClass() != obj.getClass()) 180 return false; 181 ChildSet other = (ChildSet) obj; 182 if (parentCondition == null) { 183 if (other.parentCondition != null) 184 return false; 185 } else if (!parentCondition.equals(other.parentCondition)) 186 return false; 187 return true; 188 } 129 189 } 130 190 … … 157 217 } 158 218 return result; 219 } 220 221 @Override 222 public int hashCode() { 223 final int prime = 31; 224 int result = super.hashCode(); 225 result = prime * result + ((lhs == null) ? 0 : lhs.hashCode()); 226 result = prime * result + ((rhs == null) ? 0 : rhs.hashCode()); 227 return result; 228 } 229 230 @Override 231 public boolean equals(Object obj) { 232 if (this == obj) 233 return true; 234 if (!super.equals(obj) || getClass() != obj.getClass()) 235 return false; 236 OrSet other = (OrSet) obj; 237 if (lhs == null) { 238 if (other.lhs != null) 239 return false; 240 } else if (!lhs.equals(other.lhs)) 241 return false; 242 if (rhs == null) { 243 if (other.rhs != null) 244 return false; 245 } else if (!rhs.equals(other.rhs)) 246 return false; 247 return true; 159 248 } 160 249 } … … 184 273 } 185 274 return result; 275 } 276 277 @Override 278 public int hashCode() { 279 final int prime = 31; 280 int result = super.hashCode(); 281 result = prime * result + ((lhs == null) ? 0 : lhs.hashCode()); 282 result = prime * result + ((rhs == null) ? 0 : rhs.hashCode()); 283 return result; 284 } 285 286 @Override 287 public boolean equals(Object obj) { 288 if (this == obj) 289 return true; 290 if (!super.equals(obj) || getClass() != obj.getClass()) 291 return false; 292 AndSet other = (AndSet) obj; 293 if (lhs == null) { 294 if (other.lhs != null) 295 return false; 296 } else if (!lhs.equals(other.lhs)) 297 return false; 298 if (rhs == null) { 299 if (other.rhs != null) 300 return false; 301 } else if (!rhs.equals(other.rhs)) 302 return false; 303 return true; 186 304 } 187 305 } … … 289 407 return false; 290 408 } 409 410 @Override 411 public int hashCode() { 412 final int prime = 31; 413 int result = 1; 414 result = prime * result + ((context == null) ? 0 : context.hashCode()); 415 result = prime * result + ((template == null) ? 0 : template.hashCode()); 416 return result; 417 } 418 419 @Override 420 public boolean equals(Object obj) { 421 if (this == obj) 422 return true; 423 if (obj == null || getClass() != obj.getClass()) 424 return false; 425 ContextSwitchTemplate other = (ContextSwitchTemplate) obj; 426 if (context == null) { 427 if (other.context != null) 428 return false; 429 } else if (!context.equals(other.context)) 430 return false; 431 if (template == null) { 432 if (other.template != null) 433 return false; 434 } else if (!template.equals(other.template)) 435 return false; 436 return true; 437 } 291 438 } -
trunk/src/org/openstreetmap/josm/tools/template_engine/ParseError.java
r13003 r14093 17 17 private final transient Token unexpectedToken; 18 18 19 /** 20 * Constructs a new {@code ParseError} for an unexpected token. 21 * @param unexpectedToken the unexpected token 22 */ 19 23 public ParseError(Token unexpectedToken) { 20 24 super(tr("Unexpected token ({0}) on position {1}", unexpectedToken.getType(), unexpectedToken.getPosition())); … … 22 26 } 23 27 28 /** 29 * Constructs a new {@code ParseError} for an unexpected token and an expected token. 30 * @param unexpectedToken the unexpected token 31 * @param expected the expected token 32 */ 24 33 public ParseError(Token unexpectedToken, TokenType expected) { 25 34 super(tr("Unexpected token on position {0}. Expected {1}, found {2}", … … 28 37 } 29 38 39 /** 40 * Constructs a new {@code ParseError} from a {@link SearchParseError}. 41 * @param position the position 42 * @param e the cause 43 */ 30 44 public ParseError(int position, SearchParseError e) { 31 45 super(tr("Error while parsing search expression on position {0}", position), e); … … 33 47 } 34 48 49 /** 50 * Constructs a new {@code ParseError} with a generic message. 51 * @param message the detail message. The detail message is saved for later retrieval by the {@link #getMessage()} method. 52 */ 35 53 public ParseError(String message) { 36 54 super(message); … … 38 56 } 39 57 58 /** 59 * Returns the unexpected token, if any. 60 * @return the unexpected token, or null 61 */ 40 62 public Token getUnexpectedToken() { 41 63 return unexpectedToken; 42 64 } 43 65 66 /** 67 * Constructs a new {@code ParseError} for an unexpected character. 68 * @param expected the expected character 69 * @param found the found character 70 * @param position the position 71 * @return a new {@code ParseError} 72 */ 44 73 public static ParseError unexpectedChar(char expected, char found, int position) { 45 74 return new ParseError(tr("Unexpected char on {0}. Expected {1} found {2}", position, expected, found)); -
trunk/src/org/openstreetmap/josm/tools/template_engine/SearchExpressionCondition.java
r13003 r14093 37 37 return condition + " '" + text + '\''; 38 38 } 39 40 @Override 41 public int hashCode() { 42 final int prime = 31; 43 int result = 1; 44 result = prime * result + ((condition == null) ? 0 : condition.hashCode()); 45 result = prime * result + ((text == null) ? 0 : text.hashCode()); 46 return result; 47 } 48 49 @Override 50 public boolean equals(Object obj) { 51 if (this == obj) 52 return true; 53 if (obj == null || getClass() != obj.getClass()) 54 return false; 55 SearchExpressionCondition other = (SearchExpressionCondition) obj; 56 if (condition == null) { 57 if (other.condition != null) 58 return false; 59 } else if (!condition.equals(other.condition)) 60 return false; 61 if (text == null) { 62 if (other.text != null) 63 return false; 64 } else if (!text.equals(other.text)) 65 return false; 66 return true; 67 } 39 68 } -
trunk/src/org/openstreetmap/josm/tools/template_engine/StaticText.java
r13003 r14093 33 33 return staticText; 34 34 } 35 36 @Override 37 public int hashCode() { 38 return 31 + ((staticText == null) ? 0 : staticText.hashCode()); 39 } 40 41 @Override 42 public boolean equals(Object obj) { 43 if (this == obj) 44 return true; 45 if (obj == null || getClass() != obj.getClass()) 46 return false; 47 StaticText other = (StaticText) obj; 48 if (staticText == null) { 49 if (other.staticText != null) 50 return false; 51 } else if (!staticText.equals(other.staticText)) 52 return false; 53 return true; 54 } 35 55 } -
trunk/src/org/openstreetmap/josm/tools/template_engine/Variable.java
r13004 r14093 80 80 return special; 81 81 } 82 83 @Override 84 public int hashCode() { 85 final int prime = 31; 86 int result = 1; 87 result = prime * result + (special ? 1231 : 1237); 88 result = prime * result + ((variableName == null) ? 0 : variableName.hashCode()); 89 return result; 90 } 91 92 @Override 93 public boolean equals(Object obj) { 94 if (this == obj) 95 return true; 96 if (obj == null || getClass() != obj.getClass()) 97 return false; 98 Variable other = (Variable) obj; 99 if (special != other.special) 100 return false; 101 if (variableName == null) { 102 if (other.variableName != null) 103 return false; 104 } else if (!variableName.equals(other.variableName)) 105 return false; 106 return true; 107 } 82 108 } -
trunk/test/performance/org/openstreetmap/josm/data/osm/KeyValuePerformanceTest.java
r13175 r14093 12 12 import java.util.Random; 13 13 14 import org.apache.commons.lang .RandomStringUtils;14 import org.apache.commons.lang3.RandomStringUtils; 15 15 import org.junit.Before; 16 16 import org.junit.Rule; -
trunk/test/performance/org/openstreetmap/josm/data/osm/OsmDataGenerator.java
r11324 r14093 7 7 import java.util.Random; 8 8 9 import org.apache.commons.lang .RandomStringUtils;9 import org.apache.commons.lang3.RandomStringUtils; 10 10 import org.openstreetmap.josm.data.coor.EastNorth; 11 11 import org.openstreetmap.josm.gui.layer.OsmDataLayer; -
trunk/test/unit/org/openstreetmap/josm/plugins/PluginHandlerTestIT.java
r13993 r14093 16 16 import java.util.stream.Collectors; 17 17 18 import org.apache.commons.collections.MapUtils; 19 import org.apache.commons.lang.exception.ExceptionUtils; 18 import org.apache.commons.lang3.exception.ExceptionUtils; 20 19 import org.junit.Rule; 21 20 import org.junit.Test; … … 72 71 } 73 72 74 MapUtils.debugPrint(System.out, null,invalidManifestEntries);75 MapUtils.debugPrint(System.out, null,loadingExceptions);76 MapUtils.debugPrint(System.out, null,layerExceptions);73 debugPrint(invalidManifestEntries); 74 debugPrint(loadingExceptions); 75 debugPrint(layerExceptions); 77 76 String msg = Arrays.toString(invalidManifestEntries.entrySet().toArray()) + '\n' + 78 77 Arrays.toString(loadingExceptions.entrySet().toArray()) + '\n' + 79 78 Arrays.toString(layerExceptions.entrySet().toArray()); 80 79 assertTrue(msg, invalidManifestEntries.isEmpty() && loadingExceptions.isEmpty() && layerExceptions.isEmpty()); 80 } 81 82 private static void debugPrint(Map<String, ?> invalidManifestEntries) { 83 System.out.println(invalidManifestEntries.entrySet() 84 .stream() 85 .map(e -> e.getKey() + "=\"" + e.getValue() + "\"") 86 .collect(Collectors.joining(", "))); 81 87 } 82 88 -
trunk/test/unit/org/openstreetmap/josm/tools/template_engine/TemplateParserTest.java
r13004 r14093 1 1 // License: GPL. For details, see LICENSE file. 2 2 package org.openstreetmap.josm.tools.template_engine; 3 4 import static org.junit.Assert.assertEquals; 3 5 4 6 import java.util.Arrays; … … 16 18 import org.openstreetmap.josm.data.osm.search.SearchParseError; 17 19 import org.openstreetmap.josm.testutils.DatasetFactory; 18 import org.unitils.reflectionassert.ReflectionAssert;19 20 20 21 /** … … 38 39 public void testEmpty() throws ParseError { 39 40 TemplateParser parser = new TemplateParser(""); 40 ReflectionAssert.assertReflectionEquals(new StaticText(""), parser.parse());41 assertEquals(new StaticText(""), parser.parse()); 41 42 } 42 43 … … 48 49 public void testVariable() throws ParseError { 49 50 TemplateParser parser = new TemplateParser("abc{var}\\{ef\\$\\{g"); 50 ReflectionAssert.assertReflectionEquals(CompoundTemplateEntry.fromArray(new StaticText("abc"),51 assertEquals(CompoundTemplateEntry.fromArray(new StaticText("abc"), 51 52 new Variable("var"), new StaticText("{ef${g")), parser.parse()); 52 53 } … … 63 64 new Variable("name"), 64 65 new Variable("desc"))); 65 ReflectionAssert.assertReflectionEquals(condition, parser.parse());66 assertEquals(condition, parser.parse()); 66 67 } 67 68 … … 77 78 new Variable("name"), 78 79 new Variable("desc"))); 79 ReflectionAssert.assertReflectionEquals(condition, parser.parse());80 assertEquals(condition, parser.parse()); 80 81 } 81 82 … … 96 97 new SearchExpressionCondition(compile("admin_level = 4"), new StaticText("NUTS 2")), 97 98 new Variable("admin_level"))); 98 ReflectionAssert.assertReflectionEquals(condition, parser.parse()); 99 TemplateEntry parse = parser.parse(); 100 assertEquals(condition, parse); 99 101 } 100 102
Note:
See TracChangeset
for help on using the changeset viewer.