public inbox for java-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug java/14979] New: gcj doesn't handle package private methods with differing return types properly
@ 2004-04-16 17:46 ovidr at users dot sourceforge dot net
  2004-04-16 17:51 ` [Bug java/14979] " pinskia at gcc dot gnu dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: ovidr at users dot sourceforge dot net @ 2004-04-16 17:46 UTC (permalink / raw)
  To: java-prs

one/A.java:

---------

package one;
public class A {

     public static void main(String[] s) {
          System.out.println("I'm a bug");
     }

     boolean test() {
          return false;
     }

}


two/B.java

-----
package two;

import one.A;

public class B extends A {

    void test () {

    }

}

works:
javac one\A.java
javac two\B.java

doesn't work with gcj:
gcj -C one\A.java
gcj -C two\B.java
two\B.java:8: error: Method `one.A.test()' was defined with return type 
`boolean' in class `one.A'.
        void test () {
                ^
1 error

tested on:
gcc version 3.4.0 20040316 (prerelease)
gcc version 3.5.0 20040414 (experimental)

-- 
           Summary: gcj doesn't handle package private methods with
                    differing return types properly
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: java
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: ovidr at users dot sourceforge dot net
                CC: gcc-bugs at gcc dot gnu dot org,java-prs at gcc dot gnu
                    dot org


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


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

* [Bug java/14979] gcj doesn't handle package private methods with differing return types properly
  2004-04-16 17:46 [Bug java/14979] New: gcj doesn't handle package private methods with differing return types properly ovidr at users dot sourceforge dot net
@ 2004-04-16 17:51 ` pinskia at gcc dot gnu dot org
  2004-04-17  5:39 ` pinskia at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-04-16 17:51 UTC (permalink / raw)
  To: java-prs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |rejects-valid


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


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

* [Bug java/14979] gcj doesn't handle package private methods with differing return types properly
  2004-04-16 17:46 [Bug java/14979] New: gcj doesn't handle package private methods with differing return types properly ovidr at users dot sourceforge dot net
  2004-04-16 17:51 ` [Bug java/14979] " pinskia at gcc dot gnu dot org
@ 2004-04-17  5:39 ` pinskia at gcc dot gnu dot org
  2004-05-05 15:32 ` bryce at mckinlay dot net dot nz
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-04-17  5:39 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-04-17 05:39 -------
Confirmed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
      Known to fail|                            |3.0.4 3.4.0 3.5.0
   Last reconfirmed|0000-00-00 00:00:00         |2004-04-17 05:39:15
               date|                            |


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


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

* [Bug java/14979] gcj doesn't handle package private methods with differing return types properly
  2004-04-16 17:46 [Bug java/14979] New: gcj doesn't handle package private methods with differing return types properly ovidr at users dot sourceforge dot net
  2004-04-16 17:51 ` [Bug java/14979] " pinskia at gcc dot gnu dot org
  2004-04-17  5:39 ` pinskia at gcc dot gnu dot org
@ 2004-05-05 15:32 ` bryce at mckinlay dot net dot nz
  2005-01-08  4:53 ` wasabi at larvalstage dot net
  2005-01-08  4:58 ` wasabi at larvalstage dot net
  4 siblings, 0 replies; 6+ messages in thread
From: bryce at mckinlay dot net dot nz @ 2004-05-05 15:32 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From bryce at mckinlay dot net dot nz  2004-05-05 15:32 -------


*** This bug has been marked as a duplicate of 12741 ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |DUPLICATE


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


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

* [Bug java/14979] gcj doesn't handle package private methods with differing return types properly
  2004-04-16 17:46 [Bug java/14979] New: gcj doesn't handle package private methods with differing return types properly ovidr at users dot sourceforge dot net
                   ` (2 preceding siblings ...)
  2004-05-05 15:32 ` bryce at mckinlay dot net dot nz
@ 2005-01-08  4:53 ` wasabi at larvalstage dot net
  2005-01-08  4:58 ` wasabi at larvalstage dot net
  4 siblings, 0 replies; 6+ messages in thread
From: wasabi at larvalstage dot net @ 2005-01-08  4:53 UTC (permalink / raw)
  To: java-prs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 788 bytes --]


------- Additional Comments From wasabi at larvalstage dot net  2005-01-08 04:53 -------
Are you sure this is a bug?

Quote from the JLS:
http://java.sun.com/docs/books/jls/second_edition/html/classes.doc.html

8.4.6.3 Requirements in Overriding and Hiding
If a method declaration overrides or hides the declaration of another method,
then a compile-time error occurs if they have different return types or if one
has a return type and the other is void. Moreover, a method declaration must not
have a throws clause that conflicts (§8.4.4) with that of any method that it
overrides or hides; otherwise, a compile-time error occurs.

That tells me that a compile time error SHOULD occure because the return types
are different.


-- 


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


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

* [Bug java/14979] gcj doesn't handle package private methods with differing return types properly
  2004-04-16 17:46 [Bug java/14979] New: gcj doesn't handle package private methods with differing return types properly ovidr at users dot sourceforge dot net
                   ` (3 preceding siblings ...)
  2005-01-08  4:53 ` wasabi at larvalstage dot net
@ 2005-01-08  4:58 ` wasabi at larvalstage dot net
  4 siblings, 0 replies; 6+ messages in thread
From: wasabi at larvalstage dot net @ 2005-01-08  4:58 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From wasabi at larvalstage dot net  2005-01-08 04:58 -------
Take it all back. Vektor has corrected me. I hit this problem in Eclipse, and
did not notice the package visibility. Sorry for the bother.

-- 


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


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

end of thread, other threads:[~2005-01-08  4:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-04-16 17:46 [Bug java/14979] New: gcj doesn't handle package private methods with differing return types properly ovidr at users dot sourceforge dot net
2004-04-16 17:51 ` [Bug java/14979] " pinskia at gcc dot gnu dot org
2004-04-17  5:39 ` pinskia at gcc dot gnu dot org
2004-05-05 15:32 ` bryce at mckinlay dot net dot nz
2005-01-08  4:53 ` wasabi at larvalstage dot net
2005-01-08  4:58 ` wasabi at larvalstage dot net

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).