public inbox for java-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug java/20312] New: No warning on bad method
@ 2005-03-04 15:33 davidw at dedasys dot com
  2005-03-05 16:33 ` [Bug java/20312] " pinskia at gcc dot gnu dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 8+ messages in thread
From: davidw at dedasys dot com @ 2005-03-04 15:33 UTC (permalink / raw)
  To: java-prs

Hi, in the Hecl programming language, I do this:

    public String toString() throws HeclException {
	Vector v = ListThing.get(new Thing(new HashThing(val)));
	ListThing newthing = new ListThing(v);
	return newthing.toString();
    }

Apparently, that should generate a warning or throw an error, because toString
isn't supposed to throw an exception...  "regular" java says this:

./com/dedasys/hecl/HashThing.java:140: toString() in com.dedasys.hecl.HashThing
cannot override toString() in java.lang.Object; overridden method does not throw
com.dedasys.hecl.HeclException
    public String toString() throws HeclException {
                  ^

Thanks,
Dave

-- 
           Summary: No warning on bad method
           Product: gcc
           Version: 3.3.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: java
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: davidw at dedasys dot com
                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=20312


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

* [Bug java/20312] No warning on bad method
  2005-03-04 15:33 [Bug java/20312] New: No warning on bad method davidw at dedasys dot com
@ 2005-03-05 16:33 ` pinskia at gcc dot gnu dot org
  2005-03-11  7:29 ` rmathew at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-03-05 16:33 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-03-04 15:04 -------
Confirmed, reduced self contained testcase:
class t
{
  public String toString()  throws java.io.IOException
  {return "";}
}

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
           Keywords|                            |accepts-invalid
      Known to fail|                            |4.1.0
   Last reconfirmed|0000-00-00 00:00:00         |2005-03-04 15:04:44
               date|                            |


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


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

* [Bug java/20312] No warning on bad method
  2005-03-04 15:33 [Bug java/20312] New: No warning on bad method davidw at dedasys dot com
  2005-03-05 16:33 ` [Bug java/20312] " pinskia at gcc dot gnu dot org
@ 2005-03-11  7:29 ` rmathew at gcc dot gnu dot org
  2005-03-11  9:16 ` cvs-commit at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: rmathew at gcc dot gnu dot org @ 2005-03-11  7:29 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From rmathew at gcc dot gnu dot org  2005-03-10 13:30 -------
A patch is here:

  http://gcc.gnu.org/ml/java-patches/2005-q1/msg00710.html

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch


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


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

* [Bug java/20312] No warning on bad method
  2005-03-04 15:33 [Bug java/20312] New: No warning on bad method davidw at dedasys dot com
  2005-03-05 16:33 ` [Bug java/20312] " pinskia at gcc dot gnu dot org
  2005-03-11  7:29 ` rmathew at gcc dot gnu dot org
@ 2005-03-11  9:16 ` cvs-commit at gcc dot gnu dot org
  2005-03-12  5:36 ` pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-03-11  9:16 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2005-03-10 18:40 -------
Subject: Bug 20312

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	rmathew@gcc.gnu.org	2005-03-10 18:40:28

Modified files:
	gcc/java       : ChangeLog parse.y 

Log message:
	PR java/20312
	* parse.y (checks_throws_clauses): Check exceptions list even when
	the base class does not come from a source file being compiled.
	(java_complete_lhs): Remove unused variable 'wfl'.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/java/ChangeLog.diff?cvsroot=gcc&r1=1.1570&r2=1.1571
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/java/parse.y.diff?cvsroot=gcc&r1=1.529&r2=1.530



-- 


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


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

* [Bug java/20312] No warning on bad method
  2005-03-04 15:33 [Bug java/20312] New: No warning on bad method davidw at dedasys dot com
                   ` (2 preceding siblings ...)
  2005-03-11  9:16 ` cvs-commit at gcc dot gnu dot org
@ 2005-03-12  5:36 ` pinskia at gcc dot gnu dot org
  2005-04-21  9:05 ` bothner at gcc dot gnu dot org
  2005-07-21  0:28 ` pinskia at gcc dot gnu dot org
  5 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-03-12  5:36 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-03-10 23:35 -------
Fixed in 4.1.0 and above.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |4.1.0


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


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

* [Bug java/20312] No warning on bad method
  2005-03-04 15:33 [Bug java/20312] New: No warning on bad method davidw at dedasys dot com
                   ` (3 preceding siblings ...)
  2005-03-12  5:36 ` pinskia at gcc dot gnu dot org
@ 2005-04-21  9:05 ` bothner at gcc dot gnu dot org
  2005-07-21  0:28 ` pinskia at gcc dot gnu dot org
  5 siblings, 0 replies; 8+ messages in thread
From: bothner at gcc dot gnu dot org @ 2005-04-21  9:05 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From bothner at gcc dot gnu dot org  2005-04-21 09:05 -------
This patch can cause an ICE when the super-class is byte-compiled.
If a byte-compiled method M in a super-class throws exception X,
we try to emit an erroneous error message that M can't throw X
(because we don't analyze the bytecode).  Worse, because M
doesn't have DECL_FUNCTION_WFL set, we get an ICE in parse_error_context.

The problem is check_interface_throws_clauses, which seems to be doing way
too much work ... it should be not be checking that
"The exception must be a subclass of an exception thrown" in super-classes.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |


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


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

* [Bug java/20312] No warning on bad method
  2005-03-04 15:33 [Bug java/20312] New: No warning on bad method davidw at dedasys dot com
                   ` (4 preceding siblings ...)
  2005-04-21  9:05 ` bothner at gcc dot gnu dot org
@ 2005-07-21  0:28 ` pinskia at gcc dot gnu dot org
  5 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-07-21  0:28 UTC (permalink / raw)
  To: java-prs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.1.0                       |---


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


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

* [Bug java/20312] No warning on bad method
       [not found] <bug-20312-10209@http.gcc.gnu.org/bugzilla/>
@ 2007-01-30  1:53 ` daney at gcc dot gnu dot org
  0 siblings, 0 replies; 8+ messages in thread
From: daney at gcc dot gnu dot org @ 2007-01-30  1:53 UTC (permalink / raw)
  To: java-prs



------- Comment #7 from daney at gcc dot gnu dot org  2007-01-30 01:53 -------
In 4.3.0 this is correctly flagged as an error.  With the testcase in comment
#1 we get:

$ gcj -o t --main=t t.java
t.java:3: error: Exception IOException is not compatible with throws clause in
Object.toString()
        public String toString()  throws java.io.IOException
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1 problem (1 error)


-- 

daney at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
      Known to work|                            |4.3.0
         Resolution|                            |FIXED
   Target Milestone|---                         |4.3.0


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


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

end of thread, other threads:[~2007-01-30  1:53 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-04 15:33 [Bug java/20312] New: No warning on bad method davidw at dedasys dot com
2005-03-05 16:33 ` [Bug java/20312] " pinskia at gcc dot gnu dot org
2005-03-11  7:29 ` rmathew at gcc dot gnu dot org
2005-03-11  9:16 ` cvs-commit at gcc dot gnu dot org
2005-03-12  5:36 ` pinskia at gcc dot gnu dot org
2005-04-21  9:05 ` bothner at gcc dot gnu dot org
2005-07-21  0:28 ` pinskia at gcc dot gnu dot org
     [not found] <bug-20312-10209@http.gcc.gnu.org/bugzilla/>
2007-01-30  1:53 ` daney at gcc dot gnu dot org

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