Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

compile rules during type check if compile.to.bytecode is enabled - f…

…ixes BYTEMAN-257
  • Loading branch information...
commit f85ab350a0e552002f9cbaab79c8764da30f9196 1 parent 5651629
Andrew Dinn authored
Showing with 10 additions and 0 deletions.
  1. +10 −0 agent/src/main/java/org/jboss/byteman/check/RuleCheck.java
10 agent/src/main/java/org/jboss/byteman/check/RuleCheck.java
View
@@ -259,12 +259,16 @@ public void checkRules() {
try {
rule.typeCheck();
+ rule.compile();
} catch (TypeWarningException te) {
typeWarning("WARNING : Unable to type check rule \"" + script.getName() + "\" loaded from " + script.getFile() + " line " + script.getLine() + (methodName == null ? "" : " against method " + methodName), te);
continue;
} catch (TypeException te) {
typeError("ERROR : Failed to type check rule \"" + script.getName() + "\" loaded from " + script.getFile() + " line " + script.getLine() + (methodName == null ? "" : " against method " + methodName), te);
continue;
+ } catch (CompileException ce) {
+ typeError("ERROR : Failed to compile rule \"" + script.getName() + "\" loaded from " + script.getFile() + " line " + script.getLine() + (methodName == null ? "" : " against method " + methodName), ce);
+ continue;
}
if (script.isOverride()) {
@@ -377,6 +381,7 @@ private void typeCheckAgainstMethodDeclaration(Rule rule, RuleScript script, Cla
if (paramErrorCount == 0) {
try {
rule.typeCheck();
+ rule.compile();
} catch (TypeWarningException te) {
typeWarning("WARNING : Unable to type check rule \"" + script.getName() + "\" loaded from " + script.getFile() + " line " + script.getLine(), te);
System.out.println(te);
@@ -387,6 +392,11 @@ private void typeCheckAgainstMethodDeclaration(Rule rule, RuleScript script, Cla
System.out.println(te);
System.out.println();
return;
+ } catch (CompileException ce) {
+ typeError("ERROR : Failed to compile rule \"" + script.getName() + "\" loaded from " + script.getFile() + " line " + script.getLine(), ce);
+ System.out.println(ce);
+ System.out.println();
+ return;
}
if (script.isInterface()) {
info("Type checked interface rule \"" + script.getName() + "\" against method declaration");
Please sign in to comment.
Something went wrong with that request. Please try again.