// Path: cobertura/src/main/java/net/sourceforge/cobertura/util/RegexUtil.java
// public abstract class RegexUtil {
// 
// 	private static final Logger logger = Logger.getLogger(RegexUtil.class);
// 
// 	/**
// 	 * <p>
// 	 * Check to see if one of the regular expressions in a collection match
// 	 * an input string.
// 	 * </p>
// 	 *
// 	 * @param regexs The collection of regular expressions.
// 	 * @param str    The string to check for a match.
// 	 *
// 	 * @return True if a match is found.
// 	 */
// 	public static boolean matches(Collection regexs, String str) {
// 		Iterator iter = regexs.iterator();
// 		while (iter.hasNext()) {
// 			Pattern regex = (Pattern) iter.next();
// 			Matcher m = regex.matcher(str);
// 			if (m.matches()) {
// 				return true;
// 			}
// 		}
// 
// 		return false;
// 	}
// 
// 	public static void addRegex(Collection list, String regex) {
// 		try {
// 			Pattern pattern = Pattern.compile(regex);
// 			list.add(pattern);
// 		} catch (PatternSyntaxException pse) {
// 			logger.warn("The regular expression " + regex + " is invalid: "
// 					+ pse.getLocalizedMessage());
// 		}
// 	}
// 
// }


import org.objectweb.asm.tree.InsnNode;
import org.objectweb.asm.tree.MethodInsnNode;
import org.objectweb.asm.tree.VarInsnNode;
import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.regex.Pattern;
import net.sourceforge.cobertura.util.RegexUtil;
import org.objectweb.asm.Label;
import org.objectweb.asm.MethodVisitor;
import org.objectweb.asm.Opcodes;
import org.objectweb.asm.tree.AbstractInsnNode;
	public void visitLabel(Label label) {
		int eventId = getEventId();
		touchPointListener.beforeLabel(eventId, label, currentLine, mv);
		super.visitLabel(label);
		touchPointListener.afterLabel(eventId, label, currentLine, mv);
	}

	@Override
	public void visitJumpInsn(int opcode, Label label) {
		/* Ignore any jump instructions in the "class init" method.
		 When initializing static variables, the JVM first checks
		 that the variable is null before attempting to set it.
		 This check contains an IFNONNULL jump instruction which
		 would confuse people if it showed up in the reports.*/
		if ((opcode != Opcodes.GOTO) && (opcode != Opcodes.JSR)
				&& (currentLine != 0) && (!methodName.equals("<clinit>"))) {
			int eventId = getEventId();
			touchPointListener.beforeJump(eventId, label, currentLine, mv);
			super.visitJumpInsn(opcode, label);
			touchPointListener.afterJump(eventId, label, currentLine, mv);
		} else {
			super.visitJumpInsn(opcode, label);
		}
	}

	@Override
	public void visitMethodInsn(int opcode, String owner, String method,
			String descr) {
		super.visitMethodInsn(opcode, owner, method, descr);
		//We skip lines that contains call to methods that are specified inside ignoreRegexp
// Path: cobertura/src/main/java/net/sourceforge/cobertura/util/RegexUtil.java
// public abstract class RegexUtil {
// 
// 	private static final Logger logger = Logger.getLogger(RegexUtil.class);
// 
// 	/**
// 	 * <p>
// 	 * Check to see if one of the regular expressions in a collection match
// 	 * an input string.
// 	 * </p>
// 	 *
// 	 * @param regexs The collection of regular expressions.
// 	 * @param str    The string to check for a match.
// 	 *
// 	 * @return True if a match is found.
// 	 */
// 	public static boolean matches(Collection regexs, String str) {
// 		Iterator iter = regexs.iterator();
// 		while (iter.hasNext()) {
// 			Pattern regex = (Pattern) iter.next();
// 			Matcher m = regex.matcher(str);
// 			if (m.matches()) {
// 				return true;
// 			}
// 		}
// 
// 		return false;
// 	}
// 
// 	public static void addRegex(Collection list, String regex) {
// 		try {
// 			Pattern pattern = Pattern.compile(regex);
// 			list.add(pattern);
// 		} catch (PatternSyntaxException pse) {
// 			logger.warn("The regular expression " + regex + " is invalid: "
// 					+ pse.getLocalizedMessage());
// 		}
// 	}
// 
// }


// Path: cobertura/src/main/java/net/sourceforge/cobertura/instrument/FindTouchPointsMethodAdapter.java
import org.objectweb.asm.tree.InsnNode;
import org.objectweb.asm.tree.MethodInsnNode;
import org.objectweb.asm.tree.VarInsnNode;
import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.regex.Pattern;
import net.sourceforge.cobertura.util.RegexUtil;
import org.objectweb.asm.Label;
import org.objectweb.asm.MethodVisitor;
import org.objectweb.asm.Opcodes;
import org.objectweb.asm.tree.AbstractInsnNode;

	public void visitLabel(Label label) {
		int eventId = getEventId();
		touchPointListener.beforeLabel(eventId, label, currentLine, mv);
		super.visitLabel(label);
		touchPointListener.afterLabel(eventId, label, currentLine, mv);
	}

	@Override
	public void visitJumpInsn(int opcode, Label label) {
		/* Ignore any jump instructions in the "class init" method.
		 When initializing static variables, the JVM first checks
		 that the variable is null before attempting to set it.
		 This check contains an IFNONNULL jump instruction which
		 would confuse people if it showed up in the reports.*/
		if ((opcode != Opcodes.GOTO) && (opcode != Opcodes.JSR)
				&& (currentLine != 0) && (!methodName.equals("<clinit>"))) {
			int eventId = getEventId();
			touchPointListener.beforeJump(eventId, label, currentLine, mv);
			super.visitJumpInsn(opcode, label);
			touchPointListener.afterJump(eventId, label, currentLine, mv);
		} else {
			super.visitJumpInsn(opcode, label);
		}
	}

	@Override
	public void visitMethodInsn(int opcode, String owner, String method,
			String descr) {
		super.visitMethodInsn(opcode, owner, method, descr);
		//We skip lines that contains call to methods that are specified inside ignoreRegexp
		if (RegexUtil.matches(ignoreRegexp, owner)) {