1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.commons.compress.harmony.unpack200.bytecode.forms;
18
19 import org.apache.commons.compress.harmony.pack200.Pack200Exception;
20 import org.apache.commons.compress.harmony.unpack200.bytecode.ByteCode;
21 import org.apache.commons.compress.harmony.unpack200.bytecode.OperandManager;
22
23
24
25
26 public class NarrowClassRefForm extends ClassRefForm {
27
28 public NarrowClassRefForm(final int opcode, final String name, final int[] rewrite) {
29 super(opcode, name, rewrite);
30 }
31
32 public NarrowClassRefForm(final int opcode, final String name, final int[] rewrite, final boolean widened) {
33 super(opcode, name, rewrite, widened);
34 }
35
36 @Override
37 public boolean nestedMustStartClassPool() {
38 return !widened;
39 }
40
41 @Override
42 protected void setNestedEntries(final ByteCode byteCode, final OperandManager operandManager, final int offset) throws Pack200Exception {
43 super.setNestedEntries(byteCode, operandManager, offset);
44 if (!widened) {
45 byteCode.setNestedPositions(new int[][] { { 0, 1 } });
46 }
47 }
48 }