public static Collection<com.sap.psr.vulas.shared.json.model.ConstructId> getSharedType(Collection<com.sap.psr.vulas.ConstructId> _c) { final Collection<com.sap.psr.vulas.shared.json.model.ConstructId> c = new HashSet<com.sap.psr.vulas.shared.json.model.ConstructId>(); for(ConstructId cid: _c) c.add(ConstructId.toSharedType(cid)); return c; } }
/** * Maybe promote this method, which uses the shared type as argument, to the interface. * Alternatively, make all core-internal interfaces work with core types, not with shared * types. Example to be changed: SignatureFactory. */ public Construct getConstruct(com.sap.psr.vulas.shared.json.model.ConstructId _id) throws FileAnalysisException { for(ConstructId cid: this.constructs.keySet()) if(ConstructId.toSharedType(cid).equals(_id)) return this.constructs.get(cid); return null; }
/** * Maybe promote this method, which uses the shared type as argument, to the interface. * Alternatively, make all core-internal interfaces work with core types, not with shared * types. Example to be changed: SignatureFactory. */ public Construct getConstruct(com.sap.psr.vulas.shared.json.model.ConstructId _id) throws FileAnalysisException { for(ConstructId cid: this.constructs.keySet()) if(ConstructId.toSharedType(cid).equals(_id)) return this.constructs.get(cid); return null; }
/** * Returns true if construct id and revision are equal. */ @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; final ConstructChange other = (ConstructChange)obj; final ConstructId tc = (this.def!=null ? com.sap.psr.vulas.ConstructId.toSharedType(this.def.getId()) : com.sap.psr.vulas.ConstructId.toSharedType(this.fix.getId())); final ConstructId oc = (other.def!=null ? com.sap.psr.vulas.ConstructId.toSharedType(other.def.getId()) : com.sap.psr.vulas.ConstructId.toSharedType(other.fix.getId())); return (tc.equals(oc) && this.commit.equals(other.commit)); }
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); } }
if(change_lists.get(b).contains(ConstructId.toSharedType(cle))) { if(!paths_per_bug.containsKey(b)) paths_per_bug.put(b, new ArrayList<List<PathNode>>());