Re: [Patch] small changes to CBZip2*

2004-12-10 Thread Jesse Glick
Kev Jackson wrote:
question: Do we assume that when arrays are initialised they have an
undefined value?
Java requires newly created arrays to be filled with null/0/false acc. 
to type. There is no need to explicitly blank it.

http://java.sun.com/docs/books/jls/second_edition/html/expressions.doc.html#23605
http://java.sun.com/docs/books/jls/second_edition/html/typesValues.doc.html#96595
-J.
--
Jesse Glick mailto:[EMAIL PROTECTED] x22801
NetBeans, Open APIs  http://www.netbeans.org/
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


[Patch] small changes to CBZip2*

2004-12-09 Thread Kev Jackson
just some minor tweaks
- noticed two loops looping over same range with independent code, 
combined them
- removed unneccessary casts from int to int (I left in casts from char 
to int as the code may rely on these casts in some obscure way, I 
guessed that a cast from int to int was truly unneccesary though)
- use FileUtils to close stream

question:
Do we assume that when arrays are initialised they have an undefined value?
eg:
boolean[] test = new array[10];
test[0] == null?
Reading VM spec suggests that a boolean is initialised to false and that 
was my understanding too, but does this behaviour change when an array 
of primitives is created?  I'm pretty sure it doesn't, but it may be a 
VM vendor issue so I left in the code that looped across arrays and set 
them all to false in case a particular VM doesn't do this.

http://java.sun.com/docs/books/vmspec/2nd-edition/html/Concepts.doc.html#15858
Kev
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]