@Override public void visitInsn(int opcode) { // We don't use the AdviceAdapter here because this is not properly initialised if the constructor is // exited with an exception if(opcode == Opcodes.RETURN) { loadThis(); invokeStatic(Type.getType(org.evosuite.runtime.System.class), Method.getMethod("void registerObjectForIdentityHashCode(Object)")); } super.visitInsn(opcode); } }
/** {@inheritDoc} */ @Override public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) { if(name.equals("hashCode")) definesHashCode = true; MethodVisitor mv = super.visitMethod(access, name, desc, signature, exceptions); if(name.equals("<init>")) { mv = new RegisterObjectForDeterministicHashCodeVisitor(mv, access, name, desc); } return new MethodCallReplacementMethodAdapter(mv, className, superClassName, name, access, desc); }