JDK-6573289 : api/java_awt/Color/index.html#CreateContextTesttestCase4,5,6,7 fail since JDK 7 b14
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 7
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2007-06-25
  • Updated: 2017-05-16
  • Resolved: 2011-05-18
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7
7 b27Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Description
JCK            : JCK-runtime-6a b14
J2SE           : FAIL - jdk 7 b14, PASS jdk6u2 b05 JDK 7 b13
Platform[s]    : FAIL - seems to be all
switch/Mode    : FAIL - default

Tests 
api/java_awt/Color/index.html#CreateContextTesttestCase4[testCase4]
api/java_awt/Color/index.html#CreateContextTesttestCase5[testCase5]
api/java_awt/Color/index.html#CreateContextTesttestCase6[testCase6]
api/java_awt/Color/index.html#CreateContextTesttestCase7[testCase7]

fail since jdk 7 b14. Tests verify statement
"The same PaintContext is returned, regardless of whether or not r, r2d, xform, or hints are null." of java.awt.Color.createContext method.
Unfortunately, since b14 it returns different context.

Comments
SUGGESTED FIX http://ccc/6573289
23-10-2007

EVALUATION The PaintContext class does not define a contract for the equals method so the default contract of the equals method on a class implementing that interface is the same contract as Object.equals(). Unfortunately, the createContext method on Color specifies that the same Context is returned for each call to it. This statement is unnecessary and requires caching the return value to maintain that contract which is a performance hit. The same sentence also mentions that the return value does not depend on various parameters being null or non-null and that part continues to be true, that part of the sentence should probably remain, though it should be considered whether or not the Paint interface requires such conditions to be specified or not. This doc statement should have been modified from the API description when the code to cache the context was removed during the fix of 6530420. I am reassigning to AWT and the engineer responsible for that fix to complete the appropriate modified Change Requests to modify the documentation as per the fix of that bug.
26-06-2007