Priority
Normal
Type
Bug 
State
Verified 
Assignee
Bas Leijdekkers 
Subsystem
Code Analysis. Inspection 
Affected versions
Fixed in
Fixed in build
Next build 
Build
8211
Fixed in build
8225
  • Submitted by   Alexander Chernikov
    23 months ago (06 Mar 2008 20:39)
  • Updated by   root
    3 weeks ago (17 Jan 2010 19:58)
  • Jira: IDEA-43079
    (history, comments)

IDEA-43079

IG: "Type may be weakened" with "Use righthand type" On warns about foreach parameter

0
Make sure you have "Type may be weakened" On, with option "Use righthand type as weakest type" On.
Provide dummy code like:
import org.jetbrains.annotations.NonNls;

public class RightHandIterator {
    public static int exp(Iterable<String> list) {
        int i = 0;
        for (@NonNls String s: list) {
            if ("some".equals(s)) {
                i++;
            }
        }
        return i;
    }
}

Inspection reports s: "Type of parameter may be weakened to Object".
But it seems that with "Use righthand type" option it should not be reported: the type of collection elements is explicitly set to String.

Issue was closed
Comments (1)
 
History (2)
 
Links
 
Alexander Chernikov
  Alexander Chernikov
15 Mar 2008 16:42
(22 months ago)
#permalink
8227: fix confirmed.