Keesun Baik 2015-02-23
AttachmentCache: Suppressing unchceck warning
@7dd26c709e463af8c43dcaff7bf0c734b2dec939
app/utils/AttachmentCache.java
--- app/utils/AttachmentCache.java
+++ app/utils/AttachmentCache.java
@@ -36,9 +36,10 @@
      */
     public static List<Attachment> get(ResourceType containerType, String containerId) {
         String cacheKey = containerType.name() + containerId;
-        Object cachedData = Cache.get(cacheKey);
+        @SuppressWarnings("unchecked")
+        List<Attachment> cachedData = (List<Attachment>)Cache.get(cacheKey);
         if (cachedData != null) {
-            return (List<Attachment>) cachedData;
+            return cachedData;
         } else {
             return null;
         }
@@ -72,9 +73,10 @@
      */
     public static List<Attachment> get(Resource container) {
         String cacheKey = cacheKey(container);
-        Object cachedData = Cache.get(cacheKey);
+        @SuppressWarnings("unchecked")
+        List<Attachment> cachedData = (List<Attachment>)Cache.get(cacheKey);
         if (cachedData != null) {
-            return (List<Attachment>) cachedData;
+            return cachedData;
         } else {
             return null;
         }
Add a comment
List