Skip to content
Snippets Groups Projects
Commit 151155c5 authored by Hague Matthew UXAC009's avatar Hague Matthew UXAC009
Browse files

Add support for constructing arrays in the logs

Currently only for constructing "safe" arrays that you want to use as
arguments to student code -- no failure messages provided if
construction fails beyond the normal java reflection exceptions.

Use

    Character[] cs = new Character[] { 'A', 'B', 'C' };
    Object arr = codeTester.constructArray(char.class, cs);
    codeTester.construct("StudentClass", arr);

An example would be if you want a log

    char[] c0 = new char[] { 'A', 'B', 'C' };
    StudentClass sc0 = new StudentClass(c0);

which is better than

    StudentClass sc0 = new StudentClass([c@a82324234);

which it shows if you just passed "new char[] { 'A', 'B', 'C' }".
parent 8ab1f655
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment