Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are there some statistics on the most frequently used Java API functions? [closed]

Tags:

java

api

Given a large API (an in particular, the Java or J2EE standard libraries), is there a tool or search engine or other resource that can tells me which methods, classes, or even packages people in general tend to use the most? I am annotating (see below) APIs and would like to focus my attention on popular areas. The only thing I can think of is using google code with different method names but that is of course tedious.

Some background (if anyone is interested): As part of my PhD research I've developed a tool that allows users to highlight important "directives" in method documentation (their own or in existing APIs) and then pushes these annotations to users to increase chances that they become aware of it. Our lab studies show that this has potential, but to get people to use it in the field I have to provide "corpuses" of annotated APIs and I'm trying to prioritize which libraries to annotate.

like image 697
Uri Avatar asked Oct 15 '22 18:10

Uri


2 Answers

I wouldn't know if such statistics are even feasible, but I think a pretty safe bet would be to start with the basics plus some famous third party libraries. For example:

  • Collections
  • Regular Expressions
  • Networking
  • Reflection
  • Swing (and AWT)

As for third parties

  • Joda Time
  • Apache Commons
  • Jetty (Servlet container, but usually embedded)
like image 56
Vinko Vrsalovic Avatar answered Oct 18 '22 13:10

Vinko Vrsalovic


This "simple" bash script will count most used classes in your current project codebase.

find . -name "*.java" | xargs cat | grep "^import java" |  sort | uniq -c | sort -nr | head -100
like image 23
Marko Avatar answered Oct 18 '22 14:10

Marko