java/1416: Erroneously declaring invalid argument in finalization method
mkgardne@uiuc.edu
mkgardne@uiuc.edu
Wed Dec 20 12:26:00 GMT 2000
>Number: 1416
>Category: java
>Synopsis: Erroneously declaring invalid argument in finalization method
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: tromey
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Wed Dec 20 12:19:41 PST 2000
>Closed-Date: Fri Nov 12 16:30:03 PST 1999
>Last-Modified: Fri Nov 12 16:40:00 PST 1999
>Originator: Mark K. Gardner
>Release: gcj 2.95.1, libgcj 2.95.0
>Organization:
>Environment:
i686 Redhat 5.2 with 2.2.3 SMP kernel
>Description:
GCJ complains while compiling the finalization method of
a class when I believe it shouldn't.
// Take from http://www-cse.ucsd.edu/users/wgg/JavaProf/Code/benchmark.tar.gz
class GCTest {
static int objs_collected = 0;
static final int GC_POINTERS = 200;
static final int GC_OBJECTS = 2000;
static final int size = 4725;
public void start() {
for(int i = 0; i < GC_OBJECTS; i++) {
GCTestElem objects = new GCTestElem(size);
}
}
}
class GCTestElem {
byte collect[];
public GCTestElem(int size) {
collect = new byte[size];
}
protected void finalize() {
GCTest.objs_collected++;
}
}
>How-To-Repeat:
Copy code to GCTest.java
compile: gcj GCTest.java to get
GCTest.java: In class `GCTestElem':
GCTest.java: In method `finalize()':
GCTest.java:21: Invalid argument to `++'.
GCTest.objs_collected++;
^
1 error
>Fix:
>Release-Note:
>Audit-Trail:
Formerly PR gcj/39
State-Changed-From-To: open->feedback
State-Changed-By: tromey
State-Changed-When: Fri Sep 3 10:15:50 1999
State-Changed-Why:
I've checked in a fix for this.
If you can try it, would you please do so and get back to me?
If you can't try it, please tell me and I will simply
close the PR (I know it works as I tried it on your
example).
Responsible-Changed-From-To: apbianco->tromey
Responsible-Changed-By: apbianco
Responsible-Changed-When: Tue Sep 14 12:25:48 1999
Responsible-Changed-Why:
Tom checked in a patch and will most likely close this PR
soon.
State-Changed-From-To: feedback->closed
State-Changed-By: tromey
State-Changed-When: Fri Nov 12 16:30:03 1999
State-Changed-Why:
This has been in feedback for months.
I assume it is fixed.
From: tromey@cygnus.com
To: java-gnats@sourceware.cygnus.com, mkgardne@uiuc.edu, tromey@cygnus.com
Cc:
Subject: Re: gcj/39
Date: 13 Nov 1999 00:30:03 -0000
Synopsis: Erroneously declaring invalid argument in finalization method
State-Changed-From-To: feedback->closed
State-Changed-By: tromey
State-Changed-When: Fri Nov 12 16:30:03 1999
State-Changed-Why:
This has been in feedback for months.
I assume it is fixed.
http://sourceware.cygnus.com/cgi-bin/gnatsweb.pl?cmd=view&database=java&pr=39
>Unformatted:
More information about the Gcc-prs
mailing list