Initializes this CodeWriter to define the bytecode of the specified method. @param access the method's access flags (see Constants). @param name the method's name. @param desc the method's descriptor (see Type Type). @param exceptions the internal names of the method's exceptions. M
(
final int access,
final String name,
final String desc,
final String[] exceptions)
| 526 | */ |
| 527 | |
| 528 | protected void init ( |
| 529 | final int access, |
| 530 | final String name, |
| 531 | final String desc, |
| 532 | final String[] exceptions) |
| 533 | { |
| 534 | this.access = access; |
| 535 | this.name = cw.newUTF8(name); |
| 536 | this.desc = cw.newUTF8(desc); |
| 537 | if (exceptions != null && exceptions.length > 0) { |
| 538 | exceptionCount = exceptions.length; |
| 539 | this.exceptions = new int[exceptionCount]; |
| 540 | for (int i = 0; i < exceptionCount; ++i) { |
| 541 | this.exceptions[i] = cw.newClass(exceptions[i]).index; |
| 542 | } |
| 543 | } |
| 544 | if (computeMaxs) { |
| 545 | // updates maxLocals |
| 546 | int size = getArgumentsAndReturnSizes(desc) >> 2; |
| 547 | if ((access & Constants.ACC_STATIC) != 0) { |
| 548 | --size; |
| 549 | } |
| 550 | if (size > maxLocals) { |
| 551 | maxLocals = size; |
| 552 | } |
| 553 | } |
| 554 | } |
| 555 | |
| 556 | // -------------------------------------------------------------------------- |
| 557 | // Implementation of the CodeVisitor interface |
no test coverage detected