Fallback to the global region for flags other than StateFlags. Thanks imjake9.

This commit is contained in:
Wizjany 2011-08-24 17:39:47 -04:00
parent 2b56247e21
commit 61a60ecdd6

View File

@ -347,6 +347,10 @@ public <T extends Flag<V>, V> V getFlag(T flag) {
try {
return needsClear.values().iterator().next();
} catch (NoSuchElementException e) {
if (globalRegion != null) {
V gFlag = globalRegion.getFlag(flag);
if (gFlag != null) return gFlag;
}
return null;
}
}