
AttachmentCache: Suppressing unchceck warning
@7dd26c709e463af8c43dcaff7bf0c734b2dec939
--- app/utils/AttachmentCache.java
+++ app/utils/AttachmentCache.java
... | ... | @@ -36,9 +36,10 @@ |
36 | 36 |
*/ |
37 | 37 |
public static List<Attachment> get(ResourceType containerType, String containerId) { |
38 | 38 |
String cacheKey = containerType.name() + containerId; |
39 |
- Object cachedData = Cache.get(cacheKey); |
|
39 |
+ @SuppressWarnings("unchecked") |
|
40 |
+ List<Attachment> cachedData = (List<Attachment>)Cache.get(cacheKey); |
|
40 | 41 |
if (cachedData != null) { |
41 |
- return (List<Attachment>) cachedData; |
|
42 |
+ return cachedData; |
|
42 | 43 |
} else { |
43 | 44 |
return null; |
44 | 45 |
} |
... | ... | @@ -72,9 +73,10 @@ |
72 | 73 |
*/ |
73 | 74 |
public static List<Attachment> get(Resource container) { |
74 | 75 |
String cacheKey = cacheKey(container); |
75 |
- Object cachedData = Cache.get(cacheKey); |
|
76 |
+ @SuppressWarnings("unchecked") |
|
77 |
+ List<Attachment> cachedData = (List<Attachment>)Cache.get(cacheKey); |
|
76 | 78 |
if (cachedData != null) { |
77 |
- return (List<Attachment>) cachedData; |
|
79 |
+ return cachedData; |
|
78 | 80 |
} else { |
79 | 81 |
return null; |
80 | 82 |
} |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?