public inbox for java-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug java/15377] New: GCJ does not use the good package for imported classes
@ 2004-05-11 15:40 nmoyere at calendra dot com
  2004-05-11 15:42 ` [Bug java/15377] " nmoyere at calendra dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: nmoyere at calendra dot com @ 2004-05-11 15:40 UTC (permalink / raw)
  To: java-prs

I use GCJ to compile .java files to .class files.
On the command line, I use the @<java source files list> option to make gcj
compile several classes at a time.
gcj seems to have a bug in the way it resolves the complete class name of an
imported class, and so throws compile errors for valid code.

In my example, I have several classes called AbstractAction. One comming from
javax.swing and another one I have written.
The class MoveUpMultipleDataAction extends the javax.swing.AbstractAction and in
its source file, I use a "import javax.swing.*" instead of writing a complete
class name.
When I compile MoveUpMultipleDataAction with gcj (and the @<file> option), gcj
throws a compile error: for gcj MoveUpMultipleDataAction extends my
AbstractAction class instead of the javax.swing one.
If I remove the first class in the file that contains the java source files to
compile, gcj works fine (even if the removed class has nothing to do the classes
causing the compilation error)
You will find all the sources in the attached file. I tryed to make the example
as small as possible but the bug is difficult to reproduce at a very small scale.

The example uses the following command line:
gcj -d classes -classpath <jakarta ant lib>/ant.jar -g1 -C @javafiles

-- 
           Summary: GCJ does not use the good package for imported classes
           Product: gcc
           Version: 3.3.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: java
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: nmoyere at calendra dot com
                CC: gcc-bugs at gcc dot gnu dot org,java-prs at gcc dot gnu
                    dot org
 GCC build triplet: 3.3.2
  GCC host triplet: i686-pc-linux-gnu


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


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

* [Bug java/15377] GCJ does not use the good package for imported classes
  2004-05-11 15:40 [Bug java/15377] New: GCJ does not use the good package for imported classes nmoyere at calendra dot com
@ 2004-05-11 15:42 ` nmoyere at calendra dot com
  2004-05-11 15:48 ` pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: nmoyere at calendra dot com @ 2004-05-11 15:42 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From nmoyere at calendra dot com  2004-05-11 15:42 -------
Created an attachment (id=6259)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=6259&action=view)
An example to reproduce the compile error


-- 


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


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

* [Bug java/15377] GCJ does not use the good package for imported classes
  2004-05-11 15:40 [Bug java/15377] New: GCJ does not use the good package for imported classes nmoyere at calendra dot com
  2004-05-11 15:42 ` [Bug java/15377] " nmoyere at calendra dot com
@ 2004-05-11 15:48 ` pinskia at gcc dot gnu dot org
  2004-05-11 15:57 ` nmoyere at calendra dot com
  2005-03-29 14:12 ` phil at mkdoc dot com
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-05-11 15:48 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-05-11 15:47 -------
Can you try 3.4.0 as it has improved gcj support and this problme might be fixed there.  Otherwise can 
you provide with the full instructions on how to reproduce it as I could not figure it out with the 
directions you gave?

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING


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


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

* [Bug java/15377] GCJ does not use the good package for imported classes
  2004-05-11 15:40 [Bug java/15377] New: GCJ does not use the good package for imported classes nmoyere at calendra dot com
  2004-05-11 15:42 ` [Bug java/15377] " nmoyere at calendra dot com
  2004-05-11 15:48 ` pinskia at gcc dot gnu dot org
@ 2004-05-11 15:57 ` nmoyere at calendra dot com
  2005-03-29 14:12 ` phil at mkdoc dot com
  3 siblings, 0 replies; 5+ messages in thread
From: nmoyere at calendra dot com @ 2004-05-11 15:57 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From nmoyere at calendra dot com  2004-05-11 15:57 -------
I have done the same test with gcc 3.4.0 under windows XP.

To reproduce the bug with the example,
1) unzip test.tgz somewhere
2) get the jakarta ant (at least version 1.4) from Apache Jakarta.
3) if you are under unix, start the compil.sh from the "test" directory
   if you are under windows, start a dos prompt and cd to the "test" directory
and launch
   gcj -d classes -classpath <jakarta ant lib>/ant.jar -g1 -C @javafiles

gcj will display:
/home/builder/CDMIndus/test/com/calendra/swing/components/multipledata/action/MoveUpMultipleDataAction.java:9:
error: Class `com.ca
endra.swing.components.multipledata.action.MoveUpMultipleDataAction' doesn't
define the abstract method `java.lang.String com.calen
ra.logs.AbstractAction.getActionName()' from class
`com.calendra.logs.AbstractAction'. This method must be defined or class `com.ca
endra.swing.components.multipledata.action.MoveUpMultipleDataAction' must be
declared abstract.
   public class MoveUpMultipleDataAction extends AbstractMultipleDataAction {
                                                                             ^
1 error


If you try to remove the first line of the "javafiles" file and start again gcj,
the compilation will succeed.


-- 


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


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

* [Bug java/15377] GCJ does not use the good package for imported classes
  2004-05-11 15:40 [Bug java/15377] New: GCJ does not use the good package for imported classes nmoyere at calendra dot com
                   ` (2 preceding siblings ...)
  2004-05-11 15:57 ` nmoyere at calendra dot com
@ 2005-03-29 14:12 ` phil at mkdoc dot com
  3 siblings, 0 replies; 5+ messages in thread
From: phil at mkdoc dot com @ 2005-03-29 14:12 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From phil at mkdoc dot com  2005-03-29 11:53 -------
I have seen similar behaviour to this where concrete classes are named after 
their interfaces. I haven't been able to to produce a simple test case. This bug 
looks very similar to bug 18796.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |phil at mkdoc dot com


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


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

end of thread, other threads:[~2005-03-29 11:53 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-05-11 15:40 [Bug java/15377] New: GCJ does not use the good package for imported classes nmoyere at calendra dot com
2004-05-11 15:42 ` [Bug java/15377] " nmoyere at calendra dot com
2004-05-11 15:48 ` pinskia at gcc dot gnu dot org
2004-05-11 15:57 ` nmoyere at calendra dot com
2005-03-29 14:12 ` phil at mkdoc 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).