void replaceAllocStmt(Unit u, Local cls){//Set<Unit> set){
		String classname = null;
	/*	Iterator it = u.getDefBoxes().iterator();
		while(it.hasNext()){
			Value v  = ((ValueBox)it.next()).getValue();
			if(v instanceof Local){
				Local l = (Local)v ;
				classname = l.getType().toString();
			}
		}
	*/	
		StringBuilder sb = new StringBuilder("void initializePoolObject");
		Value v = u.getDefBoxes().get(0).getValue();
		
		Unit spclInvk = b.getUnits().getSuccOf(u);
		if(spclInvk instanceof InvokeStmt){
			InvokeExpr invExpr = ((InvokeStmt) spclInvk).getInvokeExpr();
			if(invExpr instanceof SpecialInvokeExpr){
				String s = invExpr.getMethod().toString();  //does it yield full method name along with classname and parameters passed?
				int i = s.indexOf("(");
				sb.append(s.substring(i, s.length()-1));
				
				int j = s.indexOf(":");
				classname = s.substring(1, j);
			}
		}
		
		Unit u_succ = b.getUnits().getSuccOf(u);
		
		Unit insert_before = null;
		if(u_succ instanceof InvokeStmt){
			insert_before  = b.getUnits().getSuccOf(u_succ);
		}
		
		Local bool = Jimple.v().newLocal(v.toString()+"_flag", BooleanType.v());
		
		if(isLocalAvailable(bool)){
			bool = getAvailableLocal(bool);
		}
		else
			b.getLocals().add(bool);
		Stmt check = Jimple.v().newAssignStmt(bool, Jimple.v().newVirtualInvokeExpr(buf_l, bufPool.getMethod("boolean isObjInPool(java.lang.String)").makeRef(), cls));//StringConstant.v(classname)));
		b.getUnits().insertBefore(check, u);
		
		Local savedObj = Jimple.v().newLocal(v.toString()+"_savedObj", RefType.v(Scene.v().getSootClass("java.lang.Object")));
		
		if(isLocalAvailable(savedObj)){
			savedObj = getAvailableLocal(savedObj);
		}
		else
			b.getLocals().add(savedObj);
		
		Stmt ifStmt = Jimple.v().newIfStmt(
				Jimple.v().newEqExpr(bool, IntConstant.v(0)), u);
		b.getUnits().insertAfter(ifStmt, check);
		
		Stmt toCall = Jimple.v().newAssignStmt(savedObj, Jimple.v().newVirtualInvokeExpr(buf_l, bufPool.getMethod("java.lang.Object getObject(java.lang.String)").makeRef(), cls));//StringConstant.v(classname)));
		b.getUnits().insertAfter(toCall, ifStmt);
		
		Stmt castStmt = Jimple.v().newAssignStmt(v , Jimple.v().newCastExpr(savedObj, RefType.v(Scene.v().getSootClass(classname))));
		b.getUnits().insertAfter(castStmt, toCall);
		
		Stmt s = Jimple.v().newInvokeStmt(Jimple.v().newVirtualInvokeExpr((Local) v, Scene.v().getSootClass(classname).getMethod(sb.toString()).makeRef()));
		
		b.getUnits().insertAfter(s, castStmt);	
		b.getUnits().insertAfter(Jimple.v().newGotoStmt(insert_before), s);
	}