Remove redundant calls to obtain items from cache

This makes it more obvious which cached values are re-used which is
helpful for optimizing. For instance, previously we had considered
swapping the order of the anonymous access calls (so that virtual server
is first, because that is more likely to be in our cache), however, now
it is obvious that doing the swapping yields no benefit or even a loss
because the CachedWeb will be loaded anyway.
diff --git a/src/com/google/enterprise/adaptor/sharepoint/SharePointAdaptor.java b/src/com/google/enterprise/adaptor/sharepoint/SharePointAdaptor.java
index a08bca9..cc2cfdf 100644
--- a/src/com/google/enterprise/adaptor/sharepoint/SharePointAdaptor.java
+++ b/src/com/google/enterprise/adaptor/sharepoint/SharePointAdaptor.java
@@ -1130,7 +1130,8 @@
       log.entering("SiteAdaptor", "getAspxDocContent",
           new Object[] {request, response});
 
-      if (isWebNoIndex(rareModCache.getWeb(siteDataClient))) {
+      CachedWeb w = rareModCache.getWeb(siteDataClient);
+      if (isWebNoIndex(w)) {
         log.fine("Document marked for NoIndex");
         response.respondNotFound();
         log.exiting("SiteAdaptor", "getAspxDocContent");
@@ -1138,7 +1139,7 @@
       }
 
       boolean allowAnonymousAccess
-          = isAllowAnonymousReadForWeb(rareModCache.getWeb(siteDataClient))
+          = isAllowAnonymousReadForWeb(w)
           // Check if anonymous access is denied by web application policy
           && !isDenyAnonymousAccessOnVirtualServer(
               rareModCache.getVirtualServer());
@@ -1189,8 +1190,8 @@
           new Object[] {request, response, listId, itemId});
       CachedList l = rareModCache.getList(siteDataClient, listId);
 
-      if (TrueFalseType.TRUE.equals(l.noIndex)
-          || isWebNoIndex(rareModCache.getWeb(siteDataClient))) {
+      CachedWeb w = rareModCache.getWeb(siteDataClient);
+      if (TrueFalseType.TRUE.equals(l.noIndex) || isWebNoIndex(w)) {
         log.fine("Document marked for NoIndex");
         response.respondNotFound();
         log.exiting("SiteAdaptor", "getListItemDocContent");
@@ -1221,7 +1222,7 @@
       // for anonymous access to work on List and List Items.
       boolean allowAnonymousAccess = isAllowAnonymousReadForList(l)
           && scopeId.equals(l.scopeId.toLowerCase(Locale.ENGLISH))
-          && isAllowAnonymousPeekForWeb(rareModCache.getWeb(siteDataClient))
+          && isAllowAnonymousPeekForWeb(w)
           && !isDenyAnonymousAccessOnVirtualServer(
               rareModCache.getVirtualServer());
 
@@ -1459,8 +1460,8 @@
       log.fine("Suspected attachment verified as being an attachment, assuming "
           + "it exists.");
       CachedList l = rareModCache.getList(siteDataClient, listId);
-      if (TrueFalseType.TRUE.equals(l.noIndex)
-          || isWebNoIndex(rareModCache.getWeb(siteDataClient))) {
+      CachedWeb w = rareModCache.getWeb(siteDataClient);
+      if (TrueFalseType.TRUE.equals(l.noIndex) || isWebNoIndex(w)) {
         log.fine("Document marked for NoIndex");
         response.respondNotFound();
         log.exiting("SiteAdaptor", "getAttachmentDocContent", true);
@@ -1479,7 +1480,7 @@
 
       boolean allowAnonymousAccess = isAllowAnonymousReadForList(l)
           && scopeId.equals(l.scopeId.toLowerCase(Locale.ENGLISH))
-          && isAllowAnonymousPeekForWeb(rareModCache.getWeb(siteDataClient))
+          && isAllowAnonymousPeekForWeb(w)
           && !isDenyAnonymousAccessOnVirtualServer(
               rareModCache.getVirtualServer());
       if (!allowAnonymousAccess) {