merge

Jonathan Bell [2013-09-14 20:30:04]
merge
Filename
.classpath
LICENSE.md
README.md
binaries/vmvm.jar
src/com/rits/cloning/Cloner.java
src/com/rits/cloning/CloningException.java
src/com/rits/cloning/FastClonerArrayList.java
src/com/rits/cloning/FastClonerCalendar.java
src/com/rits/cloning/FastClonerConcurrentHashMap.java
src/com/rits/cloning/FastClonerCustomCollection.java
src/com/rits/cloning/FastClonerCustomMap.java
src/com/rits/cloning/FastClonerHashMap.java
src/com/rits/cloning/FastClonerHashSet.java
src/com/rits/cloning/FastClonerLinkedList.java
src/com/rits/cloning/FastClonerTreeMap.java
src/com/rits/cloning/IFastCloner.java
src/com/rits/cloning/IFreezable.java
src/com/rits/cloning/Immutable.java
src/edu/columbia/cs/psl/vmvm/AbstractInterceptor.java
src/edu/columbia/cs/psl/vmvm/AbstractLazyCloningInterceptor.java
src/edu/columbia/cs/psl/vmvm/CloningUtils.java
src/edu/columbia/cs/psl/vmvm/asm/mvs/CloningAdapter.java
src/edu/columbia/cs/psl/vmvm/asm/mvs/InvivoAdapter.java
src/edu/columbia/cs/psl/vmvm/asm/mvs/StaticFieldIsolatorMV.java
src/edu/columbia/cs/psl/vmvm/eval/DacapoPatchCallback.java
diff --git a/.classpath b/.classpath
index 19945d8..07b2181 100644
--- a/.classpath
+++ b/.classpath
@@ -3,7 +3,5 @@
 	<classpathentry kind="src" path="src"/>
 	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
 	<classpathentry kind="lib" path="/Users/jon/Documents/PSL/Projects/in-vivo/vmvm/lib/asm-all-4.1.jar" sourcepath="lib/asm-src.zip"/>
-	<classpathentry kind="lib" path="lib/objenesis-1.2.jar"/>
-	<classpathentry kind="lib" path="dacapo.jar"/>
 	<classpathentry kind="output" path="bin"/>
 </classpath>
diff --git a/LICENSE.md b/LICENSE.md
new file mode 100644
index 0000000..c377e41
--- /dev/null
+++ b/LICENSE.md
@@ -0,0 +1,16 @@
+This software is released under the MIT license:
+
+Copyright © 2013, by The Trustees of Columbia University in the City of New York.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+
+
+This project makes use of the following libraries:
+* [ASM](http://asm.ow2.org/license.html), (c) 2000-2011 INRIA, France Telecom, [license](http://asm.ow2.org/license.html)
+* [Objenesis](http://code.google.com/p/objenesis/), © 2006-2012, Joe Walnes, Henri Tremblay and Leonardo Mesquita, released under the Apache License 2.0
+* [Log4j](http://logging.apache.org/log4j/), (c) 1999-2012, Apache Software Foundation, released under the Apache License 2.0
\ No newline at end of file
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..ea774b0
--- /dev/null
+++ b/README.md
@@ -0,0 +1,80 @@
+#VMVM - Unit Test Virtualization for Java
+==========
+**VMVM** is a system for isolating unit tests with very low overhead.
+
+This repository contains the source and a [runnable binary](https://github.com/Programming-Systems-Lab/xxxxFIXME) for **VMVM**.
+
+###For more information
+Please refer to our [Technical Report](http://mice.cs.columbia.edu/getTechreport.php?techreportID=1549) or email [Jonathan Bell](mailto:jbell@cs.columbia.edu)
+
+Running
+-----
+### Instrumenting your code
+Execute the instrumenter. Make sure that the asm library and the vmvm library are both in your classpath, then run the Instrumenter class with two arguments. The first argument is the folder containing the project to instrument. The second argument is the destination for the instrumented version.
+Example:
+`java -cp lib/asm-all-4.1.jar:vmvm.jar edu.columbia.cs.psl.vmvm.Instrumenter folder-to-instrument folder-dest`
+
+
+### Modifying your build scripts
+
+
+In case of problems..
+-----
+We have verified that VMVM works with the following applications. If you notice any incompatibilities with it, please email [Jonathan Bell](mailto:jbell@cs.columbia.edu), (or, fix the bug yourself and send a patch :P).
+
+Applications that we have tested with VMVM (and are known to work):
+* [Apache Ivy](http://ant.apache.org/ivy/)
+* [Apache Nutch](http://nutch.apache.org/)
+* [Apache River](http://river.apache.org/)
+* [Apache Tomcat](http://tomcat.apache.org/)
+* [betterFORM](http://www.betterform.de/en/index.html)
+* [Bristlecone](http://www.ohloh.net/p/bristlecone)
+* [btrace](https://kenai.com/projects/btrace)
+* [Closure Compiler](http://commons.apache.org/proper/commons-jci/)
+* [Commons Codec](http://commons.apache.org/proper/commons-codec/)
+* [Commons IO](http://commons.apache.org/proper/commons-io/)
+* [Commons Validator](http://commons.apache.org/proper/commons-validator/)
+* [FreeRapid Downloader](http://wordrider.net/freerapid/)
+* [gedcom4j](http://gedcom4j.org/main/)
+* [JAXX](http://nuiton.org/projects/jaxx)
+* [Jetty](http://www.eclipse.org/jetty/jtor* )
+* [JTor](https://github.com/brl/JTor)
+* [mkgmap](http://wiki.openstreetmap.org/wiki/Mkgmap)
+* [Openfire](http://www.igniterealtime.org/projects/openfire/)
+* [Trove, for Java](http://trove.starlight-systems.com/)
+* [Universal Password Mananager (UPM)](http://upm.sourceforge.net/)
+
+License
+------
+This software is released under the MIT license.
+
+Copyright (c) 2013, by The Trustees of Columbia University in the City of New York.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+
+Acknowledgements
+-----
+This project makes use of the following libraries:
+* [ASM](http://asm.ow2.org/license.html), (c) 2000-2011 INRIA, France Telecom, [license](http://asm.ow2.org/license.html)
+* [Objenesis](http://code.google.com/p/objenesis/), © 2006-2012, Joe Walnes, Henri Tremblay and Leonardo Mesquita, released under the Apache License 2.0
+* [Log4j](http://logging.apache.org/log4j/), (c) 1999-2012, Apache Software Foundation, released under the Apache License 2.0
+
+The authors of this software are [Jonathan Bell](http://jonbell.net) and [Gail Kaiser](http://www.cs.columbia.edu/~kaiser/). The authors are members of the [Programming Systems Laboratory](http://www.psl.cs.columbia.edu/), funded in part by NSF CCF-1161079, NSF CNS-0905246, and NIH U54 CA121852.
\ No newline at end of file
diff --git a/binaries/vmvm.jar b/binaries/vmvm.jar
new file mode 100644
index 0000000..a73def8
Binary files /dev/null and b/binaries/vmvm.jar differ
diff --git a/src/com/rits/cloning/Cloner.java b/src/com/rits/cloning/Cloner.java
deleted file mode 100644
index 786402d..0000000
--- a/src/com/rits/cloning/Cloner.java
+++ /dev/null
@@ -1,614 +0,0 @@
-package com.rits.cloning;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Array;
-import java.lang.reflect.Field;
-import java.lang.reflect.Modifier;
-import java.math.BigDecimal;
-import java.math.BigInteger;
-import java.net.URI;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.GregorianCalendar;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.IdentityHashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.TreeMap;
-import java.util.TreeSet;
-import java.util.UUID;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.regex.Pattern;
-
-import org.objenesis.Objenesis;
-import org.objenesis.ObjenesisStd;
-
-import edu.columbia.cs.psl.vmvm.Constants;
-
-/**
- * Cloner: deep clone objects.
- *
- * This class is thread safe. One instance can be used by multiple threads on the same time.
- *
- * @author kostantinos.kougios
- *
- * 18 Sep 2008
- */
-public class Cloner
-{
-	private final Objenesis									objenesis;
-	private final Set<Class<?>>								ignored				= new HashSet<Class<?>>();
-	private final Set<Class<?>>								nullInstead			= new HashSet<Class<?>>();
-	private final Map<Class<?>, IFastCloner>				fastCloners			= new HashMap<Class<?>, IFastCloner>();
-	private final Map<Object, Boolean>						ignoredInstances	= new IdentityHashMap<Object, Boolean>();
-	private final ConcurrentHashMap<Class<?>, List<Field>>	fieldsCache			= new ConcurrentHashMap<Class<?>, List<Field>>();
-	private boolean											dumpClonedClasses	= false;
-	private boolean											cloningEnabled		= true;
-	private boolean											nullTransient		= false;
-	private boolean											cloneSynthetics		= true;
-
-	public Cloner()
-	{
-		objenesis = new ObjenesisStd();
-		init();
-	}
-
-	public Cloner(final Objenesis objenesis)
-	{
-		this.objenesis = objenesis;
-		init();
-	}
-
-	public boolean isNullTransient()
-	{
-		return nullTransient;
-	}
-
-	/**
-	 * this makes the cloner to set a transient field to null upon cloning.
-	 *
-	 * NOTE: primitive types can't be nulled. Their value will be set to default, i.e. 0 for int
-	 *
-	 * @param nullTransient		true for transient fields to be nulled
-	 */
-	public void setNullTransient(final boolean nullTransient)
-	{
-		this.nullTransient = nullTransient;
-	}
-
-	public void setCloneSynthetics(final boolean cloneSynthetics)
-	{
-		this.cloneSynthetics = cloneSynthetics;
-	}
-
-	private void init()
-	{
-		registerKnownJdkImmutableClasses();
-		registerKnownConstants();
-		registerFastCloners();
-	}
-
-	/**
-	 * registers a std set of fast cloners.
-	 */
-	protected void registerFastCloners()
-	{
-		fastCloners.put(GregorianCalendar.class, new FastClonerCalendar());
-		fastCloners.put(ArrayList.class, new FastClonerArrayList());
-		fastCloners.put(LinkedList.class, new FastClonerLinkedList());
-		fastCloners.put(HashSet.class, new FastClonerHashSet());
-		fastCloners.put(HashMap.class, new FastClonerHashMap());
-		fastCloners.put(TreeMap.class, new FastClonerTreeMap());
-		fastCloners.put(ConcurrentHashMap.class, new FastClonerConcurrentHashMap());
-	}
-
-	protected Object fastClone(final Object o, final Map<Object, Object> clones,int sandboxField) throws IllegalAccessException
-	{
-		final Class<? extends Object> c = o.getClass();
-		final IFastCloner fastCloner = fastCloners.get(c);
-		if (fastCloner != null) return fastCloner.clone(o, this, clones, sandboxField);
-		return null;
-	}
-
-	public void registerConstant(final Object o)
-	{
-		ignoredInstances.put(o, true);
-	}
-
-	public void registerConstant(final Class<?> c, final String privateFieldName)
-	{
-		try
-		{
-			final Field field = c.getDeclaredField(privateFieldName);
-			field.setAccessible(true);
-			final Object v = field.get(null);
-			ignoredInstances.put(v, true);
-		} catch (final SecurityException e)
-		{
-			throw new RuntimeException(e);
-		} catch (final NoSuchFieldException e)
-		{
-			throw new RuntimeException(e);
-		} catch (final IllegalArgumentException e)
-		{
-			throw new RuntimeException(e);
-		} catch (final IllegalAccessException e)
-		{
-			throw new RuntimeException(e);
-		}
-	}
-
-	/**
-	 * registers some known JDK immutable classes. Override this to register your
-	 * own list of jdk's immutable classes
-	 */
-	protected void registerKnownJdkImmutableClasses()
-	{
-		registerImmutable(String.class);
-		registerImmutable(Integer.class);
-		registerImmutable(Long.class);
-		registerImmutable(Boolean.class);
-		registerImmutable(Class.class);
-		registerImmutable(Float.class);
-		registerImmutable(Double.class);
-		registerImmutable(Character.class);
-		registerImmutable(Byte.class);
-		registerImmutable(Short.class);
-		registerImmutable(Void.class);
-
-		registerImmutable(BigDecimal.class);
-		registerImmutable(BigInteger.class);
-		registerImmutable(URI.class);
-		registerImmutable(URL.class);
-		registerImmutable(UUID.class);
-		registerImmutable(Pattern.class);
-	}
-
-	protected void registerKnownConstants()
-	{
-		// registering known constants of the jdk.
-		registerStaticFields(TreeSet.class, HashSet.class, HashMap.class, TreeMap.class);
-	}
-
-	/**
-	 * registers all static fields of these classes. Those static fields won't be cloned when an instance
-	 * of the class is cloned.
-	 *
-	 * This is useful i.e. when a static field object is added into maps or sets. At that point, there is no
-	 * way for the cloner to know that it was static except if it is registered.
-	 *
-	 * @param classes		array of classes
-	 */
-	public void registerStaticFields(final Class<?>... classes)
-	{
-		for (final Class<?> c : classes)
-		{
-			final List<Field> fields = allFields(c);
-			for (final Field field : fields)
-			{
-				final int mods = field.getModifiers();
-				if (Modifier.isStatic(mods) && !field.getType().isPrimitive())
-				{
-					//					System.out.println(c + " . " + field.getName());
-					registerConstant(c, field.getName());
-				}
-			}
-		}
-	}
-
-	/**
-	 * spring framework friendly version of registerStaticFields
-	 * @param set		a set of classes which will be scanned for static fields
-	 */
-	public void setExtraStaticFields(final Set<Class<?>> set)
-	{
-		registerStaticFields((Class<?>[]) set.toArray());
-	}
-
-	/**
-	 * instances of classes that shouldn't be cloned can be registered using this method.
-	 *
-	 * @param c		The class that shouldn't be cloned. That is, whenever a deep clone for
-	 * 				an object is created and c is encountered, the object instance of c will
-	 * 				be added to the clone.
-	 */
-	public void dontClone(final Class<?>... c)
-	{
-		for (final Class<?> cl : c)
-		{
-			ignored.add(cl);
-		}
-	}
-
-	/**
-	 * instead of cloning these classes will set the field to null
-	 *
-	 * @param c		the classes to nullify during cloning
-	 */
-	public void nullInsteadOfClone(final Class<?>... c)
-	{
-		for (final Class<?> cl : c)
-		{
-			nullInstead.add(cl);
-		}
-	}
-
-	/**
-	 * spring framework friendly version of nullInsteadOfClone
-	 */
-	public void setExtraNullInsteadOfClone(final Set<Class<?>> set)
-	{
-		nullInstead.addAll(set);
-	}
-
-	/**
-	 * registers an immutable class. Immutable classes are not cloned.
-	 *
-	 * @param c			the immutable class
-	 */
-	public void registerImmutable(final Class<?>... c)
-	{
-		for (final Class<?> cl : c)
-		{
-			ignored.add(cl);
-		}
-	}
-
-	/**
-	 * spring framework friendly version of registerImmutable
-	 */
-	public void setExtraImmutables(final Set<Class<?>> set)
-	{
-		ignored.addAll(set);
-	}
-
-	public void registerFastCloner(final Class<?> c, final IFastCloner fastCloner)
-	{
-		if (fastCloners.containsKey(c)) throw new IllegalArgumentException(c + " already fast-cloned!");
-		fastCloners.put(c, fastCloner);
-	}
-
-	/**
-	 * creates a new instance of c. Override to provide your own implementation
-	 *
-	 * @param <T>		the type of c
-	 * @param c			the class
-	 * @return			a new instance of c
-	 */
-	@SuppressWarnings("unchecked")
-	public <T> T newInstance(final Class<T> c)
-	{
-		return (T) objenesis.newInstance(c);
-	}
-
-	@SuppressWarnings("unchecked")
-	public <T> T fastCloneOrNewInstance(final Class<T> c,int sandboxField)
-	{
-		try
-		{
-			final T fastClone = (T) fastClone(c, null, sandboxField);
-			if (fastClone != null) return fastClone;
-		} catch (final IllegalAccessException e)
-		{
-			throw new RuntimeException(e);
-		}
-		return newInstance(c);
-
-	}
-
-	/**
-	 * deep clones "o".
-	 *
-	 * @param <T>		the type of "o"
-	 * @param o			the object to be deep-cloned
-	 * @return			a deep-clone of "o".
-	 */
-	public <T> T deepClone(final T o, int sandboxField)
-	{
-		if (o == null) return null;
-		if (!cloningEnabled) return o;
-		if (dumpClonedClasses)
-		{
-			System.out.println("start>" + o.getClass());
-		}
-		final Map<Object, Object> clones = new IdentityHashMap<Object, Object>(16);
-		try
-		{
-			return cloneInternal(o, clones, sandboxField);
-		} catch (final IllegalAccessException e)
-		{
-			throw new CloningException("error during cloning of " + o, e);
-		}
-	}
-
-	public <T> T deepCloneDontCloneInstances(final T o, int sandboxField, final Object... dontCloneThese)
-	{
-		if (o == null) return null;
-		if (!cloningEnabled) return o;
-		if (dumpClonedClasses)
-		{
-			System.out.println("start>" + o.getClass());
-		}
-		final Map<Object, Object> clones = new IdentityHashMap<Object, Object>(16);
-		for (final Object dc : dontCloneThese)
-		{
-			clones.put(dc, dc);
-		}
-		try
-		{
-			return cloneInternal(o, clones,sandboxField);
-		} catch (final IllegalAccessException e)
-		{
-			throw new CloningException("error during cloning of " + o, e);
-		}
-	}
-
-	/**
-	 * shallow clones "o". This means that if c=shallowClone(o) then
-	 * c!=o. Any change to c won't affect o.
-	 *
-	 * @param <T>		the type of o
-	 * @param o			the object to be shallow-cloned
-	 * @return			a shallow clone of "o"
-	 */
-	public <T> T shallowClone(final T o, int sandboxField)
-	{
-		if (o == null) return null;
-		if (!cloningEnabled) return o;
-		try
-		{
-			return cloneInternal(o, null,sandboxField);
-		} catch (final IllegalAccessException e)
-		{
-			throw new CloningException("error during cloning of " + o, e);
-		}
-	}
-
-	// caches immutables for quick reference
-	private final ConcurrentHashMap<Class<?>, Boolean>	immutables	= new ConcurrentHashMap<Class<?>, Boolean>();
-	private boolean isIgnored(final Class<?> clz)
-	{
-		for(Class<?> c : ignored)
-		{
-			if(c.isAssignableFrom(clz))
-				return true;
-		}
-		return false;
-	}
-	private boolean isImmutable(final Class<?> clz)
-	{
-		final Boolean b = immutables.get(clz);
-		if (b != null && b) return true;
-		for (final Annotation annotation : clz.getDeclaredAnnotations())
-		{
-			if (annotation.annotationType() == Immutable.class)
-			{
-				immutables.put(clz, Boolean.TRUE);
-				return true;
-			}
-		}
-		Class<?> c = clz.getSuperclass();
-		while (c != null && c != Object.class)
-		{
-			for (final Annotation annotation : c.getDeclaredAnnotations())
-			{
-				if (annotation.annotationType() == Immutable.class)
-				{
-					final Immutable im = (Immutable) annotation;
-					if (im.subClass())
-					{
-						immutables.put(clz, Boolean.TRUE);
-						return true;
-					}
-				}
-			}
-			c = c.getSuperclass();
-		}
-		return false;
-	}
-
-	/**
-	 * PLEASE DONT CALL THIS METHOD
-	 * The only reason for been public is because custom IFastCloner's must invoke it
-	 */
-	@SuppressWarnings("unchecked")
-	public <T> T cloneInternal(final T o, final Map<Object, Object> clones, final int sandboxField) throws IllegalAccessException
-	{
-		if (o == null) return null;
-		if (o == this) return null;
-		if (ignoredInstances.containsKey(o)) return o;
-		final Class<T> clz = (Class<T>) o.getClass();
-		if (clz.isEnum()) return o;
-		// skip cloning ignored classes
-//		if (nullInstead.contains(clz)) return null;
-		if (ignored.contains(clz)) return o;
-		if (isImmutable(clz)) return o;
-		if (isIgnored(clz)) return o;
-		if (o instanceof IFreezable)
-		{
-			final IFreezable f = (IFreezable) o;
-			if (f.isFrozen()) return o;
-		}
-		final Object clonedPreviously = clones != null ? clones.get(o) : null;
-		if (clonedPreviously != null) return (T) clonedPreviously;
-
-		final Object fastClone = fastClone(o, clones, sandboxField);
-		if (fastClone != null)
-		{
-			if (clones != null)
-			{
-				clones.put(o, fastClone);
-			}
-			return (T) fastClone;
-		}
-
-		if (dumpClonedClasses)
-		{
-			System.out.println("clone>" + clz);
-		}
-		if (clz.isArray())
-		{
-			final int length = Array.getLength(o);
-			final T newInstance = (T) Array.newInstance(clz.getComponentType(), length);
-			if(clones != null)
-				clones.put(o, newInstance);
-			for (int i = 0; i < length; i++)
-			{
-				final Object v = Array.get(o, i);
-				final Object clone = clones != null ? cloneInternal(v, clones,sandboxField) : v;
-				Array.set(newInstance, i, clone);
-			}
-			return newInstance;
-		}
-
-		final T newInstance = newInstance(clz);
-		if (clones != null)
-		{
-			clones.put(o, newInstance);
-		}
-		final List<Field> fields = allFields(clz);
-		for (final Field field : fields)
-		{
-			final int modifiers = field.getModifiers();
-			if (!Modifier.isStatic(modifiers))
-			{
-				if (nullTransient && Modifier.isTransient(modifiers))
-				{
-					// request by Jonathan : transient fields can be null-ed
-					final Class<?> type = field.getType();
-					if (!type.isPrimitive())
-					{
-						field.set(newInstance, null);
-					}
-				} else
-				{
-					if(field.getName().equals(Constants.CHILD_FIELD))
-						field.set(newInstance, sandboxField);
-					else
-					{
-
-						final Object fieldObject = field.get(o);
-						final boolean shouldClone = cloneSynthetics || (!cloneSynthetics && !field.isSynthetic());
-						final Object fieldObjectClone = clones != null ? (shouldClone ? cloneInternal(fieldObject, clones, sandboxField) : fieldObject) : fieldObject;
-						field.set(newInstance, fieldObjectClone);
-						if (dumpClonedClasses && fieldObjectClone != fieldObject)
-						{
-							System.out.println("cloned field>" + field + "  -- of class " + o.getClass());
-						}
-					}
-				}
-			}
-		}
-		return newInstance;
-	}
-
-	/**
-	 * copies all properties from src to dest. Src and dest can be of different class, provided they contain same field names/types
-	 *
-	 * @param src		the source object
-	 * @param dest		the destination object which must contain as minimum all the fields of src
-	 */
-	public <T, E extends T> void copyPropertiesOfInheritedClass(final T src, final E dest)
-	{
-		if (src == null) throw new IllegalArgumentException("src can't be null");
-		if (dest == null) throw new IllegalArgumentException("dest can't be null");
-		final Class<? extends Object> srcClz = src.getClass();
-		final Class<? extends Object> destClz = dest.getClass();
-		if (srcClz.isArray())
-		{
-			if (!destClz.isArray()) throw new IllegalArgumentException("can't copy from array to non-array class " + destClz);
-			final int length = Array.getLength(src);
-			for (int i = 0; i < length; i++)
-			{
-				final Object v = Array.get(src, i);
-				Array.set(dest, i, v);
-			}
-			return;
-		}
-		final List<Field> fields = allFields(srcClz);
-		final List<Field> destFields = allFields(dest.getClass());
-		for (final Field field : fields)
-		{
-			if (!Modifier.isStatic(field.getModifiers()))
-			{
-				try
-				{
-					final Object fieldObject = field.get(src);
-					field.setAccessible(true);
-					if (destFields.contains(field))
-					{
-						field.set(dest, fieldObject);
-					}
-				} catch (final IllegalArgumentException e)
-				{
-					throw new RuntimeException(e);
-				} catch (final IllegalAccessException e)
-				{
-					throw new RuntimeException(e);
-				}
-			}
-		}
-	}
-
-	/**
-	 * reflection utils
-	 */
-	private void addAll(final List<Field> l, final Field[] fields)
-	{
-		for (final Field field : fields)
-		{
-			if (!field.isAccessible()) field.setAccessible(true);
-			if(!Modifier.isStatic(field.getModifiers()))
-				l.add(field);
-		}
-	}
-
-	/**
-	 * reflection utils
-	 */
-	private List<Field> allFields(final Class<?> c)
-	{
-		List<Field> l = fieldsCache.get(c);
-		if (l == null)
-		{
-			l = new LinkedList<Field>();
-			final Field[] fields = c.getDeclaredFields();
-			addAll(l, fields);
-			Class<?> sc = c;
-			while ((sc = sc.getSuperclass()) != Object.class && sc != null)
-			{
-				addAll(l, sc.getDeclaredFields());
-			}
-			fieldsCache.putIfAbsent(c, l);
-		}
-		return l;
-	}
-
-	public boolean isDumpClonedClasses()
-	{
-		return dumpClonedClasses;
-	}
-
-	/**
-	 * will println() all cloned classes. Useful for debugging only.
-	 *
-	 * @param dumpClonedClasses			true to enable printing all cloned classes
-	 */
-	public void setDumpClonedClasses(final boolean dumpClonedClasses)
-	{
-		this.dumpClonedClasses = dumpClonedClasses;
-	}
-
-	public boolean isCloningEnabled()
-	{
-		return cloningEnabled;
-	}
-
-	public void setCloningEnabled(final boolean cloningEnabled)
-	{
-		this.cloningEnabled = cloningEnabled;
-	}
-}
diff --git a/src/com/rits/cloning/CloningException.java b/src/com/rits/cloning/CloningException.java
deleted file mode 100644
index 09b2678..0000000
--- a/src/com/rits/cloning/CloningException.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package com.rits.cloning;
-
-/**
- * thrown if cloning fails
- *
- * @author kostantinos.kougios
- *
- * 18 Jan 2009
- */
-public class CloningException extends RuntimeException
-{
-	private static final long	serialVersionUID	= 3815175312001146867L;
-
-	public CloningException(final String message, final Throwable cause)
-	{
-		super(message, cause);
-
-	}
-
-}
diff --git a/src/com/rits/cloning/FastClonerArrayList.java b/src/com/rits/cloning/FastClonerArrayList.java
deleted file mode 100644
index 9606411..0000000
--- a/src/com/rits/cloning/FastClonerArrayList.java
+++ /dev/null
@@ -1,32 +0,0 @@
-package com.rits.cloning;
-
-import java.util.ArrayList;
-import java.util.Map;
-
-/**
- * @author kostantinos.kougios
- *
- * 21 May 2009
- */
-public class FastClonerArrayList implements IFastCloner
-{
-	@SuppressWarnings({ "unchecked", "rawtypes" })
-	public Object clone(final Object t, final Cloner cloner, final Map<Object, Object> clones, int sandboxField) throws IllegalAccessException
-	{
-			final ArrayList al = (ArrayList) t;
-//			synchronized (t) {
-
-
-
-			final ArrayList l = new ArrayList();
-			for (final Object o : al)
-			{
-				final Object cloneInternal = cloner.cloneInternal(o, clones, sandboxField);
-				l.add(cloneInternal);
-			}
-			return l;
-
-//		}
-	}
-
-}
diff --git a/src/com/rits/cloning/FastClonerCalendar.java b/src/com/rits/cloning/FastClonerCalendar.java
deleted file mode 100644
index 1b29cb5..0000000
--- a/src/com/rits/cloning/FastClonerCalendar.java
+++ /dev/null
@@ -1,19 +0,0 @@
-package com.rits.cloning;
-
-import java.util.GregorianCalendar;
-import java.util.Map;
-
-/**
- * @author kostantinos.kougios
- *
- * 21 May 2009
- */
-public class FastClonerCalendar implements IFastCloner
-{
-	public Object clone(final Object t, final Cloner cloner, final Map<Object, Object> clones, int sandboxField)
-	{
-		final GregorianCalendar gc = new GregorianCalendar();
-		gc.setTimeInMillis(((GregorianCalendar) t).getTimeInMillis());
-		return gc;
-	}
-}
diff --git a/src/com/rits/cloning/FastClonerConcurrentHashMap.java b/src/com/rits/cloning/FastClonerConcurrentHashMap.java
deleted file mode 100644
index 8b2cf78..0000000
--- a/src/com/rits/cloning/FastClonerConcurrentHashMap.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package com.rits.cloning;
-
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-
-/**
- * @author kostantinos.kougios
- *
- * 18 Oct 2011
- */
-public class FastClonerConcurrentHashMap implements IFastCloner
-{
-	@SuppressWarnings({ "unchecked", "rawtypes" })
-	public Object clone(final Object t, final Cloner cloner, final Map<Object, Object> clones,int sandboxField) throws IllegalAccessException
-	{
-		synchronized (t) {
-
-		final ConcurrentHashMap<Object, Object> m = (ConcurrentHashMap) t;
-		final ConcurrentHashMap result = new ConcurrentHashMap();
-		synchronized (m.entrySet()) {
-
-		for (final Map.Entry e : m.entrySet())
-		{
-			synchronized (e.getKey()) {
-
-
-			final Object key = cloner.cloneInternal(e.getKey(), clones, sandboxField);
-			final Object value = cloner.cloneInternal(e.getValue(), clones, sandboxField);
-			if(key != null && value != null)
-			result.put(key, value);
-			}
-		}
-
-		return result;
-		}
-		}
-	}
-}
diff --git a/src/com/rits/cloning/FastClonerCustomCollection.java b/src/com/rits/cloning/FastClonerCustomCollection.java
deleted file mode 100644
index c071b22..0000000
--- a/src/com/rits/cloning/FastClonerCustomCollection.java
+++ /dev/null
@@ -1,27 +0,0 @@
-package com.rits.cloning;
-
-import java.util.Collection;
-import java.util.Map;
-
-/**
- * @author kostantinos.kougios
- *
- * 21 May 2009
- */
-@SuppressWarnings({ "unchecked", "rawtypes" })
-public abstract class FastClonerCustomCollection<T extends Collection> implements IFastCloner
-{
-	public abstract T getInstance(T o);
-
-	public Object clone(final Object t, final Cloner cloner, final Map<Object, Object> clones,int sandboxField) throws IllegalAccessException
-	{
-		final T c = getInstance((T) t);
-		final T l = (T) t;
-		for (final Object o : l)
-		{
-			final Object clone = cloner.cloneInternal(o, clones, sandboxField);
-			c.add(clone);
-		}
-		return c;
-	}
-}
diff --git a/src/com/rits/cloning/FastClonerCustomMap.java b/src/com/rits/cloning/FastClonerCustomMap.java
deleted file mode 100644
index c16e9e3..0000000
--- a/src/com/rits/cloning/FastClonerCustomMap.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package com.rits.cloning;
-
-import java.util.Map;
-import java.util.Set;
-
-/**
- * @author kostantinos.kougios
- *
- * 21 May 2009
- */
-@SuppressWarnings({ "unchecked", "rawtypes" })
-public abstract class FastClonerCustomMap<T extends Map> implements IFastCloner
-{
-	public Object clone(final Object t, final Cloner cloner, final Map<Object, Object> clones,int sandboxField) throws IllegalAccessException
-	{
-		final T m = (T) t;
-		final T result = getInstance((T) t);
-		final Set<Map.Entry<Object, Object>> entrySet = m.entrySet();
-		for (final Map.Entry e : entrySet)
-		{
-			final Object key = cloner.cloneInternal(e.getKey(), clones, sandboxField);
-			final Object value = cloner.cloneInternal(e.getValue(), clones, sandboxField);
-			result.put(key, value);
-		}
-		return result;
-	}
-
-	protected abstract T getInstance(T t);
-}
diff --git a/src/com/rits/cloning/FastClonerHashMap.java b/src/com/rits/cloning/FastClonerHashMap.java
deleted file mode 100644
index 11a0be9..0000000
--- a/src/com/rits/cloning/FastClonerHashMap.java
+++ /dev/null
@@ -1,36 +0,0 @@
-package com.rits.cloning;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * @author kostantinos.kougios
- *
- *         21 May 2009
- */
-public class FastClonerHashMap implements IFastCloner {
-	@SuppressWarnings({ "unchecked", "rawtypes" })
-	public Object clone(final Object t, final Cloner cloner, final Map<Object, Object> clones,int sandboxField) throws IllegalAccessException {
-
-		final HashMap<Object, Object> m = (HashMap) t;
-		try{
-//		synchronized (m) {
-//			synchronized (m.entrySet()) {
-
-				final HashMap result = new HashMap();
-				for (final Map.Entry e : m.entrySet()) {
-					final Object key = cloner.cloneInternal(e.getKey(), clones, sandboxField);
-					final Object value = cloner.cloneInternal(e.getValue(), clones, sandboxField);
-
-					result.put(key, value);
-				}
-				return result;
-//			}
-//		}
-		}
-		catch(Exception ex)
-		{
-			return clone(t, cloner, clones, sandboxField);
-		}
-	}
-}
diff --git a/src/com/rits/cloning/FastClonerHashSet.java b/src/com/rits/cloning/FastClonerHashSet.java
deleted file mode 100644
index 78936d5..0000000
--- a/src/com/rits/cloning/FastClonerHashSet.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package com.rits.cloning;
-
-import java.util.HashSet;
-import java.util.Map;
-
-/**
- * @author kostantinos.kougios
- *
- *         21 May 2009
- */
-public class FastClonerHashSet implements IFastCloner {
-	@SuppressWarnings({ "unchecked", "rawtypes" })
-	public Object clone(final Object t, final Cloner cloner, final Map<Object, Object> clones,int sandboxField) throws IllegalAccessException {
-//		synchronized (t) {
-
-			final HashSet al = (HashSet) t;
-			final HashSet l = new HashSet();
-			for (final Object o : al) {
-				final Object cloneInternal = cloner.cloneInternal(o, clones, sandboxField);
-				l.add(cloneInternal);
-			}
-			return l;
-//		}
-	}
-}
diff --git a/src/com/rits/cloning/FastClonerLinkedList.java b/src/com/rits/cloning/FastClonerLinkedList.java
deleted file mode 100644
index d578d84..0000000
--- a/src/com/rits/cloning/FastClonerLinkedList.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package com.rits.cloning;
-
-import java.util.LinkedList;
-import java.util.Map;
-
-/**
- * @author kostantinos.kougios
- *
- * 21 May 2009
- */
-public class FastClonerLinkedList implements IFastCloner
-{
-	@SuppressWarnings({ "unchecked", "rawtypes" })
-	public Object clone(final Object t, final Cloner cloner, final Map<Object, Object> clones,int sandboxField) throws IllegalAccessException
-	{
-		final LinkedList al = (LinkedList) t;
-		final LinkedList l = new LinkedList();
-		for (final Object o : al)
-		{
-			final Object cloneInternal = cloner.cloneInternal(o, clones, sandboxField);
-			l.add(cloneInternal);
-		}
-		return l;
-	}
-}
diff --git a/src/com/rits/cloning/FastClonerTreeMap.java b/src/com/rits/cloning/FastClonerTreeMap.java
deleted file mode 100644
index 3d80a2e..0000000
--- a/src/com/rits/cloning/FastClonerTreeMap.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package com.rits.cloning;
-
-import java.util.Map;
-import java.util.TreeMap;
-
-/**
- * @author kostantinos.kougios
- *
- * 21 May 2009
- */
-public class FastClonerTreeMap implements IFastCloner
-{
-	@SuppressWarnings({ "unchecked", "rawtypes" })
-	public Object clone(final Object t, final Cloner cloner, final Map<Object, Object> clones,int sandboxField) throws IllegalAccessException
-	{
-		final TreeMap<Object, Object> m = (TreeMap) t;
-		final TreeMap result = new TreeMap(m.comparator());
-		for (final Map.Entry e : m.entrySet())
-		{
-			final Object key = cloner.cloneInternal(e.getKey(), clones, sandboxField);
-			final Object value = cloner.cloneInternal(e.getValue(), clones, sandboxField);
-			result.put(key, value);
-		}
-		return result;
-	}
-}
diff --git a/src/com/rits/cloning/IFastCloner.java b/src/com/rits/cloning/IFastCloner.java
deleted file mode 100644
index a23e239..0000000
--- a/src/com/rits/cloning/IFastCloner.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package com.rits.cloning;
-
-import java.util.Map;
-
-/**
- * @author kostantinos.kougios
- *
- * 21 May 2009
- */
-public interface IFastCloner
-{
-	public Object clone(Object t, Cloner cloner, Map<Object, Object> clones, int sandboxField) throws IllegalAccessException;
-}
diff --git a/src/com/rits/cloning/IFreezable.java b/src/com/rits/cloning/IFreezable.java
deleted file mode 100644
index 7308583..0000000
--- a/src/com/rits/cloning/IFreezable.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package com.rits.cloning;
-
-/**
- * @author kostantinos.kougios
- *
- * 15 Nov 2010
- */
-public interface IFreezable
-{
-	public boolean isFrozen();
-
-}
diff --git a/src/com/rits/cloning/Immutable.java b/src/com/rits/cloning/Immutable.java
deleted file mode 100644
index 16347f0..0000000
--- a/src/com/rits/cloning/Immutable.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package com.rits.cloning;
-
-import static java.lang.annotation.ElementType.TYPE;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-/**
- * marks the specific class as immutable and the cloner avoids cloning it
- *
- * @author kostantinos.kougios
- *
- * 24 Mar 2011
- */
-@Target(TYPE)
-@Retention(RUNTIME)
-public @interface Immutable
-{
-	/**
-	 * by default all subclasses of the @Immutable class are not immutable. This can override it.
-	 * @return		true for subclasses of @Immutable class to be regarded as immutable from the cloner
-	 */
-	boolean subClass() default false;
-}
diff --git a/src/edu/columbia/cs/psl/vmvm/AbstractInterceptor.java b/src/edu/columbia/cs/psl/vmvm/AbstractInterceptor.java
index 6557ab4..4796a48 100644
--- a/src/edu/columbia/cs/psl/vmvm/AbstractInterceptor.java
+++ b/src/edu/columbia/cs/psl/vmvm/AbstractInterceptor.java
@@ -3,7 +3,6 @@ package edu.columbia.cs.psl.vmvm;
 import java.lang.reflect.Method;
 import java.util.concurrent.atomic.AtomicInteger;

-import com.rits.cloning.Cloner;

 public abstract class AbstractInterceptor implements Constants{
 	private Object interceptedObject;
@@ -188,7 +187,7 @@ public abstract class AbstractInterceptor implements Constants{

 	protected static final AtomicInteger nextId = new AtomicInteger(1);

-	private static Cloner cloner = new Cloner();
+//	private static Cloner cloner = new Cloner();

 //	public static <T> T shallowClone(T obj) {
 //		T ret = cloner.shallowClone(obj);
diff --git a/src/edu/columbia/cs/psl/vmvm/AbstractLazyCloningInterceptor.java b/src/edu/columbia/cs/psl/vmvm/AbstractLazyCloningInterceptor.java
deleted file mode 100644
index 3240055..0000000
--- a/src/edu/columbia/cs/psl/vmvm/AbstractLazyCloningInterceptor.java
+++ /dev/null
@@ -1,60 +0,0 @@
-package edu.columbia.cs.psl.vmvm;
-
-import java.lang.reflect.InvocationTargetException;
-import java.util.HashMap;
-
-import edu.columbia.cs.psl.vmvm.struct.MethodInvocation;
-
-
-public abstract class AbstractLazyCloningInterceptor extends AbstractInterceptor {
-
-	public AbstractLazyCloningInterceptor(Object intercepted) {
-		super(intercepted);
-	}
-	public static Object getRootCallee()
-	{
-		return createdCallees.get(getThreadChildId());
-	}
-	private static HashMap<Integer, Object> createdCallees = new HashMap<Integer, Object>();
-	protected Thread createRunnerThread(final MethodInvocation inv, boolean isChild)
-	{
-			final int id = (isChild ? nextId.getAndIncrement() : 0);
-		return new Thread(new ThreadGroup(THREAD_PREFIX+id),new Runnable() {
-
-			public void run() {
-				try {
-					createdCallees.put(id, inv.getCallee());
-					if(id > 0)
-					setAsChild(inv.getCallee(),id);
-					if (inv.getMethod() == null)
-						throw new NullPointerException();
-					System.out.println("Calling " + inv.getMethod());
-					inv.setReturnValue(inv.getMethod().invoke(inv.getCallee(), inv.getParams()));
-					cleanupChild(id);
-				} catch (SecurityException e) {
-					e.printStackTrace();
-				} catch (IllegalArgumentException e) {
-					e.printStackTrace();
-				} catch (IllegalAccessException e) {
-					e.printStackTrace();
-				} catch (InvocationTargetException e) {
-					e.printStackTrace();
-				} catch (NullPointerException e) {
-					e.printStackTrace();
-				}
-			}
-		},THREAD_PREFIX+id);
-	}
-	protected Thread createChildThread(MethodInvocation inv)
-	{
-		return createRunnerThread(inv, true);
-	}
-
-	@Override
-	protected void cleanupChild(int childId) {
-		super.cleanupChild(childId);
-		createdCallees.remove(childId);
-	}
-
-
-}
diff --git a/src/edu/columbia/cs/psl/vmvm/CloningUtils.java b/src/edu/columbia/cs/psl/vmvm/CloningUtils.java
deleted file mode 100644
index 1d6c25e..0000000
--- a/src/edu/columbia/cs/psl/vmvm/CloningUtils.java
+++ /dev/null
@@ -1,95 +0,0 @@
-package edu.columbia.cs.psl.vmvm;
-
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.net.URI;
-import java.util.HashSet;
-import java.util.IdentityHashMap;
-import java.util.concurrent.locks.ReadWriteLock;
-import java.util.concurrent.locks.ReentrantReadWriteLock;
-import java.util.zip.Deflater;
-import java.util.zip.Inflater;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipFile;
-
-import com.rits.cloning.Cloner;
-
-public class CloningUtils {
-	public static boolean				CATCH_ALL_ERRORS	= true;
-	private static Cloner				cloner				= new Cloner();
-	public static ReadWriteLock		exportLock			= new ReentrantReadWriteLock();
-	private static HashSet<Class<?>>	moreIgnoredImmutables;
-	private static HashSet<Class<?>>	nullInsteads;
-
-	private static BufferedWriter		log;
-	static {
-		try{
-		moreIgnoredImmutables = new HashSet<Class<?>>();
-		moreIgnoredImmutables.add(ClassLoader.class);
-		moreIgnoredImmutables.add(Thread.class);
-		moreIgnoredImmutables.add(URI.class);
-		moreIgnoredImmutables.add(File.class);
-		moreIgnoredImmutables.add(ZipFile.class);
-		moreIgnoredImmutables.add(ZipEntry.class);
-		moreIgnoredImmutables.add(Inflater.class);
-//		moreIgnoredImmutables.add(InputStream.class);
-//		moreIgnoredImmutables.add(OutputStream.class);
-		moreIgnoredImmutables.add(Deflater.class);
-//		moreIgnoredImmutables.add(Socket.class);
-//		moreIgnoredImmutables.add(ServerSocket.class);
-//		moreIgnoredImmutables.add(Channel.class);
-//		moreIgnoredImmutables.add(Closeable.class);
-		moreIgnoredImmutables.add(Class.class);
-		cloner.setExtraImmutables(moreIgnoredImmutables);
-//		cloner.setDumpClonedClasses(true);
-//		try {
-			File f = new File("cloneLog");
-			if (f.exists())
-				f.delete();
-			log = new BufferedWriter(new FileWriter("cloneLog"));
-		}
-//		} catch (IOException e) {
-			// TODO Auto-generated catch block
-//			e.printStackTrace();
-//		}
-		catch(Throwable t)
-		{
-			System.err.println("AHAHAHAHAHAHAH");
-			t.printStackTrace();
-//			throw t;
-		}
-	}
-
-	public static final <T> T clone(T obj, String debug, int sandboxFlag) {
-// 		System.out.println("source>"+obj + ";"+debug + "; " + sandboxFlag);
-			return cloner.deepClone(obj, sandboxFlag);
-	}
-	public static final <T> T clone(T obj, String debug) {
-		if(obj == null)
-			return null;
-		try {
-			log.append(debug);
-			log.newLine();
-			log.flush();
-		} catch (IOException e) {
-			// TODO Auto-generated catch block
-			e.printStackTrace();
-		}
-		return cloner.deepClone(obj,0);
-	}
-
-	public static String debugString(String in)
-	{
-		if(in != null && in.contains("equalsstartt"))
-		{
-			System.out.println("Method return: >" + in);
-			new Exception().printStackTrace();
-		}
-		return in;
-	}
-	public static IdentityHashMap<Object, Object>	cloneCache	= new IdentityHashMap<Object, Object>();	;
-
-
-}
diff --git a/src/edu/columbia/cs/psl/vmvm/asm/mvs/CloningAdapter.java b/src/edu/columbia/cs/psl/vmvm/asm/mvs/CloningAdapter.java
index fee4349..6420aba 100644
--- a/src/edu/columbia/cs/psl/vmvm/asm/mvs/CloningAdapter.java
+++ b/src/edu/columbia/cs/psl/vmvm/asm/mvs/CloningAdapter.java
@@ -8,7 +8,6 @@ import org.objectweb.asm.Opcodes;
 import org.objectweb.asm.Type;
 import org.objectweb.asm.commons.InstructionAdapter;

-import edu.columbia.cs.psl.vmvm.CloningUtils;

 public class CloningAdapter extends InstructionAdapter implements Opcodes {

@@ -67,70 +66,7 @@ public class CloningAdapter extends InstructionAdapter implements Opcodes {

 	private void _generateClone(String typeOfField, String debug, boolean secondElHasArrayLen) {
 		Type fieldType = Type.getType(typeOfField);
-//		println("Generate clone: "+ debug);
-		if (
-		// fieldType.getSort() == Type.ARRAY &&
-		// fieldType.getElementType().getSort()
-		// ||
-		fieldType.getSort() == Type.VOID || (fieldType.getSort() != Type.ARRAY && (fieldType.getSort() != Type.OBJECT || immutableClasses.contains(typeOfField)))) {
-			//			 println("reference> " + debug);
-			return;
-		}
-		if (fieldType.getSort() == Type.ARRAY) {
-			if (fieldType.getElementType().getSort() != Type.OBJECT || immutableClasses.contains(fieldType.getElementType().getDescriptor())) {
-				//				 println("array> " + debug);

-				// Just need to duplicate the array
-				dup();
-				Label nullContinue = new Label();
-				visitJumpInsn(IFNULL, nullContinue);
-				if (secondElHasArrayLen) {
-					swap();
-				} else {
-					dup();
-					visitInsn(ARRAYLENGTH);
-				}
-				dup();
-				newarray(Type.getType(fieldType.getDescriptor().substring(1)));
-				dupX2();
-				swap();
-
-				iconst(0);
-				dupX2();
-				swap();
-				super.visitMethodInsn(Opcodes.INVOKESTATIC, "java/lang/System", "arraycopy", "(Ljava/lang/Object;ILjava/lang/Object;II)V");
-				Label noNeedToPop = new Label();
-				if (secondElHasArrayLen) {
-					visitJumpInsn(GOTO, noNeedToPop);
-					visitLabel(nullContinue);
-					swap();
-					pop();
-				} else {
-					visitLabel(nullContinue);
-				}
-
-				visitLabel(noNeedToPop);
-
-			} else {
-				// println("heavy> " + debug);
-				// Just use the reflective cloner
-				visitLdcInsn(debug);
-//				getSandboxFlag();
-				invokestatic(Type.getType(CloningUtils.class).getInternalName(), "clone", "(Ljava/lang/Object;Ljava/lang/String;)Ljava/lang/Object;");
-				//				invokeStatic(Type.getType(CloningUtils.class), Method.getMethod("Object clone(Object, String, int)"));
-				checkcast(fieldType);
-			}
-		} else if (fieldType.getClassName().contains("InputStream") || fieldType.getClassName().contains("OutputStream") || fieldType.getClassName().contains("Socket")) {
-			// Do nothing
-		} else {
-			// println("heavy> " + debug);
-			visitLdcInsn(debug);
-//			getSandboxFlag();
-			visitMethodInsn(INVOKESTATIC,Type.getType(CloningUtils.class).getInternalName(), "clone", "(Ljava/lang/Object;Ljava/lang/String;)Ljava/lang/Object;");
-			//			invokeStatic(Type.getType(CloningUtils.class), Method.getMethod("Object clone(Object, String, int)"));
-			checkcast(fieldType);
-
-		}
 //		println("Complete clone: " + debug);
 	}
 }
diff --git a/src/edu/columbia/cs/psl/vmvm/asm/mvs/InvivoAdapter.java b/src/edu/columbia/cs/psl/vmvm/asm/mvs/InvivoAdapter.java
index deddf5f..3bc4ec6 100644
--- a/src/edu/columbia/cs/psl/vmvm/asm/mvs/InvivoAdapter.java
+++ b/src/edu/columbia/cs/psl/vmvm/asm/mvs/InvivoAdapter.java
@@ -1,9 +1,7 @@
 package edu.columbia.cs.psl.vmvm.asm.mvs;

-import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.HashMap;
-import java.util.HashSet;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.NoSuchElementException;
@@ -12,19 +10,9 @@ import org.objectweb.asm.Label;
 import org.objectweb.asm.MethodVisitor;
 import org.objectweb.asm.Opcodes;
 import org.objectweb.asm.Type;
-import org.objectweb.asm.commons.AdviceAdapter;
 import org.objectweb.asm.commons.GeneratorAdapter;
-import org.objectweb.asm.commons.InstructionAdapter;
-import org.objectweb.asm.commons.LocalVariablesSorter;
-import org.objectweb.asm.commons.Method;
-import org.objectweb.asm.tree.ClassNode;
 import org.objectweb.asm.tree.LocalVariableNode;
-import org.objectweb.asm.tree.MethodNode;

-import sun.util.logging.resources.logging;
-
-import edu.columbia.cs.psl.vmvm.CloningUtils;
-import edu.columbia.cs.psl.vmvm.Constants;
 import edu.columbia.cs.psl.vmvm.Instrumenter;
 import edu.columbia.cs.psl.vmvm.VMState;
 import edu.columbia.cs.psl.vmvm.asm.struct.EqMethodNode;
diff --git a/src/edu/columbia/cs/psl/vmvm/asm/mvs/StaticFieldIsolatorMV.java b/src/edu/columbia/cs/psl/vmvm/asm/mvs/StaticFieldIsolatorMV.java
index a14b96c..d866d01 100644
--- a/src/edu/columbia/cs/psl/vmvm/asm/mvs/StaticFieldIsolatorMV.java
+++ b/src/edu/columbia/cs/psl/vmvm/asm/mvs/StaticFieldIsolatorMV.java
@@ -1,29 +1,21 @@
 package edu.columbia.cs.psl.vmvm.asm.mvs;

-import java.util.Collection;
-import java.util.HashMap;
 import java.util.HashSet;
-import java.util.Map;

 import org.objectweb.asm.Label;
 import org.objectweb.asm.MethodVisitor;
 import org.objectweb.asm.Opcodes;
 import org.objectweb.asm.Type;
-import org.objectweb.asm.commons.InstructionAdapter;
 import org.objectweb.asm.commons.LocalVariablesSorter;
 import org.objectweb.asm.tree.ClassNode;
-import org.objectweb.asm.tree.FieldInsnNode;
 import org.objectweb.asm.tree.FieldNode;

-import edu.columbia.cs.psl.vmvm.CloningUtils;
 import edu.columbia.cs.psl.vmvm.Constants;
 import edu.columbia.cs.psl.vmvm.Instrumenter;
 import edu.columbia.cs.psl.vmvm.VirtualRuntime;
-import edu.columbia.cs.psl.vmvm.VMState;
 import edu.columbia.cs.psl.vmvm.asm.JUnitResettingClassVisitor;
 import edu.columbia.cs.psl.vmvm.asm.VMVMClassVisitor;
 import edu.columbia.cs.psl.vmvm.asm.struct.EqFieldInsnNode;
-import edu.columbia.cs.psl.vmvm.asm.struct.EqMethodInsnNode;
 import edu.columbia.cs.psl.vmvm.asm.struct.EqMethodNode;
 import edu.columbia.cs.psl.vmvm.asm.struct.MethodListClassNode;

diff --git a/src/edu/columbia/cs/psl/vmvm/eval/DacapoPatchCallback.java b/src/edu/columbia/cs/psl/vmvm/eval/DacapoPatchCallback.java
deleted file mode 100644
index 234c1e2..0000000
--- a/src/edu/columbia/cs/psl/vmvm/eval/DacapoPatchCallback.java
+++ /dev/null
@@ -1,32 +0,0 @@
-package edu.columbia.cs.psl.vmvm.eval;
-
-import org.dacapo.harness.Callback;
-import org.dacapo.harness.CommandLineArgs;
-
-public class DacapoPatchCallback extends Callback {
-
-	  public DacapoPatchCallback(CommandLineArgs args) {
-	    super(args);
-	  }
-
-	  /* Immediately prior to start of the benchmark */
-	  public void start(String benchmark) {
-	    System.err.println("my hook starting " + (isWarmup() ? "warmup " : "") + benchmark);
-	    System.exit(-1);
-	    super.start(benchmark);
-	  };
-
-	  /* Immediately after the end of the benchmark */
-	  public void stop() {
-	    super.stop();
-	    System.err.println("my hook stopped " + (isWarmup() ? "warmup" : ""));
-	    System.err.flush();
-	  };
-
-	  public void complete(String benchmark, boolean valid) {
-	    super.complete(benchmark, valid);
-	    System.err.println("my hook " + (valid ? "PASSED " : "FAILED ") + (isWarmup() ? "warmup " : "") + benchmark);
-	    System.err.flush();
-	  };
-	}
-