Strings in switch

Joseph D. Darcy Joe.Darcy at Sun.COM
Mon Mar 30 12:01:24 PDT 2009


Ulf Zibis wrote:
> Hi Joe,
>
> I refer to your proposal:
> http://mail.openjdk.java.net/pipermail/coin-dev/2009-February/000001.html
>
> If your proposal would unchanged be taken into JDK 7, there won't be 
> any compatible way to implement my more general proposal "Extend 
> switch .. case statement for Object types and simple expressions" in 
> future version of JDK !!!
> --> So switch .. case statement should compare for IDENTITY if not 
> syntactically determined otherwise.
> --> compare for EQUALITY would also break semantic of existing switch 
> .. case statement.

While pattern matching is a fine feature in some languages, I don't 
think retrofitting that flavor of facility onto Java much over and above 
the existing capabilities of the switch statement is the right direction 
to evolve Java.

-Joe




More information about the coin-dev mailing list