@Test public void testCompareFromJson() { try { final String vul_sig_json = FileUtil.readFile( Paths.get("./src/test/resources/methodBody/deserialize/signatureDef.json")); final String fix_sig_json = FileUtil.readFile( Paths.get("./src/test/resources/methodBody/deserialize/signatureFix.json")); assertEquals(vul_sig_json, vulSigJson); assertEquals(fix_sig_json, fixSigJson); final Signature vul_sig = (Signature) JacksonUtil.asObject( vul_sig_json, custom_deserializers, ASTConstructBodySignature.class); final Signature fix_sig = (Signature) JacksonUtil.asObject( fix_sig_json, custom_deserializers, ASTConstructBodySignature.class); final SignatureComparator comparator = new ASTSignatureComparator(); SignatureChange chg = comparator.computeChange(vul_sig, fix_sig); final String sig_chg_json = FileUtil.readFile( Paths.get("./src/test/resources/methodBody/deserialize/signatureChange.json")); assertEquals(sig_chg_json, sigChange); final SignatureChange sig_chg = (ASTSignatureChange) JacksonUtil.asObject(sig_chg_json, custom_deserializers, ASTSignatureChange.class); assertEquals(chg, sig_chg); } catch (JsonSyntaxException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } }
@Override public SignatureChange computeChange(Signature _a, Signature _b) { SignatureChange astChange = new ASTSignatureChange(_a, _b); astChange.getModifications(); return astChange; }
ASTSignatureComparator implements SignatureComparator { @Override public SignatureChange computeChange(Signature _a, Signature _b) { SignatureChange astChange = new ASTSignatureChange(_a, _b); astChange.getModifications(); return astChange; } }
ASTSignatureComparator implements SignatureComparator { @Override public SignatureChange computeChange(Signature _a, Signature _b) { SignatureChange astChange = new ASTSignatureChange(_a, _b); astChange.getModifications(); return astChange; } ASTSignatureComparator();  ASTSignatureComparator(double stringSimilarity); }
ASTSignatureComparator implements SignatureComparator { @Override public SignatureChange computeChange(Signature _a, Signature _b) { SignatureChange astChange = new ASTSignatureChange(_a, _b); astChange.getModifications(); return astChange; } ASTSignatureComparator();  ASTSignatureComparator(double stringSimilarity); @Override float computeSimilarity(Signature _a, Signature _b); @Override SignatureChange computeChange(Signature _a, Signature _b); int getTotalNumChanges(); int getMatchedNumChanges(); @Override boolean containsChange(Signature _s, SignatureChange _change); double getStringSimilarityThreshold(); void setStringSimilarityThreshold(double _threshold); Node searchForNode(SourceCodeChange change, Node astRoot); boolean searchForEntity(SourceCodeChange change, Node astRoot); boolean searchForEntity(String _entityUniqueName, Node astRoot); }
ASTSignatureComparator implements SignatureComparator { @Override public SignatureChange computeChange(Signature _a, Signature _b) { SignatureChange astChange = new ASTSignatureChange(_a, _b); astChange.getModifications(); return astChange; } ASTSignatureComparator();  ASTSignatureComparator(double stringSimilarity); @Override float computeSimilarity(Signature _a, Signature _b); @Override SignatureChange computeChange(Signature _a, Signature _b); int getTotalNumChanges(); int getMatchedNumChanges(); @Override boolean containsChange(Signature _s, SignatureChange _change); double getStringSimilarityThreshold(); void setStringSimilarityThreshold(double _threshold); Node searchForNode(SourceCodeChange change, Node astRoot); boolean searchForEntity(SourceCodeChange change, Node astRoot); boolean searchForEntity(String _entityUniqueName, Node astRoot);  }