ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul Philion" <phil...@acmerocket.com>
Subject [PATCH] Problem with the new JavaDoc stuff and Jikes
Date Wed, 30 Aug 2000 17:00:48 GMT
Greetings...

I just grabbed the new JavaDoc changes from CVS and found problems
when using Jikes (version 1.12) to compiler the javadoc task.

The problem arises from the used of the "dir" parameter to the accept
method in the anonymous FileFilter on line 893 of Javadoc.java. I'm
not sure what the spec is (I typically use the behavior of javac), but
javac is okay and jikes is not.

Jikes complains that "dir" is defined a second time (in the definition
of the method). It looks like jikes does not like overriding a local
variable with a parameter to a method in an anonymous inner class. By
simply changing the name of the second "dir" (to "dir1"), both jikes
and javac compile and seem to run fine.

I don't know if this is a problem with jikes or javac. Does anyone
understand the inner class spec well enough to say? I suspect that it
is a problem with jikes, but I don't want to submit a bug (or see if
one has already been submitted) until I know.

In any case, I think we should simply change the name of the parameter
and not worry about it. Here's a patch:

Index: src/main/org/apache/tools/ant/taskdefs/Javadoc.java
===================================================================
RCS file:
/home/cvspublic/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Jav
adoc.java,v
retrieving revision 1.27
diff -u -r1.27 Javadoc.java
--- src/main/org/apache/tools/ant/taskdefs/Javadoc.java 2000/08/30
14:34:531.27
+++ src/main/org/apache/tools/ant/taskdefs/Javadoc.java 2000/08/30
16:59:06
@@ -890,12 +890,12 @@
        }

        String[] files = dir.list(new FilenameFilter () {
-                       public boolean accept(File dir, String name) {
+                       public boolean accept(File dir1, String name)
{
                                if (name.endsWith(".java")) {
                                        foundJavaFile = true;
                                        return false;
                                }
-                               File d = new File(dir, name);
+                               File d = new File(dir1, name);
                                if (d.isDirectory()) {
                                        return true;
                                }
===================================================================


Mime
View raw message