Buggy code:
protected BundleActivator activatorInstance ; private String [ ] classpath ; private Map < String , String > nativeLibraries ; List < BundleImpl . Revision > fragments ; private final String [ ] classpathStrings ; private final short fragmentAttachmentPolicy ; private ConciergeBundleWiring wiring ; private HashMap < String , BundleWire > packageImportWires ; private List < BundleWire > requireBundleWires ; private final HashSet < String > exportIndex ; protected Revision ( final int revId , final Manifest manifest , final String [ ] classpathStrings ) throws BundleException { } protected void refresh ( ) { } private MultiMap < String , BundleRequirement > parseRequirements ( final String str ) throws BundleException { } private MultiMap < String , BundleCapability > parseCapabilities ( final String str ) throws BundleException { } private HashSet < String > createExportIndex ( ) { } protected boolean isFragment ( ) { } protected boolean isCurrent ( ) { } public Bundle getBundle ( ) { } public String getSymbolicName ( ) { } public Version getVersion ( ) { } public List < BundleCapability > getDeclaredCapabilities ( final String namespace ) { } public List < BundleRequirement > getDeclaredRequirements ( final String namespace ) { } public int getTypes ( ) { } public BundleWiring getWiring ( ) { } public List < Capability > getCapabilities ( final String namespace ) { } public List < Requirement > getRequirements ( final String namespace ) { } protected boolean resolve ( final boolean critical ) throws BundleException { } protected boolean resolveMetadata ( final boolean critical ) throws BundleException { } private boolean isSingleton ( ) { } @ SuppressWarnings ( "unused" ) private boolean isFrameworkExtension ( ) { } private boolean processNativeLibraries ( final String [ ] nativeStrings ) throws BundleException { } void cleanup ( final boolean uninstall ) { } void markResolved ( ) { } void setWiring ( final ConciergeBundleWiring wiring ) { } ConciergeBundleWiring addAdditionalWires ( final List < Wire > wires ) { } Tuple < String , String > getFragmentHost ( ) { } final boolean allowsFragmentAttachment ( ) { } final boolean checkFragment ( final BundleImpl . Revision fragment ) { } boolean attachFragment ( final BundleImpl . Revision fragment ) throws BundleException { } private < T extends Requirement > void checkConflicts ( final List < T > list1 , final List < T > list2 , final String namespace , final String s ) throws BundleException { } private Object checkActivationChain ( final Object result ) { } public String toString ( ) { } protected Enumeration < URL > findEntries ( final String path , final String filePattern , final boolean recurse ) { } protected abstract URL lookupFile ( final String classpath , final String filename ) throws IOException { } protected abstract Vector < URL > searchFiles ( final String path , final String filePattern , boolean recurse , final boolean paths ) { } protected abstract InputStream retrieveFile ( final String classpath , final String filename ) throws IOException { } URL createURL ( final String name1 , final String fragment ) throws MalformedURLException { } class BundleClassLoader extends ClassLoader implements BundleReference { public BundleClassLoader ( ) { } public final Class < ? > loadClass ( final String name ) throws ClassNotFoundException { } protected final Class < ? > findClass ( final String name ) throws ClassNotFoundException { } @ Override public Enumeration < URL > getResources ( final String name ) { } public URL getResource ( final String name ) { } public Bundle getBundle ( ) { } protected URL findResource ( final String name ) { } protected Enumeration < URL > findResources ( final String name ) { final String strippedName = BundleImpl . stripTrailing ( name ) ; try { @ SuppressWarnings ( "unchecked" ) final Vector < URL > results = ( ( Vector < URL > ) ( findResource0 ( BundleImpl . packageOf ( BundleImpl . pseudoClassname ( strippedName ) ) , strippedName , false , true ) ) ) ; <START_BUG> return results . isEmpty ( ) ? null : results . elements ( ) ; <END_BUG> } catch ( final ClassNotFoundException e ) { e . printStackTrace ( ) ; return null ; } } private synchronized Object findResource0 ( final String pkg , final String name , final boolean isClass , final boolean multiple ) throws ClassNotFoundException { } private synchronized Object findResource1 ( final String pkg , final String name , final boolean isClass , final boolean multiple , final Vector < URL > resources ) throws ClassNotFoundException { } protected String findLibrary ( final String libname ) { } private synchronized Class < ? > findOwnClass ( final String classname ) { } private Object dexFile = null ; private Class < ? > findDexClass ( final String classname ) { } Object findOwnResources ( final String name , final boolean useFragments , final boolean multiple , final Vector < URL > resources ) { } private Object requireBundleLookup ( final String pkg , final String name , final boolean isClass , final boolean multiple , final Vector < URL > resources , final Set < Bundle > visited ) { } } class WovenClassImpl implements WovenClass { private final String clazzName ; private byte [ ] bytes ; private boolean weavingComplete ; private Class < ? > clazz ; private List < String > dynamicImports ; private List < BundleRequirement > dynamicImportRequirements ; private ProtectionDomain domain ; WovenClassImpl ( final String clazzName , final byte [ ] bytes , final BundleImpl . Revision revision , final ProtectionDomain domain ) { } public byte [ ] getBytes ( ) { } public void setBytes ( final byte [ ] newBytes ) { } public List < String > getDynamicImports ( ) { } public boolean isWeavingComplete ( ) { } public String getClassName ( ) { } public ProtectionDomain getProtectionDomain ( ) { }

Fix:
return ( results == null ) || ( results . isEmpty ( ) ) ? null : results . elements ( ) ;