mirror of
https://github.com/openjdk/jdk.git
synced 2026-02-18 14:25:33 +00:00
Merge
This commit is contained in:
commit
6df5f2e72d
@ -614,14 +614,15 @@ public final class AlphaComposite implements Composite {
|
||||
}
|
||||
|
||||
private AlphaComposite(int rule, float alpha) {
|
||||
if (alpha < 0.0f || alpha > 1.0f) {
|
||||
throw new IllegalArgumentException("alpha value out of range");
|
||||
}
|
||||
if (rule < MIN_RULE || rule > MAX_RULE) {
|
||||
throw new IllegalArgumentException("unknown composite rule");
|
||||
}
|
||||
this.rule = rule;
|
||||
this.extraAlpha = alpha;
|
||||
if (alpha >= 0.0f && alpha <= 1.0f) {
|
||||
this.rule = rule;
|
||||
this.extraAlpha = alpha;
|
||||
} else {
|
||||
throw new IllegalArgumentException("alpha value out of range");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -3058,7 +3058,7 @@ public abstract class SunFontManager implements FontSupport, FontManagerForSGE {
|
||||
return;
|
||||
}
|
||||
/* Use lock specific to the font system */
|
||||
synchronized (lucidaFontName) {
|
||||
synchronized (this) {
|
||||
if (FontUtilities.debugFonts()) {
|
||||
Thread.dumpStack();
|
||||
FontUtilities.getLogger()
|
||||
@ -3194,7 +3194,7 @@ public abstract class SunFontManager implements FontSupport, FontManagerForSGE {
|
||||
return;
|
||||
}
|
||||
/* Use lock specific to the font system */
|
||||
synchronized (lucidaFontName) {
|
||||
synchronized (this) {
|
||||
if (FontUtilities.debugFonts()) {
|
||||
Thread.dumpStack();
|
||||
FontUtilities.getLogger().info("loadAllFontFiles() called");
|
||||
|
||||
@ -0,0 +1,22 @@
|
||||
/*
|
||||
* @test
|
||||
* @bug 6918065
|
||||
* @summary Test for passing NaN as alpha
|
||||
* should throw IllegalArgumentException
|
||||
*/
|
||||
|
||||
import java.awt.*;
|
||||
|
||||
public class TestAlphaCompositeForNaN {
|
||||
public static void main(String[] args) {
|
||||
try {
|
||||
AlphaComposite a = AlphaComposite.getInstance(AlphaComposite.DST, Float.NaN);
|
||||
System.out.println("Failed");
|
||||
throw new RuntimeException(a + " failed to throw IllegalArgumentException for alpha = " + Float.NaN);
|
||||
}
|
||||
catch (IllegalArgumentException ie) {
|
||||
System.out.println("Passed");
|
||||
System.out.println("Caught " + ie);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user