Ignore:
Timestamp:
2018-04-19T22:34:52+02:00 (7 years ago)
Author:
Don-vip
Message:

fix #16204 - allow to create a new layer, draw, drag, open a few windows. Nothing more to hope in sandbox mode. At least JOSM is now more robust than ever.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/widgets/JosmImageView.java

    r12620 r13649  
    4444    public JosmImageView(Element elem) throws NoSuchFieldException {
    4545        super(elem);
    46         imageField = ImageView.class.getDeclaredField("image");
    47         stateField = ImageView.class.getDeclaredField("state");
    48         widthField = ImageView.class.getDeclaredField("width");
    49         heightField = ImageView.class.getDeclaredField("height");
     46        imageField = getDeclaredField("image");
     47        stateField = getDeclaredField("state");
     48        widthField = getDeclaredField("width");
     49        heightField = getDeclaredField("height");
    5050        Utils.setObjectsAccessible(imageField, stateField, widthField, heightField);
     51    }
     52
     53    private static Field getDeclaredField(String name) throws NoSuchFieldException {
     54        try {
     55            return ImageView.class.getDeclaredField(name);
     56        } catch (SecurityException e) {
     57            Logging.log(Logging.LEVEL_ERROR, "Unable to access field by reflection", e);
     58            return null;
     59        }
    5160    }
    5261
Note: See TracChangeset for help on using the changeset viewer.