Ejemplo n.º 1
0
  // remove non-word characters and everything after ":::" from the
  // program point name, leaving PackageName.ClassName.MethodName
  private static String cleanup_pptname(String pptname) {
    int index;
    if ((index = pptname.indexOf("(")) > 0) {
      pptname = pptname.substring(0, index);
    }

    if (pptname.endsWith(".")) pptname = pptname.substring(0, pptname.length() - 2);

    Matcher m = non_word_pattern.matcher(pptname);
    return m.replaceAll(".");
  }
Ejemplo n.º 2
0
 private static boolean contains_exactly_one(String string, Pattern pattern) {
   Matcher m = pattern.matcher(string);
   // return true if first call returns true and second returns false
   return (m.find() && !m.find());
 }