Clone Tools
  • last updated a few seconds ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Disable compilation when injecting into inner classes -- part-fix for BYTEMAN-288

References to inner classes from compiled rule code cause verify

errors. However, these errors can be avoided if instead the ruel code

is interpreted. This fix disables compilation of rule code for any

INTERFACE rule or overriding CLASS (with a ^) rule whose trigger class

is found to be an inner class. Note that these two cases are treated

specially because there are legitimate cases where compilation might

be appropriate for some trigger classes which match the rule but will

cause problems with other matches. If compilation is specified using a

normal (non-overriding) CLASS rule and the target class is an inner

class then that is a spec error so Byteman generates bytecode and an

error results.

This is merely a limited heuristic which has both false positives and

negatives. It can interpret rules whcih might legitimately compile

(e.g. they don't use $0) and pass rules which will still fail to

compile (e.g. $1 is an inner class). It also doesn't detect cases

where the inner class is non-static (guaranteed to fail if we try to

use the inner instance with no handle on the enclosing wrapper

instance). A better fix requires upgarding the type check methods of

Expression classes to detect uses of inner classes and either disable

compilation or throw a type exception.

    • -0
    • +33
    ./auxiliary/TestInnerAbstract.java
    • -0
    • +162
    ./auxiliary/TestInnerAuxiliary.java
    • -0
    • +34
    ./auxiliary/TestInnerInterface.java
    • -0
    • +80
    ./bugfixes/TestInnerClasses.java
  1. … 6 more files in changeset.
changed all occurrences of new XXX to XXX.valueOf for boxed numeric types XXX

    • -1
    • +1
    ./bugfixes/TestBooleanComparisons.java
  1. … 8 more files in changeset.
test for LinkMap builtins -- part of fix for BYTEMAN-313

    • -0
    • +110
    ./helpertests/TestLinkMap.java
  1. … 2 more files in changeset.
fix and test case for BYTEMAN-304

    • -0
    • +34
    ./auxiliary/Child.java
    • -0
    • +34
    ./auxiliary/Parent.java
    • -0
    • +86
    ./bugfixes/TestConstructorArgUpcast.java
  1. … 4 more files in changeset.
fix and test case for BYTEMAN-302

    • -0
    • +67
    ./bugfixes/TestDoubleEntryBookKeeping.java
  1. … 3 more files in changeset.
Distinguish between boolean and int local vars -- fixes BYTEMAN-298

    • -0
    • +73
    ./bugfixes/TestBooleanLocal.java
  1. … 4 more files in changeset.
expression lists for array initializatio -- fixes BYTEMAN-291

  1. … 11 more files in changeset.
Extra test cases to validate behaviour of fix for BYTEMAN-237

The test cases pin down the way RETURN and THROW work in AT EXCEPTION

EXIT rules, specifically how this manifests when mro ethan one AT

EXCEPTION EXIT rule is employed in the same method.

With no THROW or RETURN in the first rule an uncaught exception

passing through the target method is processed by each AT EXCEPTION

EXIT rule in turn (as exemplified by the call to method

testMethodMultiRule3).

When the first rule uses THROW the second rule is still triggered but

it is passed the exception THROWN by the first rule which need not be

the original exception (as exemplified by the call to method

testMethodMultiRule). That's contrary to existing documented behaviour

where a THROW is supposed to short-circuit further method and rule

execution with an exceptional return from the target method. This

behaviour needs special-casing in the user guide.

When the first rule uses RETURN (as exemplified by the call to method

testMethodMultiRule2) this bypasses the 2nd rule i.e. it

short-circuits further rule processing as per the existing documented

behaviour.

These behaviours are acceptable so long as they are properly

documented.

    • -6
    • +81
    ./auxiliary/TestExceptionExitAuxiliary.java
  1. … 1 more file in changeset.
Add support for exceptional exit

    • -0
    • +144
    ./auxiliary/TestExceptionExitAuxiliary.java
    • -0
    • +78
    ./location/TestExceptionExit.java
  1. … 6 more files in changeset.
correct array arg type checking -- fix and test case for BYTEMAN-277

    • -0
    • +63
    ./bugfixes/TestArrayArgTypeCheck.java
  1. … 3 more files in changeset.
test case for BYTEMAN-275

    • -0
    • +68
    ./bugfixes/TestPlusExpressionCoerce.java
  1. … 2 more files in changeset.
added test cases for fix to BYTEMAN-258

    • -0
    • +64
    ./bugfixes/TestJoinWaitTimeout.java
    • -0
    • +64
    ./bugfixes/TestRendezvousTimeout.java
  1. … 2 more files in changeset.
Fixed BYTEMAN-259 and added test case

    • -0
    • +102
    ./bugfixes/TestMethodClauseReturnTypeDynamic.java
  1. … 3 more files in changeset.
Added ability to mention class literals in rule code -- fixes BYTEMAN-251

    • -0
    • +54
    ./javaops/TestClassLiteral.java
  1. … 12 more files in changeset.
use correct type for checkcast at update of local var -- fixes BYTEMAN-252

    • -0
    • +56
    ./bugfixes/TestLocalUpdateType.java
  1. … 4 more files in changeset.
correct stack height computation for fields -- fixes BYTEMAN-253

    • -0
    • +67
    ./bugfixes/TestStackHeight.java
  1. … 3 more files in changeset.
corrected boolean comparisons and added test case -- fixes for BYTEMAN-246

    • -0
    • +98
    ./bugfixes/TestBooleanComparisons.java
  1. … 3 more files in changeset.
Added two new special variables $CLASS and $METHOD -- fixes for BYTEMAN-239

Still need to update the documentation

    • -0
    • +83
    ./misc/TestTriggerClassMethodBinding.java
  1. … 8 more files in changeset.
completed refactoring of check code fixes for BYTEMAN-190

Added ability to store info messages to RuleCheckResult

Tweaked class RuleCheck so that it will stream messages to a

printstream as well as collect them in theits RuleCheckResult

Modified TestScript class -- the one used by bmcheck -- so that it

delegates to class RuleCheck

Replaced RuleCheck.isOk() with RuleCheck.hasErrors() to be in keeping

with hasWarnings() and modified TestRuleCheck and RuleCheckMojo to use

this method to test the result.

Made TestRuleCheck print warnings as well as errors so we see at build

time which rules in the test rule set have warnigns against them.

  1. … 4 more files in changeset.
moved script checker code into common package and renamed maven checker jar

  1. … 12 more files in changeset.
Test case code for BYTEMAN-236

n.b. this test is not run from the test suite as the related issue has

not yet been resolved

    • -0
    • +43
    ./auxiliary/TestAnonAuxiliary.java
    • -0
    • +73
    ./bugfixes/TestAnonClassCompile.java
  1. … 1 more file in changeset.
BYTEMAN-190 update to add rule check api and rulecheck-maven-plugin

    • -0
    • +72
    ./api/TestRuleCheck.java
  1. … 11 more files in changeset.
corrected error in stack max computation for method expressions -- fixes BYTEMAN-232

    • -0
    • +66
    ./bugfixes/TestMaxStackComputation.java
  1. … 4 more files in changeset.
added support for downcasting in local var initialisation in BBIND clauses - fixes BYTEMAN-225

    • -0
    • +72
    ./misc/TestDowncast.java
  1. … 5 more files in changeset.
new files for fix to BYTEMAN-219

    • -7
    • +63
    ./bugfixes/TestAbstractInterfaceCall.java
  1. … 3 more files in changeset.
added test case for

fixed problem with method compilation where it was planting an

invokevirtual where invokeinterface was needed

fixes for BYTEMAN-219

    • -0
    • +11
    ./bugfixes/TestAbstractInterfaceCall.java
  1. … 1 more file in changeset.
fixed BYTEMAN-210

implemented support for array length accesses i.e. expressions of the

form arrayExpression.length

modified the type checker so AssignableExpressions know whether they

are type checkign as an LVALUE or RVALUE -- this i sneeded to ensure

attempts to update arrayExpression.length are rejected with a type

error

modifed the grammar so that array indexed terms can appear as the target

of a field dereference without needing bracketing

extended the test case in TestArray to check that array length

accesses are ok. the test case does not include an example where

arrayExpression.length is used as an LVALUE because this just throws

an exception but this was checked manually.

  1. … 12 more files in changeset.
upgraded method param name test to include reference to local variable as well as method params

  1. … 1 more file in changeset.
corrected expected output

fix for BYTEMAN-205 c/o James Livingstone's patch -- slightly modified

    • -0
    • +40
    ./helpers/TestThread.java
  1. … 2 more files in changeset.