My Top 20 java classes
I was a bit curious as to which Java classes I used most often so I figured I count them. Instead of counting each individual use I decided that I'd just count the number of times a class was imported. Here's the command line:
$ find . -name "*.java" | xargs cat | grep "^import java" |\ sort | uniq -c | sort -nr | head -20I ran this on the 100,000 lines or so of code that make up Sphinx-4 with the following results:
122 import java.io.IOException; 108 import java.util.List; 101 import java.util.Iterator; 62 import java.util.Map; 50 import java.util.HashMap; 50 import java.net.URL; 48 import java.util.ArrayList; 42 import java.util.logging.Logger; 41 import java.io.File; 37 import java.util.LinkedList; 33 import java.util.Set; 28 import java.util.HashSet; 26 import java.io.InputStream; 23 import java.util.Collections; 22 import java.util.logging.Level; 22 import java.io.BufferedReader; 21 import java.util.Properties; 21 import java.io.Serializable; 20 import java.util.StringTokenizer; 20 import java.util.Collection;
I was surpised to see IOException on top of the list, but the rest confirmed what I expected, that the Collections api dominates. The Collections API is my friend.
Posted by Sumit on September 11, 2004 at 01:49 PM EDT #
Posted by Siamak on September 21, 2004 at 06:42 AM EDT #