This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 200595

Summary: Missing hint for JDK 7
Product: java Reporter: Evilus
Component: HintsAssignee: Svata Dedic <sdedic>
Status: NEW ---    
Severity: normal    
Priority: P3    
Version: 7.0.1   
Hardware: PC   
OS: Windows 7   
Issue Type: ENHANCEMENT Exception Reporter:

Description Evilus 2011-08-02 11:31:47 UTC
Hey.

So in JDK 7 we have the new hints for if /else if strings to switch case strings, howver I noticed it only works if it looks like this if(event.equals("string here")
else if (event.equals("strong here") etc or if you use == I think it works too.

So instead if you use event.equalsIgnoreCase("string here") it does not give this string , there is probably other cases too but I noticed this one for now


Product Version = NetBeans IDE 7.0 (Build 201107282000)
Operating System = Windows 7 version 6.1 running on x86
Java; VM; Vendor = 1.7.0
Runtime = Java HotSpot(TM) Client VM 21.0-b17
Comment 1 Jan Lahoda 2011-08-02 12:30:19 UTC
Not sure if I understand correctly, is the suggestion that there should be a conversion from:
if (var.equalsIgnoreCase("string1")) {
     //statements
} else if (var.equalsIgnoreCase("string2")) {
     //statements
}
to switch statement? If so, I am afraid that this is a bit more complex, as the switch over strings does not directly support equalsIgnoreCase. It might be possible to solve this in some cases by (locale specific) toLowerCase/toUpperCase-ing the strings, but that is not supported now.