package com.cflint.plugins.core;

import ro.fortsoft.pf4j.Extension;
import cfml.parsing.cfscript.CFFunctionExpression;
import cfml.parsing.cfscript.script.CFAbortStatement;
import cfml.parsing.cfscript.script.CFExpressionStatement;
import cfml.parsing.cfscript.script.CFScriptStatement;

import com.cflint.BugInfo;
import com.cflint.BugList;
import com.cflint.plugins.CFLintScannerAdapter;
import com.cflint.plugins.Context;

@Extension
public class AbortChecker extends CFLintScannerAdapter {
	final String severity = "WARNING";

	public void expression(final CFScriptStatement expression, final Context context, final BugList bugs) {
		System.out.println(expression.getClass().getName());

		if (expression instanceof CFAbortStatement) {
			int lineNo = ((CFAbortStatement) expression).getLine();
			bugs.add(new BugInfo.BugInfoBuilder().setLine(lineNo).setMessageCode("AVOID_USING_ABORT")
				.setSeverity(severity).setFilename(context.getFilename())
				.setMessage("Abort statement at " + lineNo + ". Avoid using abort in production code.")
				.build());
		}
	}
}
@@ -524,16 +524,28 @@
 RNING%22;%0A
+%09%0A%09@Override
 %0A%09public
@@ -646,64 +646,8 @@
 ) %7B%0A
-%09%09System.out.println(expression.getClass().getName());%0A%0A
 %09%09if
@@ -747,16 +747,42 @@
 etLine()
+ + context.startLine() - 1
 ;%0A%09%09%09bug
@@ -966,16 +966,21 @@
 ment at 
+line 
 %22 + line

Remove debug and fix line number