Changeset 18877 in josm for trunk/src/org
- Timestamp:
- 2023-10-24T17:29:11+02:00 (13 months ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/notes/Note.java
r18479 r18877 12 12 import org.openstreetmap.josm.data.coor.LatLon; 13 13 14 import ja vax.annotation.Nullable;14 import jakarta.annotation.Nullable; 15 15 16 16 /** -
trunk/src/org/openstreetmap/josm/data/osm/pbf/Blob.java
r18698 r18877 7 7 import java.util.zip.InflaterInputStream; 8 8 9 import javax.annotation.Nonnull; 10 import javax.annotation.Nullable; 9 import org.apache.commons.compress.compressors.bzip2.BZip2CompressorInputStream; 11 10 12 import org.apache.commons.compress.compressors.bzip2.BZip2CompressorInputStream; 11 import jakarta.annotation.Nonnull; 12 import jakarta.annotation.Nullable; 13 13 14 14 /** -
trunk/src/org/openstreetmap/josm/data/osm/pbf/BlobHeader.java
r18702 r18877 2 2 package org.openstreetmap.josm.data.osm.pbf; 3 3 4 import ja vax.annotation.Nonnull;5 import ja vax.annotation.Nullable;4 import jakarta.annotation.Nonnull; 5 import jakarta.annotation.Nullable; 6 6 7 7 /** -
trunk/src/org/openstreetmap/josm/data/osm/pbf/HeaderBlock.java
r18697 r18877 2 2 package org.openstreetmap.josm.data.osm.pbf; 3 3 4 import javax.annotation.Nonnull; 5 import javax.annotation.Nullable; 4 import org.openstreetmap.josm.data.osm.BBox; 6 5 7 import org.openstreetmap.josm.data.osm.BBox; 6 import jakarta.annotation.Nonnull; 7 import jakarta.annotation.Nullable; 8 8 9 9 /** -
trunk/src/org/openstreetmap/josm/data/osm/pbf/Info.java
r18702 r18877 2 2 package org.openstreetmap.josm.data.osm.pbf; 3 3 4 import ja vax.annotation.Nullable;4 import jakarta.annotation.Nullable; 5 5 6 6 /** -
trunk/src/org/openstreetmap/josm/data/osm/search/SearchCompiler.java
r18852 r18877 27 27 import java.util.regex.PatternSyntaxException; 28 28 import java.util.stream.Collectors; 29 30 import javax.annotation.Nonnull;31 import javax.annotation.Nullable;32 29 33 30 import org.openstreetmap.josm.data.Bounds; … … 59 56 import org.openstreetmap.josm.tools.date.DateUtils; 60 57 58 import jakarta.annotation.Nonnull; 59 import jakarta.annotation.Nullable; 60 61 61 /** 62 62 * Implements a google-like search. … … 85 85 private final boolean caseSensitive; 86 86 private final boolean regexSearch; 87 private static final String rxErrorMsg = marktr("The regex \"{0}\" had a parse error at offset {1}, full error:\n\n{2}"); 88 private static final String rxErrorMsgNoPos = marktr("The regex \"{0}\" had a parse error, full error:\n\n{1}"); 87 private static final String REGEX_ERROR_MESSAGE = marktr("The regex \"{0}\" had a parse error at offset {1}, full error:\n\n{2}"); 88 private static final String REGEX_ERROR_MESSAGE_NO_POSITION = marktr("The regex \"{0}\" had a parse error, full error:\n\n{1}"); 89 private static final String RANGE_OF_NUMBERS_EXPECTED = marktr("Range of numbers expected"); 89 90 private final PushbackTokenizer tokenizer; 90 91 private static final Map<String, SimpleMatchFactory> simpleMatchFactoryMap = new HashMap<>(); 91 92 private static final Map<String, UnaryMatchFactory> unaryMatchFactoryMap = new HashMap<>(); 92 93 private static final Map<String, BinaryMatchFactory> binaryMatchFactoryMap = new HashMap<>(); 94 95 // Common literals 96 private static final String AREA_SIZE = "areasize"; 97 private static final String CHANGESET = "changeset"; 98 private static final String CLOSED = "closed"; 99 private static final String DELETED = "deleted"; 100 private static final String INCOMPLETE = "incomplete"; 101 private static final String IN_DOWNLOADED_AREA = "indownloadedarea"; 102 private static final String ALL_IN_DOWNLOADED_AREA = "all" + IN_DOWNLOADED_AREA; 103 private static final String MEMBERS = "members"; 104 private static final String MODIFIED = "modified"; 105 private static final String NODES = "nodes"; 106 private static final String SELECTED = "selected"; 107 private static final String TIMESTAMP = "timestamp"; 108 private static final String UNTAGGED = "untagged"; 109 private static final String VERSION = "version"; 110 private static final String WAYS = "ways"; 111 private static final String WAY_LENGTH = "waylength"; 93 112 94 113 static { … … 134 153 */ 135 154 public static class CoreSimpleMatchFactory implements SimpleMatchFactory { 136 private final Collection<String> keywords = Arrays.asList("id", "version", "type", "user", "role",137 "changeset", "nodes", "ways", "members", "tags", "areasize", "waylength", "modified", "deleted", "selected",138 "incomplete", "untagged", "closed", "new", "indownloadedarea",139 "allindownloadedarea", "timestamp", "nth", "nth%", "hasRole", "preset");155 private final Collection<String> keywords = Arrays.asList("id", VERSION, "type", "user", "role", 156 CHANGESET, NODES, WAYS, MEMBERS, "tags", AREA_SIZE, WAY_LENGTH, MODIFIED, DELETED, SELECTED, 157 INCOMPLETE, UNTAGGED, CLOSED, "new", IN_DOWNLOADED_AREA, 158 ALL_IN_DOWNLOADED_AREA, TIMESTAMP, "nth", "nth%", "hasRole", "preset"); 140 159 141 160 @Override 142 161 public Match get(String keyword, boolean caseSensitive, boolean regexSearch, PushbackTokenizer tokenizer) throws SearchParseError { 143 162 switch(keyword) { 144 case "modified":163 case MODIFIED: 145 164 return new Modified(); 146 case "deleted":165 case DELETED: 147 166 return new Deleted(); 148 case "selected":167 case SELECTED: 149 168 return new Selected(); 150 case "incomplete":169 case INCOMPLETE: 151 170 return new Incomplete(); 152 case "untagged":171 case UNTAGGED: 153 172 return new Untagged(); 154 case "closed":173 case CLOSED: 155 174 return new Closed(); 156 175 case "new": 157 176 return new New(); 158 case "indownloadedarea":177 case IN_DOWNLOADED_AREA: 159 178 return new InDataSourceArea(false); 160 case "allindownloadedarea":179 case ALL_IN_DOWNLOADED_AREA: 161 180 return new InDataSourceArea(true); 162 181 default: … … 174 193 case "id": 175 194 return new Id(tokenizer); 176 case "version":195 case VERSION: 177 196 return new Version(tokenizer); 178 197 case "type": … … 184 203 case "role": 185 204 return new RoleMatch(tokenizer.readTextOrNumber()); 186 case "changeset":205 case CHANGESET: 187 206 return new ChangesetId(tokenizer); 188 case "nodes":207 case NODES: 189 208 return new NodeCountRange(tokenizer); 190 case "ways":209 case WAYS: 191 210 return new WayCountRange(tokenizer); 192 case "members":211 case MEMBERS: 193 212 return new MemberCountRange(tokenizer); 194 213 case "tags": 195 214 return new TagCountRange(tokenizer); 196 case "areasize":215 case AREA_SIZE: 197 216 return new AreaSize(tokenizer); 198 case "waylength":217 case WAY_LENGTH: 199 218 return new WayLength(tokenizer); 200 219 case "nth": … … 204 223 case "hasRole": 205 224 return new HasRole(tokenizer); 206 case "timestamp":225 case TIMESTAMP: 207 226 // add leading/trailing space in order to get expected split (e.g. "a--" => {"a", ""}) 208 227 String rangeS = ' ' + tokenizer.readTextOrNumber() + ' '; … … 370 389 return Pattern.compile(regex, flags); 371 390 } catch (PatternSyntaxException e) { 372 throw new SearchParseError(tr( rxErrorMsg, e.getPattern(), e.getIndex(), e.getMessage()), e);391 throw new SearchParseError(tr(REGEX_ERROR_MESSAGE, e.getPattern(), e.getIndex(), e.getMessage()), e); 373 392 } catch (IllegalArgumentException | StringIndexOutOfBoundsException e) { 374 393 // StringIndexOutOfBoundsException caught because of https://bugs.openjdk.java.net/browse/JI-9044959 375 394 // See #13870: To remove after we switch to a version of Java which resolves this bug 376 throw new SearchParseError(tr( rxErrorMsgNoPos, regex, e.getMessage()), e);395 throw new SearchParseError(tr(REGEX_ERROR_MESSAGE_NO_POSITION, regex, e.getMessage()), e); 377 396 } 378 397 } … … 707 726 @Override 708 727 protected String getString() { 709 return "changeset";728 return CHANGESET; 710 729 } 711 730 } … … 730 749 @Override 731 750 protected String getString() { 732 return "version";751 return VERSION; 733 752 } 734 753 } … … 783 802 private String getMv(Tagged osm) { 784 803 String mv; 785 if ( "timestamp".equals(key) && osm instanceof OsmPrimitive) {804 if (TIMESTAMP.equals(key) && osm instanceof OsmPrimitive) { 786 805 mv = ((OsmPrimitive) osm).getInstant().toString(); 787 806 } else { … … 1429 1448 1430 1449 NodeCountRange(PushbackTokenizer tokenizer) throws SearchParseError { 1431 this(tokenizer.readRange(tr( "Range of numbers expected")));1450 this(tokenizer.readRange(tr(RANGE_OF_NUMBERS_EXPECTED))); 1432 1451 } 1433 1452 … … 1445 1464 @Override 1446 1465 protected String getString() { 1447 return "nodes";1466 return NODES; 1448 1467 } 1449 1468 } … … 1458 1477 1459 1478 WayCountRange(PushbackTokenizer tokenizer) throws SearchParseError { 1460 this(tokenizer.readRange(tr( "Range of numbers expected")));1479 this(tokenizer.readRange(tr(RANGE_OF_NUMBERS_EXPECTED))); 1461 1480 } 1462 1481 … … 1487 1506 1488 1507 MemberCountRange(PushbackTokenizer tokenizer) throws SearchParseError { 1489 this(tokenizer.readRange(tr( "Range of numbers expected")));1508 this(tokenizer.readRange(tr(RANGE_OF_NUMBERS_EXPECTED))); 1490 1509 } 1491 1510 … … 1502 1521 @Override 1503 1522 protected String getString() { 1504 return "members";1523 return MEMBERS; 1505 1524 } 1506 1525 } … … 1515 1534 1516 1535 TagCountRange(PushbackTokenizer tokenizer) throws SearchParseError { 1517 this(tokenizer.readRange(tr( "Range of numbers expected")));1536 this(tokenizer.readRange(tr(RANGE_OF_NUMBERS_EXPECTED))); 1518 1537 } 1519 1538 … … 1566 1585 @Override 1567 1586 protected String getString() { 1568 return "timestamp";1587 return TIMESTAMP; 1569 1588 } 1570 1589 } … … 1627 1646 @Override 1628 1647 public String toString() { 1629 return "modified";1648 return MODIFIED; 1630 1649 } 1631 1650 } … … 1642 1661 @Override 1643 1662 public String toString() { 1644 return "deleted";1663 return DELETED; 1645 1664 } 1646 1665 } … … 1657 1676 @Override 1658 1677 public String toString() { 1659 return "selected";1678 return SELECTED; 1660 1679 } 1661 1680 } … … 1674 1693 @Override 1675 1694 public String toString() { 1676 return "incomplete";1695 return INCOMPLETE; 1677 1696 } 1678 1697 } … … 1691 1710 @Override 1692 1711 public String toString() { 1693 return "untagged";1712 return UNTAGGED; 1694 1713 } 1695 1714 } … … 1706 1725 @Override 1707 1726 public String toString() { 1708 return "closed";1727 return CLOSED; 1709 1728 } 1710 1729 } … … 1767 1786 1768 1787 AreaSize(PushbackTokenizer tokenizer) throws SearchParseError { 1769 this(tokenizer.readRange(tr( "Range of numbers expected")));1788 this(tokenizer.readRange(tr(RANGE_OF_NUMBERS_EXPECTED))); 1770 1789 } 1771 1790 … … 1778 1797 @Override 1779 1798 protected String getString() { 1780 return "areasize";1799 return AREA_SIZE; 1781 1800 } 1782 1801 } … … 1792 1811 1793 1812 WayLength(PushbackTokenizer tokenizer) throws SearchParseError { 1794 this(tokenizer.readRange(tr( "Range of numbers expected")));1813 this(tokenizer.readRange(tr(RANGE_OF_NUMBERS_EXPECTED))); 1795 1814 } 1796 1815 … … 1805 1824 @Override 1806 1825 protected String getString() { 1807 return "waylength";1826 return WAY_LENGTH; 1808 1827 } 1809 1828 } … … 1878 1897 @Override 1879 1898 public String toString() { 1880 return all ? "allindownloadedarea" : "indownloadedarea";1899 return all ? ALL_IN_DOWNLOADED_AREA : IN_DOWNLOADED_AREA; 1881 1900 } 1882 1901 } -
trunk/src/org/openstreetmap/josm/gui/layer/geoimage/viewers/projections/Equirectangular.java
r18604 r18877 13 13 import java.util.Set; 14 14 15 import javax.annotation.Nonnull;16 import javax.annotation.Nullable;17 18 15 import org.openstreetmap.josm.data.imagery.street_level.Projections; 19 16 import org.openstreetmap.josm.gui.layer.geoimage.ImageDisplay; … … 21 18 import org.openstreetmap.josm.gui.util.imagery.CameraPlane; 22 19 import org.openstreetmap.josm.gui.util.imagery.Vector3D; 20 21 import jakarta.annotation.Nonnull; 22 import jakarta.annotation.Nullable; 23 23 24 24 /** -
trunk/src/org/openstreetmap/josm/gui/util/imagery/CameraPlane.java
r18398 r18877 11 11 import java.awt.image.DataBufferInt; 12 12 import java.util.stream.IntStream; 13 import javax.annotation.Nullable; 13 14 import org.openstreetmap.josm.tools.Logging; 15 16 import jakarta.annotation.Nullable; 14 17 15 18 /** … … 129 132 res = rotate(vectors[x][y]); 130 133 } catch (Exception e) { 134 Logging.trace(e); 131 135 res = Vector3D.DEFAULT_VECTOR_3D; 132 136 } … … 150 154 * @param p Point within current plane. 151 155 */ 152 public void setRotation(final Point p) {156 public synchronized void setRotation(final Point p) { 153 157 setRotation(getVector3D(p)); 154 158 } … … 181 185 * @param vec vector pointing new view position. 182 186 */ 183 public void setRotation(Vector3D vec) {187 public synchronized void setRotation(Vector3D vec) { 184 188 setRotation(vec.getPolarAngle(), vec.getAzimuthalAngle()); 185 189 } -
trunk/src/org/openstreetmap/josm/io/OsmPbfReader.java
r18826 r18877 16 16 import java.util.Set; 17 17 18 import ja vax.annotation.Nonnull;19 import ja vax.annotation.Nullable;18 import jakarta.annotation.Nonnull; 19 import jakarta.annotation.Nullable; 20 20 21 21 import org.apache.commons.compress.utils.CountingInputStream; -
trunk/src/org/openstreetmap/josm/io/auth/CredentialsAgent.java
r18650 r18877 6 6 import java.net.PasswordAuthentication; 7 7 8 import javax.annotation.Nullable;9 10 8 import org.openstreetmap.josm.data.oauth.IOAuthToken; 11 9 import org.openstreetmap.josm.data.oauth.OAuthToken; 10 11 import jakarta.annotation.Nullable; 12 12 13 13 /**
Note:
See TracChangeset
for help on using the changeset viewer.