package bugIdeas;

import edu.umd.cs.findbugs.annotations.ExpectWarning;
import edu.umd.cs.findbugs.annotations.NoWarning;

public class Ideas_2011_08_02 {
    
    @ExpectWarning("INT_BAD_COMPARISON_WITH_INT_VALUE")
    public boolean badCheck(int x) {
        return x == 9999999999L;
    }
    @ExpectWarning("INT_BAD_COMPARISON_WITH_INT_VALUE")
    public boolean badCheck2(int x) {
        return 9999999999L == x ;
    }
    @NoWarning("INT_BAD_COMPARISON_WITH_INT_VALUE")
    public boolean okCheck(int x) {
        return x == 999999999L;
    }

}

@@ -12,16 +12,235 @@
 Ideas;%0A%0A
+import java.util.ArrayList;%0Aimport java.util.Collection;%0Aimport java.util.EnumMap;%0Aimport java.util.HashMap;%0Aimport java.util.IdentityHashMap;%0Aimport java.util.Iterator;%0Aimport java.util.Map;%0Aimport java.util.TreeMap;%0A%0A
 import e
@@ -285,16 +285,16 @@
 arning;%0A
-
 import e
@@ -334,16 +334,65 @@
 Warning;
+%0Aimport edu.umd.cs.findbugs.annotations.Priority;
 %0A%0Apublic
@@ -421,13 +421,9 @@
 2 %7B%0A
-    
 %0A
+
     
@@ -546,24 +546,25 @@
 999L;%0A    %7D%0A
+%0A
     @ExpectW
@@ -680,17 +680,16 @@
 == x
- 
 ;%0A    %7D%0A
     
@@ -684,16 +684,17 @@
 ;%0A    %7D%0A
+%0A
     @NoW
@@ -812,10 +812,1288 @@
 %0A    %7D%0A%0A
+    enum Color %7B%0A        RED, GREEN, BLUE%0A    %7D;%0A%0A    Collection%3CMap.Entry%3CColor, Integer%3E%3E c = new ArrayList%3CMap.Entry%3CColor, Integer%3E%3E();%0A%0A    @NoWarning(value=%22DMI_ENTRY_SETS_MAY_REUSE_ENTRY_OBJECTS%22, priority=Priority.HIGH)%0A    @ExpectWarning(value=%22DMI_ENTRY_SETS_MAY_REUSE_ENTRY_OBJECTS%22, priority=Priority.MEDIUM)%0A    public void addAll(Map%3CColor, Integer%3E m) %7B%0A        c.addAll(m.entrySet());%0A    %7D%0A%0A    @ExpectWarning(value=%22DMI_ENTRY_SETS_MAY_REUSE_ENTRY_OBJECTS%22, priority=Priority.HIGH)%0A    %0A    public void addAll(IdentityHashMap%3CColor, Integer%3E m) %7B%0A        c.addAll(m.entrySet());%0A    %7D%0A    @ExpectWarning(value=%22DMI_ENTRY_SETS_MAY_REUSE_ENTRY_OBJECTS%22, priority=Priority.HIGH)%0A    %0A    public void addAll(EnumMap%3CColor, Integer%3E m) %7B%0A        c.addAll(m.entrySet());%0A    %7D%0A    @NoWarning(value=%22DMI_ENTRY_SETS_MAY_REUSE_ENTRY_OBJECTS%22, priority=Priority.MEDIUM)%0A    public void addAll(HashMap%3CColor, Integer%3E m) %7B%0A        c.addAll(m.entrySet());%0A    %7D%0A    @NoWarning(value=%22DMI_ENTRY_SETS_MAY_REUSE_ENTRY_OBJECTS%22, priority=Priority.MEDIUM)%0A    public void addAll(TreeMap%3CColor, Integer%3E m) %7B%0A        c.addAll(m.entrySet());%0A    %7D%0A    %0A    static abstract class BadIdea implements Map.Entry%3CString, Integer%3E, Iterator%3CMap.Entry%3CString, Integer%3E%3E %7B%0A        %0A    %7D%0A%0A
 %7D
-%0A

add test cases for Map.entrySet() problems