java/1360: incorrect error message "Source file for class `dummy' ..."
osk@hem.passagen.se
osk@hem.passagen.se
Wed Dec 20 12:25:00 GMT 2000
>Number: 1360
>Category: java
>Synopsis: incorrect error message "Source file for class `dummy' ..."
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: apbianco
>State: feedback
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Wed Dec 20 12:19:18 PST 2000
>Closed-Date:
>Last-Modified: Sat Nov 25 01:30:00 PST 2000
>Originator: Oskar Liljeblad
>Release: unknown-1.0
>Organization:
>Environment:
2.96 20000814
>Description:
Executing the script below gives this output
dummy/ClassB.java:2: warning: Source file for class `dummy' is newer than its matching class file. Source file used instead
when it should really say "Source file for class `dummy.ClassA' is ...".
Oskar Liljeblad (osk@hem.passagen.se)
>How-To-Repeat:
mkdir dummy
echo >dummy/ClassA.java "package dummy; class ClassA {}"
echo >dummy/ClassB.java "package dummy; class ClassB { ClassB(ClassA t) {} }"
gcj -C dummy/ClassA.java
touch dummy/ClassA.java
gcj -C dummy/ClassB.java
>Fix:
I didn't make a fix but the problem is in
gcc/java/jcf-io.c near line 370.
>Release-Note:
The patch was ill-formed. I'm correcting that for the records.
>Audit-Trail:
Formerly PR gcj/333
State-Changed-From-To: open->feedback
State-Changed-By: apbianco
State-Changed-When: Thu Nov 2 22:36:46 2000
State-Changed-Why:
Thank you. Here's a patch.
From: apbianco@cygnus.com
To: apbianco@cygnus.com, java-gnats@sourceware.cygnus.com, osk@hem.passagen.se
Cc:
Subject: Re: gcj/333
Date: 3 Nov 2000 06:36:46 -0000
Synopsis: incorrect error message "Source file for class `dummy' ..."
State-Changed-From-To: open->feedback
State-Changed-By: apbianco
State-Changed-When: Thu Nov 2 22:36:46 2000
State-Changed-Why:
Thank you. Here's a patch.
http://sources.redhat.com/cgi-bin/gnatsweb.pl?cmd=view&pr=333&database=java
From: Oskar Liljeblad <osk@hem.passagen.se>
To: apbianco@cygnus.com
Cc: java-gnats@sourceware.cygnus.com
Subject: Re: gcj/333
Date: Thu, 23 Nov 2000 21:30:26 +0100
On Friday, November 03, 2000 at 06:46, apbianco@cygnus.com wrote:
> Synopsis: incorrect error message "Source file for class `dummy' ..."
>
> State-Changed-From-To: open->feedback
> State-Changed-By: apbianco
> State-Changed-When: Thu Nov 2 22:36:46 2000
> State-Changed-Why:
> Thank you. Here's a patch.
I have tried the patch and it works fine. However, it still prints
warning: Source file `X.java' for class `Y' is newer than its
matching class file. Source file used instead
even when the file X.class does not exist. IMHO this is confusing,
not only because the message is slightly wrong, but also because SUN
javac/jikes doesn't print a message at all in this case.
Oskar Liljeblad (osk@hem.passagen.se)
From: Alexandre Petit-Bianco <apbianco@cygnus.com>
To: Oskar Liljeblad <osk@hem.passagen.se>
Cc: java-gnats@sourceware.cygnus.com
Subject: Re: gcj/333
Date: Fri, 24 Nov 2000 13:35:41 -0800 (PST)
Oskar Liljeblad writes:
> I have tried the patch and it works fine. However, it still prints
>
> warning: Source file `X.java' for class `Y' is newer than its
> matching class file. Source file used instead
>
> even when the file X.class does not exist. IMHO this is confusing,
> not only because the message is slightly wrong, but also because SUN
> javac/jikes doesn't print a message at all in this case.
I don't understand/can't reproduce what you're describing. If I refer
to your original testcase, I witness the following behavior:
$ gcj -C dummy/ClassA.java
$ touch dummy/ClassA.java
$ gcj -C dummy/ClassB.java
dummy/ClassB.java:2: warning: Source file `./dummy/ClassA.java' for
class `dummy.ClassA' is newer than its matching class file. Source
file used instead
$ rm dummy/ClassA.class
$ gcj -C dummy/ClassB.java
Am I missing something? I'd love to see a test case.
On a side note, I just realized that my patch was ill-formed and
wouldn't apply properly. I'm replacing the existing patch.
./A
From: Oskar Liljeblad <osk@hem.passagen.se>
To: Alexandre Petit-Bianco <apbianco@cygnus.com>
Cc: java-gnats@sourceware.cygnus.com
Subject: Re: gcj/333
Date: Sat, 25 Nov 2000 10:56:21 +0100
On Friday, November 24, 2000 at 13:41, Alexandre Petit-Bianco wrote:
> > I have tried the patch and it works fine. However, it still prints
> >
> > warning: Source file `X.java' for class `Y' is newer than its
> > matching class file. Source file used instead
> >
> > even when the file X.class does not exist. [..]
>
> I don't understand/can't reproduce what you're describing. If I refer
> to your original testcase, I witness the following behavior:
You are correct, that script doesn't trigger the behavior. Here is a
better one:
mkdir dummy
echo >dummy/ClassA.java "package dummy; class ClassA {}"
echo >dummy/ClassB.java "package dummy; class ClassB { ClassB(ClassA t) {} }"
gcj -C dummy/*.java
touch dummy/*.java
Now, every time you run
gcj -c dummy/Class{A,B}.java
or
gcj -c dummy/Class{B,A}.java
the following will be printed:
dummy/ClassB.java:7: warning: Source file for class `dummy.ClassA' is
newer than its matching class file. Source file used instead
So actually this is a different PR... But maybe it is not a bug at all.
It is confusing though - I was compiling from .java->.o and had some
old .class files lying around, and I kept getting those error
messages.
Oskar Liljeblad (osk@hem.passagen.se)
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="patch"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="patch"
MjAwMC0xMS0wMiAgQWxleGFuZHJlIFBldGl0LUJpYW5jbyAgPGFwYmlhbmNvQGN5Z251cy5jb20+
CgogICAgICAgICogamNmLWlvLmMgKGZpbmRfY2xhc3MpOiBGaXhlZCBpc3N1aW5nIHRoZSBjbGFz
cyBuYW1lIHdpdGggdGhlCiAgICAgICAgdGltZSBkaXNjcmVwYW5jaWVzIGRldGVjdGlvbiwgYWRk
ZWQgZmlsZW5hbWUgdG9vLgoKSW5kZXg6IGpjZi1pby5jCj09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KUkNTIGZpbGU6IC9j
dnMvZ2NjL2VnY3MvZ2NjL2phdmEvamNmLWlvLmMsdgpyZXRyaWV2aW5nIHJldmlzaW9uIDEuMjYK
ZGlmZiAtdSAtcCAtcjEuMjYgamNmLWlvLmMKLS0tIGpjZi1pby5jCTIwMDAvMTEvMDcgMjI6NTA6
MDYJMS4yNgorKysgamNmLWlvLmMJMjAw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