ASTSignatureComparator implements SignatureComparator { public boolean searchForEntity(SourceCodeChange change, Node astRoot) { SourceCodeEntity parentEntity = change.getParentEntity(); String _entityUniqueName = change.getChangedEntity().getUniqueName(); String nodeValue = astRoot.getValue().toString(); if (nodeValue.equals(_entityUniqueName)) { return true; } boolean found = false; for (int i = 0; (found == false) && (i < astRoot.getChildCount()); i++) { Node node = (Node) astRoot.getChildAt(i); String nodeLbl = node.getValue().toString(); found = searchForEntity(_entityUniqueName, node); if (found) break; } return found; } 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);  }
@Test @Ignore public void testSearchForEntity() { final ASTSignatureComparator signComparator = new ASTSignatureComparator(); final boolean found = signComparator.searchForEntity( "this.boundary = new byte[(boundary.length + BOUNDARY_PREFIX.length)];", ((ASTSignature) signatureDef).getRoot()); assertTrue(found); }