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 200370

Summary: "Suspicious method call" hint does not offer a fix
Product: java Reporter: jks2
Component: HintsAssignee: Svata Dedic <sdedic>
Status: NEW ---    
Severity: normal    
Priority: P3    
Version: 7.0   
Hardware: PC   
OS: Linux   
Issue Type: ENHANCEMENT Exception Reporter:

Description jks2 2011-07-25 17:32:35 UTC
I created a class that implements java.util.Map<String, Object>. Then I created a variable of type java.util.Map<String, Object> and used the delegate method wizard to wrap all the methods, which generated methods like:

    public Object remove(Object key){
        return actualMap.remove(key);
    }

This generates a Suspicious method call warning, "Expected type String but found Object".  It seems to me the hint should offer a fix that converts the Object to a String.
Comment 1 jks2 2011-07-25 17:38:01 UTC
I suppose that should be "casts the Object to a String"