Skip to content

Instantly share code, notes, and snippets.

@SegFaultAX
Last active December 23, 2015 01:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SegFaultAX/6563909 to your computer and use it in GitHub Desktop.
Save SegFaultAX/6563909 to your computer and use it in GitHub Desktop.
Long classnames in Java/Spring are long...
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
@gdeer81
Copy link

gdeer81 commented Sep 14, 2013

ATG 10.0.2 e-commerce platform
with url:
http://docs.oracle.com/cd/E22630_01/Platform.1002/apidoc/allclasses-noframe.html

results:

AddressVerificationTaxProcessorTaxCalculator
ProcValidateHandlingInstructionsForCheckout
B2BShippingGroupRelationshipContainerImpl
ProcHandleShippingGroupUpdateModification
B2BCommerceItemRelationshipContainerImpl
DisqualifyRemovedItemClosenessQualifiers
ValidatedBusinessProcessGrammarExtension
InventoryAvailabilityPropertyDescriptor
ProcRemoveShipItemRelsFromShippingGroup
ProcSplitShippingGroupForAvailableItems

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment