Buggy code:
public abstract class AbstractAjaxCallback < T , K > implements Runnable { private static int NET_TIMEOUT = 30000 ; private static String AGENT = null ; private static int NETWORK_POOL = 4 ; private Class < T > type ; private Reference < Object > whandler ; private Object handler ; private String callback ; private WeakReference < View > progress ; private String url ; private Map < String , Object > params ; private Map < String , String > headers ; private T result ; private File cacheDir ; private AccountHandle ah ; protected AjaxStatus status ; protected boolean fileCache ; protected boolean memCache ; private boolean refresh ; private long expire ; private String encoding = "UTF-8" ; private WeakReference < Activity > act ; private boolean uiCallback = true ; @ SuppressWarnings ( "unchecked" ) private K self ( ) { } private void clear ( ) { } public static void setTimeout ( int timeout ) { } public static void setAgent ( String agent ) { } public Class < T > getType ( ) { } public K weakHandler ( Object handler , String callback ) { } public K handler ( Object handler , String callback ) { } public K url ( String url ) { } public K type ( Class < T > type ) { } public K fileCache ( boolean cache ) { } public K memCache ( boolean cache ) { } public K refresh ( boolean refresh ) { } public K uiCallback ( boolean uiCallback ) { } public K expire ( long expire ) { } public K header ( String name , String value ) { } public K encoding ( String encoding ) { } public K param ( String name , Object value ) { } public K params ( Map < String , Object > params ) { } public K progress ( View view ) { } private static final Class < ? > [ ] DEFAULT_SIG = new Class < ? > [ ] { String . class , Object . class , AjaxStatus . class } ; private boolean completed ; private void callback ( ) { } private void wake ( ) { } private boolean blocked ; public void block ( ) { } public void callback ( String url , T object , AjaxStatus status ) { } protected T fileGet ( String url , File file , AjaxStatus status ) { } protected T datastoreGet ( String url ) { } protected void showProgress ( boolean show ) { } @ SuppressWarnings ( "unchecked" ) protected T transform ( String url , byte [ ] data , AjaxStatus status ) { } protected T memGet ( String url ) { } protected void memPut ( String url , T object ) { } protected void filePut ( String url , T object , File file , byte [ ] data ) { } protected File accessFile ( File cacheDir , String url ) { } public void async ( Activity act ) { } public void async ( Context context ) { } private boolean isActive ( ) { if ( ( act ) == null ) return true ; Activity a = act . get ( ) ; <START_BUG> if ( a . isFinishing ( ) ) { <END_BUG> return false ; } return true ; } public void failure ( int code , String message ) { } protected void execute ( ) { } private void work ( Context context ) { } protected boolean cacheAvailable ( Context context ) { } @ Override public void run ( ) { } private void backgroundWork ( ) { } private String getCacheUrl ( ) { } private void fileWork ( ) { } private void datastoreWork ( ) { } private boolean reauth ; private void networkWork ( ) { } private void filePut ( ) { } private void network ( ) throws IOException { } private void afterWork ( ) { } private static ExecutorService fetchExe ; private static ExecutorService getExecutor ( ) { } public static void setNetworkLimit ( int limit ) { } public static void cancel ( ) { } private static String patchUrl ( String url ) { } private void httpGet ( String url , Map < String , String > headers , AjaxStatus status ) throws IOException { } private void httpPost ( String url , Map < String , String > headers , Map < String , Object > params , AjaxStatus status ) throws IOException , ClientProtocolException { } private static DefaultHttpClient client ; private static DefaultHttpClient getClient ( ) { } private void httpDo ( HttpUriRequest hr , String url , Map < String , String > headers , AjaxStatus status ) throws IOException , ClientProtocolException { } public K auth ( Activity act , String type , String account ) { } public K auth ( AccountHandle handle ) { } public String getUrl ( ) { } public Object getHandler ( ) { } public String getCallback ( ) { } private static int lastStatus = 200 ; protected static int getLastStatus ( ) { } public T getResult ( ) { } public AjaxStatus getStatus ( ) { } private static final String lineEnd = "\r\n" ; private static final String twoHyphens = "--" ; private static final String boundary = "*****" ; private static boolean isMultiPart ( Map < String , Object > params ) { } private void httpMulti ( String url , Map < String , String > headers , Map < String , Object > params , AjaxStatus status ) throws IOException { } private static void writeObject ( DataOutputStream dos , String name , Object obj ) throws IOException { } private static void writeData ( DataOutputStream dos , String name , InputStream is ) throws IOException { }

Fix:
if ( ( a == null ) || ( a . isFinishing ( ) ) ) {