Changeset 4874 in josm for trunk/src/org/openstreetmap/josm/data
- Timestamp:
- 26.01.2012 21:52:34 (4 months ago)
- Location:
- trunk/src/org/openstreetmap/josm/data
- Files:
-
- 7 edited
-
APIDataSet.java (modified) (4 diffs)
-
ServerSidePreferences.java (modified) (8 diffs)
-
validation/tests/DeprecatedTags.java (modified) (5 diffs)
-
validation/tests/DuplicateNode.java (modified) (1 diff)
-
validation/tests/DuplicateRelation.java (modified) (1 diff)
-
validation/tests/DuplicateWay.java (modified) (2 diffs)
-
validation/tests/RelationChecker.java (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/APIDataSet.java
r4534 r4874 73 73 OsmPrimitiveComparator c = new OsmPrimitiveComparator(); 74 74 c.relationsFirst = true; 75 Collections.sort(toDelete, c); 76 Collections.sort(toAdd, c); 77 Collections.sort(toUpdate, c); 75 Collections.sort(toDelete, c); 76 Collections.sort(toAdd, c); 77 Collections.sort(toUpdate, c); 78 78 } 79 79 … … 154 154 OsmPrimitiveComparator c = new OsmPrimitiveComparator(); 155 155 c.relationsFirst = true; 156 Collections.sort(toDelete, c); 157 Collections.sort(toAdd, c); 158 Collections.sort(toUpdate, c); 156 Collections.sort(toDelete, c); 157 Collections.sort(toAdd, c); 158 Collections.sort(toUpdate, c); 159 159 } 160 160 … … 278 278 * 279 279 */ 280 private class RelationUploadDependencyGraph {280 private static class RelationUploadDependencyGraph { 281 281 private HashMap<Relation, Set<Relation>> children; 282 282 private Collection<Relation> relations; … … 353 353 } 354 354 } 355 );355 ); 356 356 return ret; 357 357 } -
trunk/src/org/openstreetmap/josm/data/ServerSidePreferences.java
r4612 r4874 15 15 import java.net.URL; 16 16 import java.net.URLConnection; 17 import java.util.Collection;18 import java.util.Collections;19 import java.util.LinkedList;20 import java.util.StringTokenizer;21 import java.util.Map.Entry;22 17 23 18 import javax.swing.JOptionPane; … … 26 21 import org.openstreetmap.josm.Main; 27 22 import org.openstreetmap.josm.io.OsmConnection; 28 import org.openstreetmap.josm.io.OsmTransferException;29 23 import org.openstreetmap.josm.tools.Base64; 30 24 … … 36 30 */ 37 31 public class ServerSidePreferences extends Preferences { 38 public class MissingPassword extends Exception{32 public static class MissingPassword extends Exception{ 39 33 public String realm; 40 34 public MissingPassword(String r) { … … 56 50 String username = get("applet.username"); 57 51 String password = get("applet.password"); 58 if(password.isEmpty() && username.isEmpty()) 52 if(password.isEmpty() && username.isEmpty()) { 59 53 con.addRequestProperty("Authorization", "Basic "+Base64.encode(username+":"+password)); 54 } 60 55 con.connect(); 61 56 if(username.isEmpty() && con instanceof HttpURLConnection 62 && ((HttpURLConnection) con).getResponseCode()63 == HttpURLConnection.HTTP_UNAUTHORIZED) {57 && ((HttpURLConnection) con).getResponseCode() 58 == HttpURLConnection.HTTP_UNAUTHORIZED) { 64 59 String t = ((HttpURLConnection) con).getHeaderField("WWW-Authenticate"); 65 60 t = t.replace("Basic realm=\"","").replace("\"",""); … … 88 83 String username = get("applet.username"); 89 84 String password = get("applet.password"); 90 if(password.isEmpty() && username.isEmpty()) 85 if(password.isEmpty() && username.isEmpty()) { 91 86 con.addRequestProperty("Authorization", "Basic "+Base64.encode(username+":"+password)); 87 } 92 88 con.setRequestMethod("POST"); 93 89 con.setDoOutput(true); … … 103 99 tr("Information"), 104 100 JOptionPane.INFORMATION_MESSAGE 105 );101 ); 106 102 } catch (Exception e) { 107 103 e.printStackTrace(); … … 111 107 tr("Error"), 112 108 JOptionPane.ERROR_MESSAGE 113 );109 ); 114 110 } 115 111 } … … 127 123 tr("Error"), 128 124 JOptionPane.ERROR_MESSAGE 129 );125 ); 130 126 } 131 127 this.connection = connection; -
trunk/src/org/openstreetmap/josm/data/validation/tests/DeprecatedTags.java
r4806 r4874 1 1 package org.openstreetmap.josm.data.validation.tests; 2 2 3 import org.openstreetmap.josm.data.osm.Node;4 import org.openstreetmap.josm.data.osm.Relation;5 import org.openstreetmap.josm.data.osm.Way;6 3 import static org.openstreetmap.josm.tools.I18n.tr; 7 4 … … 9 6 import java.util.LinkedList; 10 7 import java.util.List; 8 11 9 import org.openstreetmap.josm.command.ChangePropertyCommand; 12 10 import org.openstreetmap.josm.command.Command; 13 11 import org.openstreetmap.josm.command.SequenceCommand; 12 import org.openstreetmap.josm.data.osm.Node; 14 13 import org.openstreetmap.josm.data.osm.OsmPrimitive; 14 import org.openstreetmap.josm.data.osm.Relation; 15 15 import org.openstreetmap.josm.data.osm.Tag; 16 import org.openstreetmap.josm.data.osm.Way; 16 17 import org.openstreetmap.josm.data.validation.Severity; 17 18 import org.openstreetmap.josm.data.validation.Test; … … 97 98 } 98 99 99 private class DeprecationCheck {100 private static class DeprecationCheck { 100 101 101 102 int code; … … 148 149 String key = tag.getKey(); 149 150 String value = tag.getValue(); 150 if (value.isEmpty() && !p.hasKey(key)) {151 if (value.isEmpty() && !p.hasKey(key)) 151 152 return false; 152 } 153 if (!value.isEmpty() && !value.equals(p.get(key))) { 153 if (!value.isEmpty() && !value.equals(p.get(key))) 154 154 return false; 155 }156 155 } 157 156 return true; … … 167 166 168 167 String getDescription() { 169 if (alternatives.isEmpty()) {168 if (alternatives.isEmpty()) 170 169 return tr("{0} is deprecated", Utils.join(", ", test)); 171 } else {170 else 172 171 return tr("{0} is deprecated, use {1} instead", Utils.join(", ", test), Utils.join(tr(" or "), alternatives)); 173 }174 172 } 175 173 } -
trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateNode.java
r4869 r4874 39 39 public class DuplicateNode extends Test { 40 40 41 private class NodeHash implements Hash<Object, Object> {41 private static class NodeHash implements Hash<Object, Object> { 42 42 43 43 double precision = Main.pref.getDouble("validator.duplicatenodes.precision", 0.); -
trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateRelation.java
r4869 r4874 34 34 { 35 35 36 public class RelMember {36 public static class RelMember { 37 37 private String role; 38 38 private OsmPrimitiveType type; -
trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateWay.java
r4869 r4874 34 34 { 35 35 36 private class WayPair {36 private static class WayPair { 37 37 public List<LatLon> coor; 38 38 public Map<String, String> keys; … … 56 56 } 57 57 58 private class WayPairNoTags {58 private static class WayPairNoTags { 59 59 public List<LatLon> coor; 60 60 public WayPairNoTags(List<LatLon> _coor) { -
trunk/src/org/openstreetmap/josm/data/validation/tests/RelationChecker.java
r4869 r4874 70 70 } 71 71 72 public class RoleInfo {72 public static class RoleInfo { 73 73 int total = 0; 74 74 Collection<Node> nodes = new LinkedList<Node>();
Note: See TracChangeset
for help on using the changeset viewer.
