void () { String s133 = """ class String1 implements java.io.Serializable { private static final long serialVersionUID = -6849794470754667710L; private static final ObjectStreamField[] serialPersistentFields = new ObjectStreamField[0]; } class StringBuilder1 implements java.io.Serializable { private void writeObject(java.io.ObjectOutputStream s) throws java.io.IOException { s.defaultWriteObject(); } private void readObject(java.io.ObjectInputStream s) throws java.io.IOException, ClassNotFoundException { s.defaultReadObject(); } static final long serialVersionUID = 4383685877147921099L; }"""; String s134 = """ class '_ implements '_:*Serializable { static final long 'VersionField:serialVersionUID = '_?; private static final ObjectStreamField[] '_?:serialPersistentFields = '_?; private void '_SerializationWriteHandler?:writeObject (ObjectOutputStream s) throws IOException; private void '_SerializationReadHandler?:readObject (ObjectInputStream s) throws IOException, ClassNotFoundException; Object '_SpecialSerializationReadHandler?:readResolve () throws ObjectStreamException; Object '_SpecialSerializationWriteHandler?:writeReplace () throws ObjectStreamException; }"""; assertEquals("serialization match", 2, findMatchesCount(s133, s134)); String s135 = """ class SimpleStudentEventActionImpl extends Action { public ActionForward execute(ActionMapping mapping, ActionForm _form, HttpServletRequest _request, HttpServletResponse _response) throws Exception {} } public class DoEnrollStudent extends SimpleStudentEventActionImpl { } public class DoCancelStudent extends SimpleStudentEventActionImpl { }"""; String s136 = """ public class 'StrutsActionClass extends '_:*Action { public ActionForward '_AnActionMethod:*execute (ActionMapping '_, ActionForm '_, HttpServletRequest '_, HttpServletResponse '_); }"""; assertEquals("Struts actions", 2, findMatchesCount(s135, s136)); final String s123 = """ class NodeFilter {} public class MethodFilter extends NodeFilter { private MethodFilter() {} public static NodeFilter getInstance() { if (instance==null) instance = new MethodFilter(); return instance; } private static NodeFilter instance; }"""; final String s124 = """ class 'Class { private 'Class('_Type '_param*) { '_st*; } private static '_Class2 '_Instance; static '_Class2 '_GetInstance() { '_st2*; return '_Instance; } }"""; assertEquals("singleton search", 1, findMatchesCount(s123,s124)); String s1111 = """ class X {{ if (true) { a=1; b=1; } else { a=1; } if(true) { a=1; } else { a=1; b=1; } if(true) { a=1; b=2; } else { a = 1; b=2; } }}"""; assertEquals("same multiple name pattern", 1, findMatchesCount(s1111, "if (true) { '_a{1,2}; } else { '_a; }")); }