Skip to content

Commit 7fae83a

Browse files
committed
removed Counter, moved SimpleEntry
1 parent 66c355e commit 7fae83a

4 files changed

Lines changed: 7 additions & 102 deletions

File tree

‎koans-lib/src/com/sandwich/koan/path/PathToEnlightenment.java‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
import com.sandwich.koan.path.xmltransformation.KoanElementAttributes;
1313
import com.sandwich.koan.path.xmltransformation.XmlToPathTransformer;
1414
import com.sandwich.koan.path.xmltransformation.XmlToPathTransformerImpl;
15-
import com.sandwich.util.Counter;
1615
import com.sandwich.util.io.FileUtils;
1716
import com.sandwich.util.io.directories.DirectoryManager;
1817

@@ -87,28 +86,30 @@ public int getTotalNumberOfKoans() {
8786
if(methodName != null){
8887
return 1;
8988
}
90-
Counter total = new Counter();
89+
int total = 0;
9190
Iterator<Entry<String, Map<String, Map<String, KoanElementAttributes>>>> koanMethodsBySuiteByPackageIter =
9291
getKoanMethodsBySuiteByPackage();
9392
while(koanMethodsBySuiteByPackageIter.hasNext()){
9493
Entry<String, Map<String, Map<String, KoanElementAttributes>>> e = koanMethodsBySuiteByPackageIter.next();
9594
for(Entry<String, Map<String, KoanElementAttributes>> e1 : e.getValue().entrySet()){
96-
countKoanAnnotationsInJavaFileGivenClassName(e1.getKey(), total);
95+
total += countKoanAnnotationsInJavaFileGivenClassName(e1.getKey());
9796
}
9897
}
99-
return (int)total.getCount();
98+
return total;
10099
}
101100

102-
private void countKoanAnnotationsInJavaFileGivenClassName(String className, Counter total) {
101+
private int countKoanAnnotationsInJavaFileGivenClassName(String className) {
103102
String[] lines = FileUtils.getContentsOfOriginalJavaFile(className).split(KoanConstants.EOLS);
104103
String koanClassSimpleNameWithAnnotationPrefix = '@'+Koan.class.getSimpleName();
104+
int total = 0;
105105
for(String line : lines){
106106
String trimmedLine = line.trim();
107107
if(trimmedLine.contains(koanClassSimpleNameWithAnnotationPrefix)
108108
&& !trimmedLine.startsWith("//") && !trimmedLine.startsWith("*") && !trimmedLine.startsWith("/*")){
109-
total.count();
109+
total++;
110110
}
111111
}
112+
return total;
112113
}
113114

114115
public Iterator<Entry<String, Map<String, Map<String, KoanElementAttributes>>>> iterator() {

‎koans-lib/src/com/sandwich/util/Counter.java‎

Lines changed: 0 additions & 28 deletions
This file was deleted.

‎koans-lib/src/com/sandwich/util/SimpleEntry.java‎

Lines changed: 0 additions & 68 deletions
This file was deleted.

‎koans/lib/koans.jar‎

-1.76 KB
Binary file not shown.

0 commit comments

Comments
 (0)