CPD Results

The following document contains the results of PMD's CPD 6.53.0.

Duplications

File Line
com/avcompris/util/junit/AvcFileAssert.java 121
com/avcompris/util/junit/AvcFileAssert.java 361
public static void assertRegexpEquals(final File refFile, final File file) throws IOException {

		assertContentComparison(refFile, file, new ContentComparisonCallback() {

			@Override
			public void assertContentEquals(final BufferedReader refBr, final BufferedReader br) throws IOException {

				for (int lineCount = 1;; ++lineCount) {

					final String refLine = refBr.readLine();
					final String line = br.readLine();

					if (refLine == null && line == null) {
						break;
					}

					if (refLine == null) {
						fail(lineCount + ", expected: <EOF>, but was: <" + line + ">");
					}

					if (line == null) {
						fail(lineCount + ", expected: <" + refLine + ">, but was: <EOF>");
					}

					if (refLine.equals(line)) {
						continue;
					}

					if (refLine.contains("\\")) {
File Line
com/avcompris/util/reflect/AbstractLog4JLoggerTest.java 113
com/avcompris/util/reflect/AbstractNonNullTest.java 736
final Class<?>... targets) throws ClassNotFoundException {

		// declared classes

		final Collection<Object[]> params = parametersDoNotScanProject(targets);

		// add all sources

		final File sourceDir = new File("src/main/java");

		final Class<?>[] fileClasses = loadFileClasses(sourceDir);

		for (final Class<?> fileClass : fileClasses) {

			// add only sources that were not declared

			boolean foundInTargets = false;

			for (final Object target : targets) {

				if (target instanceof Class<?>) {

					if (fileClass.equals(target)) {

						foundInTargets = true;

						break;
					}

				} else {

					if (fileClass.equals(target.getClass())) {

						foundInTargets = true;

						break;
					}
				}
			}

			if (!foundInTargets && !fileClass.isInterface()) {

				addToTests(params, fileClass);
File Line
com/avcompris/util/junit/AvcFileAssert.java 50
com/avcompris/util/junit/AvcFileAssert.java 121
com/avcompris/util/junit/AvcFileAssert.java 361
public static void assertTextEquals(final File refFile, final File file) throws IOException {

		assertContentComparison(refFile, file, new ContentComparisonCallback() {

			@Override
			public void assertContentEquals(final BufferedReader refBr, final BufferedReader br) throws IOException {

				for (int lineCount = 1;; ++lineCount) {

					final String refLine = refBr.readLine();
					final String line = br.readLine();

					if (refLine == null && line == null) {
						break;
					}

					if (refLine == null) {
						fail(lineCount + ", expected: <EOF>, but was: <" + line + ">");
					}

					if (line == null) {
						fail(lineCount + ", expected: <" + refLine + ">, but was: <EOF>");
					}

					if (refLine.equals(line)) {
						continue;
					}
File Line
com/avcompris/util/junit/AvcFileAssert.java 121
com/avcompris/util/junit/AvcFileAssert.java 246
public static void assertRegexpEquals(final File refFile, final File file) throws IOException {

		assertContentComparison(refFile, file, new ContentComparisonCallback() {

			@Override
			public void assertContentEquals(final BufferedReader refBr, final BufferedReader br) throws IOException {

				for (int lineCount = 1;; ++lineCount) {

					final String refLine = refBr.readLine();
					final String line = br.readLine();

					if (refLine == null && line == null) {
						break;
					}

					if (refLine == null) {
						fail(lineCount + ", expected: <EOF>, but was: <" + line + ">");
					}

					if (line == null) {
						fail(lineCount + ", expected: <" + refLine + ">, but was: <EOF>");
					}

					if (refLine.equals(line)) {
						continue;
					}

					if (refLine.contains("\\")) {
File Line
com/avcompris/util/junit/AvcFileAssert.java 246
com/avcompris/util/junit/AvcFileAssert.java 361
public static void assertProcessedEquals(final File refFile, final File file, @Nullable final Properties properties)
			throws IOException {

		assertContentComparison(refFile, file, new ContentComparisonCallback() {

			@Override
			public void assertContentEquals(final BufferedReader refBr, final BufferedReader br) throws IOException {

				for (int lineCount = 1;; ++lineCount) {

					final String refLine = refBr.readLine();
					final String line = br.readLine();

					if (refLine == null && line == null) {
						break;
					}

					if (refLine == null) {
						fail(lineCount + ", expected: <EOF>, but was: <" + line + ">");
					}

					if (line == null) {
						fail(lineCount + ", expected: <" + refLine + ">, but was: <EOF>");
					}

					if (refLine.equals(line)) {
						continue;
					}

					if (refLine.contains("${")) {
File Line
com/avcompris/util/junit/AvcFileAssert.java 50
com/avcompris/util/junit/AvcFileAssert.java 246
public static void assertTextEquals(final File refFile, final File file) throws IOException {

		assertContentComparison(refFile, file, new ContentComparisonCallback() {

			@Override
			public void assertContentEquals(final BufferedReader refBr, final BufferedReader br) throws IOException {

				for (int lineCount = 1;; ++lineCount) {

					final String refLine = refBr.readLine();
					final String line = br.readLine();

					if (refLine == null && line == null) {
						break;
					}

					if (refLine == null) {
						fail(lineCount + ", expected: <EOF>, but was: <" + line + ">");
					}

					if (line == null) {
						fail(lineCount + ", expected: <" + refLine + ">, but was: <EOF>");
					}

					if (refLine.equals(line)) {
						continue;
					}