Ignore:
Timestamp:
2008-12-22T14:48:12+01:00 (16 years ago)
Author:
hampelratte
Message:

avoid ConcurrentModificationException by copying data.nodes to an array before rendering

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/OsbLayer.java

    r11265 r12476  
    111111        @Override
    112112        public void paint(Graphics g, MapView mv) {
    113                 for (Node node : data.nodes) {
     113            Object[] nodes = data.nodes.toArray();
     114                for (int i = 0; i < nodes.length; i++) {
     115                    Node node = (Node) nodes[i];
     116                   
    114117                        // don't paint deleted nodes
    115118                        if(node.deleted) {
     
    148151                                        Rectangle2D fontBounds = null;
    149152                                        String[] lines = desc.split("<hr>");
    150                                         for (int i = 0; i < lines.length; i++) {
    151                                                 String line = lines[i];
     153                                        for (int j = 0; j < lines.length; j++) {
     154                                                String line = lines[j];
    152155                                                fontBounds = g.getFontMetrics().getStringBounds(line, g);
    153156                                                tooltipWidth = Math.max(tooltipWidth, (int)fontBounds.getWidth());
Note: See TracChangeset for help on using the changeset viewer.