History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: IDEADEV-25240
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Normal Normal
Assignee: Bas Leijdekkers
Reporter: Alexander Chernikov
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
IDEA: Development

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

Created: 06 Mar 08 20:39   Updated: 15 Mar 08 16:42
Component/s: Code Analysis. Inspection
Fix Version/s: Diana 8243, Selena 7.0.4

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown

Build: 8,211
Fixed in build: 8,225


 Description  « Hide
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.



 All   Comments   Work Log   Change History      Sort Order:
Alexander Chernikov - 15 Mar 08 16:42
8227: fix confirmed.