United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-8000293 REGRESSION : There is no way to get Icon inf, once Softreference is released
JDK-8000293 : REGRESSION : There is no way to get Icon inf, once Softreference is released

Details
Type:
Backport
Submit Date:
2012-10-01
Status:
Closed
Updated Date:
2012-11-19
Project Name:
JDK
Resolved Date:
2012-10-02
Component:
client-libs
OS:
Sub-Component:
java.beans
CPU:
Priority:
P2
Resolution:
Fixed
Affected Versions:
6u33
Fixed Versions:
7u10 (b12)

Related Reports
Backport:

Sub Tasks

Description
In recent JDK6ux( jdk6u21 and later), Icon can not be gotten by getIcon.

CONFIGURATION :
JDK : 6u21 and later/JDK7u5/JDK8(b53) (sparcV9)
OS : Solaris10

REPRODUCE:
1. Compile the test case attached below.
2. Run "java -XX:SoftRefLRUPolicyMSPerMB=0 b"

EXPECTED :

BufferedImage@116471f: type = 1 DirectColorModel: rmask=ff0000 gmask=ff00 bmask=ff amask=0 IntegerInterleavedRaster: width = 16 height = 16 #Bands = 3 xOff = 0yOff = 0 dataOffset[0] 0
BufferedImage@1f14ceb: type = 1 DirectColorModel: rmask=ff0000 gmask=ff00 bmask=ff amask=0 IntegerInterleavedRaster: width = 16 height = 16 #Bands = 3 xOff = 0yOff = 0 dataOffset[0] 0

ACTUAL : (2nd icon inf. cahnges "null")

BufferedImage@34a1fc: type = 1 DirectColorModel: rmask=ff0000 gmask=ff00 bmask=ff amask=0 IntegerInterleavedRaster: width = 16 height = 16 #Bands = 3 xOff = 0 yOff = 0 dataOffset[0] 0
null

TESTCASE:
==============================================================
import java.beans.*;
import java.awt.*;
import java.awt.image.*;

class b
{
  public static void main(String[] arg) throws Exception
  {
    BeanInfo info = Introspector.getBeanInfo(X.class);
    Image im = info.getIcon(BeanInfo.ICON_COLOR_16x16);
    System.out.println(im);
    System.gc();
    im = info.getIcon(BeanInfo.ICON_COLOR_16x16);
    System.out.println(im);
  }
  public static class X  {  }
  public static class XBeanInfo extends SimpleBeanInfo  {
    public XBeanInfo(){}
    public Image getIcon(int type)    {
      return new BufferedImage(16, 16, BufferedImage.TYPE_INT_RGB);
    }
  }
}
==============================================================


Please see comment section for more detils

                                    

Comments



Hardware and Software, Engineered to Work Together