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 - "Suspicious method call" hint does not offer a fix
Summary: "Suspicious method call" hint does not offer a fix
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 7.0
Hardware: PC Linux
: P3 normal (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-25 17:32 UTC by jks2
Modified: 2013-09-02 14:24 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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"