test_class.declarator: eval
test_class.original_string: RegexEvaluator eval;
test_class.type: RegexEvaluator
test_class.var_name: eval
test_class.file: NetbeansRegexPlugin/src/test/java/de/dev/eth0/netbeans/plugins/regex/RegexEvaluatorTest.java
test_class.identifier: RegexEvaluatorTest
test_case.body: @Test
    public void testReplace() {
      String testInput = "zzzdogzzzdogzzz";
      eval.update("dog", 0, "cat", testInput);
      assertEquals("zzzcatzzzdogzzz", eval.replaceFirst);
      assertEquals("zzzcatzzzcatzzz", eval.replaceAll);
    }
test_case.class_method_signature: RegexEvaluatorTest.testReplace()
test_case.full_signature: @Test public void testReplace()
test_case.identifier: testReplace
test_case.invocations: update assertEquals assertEquals
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testReplace()
focal_class.declarator: regex = ""
focal_class.modifier: private
focal_class.original_string: private String regex = "";
focal_class.type: String
focal_class.var_name: regex
focal_class.declarator: flags = 0
focal_class.modifier: private
focal_class.original_string: private int flags = 0;
focal_class.type: int
focal_class.var_name: flags
focal_class.declarator: pattern
focal_class.modifier: private
focal_class.original_string: private Pattern pattern;
focal_class.type: Pattern
focal_class.var_name: pattern
focal_class.declarator: matcher
focal_class.modifier: private
focal_class.original_string: private Matcher matcher;
focal_class.type: Matcher
focal_class.var_name: matcher
focal_class.declarator: validRegex
focal_class.modifier: public
focal_class.original_string: public boolean validRegex;
focal_class.type: boolean
focal_class.var_name: validRegex
focal_class.declarator: validReplex
focal_class.modifier: public
focal_class.original_string: public boolean validReplex;
focal_class.type: boolean
focal_class.var_name: validReplex
focal_class.declarator: regexReason
focal_class.modifier: public
focal_class.original_string: public String regexReason;
focal_class.type: String
focal_class.var_name: regexReason
focal_class.declarator: replexReason
focal_class.modifier: public
focal_class.original_string: public String replexReason;
focal_class.type: String
focal_class.var_name: replexReason
focal_class.declarator: matches
focal_class.modifier: public
focal_class.original_string: public boolean matches;
focal_class.type: boolean
focal_class.var_name: matches
focal_class.declarator: replaceFirst
focal_class.modifier: public
focal_class.original_string: public String replaceFirst;
focal_class.type: String
focal_class.var_name: replaceFirst
focal_class.declarator: replaceAll
focal_class.modifier: public
focal_class.original_string: public String replaceAll;
focal_class.type: String
focal_class.var_name: replaceAll
focal_class.declarator: lookingAt
focal_class.modifier: public
focal_class.original_string: public boolean lookingAt;
focal_class.type: boolean
focal_class.var_name: lookingAt
focal_class.declarator: find
focal_class.modifier: public
focal_class.original_string: public boolean find;
focal_class.type: boolean
focal_class.var_name: find
focal_class.declarator: groups = new MatcherGroup[0]
focal_class.modifier: public
focal_class.original_string: public MatcherGroup[] groups = new MatcherGroup[0];
focal_class.type: MatcherGroup[]
focal_class.var_name: groups
focal_class.file: NetbeansRegexPlugin/src/main/java/de/dev/eth0/netbeans/plugins/regex/RegexEvaluator.java
focal_class.identifier: RegexEvaluator
focal_class.class_method_signature: RegexEvaluator.update(String regex, int flags, String replacement, String input)
focal_class.full_signature: public void update(String regex, int flags, String replacement, String input)
focal_class.identifier: update
focal_class.modifiers: public
focal_class.parameters: (String regex, int flags, String replacement, String input)
focal_class.return: void
focal_class.signature: void update(String regex, int flags, String replacement, String input)
focal_class.class_method_signature: RegexEvaluator.isNotEmpty(String toTest)
focal_class.full_signature: private boolean isNotEmpty(String toTest)
focal_class.identifier: isNotEmpty
focal_class.modifiers: private
focal_class.parameters: (String toTest)
focal_class.return: boolean
focal_class.signature: boolean isNotEmpty(String toTest)
focal_method.body: public void update(String regex, int flags, String replacement, String input) {
          try {
              //TODO: catch empty/null exceptions
              if (!this.regex.equals(regex) || this.flags != flags) {
                  pattern = Pattern.compile(regex, flags);
                  this.regex = regex;
                  this.flags = flags;
                  this.validRegex = true;
                  this.validReplex = true;
              }
              if (pattern != null) {
                  matcher = pattern.matcher(input);
                  matches = matcher.matches();
                  matcher.reset();
                  if (isNotEmpty(replacement)) {
                      try {
                          replaceFirst = matcher.replaceFirst(replacement);
                          replaceAll = matcher.replaceAll(replacement);
                          validReplex = true;
                      } catch (IllegalArgumentException iae) {
                          validReplex = false;
                          replexReason = iae.getMessage();
                          replaceAll = "";
                          replaceFirst = "";
                      } catch (IndexOutOfBoundsException ioe) {
                          validReplex = false;
                          replexReason = ioe.getMessage();
                          replaceAll = "";
                          replaceFirst = "";
                      }
                  }
                  lookingAt = matcher.lookingAt();
                  matcher.reset();
                  find = matcher.find();
                  if (find) {
                      groups = new MatcherGroup[matcher.groupCount() + 1];
                      for (int i = 0; i < matcher.groupCount() + 1; i++) {
                          groups[i] = new MatcherGroup(matcher.start(i), matcher.end(i), matcher.group(i));
                      }
                  } else {
                      groups = new MatcherGroup[0];
                  }
              }
          } catch (PatternSyntaxException pse) {
              this.validRegex = false;
              this.regexReason = pse.getMessage();
          }
      }
focal_method.class_method_signature: RegexEvaluator.update(String regex, int flags, String replacement, String input)
focal_method.full_signature: public void update(String regex, int flags, String replacement, String input)
focal_method.identifier: update
focal_method.invocations: equals compile matcher matches reset isNotEmpty replaceFirst replaceAll getMessage getMessage lookingAt reset find groupCount groupCount start end group getMessage
focal_method.modifiers: public
focal_method.parameters: (String regex, int flags, String replacement, String input)
focal_method.return: void
focal_method.signature: void update(String regex, int flags, String replacement, String input)