synchronized void initialize ( ) throws IOException { if ( initialized ) { return ; } final boolean traceLogging = log . isLoggable ( Level . FINEST ) ; final boolean entryExitLogging = log . isLoggable ( Level . FINER ) ; final String methodName = "initialize" ; //$NON-NLS-1$ if ( entryExitLogging ) { log . entering ( DependencyList . class . getName ( ) , methodName ) ; } // A call to getDeclaredDependencies is made to ensure that the time stamp calculated to mark the beginning of finding the expanded //dependencies is done only after forming the dependency map is completed. aggr . getDependencies ( ) . getDelcaredDependencies ( "require" ) ; //$NON-NLS-1$ long stamp = aggr . getDependencies ( ) . getLastModified ( ) ; // save time stamp try { explicitDeps = new ModuleDeps ( ) ; expandedDeps = new ModuleDeps ( ) ; if ( traceLogging ) { log . finest ( "dependent features = " + dependentFeatures ) ; //$NON-NLS-1$ } for ( String name : names ) { processDep ( name , explicitDeps , null , new HashSet < String > ( ) , null ) ; } // Now expand the explicit dependencies resolveAliases = true ; for ( Map . Entry < String , ModuleDepInfo > entry : explicitDeps . entrySet ( ) ) { expandDependencies ( entry . getKey ( ) , entry . getValue ( ) , expandedDeps ) ; } expandedDeps . keySet ( ) . removeAll ( IDependencies . excludes ) ; // Resolve feature conditionals based on the specified feature set. This is // necessary because we don't specify features when doing has! plugin branching // so that dependent features that are discovered by has! plugin branching don't // vary based on the specified features. explicitDeps . resolveWith ( features , coerceUndefinedToFalse ) ; expandedDeps . resolveWith ( features , coerceUndefinedToFalse ) ; if ( traceLogging ) { log . finest ( "explicitDeps after applying features: " + explicitDeps ) ; //$NON-NLS-1$ log . finest ( "expandedDeps after applying features: " + expandedDeps ) ; //$NON-NLS-1$ } if ( stamp != aggr . getDependencies ( ) . getLastModified ( ) ) { // if time stamp has changed, that means that dependencies have been // updated while we were processing them. Throw an exception to avoid // caching the response with possibly corrupt dependency info. throw new IllegalStateException ( "" + stamp + "!=" + aggr . getDependencies ( ) . getLastModified ( ) ) ; //$NON-NLS-1$ //$NON-NLS-2$ } } finally { initialized = true ; } if ( entryExitLogging ) { log . exiting ( DependencyList . class . getName ( ) , methodName ) ; } }
Internal method called to resolve dependencies the first time one of the accessor methods is called . This is done in order to make object creation light - weight and to avoid the possibility of throwing an exception in the object constructor .