@Test public void testCreateMethodSignature() { assertThat(SignatureUtil.createMethodSignature("", "void"), is("()V")); assertThat(SignatureUtil.createMethodSignature("byte,\r\nchar, \tboolean", "void"), is("(BCZ)V")); assertThat(SignatureUtil.createMethodSignature("float", "java.lang.String[]"), is("(F)[Ljava/lang/String;")); }
public static String createMethodSignature(String params, String returns) { if (params == null && returns == null) { return null; } String pString, rString; if (params == null) { pString = ".*"; } else { StringBuilder buf = new StringBuilder(); StringTokenizer tok = new StringTokenizer(params, " \t\n\r\f,"); while (tok.hasMoreTokens()) { String param = typeToSignature(tok.nextToken()); buf.append(param); } pString = buf.toString(); } if (returns == null) { rString = ".*"; } else { rString = typeToSignature(returns); } if (params == null || returns == null) { String result = "~\\(" + pString + "\\)" + rString; assert Pattern.compile(result.substring(1)) != null; return result; } else { return "(" + pString + ")" + rString; } }
SignatureUtil { public static String createMethodSignature(String params, String returns) { if (params == null && returns == null) { return null; } String pString, rString; if (params == null) { pString = ".*"; } else { StringBuilder buf = new StringBuilder(); StringTokenizer tok = new StringTokenizer(params, " \t\n\r\f,"); while (tok.hasMoreTokens()) { String param = typeToSignature(tok.nextToken()); buf.append(param); } pString = buf.toString(); } if (returns == null) { rString = ".*"; } else { rString = typeToSignature(returns); } if (params == null || returns == null) { String result = "~\\(" + pString + "\\)" + rString; assert Pattern.compile(result.substring(1)) != null; return result; } else { return "(" + pString + ")" + rString; } } }
SignatureUtil { public static String createMethodSignature(String params, String returns) { if (params == null && returns == null) { return null; } String pString, rString; if (params == null) { pString = ".*"; } else { StringBuilder buf = new StringBuilder(); StringTokenizer tok = new StringTokenizer(params, " \t\n\r\f,"); while (tok.hasMoreTokens()) { String param = typeToSignature(tok.nextToken()); buf.append(param); } pString = buf.toString(); } if (returns == null) { rString = ".*"; } else { rString = typeToSignature(returns); } if (params == null || returns == null) { String result = "~\\(" + pString + "\\)" + rString; assert Pattern.compile(result.substring(1)) != null; return result; } else { return "(" + pString + ")" + rString; } }  }
SignatureUtil { public static String createMethodSignature(String params, String returns) { if (params == null && returns == null) { return null; } String pString, rString; if (params == null) { pString = ".*"; } else { StringBuilder buf = new StringBuilder(); StringTokenizer tok = new StringTokenizer(params, " \t\n\r\f,"); while (tok.hasMoreTokens()) { String param = typeToSignature(tok.nextToken()); buf.append(param); } pString = buf.toString(); } if (returns == null) { rString = ".*"; } else { rString = typeToSignature(returns); } if (params == null || returns == null) { String result = "~\\(" + pString + "\\)" + rString; assert Pattern.compile(result.substring(1)) != null; return result; } else { return "(" + pString + ")" + rString; } }  static String createMethodSignature(String params, String returns); static String createFieldSignature(String type); }
SignatureUtil { public static String createMethodSignature(String params, String returns) { if (params == null && returns == null) { return null; } String pString, rString; if (params == null) { pString = ".*"; } else { StringBuilder buf = new StringBuilder(); StringTokenizer tok = new StringTokenizer(params, " \t\n\r\f,"); while (tok.hasMoreTokens()) { String param = typeToSignature(tok.nextToken()); buf.append(param); } pString = buf.toString(); } if (returns == null) { rString = ".*"; } else { rString = typeToSignature(returns); } if (params == null || returns == null) { String result = "~\\(" + pString + "\\)" + rString; assert Pattern.compile(result.substring(1)) != null; return result; } else { return "(" + pString + ")" + rString; } }  static String createMethodSignature(String params, String returns); static String createFieldSignature(String type);  }