-
Feature Request
-
Resolution: Done
-
Major
-
None
-
None
PojoCache 2.2.0.CR5+ supports array interception. Task here is to uncomment the section in jbossweb-cluster.aop/META-INF/jboss-aop.xml that enables it and add a couple tweaks to the FIELD test cases so it gets exercised.
This can't be done until aop moves to 2.0.0.CR14.
Array interception means invoking the changeIt(...) method in a web session pojo would result in the change being detected and just one String being replicated:
public class Pojo {
private String[] array = new String[1000];
public void changeIt(int index, String newValue)
{ this.array[index] = newValue; }}
Before this PojoCache improvement, PC wouldn't detect the array element change, so the changeIt(...) method would have had to reassign the 'array' field:
public class Pojo {
private String[] array = new String[1000];
public void changeIt(int index, String newValue)
{ String[] array1 = array; array1[index] = newValue; // Do a new field assignment so PojoCache knows something changed this.array = array1; }}
Besides being odd looking and easy to forget to do, that code would result in the whole array being replicated rather than just one String.