Is it a Bug of JDK?

JSlider m_Slider = new JSlider();
m_Slider.setMajorTickSpacing( 10 );
m_Slider.setSnapToTicks( true );
when the system use windows lookandfeel,it works properly,but if the system use
MetalLookAndFeel, the last sentense doesn't work,I use jdk1.4.1
is it a bug? how can I get it work properly?

I have sympathy with the OP. It strikes me as
unreasonable that the compiler cannot detect this
obvious bad cast. I guess whoever wrote the compiler made a point about not trying to backtrack the latest write access to a variable to check a cast, just to see whether it is followed by a "new X" and to check whether X is legal for the cast. Unnecessary complication, especially considered that an assignment from another reference or even another cast blow that out of proportion, and totally leads to a dead end if it's the return value of some factory method or worse, Class.forName() call. The compiler will spend 3 seconds compiling and 5 minutes checking the casts.

Similar Messages

  • Bug with jdk update 40

    Hello, i have an urgent matter.
    I was working with earlier versions of JDK and javafx and it was ok.
    but with update 40 of JDK i have this bug generated :
    java.lang.UnsatisfiedLinkError:
    com.sun.prism.d3d.D3DContext.nSetBlendEnabled(JZZ)I
    at com.sun.prism.d3d.D3DContext.nSetBlendEnabled(Native Method)
    at com.sun.prism.d3d.D3DContext.initState(D3DContext.java:84)
    at com.sun.prism.d3d.D3DResourceFactory.<init>(D3DResourceFactory.java:57)
    at com.sun.prism.d3d.D3DPipeline.createResourceFactory(D3DPipeline.java:150)
    at com.sun.prism.d3d.D3DPipeline.getD3DResourceFactory(D3DPipeline.java:156)
    at com.sun.prism.d3d.D3DPipeline.findDefaultResourceFactory(D3DPipeline.java:182)
    at
    com.sun.prism.d3d.D3DPipeline.getDefaultResourceFactory(D3DPipeline.java:204)
    at
    com.sun.prism.GraphicsPipeline.getDefaultResourceFactory(GraphicsPipeline.java:97)
    at com.sun.javafx.tk.quantum.QuantumRenderer$3.run(QuantumRenderer.java:143)
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
    at java.util.concurrent.FutureTask.runAndReset(Unknown Source)
    at com.sun.prism.render.RenderJob.run(RenderJob.java:37)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at
    com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:98                                     
    I just want to add that i'm referecing javafx 2.2.7.
    Any help please.

    > I need a generic manner to reference this jar to be independant from the version of compilation and run version of jdk
    If you package your application using the JavaFX ant tasks or javafxpackager tool as detailed in the JavaFX deployment guide then it will be able to find the JavaFX runtime independent of the version of the jdk you are running on and you don't need to manually specify a machine specific classpath when trying to execute the jar.
    If you want to use Maven to package your JavaFX application, then refer to the StackOverflow question: java - Maven project with JavaFX (with jar file in `lib`) - Stack Overflow, which states that the preferred method of packaging using Maven is likely to use the JavaFX Maven Plugin.

  • Maybe there a bug in JDK 1.4 ?

    Hello , I use JBuilder 7 to design my application . When using the default JDK configuration(java 1.3.1-b24) ,my application runs well , but once turned to new JDK edition (java 1.4.0_01-b03),the application can not do any action but just quit ,and also there is not any message appeared . I do not know what is wrong ? Can anyone tell me how to resolve the problem ? Thanks.
    Liwei

    Test your application outside of JBuilder.

  • Bug in Jdk 1.4.1 TreeModelListener?

    Hi,
    I use a JTree with a DefaultTreeModel and want to react on inserting and removing DefaultMutableTreeNodes. Therefore I added a TreeModelListener, but it reacts only on "treeStructureChanged-Events".
    Could it be that is a Bug? Or do I have to make some additional implementation?

    My experience with Swing trees tells me that there is no bug.
    Denis Krukovsky
    http://dotuseful.sourceforge.net/

  • " JDK epoll bug" on Java 6

    Hi.
    We are using JDK6_u31, and we seem to experience the "JDK epoll bug" = Bug ID: JDK-6403933 (se) Selector doesn't block on Selector.select(timeout) (lnx)
    According to the bug report, this issue was only fixed for Java 7.
    Is there any fix/patch on this issue for Java 6?
    Thanks,
    Michal.

    We are using JDK6_u31, and we seem to experience the "JDK epoll bug" = Bug ID: JDK-6403933 (se) Selector doesn't block on Selector.select(timeout) (lnx)
    According to the bug report, this issue was only fixed for Java 7.
    Is there any fix/patch on this issue for Java 6?
    Contact Oracle support through your MOS account.
    Oracle often makes patches available for versions PRIOR to the version they were originally fixed for but only for customers with paid support.
    If you haven't purchased support you are out of luck. And if you have a support contract only Oracle can tell you if a patch for that bug is available. If it is they will provide you a link you can use to download the patched version.

  • Could I apply a bug fix as patch without updating JDK?

    Two questions:
    We have JDK6 U18 in production. I'm facing a known bug in JDK (http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6550655) which is fixed in 7(b142). I'm assuming that's JDK7 build 142.
    Q1: Could someone verify that's a correct assumption, please?
    I can NOT simply update JDK to that version (7b142) or latest for that matter; Policies and the fact that currently not all of our applications in production are fully covered with automated integration and unit tests and fully testing them manually with new JDK is not within our budget.
    Q2: Could I get that fix and its dependencies as patches from somewhere and update my JDK with them? Is there any other way than updating JDK as a whole?
    Thanks,
    Amir

    I think I found it..
    http://download.java.net/jdk7/changes/jdk7-b142.html
    and
    http://hg.openjdk.java.net/jdk7/jdk7/langtools/rev/dc3d9ef880a1
    So if I download JDK6_U18 source and apply the above changes myself and build the JDK again(!), it should work (considering dependency changes are applied, too). Question is how to build JDK?

  • BufferedImage creation slow in JDK 1.4.2

    Hi,
    The creation of BufferedImage of size 400x400 takes 156ms in JDK1.4.2. It used to take less than 10ms in JDK1.3.1.
    Image image = new BufferedImage(400, 400, BufferedImage.TYPE_INT_ARGB);
    In JDK1.4.2, for sizes 363x363 and above, it takes 156ms and
    for sizes under 363x363, it takes close to 0ms.
    Is this a bug in JDK 1.4.2? I noticed similar behavior in JDK1.5 also.
    My machine configuration:
    Windows XP, 512MB Ram, 1.7GHz
    Thanks,
    Bindu

    The arg type of the setter and the return type of the getter must match up or you'll get this exception.

  • Problems with Adler32 class in JDK 1.5 (not tried 1.6)

    When I use the java.util.zip.Adler32-class for generating Adler32-checksums, I found a couple of strange problems. When the total filesize (generating checksums of several files with the same checksum-object, using reset() in between) is 31999 bytes or greater, it gives pseudorandom output for the first file that exceeds the 31999 bytes. By running the test-program several times in a row, it seems like the output changes every second, as if random data was generated with the second counter as a seed. All the other checksums seem correct, and they do not change. A workaround that works for a series of only small files is to create a new Adler32-object for every file that needs its checksum generated, but that proves itself insufficient when a single file exceeds 31998 bytes of size (31999 or above).
    I've tried different inputstreams and various methods of using the update(xx)-functions of the Adler32, but I always get the same results. Is this a known bug (Note: JDK 1.5, not 1.6)? Or am I doing something obviously wrong? Example source code can be provided if necessary.

    R,
    I'm disappointed to see that you haven't received any replies to this. I am experiencing a very similar problem. What I have noticed is that the problem occurs when the combo-box is forced to be heavy-weight (meaning it has to draw itself outside the bounds of the window). In those cases, I can never pick a different value from the combo-box in the table. The exact same app run under 1.3.1 does not have any problems. Further, combo-boxes not in table views do not seem to have any problems even when they are heavy-weight.
    Paul

  • JRE 1.3.1 Bug May Screw Up Your Executable JAR File

    Hi;
    I just submitted this bug report to sun.
    It could save you a lot of pain.
    If you have both the JDK and a seperatley obtained Sun JRE on your computer you could build a deprecated code and not know it until you distribute your app to your user or remove jdk\bin from
    your class path.
    ======================================================================
    Bug Report: JDK 1.3.1 doesn't match JRE 1.3.1
    ======================================================================
    Hi;
    I discovered that the jre ( java.exe, javaw.exe ) that comes with the
    jdk 1.3.1 supports a deprecated option that the stand alone jre 1.3.1
    does not. Not all jre 1.3.1's of the same build are the same.
    In the jre that comes with jdk 1.3.1 you can execute code that uses
    "Cp850" for character encoding. In the stand alone jre 1.3.1 you
    cannot and get an exception thrown.
    This is a particularly insidious bug as many java programmers have
    both the jre that comes with the jdk and a stand alone version on
    their computers( for example, getting the java plugin for your browser).
    You can easily compile, run, and distribute java code that you think will
    work with the jre 1.3.1 only distribution....but will not.
    I figured this out ( after much pain ) after taking the c:\jdk\bin out
    of my path. The same code which execute with the jdk's jre, failed
    with the same version sun jre that I got as a separate distribution.
    Here is the chunk of code where I discovered this. I have put the
    block of code between "=======" lines. The code is further followed
    by more explanatory details:
    ================================================================
    public static void main(String argv[])
    String result = " ";
    // Read The Input File Into A String
    try
    FileInputStream file = new FileInputStream ("in.txt");
    DataInputStream in = new DataInputStream (file);
    byte[] b = new byte[ in.available() ];
    in.readFully (b);
    in.close ();
    //result = new String (b, 0, b.length, "US-ASCII");
    result = new String (b, 0, b.length, "Cp850");
    System.out.println(result);
    catch ( Exception e )
    e.printStackTrace();
    =================================================================
    I ran the command "java -version" on both jre 1.3.1 s just to make
    sure that each jre 1.3.1 was the same. The output of "java -version
    was identical:
    From:
    C:\Program Files\JavaSoft\JRE\1.3.1\bin\java.exe ( & javaw.exe )
    =========================================================
    java version "1.3.1"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1-b24)
    Java HotSpot(TM) Client VM (build 1.3.1-b24, mixed mode)
    From:
    C:\JDK\bin\java.exe ( & javaw.exe )
    =========================================================
    java version "1.3.1"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1-b24)
    Java HotSpot(TM) Client VM (build 1.3.1-b24, mixed mode)
    My apologies if this "bug" is really an illusion of my ignorance.

    Try making sure you have a 'i18n.jar' file in either the JDK or JRE's 'lib' directory (depending upon which one you're using).

  • MessageFormat with arguments not working in jdk 6

    I cant get the date to be formatted when using Jdk 6. Has something changed? Or am i using it in a non-standard way that gives this error.
    I have run this test in Jdk 1.5.0_10 and 1.6.0_02.
    And it fails in the 1.6.0_02.
    This is a JUnit 4 testcase.
    import java.text.MessageFormat;
    import java.util.Date;
    import java.util.Locale;
    import org.junit.Test;
    * This test the MessageFormat for usage.
    * A bug in jdk 1.6.0 seams to be the problem.
    * @author robert.alexandersson
    public class LanguageJDKVerificationTest {
         private static long time = 1000555500115L;
         @Test
         public void formatDate(){
              String formatString = "Date {0}";
              Date date = new Date();
              date.setTime(time);
              Object[] args = new Object[]{date};
              Locale locale = new Locale("sv_se");
              MessageFormat format = new MessageFormat(formatString, locale);       
             String formatted = format.format(args);                
             assertEquals(formatted, "Date 2001-09-15 14:05");
    }

    Hi there and thanx for answering.
    I researched a little more.
    The problem seams to be that the JDK 6 does not support sv_se as an input for langauge.
    BUT, the older JDK:s (1.4 or 5) did this.
    I would consider this as a backwards compatablility bug. They(SUN API:s) never said it would work with sv_se but it did anyway.
    It does however not seem to be the Locale that handles this different so its propably the DateFormat that is somehow different in its implementation.
    The sv_se is the "programmatic" version of the Locale, and this might be why it worked earlier on.

  • Focus Management Problems in JDK 1.4.0

    Hallo all,
    I have a severe problem in focus management. I inherited an applet designed in JDK 1.2.2 using focus events to generate calls in the correcponding server application. Now I'm trying to port this applet to JDK 1.4.0 for some good reasons such as character sets for eastern europe. But the focus management is complety changed and all attempts where stopped by bugs and workarounds for bugs in JDK 1.2.2 which are not valid in JDK 1.4.0.
    At the moment I'm searching a way to veto all focus events generated before "now" but accepting all generated after "now". Unfortunately no time stamps were supported for FocusEvents. By the way, "now" is the situation I find the server call while executing a focusLost on a component.
    Have anybody an idea how I can build a VetoableChangeListener blocking all FocusEvents generated before a special moment?
    Thanks for kinds of hints or answers!
    Werner

    The problem you are having is that jdev doesn't support the new beta..I have the same problem and I am currently compiling and executing from the command line
    I heard there is a workaround but I have never found it
    sorry

  • Running Weblogic Server 7.0 SP4 using JDK 1.4

    Is it possible to run Weblogic Server 7.0 SP4 with a different JRE than the one
    that ships with 7.0 SP4. I am having issues with a bug in JDK 1.3.1 which when
    I run under JBuilder X using 1.4 is not there. ANy help as to how I go about
    doing this would be welcomed.
    Thanks
    Justin

    Yes,
    The JDK is just the Sun JDK...nothing special. You may upgrade minor versions quite safely by dowloading later one at Sun website and pointting your "JAVA_HOME" at it.
    I would not jump to 1.4, as changes in java language may impact.

  • VM Crash with WLS 6.1 SP2 JDK 1.3.1 on NT/MSSQL

    Has anyone seen this? If we leave the system on for overnight, WLS crashes without
    further message. Our setting is 128M, of course it will get out of memory error
    if something is asking more than that. Question is:
    who is asking for 400 MB in one shot?
    P.S. We have internal scheduler threads wake up every 5 minutes to check tasks
    thru EJBs.
    Exception in thread "CompileThread0" java.lang.OutOfMemoryError: requested 402653192
    bytes
    goto finish
    cd config\informatica
    ENDLOCAL

    Thanks, you are right. It's a known bug in JDK 1.3.1 01 and it has been fixed in
    JDK 1.3.1 02.
    <[email protected]> wrote:
    That's the CompileThread asking for 402653192 bytes, so it's probably
    has
    nothing to do with application, WebLogic or 0x18000008. You can look
    at
    this bug:
    http://developer.java.sun.com/developer/bugParade/bugs/4484290.html
    or several other bugs very similar to this one.
    Cameron Purdy <[email protected]> wrote:
    FWIW - that's hex 0x18000008 ... I'd start by looking through yourcode for
    the string "18000" and then grep through the WL code for the ConstantPool
    equivalent in the .class files.
    Peace,
    Cameron Purdy
    Tangosol, Inc.
    Clustering Weblogic? You're either using Coherence, or you should be!
    Download a Tangosol Coherence eval today at http://www.tangosol.com/
    "Yicheng Tao" <[email protected]> wrote in message
    news:3cb48efe$[email protected]..
    Has anyone seen this? If we leave the system on for overnight, WLS
    crashes
    without
    further message. Our setting is 128M, of course it will get out of
    memory
    error
    if something is asking more than that. Question is:
    who is asking for 400 MB in one shot?
    P.S. We have internal scheduler threads wake up every 5 minutes to
    check
    tasks
    thru EJBs.
    Exception in thread "CompileThread0" java.lang.OutOfMemoryError: requested402653192
    bytes
    goto finish
    cd config\informatica
    ENDLOCAL
    Dimitri

  • ETA for JDK 1.4.2 update/patch release for tzdata2006a fix?

    I noticed that the bug 6378990 - compliance with tzdata2006a (http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6378990) got fixed in Mustang b72.
    Anyone aware of a fix for this bug in JDK 1.4.2? I would think that this bug needs to be addressed before April, 2006 for all non-EOLed JDK version?

    Yes, 1.4.2 and 5.0 will also contain this information in a later update release.
    Currently 1.4.2_11 has tzdata2005n
    and 5.0u6 contains tzdata2005m.
    Both these updates contain rules for the Australian daylight savings changes(2006)

  • BUG? 10.1.3 EA: Ant running in a separate process error.

    I'm trying to run Ant in a separate process and use different J2SE with it (JDK 1.4.1_03) and getting the error below. Seems to work ok with different JVM versions (tried 1.5 and 1.4.2). But we need to use JDK 1.4.1_03 to compile the project. Fails both for default Ant version and if I try to specify a different one. Is there any other way to make ANT to use specific JDK?
    Thanks,
    Noel.
    ===========================================================
    C:\jdk141_03\bin\javaw.exe -classpath C:\jdev10g13EA\jdev\lib\ojc.jar;C:\jdev10g13EA\j2ee\utilities\ant-oracle-classes.jar;C:\jdev10g13EA\webservices\lib\wsa.jar;C:\jdev10g13EA\jdev\lib\jdev.jar;C:\jdev10g13EA\apache-ant-1.6.5\lib\ant-antlr.jar;C:\jdev10g13EA\apache-ant-1.6.5\lib\ant-apache-bcel.jar;C:\jdev10g13EA\apache-ant-1.6.5\lib\ant-apache-bsf.jar;C:\jdev10g13EA\apache-ant-1.6.5\lib\ant-apache-log4j.jar;C:\jdev10g13EA\apache-ant-1.6.5\lib\ant-apache-oro.jar;C:\jdev10g13EA\apache-ant-1.6.5\lib\ant-apache-regexp.jar;C:\jdev10g13EA\apache-ant-1.6.5\lib\ant-apache-resolver.jar;C:\jdev10g13EA\apache-ant-1.6.5\lib\ant-commons-logging.jar;C:\jdev10g13EA\apache-ant-1.6.5\lib\ant-commons-net.jar;C:\jdev10g13EA\apache-ant-1.6.5\lib\ant-icontract.jar;C:\jdev10g13EA\apache-ant-1.6.5\lib\ant-jai.jar;C:\jdev10g13EA\apache-ant-1.6.5\lib\ant-javamail.jar;C:\jdev10g13EA\apache-ant-1.6.5\lib\ant-jdepend.jar;C:\jdev10g13EA\apache-ant-1.6.5\lib\ant-jmf.jar;C:\jdev10g13EA\apache-ant-1.6.5\lib\ant-jsch.jar;C:\jdev10g13EA\apache-ant-1.6.5\lib\ant-junit.jar;C:\jdev10g13EA\apache-ant-1.6.5\lib\ant-launcher.jar;C:\jdev10g13EA\apache-ant-1.6.5\lib\ant-netrexx.jar;C:\jdev10g13EA\apache-ant-1.6.5\lib\ant-nodeps.jar;C:\jdev10g13EA\apache-ant-1.6.5\lib\ant-starteam.jar;C:\jdev10g13EA\apache-ant-1.6.5\lib\ant-stylebook.jar;C:\jdev10g13EA\apache-ant-1.6.5\lib\ant-swing.jar;C:\jdev10g13EA\apache-ant-1.6.5\lib\ant-trax.jar;C:\jdev10g13EA\apache-ant-1.6.5\lib\ant-vaj.jar;C:\jdev10g13EA\apache-ant-1.6.5\lib\ant-weblogic.jar;C:\jdev10g13EA\apache-ant-1.6.5\lib\ant-xalan1.jar;C:\jdev10g13EA\apache-ant-1.6.5\lib\ant-xslp.jar;C:\jdev10g13EA\apache-ant-1.6.5\lib\ant.jar;C:\jdk141_03\lib\tools.jar -Djdev.ant.port=4358 -Dant.home=C:\jdev10g13EA\apache-ant-1.6.5 org.apache.tools.ant.Main -logger oracle.jdevimpl.ant.runner.OutOfProcessAntLogger -debug -inputhandler oracle.jdevimpl.ant.runner.OutOfProcessInputHandler -f C:\devbuild.xml clean
    Apache Ant version 1.6.5 compiled on June 2 2005
    Buildfile: C:\RCA_DEPOT\inovisworks\projects\iw-archive\core\hegemony\devbuild.xml
    java.lang.NullPointerException
         at java.net.Socket.<init>(Socket.java:283)
         at java.net.Socket.<init>(Socket.java:119)
         at oracle.jdevimpl.ant.runner.OutOfProcessIDEHook.connect(OutOfProcessIDEHook.java:43)
         at oracle.jdevimpl.ant.runner.OutOfProcessAntLogger.buildStarted(OutOfProcessAntLogger.java:45)
         at org.apache.tools.ant.Project.fireBuildStarted(Project.java:1831)
         at org.apache.tools.ant.Main.runBuild(Main.java:622)
         at org.apache.tools.ant.Main.startAnt(Main.java:187)
         at org.apache.tools.ant.Main.start(Main.java:150)
         at org.apache.tools.ant.Main.main(Main.java:240)

    I believe this is Sun bug 4712609. This was a bug in JDK 1.4.1, which was fixed in JDK 1.4.2 and later.
    The only workaround I can think of is to run JDeveloper itself in JDK 1.4.1_03. If you then run Ant in the same process as JDeveloper, it will be running in JDK 1.4.1_03.
    -Matt Hawkins
    Oracle JDeveloper

Maybe you are looking for