Index: src/main/java/common/java/awt/geom/AffineTransform.java =================================================================== --- src/main/java/common/java/awt/geom/AffineTransform.java (revision 470363) +++ src/main/java/common/java/awt/geom/AffineTransform.java (working copy) @@ -24,6 +24,7 @@ import java.io.IOException; import java.io.Serializable; +import org.apache.harmony.awt.internal.nls.Messages; import org.apache.harmony.misc.HashCode; public class AffineTransform implements Cloneable, Serializable { @@ -391,7 +392,8 @@ public AffineTransform createInverse() throws NoninvertibleTransformException { double det = getDeterminant(); if (Math.abs(det) < ZERO) { - throw new NoninvertibleTransformException("Determinant is zero"); + // awt.204=Determinant is zero + throw new NoninvertibleTransformException(Messages.getString("awt.204")); //$NON-NLS-1$ } return new AffineTransform( m11 / det, // m00 @@ -501,7 +503,8 @@ public Point2D inverseTransform(Point2D src, Point2D dst) throws NoninvertibleTransformException { double det = getDeterminant(); if (Math.abs(det) < ZERO) { - throw new NoninvertibleTransformException("Determinant is zero"); + // awt.204=Determinant is zero + throw new NoninvertibleTransformException(Messages.getString("awt.204")); //$NON-NLS-1$ } if (dst == null) { @@ -524,7 +527,8 @@ { double det = getDeterminant(); if (Math.abs(det) < ZERO) { - throw new NoninvertibleTransformException("Determinant is zero"); + // awt.204=Determinant is zero + throw new NoninvertibleTransformException(Messages.getString("awt.204")); //$NON-NLS-1$ } while (--length >= 0) { @@ -552,8 +556,8 @@ public String toString() { return getClass().getName() + - "[[" + m00 + ", " + m01 + ", " + m02 + "], [" - + m10 + ", " + m11 + ", " + m12 + "]]"; + "[[" + m00 + ", " + m01 + ", " + m02 + "], [" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ + + m10 + ", " + m11 + ", " + m12 + "]]"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ } @Override Index: src/main/java/common/java/awt/geom/Arc2D.java =================================================================== --- src/main/java/common/java/awt/geom/Arc2D.java (revision 470363) +++ src/main/java/common/java/awt/geom/Arc2D.java (working copy) @@ -22,6 +22,8 @@ import java.util.NoSuchElementException; +import org.apache.harmony.awt.internal.nls.Messages; + public abstract class Arc2D extends RectangularShape { public final static int OPEN = 0; @@ -394,7 +396,8 @@ public int currentSegment(double[] coords) { if (isDone()) { - throw new NoSuchElementException("Iiterator out of bounds"); + // awt.4B=Iterator out of bounds + throw new NoSuchElementException(Messages.getString("awt.4B")); //$NON-NLS-1$ } int type; int count; @@ -438,7 +441,8 @@ public int currentSegment(float[] coords) { if (isDone()) { - throw new NoSuchElementException("Iiterator out of bounds"); + // awt.4B=Iterator out of bounds + throw new NoSuchElementException(Messages.getString("awt.4B")); //$NON-NLS-1$ } int type; int count; @@ -510,7 +514,8 @@ public void setArcType(int type) { if (type != OPEN && type != CHORD && type != PIE) { - throw new IllegalArgumentException("Invalid type of Arc: " + type); + // awt.205=Invalid type of Arc: {0} + throw new IllegalArgumentException(Messages.getString("awt.205", type)); //$NON-NLS-1$ } this.type = type; } Index: src/main/java/common/java/awt/geom/Area.java =================================================================== --- src/main/java/common/java/awt/geom/Area.java (revision 470363) +++ src/main/java/common/java/awt/geom/Area.java (working copy) @@ -26,6 +26,8 @@ import java.awt.geom.Rectangle2D; import java.util.NoSuchElementException; +import org.apache.harmony.awt.internal.nls.Messages; + public class Area implements Shape, Cloneable { /** @@ -51,11 +53,13 @@ } public int currentSegment(double[] coords) { - throw new NoSuchElementException("Iterator out of bounds"); + // awt.4B=Iterator out of bounds + throw new NoSuchElementException(Messages.getString("awt.4B")); //$NON-NLS-1$ } public int currentSegment(float[] coords) { - throw new NoSuchElementException("Iterator out of bounds"); + // awt.4B=Iterator out of bounds + throw new NoSuchElementException(Messages.getString("awt.4B")); //$NON-NLS-1$ } } @@ -93,7 +97,7 @@ } public boolean equals(Area obj) { - throw new RuntimeException("Not implemented"); + throw new RuntimeException("Not implemented"); //$NON-NLS-1$ } public boolean intersects(double x, double y, double width, double height) { @@ -124,11 +128,11 @@ } public void add(Area area) { - throw new RuntimeException("Not implemented"); + throw new RuntimeException("Not implemented"); //$NON-NLS-1$ } public void exclusiveOr(Area area) { - throw new RuntimeException("Not implemented"); + throw new RuntimeException("Not implemented"); //$NON-NLS-1$ } /** @@ -169,27 +173,27 @@ } public void subtract(Area area) { - throw new RuntimeException("Not implemented"); + throw new RuntimeException("Not implemented"); //$NON-NLS-1$ } public boolean isEmpty() { - throw new RuntimeException("Not implemented"); + throw new RuntimeException("Not implemented"); //$NON-NLS-1$ } public boolean isPolygonal() { - throw new RuntimeException("Not implemented"); + throw new RuntimeException("Not implemented"); //$NON-NLS-1$ } public boolean isRectangular() { - throw new RuntimeException("Not implemented"); + throw new RuntimeException("Not implemented"); //$NON-NLS-1$ } public boolean isSingular() { - throw new RuntimeException("Not implemented"); + throw new RuntimeException("Not implemented"); //$NON-NLS-1$ } public void reset() { - throw new RuntimeException("Not implemented"); + throw new RuntimeException("Not implemented"); //$NON-NLS-1$ } public void transform(AffineTransform t) { Index: src/main/java/common/java/awt/geom/CubicCurve2D.java =================================================================== --- src/main/java/common/java/awt/geom/CubicCurve2D.java (revision 470363) +++ src/main/java/common/java/awt/geom/CubicCurve2D.java (working copy) @@ -25,6 +25,7 @@ import java.util.NoSuchElementException; import org.apache.harmony.awt.gl.Crossing; +import org.apache.harmony.awt.internal.nls.Messages; public abstract class CubicCurve2D implements Shape, Cloneable { @@ -288,7 +289,7 @@ public int currentSegment(double[] coords) { if (isDone()) { - throw new NoSuchElementException("Iiterator out of bounds"); + throw new NoSuchElementException(Messages.getString("awt.4B")); //$NON-NLS-1$ } int type; int count; @@ -315,7 +316,7 @@ public int currentSegment(float[] coords) { if (isDone()) { - throw new NoSuchElementException("Iiterator out of bounds"); + throw new NoSuchElementException(Messages.getString("awt.4B")); //$NON-NLS-1$ } int type; int count; Index: src/main/java/common/java/awt/geom/Ellipse2D.java =================================================================== --- src/main/java/common/java/awt/geom/Ellipse2D.java (revision 470363) +++ src/main/java/common/java/awt/geom/Ellipse2D.java (working copy) @@ -22,6 +22,8 @@ import java.util.NoSuchElementException; +import org.apache.harmony.awt.internal.nls.Messages; + public abstract class Ellipse2D extends RectangularShape { public static class Float extends Ellipse2D { @@ -222,7 +224,8 @@ public int currentSegment(double[] coords) { if (isDone()) { - throw new NoSuchElementException("Iiterator out of bounds"); + // awt.4B=Iterator out of bounds + throw new NoSuchElementException(Messages.getString("awt.4B")); //$NON-NLS-1$ } if (index == 5) { return SEG_CLOSE; @@ -253,7 +256,8 @@ public int currentSegment(float[] coords) { if (isDone()) { - throw new NoSuchElementException("Iiterator out of bounds"); + // awt.4B=Iterator out of bounds + throw new NoSuchElementException(Messages.getString("awt.4B")); //$NON-NLS-1$ } if (index == 5) { return SEG_CLOSE; Index: src/main/java/common/java/awt/geom/FlatteningPathIterator.java =================================================================== --- src/main/java/common/java/awt/geom/FlatteningPathIterator.java (revision 470363) +++ src/main/java/common/java/awt/geom/FlatteningPathIterator.java (working copy) @@ -22,6 +22,8 @@ import java.util.NoSuchElementException; +import org.apache.harmony.awt.internal.nls.Messages; + public class FlatteningPathIterator implements PathIterator { /** @@ -110,13 +112,16 @@ public FlatteningPathIterator(PathIterator path, double flatness, int limit) { if (flatness < 0.0) { - throw new IllegalArgumentException("Flatness is less then zero"); + // awt.206=Flatness is less then zero + throw new IllegalArgumentException(Messages.getString("awt.206")); //$NON-NLS-1$ } if (limit < 0) { - throw new IllegalArgumentException("Limit is less then zero"); + // awt.207=Limit is less then zero + throw new IllegalArgumentException(Messages.getString("awt.207")); //$NON-NLS-1$ } if (path == null) { - throw new NullPointerException("Path is null"); + // awt.208=Path is null + throw new NullPointerException(Messages.getString("awt.208")); //$NON-NLS-1$ } this.p = path; this.flatness = flatness; @@ -262,7 +267,8 @@ public int currentSegment(float[] coords) { if (isDone()) { - throw new NoSuchElementException("Iiterator out of bounds"); + // awt.4B=Iterator out of bounds + throw new NoSuchElementException(Messages.getString("awt.4Bx")); //$NON-NLS-1$ } evaluate(); int type = bufType; @@ -278,7 +284,8 @@ public int currentSegment(double[] coords) { if (isDone()) { - throw new NoSuchElementException("Iterator out of bounds"); + // awt.4B=Iterator out of bounds + throw new NoSuchElementException(Messages.getString("awt.4B")); //$NON-NLS-1$ } evaluate(); int type = bufType; Index: src/main/java/common/java/awt/geom/GeneralPath.java =================================================================== --- src/main/java/common/java/awt/geom/GeneralPath.java (revision 470363) +++ src/main/java/common/java/awt/geom/GeneralPath.java (working copy) @@ -25,6 +25,7 @@ import java.util.NoSuchElementException; import org.apache.harmony.awt.gl.Crossing; +import org.apache.harmony.awt.internal.nls.Messages; public final class GeneralPath implements Shape, Cloneable { @@ -133,7 +134,8 @@ public int currentSegment(double[] coords) { if (isDone()) { - throw new NoSuchElementException("Iterator out of bounds"); + // awt.4B=Iterator out of bounds + throw new NoSuchElementException(Messages.getString("awt.4B")); //$NON-NLS-1$ } int type = p.types[typeIndex]; int count = GeneralPath.pointShift[type]; @@ -149,7 +151,8 @@ public int currentSegment(float[] coords) { if (isDone()) { - throw new NoSuchElementException("Iterator out of bounds"); + // awt.4B=Iterator out of bounds + throw new NoSuchElementException(Messages.getString("awt.4B")); //$NON-NLS-1$ } int type = p.types[typeIndex]; int count = GeneralPath.pointShift[type]; @@ -186,7 +189,8 @@ public void setWindingRule(int rule) { if (rule != WIND_EVEN_ODD && rule != WIND_NON_ZERO) { - throw new java.lang.IllegalArgumentException("Invalid winding rule value"); + // awt.209=Invalid winding rule value + throw new java.lang.IllegalArgumentException(Messages.getString("awt.209")); //$NON-NLS-1$ } this.rule = rule; } @@ -201,8 +205,8 @@ */ void checkBuf(int pointCount, boolean checkMove) { if (checkMove && typeSize == 0) { - throw new IllegalPathStateException( - "First segment should be SEG_MOVETO type"); + // awt.20A=First segment should be SEG_MOVETO type + throw new IllegalPathStateException(Messages.getString("awt.20A")); //$NON-NLS-1$ } if (typeSize == types.length) { byte tmp[] = new byte[typeSize + BUFFER_CAPACITY]; Index: src/main/java/common/java/awt/geom/Line2D.java =================================================================== --- src/main/java/common/java/awt/geom/Line2D.java (revision 470363) +++ src/main/java/common/java/awt/geom/Line2D.java (working copy) @@ -24,6 +24,8 @@ import java.awt.Shape; import java.util.NoSuchElementException; +import org.apache.harmony.awt.internal.nls.Messages; + public abstract class Line2D implements Shape, Cloneable { public static class Float extends Line2D { @@ -247,7 +249,8 @@ public int currentSegment(double[] coords) { if (isDone()) { - throw new NoSuchElementException("Iiterator out of bounds"); + // awt.4B=Iterator out of bounds + throw new NoSuchElementException(Messages.getString("awt.4B")); //$NON-NLS-1$ } int type; if (index == 0) { @@ -267,7 +270,8 @@ public int currentSegment(float[] coords) { if (isDone()) { - throw new NoSuchElementException("Iiterator out of bounds"); + // awt.4B=Iterator out of bounds + throw new NoSuchElementException(Messages.getString("awt.4B")); //$NON-NLS-1$ } int type; if (index == 0) { Index: src/main/java/common/java/awt/geom/Point2D.java =================================================================== --- src/main/java/common/java/awt/geom/Point2D.java (revision 470363) +++ src/main/java/common/java/awt/geom/Point2D.java (working copy) @@ -60,7 +60,7 @@ @Override public String toString() { - return getClass().getName() + "[x=" + x + ",y=" + y + "]"; + return getClass().getName() + "[x=" + x + ",y=" + y + "]"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ } } @@ -95,7 +95,7 @@ @Override public String toString() { - return getClass().getName() + "[x=" + x + ",y=" + y + "]"; + return getClass().getName() + "[x=" + x + ",y=" + y + "]"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ } } Index: src/main/java/common/java/awt/geom/QuadCurve2D.java =================================================================== --- src/main/java/common/java/awt/geom/QuadCurve2D.java (revision 470363) +++ src/main/java/common/java/awt/geom/QuadCurve2D.java (working copy) @@ -25,6 +25,7 @@ import java.util.NoSuchElementException; import org.apache.harmony.awt.gl.Crossing; +import org.apache.harmony.awt.internal.nls.Messages; public abstract class QuadCurve2D implements Shape, Cloneable { @@ -241,7 +242,8 @@ public int currentSegment(double[] coords) { if (isDone()) { - throw new NoSuchElementException("Iterator out of bounds"); + // awt.4B=Iterator out of bounds + throw new NoSuchElementException(Messages.getString("awt.4B")); //$NON-NLS-1$ } int type; int count; @@ -266,7 +268,8 @@ public int currentSegment(float[] coords) { if (isDone()) { - throw new NoSuchElementException("Iterator out of bounds"); + // awt.4B=Iterator out of bounds + throw new NoSuchElementException(Messages.getString("awt.4B")); //$NON-NLS-1$ } int type; int count; Index: src/main/java/common/java/awt/geom/Rectangle2D.java =================================================================== --- src/main/java/common/java/awt/geom/Rectangle2D.java (revision 470363) +++ src/main/java/common/java/awt/geom/Rectangle2D.java (working copy) @@ -22,6 +22,7 @@ import java.util.NoSuchElementException; +import org.apache.harmony.awt.internal.nls.Messages; import org.apache.harmony.misc.HashCode; public abstract class Rectangle2D extends RectangularShape { @@ -153,7 +154,7 @@ public String toString() { // The output format based on 1.5 release behaviour. It could be obtained in the following way // System.out.println(new Rectangle2D.Float().toString()) - return getClass().getName() + "[x=" + x + ",y=" + y + ",width=" + width + ",height=" + height + "]"; + return getClass().getName() + "[x=" + x + ",y=" + y + ",width=" + width + ",height=" + height + "]"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ } } @@ -262,7 +263,7 @@ public String toString() { // The output format based on 1.5 release behaviour. It could be obtained in the following way // System.out.println(new Rectangle2D.Double().toString()) - return getClass().getName() + "[x=" + x + ",y=" + y + ",width=" + width + ",height=" + height + "]"; + return getClass().getName() + "[x=" + x + ",y=" + y + ",width=" + width + ",height=" + height + "]"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ } } @@ -332,7 +333,7 @@ public int currentSegment(double[] coords) { if (isDone()) { - throw new NoSuchElementException("Iterator out of bounds"); + throw new NoSuchElementException(Messages.getString("awt.4B")); //$NON-NLS-1$ } if (index == 5) { return SEG_CLOSE; @@ -371,7 +372,7 @@ public int currentSegment(float[] coords) { if (isDone()) { - throw new NoSuchElementException("Iterator out of bounds"); + throw new NoSuchElementException(Messages.getString("awt.4B")); //$NON-NLS-1$ } if (index == 5) { return SEG_CLOSE; Index: src/main/java/common/java/awt/geom/RoundRectangle2D.java =================================================================== --- src/main/java/common/java/awt/geom/RoundRectangle2D.java (revision 470363) +++ src/main/java/common/java/awt/geom/RoundRectangle2D.java (working copy) @@ -22,6 +22,8 @@ import java.util.NoSuchElementException; +import org.apache.harmony.awt.internal.nls.Messages; + public abstract class RoundRectangle2D extends RectangularShape { public static class Float extends RoundRectangle2D { @@ -307,8 +309,8 @@ public int currentSegment(double[] coords) { if (isDone()) { - throw new NoSuchElementException( - "RoundRectangle2D iterator out of bounds"); + // awt.4B=Iterator out of bounds + throw new NoSuchElementException(Messages.getString("awt.4B")); //$NON-NLS-1$ } if (index == points.length) { return SEG_CLOSE; @@ -327,8 +329,8 @@ public int currentSegment(float[] coords) { if (isDone()) { - throw new NoSuchElementException( - "RoundRectangle2D iterator out of bounds"); + // awt.4B=Iterator out of bounds + throw new NoSuchElementException(Messages.getString("awt.4B")); //$NON-NLS-1$ } if (index == points.length) { return SEG_CLOSE; Index: src/main/java/common/java/awt/im/InputMethodHighlight.java =================================================================== --- src/main/java/common/java/awt/im/InputMethodHighlight.java (revision 470363) +++ src/main/java/common/java/awt/im/InputMethodHighlight.java (working copy) @@ -23,6 +23,8 @@ import java.util.Map; import java.awt.font.TextAttribute; +import org.apache.harmony.awt.internal.nls.Messages; + public class InputMethodHighlight { public static final int RAW_TEXT = 0; @@ -55,8 +57,8 @@ public InputMethodHighlight(boolean selected, int state, int variation, Map style) { if ((state != RAW_TEXT) && (state != CONVERTED_TEXT)) { - throw new IllegalArgumentException("unknown input method" + - " highlight state"); + // awt.20B=unknown input method highlight state + throw new IllegalArgumentException(Messages.getString("awt.20B")); //$NON-NLS-1$ } this.selected = selected; this.state = state; Index: src/main/java/common/java/awt/im/InputSubset.java =================================================================== --- src/main/java/common/java/awt/im/InputSubset.java (revision 470363) +++ src/main/java/common/java/awt/im/InputSubset.java (working copy) @@ -22,29 +22,29 @@ public final class InputSubset extends Character.Subset { - public static final InputSubset LATIN = new InputSubset("LATIN"); + public static final InputSubset LATIN = new InputSubset("LATIN"); //$NON-NLS-1$ public static final InputSubset - LATIN_DIGITS = new InputSubset("LATIN_DIGITS"); + LATIN_DIGITS = new InputSubset("LATIN_DIGITS"); //$NON-NLS-1$ public static final InputSubset - TRADITIONAL_HANZI = new InputSubset("TRADITIONAL_HANZI"); + TRADITIONAL_HANZI = new InputSubset("TRADITIONAL_HANZI"); //$NON-NLS-1$ public static final InputSubset - SIMPLIFIED_HANZI = new InputSubset("SIMPLIFIED_HANZI"); + SIMPLIFIED_HANZI = new InputSubset("SIMPLIFIED_HANZI"); //$NON-NLS-1$ - public static final InputSubset KANJI = new InputSubset("KANJI"); + public static final InputSubset KANJI = new InputSubset("KANJI"); //$NON-NLS-1$ - public static final InputSubset HANJA = new InputSubset("HANJA"); + public static final InputSubset HANJA = new InputSubset("HANJA"); //$NON-NLS-1$ public static final InputSubset - HALFWIDTH_KATAKANA = new InputSubset("HALFWIDTH_KATAKANA"); + HALFWIDTH_KATAKANA = new InputSubset("HALFWIDTH_KATAKANA"); //$NON-NLS-1$ public static final InputSubset - FULLWIDTH_LATIN = new InputSubset("FULLWIDTH_LATIN"); + FULLWIDTH_LATIN = new InputSubset("FULLWIDTH_LATIN"); //$NON-NLS-1$ public static final InputSubset - FULLWIDTH_DIGITS = new InputSubset("FULLWIDTH_DIGITS"); + FULLWIDTH_DIGITS = new InputSubset("FULLWIDTH_DIGITS"); //$NON-NLS-1$ private InputSubset(String name) { super(name); Index: src/main/java/common/java/awt/image/AffineTransformOp.java =================================================================== --- src/main/java/common/java/awt/image/AffineTransformOp.java (revision 470363) +++ src/main/java/common/java/awt/image/AffineTransformOp.java (working copy) @@ -29,6 +29,7 @@ import java.util.Arrays; import org.apache.harmony.awt.gl.AwtImageBackdoorAccessor; +import org.apache.harmony.awt.internal.nls.Messages; public class AffineTransformOp implements BufferedImageOp, RasterOp { public static final int TYPE_NEAREST_NEIGHBOR = 1; @@ -70,13 +71,15 @@ public AffineTransformOp(AffineTransform xform, int interp) { if (Math.abs(xform.getDeterminant()) <= Double.MIN_VALUE) { - throw new ImagingOpException("Unable to invert transform " + xform); + // awt.24F=Unable to invert transform {0} + throw new ImagingOpException(Messages.getString("awt.24F", xform)); //$NON-NLS-1$ } this.at = (AffineTransform) xform.clone(); if (interp != TYPE_NEAREST_NEIGHBOR && interp != TYPE_BILINEAR && interp != TYPE_BICUBIC) { - throw new IllegalArgumentException("Unknown interpolation type: " + interp); + // awt.250=Unknown interpolation type: {0} + throw new IllegalArgumentException(Messages.getString("awt.250", interp)); //$NON-NLS-1$ } this.iType = interp; @@ -154,10 +157,9 @@ double dstHeight = newBounds.getY() + newBounds.getHeight(); if (dstWidth <= 0 || dstHeight <= 0) { + // awt.251=Transformed width ({0}) and height ({1}) should be greater than 0 throw new RasterFormatException( - "Transformed width ("+dstWidth+") and " + - "height ("+dstHeight+") should be greater than 0" - ); + Messages.getString("awt.251", dstWidth, dstHeight)); //$NON-NLS-1$ } if (destCM != null) { @@ -198,7 +200,8 @@ public final BufferedImage filter(BufferedImage src, BufferedImage dst) { if (src == dst) { - throw new IllegalArgumentException("Source can't be same as the destination"); + // awt.252=Source can't be same as the destination + throw new IllegalArgumentException(Messages.getString("awt.252")); //$NON-NLS-1$ } ColorModel srcCM = src.getColorModel(); @@ -233,7 +236,8 @@ // Skip alpha channel for TYPE_INT_RGB images if (slowFilter(src.getRaster(), dst.getRaster()) != 0) { - throw new ImagingOpException ("Unable to transform source"); + // awt.21F=Unable to transform source + throw new ImagingOpException (Messages.getString("awt.21F")); //$NON-NLS-1$ // TODO - uncomment //if (ippFilter(src.getRaster(), dst.getRaster(), src.getType()) != 0) //throw new ImagingOpException ("Unable to transform source"); @@ -252,19 +256,20 @@ public final WritableRaster filter(Raster src, WritableRaster dst) { if (src == dst) { - throw new IllegalArgumentException("Source can't be same as the destination"); + // awt.252=Source can't be same as the destination + throw new IllegalArgumentException(Messages.getString("awt.252")); //$NON-NLS-1$ } if (dst == null) { dst = createCompatibleDestRaster(src); } else if (src.getNumBands() != dst.getNumBands()) { - throw new IllegalArgumentException( - "Different number of bands in source and destination" - ); + // awt.253=Different number of bands in source and destination + throw new IllegalArgumentException(Messages.getString("awt.253")); //$NON-NLS-1$ } if (slowFilter(src, dst) != 0) { - throw new ImagingOpException("Unable to transform source"); + // awt.21F=Unable to transform source + throw new ImagingOpException(Messages.getString("awt.21F")); //$NON-NLS-1$ // TODO - uncomment //if (ippFilter(src, dst, BufferedImage.TYPE_CUSTOM) != 0) // throw new ImagingOpException("Unable to transform source"); Index: src/main/java/common/java/awt/image/AwtImageBackdoorAccessorImpl.java =================================================================== --- src/main/java/common/java/awt/image/AwtImageBackdoorAccessorImpl.java (revision 470363) +++ src/main/java/common/java/awt/image/AwtImageBackdoorAccessorImpl.java (working copy) @@ -35,6 +35,7 @@ import org.apache.harmony.awt.gl.GLVolatileImage; import org.apache.harmony.awt.gl.Surface; import org.apache.harmony.awt.gl.image.DataBufferListener; +import org.apache.harmony.awt.internal.nls.Messages; /** * This class not part of public API. It useful for receiving package private @@ -76,8 +77,9 @@ } else if (db instanceof DataBufferDouble){ return ((DataBufferDouble)db).getData(); } else { - throw new IllegalArgumentException("Wrong Data Buffer type - " + - db.getClass()); + // awt.235=Wrong Data Buffer type : {0} + throw new IllegalArgumentException(Messages.getString("awt.235", //$NON-NLS-1$ + db.getClass())); } } Index: src/main/java/common/java/awt/image/BandCombineOp.java =================================================================== --- src/main/java/common/java/awt/image/BandCombineOp.java (revision 470363) +++ src/main/java/common/java/awt/image/BandCombineOp.java (working copy) @@ -29,6 +29,7 @@ import java.util.Arrays; import org.apache.harmony.awt.gl.AwtImageBackdoorAccessor; +import org.apache.harmony.awt.internal.nls.Messages; public class BandCombineOp implements RasterOp { static final int offsets3c[] = {16, 8, 0}; @@ -95,8 +96,10 @@ public WritableRaster createCompatibleDestRaster (Raster src) { int numBands = src.getNumBands(); if (mxWidth != numBands && mxWidth != (numBands+1) || numBands != mxHeight) { - throw new IllegalArgumentException("Number of bands in the source raster ("+ numBands - + ") is incompatible with the matrix [" + mxWidth + "x" + mxHeight + "]"); + // awt.254=Number of bands in the source raster ({0}) is + // incompatible with the matrix [{1}x{2}] + throw new IllegalArgumentException(Messages.getString("awt.254", //$NON-NLS-1$ + new Object[]{numBands, mxWidth, mxHeight})); } return src.createCompatibleWritableRaster(src.getWidth(), src.getHeight()); @@ -106,27 +109,26 @@ int numBands = src.getNumBands(); if (mxWidth != numBands && mxWidth != (numBands+1)) { + // awt.254=Number of bands in the source raster ({0}) is + // incompatible with the matrix [{1}x{2}] throw new IllegalArgumentException( - "Number of bands in the source raster ("+ numBands - + ") is incompatible with the matrix [" + mxWidth + - "x" + mxHeight + "]" - ); + Messages.getString("awt.254", //$NON-NLS-1$ + new Object[]{numBands, mxWidth, mxHeight})); } if (dst == null) { dst = createCompatibleDestRaster(src); } else if (dst.getNumBands() != mxHeight) { - throw new IllegalArgumentException( - "Number of bands in the destination raster (" + - dst.getNumBands() + ") is incompatible with the matrix [" + - mxWidth + "x" + mxHeight + "]" - ); + // awt.255=Number of bands in the destination raster ({0}) is incompatible with the matrix [{1}x{2}] + throw new IllegalArgumentException(Messages.getString("awt.255", //$NON-NLS-1$ + new Object[]{dst.getNumBands(), mxWidth, mxHeight})); } // XXX - todo //if (ippFilter(src, dst) != 0) if (verySlowFilter(src, dst) != 0) { - throw new ImagingOpException ("Unable to transform source"); + // awt.21F=Unable to transform source + throw new ImagingOpException (Messages.getString("awt.21F")); //$NON-NLS-1$ } return dst; Index: src/main/java/common/java/awt/image/BandedSampleModel.java =================================================================== --- src/main/java/common/java/awt/image/BandedSampleModel.java (revision 470363) +++ src/main/java/common/java/awt/image/BandedSampleModel.java (working copy) @@ -20,6 +20,8 @@ */ package java.awt.image; +import org.apache.harmony.awt.internal.nls.Messages; + public final class BandedSampleModel extends ComponentSampleModel { private static int[] createIndices(int numBands) { @@ -85,9 +87,8 @@ @Override public SampleModel createSubsetSampleModel(int[] bands) { if (bands.length > numBands) { - throw new RasterFormatException("The number of the bands" + - " in the subset is greater than the number of bands" + - " in the sample model"); + // awt.64=The number of the bands in the subset is greater than the number of bands in the sample model + throw new RasterFormatException(Messages.getString("awt.64")); //$NON-NLS-1$ } int indices[] = new int[bands.length]; @@ -233,8 +234,8 @@ @Override public int getSample(int x, int y, int b, DataBuffer data) { if (x < 0 || y < 0 || x >= this.width || y >= this.height) { - throw new ArrayIndexOutOfBoundsException( - "Coordinates are not in bounds"); + // awt.63=Coordinates are not in bounds + throw new ArrayIndexOutOfBoundsException(Messages.getString("awt.63")); //$NON-NLS-1$ } return data.getElem(bankIndices[b], y * scanlineStride + x + @@ -244,8 +245,8 @@ @Override public double getSampleDouble(int x, int y, int b, DataBuffer data) { if (x < 0 || y < 0 || x >= this.width || y >= this.height) { - throw new ArrayIndexOutOfBoundsException("Coordinates are" + - " not in bounds"); + // awt.63=Coordinates are not in bounds + throw new ArrayIndexOutOfBoundsException(Messages.getString("awt.63")); //$NON-NLS-1$ } return data.getElemDouble(bankIndices[b], y * scanlineStride + x + @@ -255,8 +256,8 @@ @Override public float getSampleFloat(int x, int y, int b, DataBuffer data) { if (x < 0 || y < 0 || x >= this.width || y >= this.height) { - throw new ArrayIndexOutOfBoundsException("Coordinates are" + - " not in bounds"); + // awt.63=Coordinates are not in bounds + throw new ArrayIndexOutOfBoundsException(Messages.getString("awt.63")); //$NON-NLS-1$ } return data.getElemFloat(bankIndices[b], y * scanlineStride + x + @@ -359,8 +360,8 @@ @Override public void setSample(int x, int y, int b, double s, DataBuffer data) { if (x < 0 || y < 0 || x >= this.width || y >= this.height) { - throw new ArrayIndexOutOfBoundsException("Coordinates are" + - " not in bounds"); + // awt.63=Coordinates are not in bounds + throw new ArrayIndexOutOfBoundsException(Messages.getString("awt.63")); //$NON-NLS-1$ } data.setElemDouble(bankIndices[b], y * scanlineStride + x + @@ -370,8 +371,8 @@ @Override public void setSample(int x, int y, int b, float s, DataBuffer data) { if (x < 0 || y < 0 || x >= this.width || y >= this.height) { - throw new ArrayIndexOutOfBoundsException("Coordinates are" + - " not in bounds"); + // awt.63=Coordinates are not in bounds + throw new ArrayIndexOutOfBoundsException(Messages.getString("awt.63")); //$NON-NLS-1$ } data.setElemFloat(bankIndices[b], y * scanlineStride + x + @@ -381,8 +382,8 @@ @Override public void setSample(int x, int y, int b, int s, DataBuffer data) { if (x < 0 || y < 0 || x >= this.width || y >= this.height) { - throw new ArrayIndexOutOfBoundsException("Coordinates are" + - " not in bounds"); + // awt.63=Coordinates are not in bounds + throw new ArrayIndexOutOfBoundsException(Messages.getString("awt.63")); //$NON-NLS-1$ } data.setElem(bankIndices[b], y * scanlineStride + x + Index: src/main/java/common/java/awt/image/BufferedImage.java =================================================================== --- src/main/java/common/java/awt/image/BufferedImage.java (revision 470363) +++ src/main/java/common/java/awt/image/BufferedImage.java (working copy) @@ -35,6 +35,7 @@ import org.apache.harmony.awt.gl.ImageSurface; import org.apache.harmony.awt.gl.Surface; import org.apache.harmony.awt.gl.image.BufferedImageSource; +import org.apache.harmony.awt.internal.nls.Messages; public class BufferedImage extends @@ -109,13 +110,13 @@ public BufferedImage(ColorModel cm, WritableRaster raster, boolean isRasterPremultiplied, Hashtable properties) { if (!cm.isCompatibleRaster(raster)) { - throw new IllegalArgumentException("The raster is" + - " incompatible with this ColorModel"); + // awt.4D=The raster is incompatible with this ColorModel + throw new IllegalArgumentException(Messages.getString("awt.4D")); //$NON-NLS-1$ } if (raster.getMinX() != 0 || raster.getMinY() != 0) { - throw new IllegalArgumentException("minX or minY of" + - " this raster not equal to zero"); + // awt.228=minX or minY of this raster not equal to zero + throw new IllegalArgumentException(Messages.getString("awt.228")); //$NON-NLS-1$ } this.cm = cm; @@ -134,8 +135,8 @@ switch (imageType) { case TYPE_BYTE_BINARY: if (cm.hasAlpha()) { - throw new IllegalArgumentException("This image type" + - " can't have alpha"); + // awt.227=This image type can't have alpha + throw new IllegalArgumentException(Messages.getString("awt.227")); //$NON-NLS-1$ } int pixel_bits = 0; int mapSize = cm.getMapSize(); @@ -146,9 +147,8 @@ } else if (mapSize <= 16) { pixel_bits = 4; } else { - throw new IllegalArgumentException("The imageType is" + - " TYPE_BYTE_BINARY and the color map has more" + - " than 16 entries"); + // awt.221=The imageType is TYPE_BYTE_BINARY and the color map has more than 16 entries + throw new IllegalArgumentException(Messages.getString("awt.221")); //$NON-NLS-1$ } raster = Raster.createPackedRaster(DataBuffer.TYPE_BYTE, width, @@ -161,14 +161,14 @@ break; default: - throw new IllegalArgumentException("The imageType is not" + - " TYPE_BYTE_BINARY or TYPE_BYTE_INDEXED "); + // awt.222=The imageType is not TYPE_BYTE_BINARY or TYPE_BYTE_INDEXED + throw new IllegalArgumentException(Messages.getString("awt.222")); //$NON-NLS-1$ } if (!cm.isCompatibleRaster(raster)) { - throw new IllegalArgumentException("The imageType is" + - " not compatible with ColorModel"); + // awt.223=The imageType is not compatible with ColorModel + throw new IllegalArgumentException(Messages.getString("awt.223")); //$NON-NLS-1$ } this.cm = cm; @@ -349,7 +349,8 @@ } break; default: - throw new IllegalArgumentException("Unknown image type"); + // awt.224=Unknown image type + throw new IllegalArgumentException(Messages.getString("awt.224")); //$NON-NLS-1$ } this.imageType = imageType; imageSurf = createImageSurface(imageType); @@ -362,7 +363,8 @@ public Object getProperty(String name) { if(name == null) { - throw new NullPointerException("Property name is null"); + // awt.225=Property name is null + throw new NullPointerException(Messages.getString("awt.225")); //$NON-NLS-1$ } if (properties == null) { return null; @@ -439,16 +441,16 @@ @Override public String toString() { - return "BufferedImage@" + Integer.toHexString(hashCode()) + - ": type = " + imageType + " " + cm + " " + raster; + return "BufferedImage@" + Integer.toHexString(hashCode()) + //$NON-NLS-1$ + ": type = " + imageType + " " + cm + " " + raster; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ } public WritableRaster getWritableTile(int tileX, int tileY) { if (tileX == 0 && tileY == 0) { return raster; } - throw new ArrayIndexOutOfBoundsException("Both tileX and" + - " tileY are not equal to 0"); + // awt.226=Both tileX and tileY are not equal to 0 + throw new ArrayIndexOutOfBoundsException(Messages.getString("awt.226")); //$NON-NLS-1$ } public WritableRaster getRaster() { @@ -490,8 +492,8 @@ if (tileX == 0 && tileY == 0) { return raster; } - throw new ArrayIndexOutOfBoundsException("Both tileX and" + - " tileY are not equal to 0"); + // awt.226=Both tileX and tileY are not equal to 0 + throw new ArrayIndexOutOfBoundsException(Messages.getString("awt.226")); //$NON-NLS-1$ } public Raster getData() { @@ -597,8 +599,8 @@ if (tileX == 0 && tileY == 0) { return true; } - throw new ArrayIndexOutOfBoundsException("Both tileX and tileY" + - " are not equal to 0"); + // awt.226=Both tileX and tileY are not equal to 0 + throw new ArrayIndexOutOfBoundsException(Messages.getString("awt.226")); //$NON-NLS-1$ } public void releaseWritableTile(int tileX, int tileY) { Index: src/main/java/common/java/awt/image/BufferedImageFilter.java =================================================================== --- src/main/java/common/java/awt/image/BufferedImageFilter.java (revision 470363) +++ src/main/java/common/java/awt/image/BufferedImageFilter.java (working copy) @@ -309,7 +309,6 @@ if (createdValidBuffer == false) { cm = ColorModel.getRGBdefault(); raster = cm.createCompatibleWritableRaster(width, height); - System.out.println(raster +" "+ width +" "+ height); iData = accessor.getDataInt(raster.getDataBuffer()); bData = null; forcedRGB = true; Index: src/main/java/common/java/awt/image/ColorConvertOp.java =================================================================== --- src/main/java/common/java/awt/image/ColorConvertOp.java (revision 470363) +++ src/main/java/common/java/awt/image/ColorConvertOp.java (working copy) @@ -34,6 +34,7 @@ import org.apache.harmony.awt.gl.color.ColorConverter; import org.apache.harmony.awt.gl.color.ColorScaler; import org.apache.harmony.awt.gl.color.ICC_Transform; +import org.apache.harmony.awt.internal.nls.Messages; public class ColorConvertOp implements BufferedImageOp, RasterOp { // Unused but required by interfaces @@ -225,7 +226,7 @@ public ColorConvertOp(ColorSpace srcCS, ColorSpace dstCS, RenderingHints hints) { if (srcCS == null || dstCS == null) { - throw new NullPointerException("Null ColorSpace passed as a parameter"); + throw new NullPointerException(Messages.getString("awt.25B")); //$NON-NLS-1$ } renderingHints = hints; @@ -255,7 +256,7 @@ public ColorConvertOp(ICC_Profile profiles[], RenderingHints hints) { if (profiles == null) { - throw new NullPointerException("Null profiles passed as a parameter"); + throw new NullPointerException(Messages.getString("awt.25C")); //$NON-NLS-1$ } renderingHints = hints; @@ -274,7 +275,7 @@ public ColorConvertOp(ColorSpace cs, RenderingHints hints) { if (cs == null) { - throw new NullPointerException("Null ColorSpace passed as a parameter"); + throw new NullPointerException(Messages.getString("awt.25B")); //$NON-NLS-1$ } renderingHints = hints; @@ -295,8 +296,7 @@ public final WritableRaster filter(Raster src, WritableRaster dst) { if (conversionSequence.length < 2) { - throw new IllegalArgumentException( - "Source or destination color space is not defined"); + throw new IllegalArgumentException(Messages.getString("awt.25D")); //$NON-NLS-1$ } ICC_Profile srcPf = null, dstPf = null; // unused if isICC is false @@ -329,25 +329,23 @@ // Check that source and destination rasters are compatible with // transforms and with each other if (src.getNumBands() != nSrcColorComps) { - throw new IllegalArgumentException( - "Incorrect number of source raster bands. " + - "Should be equal to the number of color " + - "components of source colorspace."); + // awt.25E=Incorrect number of source raster bands. Should be equal + // to the number of color components of source colorspace. + throw new IllegalArgumentException(Messages.getString("awt.25E")); //$NON-NLS-1$ } if (dst != null) { // Check destination raster if (dst.getNumBands() != nDstColorComps) { - throw new IllegalArgumentException( - "Incorrect number of destination raster bands. " + - "Should be equal to the number of color " + - "components of destination colorspace."); + // awt.25F=Incorrect number of destination raster bands. Should + // be equal to the number of color components of destination + // colorspace. + throw new IllegalArgumentException(Messages.getString("awt.25F")); //$NON-NLS-1$ } if (src.getWidth() != dst.getWidth() || src.getHeight() != dst.getHeight()) { - throw new IllegalArgumentException( - "Incompatible rasters - width or height differs"); + throw new IllegalArgumentException(Messages.getString("awt.260")); //$NON-NLS-1$ } } else { @@ -396,7 +394,7 @@ int nSpaces = conversionSequence.length; if (nSpaces < 1) { - throw new IllegalArgumentException("Destination color space is undefined"); + throw new IllegalArgumentException(Messages.getString("awt.261")); //$NON-NLS-1$ } // Get destination color space @@ -421,7 +419,7 @@ public final BufferedImage filter(BufferedImage src, BufferedImage dst) { if (dst == null && conversionSequence.length < 1) { - throw new IllegalArgumentException("Destionation color space should be defined"); + throw new IllegalArgumentException(Messages.getString("awt.262")); //$NON-NLS-1$ } ColorModel srcCM = src.getColorModel(); @@ -437,8 +435,7 @@ if (src.getWidth() != dst.getWidth() || src.getHeight() != dst.getHeight()) { - throw new IllegalArgumentException( - "Incompatible images - width or height differs"); + throw new IllegalArgumentException(Messages.getString("awt.263")); //$NON-NLS-1$ } if (dst.getColorModel() instanceof IndexColorModel) { @@ -593,7 +590,7 @@ int nSpaces = conversionSequence.length; if (nSpaces < 2) { - throw new IllegalArgumentException("Destination color space is undefined"); + throw new IllegalArgumentException(Messages.getString("awt.261")); //$NON-NLS-1$ } Object lastCS = conversionSequence[nSpaces-1]; Index: src/main/java/common/java/awt/image/ColorModel.java =================================================================== --- src/main/java/common/java/awt/image/ColorModel.java (revision 470363) +++ src/main/java/common/java/awt/image/ColorModel.java (working copy) @@ -24,6 +24,8 @@ import java.awt.color.ColorSpace; import java.util.Arrays; +import org.apache.harmony.awt.internal.nls.Messages; + public abstract class ColorModel implements Transparency { protected int pixel_bits; // Pixel length in bits @@ -56,36 +58,38 @@ int transferType) { if (pixel_bits < 1) { - throw new IllegalArgumentException("The number of bits" + - " in the pixel values is less than 1"); + // awt.26B=The number of bits in the pixel values is less than 1 + throw new IllegalArgumentException(Messages.getString("awt.26B")); //$NON-NLS-1$ } if (bits == null) { - throw new NullPointerException("bits is null"); + // awt.26C=bits is null + throw new NullPointerException(Messages.getString("awt.26C")); //$NON-NLS-1$ } int sum = 0; for (int element : bits) { if (element < 0) { - throw new IllegalArgumentException("The elements in" + - " bits is less than 0"); + // awt.26D=The elements in bits is less than 0 + throw new IllegalArgumentException(Messages.getString("awt.26D")); //$NON-NLS-1$ } sum += element; } if (sum < 1) { - throw new NullPointerException("The sum of the number" + - " of bits in bits is less than 1"); + // awt.26E=The sum of the number of bits in bits is less than 1 + throw new NullPointerException(Messages.getString("awt.26E")); //$NON-NLS-1$ } if (cspace == null) { - throw new IllegalArgumentException("The cspace is null"); + // awt.26F=The cspace is null + throw new IllegalArgumentException(Messages.getString("awt.26F")); //$NON-NLS-1$ } if (transparency < Transparency.OPAQUE || transparency > Transparency.TRANSLUCENT) { - throw new IllegalArgumentException("The transparency " + - "is not a valid value"); + // awt.270=The transparency is not a valid value + throw new IllegalArgumentException(Messages.getString("awt.270")); //$NON-NLS-1$ } this.pixel_bits = pixel_bits; @@ -119,8 +123,8 @@ public ColorModel(int bits) { if (bits < 1) { - throw new IllegalArgumentException("The number of " + - "bits in bits is less than 1"); + // awt.271=The number of bits in bits is less than 1 + throw new IllegalArgumentException(Messages.getString("awt.271")); //$NON-NLS-1$ } pixel_bits = bits; @@ -137,8 +141,8 @@ } public Object getDataElements(int[] components, int offset, Object obj) { - throw new UnsupportedOperationException("This method is not " + - "supported by this ColorModel"); + throw new UnsupportedOperationException("This method is not " + //$NON-NLS-1$ + "supported by this ColorModel"); //$NON-NLS-1$ } public Object getDataElements(float[] normComponents, int normOffset, @@ -149,8 +153,8 @@ } public Object getDataElements(int rgb, Object pixel) { - throw new UnsupportedOperationException("This method is not " + - "supported by this ColorModel"); + throw new UnsupportedOperationException("This method is not " + //$NON-NLS-1$ + "supported by this ColorModel"); //$NON-NLS-1$ } public WritableRaster getAlphaRaster(WritableRaster raster) { @@ -159,8 +163,8 @@ public ColorModel coerceData(WritableRaster raster, boolean isAlphaPremultiplied) { - throw new UnsupportedOperationException("This method is not " + - "supported by this ColorModel"); + throw new UnsupportedOperationException("This method is not " + //$NON-NLS-1$ + "supported by this ColorModel"); //$NON-NLS-1$ } @Override @@ -170,17 +174,17 @@ // ColorModel cm = new ComponentColorModel(ColorSpace.getInstance(ColorSpace.CS_sRGB, // false, false, Transparency.OPAQUE, DataBuffer.TYPE_BYTE); // System.out.println(cm.toString()); - return "ColorModel: Color Space = " + cs.toString() + "; has alpha = " - + hasAlpha + "; is alpha premultipied = " - + isAlphaPremultiplied + "; transparency = " + transparency - + "; number color components = " + numColorComponents - + "; pixel bits = " + pixel_bits + "; transfer type = " + return "ColorModel: Color Space = " + cs.toString() + "; has alpha = " //$NON-NLS-1$ //$NON-NLS-2$ + + hasAlpha + "; is alpha premultipied = " //$NON-NLS-1$ + + isAlphaPremultiplied + "; transparency = " + transparency //$NON-NLS-1$ + + "; number color components = " + numColorComponents //$NON-NLS-1$ + + "; pixel bits = " + pixel_bits + "; transfer type = " //$NON-NLS-1$ //$NON-NLS-2$ + transferType; } public int[] getComponents(Object pixel, int[] components, int offset) { - throw new UnsupportedOperationException("This method is not " + - "supported by this ColorModel"); + throw new UnsupportedOperationException("This method is not " + //$NON-NLS-1$ + "supported by this ColorModel"); //$NON-NLS-1$ } public float[] getNormalizedComponents(Object pixel, @@ -230,23 +234,23 @@ } public WritableRaster createCompatibleWritableRaster(int w, int h) { - throw new UnsupportedOperationException("This method is not " + - "supported by this ColorModel"); + throw new UnsupportedOperationException("This method is not " + //$NON-NLS-1$ + "supported by this ColorModel"); //$NON-NLS-1$ } public boolean isCompatibleSampleModel(SampleModel sm) { - throw new UnsupportedOperationException("This method is not " + - "supported by this ColorModel"); + throw new UnsupportedOperationException("This method is not " + //$NON-NLS-1$ + "supported by this ColorModel"); //$NON-NLS-1$ } public SampleModel createCompatibleSampleModel(int w, int h) { - throw new UnsupportedOperationException("This method is not " + - "supported by this ColorModel"); + throw new UnsupportedOperationException("This method is not " + //$NON-NLS-1$ + "supported by this ColorModel"); //$NON-NLS-1$ } public boolean isCompatibleRaster(Raster raster) { - throw new UnsupportedOperationException("This method is not " + - "supported by this ColorModel"); + throw new UnsupportedOperationException("This method is not " + //$NON-NLS-1$ + "supported by this ColorModel"); //$NON-NLS-1$ } public final ColorSpace getColorSpace() { @@ -256,21 +260,21 @@ public float[] getNormalizedComponents(int[] components, int offset, float normComponents[], int normOffset) { if (bits == null) { - throw new UnsupportedOperationException("The bits is null"); + // awt.26C=bits is null + throw new UnsupportedOperationException(Messages.getString("awt.26C")); //$NON-NLS-1$ } if (components.length - offset < numComponents) { - throw new IllegalArgumentException("The length of components " + - "minus offset is less than numComponents "); + // awt.272=The length of components minus offset is less than numComponents + throw new IllegalArgumentException(Messages.getString("awt.272")); //$NON-NLS-1$ } if (normComponents == null) { normComponents = new float[numComponents + offset]; } else { if (normComponents.length - normOffset < numComponents) { - throw new IllegalArgumentException("The length of " + - "normComponents minus normOffset is " + - "less than numComponents "); + // awt.273=The length of normComponents minus normOffset is less than numComponents + throw new IllegalArgumentException(Messages.getString("awt.273")); //$NON-NLS-1$ } } @@ -302,28 +306,29 @@ } public int getDataElement(int[] components, int offset) { - throw new UnsupportedOperationException("This method is not " + - "supported by this ColorModel"); + throw new UnsupportedOperationException("This method is not " + //$NON-NLS-1$ + "supported by this ColorModel"); //$NON-NLS-1$ } public int[] getUnnormalizedComponents(float normComponents[], int normOffset, int components[], int offset) { if (bits == null) { - throw new UnsupportedOperationException("The bits is null"); + // awt.26C=bits is null + throw new UnsupportedOperationException(Messages.getString("awt.26C")); //$NON-NLS-1$ } if (normComponents.length - normOffset < numComponents) { - throw new IllegalArgumentException("The length of normComponents " + - "minus normOffset is less than numComponents "); + // awt.273=The length of normComponents minus normOffset is less than numComponents + throw new IllegalArgumentException(Messages.getString("awt.273")); //$NON-NLS-1$ } if (components == null) { components = new int[numComponents + offset]; } else { if (components.length - offset < numComponents) { - throw new IllegalArgumentException("The length of components " + - "minus offset is less than numComponents "); + // awt.272=The length of components minus offset is less than numComponents + throw new IllegalArgumentException(Messages.getString("awt.272")); //$NON-NLS-1$ } } @@ -354,8 +359,8 @@ } public int[] getComponents(int pixel, int components[], int offset) { - throw new UnsupportedOperationException("This method is not " + - "supported by this ColorModel"); + throw new UnsupportedOperationException("This method is not " + //$NON-NLS-1$ + "supported by this ColorModel"); //$NON-NLS-1$ } public abstract int getRed(int pixel); @@ -369,13 +374,13 @@ public int getComponentSize(int componentIdx) { if (bits == null) { - throw new NullPointerException("The number of bits array is null"); + // awt.26C=bits is null + throw new NullPointerException(Messages.getString("awt.26C")); //$NON-NLS-1$ } if (componentIdx < 0 || componentIdx >= bits.length) { - throw new ArrayIndexOutOfBoundsException( - "componentIdx is greater than the number of components " + - "or less than zero"); + // awt.274=componentIdx is greater than the number of components or less than zero + throw new ArrayIndexOutOfBoundsException(Messages.getString("awt.274")); //$NON-NLS-1$ } return bits[componentIdx]; @@ -495,8 +500,8 @@ case DataBuffer.TYPE_BYTE: byte[] bPixel = (byte[]) obj; if(bPixel.length > 1) { - throw new UnsupportedOperationException("This pixel " + - "representation is not suuported by tis Color Model"); + // awt.275=This pixel representation is not suuported by tis Color Model + throw new UnsupportedOperationException(Messages.getString("awt.275")); //$NON-NLS-1$ } pixel = bPixel[0] & 0xff; break; @@ -504,8 +509,8 @@ case DataBuffer.TYPE_USHORT: short[] sPixel = (short[]) obj; if(sPixel.length > 1) { - throw new UnsupportedOperationException("This pixel " + - "representation is not suuported by tis Color Model"); + // awt.275=This pixel representation is not suuported by tis Color Model + throw new UnsupportedOperationException(Messages.getString("awt.275")); //$NON-NLS-1$ } pixel = sPixel[0] & 0xffff; break; @@ -513,15 +518,16 @@ case DataBuffer.TYPE_INT: int[] iPixel = (int[]) obj; if(iPixel.length > 1) { - throw new UnsupportedOperationException("This pixel " + - "representation is not suuported by tis Color Model"); + // awt.275=This pixel representation is not suuported by tis Color Model + throw new UnsupportedOperationException(Messages.getString("awt.275")); //$NON-NLS-1$ } pixel = iPixel[0]; break; default: - throw new UnsupportedOperationException("This transferType (" + - transferType + ")is not supported"); + // awt.22D=This transferType ( {0} ) is not supported by this color model + throw new UnsupportedOperationException(Messages.getString("awt.22D", //$NON-NLS-1$ + transferType)); } return pixel; Index: src/main/java/common/java/awt/image/ComponentColorModel.java =================================================================== --- src/main/java/common/java/awt/image/ComponentColorModel.java (revision 470363) +++ src/main/java/common/java/awt/image/ComponentColorModel.java (working copy) @@ -23,6 +23,7 @@ import java.awt.color.ColorSpace; import org.apache.harmony.awt.gl.color.LUTColorConverter; +import org.apache.harmony.awt.internal.nls.Messages; public class ComponentColorModel extends ColorModel { @@ -136,10 +137,11 @@ donotSupportUnnormalized = true; break; default: - throw new IllegalArgumentException("transferType is not " + - "one of DataBuffer.TYPE_BYTE, DataBuffer.TYPE_USHORT, " + - "DataBuffer.TYPE_INT, DataBuffer.TYPE_SHORT, " + - "DataBuffer.TYPE_FLOAT, or DataBuffer.TYPE_DOUBLE"); + // awt.215=transferType is not one of DataBuffer.TYPE_BYTE, + // DataBuffer.TYPE_USHORT, DataBuffer.TYPE_INT, + // DataBuffer.TYPE_SHORT, DataBuffer.TYPE_FLOAT, or + // DataBuffer.TYPE_DOUBLE + throw new IllegalArgumentException(Messages.getString("awt.215")); //$NON-NLS-1$ } needAlphaDivide = hasAlpha && isAlphaPremultiplied; @@ -206,13 +208,13 @@ @Override public Object getDataElements(int components[], int offset, Object obj) { if (donotSupportUnnormalized) { - throw new IllegalArgumentException("This ComponentColorModel " + - "does not support the unnormalized form"); + // awt.213=This ComponentColorModel does not support the unnormalized form + throw new IllegalArgumentException(Messages.getString("awt.213")); //$NON-NLS-1$ } if (offset + numComponents > components.length) { - throw new IllegalArgumentException("The components array is not " + - "large enough to hold all the color and alpha components "); + // awt.216=The components array is not large enough to hold all the color and alpha components + throw new IllegalArgumentException(Messages.getString("awt.216")); //$NON-NLS-1$ } switch (transferType) { @@ -250,11 +252,11 @@ } return ia; default: - throw new UnsupportedOperationException( - "The transfer type of this ComponentColorModel" + - " is not one of the following transfer types: " + - "DataBuffer.TYPE_BYTE, DataBuffer.TYPE_USHORT, " + - "or DataBuffer.TYPE_INT"); + // awt.217=The transfer type of this ComponentColorModel is not one + // of the following transfer types: DataBuffer.TYPE_BYTE, + // DataBuffer.TYPE_USHORT, or DataBuffer.TYPE_INT + throw new UnsupportedOperationException(Messages + .getString("awt.217")); //$NON-NLS-1$ } } @@ -415,9 +417,8 @@ return da; default: - throw new IllegalArgumentException("This ComponentColorModel " + - "does not support the unnormalized form"); - + // awt.213=This ComponentColorModel does not support the unnormalized form + throw new IllegalArgumentException(Messages.getString("awt.213")); //$NON-NLS-1$ } } @@ -606,8 +607,8 @@ break; default: - throw new UnsupportedOperationException("This transferType " + - "is not supported by this color model"); + // awt.219=This transferType is not supported by this color model + throw new UnsupportedOperationException(Messages.getString("awt.219")); //$NON-NLS-1$ } } else { switch (transferType) { @@ -707,8 +708,8 @@ } break; default: - throw new UnsupportedOperationException("This transferType " + - "is not supported by this color model"); + // awt.219=This transferType is not supported by this color model + throw new UnsupportedOperationException(Messages.getString("awt.219")); //$NON-NLS-1$ } } @@ -724,15 +725,15 @@ @Override public int[] getComponents(Object pixel, int[] components, int offset) { if (donotSupportUnnormalized) { - throw new IllegalArgumentException("This ComponentColorModel " + - "does not support the unnormalized form"); + // awt.213=This ComponentColorModel does not support the unnormalized form + throw new IllegalArgumentException(Messages.getString("awt.213")); //$NON-NLS-1$ } if (components == null) { components = new int[offset + numComponents]; } else if (offset + numComponents > components.length) { - throw new IllegalArgumentException("The components array is not " + - "large enough to hold all the color and alpha components "); + // awt.218=The components array is not large enough to hold all the color and alpha components + throw new IllegalArgumentException(Messages.getString("awt.218")); //$NON-NLS-1$ } switch (transferType) { @@ -759,10 +760,11 @@ return components; default: - throw new UnsupportedOperationException("The transfer type " + - "of this ComponentColorModel is not one of the " + - "following transfer types: DataBuffer.TYPE_BYTE, " + - "DataBuffer.TYPE_USHORT, or DataBuffer.TYPE_INT"); + // awt.217=The transfer type of this ComponentColorModel is not one + // of the following transfer types: DataBuffer.TYPE_BYTE, + // DataBuffer.TYPE_USHORT, or DataBuffer.TYPE_INT + throw new UnsupportedOperationException(Messages + .getString("awt.217")); //$NON-NLS-1$ } } @@ -820,8 +822,8 @@ break; default: - throw new IllegalArgumentException("This ComponentColorModel " + - "does not support this transferType"); + // awt.21A=This ComponentColorModel does not support this transferType + throw new IllegalArgumentException(Messages.getString("awt.21A")); //$NON-NLS-1$ } if (needAlphaDivide) { @@ -925,8 +927,8 @@ return (int) (da[numColorComponents] * 255.0 + 0.5); } default: { - throw new UnsupportedOperationException("This Color Model " + - "doesn't support this transferType"); + // awt.214=This Color Model doesn't support this transferType + throw new UnsupportedOperationException(Messages.getString("awt.214")); //$NON-NLS-1$ } } } @@ -998,8 +1000,8 @@ public float[] getNormalizedComponents(int components[], int offset, float normComponents[], int normOffset) { if (donotSupportUnnormalized) { - throw new IllegalArgumentException("This ComponentColorModel " + - "does not support the unnormalized form"); + // awt.213=This ComponentColorModel does not support the unnormalized form + throw new IllegalArgumentException(Messages.getString("awt.213")); //$NON-NLS-1$ } return super.getNormalizedComponents(components, offset, @@ -1009,12 +1011,12 @@ @Override public int getDataElement(int[] components, int offset) { if (numComponents > 1) { - throw new IllegalArgumentException("There is more than one " + - "component in this ColorModel"); + // awt.212=There is more than one component in this ColorModel + throw new IllegalArgumentException(Messages.getString("awt.212")); //$NON-NLS-1$ } if (donotSupportUnnormalized) { - throw new IllegalArgumentException("This ComponentColorModel " + - "does not support the unnormalized form"); + // awt.213=This ComponentColorModel does not support the unnormalized form + throw new IllegalArgumentException(Messages.getString("awt.213")); //$NON-NLS-1$ } return components[offset]; } @@ -1024,14 +1026,13 @@ int normOffset, int[] components, int offset) { if (donotSupportUnnormalized) { - throw new IllegalArgumentException("This ComponentColorModel " + - "does not support the unnormalized form "); + // awt.213=This ComponentColorModel does not support the unnormalized form + throw new IllegalArgumentException(Messages.getString("awt.213")); //$NON-NLS-1$ } if (normComponents.length - normOffset < numComponents) { - throw new IllegalArgumentException("The length of " + - "normComponents minus normOffset is less than" + - " numComponents"); + // awt.21B=The length of normComponents minus normOffset is less than numComponents + throw new IllegalArgumentException(Messages.getString("awt.21B")); //$NON-NLS-1$ } return super.getUnnormalizedComponents(normComponents, normOffset, @@ -1041,12 +1042,12 @@ @Override public int getDataElement(float normComponents[], int normOffset) { if (numComponents > 1) { - throw new IllegalArgumentException("There is more than one " + - "component in this ColorModel"); + // awt.212=There is more than one component in this ColorModel + throw new IllegalArgumentException(Messages.getString("awt.212")); //$NON-NLS-1$ } if (signed) { - throw new IllegalArgumentException("The component value for " + - "this ColorModel is signed"); + // awt.210=The component value for this ColorModel is signed + throw new IllegalArgumentException(Messages.getString("awt.210")); //$NON-NLS-1$ } Object pixel = getDataElements(normComponents, normOffset, null); @@ -1062,21 +1063,21 @@ int ia[] = (int[]) pixel; return ia[0]; default: - throw new IllegalArgumentException("Pixel values for " + - "this ColorModel are not conveniently representable " + - "as a single int "); + // awt.211=Pixel values for this ColorModel are not conveniently + // representable as a single int + throw new IllegalArgumentException(Messages.getString("awt.211")); //$NON-NLS-1$ } } @Override public int[] getComponents(int pixel, int components[], int offset) { if (numComponents > 1) { - throw new IllegalArgumentException("There is more than one " + - "component in this ColorModel"); + // awt.212=There is more than one component in this ColorModel + throw new IllegalArgumentException(Messages.getString("awt.212")); //$NON-NLS-1$ } if (donotSupportUnnormalized) { - throw new IllegalArgumentException("This ComponentColorModel " + - "does not support the unnormalized form"); + // awt.213=This ComponentColorModel does not support the unnormalized form + throw new IllegalArgumentException(Messages.getString("awt.213")); //$NON-NLS-1$ } if (components == null) { @@ -1117,13 +1118,13 @@ // This method throw IllegalArgumentException according to // Java API Spacification if (signed) { - throw new IllegalArgumentException("The component value " + - "for this ColorModel is signed"); + // awt.210=The component value for this ColorModel is signed + throw new IllegalArgumentException(Messages.getString("awt.210")); //$NON-NLS-1$ } if (numComponents > 1) { - throw new IllegalArgumentException("There is more than one " + - "component in this ColorModel"); + // awt.212=There is more than one component in this ColorModel + throw new IllegalArgumentException(Messages.getString("awt.212")); //$NON-NLS-1$ } return 255; @@ -1221,13 +1222,13 @@ // This method throw IllegalArgumentException according to // Java API Spacification if (signed) { - throw new IllegalArgumentException("The component value " + - "for this ColorModel is signed"); + // awt.210=The component value for this ColorModel is signed + throw new IllegalArgumentException(Messages.getString("awt.210")); //$NON-NLS-1$ } if (numComponents > 1) { - throw new IllegalArgumentException("There is more than " + - "one component in this ColorModel"); + // awt.212=There is more than one component in this ColorModel + throw new IllegalArgumentException(Messages.getString("awt.212")); //$NON-NLS-1$ } Object obj = null; @@ -1382,8 +1383,8 @@ return comp; default: - throw new UnsupportedOperationException("This Color Model " + - "doesn't support this transferType"); + // awt.214=This Color Model doesn't support this transferType + throw new UnsupportedOperationException(Messages.getString("awt.214")); //$NON-NLS-1$ } } Index: src/main/java/common/java/awt/image/ComponentSampleModel.java =================================================================== --- src/main/java/common/java/awt/image/ComponentSampleModel.java (revision 470363) +++ src/main/java/common/java/awt/image/ComponentSampleModel.java (working copy) @@ -22,6 +22,8 @@ import java.util.Arrays; +import org.apache.harmony.awt.internal.nls.Messages; + public class ComponentSampleModel extends SampleModel { protected int bandOffsets[]; @@ -42,16 +44,18 @@ super(dataType, w, h, bandOffsets.length); if (pixelStride < 0) { - throw new IllegalArgumentException("Pixel stride must be >= 0"); + // awt.24B=Pixel stride must be >= 0 + throw new IllegalArgumentException(Messages.getString("awt.24B")); //$NON-NLS-1$ } if (scanlineStride < 0) { - throw new IllegalArgumentException("Scanline stride must be >= 0"); + // awt.24C=Scanline stride must be >= 0 + throw new IllegalArgumentException(Messages.getString("awt.24C")); //$NON-NLS-1$ } if (bankIndices.length != bandOffsets.length) { - throw new IllegalArgumentException("Bank Indices length must be " + - "equal Bank Offsets length"); + // awt.24D=Bank Indices length must be equal Bank Offsets length + throw new IllegalArgumentException(Messages.getString("awt.24D")); //$NON-NLS-1$ } this.pixelStride = pixelStride; @@ -63,8 +67,8 @@ int maxBank = 0; for (int i = 0; i < bankIndices.length; i++) { if (bankIndices[i] < 0) { - throw new IllegalArgumentException("Index of " + i - + "bank must be >= 0"); + // awt.24E=Index of {0} bank must be >= 0 + throw new IllegalArgumentException(Messages.getString("awt.24E", i)); //$NON-NLS-1$ } if (bankIndices[i] > maxBank) { maxBank = bankIndices[i]; @@ -79,11 +83,13 @@ super(dataType, w, h, bandOffsets.length); if (pixelStride < 0) { - throw new IllegalArgumentException("Pixel stride must be >= 0"); + // awt.24B=Pixel stride must be >= 0 + throw new IllegalArgumentException(Messages.getString("awt.24B")); //$NON-NLS-1$ } if (scanlineStride < 0) { - throw new IllegalArgumentException("Scanline stride must be >= 0"); + // awt.24C=Scanline stride must be >= 0 + throw new IllegalArgumentException(Messages.getString("awt.24C")); //$NON-NLS-1$ } this.pixelStride = pixelStride; @@ -242,9 +248,8 @@ @Override public SampleModel createSubsetSampleModel(int bands[]) { if (bands.length > this.numBands) { - throw new RasterFormatException("The number of the bands " + - "in the subset is greater than the number of bands " + - "in the sample model"); + // awt.64=The number of the bands in the subset is greater than the number of bands in the sample model + throw new RasterFormatException(Messages.getString("awt.64")); //$NON-NLS-1$ } int indices[] = new int[bands.length]; @@ -293,8 +298,8 @@ @Override public int getSample(int x, int y, int b, DataBuffer data) { if (x < 0 || y < 0 || x >= this.width || y >= this.height) { - throw new ArrayIndexOutOfBoundsException("Coordinates are " + - "not in bounds"); + // awt.63=Coordinates are not in bounds + throw new ArrayIndexOutOfBoundsException(Messages.getString("awt.63")); //$NON-NLS-1$ } return data.getElem(bankIndices[b], y * scanlineStride + @@ -304,8 +309,8 @@ @Override public float getSampleFloat(int x, int y, int b, DataBuffer data) { if (x < 0 || y < 0 || x >= this.width || y >= this.height) { - throw new ArrayIndexOutOfBoundsException("Coordinates are " + - "not in bounds"); + // awt.63=Coordinates are not in bounds + throw new ArrayIndexOutOfBoundsException(Messages.getString("awt.63")); //$NON-NLS-1$ } return data.getElemFloat(bankIndices[b], y * scanlineStride + @@ -315,8 +320,8 @@ @Override public double getSampleDouble(int x, int y, int b, DataBuffer data) { if (x < 0 || y < 0 || x >= this.width || y >= this.height) { - throw new ArrayIndexOutOfBoundsException("Coordinates are " + - "not in bounds"); + // awt.63=Coordinates are not in bounds + throw new ArrayIndexOutOfBoundsException(Messages.getString("awt.63")); //$NON-NLS-1$ } return data.getElemDouble(bankIndices[b], y * scanlineStride + @@ -327,8 +332,8 @@ public int[] getPixels(int x, int y, int w, int h, int iArray[], DataBuffer data) { if (x < 0 || y < 0 || x + w > this.width || y + h > this.height) { - throw new ArrayIndexOutOfBoundsException("Coordinates are " + - "not in bounds"); + // awt.63=Coordinates are not in bounds + throw new ArrayIndexOutOfBoundsException(Messages.getString("awt.63")); //$NON-NLS-1$ } int pixels[] = null; int idx = 0; @@ -354,8 +359,8 @@ public void setPixels(int x, int y, int w, int h, int iArray[], DataBuffer data) { if (x < 0 || y < 0 || x + w > this.width || y + h > this.height) { - throw new ArrayIndexOutOfBoundsException("Coordinates are " + - "not in bounds"); + // awt.63=Coordinates are not in bounds + throw new ArrayIndexOutOfBoundsException(Messages.getString("awt.63")); //$NON-NLS-1$ } int idx = 0; for (int i = y; i < y + h; i++) { @@ -370,8 +375,8 @@ @Override public void setSample(int x, int y, int b, int s, DataBuffer data) { if (x < 0 || y < 0 || x >= this.width || y >= this.height) { - throw new ArrayIndexOutOfBoundsException("Coordinates are " + - "not in bounds"); + // awt.63=Coordinates are not in bounds + throw new ArrayIndexOutOfBoundsException(Messages.getString("awt.63")); //$NON-NLS-1$ } data.setElem(bankIndices[b], y * scanlineStride + x * pixelStride @@ -382,8 +387,8 @@ public int[] getSamples(int x, int y, int w, int h, int b, int iArray[], DataBuffer data) { if (x < 0 || y < 0 || x + w > this.width || y + h > this.height) { - throw new ArrayIndexOutOfBoundsException("Coordinates are " + - "not in bounds"); + // awt.63=Coordinates are not in bounds + throw new ArrayIndexOutOfBoundsException(Messages.getString("awt.63")); //$NON-NLS-1$ } int samples[]; int idx = 0; @@ -407,8 +412,8 @@ public void setSamples(int x, int y, int w, int h, int b, int iArray[], DataBuffer data) { if (x < 0 || y < 0 || x + w > this.width || y + h > this.height) { - throw new ArrayIndexOutOfBoundsException("Coordinates are " + - "not in bounds"); + // awt.63=Coordinates are not in bounds + throw new ArrayIndexOutOfBoundsException(Messages.getString("awt.63")); //$NON-NLS-1$ } int idx = 0; for (int i = y; i < y + h; i++) { @@ -421,8 +426,8 @@ @Override public void setSample(int x, int y, int b, float s, DataBuffer data) { if (x < 0 || y < 0 || x >= this.width || y >= this.height) { - throw new ArrayIndexOutOfBoundsException("Coordinates are " + - "not in bounds"); + // awt.63=Coordinates are not in bounds + throw new ArrayIndexOutOfBoundsException(Messages.getString("awt.63")); //$NON-NLS-1$ } data.setElemFloat(bankIndices[b], y * scanlineStride + @@ -432,8 +437,8 @@ @Override public void setSample(int x, int y, int b, double s, DataBuffer data) { if (x < 0 || y < 0 || x >= this.width || y >= this.height) { - throw new ArrayIndexOutOfBoundsException("Coordinates are " + - "not in bounds"); + // awt.63=Coordinates are not in bounds + throw new ArrayIndexOutOfBoundsException(Messages.getString("awt.63")); //$NON-NLS-1$ } data.setElemDouble(bankIndices[b], y * scanlineStride + Index: src/main/java/common/java/awt/image/ConvolveOp.java =================================================================== --- src/main/java/common/java/awt/image/ConvolveOp.java (revision 470363) +++ src/main/java/common/java/awt/image/ConvolveOp.java (working copy) @@ -29,6 +29,7 @@ import java.util.Arrays; import org.apache.harmony.awt.gl.AwtImageBackdoorAccessor; +import org.apache.harmony.awt.internal.nls.Messages; public class ConvolveOp implements BufferedImageOp, RasterOp { @@ -113,26 +114,28 @@ public final WritableRaster filter(Raster src, WritableRaster dst) { if (src == null) { // Should throw according to spec - throw new NullPointerException("Source raster is null"); + // awt.256=Source raster is null + throw new NullPointerException(Messages.getString("awt.256")); //$NON-NLS-1$ } if (src == dst){ - throw new IllegalArgumentException("Source raster is equal to destination"); + // awt.257=Source raster is equal to destination + throw new IllegalArgumentException(Messages.getString("awt.257")); //$NON-NLS-1$ } if (dst == null) { dst = createCompatibleDestRaster(src); } else if (src.getNumBands() != dst.getNumBands()) { + // awt.258=Number of source bands ({0}) is not equal to number of destination bands ({1}) throw new IllegalArgumentException( - "Number of source bands (" + src.getNumBands() + - ") is not equal to number of destination bands (" + dst.getNumBands() + ")" - ); + Messages.getString("awt.258", src.getNumBands(), dst.getNumBands())); //$NON-NLS-1$ } // TODO //if (ippFilter(src, dst, BufferedImage.TYPE_CUSTOM) != 0) if (slowFilter(src, dst) != 0) { - throw new ImagingOpException ("Unable to transform source"); + // awt.21F=Unable to transform source + throw new ImagingOpException (Messages.getString("awt.21F")); //$NON-NLS-1$ } return dst; @@ -240,11 +243,13 @@ public final BufferedImage filter(BufferedImage src, BufferedImage dst) { if (src == null) { - throw new NullPointerException("Source image is null"); + // awt.259=Source image is null + throw new NullPointerException(Messages.getString("awt.259")); //$NON-NLS-1$ } if (src == dst){ - throw new IllegalArgumentException("Source equals to destination"); + // awt.25A=Source equals to destination + throw new IllegalArgumentException(Messages.getString("awt.25A")); //$NON-NLS-1$ } ColorModel srcCM = src.getColorModel(); @@ -276,7 +281,8 @@ // TODO //if (ippFilter(src.getRaster(), dst.getRaster(), src.getType()) != 0) if (slowFilter(src.getRaster(), dst.getRaster()) != 0) { - throw new ImagingOpException ("Unable to transform source"); + // awt.21F=Unable to transform source + throw new ImagingOpException (Messages.getString("awt.21F")); //$NON-NLS-1$ } if (finalDst != null) { Index: src/main/java/common/java/awt/image/CropImageFilter.java =================================================================== --- src/main/java/common/java/awt/image/CropImageFilter.java (revision 470363) +++ src/main/java/common/java/awt/image/CropImageFilter.java (working copy) @@ -42,15 +42,15 @@ } else { fprops = (Hashtable) props.clone(); } - String propName = "Crop Filters"; - String prop = "x=" + X + "; y=" + Y + "; width=" + - WIDTH + "; height=" + HEIGHT; + String propName = "Crop Filters"; //$NON-NLS-1$ + String prop = "x=" + X + "; y=" + Y + "; width=" + //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + WIDTH + "; height=" + HEIGHT; //$NON-NLS-1$ Object o = fprops.get(propName); if(o != null){ if(o instanceof String){ - prop = (String)o + "; " + prop; + prop = (String)o + "; " + prop; //$NON-NLS-1$ }else{ - prop = o.toString() + "; " + prop; + prop = o.toString() + "; " + prop; //$NON-NLS-1$ } } fprops.put(propName, prop); Index: src/main/java/common/java/awt/image/DataBuffer.java =================================================================== --- src/main/java/common/java/awt/image/DataBuffer.java (revision 470363) +++ src/main/java/common/java/awt/image/DataBuffer.java (working copy) @@ -21,6 +21,7 @@ package java.awt.image; import org.apache.harmony.awt.gl.image.DataBufferListener; +import org.apache.harmony.awt.internal.nls.Messages; public abstract class DataBuffer { @@ -174,7 +175,8 @@ return 64; default: - throw new IllegalArgumentException("Unknown data type " + type); + // awt.22C=Unknown data type {0} + throw new IllegalArgumentException(Messages.getString("awt.22C", type)); //$NON-NLS-1$ } } Index: src/main/java/common/java/awt/image/DirectColorModel.java =================================================================== --- src/main/java/common/java/awt/image/DirectColorModel.java (revision 470363) +++ src/main/java/common/java/awt/image/DirectColorModel.java (working copy) @@ -25,6 +25,7 @@ import java.util.Arrays; import org.apache.harmony.awt.gl.color.LUTColorConverter; +import org.apache.harmony.awt.internal.nls.Messages; public class DirectColorModel extends PackedColorModel { @@ -121,8 +122,8 @@ break; default: - throw new UnsupportedOperationException("This transferType is " + - "not supported by this color model"); + // awt.214=This Color Model doesn't support this transferType + throw new UnsupportedOperationException(Messages.getString("awt.214")); //$NON-NLS-1$ } return obj; @@ -247,8 +248,8 @@ return ia; default: - throw new UnsupportedOperationException("This transferType " + - "is not supported by this color model"); + // awt.214=This Color Model doesn't support this transferType + throw new UnsupportedOperationException(Messages.getString("awt.214")); //$NON-NLS-1$ } } @@ -296,8 +297,8 @@ break; default: - throw new UnsupportedOperationException("This transferType " + - "is not supported by this color model"); + // awt.214=This Color Model doesn't support this transferType + throw new UnsupportedOperationException(Messages.getString("awt.214")); //$NON-NLS-1$ } } else { switch (transferType) { @@ -322,8 +323,8 @@ break; default: - throw new UnsupportedOperationException("This transferType " + - "is not supported by this color model"); + // awt.214=This Color Model doesn't support this transferType + throw new UnsupportedOperationException(Messages.getString("awt.214")); //$NON-NLS-1$ } } @@ -340,11 +341,11 @@ // BufferedImage bi = new BufferedImage(1, 1, BufferedImage.TYPE_INT_ARGB); // ColorModel cm = bi.getColorModel(); // System.out.println(cm.toString()); - String str = "DirectColorModel:" + " rmask = " + - Integer.toHexString(componentMasks[0]) + " gmask = " + - Integer.toHexString(componentMasks[1]) + " bmask = " + - Integer.toHexString(componentMasks[2]) + " amask = " + - (!hasAlpha ? "0" : Integer.toHexString(componentMasks[3])); + String str = "DirectColorModel:" + " rmask = " + //$NON-NLS-1$ //$NON-NLS-2$ + Integer.toHexString(componentMasks[0]) + " gmask = " + //$NON-NLS-1$ + Integer.toHexString(componentMasks[1]) + " bmask = " + //$NON-NLS-1$ + Integer.toHexString(componentMasks[2]) + " amask = " + //$NON-NLS-1$ + (!hasAlpha ? "0" : Integer.toHexString(componentMasks[3])); //$NON-NLS-1$ return str; } @@ -376,8 +377,9 @@ break; default: - throw new UnsupportedOperationException("This transferType ( " + - transferType + " ) is not supported by this color model"); + // awt.22D=This transferType ( {0} ) is not supported by this color model + throw new UnsupportedOperationException(Messages.getString("awt.22D", //$NON-NLS-1$ + transferType)); } return getComponents(intPixel, components, offset); @@ -403,8 +405,8 @@ break; default: - throw new UnsupportedOperationException("This tranferType is " + - "not supported by this ColorModel"); + // awt.214=This Color Model doesn't support this transferType + throw new UnsupportedOperationException(Messages.getString("awt.214")); //$NON-NLS-1$ } return getRed(pixel); } @@ -429,8 +431,8 @@ break; default: - throw new UnsupportedOperationException("This tranferType is " + - "not supported by this ColorModel"); + // awt.214=This Color Model doesn't support this transferType + throw new UnsupportedOperationException(Messages.getString("awt.214")); //$NON-NLS-1$ } return getRGB(pixel); } @@ -455,8 +457,8 @@ break; default: - throw new UnsupportedOperationException("This tranferType is " + - "not supported by this ColorModel"); + // awt.214=This Color Model doesn't support this transferType + throw new UnsupportedOperationException(Messages.getString("awt.214")); //$NON-NLS-1$ } return getGreen(pixel); } @@ -481,8 +483,8 @@ break; default: - throw new UnsupportedOperationException("This tranferType is " + - "not supported by this ColorModel"); + // awt.214=This Color Model doesn't support this transferType + throw new UnsupportedOperationException(Messages.getString("awt.214")); //$NON-NLS-1$ } return getBlue(pixel); } @@ -507,8 +509,8 @@ break; default: - throw new UnsupportedOperationException("This tranferType is " + - "not supported by this ColorModel"); + // awt.214=This Color Model doesn't support this transferType + throw new UnsupportedOperationException(Messages.getString("awt.214")); //$NON-NLS-1$ } return getAlpha(pixel); } @@ -516,8 +518,8 @@ @Override public final WritableRaster createCompatibleWritableRaster(int w, int h) { if (w <= 0 || h <= 0) { - throw new IllegalArgumentException("w or h is less than or " + - "equal to zero"); + // awt.22E=w or h is less than or equal to zero + throw new IllegalArgumentException(Messages.getString("awt.22E")); //$NON-NLS-1$ } int bandMasks[] = componentMasks.clone(); Index: src/main/java/common/java/awt/image/ImageFilter.java =================================================================== --- src/main/java/common/java/awt/image/ImageFilter.java (revision 470363) +++ src/main/java/common/java/awt/image/ImageFilter.java (working copy) @@ -44,14 +44,14 @@ } else { fprops = (Hashtable) props.clone(); } - String propName = "Filters"; - String prop = "Null filter"; + String propName = "Filters"; //$NON-NLS-1$ + String prop = "Null filter"; //$NON-NLS-1$ Object o = fprops.get(propName); if (o != null) { if (o instanceof String) { - prop = (String) o + "; " + prop; + prop = (String) o + "; " + prop; //$NON-NLS-1$ } else { - prop = o.toString() + "; " + prop; + prop = o.toString() + "; " + prop; //$NON-NLS-1$ } } fprops.put(propName, prop); Index: src/main/java/common/java/awt/image/IndexColorModel.java =================================================================== --- src/main/java/common/java/awt/image/IndexColorModel.java (revision 470363) +++ src/main/java/common/java/awt/image/IndexColorModel.java (working copy) @@ -24,6 +24,8 @@ import java.awt.color.ColorSpace; import java.math.BigInteger; +import org.apache.harmony.awt.internal.nls.Messages; + public class IndexColorModel extends ColorModel { private int colorMap[]; // Color Map @@ -57,8 +59,8 @@ Transparency.OPAQUE, validateTransferType(transferType)); if (size < 1) { - throw new IllegalArgumentException("Size of the color map is " + - "less than 1"); + // awt.264=Size of the color map is less than 1 + throw new IllegalArgumentException(Messages.getString("awt.264")); //$NON-NLS-1$ } mapSize = size; @@ -111,8 +113,8 @@ validateTransferType(transferType)); if (size < 1) { - throw new IllegalArgumentException("Size of the color map " + - "is less than 1"); + // awt.264=Size of the color map is less than 1 + throw new IllegalArgumentException(Messages.getString("awt.264")); //$NON-NLS-1$ } mapSize = size; @@ -202,8 +204,8 @@ validateTransferType(ColorModel.getTransferType(bits))); if (size < 1) { - throw new IllegalArgumentException("Size of the color map " + - "is less than 1"); + // awt.264=Size of the color map is less than 1 + throw new IllegalArgumentException(Messages.getString("awt.264")); //$NON-NLS-1$ } mapSize = size; @@ -354,8 +356,8 @@ boolean forceARGB) { if (!isCompatibleRaster(raster)) { - throw new IllegalArgumentException("The raster argument is " + - "not compatible with this IndexColorModel"); + // awt.265=The raster argument is not compatible with this IndexColorModel + throw new IllegalArgumentException(Messages.getString("awt.265")); //$NON-NLS-1$ } ColorModel model; @@ -425,20 +427,20 @@ // BufferedImage bi = new BufferedImage(1, 1, BufferedImage.TYPE_BYTE_INDEXED); // ColorModel cm = bi.getColorModel(); // System.out.println(cm.toString()); - String str = "IndexColorModel: #pixel_bits = " + pixel_bits + - " numComponents = " + numComponents + " color space = " + cs + - " transparency = "; + String str = "IndexColorModel: #pixel_bits = " + pixel_bits + //$NON-NLS-1$ + " numComponents = " + numComponents + " color space = " + cs + //$NON-NLS-1$ //$NON-NLS-2$ + " transparency = "; //$NON-NLS-1$ if (transparency == Transparency.OPAQUE) { - str = str + "Transparency.OPAQUE"; + str = str + "Transparency.OPAQUE"; //$NON-NLS-1$ } else if (transparency == Transparency.BITMASK) { - str = str + "Transparency.BITMASK"; + str = str + "Transparency.BITMASK"; //$NON-NLS-1$ } else { - str = str + "Transparency.TRANSLUCENT"; + str = str + "Transparency.TRANSLUCENT"; //$NON-NLS-1$ } - str = str + " transIndex = " + transparentIndex + " has alpha = " + - hasAlpha + " isAlphaPre = " + isAlphaPremultiplied; + str = str + " transIndex = " + transparentIndex + " has alpha = " + //$NON-NLS-1$ //$NON-NLS-2$ + hasAlpha + " isAlphaPre = " + isAlphaPremultiplied; //$NON-NLS-1$ return str; } @@ -456,8 +458,8 @@ int ia[] = (int[]) pixel; pixIdx = ia[0]; } else { - throw new UnsupportedOperationException("The transferType is " + - "not one of the supported transer types"); + // awt.219=This transferType is not supported by this color model + throw new UnsupportedOperationException(Messages.getString("awt.219")); //$NON-NLS-1$ } return getComponents(pixIdx, components, offset); @@ -476,8 +478,8 @@ raster = Raster.createInterleavedRaster(DataBuffer.TYPE_USHORT, w, h, 1, null); } else { - throw new UnsupportedOperationException("The number of bits " + - "in a pixel is greater than 16"); + // awt.266=The number of bits in a pixel is greater than 16 + throw new UnsupportedOperationException(Messages.getString("awt.266")); //$NON-NLS-1$ } return raster; @@ -546,8 +548,8 @@ pixel = sa[0] & 0xffff; break; default: - throw new UnsupportedOperationException("The transferType " + - "is invalid"); + // awt.267=The transferType is invalid + throw new UnsupportedOperationException(Messages.getString("awt.267")); //$NON-NLS-1$ } return pixel; @@ -660,8 +662,8 @@ private void createColorMap(int size, byte r[], byte g[], byte b[], byte a[], int trans) { if (size < 1) { - throw new IllegalArgumentException("Size of the color map is " + - "less than 1"); + // awt.264=Size of the color map is less than 1 + throw new IllegalArgumentException(Messages.getString("awt.264")); //$NON-NLS-1$ } mapSize = size; @@ -748,8 +750,8 @@ pixel = sa; break; default: - throw new UnsupportedOperationException("The transferType " + - "is invalid"); + // awt.267=The transferType is invalid + throw new UnsupportedOperationException(Messages.getString("awt.267")); //$NON-NLS-1$ } } else if (pixel instanceof byte[] && transferType == DataBuffer.TYPE_BYTE) { @@ -766,8 +768,8 @@ ia[0] = colorMapIdx; pixel = ia; } else { - throw new ClassCastException("The pixel is not a primitive " + - "array of type transferType"); + // awt.268=The pixel is not a primitive array of type transferType + throw new ClassCastException(Messages.getString("awt.268")); //$NON-NLS-1$ } return pixel; } @@ -793,8 +795,8 @@ private static int validateTransferType(int transferType) { if (transferType != DataBuffer.TYPE_BYTE && transferType != DataBuffer.TYPE_USHORT) { - throw new IllegalArgumentException("The transferType is not " + - "one of DataBuffer.TYPE_BYTE or DataBuffer.TYPE_USHORT"); + // awt.269=The transferType is not one of DataBuffer.TYPE_BYTE or DataBuffer.TYPE_USHORT + throw new IllegalArgumentException(Messages.getString("awt.269")); //$NON-NLS-1$ } return transferType; } Index: src/main/java/common/java/awt/image/Kernel.java =================================================================== --- src/main/java/common/java/awt/image/Kernel.java (revision 470363) +++ src/main/java/common/java/awt/image/Kernel.java (working copy) @@ -23,6 +23,8 @@ package java.awt.image; +import org.apache.harmony.awt.internal.nls.Messages; + public class Kernel implements Cloneable { private final int xOrigin; private final int yOrigin; @@ -33,8 +35,8 @@ public Kernel(int width, int height, float[] data) { int dataLength = width*height; if (data.length < dataLength) { - throw new IllegalArgumentException( - "Length of data should not be less than width*height"); + // awt.22B=Length of data should not be less than width*height + throw new IllegalArgumentException(Messages.getString("awt.22B")); //$NON-NLS-1$ } this.width = width; Index: src/main/java/common/java/awt/image/LookupOp.java =================================================================== --- src/main/java/common/java/awt/image/LookupOp.java (revision 470363) +++ src/main/java/common/java/awt/image/LookupOp.java (working copy) @@ -29,6 +29,7 @@ import java.util.Arrays; import org.apache.harmony.awt.gl.AwtImageBackdoorAccessor; +import org.apache.harmony.awt.internal.nls.Messages; public class LookupOp implements BufferedImageOp, RasterOp { private final LookupTable lut; @@ -131,23 +132,20 @@ if (dst == null) { dst = createCompatibleDestRaster(src); } else if (src.getNumBands() != dst.getNumBands()) { - throw new IllegalArgumentException( - "Source and destinations rasters do not have " + - "the same number of bands" - ); + // awt.237=Source and destinations rasters do not have the same number of bands + throw new IllegalArgumentException(Messages.getString("awt.237")); //$NON-NLS-1$ } if (lut.getNumComponents() != 1 && lut.getNumComponents() != src.getNumBands()) { - throw new IllegalArgumentException( - "The number of arrays in the LookupTable does not " + - "meet the restrictions" - ); + // awt.238=The number of arrays in the LookupTable does not meet the restrictions + throw new IllegalArgumentException(Messages.getString("awt.238")); //$NON-NLS-1$ } // TODO // if (!canUseIpp || ippFilter(src, dst, BufferedImage.TYPE_CUSTOM, false) != 0) if (slowFilter(src, dst, false) != 0) { - throw new ImagingOpException ("Unable to transform source"); + // awt.21F=Unable to transform source + throw new ImagingOpException (Messages.getString("awt.21F")); //$NON-NLS-1$ } return dst; @@ -157,9 +155,8 @@ ColorModel srcCM = src.getColorModel(); if (srcCM instanceof IndexColorModel) { - throw new IllegalArgumentException( - "Source should not have IndexColorModel" - ); + // awt.220=Source should not have IndexColorModel + throw new IllegalArgumentException(Messages.getString("awt.220")); //$NON-NLS-1$ } // Check if the number of scaling factors matches the number of bands @@ -172,18 +169,14 @@ } else if (nLUTComponents == nComponents) { skipAlpha = false; } else { - throw new IllegalArgumentException( - "Number of components in the LUT does not " + - "match the number of bands" - ); + // awt.229=Number of components in the LUT does not match the number of bands + throw new IllegalArgumentException(Messages.getString("awt.229")); //$NON-NLS-1$ } } else if (nLUTComponents == 1 || nLUTComponents == nComponents) { skipAlpha = false; } else { - throw new IllegalArgumentException( - "Number of components in the LUT does not " + - "match the number of bands" - ); + // awt.229=Number of components in the LUT does not match the number of bands + throw new IllegalArgumentException(Messages.getString("awt.229")); //$NON-NLS-1$ } BufferedImage finalDst = null; @@ -206,7 +199,8 @@ // TODO //if (!canUseIpp || ippFilter(src.getRaster(), dst.getRaster(), src.getType(), skipAlpha) != 0) if (slowFilter(src.getRaster(), dst.getRaster(), skipAlpha) != 0) { - throw new ImagingOpException ("Unable to transform source"); + // awt.21F=Unable to transform source + throw new ImagingOpException (Messages.getString("awt.21F")); //$NON-NLS-1$ } if (finalDst != null) { Index: src/main/java/common/java/awt/image/LookupTable.java =================================================================== --- src/main/java/common/java/awt/image/LookupTable.java (revision 470363) +++ src/main/java/common/java/awt/image/LookupTable.java (working copy) @@ -23,20 +23,20 @@ package java.awt.image; +import org.apache.harmony.awt.internal.nls.Messages; + public abstract class LookupTable { private int offset; private int numComponents; protected LookupTable(int offset, int numComponents) { if (offset < 0) { - throw new IllegalArgumentException( - "Offset should be not less than zero" - ); + // awt.232=Offset should be not less than zero + throw new IllegalArgumentException(Messages.getString("awt.232")); //$NON-NLS-1$ } if (numComponents < 1) { - throw new IllegalArgumentException( - "Number of components should be positive" - ); + // awt.233=Number of components should be positive + throw new IllegalArgumentException(Messages.getString("awt.233")); //$NON-NLS-1$ } this.offset = offset; Index: src/main/java/common/java/awt/image/MemoryImageSource.java =================================================================== --- src/main/java/common/java/awt/image/MemoryImageSource.java (revision 470363) +++ src/main/java/common/java/awt/image/MemoryImageSource.java (working copy) @@ -23,6 +23,8 @@ import java.util.Hashtable; import java.util.Vector; +import org.apache.harmony.awt.internal.nls.Messages; + public class MemoryImageSource implements ImageProducer { int width; @@ -276,7 +278,8 @@ con.setPixels(x, y, w, h, cm, iData, pixelOff, scanline); break; default: - throw new IllegalArgumentException("Wrong type of pixels array"); + // awt.22A=Wrong type of pixels array + throw new IllegalArgumentException(Messages.getString("awt.22A")); //$NON-NLS-1$ } } Index: src/main/java/common/java/awt/image/MultiPixelPackedSampleModel.java =================================================================== --- src/main/java/common/java/awt/image/MultiPixelPackedSampleModel.java (revision 470363) +++ src/main/java/common/java/awt/image/MultiPixelPackedSampleModel.java (working copy) @@ -20,6 +20,8 @@ */ package java.awt.image; +import org.apache.harmony.awt.internal.nls.Messages; + public class MultiPixelPackedSampleModel extends SampleModel { private int pixelBitStride; @@ -41,24 +43,26 @@ if (dataType != DataBuffer.TYPE_BYTE && dataType != DataBuffer.TYPE_USHORT && dataType != DataBuffer.TYPE_INT) { - throw new IllegalArgumentException("Unsupported data type:" - + dataType); + // awt.61=Unsupported data type: {0} + throw new IllegalArgumentException(Messages.getString("awt.61", //$NON-NLS-1$ + dataType)); } this.scanlineStride = scanlineStride; if(numberOfBits == 0) { - throw new RasterFormatException("Number of Bits equals to zero"); + // awt.20C=Number of Bits equals to zero + throw new RasterFormatException(Messages.getString("awt.20C")); //$NON-NLS-1$ } this.pixelBitStride = numberOfBits; this.dataElementSize = DataBuffer.getDataTypeSize(dataType); if(dataElementSize % pixelBitStride != 0) { - throw new RasterFormatException("The number of bits per pixel " + - "is not a power of 2 or pixels span data element boundaries"); + // awt.20D=The number of bits per pixel is not a power of 2 or pixels span data element boundaries + throw new RasterFormatException(Messages.getString("awt.20D")); //$NON-NLS-1$ } if(dataBitOffset % numberOfBits != 0) { - throw new RasterFormatException("Data Bit offset is not a multiple " + - "of pixel bit stride"); + // awt.20E=Data Bit offset is not a multiple of pixel bit stride + throw new RasterFormatException(Messages.getString("awt.20E")); //$NON-NLS-1$ } this.dataBitOffset = dataBitOffset; @@ -77,8 +81,8 @@ @Override public Object getDataElements(int x, int y, Object obj, DataBuffer data) { if (x < 0 || y < 0 || x >= this.width || y >= this.height) { - throw new ArrayIndexOutOfBoundsException("Coordinates are " + - "not in bounds"); + // awt.63=Coordinates are not in bounds + throw new ArrayIndexOutOfBoundsException(Messages.getString("awt.63")); //$NON-NLS-1$ } switch (getTransferType()) { case DataBuffer.TYPE_BYTE: @@ -119,8 +123,8 @@ @Override public void setDataElements(int x, int y, Object obj, DataBuffer data) { if (x < 0 || y < 0 || x >= this.width || y >= this.height) { - throw new ArrayIndexOutOfBoundsException("Coordinates are " + - "not in bounds"); + // awt.63=Coordinates are not in bounds + throw new ArrayIndexOutOfBoundsException(Messages.getString("awt.63")); //$NON-NLS-1$ } switch (getTransferType()) { case DataBuffer.TYPE_BYTE: @@ -157,7 +161,8 @@ @Override public SampleModel createSubsetSampleModel(int bands[]) { if (bands != null && bands.length != 1) { - throw new RasterFormatException("Number of bands must be only 1"); + // awt.20F=Number of bands must be only 1 + throw new RasterFormatException(Messages.getString("awt.20F")); //$NON-NLS-1$ } return createCompatibleSampleModel(width, height); } @@ -170,8 +175,8 @@ @Override public int[] getPixel(int x, int y, int iArray[], DataBuffer data) { if (x < 0 || y < 0 || x >= this.width || y >= this.height) { - throw new ArrayIndexOutOfBoundsException("Coordinates are " + - "not in bounds"); + // awt.63=Coordinates are not in bounds + throw new ArrayIndexOutOfBoundsException(Messages.getString("awt.63")); //$NON-NLS-1$ } int pixel[]; if (iArray == null) { @@ -187,8 +192,8 @@ @Override public void setPixel(int x, int y, int iArray[], DataBuffer data) { if (x < 0 || y < 0 || x >= this.width || y >= this.height) { - throw new ArrayIndexOutOfBoundsException("Coordinates are " + - "not in bounds"); + // awt.63=Coordinates are not in bounds + throw new ArrayIndexOutOfBoundsException(Messages.getString("awt.63")); //$NON-NLS-1$ } setSample(x, y, 0, iArray[0], data); } @@ -196,8 +201,8 @@ @Override public int getSample(int x, int y, int b, DataBuffer data) { if (x < 0 || y < 0 || x >= this.width || y >= this.height || b != 0) { - throw new ArrayIndexOutOfBoundsException("Coordinates are not " + - "in bounds"); + // awt.63=Coordinates are not in bounds + throw new ArrayIndexOutOfBoundsException(Messages.getString("awt.63")); //$NON-NLS-1$ } int bitnum = dataBitOffset + x * pixelBitStride; @@ -211,8 +216,8 @@ @Override public void setSample(int x, int y, int b, int s, DataBuffer data) { if (x < 0 || y < 0 || x >= this.width || y >= this.height || b != 0) { - throw new ArrayIndexOutOfBoundsException("Coordinates are not " + - "in bounds"); + // awt.63=Coordinates are not in bounds + throw new ArrayIndexOutOfBoundsException(Messages.getString("awt.63")); //$NON-NLS-1$ } int bitnum = dataBitOffset + x * pixelBitStride; Index: src/main/java/common/java/awt/image/PackedColorModel.java =================================================================== --- src/main/java/common/java/awt/image/PackedColorModel.java (revision 470363) +++ src/main/java/common/java/awt/image/PackedColorModel.java (working copy) @@ -24,6 +24,8 @@ import java.awt.color.ColorSpace; import java.util.Arrays; +import org.apache.harmony.awt.internal.nls.Messages; + public abstract class PackedColorModel extends ColorModel { int componentMasks[]; @@ -41,8 +43,8 @@ validateTransferType(transferType)); if (pixel_bits < 1 || pixel_bits > 32) { - throw new IllegalArgumentException("The bits is less than 1 or " + - "greater than 32"); + // awt.236=The bits is less than 1 or greater than 32 + throw new IllegalArgumentException(Messages.getString("awt.236")); //$NON-NLS-1$ } componentMasks = new int[numComponents]; @@ -69,19 +71,19 @@ validateTransferType(transferType)); if (pixel_bits < 1 || pixel_bits > 32) { - throw new IllegalArgumentException("The bits is less than 1 or " + - "greater than 32"); + // awt.236=The bits is less than 1 or greater than 32 + throw new IllegalArgumentException(Messages.getString("awt.236")); //$NON-NLS-1$ } if (cs.getType() != ColorSpace.TYPE_RGB) { - throw new IllegalArgumentException("The space is not a TYPE_RGB " + - "space"); + // awt.239=The space is not a TYPE_RGB space + throw new IllegalArgumentException(Messages.getString("awt.239")); //$NON-NLS-1$ } for (int i = 0; i < numColorComponents; i++) { if (cs.getMinValue(i) != 0.0f || cs.getMaxValue(i) != 1.0f) { - throw new IllegalArgumentException("The min/max normalized " + - "component values are not 0.0/1.0"); + // awt.23A=The min/max normalized component values are not 0.0/1.0 + throw new IllegalArgumentException(Messages.getString("awt.23A")); //$NON-NLS-1$ } } componentMasks = new int[numComponents]; @@ -179,8 +181,8 @@ for (; i < colorMaskArray.length; i++) { bits[i] = countCompBits(colorMaskArray[i]); if (bits[i] < 0) { - throw new IllegalArgumentException("The mask of the " + i - + " component is not contiguous"); + // awt.23B=The mask of the {0} component is not contiguous + throw new IllegalArgumentException(Messages.getString("awt.23B", i)); //$NON-NLS-1$ } } @@ -188,8 +190,8 @@ bits[i] = countCompBits(alphaMask); if (bits[i] < 0) { - throw new IllegalArgumentException("The mask of the alpha " + - "component is not contiguous"); + // awt.23C=The mask of the alpha component is not contiguous + throw new IllegalArgumentException(Messages.getString("awt.23C")); //$NON-NLS-1$ } } @@ -209,27 +211,27 @@ bits[0] = countCompBits(rmask); if (bits[0] < 0) { - throw new IllegalArgumentException("The mask of the red " + - "component is not contiguous"); + // awt.23D=The mask of the red component is not contiguous + throw new IllegalArgumentException(Messages.getString("awt.23D")); //$NON-NLS-1$ } bits[1] = countCompBits(gmask); if (bits[1] < 0) { - throw new IllegalArgumentException("The mask of the green " + - "component is not contiguous"); + // awt.23E=The mask of the green component is not contiguous + throw new IllegalArgumentException(Messages.getString("awt.23E")); //$NON-NLS-1$ } bits[2] = countCompBits(bmask); if (bits[2] < 0) { - throw new IllegalArgumentException("The mask of the blue " + - "component is not contiguous"); + // awt.23F=The mask of the blue component is not contiguous + throw new IllegalArgumentException(Messages.getString("awt.23F")); //$NON-NLS-1$ } if (amask != 0) { bits[3] = countCompBits(amask); if (bits[3] < 0) { - throw new IllegalArgumentException("The mask of the alpha " + - "component is not contiguous"); + // awt.23C=The mask of the alpha component is not contiguous + throw new IllegalArgumentException(Messages.getString("awt.23C")); //$NON-NLS-1$ } } @@ -261,9 +263,9 @@ if (transferType != DataBuffer.TYPE_BYTE && transferType != DataBuffer.TYPE_USHORT && transferType != DataBuffer.TYPE_INT) { - throw new IllegalArgumentException("The transferType is not " + - "one of DataBuffer.TYPE_BYTE, DataBuffer.TYPE_USHORT " + - "or DataBuffer.TYPE_INT"); + // awt.240=The transferType not is one of DataBuffer.TYPE_BYTE, + // DataBuffer.TYPE_USHORT or DataBuffer.TYPE_INT + throw new IllegalArgumentException(Messages.getString("awt.240")); //$NON-NLS-1$ } return transferType; } Index: src/main/java/common/java/awt/image/PixelGrabber.java =================================================================== --- src/main/java/common/java/awt/image/PixelGrabber.java (revision 470363) +++ src/main/java/common/java/awt/image/PixelGrabber.java (working copy) @@ -23,6 +23,8 @@ import java.awt.Image; import java.util.Hashtable; +import org.apache.harmony.awt.internal.nls.Messages; + public class PixelGrabber implements ImageConsumer { int width; @@ -306,8 +308,8 @@ grabberStatus |= ImageObserver.ALLBITS; break; default: - throw new IllegalArgumentException("Incorrect ImageConsumer " - + "completion status"); + // awt.26A=Incorrect ImageConsumer completion status + throw new IllegalArgumentException(Messages.getString("awt.26A")); //$NON-NLS-1$ } isGrabbing = false; producer.removeConsumer(this); Index: src/main/java/common/java/awt/image/PixelInterleavedSampleModel.java =================================================================== --- src/main/java/common/java/awt/image/PixelInterleavedSampleModel.java (revision 470363) +++ src/main/java/common/java/awt/image/PixelInterleavedSampleModel.java (working copy) @@ -20,6 +20,8 @@ */ package java.awt.image; +import org.apache.harmony.awt.internal.nls.Messages; + public class PixelInterleavedSampleModel extends ComponentSampleModel { public PixelInterleavedSampleModel(int dataType, int w, int h, @@ -41,18 +43,18 @@ maxOffset -= minOffset; if (maxOffset > scanlineStride) { - throw new IllegalArgumentException("Any offset between bands " + - "is greater than the Scanline stride"); + // awt.241=Any offset between bands is greater than the Scanline stride + throw new IllegalArgumentException(Messages.getString("awt.241")); //$NON-NLS-1$ } if (maxOffset > pixelStride) { - throw new IllegalArgumentException("Pixel stride is less than " + - "any offset between bands"); + // awt.242=Pixel stride is less than any offset between bands + throw new IllegalArgumentException(Messages.getString("awt.242")); //$NON-NLS-1$ } if (pixelStride * w > scanlineStride) { - throw new IllegalArgumentException("Product of Pixel stride and " + - "w is greater than Scanline stride "); + // awt.243=Product of Pixel stride and w is greater than Scanline stride + throw new IllegalArgumentException(Messages.getString("awt.243")); //$NON-NLS-1$ } } Index: src/main/java/common/java/awt/image/Raster.java =================================================================== --- src/main/java/common/java/awt/image/Raster.java (revision 470363) +++ src/main/java/common/java/awt/image/Raster.java (working copy) @@ -24,6 +24,7 @@ import java.awt.Rectangle; import org.apache.harmony.awt.gl.image.OrdinaryWritableRaster; +import org.apache.harmony.awt.internal.nls.Messages; public class Raster { @@ -55,8 +56,8 @@ int bandOffsets[], Point location) { if (w <= 0 || h <= 0) { - throw new RasterFormatException("w or h is less than or " - + "equal to zero"); + // awt.22E=w or h is less than or equal to zero + throw new RasterFormatException(Messages.getString("awt.22E")); //$NON-NLS-1$ } if (location == null) { @@ -65,17 +66,18 @@ if ((long) location.x + w > Integer.MAX_VALUE || (long) location.y + h > Integer.MAX_VALUE) { - throw new RasterFormatException("location.x + w or " - + "location.y + h results in integer overflow"); + // awt.276=location.x + w or location.y + h results in integer overflow + throw new RasterFormatException(Messages.getString("awt.276")); //$NON-NLS-1$ } if (bankIndices == null || bandOffsets == null) { - throw new ArrayIndexOutOfBoundsException("bankIndices or " - + "bandOffsets is null"); + // awt.277=bankIndices or bandOffsets is null + throw new ArrayIndexOutOfBoundsException(Messages.getString("awt.277")); //$NON-NLS-1$ } if (dataBuffer == null) { - throw new NullPointerException("dataBuffer is null"); + // awt.278=dataBuffer is null + throw new NullPointerException(Messages.getString("awt.278")); //$NON-NLS-1$ } int dataType = dataBuffer.getDataType(); @@ -83,8 +85,8 @@ if (dataType != DataBuffer.TYPE_BYTE && dataType != DataBuffer.TYPE_USHORT && dataType != DataBuffer.TYPE_INT) { - throw new IllegalArgumentException("dataType is not one " - + "of the supported data types"); + // awt.230=dataType is not one of the supported data types + throw new IllegalArgumentException(Messages.getString("awt.230")); //$NON-NLS-1$ } BandedSampleModel sampleModel = new BandedSampleModel(dataType, w, h, @@ -98,8 +100,8 @@ Point location) { if (w <= 0 || h <= 0) { - throw new RasterFormatException("w or h is less than or " - + "equal to zero"); + // awt.22E=w or h is less than or equal to zero + throw new RasterFormatException(Messages.getString("awt.22E")); //$NON-NLS-1$ } if (location == null) { @@ -108,20 +110,20 @@ if ((long) location.x + w > Integer.MAX_VALUE || (long) location.y + h > Integer.MAX_VALUE) { - throw new RasterFormatException("location.x + w or location.y + " - + "h results in integer overflow"); + // awt.276=location.x + w or location.y + h results in integer overflow + throw new RasterFormatException(Messages.getString("awt.276")); //$NON-NLS-1$ } if (bankIndices == null || bandOffsets == null) { - throw new ArrayIndexOutOfBoundsException("bankIndices or " - + "bandOffsets is null"); + // awt.277=bankIndices or bandOffsets is null + throw new ArrayIndexOutOfBoundsException(Messages.getString("awt.277")); //$NON-NLS-1$ } if (dataType != DataBuffer.TYPE_BYTE && dataType != DataBuffer.TYPE_USHORT && dataType != DataBuffer.TYPE_INT) { - throw new IllegalArgumentException("dataType is not one of " - + "the supported data types"); + // awt.230=dataType is not one of the supported data types + throw new IllegalArgumentException(Messages.getString("awt.230")); //$NON-NLS-1$ } int maxOffset = bandOffsets[0]; @@ -160,8 +162,8 @@ int bands, Point location) { if (w <= 0 || h <= 0) { - throw new RasterFormatException("w or h is less than " - + "or equal to zero"); + // awt.22E=w or h is less than or equal to zero + throw new RasterFormatException(Messages.getString("awt.22E")); //$NON-NLS-1$ } if (location == null) { @@ -170,12 +172,13 @@ if ((long) location.x + w > Integer.MAX_VALUE || (long) location.y + h > Integer.MAX_VALUE) { - throw new RasterFormatException("location.x + w or location.y + " - + "h results in integer overflow"); + // awt.276=location.x + w or location.y + h results in integer overflow + throw new RasterFormatException(Messages.getString("awt.276")); //$NON-NLS-1$ } if (bands < 1) { - throw new ArrayIndexOutOfBoundsException("bands is less than 1"); + // awt.279=bands is less than 1 + throw new ArrayIndexOutOfBoundsException(Messages.getString("awt.279")); //$NON-NLS-1$ } int bandOffsets[] = new int[bands]; @@ -194,8 +197,8 @@ int bandOffsets[], Point location) { if (w <= 0 || h <= 0) { - throw new RasterFormatException("w or h is less than or " - + "equal to zero"); + // awt.22E=w or h is less than or equal to zero + throw new RasterFormatException(Messages.getString("awt.22E")); //$NON-NLS-1$ } if (location == null) { @@ -204,28 +207,30 @@ if ((long) location.x + w > Integer.MAX_VALUE || (long) location.y + h > Integer.MAX_VALUE) { - throw new RasterFormatException("location.x + w or location.y " - + "+ h results in integer overflow"); + // awt.276=location.x + w or location.y + h results in integer overflow + throw new RasterFormatException(Messages.getString("awt.276")); //$NON-NLS-1$ } if (dataBuffer == null) { - throw new NullPointerException("dataBuffer is null"); + // awt.278=dataBuffer is null + throw new NullPointerException(Messages.getString("awt.278")); //$NON-NLS-1$ } int dataType = dataBuffer.getDataType(); if (dataType != DataBuffer.TYPE_BYTE && dataType != DataBuffer.TYPE_USHORT) { - throw new IllegalArgumentException("dataType is not one of " - + "the supported data types"); + // awt.230=dataType is not one of the supported data types + throw new IllegalArgumentException(Messages.getString("awt.230")); //$NON-NLS-1$ } if (dataBuffer.getNumBanks() > 1) { - throw new RasterFormatException("dataBuffer has more " - + "than one bank"); + // awt.27A=dataBuffer has more than one bank + throw new RasterFormatException(Messages.getString("awt.27A")); //$NON-NLS-1$ } if (bandOffsets == null) { - throw new NullPointerException("bandOffsets is null"); + // awt.27B=bandOffsets is null + throw new NullPointerException(Messages.getString("awt.27B")); //$NON-NLS-1$ } PixelInterleavedSampleModel sampleModel = @@ -240,8 +245,8 @@ Point location) { if (w <= 0 || h <= 0) { - throw new RasterFormatException("w or h is less than or " - + "equal to zero"); + // awt.22E=w or h is less than or equal to zero + throw new RasterFormatException(Messages.getString("awt.22E")); //$NON-NLS-1$ } if (location == null) { @@ -250,18 +255,19 @@ if ((long) location.x + w > Integer.MAX_VALUE || (long) location.y + h > Integer.MAX_VALUE) { - throw new RasterFormatException("location.x + w or location.y + " - + "h results in integer overflow"); + // awt.276=location.x + w or location.y + h results in integer overflow + throw new RasterFormatException(Messages.getString("awt.276")); //$NON-NLS-1$ } if (dataType != DataBuffer.TYPE_BYTE && dataType != DataBuffer.TYPE_USHORT) { - throw new IllegalArgumentException("dataType is not one of " - + "the supported data types"); + // awt.230=dataType is not one of the supported data types + throw new IllegalArgumentException(Messages.getString("awt.230")); //$NON-NLS-1$ } if (bandOffsets == null) { - throw new NullPointerException("bandOffsets is null"); + // awt.27B=bandOffsets is null + throw new NullPointerException(Messages.getString("awt.27B")); //$NON-NLS-1$ } int minOffset = bandOffsets[0]; @@ -290,8 +296,8 @@ int h, int bands, Point location) { if (w <= 0 || h <= 0) { - throw new RasterFormatException("w or h is less than or " - + "equal to zero"); + // awt.22E=w or h is less than or equal to zero + throw new RasterFormatException(Messages.getString("awt.22E")); //$NON-NLS-1$ } if (location == null) { @@ -300,14 +306,14 @@ if ((long) location.x + w > Integer.MAX_VALUE || (long) location.y + h > Integer.MAX_VALUE) { - throw new RasterFormatException("location.x + w or location.y + " - + "h results in integer overflow"); + // awt.276=location.x + w or location.y + h results in integer overflow + throw new RasterFormatException(Messages.getString("awt.276")); //$NON-NLS-1$ } if (dataType != DataBuffer.TYPE_BYTE && dataType != DataBuffer.TYPE_USHORT) { - throw new IllegalArgumentException("dataType is not one of " - + "the supported data types"); + // awt.230=dataType is not one of the supported data types + throw new IllegalArgumentException(Messages.getString("awt.230")); //$NON-NLS-1$ } int bandOffsets[] = new int[bands]; @@ -323,8 +329,8 @@ int w, int h, int scanlineStride, int bandMasks[], Point location) { if (w <= 0 || h <= 0) { - throw new RasterFormatException("w or h is less than or " - + "equal to zero"); + // awt.22E=w or h is less than or equal to zero + throw new RasterFormatException(Messages.getString("awt.22E")); //$NON-NLS-1$ } if (location == null) { @@ -333,28 +339,31 @@ if ((long) location.x + w > Integer.MAX_VALUE || (long) location.y + h > Integer.MAX_VALUE) { - throw new RasterFormatException("location.x + w or location.y + " - + "h results in integer overflow"); + // awt.276=location.x + w or location.y + h results in integer overflow + throw new RasterFormatException(Messages.getString("awt.276")); //$NON-NLS-1$ } if (bandMasks == null) { - throw new RasterFormatException("bandMasks is null"); + // awt.27C=bandMasks is null + throw new RasterFormatException(Messages.getString("awt.27C")); //$NON-NLS-1$ } if (dataBuffer == null) { - throw new NullPointerException("dataBuffer is null"); + // awt.278=dataBuffer is null + throw new NullPointerException(Messages.getString("awt.278")); //$NON-NLS-1$ } if (dataBuffer.getNumBanks() > 1) { - throw new RasterFormatException("dataBuffer has more than one bank"); + // awt.27A=dataBuffer has more than one bank + throw new RasterFormatException(Messages.getString("awt.27A")); //$NON-NLS-1$ } int dataType = dataBuffer.getDataType(); if (dataType != DataBuffer.TYPE_BYTE && dataType != DataBuffer.TYPE_USHORT && dataType != DataBuffer.TYPE_INT) { - throw new IllegalArgumentException("dataType is not one of " - + "the supported data types"); + // awt.230=dataType is not one of the supported data types + throw new IllegalArgumentException(Messages.getString("awt.230")); //$NON-NLS-1$ } SinglePixelPackedSampleModel sampleModel = @@ -368,8 +377,8 @@ int w, int h, int bitsPerPixel, Point location) { if (w <= 0 || h <= 0) { - throw new RasterFormatException("w or h is less than or " - + "equal to zero"); + // awt.22E=w or h is less than or equal to zero + throw new RasterFormatException(Messages.getString("awt.22E")); //$NON-NLS-1$ } if (location == null) { @@ -378,24 +387,26 @@ if ((long) location.x + w > Integer.MAX_VALUE || (long) location.y + h > Integer.MAX_VALUE) { - throw new RasterFormatException("location.x + w or location.y " - + "+ h results in integer overflow"); + // awt.276=location.x + w or location.y + h results in integer overflow + throw new RasterFormatException(Messages.getString("awt.276")); //$NON-NLS-1$ } if (dataBuffer == null) { - throw new NullPointerException("dataBuffer is null"); + // awt.278=dataBuffer is null + throw new NullPointerException(Messages.getString("awt.278")); //$NON-NLS-1$ } if (dataBuffer.getNumBanks() > 1) { - throw new RasterFormatException("dataBuffer has more than one bank"); + // awt.27A=dataBuffer has more than one bank + throw new RasterFormatException(Messages.getString("awt.27A")); //$NON-NLS-1$ } int dataType = dataBuffer.getDataType(); if (dataType != DataBuffer.TYPE_BYTE && dataType != DataBuffer.TYPE_USHORT && dataType != DataBuffer.TYPE_INT) { - throw new IllegalArgumentException("dataType is not one of " - + "the supported data types"); + // awt.230=dataType is not one of the supported data types + throw new IllegalArgumentException(Messages.getString("awt.230")); //$NON-NLS-1$ } MultiPixelPackedSampleModel sampleModel = @@ -408,8 +419,8 @@ int bands, int bitsPerBand, Point location) { if (w <= 0 || h <= 0) { - throw new RasterFormatException("w or h is less than or " - + "equal to zero"); + // awt.22E=w or h is less than or equal to zero + throw new RasterFormatException(Messages.getString("awt.22E")); //$NON-NLS-1$ } if (location == null) { @@ -418,26 +429,25 @@ if ((long) location.x + w > Integer.MAX_VALUE || (long) location.y + h > Integer.MAX_VALUE) { - throw new RasterFormatException("location.x + w or location.y + " - + "h results in integer overflow"); + // awt.276=location.x + w or location.y + h results in integer overflow + throw new RasterFormatException(Messages.getString("awt.276")); //$NON-NLS-1$ } if (bands < 1 || bitsPerBand < 1) { - throw new IllegalArgumentException("bitsPerBand or bands is " - + "not greater than zero"); + // awt.27D=bitsPerBand or bands is not greater than zero + throw new IllegalArgumentException(Messages.getString("awt.27D")); //$NON-NLS-1$ } if (dataType != DataBuffer.TYPE_BYTE && dataType != DataBuffer.TYPE_USHORT && dataType != DataBuffer.TYPE_INT) { - throw new IllegalArgumentException("dataType is not one of " - + "the supported data types"); + // awt.230=dataType is not one of the supported data types + throw new IllegalArgumentException(Messages.getString("awt.230")); //$NON-NLS-1$ } if (bitsPerBand * bands > DataBuffer.getDataTypeSize(dataType)) { - throw new IllegalArgumentException("The product of bitsPerBand " - + "and bands is greater than the number of bits held by " - + "dataType "); + // awt.27E=The product of bitsPerBand and bands is greater than the number of bits held by dataType + throw new IllegalArgumentException(Messages.getString("awt.27E")); //$NON-NLS-1$ } if (bands > 1) { @@ -474,8 +484,8 @@ int bandMasks[], Point location) { if (w <= 0 || h <= 0) { - throw new RasterFormatException("w or h is less than or " - + "equal to zero"); + // awt.22E=w or h is less than or equal to zero + throw new RasterFormatException(Messages.getString("awt.22E")); //$NON-NLS-1$ } if (location == null) { @@ -484,19 +494,20 @@ if ((long) location.x + w > Integer.MAX_VALUE || (long) location.y + h > Integer.MAX_VALUE) { - throw new RasterFormatException("location.x + w or location.y + " - + "h results in integer overflow"); + // awt.276=location.x + w or location.y + h results in integer overflow + throw new RasterFormatException(Messages.getString("awt.276")); //$NON-NLS-1$ } if (bandMasks == null) { - throw new RasterFormatException("bandMasks is null"); + // awt.27C=bandMasks is null + throw new RasterFormatException(Messages.getString("awt.27C")); //$NON-NLS-1$ } if (dataType != DataBuffer.TYPE_BYTE && dataType != DataBuffer.TYPE_USHORT && dataType != DataBuffer.TYPE_INT) { - throw new IllegalArgumentException("dataType is not one of " - + "the supported data types"); + // awt.230=dataType is not one of the supported data types + throw new IllegalArgumentException(Messages.getString("awt.230")); //$NON-NLS-1$ } DataBuffer data = null; @@ -520,7 +531,8 @@ Point location) { if (sm == null || db == null) { - throw new NullPointerException("SampleModel or DataBuffer is null"); + // awt.27F=SampleModel or DataBuffer is null + throw new NullPointerException(Messages.getString("awt.27F")); //$NON-NLS-1$ } if (location == null) { @@ -534,7 +546,8 @@ DataBuffer db, Point location) { if (sm == null || db == null) { - throw new NullPointerException("SampleModel or DataBuffer is null"); + // awt.27F=SampleModel or DataBuffer is null + throw new NullPointerException(Messages.getString("awt.27F")); //$NON-NLS-1$ } if (location == null) { @@ -548,7 +561,8 @@ Point location) { if (sm == null) { - throw new NullPointerException("SampleModel is null"); + // awt.280=SampleModel is null + throw new NullPointerException(Messages.getString("awt.280")); //$NON-NLS-1$ } if (location == null) { @@ -570,21 +584,23 @@ if (sampleModel == null || dataBuffer == null || aRegion == null || sampleModelTranslate == null) { - throw new NullPointerException("sampleModel, dataBuffer, " - + "aRegion or sampleModelTranslate is null"); + // awt.281=sampleModel, dataBuffer, aRegion or sampleModelTranslate is null + throw new NullPointerException(Messages.getString("awt.281")); //$NON-NLS-1$ } if (aRegion.width <= 0 || aRegion.height <= 0) { - throw new RasterFormatException("aRegion has width or height " - + "less than or equal to zero"); + // awt.282=aRegion has width or height less than or equal to zero + throw new RasterFormatException(Messages.getString("awt.282")); //$NON-NLS-1$ } if ((long) aRegion.x + (long) aRegion.width > Integer.MAX_VALUE) { - throw new RasterFormatException("Overflow X coordinate of Raster"); + // awt.283=Overflow X coordinate of Raster + throw new RasterFormatException(Messages.getString("awt.283")); //$NON-NLS-1$ } if ((long) aRegion.y + (long) aRegion.height > Integer.MAX_VALUE) { - throw new RasterFormatException("Overflow Y coordinate of Raster"); + // awt.284=Overflow Y coordinate of Raster + throw new RasterFormatException(Messages.getString("awt.284")); //$NON-NLS-1$ } this.sampleModel = sampleModel; @@ -610,36 +626,38 @@ public Raster createChild(int parentX, int parentY, int width, int height, int childMinX, int childMinY, int bandList[]) { if (width <= 0 || height <= 0) { - throw new RasterFormatException("Width or Height of child " - + "Raster is less than or equal to zero"); + // awt.285=Width or Height of child Raster is less than or equal to zero + throw new RasterFormatException(Messages.getString("awt.285")); //$NON-NLS-1$ } if (parentX < this.minX || parentX + width > this.minX + this.width) { - throw new RasterFormatException("parentX disposes outside Raster"); + // awt.286=parentX disposes outside Raster + throw new RasterFormatException(Messages.getString("awt.286")); //$NON-NLS-1$ } if (parentY < this.minY || parentY + height > this.minY + this.height) { - throw new RasterFormatException("parentY disposes outside Raster"); + // awt.287=parentY disposes outside Raster + throw new RasterFormatException(Messages.getString("awt.287")); //$NON-NLS-1$ } if ((long) parentX + width > Integer.MAX_VALUE) { - throw new RasterFormatException("parentX + width results in " - + "integer overflow"); + // awt.288=parentX + width results in integer overflow + throw new RasterFormatException(Messages.getString("awt.288")); //$NON-NLS-1$ } if ((long) parentY + height > Integer.MAX_VALUE) { - throw new RasterFormatException("parentY + height results in " - + "integer overflow"); + // awt.289=parentY + height results in integer overflow + throw new RasterFormatException(Messages.getString("awt.289")); //$NON-NLS-1$ } if ((long) childMinX + width > Integer.MAX_VALUE) { - throw new RasterFormatException("childMinX + width results in " - + "integer overflow"); + // awt.28A=childMinX + width results in integer overflow + throw new RasterFormatException(Messages.getString("awt.28A")); //$NON-NLS-1$ } if ((long) childMinY + height > Integer.MAX_VALUE) { - throw new RasterFormatException("childMinY + height results in " - + "integer overflow"); + // awt.28B=childMinY + height results in integer overflow + throw new RasterFormatException(Messages.getString("awt.28B")); //$NON-NLS-1$ } SampleModel childModel; @@ -679,7 +697,8 @@ public WritableRaster createCompatibleWritableRaster(Rectangle rect) { if (rect == null) { - throw new NullPointerException("Rect is null"); + // awt.28C=Rect is null + throw new NullPointerException(Messages.getString("awt.28C")); //$NON-NLS-1$ } return createCompatibleWritableRaster(rect.x, rect.y, rect.width, Index: src/main/java/common/java/awt/image/renderable/RenderableImage.java =================================================================== --- src/main/java/common/java/awt/image/renderable/RenderableImage.java (revision 470363) +++ src/main/java/common/java/awt/image/renderable/RenderableImage.java (working copy) @@ -26,7 +26,7 @@ public interface RenderableImage { - public static final String HINTS_OBSERVED = "HINTS_OBSERVED"; + public static final String HINTS_OBSERVED = "HINTS_OBSERVED"; //$NON-NLS-1$ public Object getProperty(String name); Index: src/main/java/common/java/awt/image/renderable/RenderableImageOp.java =================================================================== --- src/main/java/common/java/awt/image/renderable/RenderableImageOp.java (revision 470363) +++ src/main/java/common/java/awt/image/renderable/RenderableImageOp.java (working copy) @@ -26,6 +26,8 @@ import java.awt.image.RenderedImage; import java.util.Vector; +import org.apache.harmony.awt.internal.nls.Messages; + public class RenderableImageOp implements RenderableImage { ContextualRenderedImageFactory CRIF; @@ -79,7 +81,8 @@ public RenderedImage createScaledRendering(int w, int h, RenderingHints hints) { if(w == 0 && h == 0) { - throw new IllegalArgumentException("Width and Height mustn't be equal zero both"); + // awt.60=Width and Height mustn't be equal zero both + throw new IllegalArgumentException(Messages.getString("awt.60")); //$NON-NLS-1$ } if(w == 0){ w = Math.round(h*(getWidth()/getHeight())); Index: src/main/java/common/java/awt/image/renderable/RenderableImageProducer.java =================================================================== --- src/main/java/common/java/awt/image/renderable/RenderableImageProducer.java (revision 470363) +++ src/main/java/common/java/awt/image/renderable/RenderableImageProducer.java (working copy) @@ -48,7 +48,7 @@ public synchronized void startProduction(ImageConsumer ic) { addConsumer(ic); - Thread t = new Thread(this, "RenderableImageProducer thread"); + Thread t = new Thread(this, "RenderableImageProducer thread"); //$NON-NLS-1$ t.start(); } Index: src/main/java/common/java/awt/image/ReplicateScaleFilter.java =================================================================== --- src/main/java/common/java/awt/image/ReplicateScaleFilter.java (revision 470363) +++ src/main/java/common/java/awt/image/ReplicateScaleFilter.java (working copy) @@ -22,6 +22,8 @@ import java.util.Hashtable; +import org.apache.harmony.awt.internal.nls.Messages; + public class ReplicateScaleFilter extends ImageFilter { protected int srcWidth; @@ -40,7 +42,8 @@ public ReplicateScaleFilter(int width, int height) { if(width == 0 || height == 0) { - throw new IllegalArgumentException("Width or Height equals zero"); + // awt.234=Width or Height equals zero + throw new IllegalArgumentException(Messages.getString("awt.234")); //$NON-NLS-1$ } this.destWidth = width; @@ -56,15 +59,15 @@ } else { fprops = (Hashtable) props.clone(); } - String propName = "Rescale Filters"; - String prop = "destWidth=" + destWidth + "; " + - "destHeight=" + destHeight; + String propName = "Rescale Filters"; //$NON-NLS-1$ + String prop = "destWidth=" + destWidth + "; " + //$NON-NLS-1$ //$NON-NLS-2$ + "destHeight=" + destHeight; //$NON-NLS-1$ Object o = fprops.get(propName); if(o != null){ if(o instanceof String){ - prop = (String)o + "; " + prop; + prop = (String)o + "; " + prop; //$NON-NLS-1$ }else{ - prop = o.toString() + "; " + prop; + prop = o.toString() + "; " + prop; //$NON-NLS-1$ } } fprops.put(propName, prop); Index: src/main/java/common/java/awt/image/RescaleOp.java =================================================================== --- src/main/java/common/java/awt/image/RescaleOp.java (revision 470363) +++ src/main/java/common/java/awt/image/RescaleOp.java (working copy) @@ -29,6 +29,7 @@ import java.util.Arrays; import org.apache.harmony.awt.gl.AwtImageBackdoorAccessor; +import org.apache.harmony.awt.internal.nls.Messages; public class RescaleOp implements BufferedImageOp, RasterOp { @@ -45,9 +46,8 @@ int numFactors = Math.min(scaleFactors.length, offsets.length); if (numFactors == 0) { - throw new IllegalArgumentException( - "The number of scale factors should not be zero" - ); + // awt.21C=The number of scale factors should not be zero + throw new IllegalArgumentException(Messages.getString("awt.21C")); //$NON-NLS-1$ } this.scaleFactors = new float[numFactors]; @@ -143,12 +143,9 @@ dst = createCompatibleDestRaster(src); } else { if (src.getNumBands() != dst.getNumBands()) { - throw new IllegalArgumentException( - "Number of src bands ("+ - src.getNumBands()+ - ") does not match number of dst bands (" + - dst.getNumBands()+")" - ); + // awt.21D=Number of src bands ({0}) does not match number of dst bands ({1}) + throw new IllegalArgumentException(Messages.getString("awt.21D", //$NON-NLS-1$ + src.getNumBands(), dst.getNumBands())); } } @@ -156,16 +153,15 @@ this.scaleFactors.length != 1 && this.scaleFactors.length != src.getNumBands() ) { - throw new IllegalArgumentException( - "Number of scaling constants is not equal " + - "to the number of bands" - ); + // awt.21E=Number of scaling constants is not equal to the number of bands + throw new IllegalArgumentException(Messages.getString("awt.21E")); //$NON-NLS-1$ } // TODO //if (ippFilter(src, dst, BufferedImage.TYPE_CUSTOM, false) != 0) if (slowFilter(src, dst, false) != 0) { - throw new ImagingOpException ("Unable to transform source"); + // awt.21F=Unable to transform source + throw new ImagingOpException (Messages.getString("awt.21F")); //$NON-NLS-1$ } return dst; @@ -272,7 +268,8 @@ ColorModel srcCM = src.getColorModel(); if (srcCM instanceof IndexColorModel) { - throw new IllegalArgumentException("Source should not have IndexColorModel"); + // awt.220=Source should not have IndexColorModel + throw new IllegalArgumentException(Messages.getString("awt.220")); //$NON-NLS-1$ } // Check if the number of scaling factors matches the number of bands @@ -284,16 +281,14 @@ } else if (scaleFactors.length == nComponents) { skipAlpha = false; } else { - throw new IllegalArgumentException( - "Number of scaling constants does not match the number of bands" - ); + // awt.21E=Number of scaling constants is not equal to the number of bands + throw new IllegalArgumentException(Messages.getString("awt.21E")); //$NON-NLS-1$ } } else if (scaleFactors.length == 1 || scaleFactors.length == nComponents) { skipAlpha = false; } else { - throw new IllegalArgumentException( - "Number of scaling constants does not match the number of bands" - ); + // awt.21E=Number of scaling constants is not equal to the number of bands + throw new IllegalArgumentException(Messages.getString("awt.21E")); //$NON-NLS-1$ } BufferedImage finalDst = null; @@ -316,7 +311,8 @@ // TODO //if (ippFilter(src.getRaster(), dst.getRaster(), src.getType(), skipAlpha) != 0) if (slowFilter(src.getRaster(), dst.getRaster(), skipAlpha) != 0) { - throw new ImagingOpException ("Unable to transform source"); + // awt.21F=Unable to transform source + throw new ImagingOpException (Messages.getString("awt.21F")); //$NON-NLS-1$ } if (finalDst != null) { Index: src/main/java/common/java/awt/image/SampleModel.java =================================================================== --- src/main/java/common/java/awt/image/SampleModel.java (revision 470363) +++ src/main/java/common/java/awt/image/SampleModel.java (working copy) @@ -20,6 +20,8 @@ */ package java.awt.image; +import org.apache.harmony.awt.internal.nls.Messages; + public abstract class SampleModel { protected int width; @@ -32,26 +34,26 @@ public SampleModel(int dataType, int w, int h, int numBands) { if (w <= 0 || h <= 0) { - throw new IllegalArgumentException("Width or Height is not " + - "greater than 0"); + // awt.22E=w or h is less than or equal to zero + throw new IllegalArgumentException(Messages.getString("awt.22E")); //$NON-NLS-1$ } double squre = ((double) w) * ((double) h); if (squre >= Integer.MAX_VALUE) { - throw new IllegalArgumentException("The product of w and h is " + - "greater than Integer.MAX_VALUE "); + // awt.22F=The product of w and h is greater than Integer.MAX_VALUE + throw new IllegalArgumentException(Messages.getString("awt.22F")); //$NON-NLS-1$ } if (dataType < DataBuffer.TYPE_BYTE || dataType > DataBuffer.TYPE_DOUBLE && dataType != DataBuffer.TYPE_UNDEFINED) { - throw new IllegalArgumentException("dataType is not one " + - "of the supported data types"); + // awt.230=dataType is not one of the supported data types + throw new IllegalArgumentException(Messages.getString("awt.230")); //$NON-NLS-1$ } if (numBands < 1) { - throw new IllegalArgumentException("Number of bands must " + - "be more then 0"); + // awt.231=Number of bands must be more then 0 + throw new IllegalArgumentException(Messages.getString("awt.231")); //$NON-NLS-1$ } this.dataType = dataType; @@ -261,8 +263,8 @@ public int[] getPixel(int x, int y, int iArray[], DataBuffer data) { if (x < 0 || y < 0 || x >= this.width || y >= this.height) { - throw new ArrayIndexOutOfBoundsException("Coordinates are " + - "not in bounds"); + // awt.63=Coordinates are not in bounds + throw new ArrayIndexOutOfBoundsException(Messages.getString("awt.63")); //$NON-NLS-1$ } int pixel[]; @@ -281,8 +283,8 @@ public void setPixel(int x, int y, int iArray[], DataBuffer data) { if (x < 0 || y < 0 || x >= this.width || y >= this.height) { - throw new ArrayIndexOutOfBoundsException("Coordinates are " + - "not in bounds"); + // awt.63=Coordinates are not in bounds + throw new ArrayIndexOutOfBoundsException(Messages.getString("awt.63")); //$NON-NLS-1$ } for (int i = 0; i < numBands; i++) { setSample(x, y, i, iArray[i], data); @@ -291,8 +293,8 @@ public float[] getPixel(int x, int y, float fArray[], DataBuffer data) { if (x < 0 || y < 0 || x >= this.width || y >= this.height) { - throw new ArrayIndexOutOfBoundsException("Coordinates are " + - "not in bounds"); + // awt.63=Coordinates are not in bounds + throw new ArrayIndexOutOfBoundsException(Messages.getString("awt.63")); //$NON-NLS-1$ } float pixel[]; @@ -311,8 +313,8 @@ public void setPixel(int x, int y, float fArray[], DataBuffer data) { if (x < 0 || y < 0 || x >= this.width || y >= this.height) { - throw new ArrayIndexOutOfBoundsException("Coordinates are " + - "not in bounds"); + // awt.63=Coordinates are not in bounds + throw new ArrayIndexOutOfBoundsException(Messages.getString("awt.63")); //$NON-NLS-1$ } for (int i = 0; i < numBands; i++) { setSample(x, y, i, fArray[i], data); @@ -321,8 +323,8 @@ public double[] getPixel(int x, int y, double dArray[], DataBuffer data) { if (x < 0 || y < 0 || x >= this.width || y >= this.height) { - throw new ArrayIndexOutOfBoundsException("Coordinates are " + - "not in bounds"); + // awt.63=Coordinates are not in bounds + throw new ArrayIndexOutOfBoundsException(Messages.getString("awt.63")); //$NON-NLS-1$ } double pixel[]; @@ -341,8 +343,8 @@ public void setPixel(int x, int y, double dArray[], DataBuffer data) { if (x < 0 || y < 0 || x >= this.width || y >= this.height) { - throw new ArrayIndexOutOfBoundsException("Coordinates are " + - "not in bounds"); + // awt.63=Coordinates are not in bounds + throw new ArrayIndexOutOfBoundsException(Messages.getString("awt.63")); //$NON-NLS-1$ } for (int i = 0; i < numBands; i++) { setSample(x, y, i, dArray[i], data); @@ -362,8 +364,8 @@ public int[] getPixels(int x, int y, int w, int h, int iArray[], DataBuffer data) { if (x < 0 || y < 0 || x + w > this.width || y + h > this.height) { - throw new ArrayIndexOutOfBoundsException("Coordinates are " + - "not in bounds"); + // awt.63=Coordinates are not in bounds + throw new ArrayIndexOutOfBoundsException(Messages.getString("awt.63")); //$NON-NLS-1$ } int pixels[]; int idx = 0; @@ -387,8 +389,8 @@ public void setPixels(int x, int y, int w, int h, int iArray[], DataBuffer data) { if (x < 0 || y < 0 || x + w > this.width || y + h > this.height) { - throw new ArrayIndexOutOfBoundsException("Coordinates are " + - "not in bounds"); + // awt.63=Coordinates are not in bounds + throw new ArrayIndexOutOfBoundsException(Messages.getString("awt.63")); //$NON-NLS-1$ } int idx = 0; for (int i = y; i < y + h; i++) { @@ -403,8 +405,8 @@ public float[] getPixels(int x, int y, int w, int h, float fArray[], DataBuffer data) { if (x < 0 || y < 0 || x + w > this.width || y + h > this.height) { - throw new ArrayIndexOutOfBoundsException("Coordinates are " + - "not in bounds"); + // awt.63=Coordinates are not in bounds + throw new ArrayIndexOutOfBoundsException(Messages.getString("awt.63")); //$NON-NLS-1$ } float pixels[]; int idx = 0; @@ -428,8 +430,8 @@ public void setPixels(int x, int y, int w, int h, float fArray[], DataBuffer data) { if (x < 0 || y < 0 || x + w > this.width || y + h > this.height) { - throw new ArrayIndexOutOfBoundsException("Coordinates are " + - "not in bounds"); + // awt.63=Coordinates are not in bounds + throw new ArrayIndexOutOfBoundsException(Messages.getString("awt.63")); //$NON-NLS-1$ } int idx = 0; for (int i = y; i < y + h; i++) { @@ -444,8 +446,8 @@ public double[] getPixels(int x, int y, int w, int h, double dArray[], DataBuffer data) { if (x < 0 || y < 0 || x + w > this.width || y + h > this.height) { - throw new ArrayIndexOutOfBoundsException("Coordinates are " + - "not in bounds"); + // awt.63=Coordinates are not in bounds + throw new ArrayIndexOutOfBoundsException(Messages.getString("awt.63")); //$NON-NLS-1$ } double pixels[]; int idx = 0; @@ -469,8 +471,8 @@ public void setPixels(int x, int y, int w, int h, double dArray[], DataBuffer data) { if (x < 0 || y < 0 || x + w > this.width || y + h > this.height) { - throw new ArrayIndexOutOfBoundsException("Coordinates are " + - "not in bounds"); + // awt.63=Coordinates are not in bounds + throw new ArrayIndexOutOfBoundsException(Messages.getString("awt.63")); //$NON-NLS-1$ } int idx = 0; for (int i = y; i < y + h; i++) { Index: src/main/java/common/java/awt/image/SinglePixelPackedSampleModel.java =================================================================== --- src/main/java/common/java/awt/image/SinglePixelPackedSampleModel.java (revision 470363) +++ src/main/java/common/java/awt/image/SinglePixelPackedSampleModel.java (working copy) @@ -22,6 +22,8 @@ import java.util.Arrays; +import org.apache.harmony.awt.internal.nls.Messages; + public class SinglePixelPackedSampleModel extends SampleModel { private int bitMasks[]; @@ -47,8 +49,9 @@ if (dataType != DataBuffer.TYPE_BYTE && dataType != DataBuffer.TYPE_USHORT && dataType != DataBuffer.TYPE_INT) { - throw new IllegalArgumentException("Unsupported data type:" - + dataType); + // awt.61=Unsupported data type: {0} + throw new IllegalArgumentException(Messages.getString("awt.61", //$NON-NLS-1$ + dataType)); } this.scanlineStride = scanlineStride; @@ -75,8 +78,9 @@ } if (mask != 0) { - throw new IllegalArgumentException("Wrong mask :" - + bitMasks[i]); + // awt.62=Wrong mask : {0} + throw new IllegalArgumentException(Messages.getString( + "awt.62", bitMasks[i])); //$NON-NLS-1$ } } @@ -94,8 +98,8 @@ @Override public Object getDataElements(int x, int y, Object obj, DataBuffer data) { if (x < 0 || y < 0 || x >= this.width || y >= this.height) { - throw new ArrayIndexOutOfBoundsException("Coordinates are " + - "not in bounds"); + // awt.63=Coordinates are not in bounds + throw new ArrayIndexOutOfBoundsException(Messages.getString("awt.63")); //$NON-NLS-1$ } switch (getTransferType()) { case DataBuffer.TYPE_BYTE: @@ -138,8 +142,8 @@ @Override public void setDataElements(int x, int y, Object obj, DataBuffer data) { if (x < 0 || y < 0 || x >= this.width || y >= this.height) { - throw new ArrayIndexOutOfBoundsException("Coordinates are " + - "not in bounds"); + // awt.63=Coordinates are not in bounds + throw new ArrayIndexOutOfBoundsException(Messages.getString("awt.63")); //$NON-NLS-1$ } switch (getTransferType()) { case DataBuffer.TYPE_BYTE: @@ -174,9 +178,8 @@ @Override public SampleModel createSubsetSampleModel(int bands[]) { if (bands.length > this.numBands) { - throw new RasterFormatException("The number of the bands " + - "in the subset is greater than the number of bands " + - "in the sample model"); + // awt.64=The number of the bands in the subset is greater than the number of bands in the sample model + throw new RasterFormatException(Messages.getString("awt.64")); //$NON-NLS-1$ } int masks[] = new int[bands.length]; @@ -196,8 +199,8 @@ @Override public int[] getPixel(int x, int y, int iArray[], DataBuffer data) { if (x < 0 || y < 0 || x >= this.width || y >= this.height) { - throw new ArrayIndexOutOfBoundsException("Coordinates are " + - "not in bounds"); + // awt.63=Coordinates are not in bounds + throw new ArrayIndexOutOfBoundsException(Messages.getString("awt.63")); //$NON-NLS-1$ } int pixel[]; if (iArray == null) { @@ -216,8 +219,8 @@ @Override public void setPixel(int x, int y, int iArray[], DataBuffer data) { if (x < 0 || y < 0 || x >= this.width || y >= this.height) { - throw new ArrayIndexOutOfBoundsException("Coordinates are " + - "not in bounds"); + // awt.63=Coordinates are not in bounds + throw new ArrayIndexOutOfBoundsException(Messages.getString("awt.63")); //$NON-NLS-1$ } for (int i = 0; i < this.numBands; i++) { setSample(x, y, i, iArray[i], data); @@ -227,8 +230,8 @@ @Override public int getSample(int x, int y, int b, DataBuffer data) { if (x < 0 || y < 0 || x >= this.width || y >= this.height) { - throw new ArrayIndexOutOfBoundsException("Coordinates are " + - "not in bounds"); + // awt.63=Coordinates are not in bounds + throw new ArrayIndexOutOfBoundsException(Messages.getString("awt.63")); //$NON-NLS-1$ } int sample = data.getElem(y * scanlineStride + x); return ((sample & this.bitMasks[b]) >>> this.bitOffsets[b]); @@ -238,8 +241,8 @@ public int[] getPixels(int x, int y, int w, int h, int iArray[], DataBuffer data) { if (x < 0 || y < 0 || x + w > this.width || y + h > this.height) { - throw new ArrayIndexOutOfBoundsException("Coordinates are " + - "not in bounds"); + // awt.63=Coordinates are not in bounds + throw new ArrayIndexOutOfBoundsException(Messages.getString("awt.63")); //$NON-NLS-1$ } int pixels[]; @@ -266,8 +269,8 @@ public void setPixels(int x, int y, int w, int h, int iArray[], DataBuffer data) { if (x < 0 || y < 0 || x + w > this.width || y + h > this.height) { - throw new ArrayIndexOutOfBoundsException("Coordinates are " + - "not in bounds"); + // awt.63=Coordinates are not in bounds + throw new ArrayIndexOutOfBoundsException(Messages.getString("awt.63")); //$NON-NLS-1$ } int idx = 0; @@ -284,8 +287,8 @@ @Override public void setSample(int x, int y, int b, int s, DataBuffer data) { if (x < 0 || y < 0 || x >= this.width || y >= this.height) { - throw new ArrayIndexOutOfBoundsException("Coordinates are " + - "not in bounds"); + // awt.63=Coordinates are not in bounds + throw new ArrayIndexOutOfBoundsException(Messages.getString("awt.63")); //$NON-NLS-1$ } int tmp = data.getElem(y * scanlineStride + x); tmp &= ~this.bitMasks[b]; @@ -297,8 +300,8 @@ public int[] getSamples(int x, int y, int w, int h, int b, int iArray[], DataBuffer data) { if (x < 0 || y < 0 || x + w > this.width || y + h > this.height) { - throw new ArrayIndexOutOfBoundsException("Coordinates are " + - "not in bounds"); + // awt.63=Coordinates are not in bounds + throw new ArrayIndexOutOfBoundsException(Messages.getString("awt.63")); //$NON-NLS-1$ } int samples[]; @@ -323,8 +326,8 @@ public void setSamples(int x, int y, int w, int h, int b, int iArray[], DataBuffer data) { if (x < 0 || y < 0 || x + w > this.width || y + h > this.height) { - throw new ArrayIndexOutOfBoundsException("Coordinates are " + - "not in bounds"); + // awt.63=Coordinates are not in bounds + throw new ArrayIndexOutOfBoundsException(Messages.getString("awt.63")); //$NON-NLS-1$ } int idx = 0; Index: src/main/java/common/java/awt/image/WritableRaster.java =================================================================== --- src/main/java/common/java/awt/image/WritableRaster.java (revision 470363) +++ src/main/java/common/java/awt/image/WritableRaster.java (working copy) @@ -23,6 +23,8 @@ import java.awt.Point; import java.awt.Rectangle; +import org.apache.harmony.awt.internal.nls.Messages; + public class WritableRaster extends Raster { protected WritableRaster(SampleModel sampleModel, DataBuffer dataBuffer, @@ -56,36 +58,38 @@ public WritableRaster createWritableChild(int parentX, int parentY, int w, int h, int childMinX, int childMinY, int bandList[]) { if (w <= 0 || h <= 0) { - throw new RasterFormatException("Width or Height of child " + - "Raster is less than or equal to zero"); + // awt.244=Width or Height of child Raster is less than or equal to zero + throw new RasterFormatException(Messages.getString("awt.244")); //$NON-NLS-1$ } if (parentX < this.minX || parentX + w > this.minX + this.width) { - throw new RasterFormatException("parentX disposes outside Raster"); + // awt.245=parentX disposes outside Raster + throw new RasterFormatException(Messages.getString("awt.245")); //$NON-NLS-1$ } if (parentY < this.minY || parentY + h > this.minY + this.height) { - throw new RasterFormatException("parentY disposes outside Raster"); + // awt.246=parentY disposes outside Raster + throw new RasterFormatException(Messages.getString("awt.246")); //$NON-NLS-1$ } if ((long) parentX + w > Integer.MAX_VALUE) { - throw new RasterFormatException("parentX + w results in " + - "integer overflow"); + // awt.247=parentX + w results in integer overflow + throw new RasterFormatException(Messages.getString("awt.247")); //$NON-NLS-1$ } if ((long) parentY + h > Integer.MAX_VALUE) { - throw new RasterFormatException("parentY + h results in " + - "integer overflow"); + // awt.248=parentY + h results in integer overflow + throw new RasterFormatException(Messages.getString("awt.248")); //$NON-NLS-1$ } if ((long) childMinX + w > Integer.MAX_VALUE) { - throw new RasterFormatException("childMinX + w results in " + - "integer overflow"); + // awt.249=childMinX + w results in integer overflow + throw new RasterFormatException(Messages.getString("awt.249")); //$NON-NLS-1$ } if ((long) childMinY + h > Integer.MAX_VALUE) { - throw new RasterFormatException("childMinY + h results in " + - "integer overflow"); + // awt.24A=childMinY + h results in integer overflow + throw new RasterFormatException(Messages.getString("awt.24A")); //$NON-NLS-1$ } SampleModel childModel; @@ -200,8 +204,8 @@ if (dstX < this.minX || dstX + w > this.minX + this.width || dstY < this.minY || dstY + h > this.minY + this.height) { - throw new ArrayIndexOutOfBoundsException("Coordinates are " + - "not in bounds"); + // awt.63=Coordinates are not in bounds + throw new ArrayIndexOutOfBoundsException(Messages.getString("awt.63")); //$NON-NLS-1$ } int srcX = inRaster.getMinX(); Index: src/main/java/common/java/awt/print/Book.java =================================================================== --- src/main/java/common/java/awt/print/Book.java (revision 470363) +++ src/main/java/common/java/awt/print/Book.java (working copy) @@ -22,6 +22,8 @@ import java.util.Vector; +import org.apache.harmony.awt.internal.nls.Messages; + public class Book implements Pageable { private final Vector bookPages; @@ -35,10 +37,14 @@ innerPage(Printable painter, PageFormat page) { super(); if (painter == null) { - throw new NullPointerException("painter is null"); + // awt.01='{0}' parameter is null + throw new NullPointerException(Messages.getString( + "awt.01", "painter")); //$NON-NLS-1$ //$NON-NLS-2$ } if (page == null) { - throw new NullPointerException("page is null"); + // awt.01='{0}' parameter is null + throw new NullPointerException(Messages.getString( + "awt.01", "page")); //$NON-NLS-1$ //$NON-NLS-2$ } pagePainter = painter; pageFormat = page; @@ -80,8 +86,8 @@ throws IndexOutOfBoundsException { if (pageIndex >= getNumberOfPages()) { - throw new IndexOutOfBoundsException( - "pageIndex is more than book size"); + // awt.5E=pageIndex is more than book size + throw new IndexOutOfBoundsException(Messages.getString("awt.5E")); //$NON-NLS-1$ } return bookPages.elementAt(pageIndex).getPageFormat(); } @@ -90,8 +96,8 @@ throws IndexOutOfBoundsException { if (pageIndex >= getNumberOfPages()) { - throw new IndexOutOfBoundsException( - "pageIndex is more than book size"); + // awt.5E=pageIndex is more than book size + throw new IndexOutOfBoundsException(Messages.getString("awt.5E")); //$NON-NLS-1$ } return bookPages.elementAt(pageIndex).getPrintable(); } @@ -100,8 +106,8 @@ throws IndexOutOfBoundsException { if (pageIndex >= getNumberOfPages()) { - throw new IndexOutOfBoundsException( - "pageIndex is more than book size"); + // awt.5E=pageIndex is more than book size + throw new IndexOutOfBoundsException(Messages.getString("awt.5E")); //$NON-NLS-1$ } bookPages.setElementAt(new innerPage(painter, page), pageIndex); } Index: src/main/java/common/java/awt/print/PageFormat.java =================================================================== --- src/main/java/common/java/awt/print/PageFormat.java (revision 470363) +++ src/main/java/common/java/awt/print/PageFormat.java (working copy) @@ -20,6 +20,8 @@ */ package java.awt.print; +import org.apache.harmony.awt.internal.nls.Messages; + public class PageFormat implements Cloneable { public static final int LANDSCAPE = 0; public static final int PORTRAIT = 1; @@ -155,7 +157,8 @@ || orientation == REVERSE_LANDSCAPE) { this.pageOrientation = orientation; } else { - throw new IllegalArgumentException("wrong orientation"); + // awt.5F=wrong orientation + throw new IllegalArgumentException(Messages.getString("awt.5F")); //$NON-NLS-1$ } } Index: src/main/java/common/java/awt/print/PrinterJob.java =================================================================== --- src/main/java/common/java/awt/print/PrinterJob.java (revision 470363) +++ src/main/java/common/java/awt/print/PrinterJob.java (working copy) @@ -27,6 +27,8 @@ import javax.print.StreamPrintServiceFactory; import javax.print.attribute.PrintRequestAttributeSet; +import org.apache.harmony.awt.internal.nls.Messages; + public abstract class PrinterJob { /* abstract section */ @@ -75,22 +77,22 @@ return AccessController.doPrivileged( new PrivilegedAction() { public PrinterJob run() { - String s = System.getProperty("java.awt.printerjob"); + String s = System.getProperty("java.awt.printerjob"); //$NON-NLS-1$ - if (s == null || s.equals("")){ - s = "org.apache.harmony.x.print.awt.PSPrinterJob"; + if (s == null || s.equals("")){ //$NON-NLS-1$ + s = "org.apache.harmony.x.print.awt.PSPrinterJob"; //$NON-NLS-1$ } try { return (PrinterJob) Class.forName(s).newInstance(); } catch (ClassNotFoundException cnfe) { - throw new AWTError( - "Default class for PrinterJob is not found"); + // awt.5A=Default class for PrinterJob is not found + throw new AWTError(Messages.getString("awt.5A")); //$NON-NLS-1$ } catch (IllegalAccessException iae) { - throw new AWTError( - "No access to default class for PrinterJob"); + // awt.5B=No access to default class for PrinterJob + throw new AWTError(Messages.getString("awt.5B")); //$NON-NLS-1$ } catch (InstantiationException ie) { - throw new AWTError( - "Instantiation exception for PrinterJob"); + // awt.5C=Instantiation exception for PrinterJob + throw new AWTError(Messages.getString("awt.5C")); //$NON-NLS-1$ } } }); @@ -130,8 +132,8 @@ public boolean printDialog(PrintRequestAttributeSet attributes) throws HeadlessException { if (attributes == null) { - throw new NullPointerException( - "The parameter 'attributes' is null"); + // awt.01='{0}' parameter is null + throw new NullPointerException(Messages.getString("awt.01", "attributes")); //$NON-NLS-1$ //$NON-NLS-2$ } //This implementation ignores the attribute set. return printDialog(); @@ -139,16 +141,17 @@ public void setPrintService(PrintService printservice) throws PrinterException { - throw new PrinterException(printservice.toString() - + "is not supported"); + // awt.5D={0} is not supported + throw new PrinterException(Messages.getString( + "awt.5D", printservice.toString())); //$NON-NLS-1$ } public PageFormat pageDialog(PrintRequestAttributeSet attributes) throws HeadlessException { //This implementation ignores the attribute set. if(attributes == null) { - throw new NullPointerException( - "The parameter 'attributes' is null"); + // awt.01='{0}' parameter is null + throw new NullPointerException(Messages.getString("awt.01", "attributes")); //$NON-NLS-1$ //$NON-NLS-2$ } return pageDialog(defaultPage()); }