Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4706866

REGRESSION: javac doesn't implement transitive rule for overriding

XMLWordPrintable

    • rc
    • generic, x86
    • solaris_8, windows_2000, windows_xp



        Name: rmT116609 Date: 06/24/2002


        FULL PRODUCT VERSION :
        java version "1.4.1-beta"
        Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1-beta-b14)
        Java HotSpot(TM) Client VM (build 1.4.1-beta-b14, mixed mode)

        FULL OPERATING SYSTEM VERSION :
        Microsoft Windows XP [Version 5.1.2600], Windows 2000

        A DESCRIPTION OF THE PROBLEM :
        I cannot compile a J2ME app that has a class that subclasses javax.microedition.lcdui.Canvas. I am using J2ME Wireless
          Toolkit version 1.0.4. The app compiles fine using J2SDK 1.4.0.

        When I try to compile the app, here's the compile error I get:

        MyTestClass.java:529: MyTestClass should be declared abstract; it does not define paint(javax.microedition.lcdui.Graphics) in javax.microedition.lcdui.Displayable

        The class DOES define this - again it compiles fine in J2SDK
        1.4.

        It appears as if the Displayable abstract class, which
        Canvas inherits from, defines paint() as package-level
        access, while Canvas defines this as protected. I'm not sure
        if that has anything to do with it.


        REGRESSION. Last worked in version 1.4

        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        Using J2SDK 1.4.1 beta and J2ME Wireless Toolkit 1.0.4, try
        to compile the following class using the given command line:



        import javax.microedition.lcdui.*;

        public class MyTestClass extends Canvas
        {
        protected void paint(Graphics g) {
        //NO-OP
        }
        }


        >javac -bootclasspath C:\WTK104\lib\midpapi.zip MyTestClass.java


        The following error should occur:

        MyTestClass.java:3: MyTestClass should be declared abstract;
        it does not define
        paint(javax.microedition.lcdui.Graphics) in
        javax.microedition.lcdui.Displayable

        public class MyTestClass extends Canvas




        EXPECTED VERSUS ACTUAL BEHAVIOR :
        The expected result is that this compiles fine. It could be
        a problem with the Wireless Toolkit library not being
        compatible w/ J2SDK 1.4.1 beta.

        ERROR MESSAGES/STACK TRACES THAT OCCUR :
        MyTestClass.java:3: MyTestClass should be declared abstract; it does not define
        paint(javax.microedition.lcdui.Graphics) in javax.microedition.lcdui.Displayable

        public class MyTestClass extends Canvas




        REPRODUCIBILITY :
        This bug can be reproduced always.

        ---------- BEGIN SOURCE ----------
        import javax.microedition.lcdui.*;

        public class MyTestClass extends Canvas
        {
        protected void paint(Graphics g) {
        //NO-OP
        }
        }


        >javac -bootclasspath C:\WTK104\lib\midpapi.zip MyTestClass.java

        ---------- END SOURCE ----------

        CUSTOMER WORKAROUND :
        Haven't found one yet. Revert back to 1.4.0 I guess.

        Release Regression From : 1.4.0_01
        The above release value was the last known release where this
        bug was known to work. Since then there has been a regression.

        (Review ID: 158332)
        ======================================================================

              gafter Neal Gafter (Inactive)
              rmandalasunw Ranjith Mandala (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: