Changeset 10308 in josm for trunk/src/org
- Timestamp:
- 2016-06-01T23:17:40+02:00 (8 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 57 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/AlignInCircleAction.java
r8870 r10308 247 247 int nodeCount = nodes.size(); 248 248 // Search first fixed node 249 int startPosition = 0;249 int startPosition; 250 250 for (startPosition = 0; startPosition < nodeCount; startPosition++) { 251 251 if (fixNodes.contains(nodes.get(startPosition % nodeCount))) -
trunk/src/org/openstreetmap/josm/actions/AlignInLineAction.java
r9087 r10308 173 173 174 174 try { 175 Command cmd = null;175 Command cmd; 176 176 // Decide what to align based on selection: 177 177 … … 182 182 // Only 1 node selected -> align this node relative to referers way 183 183 Node selectedNode = selectedNodes.get(0); 184 List<Way> involvedWays = null;184 List<Way> involvedWays; 185 185 if (selectedWays.isEmpty()) 186 186 // No selected way, all way containing this node are used -
trunk/src/org/openstreetmap/josm/actions/JoinAreasAction.java
r10174 r10308 775 775 * @param isInner - if true, reverts the direction (for multipolygon islands) 776 776 * @return list of parts, marked with the inside orientation. 777 * @throws IllegalArgumentException if parts is empty 777 * @throws IllegalArgumentException if parts is empty or not circular 778 778 */ 779 779 private static List<WayInPolygon> markWayInsideSide(List<Way> parts, boolean isInner) { … … 785 785 786 786 if (!parts.get(pos).lastNode().equals(parts.get((pos + 1) % parts.size()).firstNode())) 787 throw new RuntimeException("Way not circular");787 throw new IllegalArgumentException("Way not circular"); 788 788 789 789 nextWayMap.put(parts.get(pos), parts.get((pos + 1) % parts.size())); … … 818 818 819 819 if (topNode.equals(topWay.firstNode()) || topNode.equals(topWay.lastNode())) { 820 Node headNode = null; // the node at junction 821 Node prevNode = null; // last node from previous path 822 wayClockwise = false; 820 Node headNode; // the node at junction 821 Node prevNode; // last node from previous path 823 822 824 823 //node is in split point - find the outermost way from this point -
trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmChangeTask.java
r10001 r10308 149 149 HistoryOsmPrimitive hp = history.getByDate(date); 150 150 if (hp != null) { 151 PrimitiveData data = null;151 PrimitiveData data; 152 152 153 153 switch (p.getType()) { -
trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java
r10303 r10308 398 398 399 399 boolean newNode = false; 400 Node n = null; 401 402 n = Main.map.mapView.getNearestNode(mousePos, OsmPrimitive.isSelectablePredicate); 400 Node n = Main.map.mapView.getNearestNode(mousePos, OsmPrimitive.isSelectablePredicate); 403 401 if (ctrl) { 404 402 Iterator<Way> it = getCurrentDataSet().getSelectedWays().iterator(); -
trunk/src/org/openstreetmap/josm/actions/mapmode/ExtrudeAction.java
r10115 r10308 684 684 wnew.addNode(insertionPoint, n2New); 685 685 wayWasModified = true; 686 insertionPoint++;687 686 cmds.add(new AddCommand(n2New)); 688 687 changedNodes.add(n2New); -
trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java
r10179 r10308 1196 1196 Pair<Node, Node> vnp = null, wnp = new Pair<>(null, null); 1197 1197 1198 Way w = null;1199 1198 for (WaySegment ws : mv.getNearestWaySegments(p, mv.isSelectablePredicate)) { 1200 w = ws.way;1199 Way w = ws.way; 1201 1200 1202 1201 wnp.a = w.getNode(ws.lowerIndex); -
trunk/src/org/openstreetmap/josm/actions/search/SearchCompiler.java
r10300 r10308 680 680 } 681 681 } else { 682 String mv = null;682 String mv; 683 683 684 684 if ("timestamp".equals(key) && osm instanceof OsmPrimitive) { -
trunk/src/org/openstreetmap/josm/command/ChangePropertyCommand.java
r10216 r10308 154 154 if (objects.size() == 1 && tags.size() == 1) { 155 155 OsmPrimitive primitive = objects.get(0); 156 String msg = "";156 String msg; 157 157 Map.Entry<String, String> entry = tags.entrySet().iterator().next(); 158 158 if (entry.getValue() == null) { -
trunk/src/org/openstreetmap/josm/corrector/TagCorrector.java
r10125 r10308 146 146 147 147 // create the clone 148 OsmPrimitive clone = null;148 OsmPrimitive clone; 149 149 if (primitive instanceof Way) { 150 150 clone = new Way((Way) primitive); -
trunk/src/org/openstreetmap/josm/data/cache/JCSCachedTileLoaderJob.java
r10212 r10308 256 256 257 257 private void finishLoading(LoadResult result) { 258 Set<ICachedLoaderListener> listeners = null;258 Set<ICachedLoaderListener> listeners; 259 259 synchronized (inProgress) { 260 260 listeners = inProgress.remove(getUrlNoException().toString()); -
trunk/src/org/openstreetmap/josm/data/osm/DataSetMerger.java
r9961 r10308 111 111 // the target dataset. Create a clone and add it to the target dataset. 112 112 // 113 OsmPrimitive target = null;113 OsmPrimitive target; 114 114 switch(source.getType()) { 115 115 case NODE: target = source.isNew() ? new Node() : new Node(source.getId()); break; -
trunk/src/org/openstreetmap/josm/data/osm/FilterWorker.java
r9665 r10308 24 24 * Apply the filters to the primitives of the data set. 25 25 * 26 * @param all the collection of primitives for that the filter state should 27 * be updated 26 * @param all the collection of primitives for that the filter state should be updated 28 27 * @param filterMatcher the FilterMatcher 29 28 * @return true, if the filter state (normal / disabled / hidden) … … 31 30 */ 32 31 public static boolean executeFilters(Collection<OsmPrimitive> all, FilterMatcher filterMatcher) { 33 boolean changed = false;32 boolean changed; 34 33 // first relations, then ways and nodes last; this is required to resolve dependencies 35 34 changed = doExecuteFilters(Utils.filter(all, OsmPrimitive.relationPredicate), filterMatcher); -
trunk/src/org/openstreetmap/josm/data/osm/event/DatasetEventManager.java
r10043 r10308 36 36 DataSet dataSet = null; 37 37 AbstractDatasetChangedEvent consolidatedEvent = null; 38 AbstractDatasetChangedEvent event = null;38 AbstractDatasetChangedEvent event; 39 39 40 40 while ((event = eventsInEDT.poll()) != null) { -
trunk/src/org/openstreetmap/josm/data/projection/datum/NTV2Util.java
r9981 r10308 72 72 */ 73 73 public static float getFloat(byte[] b, boolean bigEndian) { 74 int i = 0;74 int i; 75 75 if (bigEndian) { 76 76 i = getIntBE(b, 0); … … 89 89 */ 90 90 public static double getDouble(byte[] b, boolean bigEndian) { 91 int i = 0;92 int j = 0;91 int i; 92 int j; 93 93 if (bigEndian) { 94 94 i = getIntBE(b, 0); … … 98 98 j = getIntLE(b, 0); 99 99 } 100 long l = ((long) i << 32) | 101 (j & 0x00000000FFFFFFFFL); 100 long l = ((long) i << 32) | (j & 0x00000000FFFFFFFFL); 102 101 return Double.longBitsToDouble(l); 103 102 } -
trunk/src/org/openstreetmap/josm/data/projection/proj/SwissObliqueMercator.java
r10001 r10308 102 102 double lambda = l / alpha; 103 103 double phi = b; 104 double s = 0;105 104 106 105 double prevPhi = -1000; … … 111 110 throw new RuntimeException("Two many iterations"); 112 111 prevPhi = phi; 113 s = 1 / alpha * (log(tan(PI / 4 + b / 2)) - k) + ellps.e112 double s = 1 / alpha * (log(tan(PI / 4 + b / 2)) - k) + ellps.e 114 113 * log(tan(PI / 4 + asin(ellps.e * sin(phi)) / 2)); 115 114 phi = 2 * atan(exp(s)) - PI / 2; -
trunk/src/org/openstreetmap/josm/data/validation/tests/RelationChecker.java
r10043 r10308 150 150 for (Role role: r.roles) { 151 151 String key = role.key; 152 List<Role> roleGroup = null;152 List<Role> roleGroup; 153 153 if (allroles.containsKey(key)) { 154 154 roleGroup = allroles.get(key).roles; -
trunk/src/org/openstreetmap/josm/gui/DefaultNameFormatter.java
r10242 r10308 210 210 StringBuilder name = new StringBuilder(); 211 211 212 char mark = 0;212 char mark; 213 213 // If current language is left-to-right (almost all languages) 214 214 if (ComponentOrientation.getOrientation(Locale.getDefault()).isLeftToRight()) { -
trunk/src/org/openstreetmap/josm/gui/ExtendedDialog.java
r10035 r10308 386 386 } 387 387 388 gc.gridy = y ++;388 gc.gridy = y; 389 389 gc.anchor = GridBagConstraints.CENTER; 390 390 gc.insets = new Insets(5, 5, 5, 5); -
trunk/src/org/openstreetmap/josm/gui/conflict/pair/PairTable.java
r8509 r10308 16 16 private final transient ListMergeModel<? extends PrimitiveId> model; 17 17 18 /** 19 * Constructs a new {@code PairTable}. 20 * @param name table name 21 * @param model merge model 22 * @param dm table model 23 * @param cm column model 24 * @param sm selection model 25 */ 18 26 public PairTable(String name, ListMergeModel<? extends PrimitiveId> model, 19 27 OsmPrimitivesTableModel dm, TableColumnModel cm, ListSelectionModel sm) { -
trunk/src/org/openstreetmap/josm/gui/conflict/pair/nodes/NodeListColumnModel.java
r6890 r10308 8 8 import javax.swing.table.TableColumn; 9 9 10 /** 11 * Column model used in {@link NodeListTable}. 12 * @since 1622 13 */ 10 14 public class NodeListColumnModel extends DefaultTableColumnModel { 15 16 /** 17 * Constructs a new {@code NodeListColumnModel}. 18 * @param renderer table cell renderer 19 */ 20 public NodeListColumnModel(TableCellRenderer renderer) { 21 createColumns(renderer); 22 } 11 23 12 24 protected final void createColumns(TableCellRenderer renderer) { 13 25 14 TableColumn col = null;15 16 26 // column 0 - Row num 17 col = new TableColumn(0);27 TableColumn col = new TableColumn(0); 18 28 col.setHeaderValue(""); 19 29 col.setResizable(true); … … 30 40 addColumn(col); 31 41 } 32 33 public NodeListColumnModel(TableCellRenderer renderer) {34 createColumns(renderer);35 }36 42 } -
trunk/src/org/openstreetmap/josm/gui/conflict/pair/nodes/NodeListTable.java
r7937 r10308 12 12 public class NodeListTable extends PairTable { 13 13 14 /** 15 * Constructs a new {@code NodeListTable}. 16 * @param name table name 17 * @param model node merge model 18 * @param dm table model 19 * @param sm selection model 20 */ 14 21 public NodeListTable(String name, ListMergeModel<Node> model, OsmPrimitivesTableModel dm, ListSelectionModel sm) { 15 22 super(name, model, dm, new NodeListColumnModel(new NodeListTableCellRenderer()), sm); -
trunk/src/org/openstreetmap/josm/gui/conflict/pair/nodes/NodeListTableCellRenderer.java
r9243 r10308 20 20 /** 21 21 * This is the {@link TableCellRenderer} used in the node tables of {@link NodeListMerger}. 22 * 22 * @since 1622 23 23 */ 24 public 24 public class NodeListTableCellRenderer extends JLabel implements TableCellRenderer { 25 25 26 26 private final ImageIcon icon; … … 118 118 default: 119 119 // should not happen 120 throw new RuntimeException(MessageFormat.format("Unexpected column index. Got {0}.", column));120 throw new IllegalArgumentException(MessageFormat.format("Unexpected column index. Got {0}.", column)); 121 121 } 122 122 } -
trunk/src/org/openstreetmap/josm/gui/conflict/pair/relation/RelationMemberListColumnModel.java
r9059 r10308 7 7 import javax.swing.table.TableColumn; 8 8 9 /** 10 * Column model used in {@link RelationMemberTable}. 11 * @since 1622 12 */ 9 13 public class RelationMemberListColumnModel extends DefaultTableColumnModel { 10 14 15 /** 16 * Constructs a new {@code RelationMemberListColumnModel}. 17 */ 18 public RelationMemberListColumnModel() { 19 createColumns(); 20 } 21 11 22 protected final void createColumns() { 12 TableColumn col = null;13 23 RelationMemberTableCellRenderer renderer = new RelationMemberTableCellRenderer(); 14 24 15 25 // column 0 - Row num 16 col = new TableColumn(0);26 TableColumn col = new TableColumn(0); 17 27 col.setHeaderValue(""); 18 28 col.setResizable(true); … … 38 48 addColumn(col); 39 49 } 40 41 public RelationMemberListColumnModel() {42 createColumns();43 }44 50 } -
trunk/src/org/openstreetmap/josm/gui/conflict/pair/relation/RelationMemberTable.java
r7937 r10308 12 12 public class RelationMemberTable extends PairTable { 13 13 14 /** 15 * Constructs a new {@code RelationMemberTable}. 16 * @param name table name 17 * @param model relation member merge model 18 * @param dm table model 19 * @param sm selection model 20 */ 14 21 public RelationMemberTable(String name, ListMergeModel<RelationMember> model, OsmPrimitivesTableModel dm, ListSelectionModel sm) { 15 22 super(name, model, dm, new RelationMemberListColumnModel(), sm); -
trunk/src/org/openstreetmap/josm/gui/conflict/pair/tags/TagMerger.java
r9847 r10308 360 360 if (e.getClickCount() != 2) 361 361 return; 362 JTable table = null;362 JTable table; 363 363 MergeDecisionType mergeDecision; 364 364 -
trunk/src/org/openstreetmap/josm/gui/conflict/tags/RelationMemberConflictResolverColumnModel.java
r8308 r10308 66 66 RelationMemberConflictDecisionEditor decisionEditor = new RelationMemberConflictDecisionEditor(); 67 67 68 TableColumn col = null;69 70 68 // column 0 - Relation 71 col = new TableColumn(0);69 TableColumn col = new TableColumn(0); 72 70 col.setHeaderValue("Relation"); 73 71 col.setResizable(true); -
trunk/src/org/openstreetmap/josm/gui/dialogs/DeleteFromRelationConfirmationDialog.java
r10300 r10308 275 275 276 276 protected final void createColumns() { 277 TableColumn col = null;278 277 279 278 // column 0 - To Delete 280 col = new TableColumn(0);279 TableColumn col = new TableColumn(0); 281 280 col.setHeaderValue(tr("To delete")); 282 281 col.setResizable(true); -
trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetContentTableColumnModel.java
r7715 r10308 11 11 /** 12 12 * The column model for the changeset content 13 * 13 * @since 2689 14 14 */ 15 15 public class ChangesetContentTableColumnModel extends DefaultTableColumnModel { 16 16 17 /** 18 * Constructs a new {@code ChangesetContentTableColumnModel}. 19 */ 20 public ChangesetContentTableColumnModel() { 21 createColumns(); 22 } 23 17 24 protected void createColumns() { 18 TableColumn col = null;19 25 ChangesetContentTableCellRenderer renderer = new ChangesetContentTableCellRenderer(); 20 26 // column 0 - type 21 col = new TableColumn(0);27 TableColumn col = new TableColumn(0); 22 28 col.setHeaderValue(""); 23 29 col.setResizable(true); … … 45 51 addColumn(col); 46 52 } 47 48 /**49 * Constructs a new {@code ChangesetContentTableColumnModel}.50 */51 public ChangesetContentTableColumnModel() {52 createColumns();53 }54 53 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetDiscussionTableColumnModel.java
r7937 r10308 13 13 public class ChangesetDiscussionTableColumnModel extends DefaultTableColumnModel { 14 14 15 /** 16 * Constructs a new {@code ChangesetContentTableColumnModel}. 17 */ 18 public ChangesetDiscussionTableColumnModel() { 19 createColumns(); 20 } 21 15 22 protected void createColumns() { 16 TableColumn col = null;17 23 ChangesetDiscussionTableCellRenderer renderer = new ChangesetDiscussionTableCellRenderer(); 18 24 // column 0 - Date 19 col = new TableColumn(0, 150);25 TableColumn col = new TableColumn(0, 150); 20 26 col.setHeaderValue(tr("Date")); 21 27 col.setResizable(true); … … 39 45 addColumn(col); 40 46 } 41 42 /**43 * Constructs a new {@code ChangesetContentTableColumnModel}.44 */45 public ChangesetDiscussionTableColumnModel() {46 createColumns();47 }48 47 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/MemberTableLinkedCellRenderer.java
r10248 r10308 60 60 int w = 2; 61 61 int p = 2 + w + 1; 62 int y1 = 0;63 int y2 = 0;62 int y1; 63 int y2; 64 64 65 65 if (value.linkPrev) { -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/sort/WayConnectionTypeCalculator.java
r10250 r10308 145 145 RelationMember m, int i, final WayConnectionType wct) { 146 146 Direction dirFW = determineDirection(lastForwardWay, con.get(lastForwardWay).direction, i); 147 Direction dirBW = NONE;147 Direction dirBW; 148 148 if (onewayBeginning) { 149 149 if (lastBackwardWay < 0) { -
trunk/src/org/openstreetmap/josm/gui/history/HistoryBrowserModel.java
r10212 r10308 763 763 l.data.addDataSetListener(this); 764 764 OsmPrimitive primitive = history != null ? l.data.getPrimitiveById(history.getId(), history.getType()) : null; 765 HistoryOsmPrimitive latest;765 HistoryOsmPrimitive newLatest; 766 766 if (canShowAsLatest(primitive)) { 767 latest = new HistoryPrimitiveBuilder().build(primitive);767 newLatest = new HistoryPrimitiveBuilder().build(primitive); 768 768 } else { 769 latest = null;770 } 771 setLatest( latest);769 newLatest = null; 770 } 771 setLatest(newLatest); 772 772 fireModelChange(); 773 773 } -
trunk/src/org/openstreetmap/josm/gui/history/NodeListTableCellRenderer.java
r10021 r10308 33 33 protected void renderNode(TwoColumnDiff.Item item, boolean isSelected) { 34 34 String text = ""; 35 Color bgColor = Color.WHITE;36 35 setIcon(nodeIcon); 37 36 if (item.value != null) { 38 37 text = tr("Node {0}", item.value.toString()); 39 38 } 40 bgColor = item.state.getColor();39 Color bgColor = item.state.getColor(); 41 40 if (item.state == DiffItemType.EMPTY) { 42 41 text = ""; -
trunk/src/org/openstreetmap/josm/gui/history/NodeListTableColumnModel.java
r5835 r10308 7 7 import javax.swing.table.TableColumn; 8 8 9 10 9 /** 11 10 * The {@link javax.swing.table.TableColumnModel} for the table with the list of nodes. 12 * 13 * 11 * @since 1709 14 12 */ 15 13 public class NodeListTableColumnModel extends DefaultTableColumnModel { 14 15 /** 16 * Constructs a new {@code NodeListTableColumnModel}. 17 */ 18 public NodeListTableColumnModel() { 19 createColumns(); 20 } 21 16 22 protected void createColumns() { 17 TableColumn col = null;18 23 NodeListTableCellRenderer renderer = new NodeListTableCellRenderer(); 19 24 20 25 // column 0 - Version 21 col = new TableColumn(0);26 TableColumn col = new TableColumn(0); 22 27 col.setHeaderValue(tr("Nodes")); 23 28 col.setCellRenderer(renderer); 24 29 addColumn(col); 25 30 } 26 27 public NodeListTableColumnModel() {28 createColumns();29 }30 31 } -
trunk/src/org/openstreetmap/josm/gui/history/RelationMemberTableColumnModel.java
r5835 r10308 9 9 /** 10 10 * The {@link javax.swing.table.TableColumnModel} for the table with the list of relation members. 11 * 11 * @since 1709 12 12 */ 13 13 public class RelationMemberTableColumnModel extends DefaultTableColumnModel { 14 15 /** 16 * Constructs a new {@code RelationMemberTableColumnModel}. 17 */ 18 public RelationMemberTableColumnModel() { 19 createColumns(); 20 } 21 14 22 protected void createColumns() { 15 TableColumn col = null;16 23 RelationMemberListTableCellRenderer renderer = new RelationMemberListTableCellRenderer(); 17 24 18 25 // column 0 - Version 19 col = new TableColumn(0);26 TableColumn col = new TableColumn(0); 20 27 col.setHeaderValue(tr("Role")); 21 28 col.setCellRenderer(renderer); … … 28 35 addColumn(col); 29 36 } 30 31 public RelationMemberTableColumnModel() {32 createColumns();33 }34 37 } -
trunk/src/org/openstreetmap/josm/gui/history/TagTableColumnModel.java
r7822 r10308 12 12 */ 13 13 public class TagTableColumnModel extends DefaultTableColumnModel { 14 15 /** 16 * Constructs a new {@code TagTableColumnModel}. 17 */ 18 public TagTableColumnModel() { 19 createColumns(); 20 } 21 14 22 protected void createColumns() { 15 TableColumn col = null;16 17 23 TagTableCellRenderer renderer = new TagTableCellRenderer(); 18 24 19 25 // column 0 - Key 20 col = new TableColumn(0);26 TableColumn col = new TableColumn(0); 21 27 col.setHeaderValue(tr("Key")); 22 28 col.setCellRenderer(renderer); … … 28 34 col.setCellRenderer(renderer); 29 35 addColumn(col); 30 31 }32 33 /**34 * Constructs a new {@code TagTableColumnModel}.35 */36 public TagTableColumnModel() {37 createColumns();38 36 } 39 37 } -
trunk/src/org/openstreetmap/josm/gui/history/VersionTableColumnModel.java
r9983 r10308 11 11 /** 12 12 * The {@link TableColumnModel} for the table with the list of versions 13 * 13 * @since 1709 14 14 */ 15 15 public class VersionTableColumnModel extends DefaultTableColumnModel { … … 26 26 public static final int COL_USER = 4; 27 27 28 /** 29 * Creates a new {@code VersionTableColumnModel}. 30 */ 31 public VersionTableColumnModel() { 32 createColumns(); 33 } 34 28 35 protected void createColumns() { 29 TableColumn col = null;30 36 VersionTable.RadioButtonRenderer bRenderer = new VersionTable.RadioButtonRenderer(); 31 37 32 38 // column 0 - Version 33 col = new TableColumn(COL_VERSION);39 TableColumn col = new TableColumn(COL_VERSION); 34 40 /* translation note: 3 letter abbr. for "Version" */ 35 41 col.setHeaderValue(tr("Ver")); … … 62 68 addColumn(col); 63 69 } 64 65 /**66 * Creates a new {@code VersionTableColumnModel}.67 */68 public VersionTableColumnModel() {69 createColumns();70 }71 70 } -
trunk/src/org/openstreetmap/josm/gui/io/LayerNameAndFilePathTableCell.java
r10021 r10308 32 32 /** 33 33 * Display and edit layer name and file path in a <code>JTable</code>. 34 * 34 * 35 35 * Note: Do not use the same object both as <code>TableCellRenderer</code> and 36 36 * <code>TableCellEditor</code> - this can mess up the current editor component … … 39 39 class LayerNameAndFilePathTableCell extends JPanel implements TableCellRenderer, TableCellEditor { 40 40 private static final Color colorError = new Color(255, 197, 197); 41 private static final String separator = System.getProperty("file.separator"); 42 private static final String ellipsis = '…' + separator; 41 private static final String ELLIPSIS = '…' + File.separator; 43 42 44 43 private final JLabel lblLayerName = new JLabel(); … … 151 150 */ 152 151 private String addLblFilename(SaveLayerInfo info) { 153 String tooltip = "";152 String tooltip; 154 153 boolean error = false; 155 154 if (info.getFile() == null) { … … 185 184 while (t != null && !t.isEmpty()) { 186 185 int txtwidth = lblFilename.getFontMetrics(lblFilename.getFont()).stringWidth(t); 187 if (txtwidth < lblFilename.getWidth() || t.lastIndexOf( separator) < ellipsis.length()) {186 if (txtwidth < lblFilename.getWidth() || t.lastIndexOf(File.separator) < ELLIPSIS.length()) { 188 187 break; 189 188 } 190 189 // remove ellipsis, if present 191 t = hasEllipsis ? t.substring( ellipsis.length()) : t;190 t = hasEllipsis ? t.substring(ELLIPSIS.length()) : t; 192 191 // cut next block, and re-add ellipsis 193 t = ellipsis + t.substring(t.indexOf(separator) + 1);192 t = ELLIPSIS + t.substring(t.indexOf(File.separator) + 1); 194 193 hasEllipsis = true; 195 194 } -
trunk/src/org/openstreetmap/josm/gui/io/SaveLayersTableColumnModel.java
r9754 r10308 83 83 84 84 protected void build() { 85 TableColumn col = null;86 87 85 // column 0 - layer name, save path editor 88 86 LayerNameAndFilePathTableCell lnfpRenderer = new LayerNameAndFilePathTableCell(); 89 87 LayerNameAndFilePathTableCell lnfpEditor = new LayerNameAndFilePathTableCell(); 90 col = new TableColumn(0); // keep in sync with SaveLayersModel#columnFilename88 TableColumn col = new TableColumn(0); // keep in sync with SaveLayersModel#columnFilename 91 89 col.setHeaderValue(tr("Layer Name and File Path")); 92 90 col.setResizable(true); -
trunk/src/org/openstreetmap/josm/gui/layer/NoteLayer.java
r10152 r10308 110 110 Point p = mv.getPoint(note.getLatLon()); 111 111 112 ImageIcon icon = null;112 ImageIcon icon; 113 113 if (note.getId() < 0) { 114 114 icon = NotesDialog.ICON_NEW_SMALL; -
trunk/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java
r10234 r10308 721 721 gbc = GBC.eol(); 722 722 gbc.gridx = 0; 723 gbc.gridy = y ++;723 gbc.gridy = y; 724 724 panelTf.add(cbShowThumbs, gbc); 725 725 … … 1249 1249 1250 1250 // The searched index is somewhere in the middle, do a binary search from the beginning 1251 int curIndex = 0;1251 int curIndex; 1252 1252 int startIndex = 0; 1253 1253 int endIndex = lstSize-1; -
trunk/src/org/openstreetmap/josm/gui/mappaint/ElemStyles.java
r9341 r10308 281 281 if (!hasIndependentElemStyle && !multipolygon.getOuterWays().isEmpty()) { 282 282 Color mpColor = null; 283 StyleElementList mpElemStyles = null;283 StyleElementList mpElemStyles; 284 284 synchronized (ref) { 285 285 mpElemStyles = get(ref, scale, nc); -
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Instruction.java
r8846 r10308 71 71 @Override 72 72 public void execute(Environment env) { 73 Object value = null;73 Object value; 74 74 if (val instanceof Expression) { 75 75 value = ((Expression) val).evaluate(env); … … 88 88 public String toString() { 89 89 return key + ": " + (val instanceof float[] ? Arrays.toString((float[]) val) : 90 val instanceof String ? "String<"+val+'>' : val) + ';';90 (val instanceof String ? ("String<"+val+'>') : val)) + ';'; 91 91 } 92 92 } -
trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletingComboBox.java
r10254 r10308 101 101 102 102 // item for lookup and selection 103 Object item = null;103 Object item; 104 104 // if the text is a number we don't autocomplete 105 105 if (Main.pref.getBoolean("autocomplete.dont_complete_numbers", true)) { -
trunk/src/org/openstreetmap/josm/gui/widgets/MultiSplitLayout.java
r10207 r10308 607 607 Split split = (Split) root; 608 608 Iterator<Node> splitChildren = split.getChildren().iterator(); 609 Rectangle childBounds = null;609 Rectangle childBounds; 610 610 int dividerSize = getDividerSize(); 611 611 … … 624 624 splitChildren.hasNext() ? (Divider) (splitChildren.next()) : null; 625 625 626 double childWidth = 0.0;626 double childWidth; 627 627 if (getFloatingDividers()) { 628 628 childWidth = preferredNodeSize(splitChild).getWidth(); -
trunk/src/org/openstreetmap/josm/io/AbstractReader.java
r8510 r10308 140 140 List<RelationMember> relationMembers = new ArrayList<>(); 141 141 for (RelationMemberData rm : entry.getValue()) { 142 OsmPrimitive primitive = null;143 144 142 // lookup the member from the map of already created primitives 145 primitive = externalIdMap.get(new SimplePrimitiveId(rm.getMemberId(), rm.getMemberType()));143 OsmPrimitive primitive = externalIdMap.get(new SimplePrimitiveId(rm.getMemberId(), rm.getMemberType())); 146 144 147 145 if (primitive == null) { -
trunk/src/org/openstreetmap/josm/io/OsmConnection.java
r10237 r10308 11 11 import java.nio.CharBuffer; 12 12 import java.nio.charset.CharacterCodingException; 13 import java.nio.charset.CharsetEncoder;14 13 import java.nio.charset.StandardCharsets; 15 14 import java.util.Objects; … … 63 62 */ 64 63 protected void addBasicAuthorizationHeader(HttpClient con) throws OsmTransferException { 65 CharsetEncoder encoder = StandardCharsets.UTF_8.newEncoder();66 64 CredentialsAgentResponse response; 67 String token;68 65 try { 69 66 synchronized (CredentialsManager.getInstance()) { … … 74 71 throw new OsmTransferException(e); 75 72 } 73 String token; 76 74 if (response == null) { 77 75 token = ":"; … … 84 82 token = username + ':' + password; 85 83 try { 86 ByteBuffer bytes = encoder.encode(CharBuffer.wrap(token));84 ByteBuffer bytes = StandardCharsets.UTF_8.newEncoder().encode(CharBuffer.wrap(token)); 87 85 con.setHeader("Authorization", "Basic "+Base64.encode(bytes)); 88 86 } catch (CharacterCodingException e) { -
trunk/src/org/openstreetmap/josm/io/OsmReader.java
r10235 r10308 316 316 317 317 private RelationMemberData parseRelationMember(Relation r) throws XMLStreamException { 318 String role = null;319 318 OsmPrimitiveType type = null; 320 319 long id = 0; … … 339 338 Long.toString(id), Long.toString(r.getUniqueId()), value), e); 340 339 } 341 value = parser.getAttributeValue(null, "role"); 342 role = value; 340 String role = parser.getAttributeValue(null, "role"); 343 341 344 342 if (id == 0) { -
trunk/src/org/openstreetmap/josm/io/auth/AbstractCredentialsAgent.java
r8929 r10308 49 49 @Override 50 50 public void run() { 51 CredentialDialog dialog = null;51 CredentialDialog dialog; 52 52 if (requestorType.equals(RequestorType.PROXY)) 53 53 dialog = CredentialDialog.getHttpProxyCredentialDialog( -
trunk/src/org/openstreetmap/josm/io/remotecontrol/AddTagsDialog.java
r10242 r10308 272 272 @Override 273 273 public void run() { 274 String[] tags = null;275 tags = Utils.decodeUrl(args.get("addtags")).split("\\|");276 274 Set<String> tagSet = new HashSet<>(); 277 for (String tag : tags) {275 for (String tag : Utils.decodeUrl(args.get("addtags")).split("\\|")) { 278 276 if (!tag.trim().isEmpty() && tag.contains("=")) { 279 277 tagSet.add(tag.trim()); -
trunk/src/org/openstreetmap/josm/io/remotecontrol/RemoteControlHttpsServer.java
r10212 r10308 216 216 public static Path setupJosmKeystore() throws IOException, GeneralSecurityException { 217 217 218 char[] storePassword = KEYSTORE_PASSWORD.get().toCharArray();219 char[] entryPassword = KEYENTRY_PASSWORD.get().toCharArray();220 221 218 Path dir = Paths.get(RemoteControl.getRemoteControlDir()); 222 219 Path path = dir.resolve(KEYSTORE_FILENAME); … … 249 246 KEYENTRY_PASSWORD.put(new BigInteger(130, random).toString(32)); 250 247 251 storePassword = KEYSTORE_PASSWORD.get().toCharArray();252 entryPassword = KEYENTRY_PASSWORD.get().toCharArray();248 char[] storePassword = KEYSTORE_PASSWORD.get().toCharArray(); 249 char[] entryPassword = KEYENTRY_PASSWORD.get().toCharArray(); 253 250 254 251 ks.setKeyEntry(ENTRY_ALIAS, pair.getPrivate(), entryPassword, new Certificate[]{cert}); -
trunk/src/org/openstreetmap/josm/tools/AudioPlayer.java
r10216 r10308 302 302 if (audioInputStream != null) { 303 303 Utils.close(audioInputStream); 304 audioInputStream = null;305 304 } 306 305 playingUrl = command.url(); 307 306 audioInputStream = AudioSystem.getAudioInputStream(playingUrl); 308 307 audioFormat = audioInputStream.getFormat(); 309 long nBytesRead = 0;308 long nBytesRead; 310 309 position = 0.0; 311 310 offset -= leadIn; -
trunk/src/org/openstreetmap/josm/tools/Diff.java
r10246 r10308 116 116 private final FileData[] filevec; 117 117 private int cost; 118 /** Snakes bigger than this are considered "big". */119 private static final int SNAKE_LIMIT = 20;120 118 121 119 /** … … 168 166 for (int c = 1;; ++c) { 169 167 int d; /* Active diagonal. */ 170 boolean bigSnake = false;171 168 172 169 /* Extend the top-down search by an edit step in each diagonal. */ … … 182 179 } 183 180 for (d = fmax; d >= fmin; d -= 2) { 184 int x, y, oldx,tlo = fd[fdiagoff + d - 1], thi = fd[fdiagoff + d + 1];181 int x, y, tlo = fd[fdiagoff + d - 1], thi = fd[fdiagoff + d + 1]; 185 182 186 183 if (tlo >= thi) { … … 189 186 x = thi; 190 187 } 191 oldx = x;192 188 y = x - d; 193 189 while (x < xlim && y < ylim && xv[x] == yv[y]) { 194 190 ++x; ++y; 195 }196 if (x - oldx > SNAKE_LIMIT) {197 bigSnake = true;198 191 } 199 192 fd[fdiagoff + d] = x; … … 216 209 } 217 210 for (d = bmax; d >= bmin; d -= 2) { 218 int x, y, oldx,tlo = bd[bdiagoff + d - 1], thi = bd[bdiagoff + d + 1];211 int x, y, tlo = bd[bdiagoff + d - 1], thi = bd[bdiagoff + d + 1]; 219 212 220 213 if (tlo < thi) { … … 223 216 x = thi - 1; 224 217 } 225 oldx = x;226 218 y = x - d; 227 219 while (x > xoff && y > yoff && xv[x - 1] == yv[y - 1]) { 228 220 --x; --y; 229 }230 if (oldx - x > SNAKE_LIMIT) {231 bigSnake = true;232 221 } 233 222 bd[bdiagoff + d] = x; -
trunk/src/org/openstreetmap/josm/tools/ImageProvider.java
r10300 r10308 874 874 if ("image/svg+xml".equals(mediatype)) { 875 875 String s = new String(bytes, StandardCharsets.UTF_8); 876 SVGDiagram svg = null;876 SVGDiagram svg; 877 877 synchronized (getSvgUniverse()) { 878 878 URI uri = getSvgUniverse().loadSVG(new StringReader(s), Utils.encodeUrl(s)); … … 1003 1003 switch (type) { 1004 1004 case SVG: 1005 SVGDiagram svg = null;1005 SVGDiagram svg; 1006 1006 synchronized (getSvgUniverse()) { 1007 1007 URI uri = getSvgUniverse().loadSVG(path); … … 1049 1049 1050 1050 private static URL getImageUrl(String imageName, Collection<String> dirs, Collection<ClassLoader> additionalClassLoaders) { 1051 URL u = null;1051 URL u; 1052 1052 1053 1053 // Try passed directories first … … 1225 1225 } 1226 1226 1227 ImageResource imageResource = null;1227 ImageResource imageResource; 1228 1228 1229 1229 synchronized (ROTATE_CACHE) { -
trunk/src/org/openstreetmap/josm/tools/PlatformHookUnixoid.java
r10173 r10308 237 237 if (dpkg || rpm || eque) { 238 238 for (String packageName : packageNames) { 239 String[] args = null;239 String[] args; 240 240 if (dpkg) { 241 241 args = new String[] {"dpkg-query", "--show", "--showformat", "${Architecture}-${Version}", packageName}; -
trunk/src/org/openstreetmap/josm/tools/TextTagParser.java
r9078 r10308 175 175 Pattern p = Pattern.compile(tagRegex); 176 176 Map<String, String> tags = new HashMap<>(); 177 String k = null, v = null; 177 String k; 178 String v; 178 179 for (String line: lines) { 179 180 if (line.trim().isEmpty()) continue; // skip empty lines
Note:
See TracChangeset
for help on using the changeset viewer.