Constructs a new MethodWriter. @param symbolTable where the constants used in this AnnotationWriter must be stored. @param access the method's access flags (see Opcodes). @param name the method's name. @param descriptor the method's descriptor (see Type). @param signature th
(
final SymbolTable symbolTable,
final int access,
final String name,
final String descriptor,
final String signature,
final String[] exceptions,
final int compute)
| 581 | * @param compute indicates what must be computed (see #compute). |
| 582 | */ |
| 583 | MethodWriter( |
| 584 | final SymbolTable symbolTable, |
| 585 | final int access, |
| 586 | final String name, |
| 587 | final String descriptor, |
| 588 | final String signature, |
| 589 | final String[] exceptions, |
| 590 | final int compute) { |
| 591 | super(Opcodes.ASM6); |
| 592 | this.symbolTable = symbolTable; |
| 593 | this.accessFlags = "<init>".equals(name) ? access | Constants.ACC_CONSTRUCTOR : access; |
| 594 | this.nameIndex = symbolTable.addConstantUtf8(name); |
| 595 | this.descriptorIndex = symbolTable.addConstantUtf8(descriptor); |
| 596 | this.descriptor = descriptor; |
| 597 | this.signatureIndex = signature == null ? 0 : symbolTable.addConstantUtf8(signature); |
| 598 | if (exceptions != null && exceptions.length > 0) { |
| 599 | numberOfExceptions = exceptions.length; |
| 600 | this.exceptionIndexTable = new int[numberOfExceptions]; |
| 601 | for (int i = 0; i < numberOfExceptions; ++i) { |
| 602 | this.exceptionIndexTable[i] = symbolTable.addConstantClass(exceptions[i]).index; |
| 603 | } |
| 604 | } else { |
| 605 | numberOfExceptions = 0; |
| 606 | this.exceptionIndexTable = null; |
| 607 | } |
| 608 | this.compute = compute; |
| 609 | if (compute != COMPUTE_NOTHING) { |
| 610 | // Update maxLocals and currentLocals. |
| 611 | int argumentsSize = Type.getArgumentsAndReturnSizes(descriptor) >> 2; |
| 612 | if ((access & Opcodes.ACC_STATIC) != 0) { |
| 613 | --argumentsSize; |
| 614 | } |
| 615 | maxLocals = argumentsSize; |
| 616 | currentLocals = argumentsSize; |
| 617 | // Create and visit the label for the first basic block. |
| 618 | firstBasicBlock = new Label(); |
| 619 | visitLabel(firstBasicBlock); |
| 620 | } |
| 621 | } |
| 622 | |
| 623 | boolean hasFrames() { |
| 624 | return stackMapTableNumberOfEntries > 0; |
nothing calls this directly
no test coverage detected