Last active
December 23, 2015 01:59
-
-
Save SegFaultAX/6563909 to your computer and use it in GitHub Desktop.
Long classnames in Java/Spring are long...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os.path | |
import lxml.html | |
SPRING_URL = "http://docs.spring.io/spring/docs/3.2.x/javadoc-api/overview-tree.html" | |
SWING_URL = "http://www.cs.rit.edu/usr/local/pub/swm/jdoc6/overview-tree.html" | |
concat = lambda l: [e for v in l for e in v] | |
def longest(url): | |
files = [os.path.basename(f[2]) for f in lxml.html.parse(url).getroot().iterlinks()] | |
print '\n'.join(sorted(concat([f.split(".")[:-1] for f in files]), key=len, reverse=True)[:10]) | |
print "Spring" | |
longest(SPRING_URL) | |
print "\nSwing" | |
longest(SWING_URL) | |
# Result: | |
# Spring | |
# AbstractAnnotationConfigDispatcherServletInitializer | |
# AbstractInterruptibleBatchPreparedStatementSetter | |
# AbstractTransactionalDataSourceSpringContextTests | |
# AbstractInterceptorDrivenBeanDefinitionDecorator | |
# JdbcUpdateAffectedIncorrectNumberOfRowsException | |
# AbstractMessageConverterMethodArgumentResolver | |
# AbstractTransactionalJUnit38SpringContextTests | |
# DelegatePerTargetObjectIntroductionInterceptor | |
# ServletPathExtensionContentNegotiationStrategy | |
# TransactionAwarePersistenceManagerFactoryProxy | |
# Swing | |
# InternalFrameInternalFrameTitlePaneInternalFrameTitlePaneMaximizeButtonWindowNotFocusedState | |
# InternalFrameInternalFrameTitlePaneInternalFrameTitlePaneIconifyButtonWindowNotFocusedState | |
# InternalFrameInternalFrameTitlePaneInternalFrameTitlePaneMaximizeButtonWindowMaximizedState | |
# InternalFrameInternalFrameTitlePaneInternalFrameTitlePaneCloseButtonWindowNotFocusedState | |
# InternalFrameInternalFrameTitlePaneInternalFrameTitlePaneMenuButtonWindowNotFocusedState | |
# InternalFrameInternalFrameTitlePaneInternalFrameTitlePaneMaximizeButtonPainter | |
# InternalFrameInternalFrameTitlePaneInternalFrameTitlePaneIconifyButtonPainter | |
# InternalFrameInternalFrameTitlePaneInternalFrameTitlePaneCloseButtonPainter | |
# InternalFrameInternalFrameTitlePaneInternalFrameTitlePaneMenuButtonPainter | |
# java_beans_beancontext_BeanContextSupport_PersistenceDelegate |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ATG 10.0.2 e-commerce platform
with url:
http://docs.oracle.com/cd/E22630_01/Platform.1002/apidoc/allclasses-noframe.html
results: