CPD Results

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

Duplications

FileProjectLine
org/nongnu/pulsefire/device/flash/avr/Stk500Controller.javapulsefire-device-flash48
org/nongnu/pulsefire/device/flash/avr/Stk500v2Controller.javapulsefire-device-flash71
	public FlashMessage sendFlashMessage(FlashMessage message) throws IOException {
		if (message==null) {
			throw new NullPointerException("Can't send null message");
		}
		if (message.getRequest().isEmpty()) {
			throw new IllegalArgumentException("Can't send empty message");
		}
		StringBuilder buf = new StringBuilder(30);
		for (Integer data:message.getRequest()) {
			output.write(data);
			output.flush();
			
			String hex = Integer.toHexString(data);
			if (hex.length()==1) {
				hex = "0"+hex;
			}
			if (hex.startsWith("ffffff")) {
				hex = hex.substring(6);
			}
			buf.append(hex);
		}
		output.flush();
		if (logDebug) {
			logMessage("Send data: "+buf+" ("+Stk500v2Command.valueOfToken(message.getRequest().get(5))+")");
FileProjectLine
org/nongnu/pulsefire/device/flash/avr/Stk500Controller.javapulsefire-device-flash287
org/nongnu/pulsefire/device/flash/avr/Stk500v2Controller.javapulsefire-device-flash329
				for (int ii=3;ii<flash.getResponse().size()-1;ii++) {
					Integer data = flash.getResponse().get(ii);
					readBytes.add(data);
				}
			}
			logMessage("Verify flash data...");
			for (int ii=0;ii<flashControllerConfig.getFlashData().length;ii++) {
				byte burnData = flashControllerConfig.getFlashData()[ii];
				if (ii>readBytes.size()) {
					throw new FlashException("Missing backread bytes to verify");
				}
				byte readData = readBytes.get(ii).byteValue();
				if (burnData!=readData) {
					throw new FlashException("Mismatch on address: "+Integer.toHexString(ii)+" expected: "+Integer.toHexString(burnData)+" got: "+Integer.toHexString(readData));
				}
			}
			logMessage("Verified "+readBytes.size()+" bytes flash oke.");
		}
FileProjectLine
org/nongnu/pulsefire/device/ui/components/JMalEditor.javapulsefire-device-ui533
org/nongnu/pulsefire/device/ui/components/JMalEditor.javapulsefire-device-ui588
					for (ExtOpIf op:ExtOpIf.values()) {
						extOpComboBox.addItem(op.getCharCode());
					}
					extOpComboBox.setSelectedIndex(cmd.getExtOp());
					add(extOpComboBoxLabel);
					add(extOpComboBox);
					switch (cmd.getValueType()) {
					case RAW_VALUE:
						valueRawTextField.setText(""+cmd.getCmdArgu());
						add(valueRawTextFieldLabel);
						add(valueRawTextField);
						break;
					case PROG_VALUE:
						progIdxBox.setSelectedItem(cmd.getVarIndex());
						add(progIdxBoxLabel);
						add(progIdxBox);
						break;
					case PF_VALUE:
						valueCommandBox.setSelectedItem(CommandName.valueOfMapIndex(cmd.getCmdArgu()));
						add(valueCommandBoxLabel);
						add(valueCommandBox);
						break;
					case PF_VALUE_SET:
						varIdxBox.setSelectedItem(cmd.getVarIndex());
						add(varIdxBoxLabel);
						add(varIdxBox);
						break;
					}