CPD Results

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

Duplications

File Line
eu\medsea\mimeutil\detector\MagicMimeEntry.java 674
eu\medsea\mimeutil\detector\MagicMimeEntry.java 704
		int found = (int)((bbuf.getShort() & 0xffff) & (int)getMask(typeStr));

		if (operation.equals(MagicMimeEntryOperation.EQUALS)) {
			return found == contentNumber;
		} else if (operation.equals(MagicMimeEntryOperation.NOT_EQUALS)) {
			return found != contentNumber;
		} else if (operation.equals(MagicMimeEntryOperation.GREATER_THAN)) {
			return found > contentNumber;
		} else if (operation.equals(MagicMimeEntryOperation.LESS_THAN)) {
			return found < contentNumber;
		} else if (operation.equals(MagicMimeEntryOperation.AND)) {
			boolean result = (found & contentNumber) == contentNumber;
			return result;
		} else if (operation.equals(MagicMimeEntryOperation.ANY)) {
			return true;
		} else if (operation.equals(MagicMimeEntryOperation.CLEAR)) {
			long maskedFound = found & contentNumber;
			boolean result = (maskedFound ^ contentNumber) == 0;
			return result;
		} else if (operation.equals(MagicMimeEntryOperation.NEGATED)) {
			int negatedFound = ~found;
			return negatedFound == contentNumber;
		} else
			return false;
	}

	private boolean matchLong(ByteBuffer bbuf, ByteOrder bo)

File Line
eu\medsea\mimeutil\detector\MagicMimeEntry.java 674
eu\medsea\mimeutil\detector\MagicMimeEntry.java 734
		long found = (long)((bbuf.getInt() & 0xffffffffL) & getMask(typeStr));

		if (operation.equals(MagicMimeEntryOperation.EQUALS)) {
			return found == contentNumber;
		} else if (operation.equals(MagicMimeEntryOperation.NOT_EQUALS)) {
			return found != contentNumber;
		} else if (operation.equals(MagicMimeEntryOperation.GREATER_THAN)) {
			return found > contentNumber;
		} else if (operation.equals(MagicMimeEntryOperation.LESS_THAN)) {
			return found < contentNumber;
		} else if (operation.equals(MagicMimeEntryOperation.AND)) {
			boolean result = (found & contentNumber) == contentNumber;
			return result;
		} else if (operation.equals(MagicMimeEntryOperation.ANY)) {
			return true;
		} else if (operation.equals(MagicMimeEntryOperation.CLEAR)) {
			long maskedFound = found & contentNumber;
			boolean result = (maskedFound ^ contentNumber) == 0;
			return result;
		} else if (operation.equals(MagicMimeEntryOperation.NEGATED)) {