public CoverageDataContainer() { initLock(); }
/** * @return The number of children in this container. */ public int getNumberOfChildren() { synchronizeState(); lock.lock(); try { return this.children.size(); } finally { lock.unlock(); } }
/** * Returns true if the given object is an instance of the * PackageData class, and it contains the same data as this * class. */ public boolean equals(Object obj) { if (this == obj) return true; if ((obj == null) || !(obj.getClass().equals(this.getClass()))) return false; PackageData packageData = (PackageData) obj; getBothLocks(packageData); try { return super.equals(obj) && this.name.equals(packageData.name); } finally { lock.unlock(); packageData.lock.unlock(); } }
public void merge(CoverageData coverageData) { if (coverageData == null) { return; } ProjectData projectData = (ProjectData) coverageData; getBothLocks(projectData); try { super.merge(coverageData); for (Iterator iter = projectData.classes.keySet().iterator(); iter .hasNext();) { Object key = iter.next(); if (!this.classes.containsKey(key)) { this.classes.put(key, projectData.classes.get(key)); } } } finally { lock.unlock(); projectData.lock.unlock(); } }
synchronizeState(); CoverageDataContainer container = (CoverageDataContainer) coverageData; container.synchronizeState(); getBothLocks(container); try { Iterator<Object> iter = container.children.keySet().iterator();
getBothLocks(container); try
/** * Returns true if the given object is an instance of the * SourceFileData class, and it contains the same data as this * class. */ public boolean equals(Object obj) { if (this == obj) return true; if ((obj == null) || !(obj.getClass().equals(this.getClass()))) return false; SourceFileData sourceFileData = (SourceFileData) obj; getBothLocks(sourceFileData); try { return super.equals(obj) && this.name.equals(sourceFileData.name); } finally { lock.unlock(); sourceFileData.lock.unlock(); } }
public void merge(CoverageData coverageData) { if (coverageData == null) { return; } ProjectData projectData = (ProjectData) coverageData; getBothLocks(projectData); try { super.merge(coverageData); for (Iterator iter = projectData.classes.keySet().iterator(); iter .hasNext();) { Object key = iter.next(); if (!this.classes.containsKey(key)) { this.classes.put(key, projectData.classes.get(key)); } } } finally { lock.unlock(); projectData.lock.unlock(); } }
synchronizeState(); CoverageDataContainer container = (CoverageDataContainer) coverageData; container.synchronizeState(); getBothLocks(container); try { Iterator<Object> iter = container.children.keySet().iterator();
/** * Returns true if the given object is an instance of the * SourceFileData class, and it contains the same data as this * class. */ public boolean equals(Object obj) { if (this == obj) return true; if ((obj == null) || !(obj.getClass().equals(this.getClass()))) return false; SourceFileData sourceFileData = (SourceFileData) obj; getBothLocks(sourceFileData); try { return super.equals(obj) && this.name.equals(sourceFileData.name); } finally { lock.unlock(); sourceFileData.lock.unlock(); } }
public CoverageDataContainer() { initLock(); }
public void merge(CoverageData coverageData) { ProjectData projectData = (ProjectData)coverageData; getBothLocks(projectData); try { super.merge(coverageData); for (Iterator iter = projectData.classes.keySet().iterator(); iter.hasNext();) { Object key = iter.next(); if (!this.classes.containsKey(key)) { this.classes.put(key, projectData.classes.get(key)); } } } finally { lock.unlock(); projectData.lock.unlock(); } }
/** * @return The number of children in this container. */ public int getNumberOfChildren() { synchronizeState(); lock.lock(); try { return this.children.size(); } finally { lock.unlock(); } }
/** * Returns true if the given object is an instance of the * PackageData class, and it contains the same data as this * class. */ public boolean equals(Object obj) { if (this == obj) return true; if ((obj == null) || !(obj.getClass().equals(this.getClass()))) return false; PackageData packageData = (PackageData) obj; getBothLocks(packageData); try { return super.equals(obj) && this.name.equals(packageData.name); } finally { lock.unlock(); packageData.lock.unlock(); } }
public CoverageDataContainer() { initLock(); }
super.merge(coverageData);
/** * It is highly recommended that classes extending this * class override this hashCode method and generate a more * effective hash code. */ public int hashCode() { synchronizeState(); lock.lock(); try { return this.children.size(); } finally { lock.unlock(); } }
/** * Returns true if the given object is an instance of the * ClassData class, and it contains the same data as this * class. */ public boolean equals(Object obj) { if (this == obj) return true; if ((obj == null) || !(obj.getClass().equals(this.getClass()))) return false; ClassData classData = (ClassData) obj; getBothLocks(classData); try { return super.equals(obj) && this.branches.equals(classData.branches) && this.methodNamesAndDescriptors .equals(classData.methodNamesAndDescriptors) && this.name.equals(classData.name) && this.sourceFileName.equals(classData.sourceFileName); } finally { lock.unlock(); classData.lock.unlock(); } }
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); initLock(); } }
super.merge(coverageData);