diff --git a/src/share/classes/java/awt/Image.java b/src/share/classes/java/awt/Image.java
index ce23169ea3c47e9bcf113686085957ac42cb3889..b7629f19a959425891c175639243a22ac017b303 100644
--- a/src/share/classes/java/awt/Image.java
+++ b/src/share/classes/java/awt/Image.java
@@ -124,7 +124,7 @@ public abstract class Image {
* @param name a property name.
* @param observer an object waiting for this image to be loaded.
* @return the value of the named property.
- * @throws NullPointerException
if the property name is null.
+ * @throws NullPointerException if the property name is null.
* @see java.awt.image.ImageObserver
* @see java.awt.Image#UndefinedProperty
*/
diff --git a/src/share/classes/java/awt/MediaTracker.java b/src/share/classes/java/awt/MediaTracker.java
index 23ec357727452267a514d8904a02f17c58814271..ec76ce4ce9fdff85a331b65a290aca34cdf7f0ff 100644
--- a/src/share/classes/java/awt/MediaTracker.java
+++ b/src/share/classes/java/awt/MediaTracker.java
@@ -66,7 +66,7 @@ import java.awt.image.ImageObserver;
*
* Here is an example of using MediaTracker
:
*
- *
+ *
{@code
* import java.applet.Applet;
* import java.awt.Color;
* import java.awt.Image;
@@ -160,7 +160,7 @@ import java.awt.image.ImageObserver;
* }
* }
* }
- *
+ * }
*
* @author Jim Graham
* @since JDK1.0
diff --git a/src/share/classes/java/awt/PageAttributes.java b/src/share/classes/java/awt/PageAttributes.java
index 85f52ffbe14935efd1158eb79b5130204a7a0bc6..7e7bf1ce4a8a26172d24bf2063bdbff435fadf01 100644
--- a/src/share/classes/java/awt/PageAttributes.java
+++ b/src/share/classes/java/awt/PageAttributes.java
@@ -187,55 +187,55 @@ public final class PageAttributes implements Cloneable {
};
/**
- * The MediaType instance for ISO/DIN & JIS 4A0, 1682 x 2378 mm.
+ * The MediaType instance for ISO/DIN and JIS 4A0, 1682 x 2378 mm.
*/
public static final MediaType ISO_4A0 = new MediaType(I_ISO_4A0);
/**
- * The MediaType instance for ISO/DIN & JIS 2A0, 1189 x 1682 mm.
+ * The MediaType instance for ISO/DIN and JIS 2A0, 1189 x 1682 mm.
*/
public static final MediaType ISO_2A0 = new MediaType(I_ISO_2A0);
/**
- * The MediaType instance for ISO/DIN & JIS A0, 841 x 1189 mm.
+ * The MediaType instance for ISO/DIN and JIS A0, 841 x 1189 mm.
*/
public static final MediaType ISO_A0 = new MediaType(I_ISO_A0);
/**
- * The MediaType instance for ISO/DIN & JIS A1, 594 x 841 mm.
+ * The MediaType instance for ISO/DIN and JIS A1, 594 x 841 mm.
*/
public static final MediaType ISO_A1 = new MediaType(I_ISO_A1);
/**
- * The MediaType instance for ISO/DIN & JIS A2, 420 x 594 mm.
+ * The MediaType instance for ISO/DIN and JIS A2, 420 x 594 mm.
*/
public static final MediaType ISO_A2 = new MediaType(I_ISO_A2);
/**
- * The MediaType instance for ISO/DIN & JIS A3, 297 x 420 mm.
+ * The MediaType instance for ISO/DIN and JIS A3, 297 x 420 mm.
*/
public static final MediaType ISO_A3 = new MediaType(I_ISO_A3);
/**
- * The MediaType instance for ISO/DIN & JIS A4, 210 x 297 mm.
+ * The MediaType instance for ISO/DIN and JIS A4, 210 x 297 mm.
*/
public static final MediaType ISO_A4 = new MediaType(I_ISO_A4);
/**
- * The MediaType instance for ISO/DIN & JIS A5, 148 x 210 mm.
+ * The MediaType instance for ISO/DIN and JIS A5, 148 x 210 mm.
*/
public static final MediaType ISO_A5 = new MediaType(I_ISO_A5);
/**
- * The MediaType instance for ISO/DIN & JIS A6, 105 x 148 mm.
+ * The MediaType instance for ISO/DIN and JIS A6, 105 x 148 mm.
*/
public static final MediaType ISO_A6 = new MediaType(I_ISO_A6);
/**
- * The MediaType instance for ISO/DIN & JIS A7, 74 x 105 mm.
+ * The MediaType instance for ISO/DIN and JIS A7, 74 x 105 mm.
*/
public static final MediaType ISO_A7 = new MediaType(I_ISO_A7);
/**
- * The MediaType instance for ISO/DIN & JIS A8, 52 x 74 mm.
+ * The MediaType instance for ISO/DIN and JIS A8, 52 x 74 mm.
*/
public static final MediaType ISO_A8 = new MediaType(I_ISO_A8);
/**
- * The MediaType instance for ISO/DIN & JIS A9, 37 x 52 mm.
+ * The MediaType instance for ISO/DIN and JIS A9, 37 x 52 mm.
*/
public static final MediaType ISO_A9 = new MediaType(I_ISO_A9);
/**
- * The MediaType instance for ISO/DIN & JIS A10, 26 x 37 mm.
+ * The MediaType instance for ISO/DIN and JIS A10, 26 x 37 mm.
*/
public static final MediaType ISO_A10 = new MediaType(I_ISO_A10);
/**
diff --git a/src/share/classes/java/awt/Rectangle.java b/src/share/classes/java/awt/Rectangle.java
index c826022a63b63c7e1140c97f46ab8440d3b7184d..0b550073b0ab23a72b1bffa0078ecde555a6082a 100644
--- a/src/share/classes/java/awt/Rectangle.java
+++ b/src/share/classes/java/awt/Rectangle.java
@@ -76,19 +76,19 @@ import java.beans.Transient;
* negative width and height or it should use the first point in the set
* to construct the {@code Rectangle}.
* For example:
- *
+ * {@code
* Rectangle bounds = new Rectangle(0, 0, -1, -1);
* for (int i = 0; i < points.length; i++) {
* bounds.add(points[i]);
* }
- *
+ * }
* or if we know that the points array contains at least one point:
- *
+ * {@code
* Rectangle bounds = new Rectangle(points[0]);
* for (int i = 1; i < points.length; i++) {
* bounds.add(points[i]);
* }
- *
+ * }
*
* This class uses 32-bit integers to store its location and dimensions.
* Frequently operations may produce a result that exceeds the range of
diff --git a/src/share/classes/java/awt/RenderingHints.java b/src/share/classes/java/awt/RenderingHints.java
index 4238679705507ce03cda6d1ff164c7865ede4686..931639c15e30739516c803495317210f086e0d1a 100644
--- a/src/share/classes/java/awt/RenderingHints.java
+++ b/src/share/classes/java/awt/RenderingHints.java
@@ -999,15 +999,15 @@ public class RenderingHints
}
/**
- * Returns true
if this RenderingHints
+ * Returns {@code true} if this {@code RenderingHints}
* contains a mapping for the specified key.
*
* @param key key whose presence in this
- * RenderingHints
is to be tested.
- * @return true
if this RenderingHints
+ * {@code RenderingHints} is to be tested.
+ * @return {@code true} if this {@code RenderingHints}
* contains a mapping for the specified key.
- * @exception ClassCastException
if the key can not
- * be cast to RenderingHints.Key
+ * @exception ClassCastException if the key can not
+ * be cast to {@code RenderingHints.Key}
*/
public boolean containsKey(Object key) {
return hintmap.containsKey((Key) key);
@@ -1039,10 +1039,10 @@ public class RenderingHints
* Returns the value to which the specified key is mapped.
* @param key a rendering hint key
* @return the value to which the key is mapped in this object or
- * null
if the key is not mapped to any value in
+ * {@code null} if the key is not mapped to any value in
* this object.
- * @exception ClassCastException
if the key can not
- * be cast to RenderingHints.Key
+ * @exception ClassCastException if the key can not
+ * be cast to {@code RenderingHints.Key}
* @see #put(Object, Object)
*/
public Object get(Object key) {
@@ -1050,20 +1050,20 @@ public class RenderingHints
}
/**
- * Maps the specified key
to the specified
- * value
in this RenderingHints
object.
- * Neither the key nor the value can be null
.
- * The value can be retrieved by calling the get
method
+ * Maps the specified {@code key} to the specified
+ * {@code value} in this {@code RenderingHints} object.
+ * Neither the key nor the value can be {@code null}.
+ * The value can be retrieved by calling the {@code get} method
* with a key that is equal to the original key.
* @param key the rendering hint key.
* @param value the rendering hint value.
* @return the previous value of the specified key in this object
- * or null
if it did not have one.
- * @exception NullPointerException
if the key is
- * null
.
- * @exception ClassCastException
if the key can not
- * be cast to RenderingHints.Key
- * @exception IllegalArgumentException
if the
+ * or {@code null} if it did not have one.
+ * @exception NullPointerException if the key is
+ * {@code null}.
+ * @exception ClassCastException if the key can not
+ * be cast to {@code RenderingHints.Key}
+ * @exception IllegalArgumentException if the
* {@link Key#isCompatibleValue(java.lang.Object)
* Key.isCompatibleValue()}
* method of the specified key returns false for the
@@ -1102,13 +1102,13 @@ public class RenderingHints
/**
* Removes the key and its corresponding value from this
- * RenderingHints
object. This method does nothing if the
- * key is not in this RenderingHints
object.
+ * {@code RenderingHints} object. This method does nothing if the
+ * key is not in this {@code RenderingHints} object.
* @param key the rendering hints key that needs to be removed
- * @exception ClassCastException
if the key can not
- * be cast to RenderingHints.Key
+ * @exception ClassCastException if the key can not
+ * be cast to {@code RenderingHints.Key}
* @return the value to which the key had previously been mapped in this
- * RenderingHints
object, or null
+ * {@code RenderingHints} object, or {@code null}
* if the key did not have a mapping.
*/
public Object remove(Object key) {
@@ -1116,18 +1116,18 @@ public class RenderingHints
}
/**
- * Copies all of the mappings from the specified Map
- * to this RenderingHints
. These mappings replace
- * any mappings that this RenderingHints
had for any
- * of the keys currently in the specified Map
.
- * @param m the specified Map
- * @exception ClassCastException
class of a key or value
- * in the specified Map
prevents it from being
- * stored in this RenderingHints
.
- * @exception IllegalArgumentException
some aspect
- * of a key or value in the specified Map
+ * Copies all of the mappings from the specified {@code Map}
+ * to this {@code RenderingHints}. These mappings replace
+ * any mappings that this {@code RenderingHints} had for any
+ * of the keys currently in the specified {@code Map}.
+ * @param m the specified {@code Map}
+ * @exception ClassCastException class of a key or value
+ * in the specified {@code Map} prevents it from being
+ * stored in this {@code RenderingHints}.
+ * @exception IllegalArgumentException some aspect
+ * of a key or value in the specified {@code Map}
* prevents it from being stored in
- * this RenderingHints
.
+ * this {@code RenderingHints}.
*/
public void putAll(Map,?> m) {
// ## javac bug?
diff --git a/src/share/classes/java/awt/font/NumericShaper.java b/src/share/classes/java/awt/font/NumericShaper.java
index 0de80e91f39e62110366a2c20bdaadee6d0fe6f9..63a1a6afe3a442a230f80a16229de1bb7e2d580e 100644
--- a/src/share/classes/java/awt/font/NumericShaper.java
+++ b/src/share/classes/java/awt/font/NumericShaper.java
@@ -1212,7 +1212,7 @@ public final class NumericShaper implements java.io.Serializable {
* For example, to check if a shaper shapes to Arabic, you would use the
* following:
*
- * if ((shaper.getRanges() & shaper.ARABIC) != 0) { ...
+ * {@code if ((shaper.getRanges() & shaper.ARABIC) != 0) { ... }
*
*
* Note that this method supports only the bit mask-based
diff --git a/src/share/classes/java/awt/font/TextAttribute.java b/src/share/classes/java/awt/font/TextAttribute.java
index c462636348fc0e6e1b84f59f889194b2109fc6e0..8b1612d385c2df2600ce2b971c5cb56466a3c615 100644
--- a/src/share/classes/java/awt/font/TextAttribute.java
+++ b/src/share/classes/java/awt/font/TextAttribute.java
@@ -66,7 +66,7 @@ import java.util.HashMap;
*
a description of the effect.
*
*
- *
Values
+ * Values
*
* - The values of attributes must always be immutable.
*
- Where value limitations are given, any value outside of that
@@ -96,7 +96,6 @@ import java.util.HashMap;
*
*
Summary of attributes
*
- *
*
@@ -110,9 +109,9 @@ import java.util.HashMap;
* {@link #FAMILY} |
* String |
* See Font {@link java.awt.Font#DIALOG DIALOG},
-{@link java.awt.Font#DIALOG_INPUT DIALOG_INPUT}, {@link java.awt.Font#SERIF SERIF},
-{@link java.awt.Font#SANS_SERIF SANS_SERIF}, and {@link java.awt.Font#MONOSPACED MONOSPACED}.
- |
+ * {@link java.awt.Font#DIALOG_INPUT DIALOG_INPUT},
{@link java.awt.Font#SERIF SERIF},
+ * {@link java.awt.Font#SANS_SERIF SANS_SERIF}, and {@link java.awt.Font#MONOSPACED MONOSPACED}.
+ *
* "Default" (use platform default) |
*
*
@@ -248,7 +247,6 @@ import java.util.HashMap;
* 0 (do not add tracking) |
*
*
- *
*
* @see java.awt.Font
* @see java.awt.font.TextLayout
diff --git a/src/share/classes/java/awt/geom/FlatteningPathIterator.java b/src/share/classes/java/awt/geom/FlatteningPathIterator.java
index 35a7895650d90671d24ff21aeffef8f2f0b4184e..3ee163ed2b6e770961fe202922499cb1a9e6f939 100644
--- a/src/share/classes/java/awt/geom/FlatteningPathIterator.java
+++ b/src/share/classes/java/awt/geom/FlatteningPathIterator.java
@@ -109,7 +109,7 @@ public class FlatteningPathIterator implements PathIterator {
* control points and the flattened curve
* @param limit the maximum number of recursive subdivisions
* allowed for any curved segment
- * @exception IllegalArgumentException
if
+ * @exception IllegalArgumentException if
* flatness
or limit
* is less than zero
*/
@@ -336,7 +336,7 @@ public class FlatteningPathIterator implements PathIterator {
* @param coords an array that holds the data returned from
* this method
* @return the path segment type of the current path segment.
- * @exception NoSuchElementException
if there
+ * @exception NoSuchElementException if there
* are no more elements in the flattening path to be
* returned.
* @see PathIterator#SEG_MOVETO
@@ -371,7 +371,7 @@ public class FlatteningPathIterator implements PathIterator {
* @param coords an array that holds the data returned from
* this method
* @return the path segment type of the current path segment.
- * @exception NoSuchElementException
if there
+ * @exception NoSuchElementException if there
* are no more elements in the flattening path to be
* returned.
* @see PathIterator#SEG_MOVETO
diff --git a/src/share/classes/java/awt/geom/Path2D.java b/src/share/classes/java/awt/geom/Path2D.java
index acf781ad775b5a47560e9383ca1d062da88c5275..d968e2ec939dc1405d45ff7bb09e8575b3735274 100644
--- a/src/share/classes/java/awt/geom/Path2D.java
+++ b/src/share/classes/java/awt/geom/Path2D.java
@@ -794,7 +794,7 @@ public abstract class Path2D implements Shape, Cloneable {
* ({@link #WIND_EVEN_ODD WIND_EVEN_ODD} or
* {@link #WIND_NON_ZERO WIND_NON_ZERO})
*
- followed by
- * NP (or unlimited if NP < 0) sets of values consisting of
+ * {@code NP} (or unlimited if {@code NP < 0}) sets of values consisting of
* a single byte indicating a path segment type
* followed by one or more pairs of float or double
* values representing the coordinates of the path segment
@@ -1520,7 +1520,7 @@ public abstract class Path2D implements Shape, Cloneable {
* ({@link #WIND_EVEN_ODD WIND_EVEN_ODD} or
* {@link #WIND_NON_ZERO WIND_NON_ZERO})
*
- followed by
- * NP (or unlimited if NP < 0) sets of values consisting of
+ * {@code NP} (or unlimited if {@code NP < 0}) sets of values consisting of
* a single byte indicating a path segment type
* followed by one or more pairs of float or double
* values representing the coordinates of the path segment
diff --git a/src/share/classes/java/awt/image/MultiPixelPackedSampleModel.java b/src/share/classes/java/awt/image/MultiPixelPackedSampleModel.java
index 8095dad2fc5a74851c80ae133924a757c0936578..ebd41f61b2523445a2cefb92efedd2c426c9f762 100644
--- a/src/share/classes/java/awt/image/MultiPixelPackedSampleModel.java
+++ b/src/share/classes/java/awt/image/MultiPixelPackedSampleModel.java
@@ -348,7 +348,7 @@ public class MultiPixelPackedSampleModel extends SampleModel
* data
* @return the specified band containing the sample of the specified
* pixel.
- * @exception ArrayIndexOutOfBoundException if the specified
+ * @exception ArrayIndexOutOfBoundsException if the specified
* coordinates are not in bounds.
* @see #setSample(int, int, int, int, DataBuffer)
*/
diff --git a/src/share/classes/java/awt/print/Book.java b/src/share/classes/java/awt/print/Book.java
index abf02e04b332a71953c8c31ce5701f4f4e7c5e22..72f032e7f35eb4c5524e7086b6434aeaaeb91f7e 100644
--- a/src/share/classes/java/awt/print/Book.java
+++ b/src/share/classes/java/awt/print/Book.java
@@ -129,7 +129,7 @@ public class Book implements Pageable {
* @param painter the
Printable
instance that
* renders the page
* @param page the size and orientation of the page
- * @throws NullPointerException
+ * @throws NullPointerException
* If the painter
or page
* argument is null
*/
@@ -146,7 +146,7 @@ public class Book implements Pageable {
* @param page the size and orientation of the page
* @param numPages the number of pages to be added to the
* this Book
.
- * @throws NullPointerException
+ * @throws NullPointerException
* If the painter
or page
* argument is null
*/
diff --git a/src/share/classes/java/awt/print/PageFormat.java b/src/share/classes/java/awt/print/PageFormat.java
index 0b25201c6c7e2da148b800bf1e3b55ffd1e69417..fc6e023d56709c77f3a37adc734916c533312fef 100644
--- a/src/share/classes/java/awt/print/PageFormat.java
+++ b/src/share/classes/java/awt/print/PageFormat.java
@@ -286,7 +286,7 @@ public class PageFormat implements Cloneable
* PageFormat
.
* @param paper the Paper
object to which to set
* the Paper
object for this PageFormat
.
- * @exception NullPointerException
+ * @exception NullPointerException
* a null paper instance was passed as a parameter.
* @see #getPaper
*/
diff --git a/src/share/classes/java/awt/print/Printable.java b/src/share/classes/java/awt/print/Printable.java
index 6737aec6194d24498eabcd2ba40afbd61f8d6a60..c34b7e6a963b1fb3105832b489efc0c7b64924d2 100644
--- a/src/share/classes/java/awt/print/Printable.java
+++ b/src/share/classes/java/awt/print/Printable.java
@@ -76,7 +76,7 @@ import java.awt.Graphics;
* - With the exception of re-imaging an entire document for multiple
* collated copies, the increasing page index order means that when
* page N is requested if a client needs to calculate page break position,
- * it may safely discard any state related to pages < N, and make current
+ * it may safely discard any state related to pages < N, and make current
* that for page N. "State" usually is just the calculated position in the
* document that corresponds to the start of the page.
*
diff --git a/src/share/classes/java/awt/print/PrinterJob.java b/src/share/classes/java/awt/print/PrinterJob.java
index 6ac1133b635017b6633e7551be76bb17da5f0a96..74121c57794e3cc4dce6bf079136dc2fa2ca2636 100644
--- a/src/share/classes/java/awt/print/PrinterJob.java
+++ b/src/share/classes/java/awt/print/PrinterJob.java
@@ -113,7 +113,7 @@ public abstract class PrinterJob {
* A convenience method which locates factories for stream print
* services which can image 2D graphics.
* Sample usage :
- *
+ * {@code
* FileOutputStream outstream;
* StreamPrintService psPrinter;
* String psMimeType = "application/postscript";
@@ -131,7 +131,7 @@ public abstract class PrinterJob {
* e.printStackTrace();
* }
* }
- *
+ * }
* Services returned from this method may be installed on
* PrinterJob
instances which support print services.
* Calling this method is equivalent to calling
diff --git a/src/solaris/classes/sun/font/XRTextRenderer.java b/src/solaris/classes/sun/font/XRTextRenderer.java
index 308de3ab300cb214a8e3f0dd7ff69557b1196c45..243fa8543fba898e7465a880393c7aadd61c4b4b 100644
--- a/src/solaris/classes/sun/font/XRTextRenderer.java
+++ b/src/solaris/classes/sun/font/XRTextRenderer.java
@@ -36,6 +36,10 @@ import sun.java2d.xr.*;
* @author Clemens Eisserer
*/
public class XRTextRenderer extends GlyphListPipe {
+ // Workarround for a bug in libXrender.
+ // In case the number of glyphs of an ELT is a multiple of 254,
+ // a few garbage bytes are sent to the XServer causing hangs.
+ static final int MAX_ELT_GLYPH_COUNT = 253;
XRGlyphCache glyphCache;
XRCompositeManager maskBuffer;
@@ -92,8 +96,11 @@ public class XRTextRenderer extends GlyphListPipe {
int posX = 0, posY = 0;
if (gl.usePositions()
- || (cacheEntry.getXAdvance() != ((float) cacheEntry.getXOff()) || cacheEntry.getYAdvance() != ((float) cacheEntry.getYOff()))
- || eltIndex < 0 || glyphSet != activeGlyphSet) {
+ || cacheEntry.getXAdvance() != ((float) cacheEntry.getXOff())
+ || cacheEntry.getYAdvance() != ((float) cacheEntry.getYOff())
+ || glyphSet != activeGlyphSet
+ || eltIndex < 0
+ || eltList.getCharCnt(eltIndex) == MAX_ELT_GLYPH_COUNT) {
eltIndex = eltList.getNextIndex();
eltList.setCharCnt(eltIndex, 1);
@@ -101,7 +108,7 @@ public class XRTextRenderer extends GlyphListPipe {
eltList.setGlyphSet(eltIndex, glyphSet);
if (gl.usePositions()) {
- // /*In this case advX only stores rounding errors*/
+ // In this case advX only stores rounding errors
float x = positions[i * 2] + advX;
float y = positions[i * 2 + 1] + advY;
posX = (int) Math.floor(x);
@@ -120,16 +127,14 @@ public class XRTextRenderer extends GlyphListPipe {
posX = (int) Math.floor(advX);
posY = (int) Math.floor(advY);
- // Advance of ELT = difference between stored
- // relative
+ // Advance of ELT = difference between stored relative
// positioning information and required float.
advX += (cacheEntry.getXAdvance() - cacheEntry.getXOff());
advY += (cacheEntry.getYAdvance() - cacheEntry.getYOff());
}
- /*
- * Offset of the current glyph is the difference to the last
- * glyph and this one
- */
+
+ // Offset of the current glyph is the difference
+ // to the last glyph and this one
eltList.setXOff(eltIndex, (posX - oldPosX));
eltList.setYOff(eltIndex, (posY - oldPosY));
diff --git a/src/solaris/classes/sun/java2d/xr/XRSurfaceData.java b/src/solaris/classes/sun/java2d/xr/XRSurfaceData.java
index f05243e407bfd60f2dd70c89d82c332e05b9d392..c6953151a19bef2b44f9ec9d2571d1025f41a1a7 100644
--- a/src/solaris/classes/sun/java2d/xr/XRSurfaceData.java
+++ b/src/solaris/classes/sun/java2d/xr/XRSurfaceData.java
@@ -245,7 +245,17 @@ public abstract class XRSurfaceData extends XSurfaceData {
ColorModel cm, Image image,
long drawable,
int transparency) {
- int depth = transparency > Transparency.OPAQUE ? 32 : 24;
+ int depth;
+ // If we have a 32 bit color model for the window it needs
+ // alpha to support translucency of the window so we need
+ // to upgrade what was requested for the surface.
+ if (gc.getColorModel().getPixelSize() == 32) {
+ depth = 32;
+ transparency = Transparency.TRANSLUCENT;
+ } else {
+ depth = transparency > Transparency.OPAQUE ? 32 : 24;
+ }
+
if (depth == 24) {
cm = new DirectColorModel(depth,
0x00FF0000, 0x0000FF00, 0x000000FF);
diff --git a/src/solaris/classes/sun/print/IPPPrintService.java b/src/solaris/classes/sun/print/IPPPrintService.java
index 329bb2934a9a9fef2a9b8b10e62e60d9a5c203f9..f48dd5ba38e67fc502df2db82b0afe6ad5dbd446 100644
--- a/src/solaris/classes/sun/print/IPPPrintService.java
+++ b/src/solaris/classes/sun/print/IPPPrintService.java
@@ -44,6 +44,7 @@ import javax.print.event.PrintServiceAttributeListener;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
+import java.net.URLConnection;
import java.net.HttpURLConnection;
import java.io.File;
import java.io.InputStream;
@@ -1607,14 +1608,16 @@ public class IPPPrintService implements PrintService, SunPrinterJobService {
public static HttpURLConnection getIPPConnection(URL url) {
HttpURLConnection connection;
+ URLConnection urlc;
try {
- connection = (HttpURLConnection)url.openConnection();
+ urlc = url.openConnection();
} catch (java.io.IOException ioe) {
return null;
}
- if (!(connection instanceof HttpURLConnection)) {
+ if (!(urlc instanceof HttpURLConnection)) {
return null;
}
+ connection = (HttpURLConnection)urlc;
connection.setUseCaches(false);
connection.setDefaultUseCaches(false);
connection.setDoInput(true);
diff --git a/src/solaris/classes/sun/print/UnixPrintServiceLookup.java b/src/solaris/classes/sun/print/UnixPrintServiceLookup.java
index 2c9acbcdf8fafe989f74a81ffc568cfc27184b36..fb6950b7d0deab3d21790065efa43b271e963fbf 100644
--- a/src/solaris/classes/sun/print/UnixPrintServiceLookup.java
+++ b/src/solaris/classes/sun/print/UnixPrintServiceLookup.java
@@ -620,7 +620,7 @@ public class UnixPrintServiceLookup extends PrintServiceLookup
if (CUPSPrinter.isCupsRunning()) {
try {
PrintService defaultPS;
- if (psuri != null) {
+ if ((psuri != null) && !psuri.startsWith("file")) {
defaultPS = new IPPPrintService(defaultPrinter,
psuri, true);
} else {
diff --git a/test/java/awt/Graphics2D/DrawString/TextRenderingTest.java b/test/java/awt/Graphics2D/DrawString/TextRenderingTest.java
new file mode 100644
index 0000000000000000000000000000000000000000..205cda9bc4789ffd6703f0d692094685cec31a4d
--- /dev/null
+++ b/test/java/awt/Graphics2D/DrawString/TextRenderingTest.java
@@ -0,0 +1,110 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.Color;
+import java.awt.Graphics2D;
+import java.awt.GraphicsConfiguration;
+import java.awt.GraphicsEnvironment;
+import java.awt.GradientPaint;
+import java.awt.geom.Point2D;
+
+import java.awt.Font;
+
+import java.awt.image.BufferedImage;
+import java.awt.image.VolatileImage;
+
+
+/*
+ * @test
+ * @bug 7189452 8024767
+ * @summary Check if source offset for text rendering is handled correctly
+ * (shouldn't see the text on a similarly colored background).
+ * @author a.stepanov
+ * @run main TextRenderingTest
+ */
+
+public class TextRenderingTest {
+
+ private static final int width = 450;
+ private static final int height = 150;
+
+ public static void main(final String[] args) {
+
+ GraphicsEnvironment ge =
+ GraphicsEnvironment.getLocalGraphicsEnvironment();
+ GraphicsConfiguration gc =
+ ge.getDefaultScreenDevice().getDefaultConfiguration();
+ VolatileImage vi = gc.createCompatibleVolatileImage(width, height);
+
+ while (true) {
+ vi.validate(gc);
+ Graphics2D g2d = vi.createGraphics();
+ g2d.setColor(Color.white);
+ g2d.fillRect(0, 0, width, height);
+
+ g2d.setPaint(new GradientPaint(
+ new Point2D.Float(0, height / 2), Color.white,
+ new Point2D.Float(width, height / 2), Color.black));
+ g2d.fillRect(0, 0, width, height);
+
+ String fnt = g2d.getFont().getFamily();
+ g2d.setFont(new Font(fnt, Font.PLAIN, 100));
+ g2d.drawString("IIIIIIIIII", 100, 100); // draw text with offset
+
+ g2d.dispose();
+
+ if (vi.validate(gc) != VolatileImage.IMAGE_OK) {
+ try {
+ Thread.sleep(100);
+ } catch (InterruptedException e) {}
+ continue;
+ }
+
+ if (vi.contentsLost()) {
+ try {
+ Thread.sleep(100);
+ } catch (InterruptedException e) {}
+ continue;
+ }
+
+ break;
+ }
+
+ BufferedImage bi = vi.getSnapshot();
+
+ // the text shifted shouldn't be visible onto a painted rectangle!
+ // so the check: color component (blue) must decrease monotonously
+
+ int prev = Integer.MAX_VALUE;
+ for (int x = 0; x < width; ++x) {
+ int color = bi.getRGB(x, height / 2);
+ int b = color & 0xFF;
+
+ if (b > prev) {
+ throw new RuntimeException("test failed: can see the text rendered!");
+ }
+
+ prev = b;
+ }
+ }
+}
diff --git a/test/java/awt/Graphics2D/DrawString/XRenderElt254TextTest.java b/test/java/awt/Graphics2D/DrawString/XRenderElt254TextTest.java
new file mode 100644
index 0000000000000000000000000000000000000000..33e834fb7521e163809c4039c7667b95fc8cd910
--- /dev/null
+++ b/test/java/awt/Graphics2D/DrawString/XRenderElt254TextTest.java
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.*;
+import java.awt.MultipleGradientPaint.*;
+import java.awt.image.*;
+import java.io.*;
+
+import javax.imageio.*;
+import javax.swing.*;
+
+/**
+ * @test
+ * @bug 8028722
+ * @summary tests wether drawString with 254 characters causes the xrender
+ * pipeline to hang.
+ * @author ceisserer
+ */
+public class XRenderElt254TextTest extends Frame implements Runnable {
+ public volatile boolean success = false;
+
+ public void run() {
+ Image dstImg = getGraphicsConfiguration().createCompatibleVolatileImage(400, 400);
+ Graphics2D g = (Graphics2D) dstImg.getGraphics();
+
+ StringBuilder strBuilder = new StringBuilder(254);
+ for (int c = 0; c < 254; c++) {
+ strBuilder.append('a');
+ }
+
+ for (int i = 0; i < 100; i++) {
+ g.drawString(strBuilder.toString(), 20, 20);
+ Toolkit.getDefaultToolkit().sync();
+ }
+ success = true;
+ }
+
+ public static void main(String[] args) throws Exception {
+ XRenderElt254TextTest test = new XRenderElt254TextTest();
+ new Thread(test).start();
+
+ for (int i = 0; i < 30; i++) {
+ Thread.sleep(1000);
+
+ if (test.success) {
+ return; // Test finished successful
+ }
+ }
+
+ throw new RuntimeException("Test Failed");
+ }
+}
diff --git a/test/java/awt/print/PageFormat/PageFormatFromAttributes.java b/test/java/awt/print/PageFormat/PageFormatFromAttributes.java
index de154c03923f69582bb387f785c660f0f301a31e..8b291388f9d51ccbd122035ee9837c0e1c6efae2 100644
--- a/test/java/awt/print/PageFormat/PageFormatFromAttributes.java
+++ b/test/java/awt/print/PageFormat/PageFormatFromAttributes.java
@@ -23,7 +23,7 @@
/*
* @test
- * @bug 4500750 6848799
+ * @bug 4500750 6848799 8028584
* @summary Tests creating page format from attributes
* @run main PageFormatFromAttributes
*/