Changeset 8870 in josm for trunk/src/org/openstreetmap/josm/data
- Timestamp:
- 2015-10-13T23:50:14+02:00 (9 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/data
- Files:
-
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/AutosaveTask.java
r8846 r8870 118 118 } 119 119 120 private String getFileName(String layerName, int index) { 120 private static String getFileName(String layerName, int index) { 121 121 String result = layerName; 122 122 for (char illegalCharacter : ILLEGAL_CHARACTERS) { -
trunk/src/org/openstreetmap/josm/data/CustomConfigurator.java
r8846 r8870 614 614 } 615 615 616 private void processPluginInstallElement(Element elem) { 616 private static void processPluginInstallElement(Element elem) { 617 617 String install = elem.getAttribute("install"); 618 618 String uninstall = elem.getAttribute("remove"); … … 739 739 } 740 740 741 private String normalizeDirName(String dir) { 741 private static String normalizeDirName(String dir) { 742 742 String s = dir.replace('\\', '/'); 743 743 if (s.endsWith("/")) s = s.substring(0, s.length()-1); -
trunk/src/org/openstreetmap/josm/data/Preferences.java
r8846 r8870 689 689 } 690 690 691 private void addPossibleResourceDir(Set<String> locations, String s) { 691 private static void addPossibleResourceDir(Set<String> locations, String s) { 692 692 if (s != null) { 693 693 if (!s.endsWith(File.separator)) { … … 867 867 } 868 868 869 private void setCorrectPermissions(File file) { 869 private static void setCorrectPermissions(File file) { 870 870 if (!file.setReadable(false, false) && Main.isDebugEnabled()) { 871 871 Main.debug(tr("Unable to set file non-readable {0}", file.getAbsolutePath())); … … 1337 1337 } 1338 1338 1339 private <T> Collection<Map<String, String>> serializeListOfStructs(Collection<T> l, Class<T> klass) { 1339 private static <T> Collection<Map<String, String>> serializeListOfStructs(Collection<T> l, Class<T> klass) { 1340 1340 if (l == null) 1341 1341 return null; -
trunk/src/org/openstreetmap/josm/data/imagery/ImageryLayerInfo.java
r8824 r8870 247 247 248 248 // some additional checks to respect extended URLs in preferences (legacy workaround) 249 private boolean isSimilar(String a, String b) { 249 private static boolean isSimilar(String a, String b) { 250 250 return Objects.equals(a, b) || (a != null && b != null && !a.isEmpty() && !b.isEmpty() && (a.contains(b) || b.contains(a))); 251 251 } -
trunk/src/org/openstreetmap/josm/data/osm/DataSet.java
r8855 r8870 969 969 } 970 970 971 private void deleteWay(Way way) { 971 private static void deleteWay(Way way) { 972 972 way.setNodes(null); 973 973 way.setDeleted(true); … … 1099 1099 } 1100 1100 1101 private void reindexRelation(Relation relation) { 1101 private static void reindexRelation(Relation relation) { 1102 1102 BBox before = relation.getBBox(); 1103 1103 relation.updatePosition(); -
trunk/src/org/openstreetmap/josm/data/osm/DataSetMerger.java
r8565 r8870 218 218 } 219 219 220 private void resetPrimitive(OsmPrimitive osm) { 220 private static void resetPrimitive(OsmPrimitive osm) { 221 221 if (osm instanceof Way) { 222 222 ((Way) osm).setNodes(null); -
trunk/src/org/openstreetmap/josm/data/osm/FilterMatcher.java
r8811 r8870 136 136 * when hidden is false, returns whether the primitive is disabled or hidden 137 137 */ 138 private boolean isFiltered(OsmPrimitive primitive, boolean hidden) { 138 private static boolean isFiltered(OsmPrimitive primitive, boolean hidden) { 139 139 return hidden ? primitive.isDisabledAndHidden() : primitive.isDisabled(); 140 140 } … … 147 147 * @return true, if at least one non-inverted filter applies to the primitive 148 148 */ 149 private boolean isFilterExplicit(OsmPrimitive primitive, boolean hidden) { 149 private static boolean isFilterExplicit(OsmPrimitive primitive, boolean hidden) { 150 150 return hidden ? primitive.getHiddenType() : primitive.getDisabledType(); 151 151 } … … 162 162 * (c) at least one of the parent ways is explicitly filtered 163 163 */ 164 private boolean allParentWaysFiltered(OsmPrimitive primitive, boolean hidden) { 164 private static boolean allParentWaysFiltered(OsmPrimitive primitive, boolean hidden) { 165 165 List<OsmPrimitive> refs = primitive.getReferrers(); 166 166 boolean isExplicit = false; … … 175 175 } 176 176 177 private boolean oneParentWayNotFiltered(OsmPrimitive primitive, boolean hidden) { 177 private static boolean oneParentWayNotFiltered(OsmPrimitive primitive, boolean hidden) { 178 178 List<OsmPrimitive> refs = primitive.getReferrers(); 179 179 for (OsmPrimitive p: refs) { … … 185 185 } 186 186 187 private boolean allParentMultipolygonsFiltered(OsmPrimitive primitive, boolean hidden) { 187 private static boolean allParentMultipolygonsFiltered(OsmPrimitive primitive, boolean hidden) { 188 188 boolean isExplicit = false; 189 189 for (Relation r : new SubclassFilteredCollection<OsmPrimitive, Relation>( … … 196 196 } 197 197 198 private boolean oneParentMultipolygonNotFiltered(OsmPrimitive primitive, boolean hidden) { 198 private static boolean oneParentMultipolygonNotFiltered(OsmPrimitive primitive, boolean hidden) { 199 199 for (Relation r : new SubclassFilteredCollection<OsmPrimitive, Relation>( 200 200 primitive.getReferrers(), OsmPrimitive.multipolygonPredicate)) { … … 205 205 } 206 206 207 private FilterType test(List<FilterInfo> filters, OsmPrimitive primitive, boolean hidden) { 207 private static FilterType test(List<FilterInfo> filters, OsmPrimitive primitive, boolean hidden) { 208 208 209 209 if (primitive.isIncomplete()) -
trunk/src/org/openstreetmap/josm/data/osm/NoteData.java
r8840 r8870 279 279 } 280 280 281 private User getCurrentUser() { 281 private static User getCurrentUser() { 282 282 JosmUserIdentityManager userMgr = JosmUserIdentityManager.getInstance(); 283 283 return User.createOsmUser(userMgr.getUserId(), userMgr.getUserName()); -
trunk/src/org/openstreetmap/josm/data/osm/Storage.java
r8855 r8870 266 266 * Additional mixing of hash 267 267 */ 268 private int rehash(int h) { 268 private static int rehash(int h) { 269 269 return 1103515245*h >> 2; 270 270 } -
trunk/src/org/openstreetmap/josm/data/osm/Way.java
r8846 r8870 81 81 * Prevent directly following identical nodes in ways. 82 82 */ 83 private List<Node> removeDouble(List<Node> nodes) { 83 private static List<Node> removeDouble(List<Node> nodes) { 84 84 Node last = null; 85 85 int count = nodes.size(); -
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRenderer.java
r8846 r8870 363 363 } 364 364 365 private Polygon buildPolygon(Point center, int radius, int sides, double rotation) { 365 private static Polygon buildPolygon(Point center, int radius, int sides, double rotation) { 366 366 Polygon polygon = new Polygon(); 367 367 for (int i = 0; i < sides; i++) { … … 1500 1500 } 1501 1501 1502 private double[] pointAt(double t, Polygon poly, double pathLength) { 1502 private static double[] pointAt(double t, Polygon poly, double pathLength) { 1503 1503 double totalLen = t * pathLength; 1504 1504 double curLen = 0; -
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/WireframeMapRenderer.java
r8855 r8870 276 276 } 277 277 278 private boolean isNodeTagged(Node n) { 278 private static boolean isNodeTagged(Node n) { 279 279 return n.isTagged() || n.isAnnotated(); 280 280 } -
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/relations/Multipolygon.java
r8512 r8870 77 77 } 78 78 79 private void setNormalized(Collection<String> literals, List<String> target) { 79 private static void setNormalized(Collection<String> literals, List<String> target) { 80 80 target.clear(); 81 81 for (String l: literals) { -
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/relations/MultipolygonCache.java
r8739 r8870 202 202 } 203 203 204 private void dispatchEvent(AbstractDatasetChangedEvent event, Relation r, Collection<Map<Relation, Multipolygon>> maps) { 204 private static void dispatchEvent(AbstractDatasetChangedEvent event, Relation r, Collection<Map<Relation, Multipolygon>> maps) { 205 205 for (Map<Relation, Multipolygon> map : maps) { 206 206 Multipolygon m = map.get(r); … … 217 217 } 218 218 219 private void removeMultipolygonFrom(Relation r, Collection<Map<Relation, Multipolygon>> maps) { 219 private static void removeMultipolygonFrom(Relation r, Collection<Map<Relation, Multipolygon>> maps) { 220 220 for (Map<Relation, Multipolygon> map : maps) { 221 221 map.remove(r); -
trunk/src/org/openstreetmap/josm/data/projection/datum/NTV2GridShiftFile.java
r8510 r8870 83 83 private NTV2SubGrid lastSubGrid; 84 84 85 private void readBytes(InputStream in, byte[] b) throws IOException { 85 private static void readBytes(InputStream in, byte[] b) throws IOException { 86 86 if (in.read(b) < b.length) { 87 87 Main.error("Failed to read expected amount of bytes ("+ b.length +") from stream"); … … 167 167 * @return an array of top level Sub Grids with lower level Sub Grids set. 168 168 */ 169 private NTV2SubGrid[] createSubGridTree(NTV2SubGrid[] subGrid) { 169 private static NTV2SubGrid[] createSubGridTree(NTV2SubGrid[] subGrid) { 170 170 int topLevelCount = 0; 171 171 Map<String, List<NTV2SubGrid>> subGridMap = new HashMap<>(); -
trunk/src/org/openstreetmap/josm/data/projection/datum/NTV2SubGrid.java
r8512 r8870 149 149 } 150 150 151 private void readBytes(InputStream in, byte[] b) throws IOException { 151 private static void readBytes(InputStream in, byte[] b) throws IOException { 152 152 if (in.read(b) < b.length) { 153 153 Main.error("Failed to read expected amount of bytes ("+ b.length +") from stream"); … … 209 209 * @return interpolated value 210 210 */ 211 private double interpolate(float a, float b, float c, float d, double x, double y) { 211 private static double interpolate(float a, float b, float c, float d, double x, double y) { 212 212 return a + (((double) b - (double) a) * x) + (((double) c - (double) a) * y) + 213 213 (((double) a + (double) d - b - c) * x * y); -
trunk/src/org/openstreetmap/josm/data/validation/OsmValidator.java
r8840 r8870 162 162 * Check if plugin directory exists (store ignored errors file) 163 163 */ 164 private void checkValidatorDir() { 164 private static void checkValidatorDir() { 165 165 try { 166 166 File pathDir = new File(getValidatorDir()); … … 173 173 } 174 174 175 private void loadIgnoredErrors() { 175 private static void loadIgnoredErrors() { 176 176 ignoredErrors.clear(); 177 177 if (Main.pref.getBoolean(ValidatorPreference.PREF_USE_IGNORE, true)) { -
trunk/src/org/openstreetmap/josm/data/validation/routines/DomainValidator.java
r8510 r8870 218 218 } 219 219 220 private String chompLeadingDot(String str) { 220 private static String chompLeadingDot(String str) { 221 221 if (str.startsWith(".")) { 222 222 return str.substring(1); -
trunk/src/org/openstreetmap/josm/data/validation/tests/MultipolygonTest.java
r8777 r8870 91 91 } 92 92 93 private GeneralPath createPath(List<Node> nodes) { 93 private static GeneralPath createPath(List<Node> nodes) { 94 94 GeneralPath result = new GeneralPath(); 95 95 result.moveTo((float) nodes.get(0).getCoor().lat(), (float) nodes.get(0).getCoor().lon()); … … 109 109 } 110 110 111 private Intersection getPolygonIntersection(GeneralPath outer, List<Node> inner) { 111 private static Intersection getPolygonIntersection(GeneralPath outer, List<Node> inner) { 112 112 boolean inside = false; 113 113 boolean outside = false; … … 292 292 } 293 293 294 private void addRelationIfNeeded(TestError error, Relation r) { 294 private static void addRelationIfNeeded(TestError error, Relation r) { 295 295 // Fix #8212 : if the error references only incomplete primitives, 296 296 // add multipolygon in order to let user select something and fix the error -
trunk/src/org/openstreetmap/josm/data/validation/tests/TagChecker.java
r8863 r8870 297 297 * @param s string to check 298 298 */ 299 private boolean containsLow(String s) { 299 private static boolean containsLow(String s) { 300 300 if (s == null) 301 301 return false; … … 454 454 } 455 455 456 private Map<String, String> getPossibleValues(Set<String> values) { 456 private static Map<String, String> getPossibleValues(Set<String> values) { 457 457 // generate a map with common typos 458 458 Map<String, String> map = new HashMap<>(); … … 666 666 public boolean valueBool; 667 667 668 private Pattern getPattern(String str) throws PatternSyntaxException { 668 private static Pattern getPattern(String str) throws PatternSyntaxException { 669 669 if (str.endsWith("/i")) 670 670 return Pattern.compile(str.substring(1, str.length()-2), Pattern.CASE_INSENSITIVE); -
trunk/src/org/openstreetmap/josm/data/validation/tests/WayConnectedToArea.java
r8510 r8870 84 84 } 85 85 86 private boolean isArea(OsmPrimitive p) { 86 private static boolean isArea(OsmPrimitive p) { 87 87 return (p.hasKey("landuse") || p.hasKey("natural")) 88 88 && ElemStyles.hasAreaElemStyle(p, false);
Note:
See TracChangeset
for help on using the changeset viewer.