Visit OP_ADD and OP_CLOSE, they are almost the same

@param editsOpCode op code to visit
5697
private void visit_OP_ADD_or_OP_CLOSE(FSEditLogOpCodes editsOpCode)
      throws IOException {
      visitTxId();
      if (!LayoutVersion.supports(Feature.EDITLOG_OP_OPTIMIZATION, editsVersion)) {
        IntToken opAddLength = v.visitInt(EditsElement.LENGTH);
        // this happens if the edits is not properly ended (-1 op code),
        // it is padded at the end with all zeros, OP_ADD is zero so
        // without this check we would treat all zeros as empty OP_ADD)
        if (opAddLength.value == 0) {
          throw new IOException("OpCode " + editsOpCode
              + " has zero length (corrupted edits)");
        }
      }
      
      v.visitStringUTF8(EditsElement.PATH);
      
      if (LayoutVersion.supports(Feature.ADD_INODE_ID, editsVersion)) {
        v.visitLong(EditsElement.INODE_ID);
      }
      
      if (LayoutVersion.supports(Feature.EDITLOG_OP_OPTIMIZATION, editsVersion)) {
        v.visitShort(EditsElement.REPLICATION);
        v.visitLong(EditsElement.MTIME);
        v.visitLong(EditsElement.ATIME);
        v.visitLong(EditsElement.BLOCKSIZE);
      } else {
        v.visitStringUTF8(EditsElement.REPLICATION);
        v.visitStringUTF8(EditsElement.MTIME);
        v.visitStringUTF8(EditsElement.ATIME);
        v.visitStringUTF8(EditsElement.BLOCKSIZE);
      }
      // now read blocks
      visit_Blocks();
      
      // PERMISSION_STATUS
      v.visitEnclosingElement(EditsElement.PERMISSION_STATUS);

      v.visitStringText( EditsElement.USERNAME);
      v.visitStringText( EditsElement.GROUPNAME);
      v.visitShort(      EditsElement.FS_PERMISSIONS);

      v.leaveEnclosingElement();
      if(editsOpCode == FSEditLogOpCodes.OP_ADD) {
        v.visitStringUTF8(EditsElement.CLIENT_NAME);
        v.visitStringUTF8(EditsElement.CLIENT_MACHINE);
      }
    }
898576
@SuppressWarnings("unused")
    private void opSetOptionPush() {
        // option = code[ip++]; // final for now
        pushAlt(ip, s, sprev, pkeep);
        ip += OPSize.SET_OPTION + OPSize.FAIL;
    }
176450
@Override
    public void sawOpcode(int seen) {
        String methodPackage = null;
        try {
            stack.precomputation(this);

            if (seen == Const.INVOKEVIRTUAL) {
                methodPackage = processInvokeVirtual();

            } else if (OpcodeUtils.isAStore(seen)) {
                if (stack.getStackDepth() > 0) {
                    OpcodeStack.Item item = stack.getStackItem(0);
                    Integer reg = Integer.valueOf(RegisterUtils.getAStoreReg(this, seen));
                    if (item.getUserValue() != null) {
                        XMethod xm = item.getReturnValueOf();
                        if (xm != null) {
                            toStringRegisters.put(reg, xm.getPackageName());
                        } else {
                            toStringRegisters.remove(reg);
                        }
                    } else {
                        toStringRegisters.remove(reg);
                    }
                }
            } else if (OpcodeUtils.isALoad(seen)) {
                Integer reg = Integer.valueOf(RegisterUtils.getAStoreReg(this, seen));
                methodPackage = toStringRegisters.get(reg);
            }
        } catch (ClassNotFoundException cnfe) {
            bugReporter.reportMissingClass(cnfe);
        } finally {
            TernaryPatcher.pre(stack, seen);
            stack.sawOpcode(this, seen);
            TernaryPatcher.post(stack, seen);
            if ((methodPackage != null) && (stack.getStackDepth() > 0)) {
                OpcodeStack.Item item = stack.getStackItem(0);
                item.setUserValue(methodPackage);
            }
        }
    }
422711
@Override
    public void visitCode(Code obj) {
        stack.resetForMethodEntry(this);
        nodeCreations.clear();
        nodeStores.clear();
        super.visitCode(obj);

        BitSet reportedPCs = new BitSet();
        for (Integer pc : nodeCreations.values()) {
            if (!reportedPCs.get(pc.intValue())) {
                bugReporter.reportBug(new BugInstance(this, BugType.ODN_ORPHANED_DOM_NODE.name(), NORMAL_PRIORITY).addClass(this).addMethod(this)
                        .addSourceLine(this, pc.intValue()));
                reportedPCs.set(pc.intValue());
            }
        }
        for (Integer pc : nodeStores.values()) {
            if (!reportedPCs.get(pc.intValue())) {
                bugReporter.reportBug(new BugInstance(this, BugType.ODN_ORPHANED_DOM_NODE.name(), NORMAL_PRIORITY).addClass(this).addMethod(this)
                        .addSourceLine(this, pc.intValue()));
                reportedPCs.set(pc.intValue());
            }
        }
    }
788553
@Override
    public void sawOpcode(int seen) {
        if (seen == Const.PUTFIELD) {
            OpcodeStack stack = getStack();
            if (stack.getStackDepth() > 0) {
                int reg = stack.getStackItem(0).getRegisterNumber();
                if ((reg >= 0) && (reg < firstLocalRegister)) {
                    clearSpecialField(getNameConstantOperand());
                }
            }
        }
        super.sawOpcode(seen);
    }
891285
public static void pre(OpcodeStack stack, int opcode) {
        if (sawGOTO) {
            return;
        }
        sawGOTO = (opcode == Const.GOTO) || (opcode == Const.GOTO_W);
        if (sawGOTO) {
            int depth = stack.getStackDepth();
            if (depth > 0) {
                userValues.clear();
                for (int i = 0; i < depth; i++) {
                    OpcodeStack.Item item = stack.getStackItem(i);
                    userValues.add(item.getUserValue());
                }
            }
        }
    }
1056165
@Override
    public void visitCode(final Code obj) {
        try {
            if (methodSignatureIsConstrained) {
                return;
            }

            if (obj.getCode() == null) {
                return;
            }
            Method m = getMethod();

            if (m.isSynthetic()) {
                return;
            }

            if (m.getName().startsWith("access$")) {
                return;
            }

            methodIsStatic = m.isStatic();
            parmCount = m.getArgumentTypes().length;

            if (parmCount == 0) {
                return;
            }

            parameterDefiners.clear();
            usedParameters.clear();
            stack.resetForMethodEntry(this);

            if (buildParameterDefiners()) {
                try {
                    super.visitCode(obj);
                    reportBugs();
                } catch (StopOpcodeParsingException e) {
                    // no more possible parameter definers
                }
            }
        } catch (ClassNotFoundException cnfe) {
            bugReporter.reportMissingClass(cnfe);
        }
    }
973432
@Override
    public void visitCode(Code obj) {
        try {
            Method m = getMethod();
            if ((!m.isPublic() && !m.isProtected()) || m.isAbstract() || m.isSynthetic()) {
                return;
            }

            CodeInfo superCode = superclassCode.remove(curMethodInfo);
            if (superCode != null) {
                if (sameAccess(getMethod().getAccessFlags(), superCode.getAccess()) && codeEquals(obj, superCode.getCode())) {
                    bugReporter.reportBug(new BugInstance(this, BugType.COM_COPIED_OVERRIDDEN_METHOD.name(), NORMAL_PRIORITY).addClass(this).addMethod(this)
                            .addSourceLine(classContext, this, getPC()));
                    return;
                }

                if ((getMethod().getAccessFlags() & Const.ACC_SYNCHRONIZED) != (superCode.getAccess() & Const.ACC_SYNCHRONIZED)) {
                    return;
                }

                parmTypes = getMethod().getArgumentTypes();
                nextParmIndex = 0;
                nextParmOffset = getMethod().isStatic() ? 0 : 1;
                sawAload0 = nextParmOffset == 0;
                sawParentCall = false;
                super.visitCode(obj);
            }
        } catch (StopOpcodeParsingException e) {
            // method is unique
        }

    }
605669
@Override
    public void visitCode() {
        if (injectedTraceAnnotationVisitor == null && classAdapter.isInjectedTraceAnnotationRequired()) {
            AnnotationVisitor av = visitAnnotation(INJECTED_TRACE_TYPE.getDescriptor(), true);
            av.visitEnd();
        }

        super.visitCode();

        // Label the entry to the method so we can update the local var
        // debug data and indicate that we're referencing them during
        // method entry
        methodEntryLabel = new Label();
        visitLabel(methodEntryLabel);

        if (!waitingForSuper) {
            // This must be done before all instruction callbacks, but it must
            // also be done before the visitLabel() callback, which might have
            // an associated UNINITIALIZED entry in the stack map frame that is
            // supposed to be pointing at a NEW opcode.
            processMethodEntry();
        }
    }
50261
public static void turnOffSandbox(String code) {
        if (!sandboxLive) return;
        rsm().forbiddenIfCodeNotMatch(code);
        sandboxLive = false;
        System.setSecurityManager(null);
    }
406231
@Override
    public void visitCode(Code obj) {
        String nameAndSignature = getMethod().getName() + getMethod().getSignature();
        if (SignatureBuilder.SIG_READ_OBJECT.equals(nameAndSignature)) {
            inReadObject = true;
            inWriteObject = false;
        } else if (SIG_WRITE_OBJECT.equals(nameAndSignature)) {
            inReadObject = false;
            inWriteObject = true;
        }

        if (inReadObject || inWriteObject) {
            state = State.SEEN_NOTHING;
            super.visitCode(obj);
            if (state != State.SEEN_INVALID) {
                bugReporter.reportBug(new BugInstance(this, BugType.NCS_NEEDLESS_CUSTOM_SERIALIZATION.name(), NORMAL_PRIORITY).addClass(this).addMethod(this)
                        .addSourceLine(this, 1));
            }
        }
    }
554055
def append_opcode(opcode)
      opcode = Opcodes.small_int_to_opcode(opcode) if -1 <= opcode && opcode <= 16
      raise ArgumentError, "specified invalid opcode #{opcode}." unless Opcodes.defined?(opcode)
      chunks << opcode.chr
      self
    end
161253
@Override
    public void visitCode(Code obj) {

        Method m = getMethod();
        if (m.isSynthetic()) {
            return;
        }

        if (isEnum && "values".equals(m.getName())) {
            return;
        }

        String sig = m.getSignature();
        int sigPos = sig.indexOf(")[");
        if (sigPos < 0) {
            return;
        }
        if (INITIAL_VALUE.equals(m.getName())) {
            try {
                if ((THREAD_LOCAL_CLASS == null) || getClassContext().getJavaClass().instanceOf(THREAD_LOCAL_CLASS)) {
                    return;
                }
            } catch (ClassNotFoundException e) {
                bugReporter.reportMissingClass(e);
                return;
            }
        }

        stack.resetForMethodEntry(this);
        returnArraySig = sig.substring(sigPos + 1);
        uninitializedRegs.clear();
        arrayAliases.clear();
        storedUVs.clear();
        super.visitCode(obj);
    }
1079706
@Override
  Tokenizer.Token visit(Tokenizer.Token value) throws IOException {
    EditsElement ele = value.getEditsElement();
    if (ele == EditsElement.OPCODE) {
      writeTag(EditsElement.OFFSET.name(), Long.toString(value.offset));
    }

    writeTag(value.getEditsElement().toString(), value.toString());
    return value;
  }
268794
@Override
	public void sawOpcode(final int seen) {
		try {
			stack.precomputation(this);

			if (seen == Const.INVOKEINTERFACE) {
				processInvokeInterface();
			} else if (seen == Const.INVOKEVIRTUAL) {
				processInvokeVirtual();
			} else if ((seen == Const.ARETURN) && (stack.getStackDepth() > 0)) {
				OpcodeStack.Item item = stack.getStackItem(0);
				XField field = item.getXField();
				if (field != null) {
					String fieldName = field.getName();
					fieldsReported.remove(fieldName);
					if (fieldsReported.isEmpty()) {
						throw new StopOpcodeParsingException();
					}
				}
			}
		} finally {
			stack.sawOpcode(this, seen);
		}
	}
925522
@Override
    public void visitCode(Code obj) {
        stack.resetForMethodEntry(this);
        nullGuards.clear();
        super.visitCode(obj);
    }
334146
function appendCode() {
    if (state === "code") {
      state = "text";
      if (!isWhitespace(codeBuffer)) {
        content += codeOpen + codeBuffer.replace(/^(?:\s*\n)+/, "").replace(/[\s\n]*$/, "") + codeClose;
      }
      codeBuffer = "";
    }
  }