In BCEL, I would like to initialize static fields in the static initializer of a class. I haven't found a way to do so however... any hints?
I need something like:
// Field descriptor #8 [I
private static int[] a;
static {};
0 bipush 10
2 multianewarray int[] [9]
6 putstatic Output.a : int[] [11]
9 return
I however only seem to be able to generate (with MethodGen
) things like:
public static void {}();
0 bipush 10
2 multianewarray int[] [9]
6 putstatic Output.a : int[] [11]
9 return
Which is of course not the same.