With minor modifications , it may be simpler
class ByteArray
{
private byte[] array;
private int counter = 0;
public ByteArray(int size)
{
array = new byte[size];
}
public ByteArray add(byte b)
{
array[counter]=b;
counter++;
return this;
}
public byte[] getArray()
I have a trick to solve this problem, create a utility class like:
class ByteArray
{
private byte[] array;
public ByteArray(int size)
{
array = new byte[size];
}
public ByteArray set(int index,byte b)
{
array[index]=b;
return this;
}
public byte[] getArray()
{
retu
instrument() always recognize an array index modification as read access.
Example:
class MyClass
{
private int[] a = new int[3];
public void example()
{
a[2] = 5;
}
}
Using instrument() with CodeConverter detect "a[2] = " as a read field access of
"a". There is no way to modi
instrument(ExprEditor) doesn't recognize new type[ ] as NewExpr
Example:
public int[] myarray = new int[10];
is not recognized calling CtClass.instrument() and filtering with NewExpr
occurrences.
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3825359#3825359";>View
the orig
Thank you.
A suggestion: there are very good parser generators like ANTLR and JavaCC with very
accurate Java sintax analizers, I think.
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3825349#3825349";>View
the original post
http://www.jboss.org/index.html?module=bb&op=posting&
Javassist 2.6 doesnÃÂt compile the singleton expression:
Class cls = AnyNameClassOrInterface.class;
inside a body source doing CtNewMethod.make
Perhaps the parser doesn't recognize .class as especial static member (does Javassist
thinks is a package...?)
http://www.jboss.org/index.html?m