Commit 2c58d45f authored by Varun Patil's avatar Varun Patil

Fix messed up NotificationId

parent 33c48c12
......@@ -4,23 +4,24 @@ import java.util.concurrent.atomic.AtomicInteger;
public class NotificationId {
private final static AtomicInteger c = new AtomicInteger(0);
private final static AtomicInteger current_count = new AtomicInteger(0);
public static int getID() {
return c.incrementAndGet();
}
private final static AtomicInteger current_count = new AtomicInteger(0);
public static int getCurrentCount() {
return c.get();
return current_count.get();
}
public static int decrementAndGetCurrentCount() {
if (c.get() > 0)
return c.decrementAndGet();
if (current_count.get() > 0)
return current_count.decrementAndGet();
else
return 0;
}
public static void setCurrentCount(int count) {
c.set(count);
current_count.set(count);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment