Changeset 14816 in josm for trunk/src/org/openstreetmap


Ignore:
Timestamp:
2019-02-25T20:03:10+01:00 (6 years ago)
Author:
Don-vip
Message:

see #17387 - add more details when NegativeArraySizeException occurs to be sure it's caused by https://bugs.openjdk.java.net/browse/JDK-4690476

Location:
trunk/src/org/openstreetmap/josm
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/layer/imagery/ReprojectionTile.java

    r14120 r14816  
    1818import org.openstreetmap.josm.tools.ImageWarp;
    1919import org.openstreetmap.josm.tools.Utils;
     20import org.openstreetmap.josm.tools.bugreport.BugReport;
    2021
    2122/**
     
    166167            transform = pointTransform;
    167168        }
    168         BufferedImage imageOut = ImageWarp.warp(
    169                 imageIn, getDimension(pbTargetAligned, scale),
    170                 transform, interpolation);
    171         synchronized (this) {
    172             this.image = imageOut;
    173             this.anchor = new TileAnchor(p00Img, p11Img);
    174             this.nativeScale = scale;
    175             this.maxZoomReached = scaleFix != null;
     169        Dimension targetDim = getDimension(pbTargetAligned, scale);
     170        try {
     171            BufferedImage imageOut = ImageWarp.warp(imageIn, targetDim, transform, interpolation);
     172            synchronized (this) {
     173                this.image = imageOut;
     174                this.anchor = new TileAnchor(p00Img, p11Img);
     175                this.nativeScale = scale;
     176                this.maxZoomReached = scaleFix != null;
     177            }
     178        } catch (NegativeArraySizeException e) {
     179            // See #17387 - https://bugs.openjdk.java.net/browse/JDK-4690476
     180            throw BugReport.intercept(e).put("targetDim", targetDim);
    176181        }
    177182    }
  • trunk/src/org/openstreetmap/josm/tools/ImageWarp.java

    r12865 r14816  
    99import java.util.HashSet;
    1010import java.util.Map;
     11import java.util.Objects;
    1112import java.util.Set;
    1213
     
    181182                            break;
    182183                        default:
    183                             throw new AssertionError();
     184                            throw new AssertionError(Objects.toString(interpolation));
    184185                    }
    185186                    imgTarget.setRGB(i, j, rgba);
Note: See TracChangeset for help on using the changeset viewer.