package com.nostra13.universalimageloader.cache;

import java.lang.ref.Reference;
import java.lang.ref.SoftReference;

import android.graphics.Bitmap;

/**
 * Image cache limited by size. Contains Bitmaps.<br />
 * Not thread-safe.
 * 
 * @author Sergey Tarasevich (nostra13[at]gmail[dot]com)
 */
public class ImageCache extends LimitedCache<String, Bitmap> {

	private int sizeLimit;

	public ImageCache(int sizeLimit) {
		this.sizeLimit = sizeLimit;
	}

	@Override
	protected int getSize(Bitmap value) {
		return value.getRowBytes() * value.getHeight();
	}

	@Override
	protected int getSizeLimit() {
		return sizeLimit;
	}

	@Override
	protected Reference<Bitmap> createReference(Bitmap value) {
		return new SoftReference<Bitmap>(value);
	}
}

@@ -96,20 +96,20 @@
 ang.ref.
-Soft
+Weak
 Referenc
@@ -709,12 +709,12 @@
 new 
-Soft
+Weak
 Refe

Return mistakenly replaced weak reference