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.
Logged In: YES
user_id=1050693
compiles fine with the latest Sun jdk1.5.0_04
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);
}
Logged In: YES
user_id=1050693
Both branches of CVS now compile under Jikes 1.22. This
patch is no longer needed.
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