public ConstructChange(String _repo, String _repo_path, Construct _def, Construct _fix, String _rev, String _time_stamp) { if(_def==null && _fix==null) throw new IllegalArgumentException("At least one construct must be provided (defective, fixed or both)"); this.repo = _repo; this.repoPath = _repo_path; this.def = _def; this.fix = _fix; this.commit = (_rev!=null&&_rev.contains(":"))?_rev.substring(0,_rev.indexOf(":")-1):_rev; this.committedAt = _time_stamp; // Signatures of the defective and fixed constructs (if any, can be null) and the so-called signature change final SignatureFactory factory = CoreConfiguration.getSignatureFactory( com.sap.psr.vulas.ConstructId.toSharedType( (_def!=null ? _def.getId() : _fix.getId()) )); if(factory!=null) { defSignature = factory.createSignature(def); fixSignature = factory.createSignature(fix); signatureChange = factory.computeChange(def, fix); } }
SignatureFactory sf = CoreConfiguration.getSignatureFactory(JavaId.toSharedType(jid)); ASTConstructBodySignature sign = (ASTConstructBodySignature)sf.createSignature(JavaId.toSharedType(jid), file.toFile());
SignatureFactory sf = CoreConfiguration.getSignatureFactory(JavaId.toSharedType(jid)); SignatureFactory sf = CoreConfiguration.getSignatureFactory(pid); sign = (PythonConstructDigest)sf.createSignature(fa.getConstructs().get(c)); break;