From 9f6f40fca68053d796a1d28db6deffc4516da835 Mon Sep 17 00:00:00 2001 From: boccioli_m Date: Mon, 8 Jun 2015 09:33:47 +0200 Subject: [PATCH] Closedown --- plugins/TestingList.java | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/plugins/TestingList.java b/plugins/TestingList.java index 7e714e1..208aa2c 100644 --- a/plugins/TestingList.java +++ b/plugins/TestingList.java @@ -86,33 +86,32 @@ public class TestingList extends Panel { int COL_SUCCESS = 4; txtOutput.setText(res); - boolean bDeviceFound = false, bTestFound = false; - int rowD, colT, colD; + int rowD=-1, colT=-1; //search for device name in table - for (rowD = 0; rowD <= jTable1.getRowCount() - 1; rowD++) { + for (int row = 0; row <= jTable1.getRowCount() - 1; row++) { - for (colD = 0; colD <= jTable1.getColumnCount() - 1; colD++) { + for (int col = 0; col <= jTable1.getColumnCount() - 1; col++) { - if (deviceName.equals(jTable1.getValueAt(rowD, colD))) { - - bDeviceFound = true; + if (deviceName.equals(jTable1.getValueAt(row, col))) { + rowD = row; break; } } } - if (bDeviceFound){ + if (rowD>0){ //search for test name in table - for (colT = 0; colT <= jTable1.getColumnCount() - 1; colT++) { + for (int col = 0; col <= jTable1.getColumnCount() - 1; col++) { - if (testName.equals(jTable1.getValueAt(rowD, colT))) { - - bTestFound = true; + if (testName.equals(jTable1.getValueAt(rowD, col))) { + colT = col; break; } } } - jTable1.setValueAt(res, rowD, COL_RESULT); - jTable1.setValueAt(success, rowD, COL_SUCCESS); + if(colT>0 && rowD>0){ + jTable1.setValueAt(res, rowD, COL_RESULT); + jTable1.setValueAt(success, rowD, COL_SUCCESS); + } } // //GEN-BEGIN:initComponents