Saturday, July 9, 2011

The longest class name in Java

The first thing, that I noticed while working with Spring framework (right after its simplicity, purity, good performance, etc.) is that the designers of the framework didn't bother of creating short and simple names which resulted in a set of VeryLongSelfDescriptiveClassNames.

Curious enough, went throught the core Spring API and found two candidates for the title of "the longest class name in Java", and by the longes class name I mean a class name with no package prefix.

Those two candidates are:

AbstractInterruptibleBatchPreparedStatementSetter
AbstractTransactionalDataSourceSpringContextTests
both containing impressing 50 characters.

However, with Google's help found they're not the winners. The longes class name tends to be:
PreAuthenticatedGrantedAuthoritiesWebAuthenticationDetails
from Spring Security package, which is amazing 59 characters long.

Well self-described code or just a good sense of humor? Both, I guess.

2 comments:

  1. InternalFrameInternalFrameTitlePaneInternalFrameTitlePaneMaximizeButtonWindowNotFocusedState

    92 characters in all. Can be found in com.sun.java.swing.plaf.nimbus :) (may have changed in Java 7).

    ReplyDelete