The Source for Java Technology Collaboration
User: Password:



Scott Schram

Scott Schram's Blog

koders.com Searches Open Source Projects

Posted by scottschram on April 12, 2005 at 04:01 PM | Comments (2)

I recently wanted to write a reusable FilenameFilter class. Before starting, I used the source code search engine at koders.com to research how other people had implemented solutions to a similar problem.

koders.com has indexed over 180,000,000 lines of code in hundreds of open source projects.

This is amazingly handy. Try searching for FilenameFilter. On the first page of results, it's easy to spot some trivial implementations (using endsWith("xml"), for example).

Further down are classes that combine other FilenameFilters with boolean operators: AndFileFilter, OrFileFilter, etc.

There is code from the Jakarta Commons that helps with contruction of filters that act as Swing FileFilter and java.io.FilenameFilter, as well as an example of making a singleton using a static public INSTANCE variable and protected constructors. Very nice.

Clicking on the returned file name lists the colorized code. Clicking on the project name shows the approximate size of the project, an estimated cost to re-implement it from scratch, and the language composition.

Searches may be limited to a given language or license. This could be improved to offer a search for commercial-friendly vs. GPL style licenses.

Koders.com offers an Enterprise Edition for indexing your own company's internal codebase.

As a result of my search, I have decided to include Jakarta Commons IO in my project, and write in that style, leveraging the work that is already there.

Koders.com could also be used when confronting an apparently awkward API to see if anyone has an elegant solution or as a rough guide to the popularity of an API.


Bookmark blog post: del.icio.us del.icio.us Digg Digg DZone DZone Furl Furl Reddit Reddit
Comments
Comments are listed in date ascending order (oldest first) | Post Comment

  • Hi Scott, Hmm, this sounds similars to the JExamples, posted Yesterday here: http://today.java.net/pub/n/JExamples Are these 2 efforts for the same purpose? -- Felipe

    Posted by: felipeal on April 13, 2005 at 06:52 AM

  • They do seem very similar, JExamples seems to have only a few projects, but it looks promising.

    Posted by: scottschram on April 13, 2005 at 08:41 AM





Powered by
Movable Type 3.01D
 Feed java.net RSS Feeds