Index: trunk/CrossPare/src/de/ugoe/cs/cpdp/dataprocessing/CLAMIProcessor.java
===================================================================
--- trunk/CrossPare/src/de/ugoe/cs/cpdp/dataprocessing/CLAMIProcessor.java	(revision 42)
+++ trunk/CrossPare/src/de/ugoe/cs/cpdp/dataprocessing/CLAMIProcessor.java	(revision 43)
@@ -138,4 +138,9 @@
         int violationCutoff = violationCountInterator.next();
         // now we filter the data;
+        // this is first tried with the metrics with fewest violations. if no buggy/bugfree
+        // instances remain, this is repeated with the next metrics with second fewest violations,
+        // and so on.
+        // this part is a bit unclear from the description in the paper, but I confirmed with the
+        // author that this is how they implemented it
         boolean[] cleanInstances = new boolean[data.numInstances()];
         int numCleanBuggyInstances = 0;
@@ -150,5 +155,5 @@
                 Instance currentInstance = data.get(i);
                 for (int j = 0; j < data.numAttributes(); j++) {
-                    if (j != data.classIndex() && numMetricViolations[j] <= violationCutoff) {
+                    if (j != data.classIndex() && numMetricViolations[j] == violationCutoff) {
                         if (clusterNumber[i] > medianClusterNumber) {
                             // "buggy"
@@ -180,17 +185,17 @@
         }
         while (numCleanBuggyInstances == 0 || numCleanBugfreeInstances == 0);
-        
+
         // output some interesting information to provide insights into the CLAMI model
         Console.traceln(Level.FINE, "Selected Metrics and Median-threshold: ");
-        for( int j=0 ; j<data.numAttributes(); j++) {
-            if( j!=data.classIndex() && numMetricViolations[j]<=violationCutoff ) {
+        for (int j = 0; j < data.numAttributes(); j++) {
+            if (j != data.classIndex() && numMetricViolations[j] == violationCutoff) {
                 Console.traceln(Level.FINE, "\t" + data.attribute(j).name() + ": " + medians[j]);
             }
         }
-        
+
         // finally modify the instances
         // drop the metrics (also from the testdata)
         for (int j = data.numAttributes() - 1; j >= 0; j--) {
-            if (j != data.classIndex() && numMetricViolations[j] > violationCutoff) {
+            if (j != data.classIndex() && numMetricViolations[j] != violationCutoff) {
                 data.deleteAttributeAt(j);
                 testdata.deleteAttributeAt(j);
