1
2
3
4
5
6
7
8 package it.imolinfo.jbi4corba.webservice.generator.bcm;
9
10 import it.imolinfo.jbi4corba.Logger;
11 import it.imolinfo.jbi4corba.LoggerFactory;
12 import it.imolinfo.jbi4corba.webservice.generator.AnyType;
13 import it.imolinfo.jbi4corba.webservice.generator.TypeUtils;
14
15 import org.objectweb.asm.MethodVisitor;
16 import org.objectweb.asm.Opcodes;
17 import org.objectweb.asm.util.TraceMethodVisitor;
18
19
20
21
22
23
24
25 public class ReplaceAnyMethodVisitor extends TraceMethodVisitor {
26
27
28
29
30 private static final Logger LOG = LoggerFactory
31 .getLogger(ConstructorModMethodVisitor.class);
32
33
34
35
36
37
38
39 public ReplaceAnyMethodVisitor(MethodVisitor mv) {
40 super(mv);
41 }
42
43
44
45
46
47
48 @Override
49 public void visitFieldInsn(int opcode, String className, String fieldName,
50 String fieldType) {
51
52 LOG.debug("<<<<< AppenderMethodVisitor.visitInsn - end");
53 if (opcode == Opcodes.PUTFIELD) {
54
55 String arrayStr = TypeUtils.getArrayDimmentionAsPrefix(fieldType);
56 boolean isAny = TypeUtils.getTypeFromTypeDescription(fieldType).equals(AnyType.CORBA_ANY_TYPE);
57 if (isAny) {
58
59 fieldType = arrayStr + "Ljava/lang/Object;";
60 }
61 }
62 super.visitFieldInsn(opcode, className, fieldName, fieldType);
63
64 }
65
66 }