@ CheckForNull private static String resolvePluginClassesDir ( String bundleName , File sourceDir ) { if ( sourceDir . listFiles ( ) == null ) { FindbugsPlugin . getDefault ( ) . logException ( new IllegalStateException ( "No files in the bundle!" ) , "Failed to create temporary detector package for bundle " + sourceDir ) ; return null ; } String outputDir = getBuildDirectory ( bundleName , sourceDir ) ; if ( outputDir . length ( ) == 0 ) { FindbugsPlugin . getDefault ( ) . logException ( new IllegalStateException ( "No output directory in build.properties" ) , "No output directory in build.properties " + sourceDir ) ; return null ; } File classDir = new File ( sourceDir , outputDir ) ; if ( classDir . listFiles ( ) == null ) { FindbugsPlugin . getDefault ( ) . logException ( new IllegalStateException ( "No files in the bundle output dir!" ) , "Failed to create temporary detector package for bundle " + sourceDir ) ; return null ; } File etcDir = new File ( sourceDir , "etc" ) ; if ( etcDir . listFiles ( ) == null ) { FindbugsPlugin . getDefault ( ) . logException ( new IllegalStateException ( "No files in the bundle etc dir!" ) , "Failed to create temporary detector package for bundle " + sourceDir ) ; return null ; } return classDir . getAbsolutePath ( ) ; }
Used for Eclipse instances running inside debugger . During development Eclipse plugins are just directories . The code below tries to locate plugin s bin directory . It doesn t work if the plugin build . properties are not existing or contain invalid content