From 6e28605824746fbc9424d615d64ca9e6f186d26a Mon Sep 17 00:00:00 2001 From: Alex Petrescu Date: Tue, 31 Mar 2015 22:23:06 -0700 Subject: [PATCH] Added volatile keyword to memoized YearClass --- .../main/java/com/facebook/device/yearclass/YearClass.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yearclass/src/main/java/com/facebook/device/yearclass/YearClass.java b/yearclass/src/main/java/com/facebook/device/yearclass/YearClass.java index c74ec62..b57e5e5 100644 --- a/yearclass/src/main/java/com/facebook/device/yearclass/YearClass.java +++ b/yearclass/src/main/java/com/facebook/device/yearclass/YearClass.java @@ -26,7 +26,7 @@ public class YearClass { private static final long MB = 1024 * 1024; private static final int MHZ_IN_KHZ = 1000; - private static Integer mYearCategory; + private volatile static Integer mYearCategory; /** * Entry Point of YearClass. Extracts YearClass variable with memoizing. @@ -168,4 +168,4 @@ private static int getRamYear(Context c) { if (totalRam <= 2048 * MB) return CLASS_2013; return CLASS_2014; } -} \ No newline at end of file +}