public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug java/12217] New: extra qualification required if multiple .java basenames on command line
@ 2003-09-08 21:01 bart at sabl dot com
  2003-09-08 21:26 ` [Bug java/12217] " bart at sabl dot com
  0 siblings, 1 reply; 2+ messages in thread
From: bart at sabl dot com @ 2003-09-08 21:01 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug java/12217] extra qualification required if multiple .java basenames on command line
  2003-09-08 21:01 [Bug java/12217] New: extra qualification required if multiple .java basenames on command line bart at sabl dot com
@ 2003-09-08 21:26 ` bart at sabl dot com
  0 siblings, 0 replies; 2+ messages in thread
From: bart at sabl dot com @ 2003-09-08 21:26 UTC (permalink / raw)
  To: gcc-bugs

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



------- Additional Comments From bart at sabl dot com  2003-09-08 21:26 -------
update on bug report: the first reported xalan source file change is unnecessary
and is instead an artifact of the reported bug. qualifying the use of Expression
in xalan/upstream/src/org/apache/xpath/objects/XObject.java to
org.apache.xpath.Expression makes this seemingly unrelated bug go away.

so ignore this diff:

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

the problem of extra qualifications being required is still there.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-09-08 21:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-09-08 21:01 [Bug java/12217] New: extra qualification required if multiple .java basenames on command line bart at sabl dot com
2003-09-08 21:26 ` [Bug java/12217] " bart at sabl dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).