*/
break;
case USE_ALL_NEW:
// use all new results, add a new cache entry
cachedResult = new CachedRebindResult(newResult.getReturnedTypeName(),
genCtx.getArtifacts(), genCtx.getGeneratedUnitMap(),
System.currentTimeMillis(), newResult.getClientDataMap());
rebindCachePut(rule, typeName, cachedResult);
break;
case USE_ALL_CACHED:
// use all cached results
assert (cachedResult != null);
genCtx.commitArtifactsFromCache(logger);
genCtx.addGeneratedUnitsFromCache();
// use cached type name
resultTypeName = cachedResult.getReturnedTypeName();
break;
case USE_PARTIAL_CACHED:
/*
* Add cached generated units marked for reuse to the context.
* TODO(jbrosenberg): add support for reusing artifacts as well
* as GeneratedUnits.
*/
genCtx.addGeneratedUnitsMarkedForReuseFromCache();
/*
* Create a new cache entry using the composite set of new and
* reused cached results currently in genCtx.
*/
cachedResult = new CachedRebindResult(newResult.getReturnedTypeName(),
genCtx.getArtifacts(), genCtx.getGeneratedUnitMap(),
System.currentTimeMillis(), newResult.getClientDataMap());
rebindCachePut(rule, typeName, cachedResult);
break;
}