/** * Returns the total number of duplicate lines. * * @return the number of duplicate lines */ public int getNumberOfLines() { return getLineRanges().iterator().next().getEnd() - getPrimaryLineNumber() + 1; }
/** * Reads the current value at the cursor and compares it. */ public boolean compare(final LineRange lr) { int s = read(); int d = read(); return lr.getStart() == s && lr.getEnd() == s + d; }
/** * Reads the current value at the cursor and compares it. */ public boolean compare(final LineRange lr) { int s = read(); int d = read(); return lr.getStart() == s && lr.getEnd() == s + d; }
private void write(final LineRange r) { write(r.getStart()); write(r.getEnd() - r.getStart()); }
private int sizeOf(final LineRange v) { return sizeOf(v.getStart()) + sizeOf(v.getEnd() - v.getStart()); }
private void write(final LineRange r) { write(r.getStart()); write(r.getEnd() - r.getStart()); }
private int sizeOf(final LineRange v) { return sizeOf(v.getStart()) + sizeOf(v.getEnd() - v.getStart()); }
while (lineNumber <= range.getEnd()) { copyLine(output, lineIterator); lineNumber++;
while (lineNumber <= range.getEnd()) { copyLine(output, lineIterator); lineNumber++;
/** * Verifies the created project. * * @param project the created project */ @SuppressWarnings("PMD") protected void verifyProject(final JavaProject project) { assertTrue(project.hasAnnotations()); checkSummary(project); assertTrue(MODULE_NOT_IN_PROJECT, project.containsModule(MODULE1)); assertTrue(MODULE_NOT_IN_PROJECT, project.containsModule(MODULE2)); checkFirstModule(project.getModule(MODULE1)); checkSecondModule(project.getModule(MODULE2)); for (FileAnnotation annotation : project.getModule(MODULE2).getAnnotations()) { assertEquals("Wrong primary line number.", LINE_NUMBER, annotation.getPrimaryLineNumber()); Collection<LineRange> lineRanges = annotation.getLineRanges(); assertEquals("Wrong number of ranges.", 1, lineRanges.size()); LineRange range = lineRanges.iterator().next(); assertEquals("Wrong start line number.", LINE_NUMBER, range.getStart()); assertEquals("Wrong end line number.", LINE_NUMBER, range.getEnd()); assertEquals("Wrong package prefix.", Messages.PackageDetail_header(), project.getModule(MODULE2).getPackageCategoryName()); assertSame(annotation, project.getAnnotation(annotation.getKey())); assertSame(annotation, project.getAnnotation(Long.toString(annotation.getKey()))); } }
/** * Verifies the created project. * * @param project the created project */ @SuppressWarnings("PMD") protected void verifyProject(final JavaProject project) { assertTrue(project.hasAnnotations()); checkSummary(project); assertTrue(MODULE_NOT_IN_PROJECT, project.containsModule(MODULE1)); assertTrue(MODULE_NOT_IN_PROJECT, project.containsModule(MODULE2)); checkFirstModule(project.getModule(MODULE1)); checkSecondModule(project.getModule(MODULE2)); for (FileAnnotation annotation : project.getModule(MODULE2).getAnnotations()) { assertEquals("Wrong primary line number.", LINE_NUMBER, annotation.getPrimaryLineNumber()); Collection<LineRange> lineRanges = annotation.getLineRanges(); assertEquals("Wrong number of ranges.", 1, lineRanges.size()); LineRange range = lineRanges.iterator().next(); assertEquals("Wrong start line number.", LINE_NUMBER, range.getStart()); assertEquals("Wrong end line number.", LINE_NUMBER, range.getEnd()); assertEquals("Wrong package prefix.", Messages.PackageDetail_header(), project.getModule(MODULE2).getPackageCategoryName()); assertSame(annotation, project.getAnnotation(annotation.getKey())); assertSame(annotation, project.getAnnotation(Long.toString(annotation.getKey()))); } }
if (annotation.isInConsoleLog()) { LineRange lines = annotation.getLineRanges().iterator().next(); return new ConsoleDetail(owner, lines.getStart(), lines.getEnd());
if (annotation.isInConsoleLog()) { LineRange lines = annotation.getLineRanges().iterator().next(); return new ConsoleDetail(owner, lines.getStart(), lines.getEnd());