/** * Subtracts the probes in the given {@link ExecutionData} object from the * store. I.e. for all set probes in the given data object the corresponding * probes in this store will be unset. If there is no execution data with id * of the given data object this operation will have no effect. * * @param data * execution data to subtract * @throws IllegalStateException * if the given {@link ExecutionData} object is not compatible * to a corresponding one, that is already contained * @see ExecutionData#assertCompatibility(long, String, int) */ public void subtract(final ExecutionData data) throws IllegalStateException { final Long id = Long.valueOf(data.getId()); final ExecutionData entry = entries.get(id); if (entry != null) { entry.merge(data, false); } }
public void visitClassExecution(final ExecutionData data) { out.printf("%016x %3d of %3d %s%n", Long.valueOf(data.getId()), Integer.valueOf(getHitCount(data.getProbes())), Integer.valueOf(data.getProbes().length), data.getName()); } });
/** * Adds the given {@link ExecutionData} object into the store. If there is * already execution data with this same class id, this structure is merged * with the given one. * * @param data * execution data to add or merge * @throws IllegalStateException * if the given {@link ExecutionData} object is not compatible * to a corresponding one, that is already contained * @see ExecutionData#assertCompatibility(long, String, int) */ public void put(final ExecutionData data) throws IllegalStateException { final Long id = Long.valueOf(data.getId()); final ExecutionData entry = entries.get(id); if (entry == null) { entries.put(id, data); names.add(data.getName()); } else { entry.merge(data); } }
private static ExecutionData defensiveCopy(ExecutionData data) { boolean[] src = data.getProbes(); boolean[] dest = new boolean[src.length]; System.arraycopy(src, 0, dest, 0, src.length); return new ExecutionData(data.getId(), data.getName(), dest); }
private static ExecutionData defensiveCopy(ExecutionData data) { boolean[] src = data.getProbes(); boolean[] dest = new boolean[src.length]; System.arraycopy(src, 0, dest, 0, src.length); return new ExecutionData(data.getId(), data.getName(), dest); }
private static ExecutionData defensiveCopy(ExecutionData data) { boolean[] src = data.getProbes(); boolean[] dest = new boolean[src.length]; System.arraycopy(src, 0, dest, 0, src.length); return new ExecutionData(data.getId(), data.getName(), dest); }
private static ExecutionData defensiveCopy(ExecutionData data) { boolean[] src = data.getProbes(); boolean[] dest = new boolean[src.length]; System.arraycopy(src, 0, dest, 0, src.length); return new ExecutionData(data.getId(), data.getName(), dest); }
private static ExecutionData defensiveCopy(ExecutionData data) { boolean[] src = data.getProbes(); boolean[] dest = new boolean[src.length]; System.arraycopy(src, 0, dest, 0, src.length); return new ExecutionData(data.getId(), data.getName(), dest); } }
private void copyToAgentExecutionStore(ExecutionDataStore dataStore) throws Exception { Field f = null; try { f = UUID.class.getDeclaredField("$jacocoAccess"); } catch (Exception e) { f = UnknownError.class.getDeclaredField("$jacocoAccess"); } Object executor = f.get(null); Method m = executor.getClass().getDeclaredMethod("getProbes", Object[].class); m.setAccessible(true); for (ExecutionData data : dataStore.getContents()) { Object[] probeData = new Object[] {data.getId(), data.getName(), data.getProbes().length}; m.invoke(executor, new Object[] {probeData}); boolean[] resultData = (boolean[]) probeData[0]; for (int i = 0; i < data.getProbes().length; i++) { if (!resultData[i]) { resultData[i] = data.getProbes()[i]; } } } }
private void copyToAgentExecutionStore(ExecutionDataStore dataStore) throws Exception { Field f = null; try { f = UUID.class.getDeclaredField("$jacocoAccess"); } catch (Exception e) { f = UnknownError.class.getDeclaredField("$jacocoAccess"); } Object executor = f.get(null); Method m = executor.getClass().getDeclaredMethod("getProbes", Object[].class); m.setAccessible(true); for (ExecutionData data : dataStore.getContents()) { Object[] probeData = new Object[] {data.getId(), data.getName(), data.getProbes().length}; m.invoke(executor, new Object[] {probeData}); boolean[] resultData = (boolean[]) probeData[0]; for (int i = 0; i < data.getProbes().length; i++) { if (!resultData[i]) { resultData[i] = data.getProbes()[i]; } } } }
public void visitClassExecution(final ExecutionData data) { if (data.hasHits()) { try { out.writeByte(BLOCK_EXECUTIONDATA); out.writeLong(data.getId()); out.writeUTF(data.getName()); out.writeBooleanArray(data.getProbes()); } catch (final IOException e) { throw new RuntimeException(e); } } }
assertCompatibility(other.getId(), other.getName(), other.getProbes().length); final boolean[] otherData = other.getProbes();
private void executionDataTable(final HTMLElement body) throws IOException { final HTMLElement table = body.table(Styles.COVERAGETABLE); { final HTMLElement tr = table.thead().tr(); tr.td().text("Class"); tr.td().text("Id"); } final HTMLElement tbody = table.tbody(); final ILanguageNames names = context.getLanguageNames(); for (final ExecutionData e : executionData) { final HTMLElement tr = tbody.tr(); final String link = index.getLinkToClass(e.getId()); final String qualifiedName = names.getQualifiedClassName(e .getName()); if (link == null) { tr.td().span(Styles.EL_CLASS).text(qualifiedName); } else { tr.td().a(link, Styles.EL_CLASS).text(qualifiedName); } final String id = String.format("%016x", Long.valueOf(e.getId())); tr.td().code().text(id); } }