> not got into generics yet. any good? worth learning?
> You can expect the amount of practical software development to decline as
> thousands of hours are devoted to eliminating compiler warnings and
[quoted text clipped - 4 lines]
> Regards,
> Adam
so stemming innovation is a good thing?
On Fri, 24 Feb 2006 15:45:40 +1300, Adam Warner
<usenet@consulting.net.nz> wrote, quoted or indirectly quoted someone
who said :
>Sun's compiler now warns that lots of traditional Java code is potentially
>unsafe and unchecked. This is propaganda that hurts Sun's message about
>Java being a safe language--especially when only a subset of these
>warnings can be resolved using generics.
You are using safe in two different contexts. Generics safe means
finding out about a problem at compile time rather than run time.
Application safe means that programs don't have undefined behaviour
when you have null pointers or subscripts out of range.
Applet safe means a unsigned Applet you invite into your computer
can't write on your hard disks go pestering other computers on the
net.

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
Adam Warner - 24 Feb 2006 09:19 GMT
> On Fri, 24 Feb 2006 15:45:40 +1300, Adam Warner
> <usenet@consulting.net.nz> wrote, quoted or indirectly quoted someone
[quoted text clipped - 7 lines]
> You are using safe in two different contexts. Generics safe means
> finding out about a problem at compile time rather than run time.
Therefore "Generics safe" is a misleading term for "satisfies the static
type checker". Code that satisfies the extra static type checks is not
automatically safe and so-called unchecked code is always checked. It is
the run time environment that ensures safety...
> Application safe means that programs don't have undefined behaviour when
> you have null pointers or subscripts out of range.
That is the code cannot subvert the relevant run time environment.
> Applet safe means a unsigned Applet you invite into your computer can't
> write on your hard disks go pestering other computers on the net.
That is the code cannot subvert the relevant run time environment.
"The code compiles without needing to suppress warnings" is not a useful
definition of safe. I think Sun is nuts claiming that traditional Java
code is potentially unsafe when it is the JVM's job to enforce safety.
Sun are the ones using safe in a misleading context.
Regards,
Adam
> Sun expects you to write additional code to make the warnings go away.
> Regards,
> Adam
I've been cranking Google but the mince is too fatty: does anyone know
of any tool that might help reformat pre-generics into generics-ised code?
I know nothing could do the job 100%, but it couldn't be beyond the
bounds of possibility to parse some Collections in the source code (with
their tell-tale, casted getter methods) back to their declarations and
smack them both with some angle-brackets. (An oversimplification, I know.)
Even if the tool bailed where confused, a 50% success rate would help.

Signature
.ed
www.EdmundKirwan.com - Home of The Fractal Class Composition.
Roedy Green - 24 Feb 2006 20:13 GMT
>I've been cranking Google but the mince is too fatty: does anyone know
>of any tool that might help reformat pre-generics into generics-ised code?
I noticed IntelliJ has a genericise button, but I have have not used
it yet.
see http://mindprod.com/jgloss/intelliJ.html You could find you with
the trial version.

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.