Commit a796a733 authored by Yudi Zheng's avatar Yudi Zheng
Browse files

Implement the marker factory and add a default empty marker.

parent 4dae2194
package ch.usi.dag.disl.snippet.marker;
import java.util.LinkedList;
import java.util.List;
import org.objectweb.asm.tree.MethodNode;
public class EmptyMarker implements Marker {
@Override
public List<MarkedRegion> mark(MethodNode method) {
return new LinkedList<MarkedRegion>();
}
}
......@@ -5,9 +5,11 @@ import org.objectweb.asm.Type;
public class MarkerFactory {
public static Marker createMarker(Type marker) {
// TODO! implement
// load class according to Type and instantiate
return null;
try {
return (Marker) Class.forName(marker.getClassName()).newInstance();
} catch (Exception e) {
e.printStackTrace();
return new EmptyMarker();
}
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment