CPD Results

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

Duplications

FileLine
org\fosstrak\hal\impl\impinj\ImpinjTCPIPController.java234
org\fosstrak\hal\impl\impinj\ImpinjTCPIPController.java1589
               len = ids_vec_arr[i].size();
               String[] ids_arr = new String[len];
               ids_arr = ids_vec_arr[i].toArray(ids_arr);
               TagDescriptor[] td_arr = new TagDescriptor[ids_arr.length];
               for (int j = 0; j < td_arr.length; j++) {
   					IDType idType = IDType.getIdType("EPC",
   							config.getString("idTypesConfig"));
                  EPCTransponderModel tagModel = currentInventory.get(ids_arr[j]).
                     epcTransponderModel;
                  MemoryBankDescriptor[] memoryBankDescriptors =
                     new MemoryBankDescriptor[4];
                  memoryBankDescriptors[0] = new MemoryBankDescriptor(
                     tagModel.getReservedSize(), tagModel.getReservedReadable(),
                     tagModel.getReservedWriteable());
                  memoryBankDescriptors[1] = new MemoryBankDescriptor(
                        tagModel.getEpcSize(), tagModel.getEpcReadable(),
                        tagModel.getEpcWriteable());
                  memoryBankDescriptors[2] = new MemoryBankDescriptor(
                        tagModel.getTidSize(), tagModel.getTidReadable(),
                        tagModel.getTidWriteable());
                  memoryBankDescriptors[3] = new MemoryBankDescriptor(
                        tagModel.getUserSize(), tagModel.getUserReadable(),
                        tagModel.getUserWriteable());
                  MemoryDescriptor memoryDescriptor = new MemoryDescriptor(
                        memoryBankDescriptors);
                  td_arr[j] = new TagDescriptor(idType, memoryDescriptor);
               }
               observations[i].setTagDescriptors(td_arr);
               observations[i].setIds(ids_arr);
               observations[i].setTimestamp(System.currentTimeMillis());

FileLine
org\fosstrak\hal\impl\impinj\ImpinjTCPIPController.java1029
org\fosstrak\hal\impl\impinj\ImpinjTCPIPController.java1682
            byte[] iacr = new byte[] { 0x00, 0x03, 0x01 };
            c = new Frame(Frame.Type.COMMAND, Frame.Category.OPERATING_MODEL,
                  0x1E, iacr);
            r = tcpip.sendRequest(c);
            if (r.getData()[0] != 0x00) {
               throw new HardwareException("Could not enable "
                     + "InventoryAttemptCount reporting.");
            }

            // inventory command (read TID during inventory)
            byte[] data = new byte[] { 0x0c, 0x02, 0x0d, 0x00, 0x00, 0x0e, 0x02 };
            c = new Frame(Frame.Type.COMMAND, Frame.Category.OPERATING_MODEL,
                  0x13, data);
            r = tcpip.sendRequest(c);
            if (r.getData()[0] != 0x00) {
               throw new HardwareException("Inventory command failed, " +
                     "ResultCode: " + r.getData()[0] + ".");
            }

FileLine
org\fosstrak\hal\impl\impinj\ImpinjTCPIPController.java1259
org\fosstrak\hal\impl\impinj\ImpinjTCPIPController.java1355
            }
            /*antenna = params.getParameter(0x04)[0] & 0xFF;
            for (int i = 0; i < 4; i++) {
               if (((antenna >> i) & 0x01) > 0x00) {
                  antenna = i + 1;
                  break;
               }
            }*/
            break;
         case 0x0102:
            // InventoryStatusNtf
            params = new FrameParameters(n.getData(),
               new FrameParametersSpec(FrameParametersSpec.
               InventoryStatusNtf));
            if ((params.getParameter(0x0100)[0] & 0xFF) != 0x00) {
               // transmitter enabled, more params available
               iac = params.getParameter(0x03);
               roundcount = ((iac[0] & 0xFF) << 8) | (iac[1] & 0xFF);
            }
            break;
         default:
            // omit other notifications
            break;
         }

      } while ((roundcount < MUX_ROUNDS) && !halted);

      if (!halted) {
         // stop the inventory
         stopModem();
         throw new IOException("EPC not found in inventory.");
      }