--- old/src/macosx/classes/sun/lwawt/macosx/CImage.java 2014-03-14 18:57:27.000000000 +0400 +++ new/src/macosx/classes/sun/lwawt/macosx/CImage.java 2014-03-14 18:57:27.000000000 +0400 @@ -224,24 +224,11 @@ = nativeGetNSImageRepresentationSizes(ptr, size.getWidth(), size.getHeight()); - if (sizes == null || sizes.length < 2) { - return toImage(w, h, w, h); - } + BufferedImage baseImage = toImage(w, h, w, h); - BufferedImage[] images = new BufferedImage[sizes.length]; - int currentImageIndex = 0; - - for (int i = 0; i < sizes.length; i++) { - int imageRepWidth = (int) sizes[i].getWidth(); - int imageRepHeight = (int) sizes[i].getHeight(); - - if(imageRepHeight <= w && imageRepHeight <= h){ - currentImageIndex = i; - } - images[i] = toImage(w, h, imageRepWidth, imageRepHeight); - } - return new MultiResolutionBufferedImage(BufferedImage.TYPE_INT_ARGB_PRE, - currentImageIndex, images); + return sizes == null || sizes.length < 2 ? baseImage + : new MultiResolutionBufferedImage(baseImage, sizes, + (width, height) -> toImage(w, h, width, height)); } private BufferedImage toImage(int srcWidth, int srcHeight, int dstWidth, int dstHeight) {