package bugPatterns;

public class RE_POSSIBLE_UNINTENDED_PATTERN {

    void bug1(String any) {
        any.split(".");
    }

    void bug2(String any, String any2) {
        any.replaceAll(".", any2);
    }

    void bug3(String any, String any2) {
        any.replaceFirst(".", any2);
    }

    void notBug1(String any) {
        any.replaceAll(".", "*");
    }

    void notBug2(String any) {
        any.indexOf(".");
    }
}

@@ -19,63 +19,226 @@
 s;%0A%0A
-public class RE_POSSIBLE_UNINTENDED_PATTERN %7B%0A%0A    void
+import edu.umd.cs.findbugs.annotations.ExpectWarning;%0Aimport edu.umd.cs.findbugs.annotations.NoWarning;%0A%0Apublic class RE_POSSIBLE_UNINTENDED_PATTERN %7B%0A%0A    @ExpectWarning(%22RE_POSSIBLE_UNINTENDED_PATTERN%22)%0A    String %5B%5D
  bug
@@ -257,24 +257,31 @@
 ) %7B%0A        
+return 
 any.split(%22.
@@ -291,28 +291,83 @@
 %0A    %7D%0A%0A    
-void
+@ExpectWarning(%22RE_POSSIBLE_UNINTENDED_PATTERN%22)%0A    String
  bug2(String
@@ -387,32 +387,39 @@
 any2) %7B%0A        
+return 
 any.replaceAll(%22
@@ -440,20 +440,75 @@
  %7D%0A%0A    
-void
+@ExpectWarning(%22RE_POSSIBLE_UNINTENDED_PATTERN%22)%0A    String
  bug3(St
@@ -532,32 +532,39 @@
 any2) %7B%0A        
+return 
 any.replaceFirst
@@ -583,28 +583,79 @@
 %0A    %7D%0A%0A    
-void
+@NoWarning(%22RE_POSSIBLE_UNINTENDED_PATTERN%22)%0A    String
  notBug1(Str
@@ -669,24 +669,31 @@
 ) %7B%0A        
+return 
 any.replaceA
@@ -721,12 +721,60 @@
     
-void
+@NoWarning(%22RE_POSSIBLE_UNINTENDED_PATTERN%22)%0A    int
  not
@@ -800,16 +800,23 @@
         
+return 
 any.inde

add annotations showing expected warnings