public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* java/2040: java.util.Hashtable(int,float) is stricter than sun's version
@ 2001-04-01  0:00 pedro
  0 siblings, 0 replies; only message in thread
From: pedro @ 2001-04-01  0:00 UTC (permalink / raw)
  To: gcc-gnats

>Number:         2040
>Category:       java
>Synopsis:       java.util.Hashtable(int,float) is stricter than sun's version
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Feb 20 10:26:02 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     pedro@vis.ethz.ch
>Release:        latest 3.0 snapshot
>Organization:
>Environment:
i686-linux
>Description:
the java.util.Hashtable(initialCapacity,loadFactor) initializer throws an IllegalArgumentException in one of the following cases:

	- initialCapacity is negative
	- loadFactor is negative
	- loadFactor is > 1

although a loadFactor > 1 doesn't make much sense, many people don't realize it and sice sun's jdk won't send you to hell if you do it, many programs (in my case i'm trying to compile kjc - it has about 10-20 of these) do it.
i have no idea what the jls says about this, if anything.
>How-To-Repeat:
public class Test {
	public static void main ( String args[] ) {
		Hashtable h = new java.util.Hashtable(1,1.5f);
		System.out.println(h);
		}
	}
>Fix:
i changed java.util.Hashtable.java to not through an exception but force the parameters into reasonable values if they don't make sense. stupid people shouldn't be playing with these in the first place.
>Release-Note:
>Audit-Trail:
>Unformatted:


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2001-04-01  0:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-04-01  0:00 java/2040: java.util.Hashtable(int,float) is stricter than sun's version pedro

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