Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Class is not abstract and does not override abstract method...

807580Apr 27 2010 — edited Apr 27 2010
I'm getting this mysterious error that my concrete class is not overriding an abstract method when it is. Here is the exact error:
Exception in thread "main" java.lang.ExceptionInInitializerError
        at drawright1.dialogTextStyle.updateDemo(dialogTextStyle.java:78)
        at drawright1.dialogTextStyle.<init>(dialogTextStyle.java:661)
        at drawright1.gui.<init>(gui.java:130)
        at drawright1.gui.getTheGui(gui.java:175)
        at drawright1.Main.main(Main.java:23)
Caused by: java.lang.RuntimeException: Uncompilable source code - drawright1.graphicText is not abstract and does not override abstract method getShape() in drawright1.graphicOpen
        at drawright1.graphicObject.<clinit>(graphicObject.java:24)
        ... 5 more
Here is the relevant portion of the abstract class
public abstract class graphicOpen
        extends graphicObject
        implements Cloneable, Serializable
{
   ...

   /**
     * Get a path outlining the shape of the graphic
     * @return the shape.
     */
    public abstract GeneralPath getShape();

    ...
}
And the concrete class (note that graphicClosed is an abstract class that extends graphicOpen)
public class graphicText
        extends graphicClosed
{
    ...
    
    /**
     * Get a path outlining the shape of the graphic
     * @return the shape.
     */
    @Override
    public GeneralPath getShape()
    {
        Shape s = getATextLayout().getOutline(null);
        GeneralPath gp = new GeneralPath();
        gp.append(s.getPathIterator(null), false);
        return gp;
    }

    ...
}
This error shows up when I attempt to run in netbeans, but I can clean and rebuild with no error messages. I can run the resulting jar file. Any ideas what could be going wrong?

Thanks!
James


P.S. I have cut down graphicText as far as possible and still get the error, but don't have enough space here to include it. Is there a way to attach files?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 25 2010
Added on Apr 27 2010
3 comments
2,763 views