* @param factory the source factory containing the information needed to create the cache
* @return the cache that was created
*/
protected AnalysisCache createCacheFromSourceFactory(SourceFactory factory) {
if (factory == null) {
return new AnalysisCache(new CachePartition[] {privatePartition});
}
DartSdk sdk = factory.getDartSdk();
if (sdk == null) {
return new AnalysisCache(new CachePartition[] {privatePartition});
}
return new AnalysisCache(new CachePartition[] {
AnalysisEngine.getInstance().getPartitionManager().forSdk(sdk), privatePartition});
}