Menu

#1 FindDialog fixes for build with latest Jikes

closed
nobody
None
5
2005-07-22
2005-02-16
Ed Barker
No

Hello,

I was not able to build Wordcorr using Apache Ant 1.6.1
with Jikes 1.21 or with the Java SDK 1.4.2_07, due to
compile errors for FindDialog.java.

A friend of mine was able to fix the compile errors by
making minor modifications to FindDialog.java. Here was
her explanation:

FindListener couldn't access FindEvent here because the
latter was a non-static class:

/**
* Listener interface.
**/
public interface FindListener extends EventListener {
void find(FindEvent evt);
}

Fix: she made FindEvent static. Therefore it could not
use "this". So, we also modified the constructor to
accept an instance of FindDialog as an argument. Since
_findProperties is private, we added an accessor class
and called it to access the find properties:

public FindProperties getFindProperties() { return
_findProperties; }

Also modified: getOKAction()
This method was modified to provide the FindDialog
instance to the FindEvent constructor.

Note: My friend commented that she would rather not
have FindEvent as an inner class; some consider this
bad practice.

The reason this is a new problem: The previous version
of Jikes may not have inferred that interface
FindListener was static. Thus, they would build OK.
The newest Jikes compiler seems to be more strict.

Discussion

  • Nathan

    Nathan - 2005-07-21

    Logged In: YES
    user_id=1050693

    compiles fine with the latest Sun jdk1.5.0_04

     
  • Nathan

    Nathan - 2005-07-22

    Logged In: YES
    user_id=1050693

    There is a simpler fix.

    Simply change
    public interface FindListener extends EventListener {
    void find(FindEvent evt);
    }

    to

    public interface FindListener extends EventListener {
    void find(FindDialog.FindEvent evt);
    }

     
  • Nathan

    Nathan - 2005-07-22

    Logged In: YES
    user_id=1050693

    Both branches of CVS now compile under Jikes 1.22. This
    patch is no longer needed.

     
  • Ed Barker

    Ed Barker - 2005-07-22

    Logged In: YES
    user_id=1064110

    Nathan,
    Thanks for the follow-up on this. I can confirm that after
    making just the slight change to FindDialog.FindEvent
    instead of FindEvent, the build went smoothly using an Ant
    build from within Eclipse 3.0.1, with Jikes 1.22 as the
    compiler.
    Ed

     
  • Joseph E. Grimes

    • status: open --> closed
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.