public void addRequiredBundles ( Set < String > bundles ) { // TODO manage transitive dependencies // don't require self Set < String > bundlesToMerge ; String bundleName = ( String ) getMainAttributes ( ) . get ( BUNDLE_SYMBOLIC_NAME ) ; if ( bundleName != null ) { int idx = bundleName . indexOf ( ' ' ) ; if ( idx >= 0 ) { bundleName = bundleName . substring ( 0 , idx ) ; } } if ( bundleName != null && bundles . contains ( bundleName ) || projectName != null && bundles . contains ( projectName ) ) { bundlesToMerge = new LinkedHashSet < String > ( bundles ) ; bundlesToMerge . remove ( bundleName ) ; bundlesToMerge . remove ( projectName ) ; } else { bundlesToMerge = bundles ; } String s = ( String ) getMainAttributes ( ) . get ( REQUIRE_BUNDLE ) ; Wrapper < Boolean > modified = Wrapper . wrap ( this . modified ) ; String result = mergeIntoCommaSeparatedList ( s , bundlesToMerge , modified , lineDelimiter ) ; this . modified = modified . get ( ) ; getMainAttributes ( ) . put ( REQUIRE_BUNDLE , result ) ; }
adds the qualified names to the require - bundle attribute if not already present .