Skip to content

Instantly share code, notes, and snippets.

@rnewman
Created April 25, 2014 18:26
Show Gist options
  • Save rnewman/11298776 to your computer and use it in GitHub Desktop.
Save rnewman/11298776 to your computer and use it in GitHub Desktop.
Spot the bug
public int getDominantColor(String key) {
startRead();
try {
FaviconsForURL element = permanentBackingMap.get(key);
if (element == null) {
element = backingMap.get(key);
}
if (element == null) {
Log.w(LOGTAG, "Cannot compute dominant color of non-cached favicon. Cache fullness " +
currentSize.get() + '/' + maxSizeBytes);
finishRead();
return 0xFFFFFF;
}
return element.ensureDominantColor();
} finally {
finishRead();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment