This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug java/12217] New: extra qualification required if multiple .java basenames on command line


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12217

           Summary: extra qualification required if multiple .java basenames
                    on command line
           Product: gcc
           Version: 3.3.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: java
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: bart at sabl dot com
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu

so far i have been unable to condense the problem into a small example. here's
the gist, though. if you have the following 3 files:

j/a/X.java:
package a;
public interface X {
}
j/b/Y.java:
package b;
import c.X;
public class Y extends X { // will require explicit c.X ref
}
j/c/X.java:
package c;
public class X {
}

and then compile them into .class files with

gcj -C -d class -classpath class:j `find j -name '*.java'`

the behavior is that X in "extends X" in j/b/Y.java is taken as a.X rather than
the explicitly imported c.X.

the given example does NOT reproduce this bug, unfortunately. i don't know if
this is because i am characterizing the problem wrong or if it's a problem of scale.

i ran across it trying to compile the xalan package in rhug
(http://sources.redhat.com/rhug) using a makefile that compiles all the .java
files in each package at once.

at this point i don't know a way of reproducing this short of pulling the rhug
tree from cvs and using the following makefile instead:

F=--encoding=8859_1

all: xalan.o

regexp.o:       jakarta-regexp/upstream/src
        gcj -C $F -d class -classpath class:$< `alljava $<`
        gcj -c -o $@ $F -classpath class:$< `alljava $<`

xerces.o:       xerces/upstream/src regexp.o
        gcj -C $F -d class -classpath class:$< `alljava $<`
        gcj -c -o $@ $F -classpath class:$< `alljava $<`

cup.o:  cup/upstream
        gcj -C $F -d class -classpath class:$< `alljava $<`
        gcj -c -o $@ $F -classpath class:$< `alljava $<`

bcel.o: BCEL/upstream/src/java regexp.o
        gcj -C $F -d class -classpath class:$< `alljava $< | grep -v verifier`
        gcj -c -o $@ $F -classpath class:$< `alljava $< | grep -v verifier`

xalan.o:        xalan/upstream/src regexp.o xerces.o bcel.o cup.o
        gcj -C $F -d class -classpath class:$< `alljava $<`
        gcj -c -o $@ $F -classpath class:$< `alljava $<`

clean:
        rm -rf *.o class/*

where alljava is defined as:

#!/bin/sh
find ${1:-.} -name '*.java' | sed 's;^\./;;'

the first error you will get from this looks valid - a class that should be
declared public but isn't - but every one from that point on is this
qualification thing.

here is the list of cvs diffs that successfully work around this issue:

Index: org/apache/xalan/xsltc/compiler/Expression.java
===================================================================
RCS file:
/cvs/rhug/rhug/xalan/upstream/src/org/apache/xalan/xsltc/compiler/Expression.java,v
retrieving revision 1.2
diff -r1.2 Expression.java
76c76
< abstract class Expression extends SyntaxTreeNode {
---
> abstract public class Expression extends SyntaxTreeNode {
Index: org/apache/xpath/axes/PredicatedNodeTest.java
===================================================================
RCS file:
/cvs/rhug/rhug/xalan/upstream/src/org/apache/xpath/axes/PredicatedNodeTest.java,v
retrieving revision 1.2
diff -r1.2 PredicatedNodeTest.java
19c19
< public abstract class PredicatedNodeTest extends NodeTest implements
SubContextList
---
> public abstract class PredicatedNodeTest extends
org.apache.xpath.patterns.NodeTest implements SubContextList
Index: org/apache/xpath/objects/XObject.java
===================================================================
RCS file: /cvs/rhug/rhug/xalan/upstream/src/org/apache/xpath/objects/XObject.java,v
retrieving revision 1.2
diff -r1.2 XObject.java
85c85
< public class XObject extends Expression implements Serializable, Cloneable
---
> public class XObject extends org.apache.xpath.Expression implements
Serializable, Cloneable
Index: org/apache/xpath/operations/Operation.java
===================================================================
RCS file:
/cvs/rhug/rhug/xalan/upstream/src/org/apache/xpath/operations/Operation.java,v
retrieving revision 1.2
diff -r1.2 Operation.java
71c71
< public class Operation extends Expression implements ExpressionOwner
---
> public class Operation extends org.apache.xpath.Expression implements
ExpressionOwner
Index: org/apache/xpath/operations/UnaryOperation.java
===================================================================
RCS file:
/cvs/rhug/rhug/xalan/upstream/src/org/apache/xpath/operations/UnaryOperation.java,v
retrieving revision 1.2
diff -r1.2 UnaryOperation.java
71c71
< public abstract class UnaryOperation extends Expression implements ExpressionOwner
---
> public abstract class UnaryOperation extends org.apache.xpath.Expression
implements ExpressionOwner
Index: org/apache/xpath/operations/Variable.java
===================================================================
RCS file:
/cvs/rhug/rhug/xalan/upstream/src/org/apache/xpath/operations/Variable.java,v
retrieving revision 1.2
diff -r1.2 Variable.java
86c86
< public class Variable extends Expression implements PathComponent
---
> public class Variable extends org.apache.xpath.Expression implements PathComponent


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]