Class CodeAttribute
java.lang.Object
org.apache.commons.compress.harmony.unpack200.bytecode.ClassFileEntry
org.apache.commons.compress.harmony.unpack200.bytecode.Attribute
org.apache.commons.compress.harmony.unpack200.bytecode.BCIRenumberedAttribute
org.apache.commons.compress.harmony.unpack200.bytecode.CodeAttribute
-
Field Summary
FieldsModifier and TypeFieldDescriptionint
int
int
Fields inherited from class org.apache.commons.compress.harmony.unpack200.bytecode.BCIRenumberedAttribute
renumbered
Fields inherited from class org.apache.commons.compress.harmony.unpack200.bytecode.ClassFileEntry
NONE
-
Constructor Summary
ConstructorsConstructorDescriptionCodeAttribute
(int maxStack, int maxLocals, byte[] codePacked, Segment segment, OperandManager operandManager, List<ExceptionTableEntry> exceptionTable) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAttribute
(Attribute attribute) protected int
Gets the length.protected ClassFileEntry[]
Returns an empty array.protected int[]
Gets the array of indices for the start of line numbers.void
In Pack200, line number tables are BCI renumbered.protected void
resolve
(ClassConstantPool pool) Allows the constant pool entries to resolve their nested entries.static void
setAttributeName
(CPUTF8 attributeName) toString()
protected void
Writes this body to the given output stream.Methods inherited from class org.apache.commons.compress.harmony.unpack200.bytecode.BCIRenumberedAttribute
hasBCIRenumbering
Methods inherited from class org.apache.commons.compress.harmony.unpack200.bytecode.Attribute
doWrite, equals, getAttributeName, getLengthIncludingHeader, hashCode, isSourceFileAttribute
Methods inherited from class org.apache.commons.compress.harmony.unpack200.bytecode.ClassFileEntry
objectHashCode, write
-
Field Details
-
attributes
-
byteCodeOffsets
-
byteCodes
-
codeLength
-
exceptionTable
-
maxLocals
-
maxStack
-
-
Constructor Details
-
CodeAttribute
public CodeAttribute(int maxStack, int maxLocals, byte[] codePacked, Segment segment, OperandManager operandManager, List<ExceptionTableEntry> exceptionTable) throws Pack200Exception - Throws:
Pack200Exception
-
-
Method Details
-
setAttributeName
-
addAttribute
-
getLength
Description copied from class:Attribute
Gets the length.- Specified by:
getLength
in classBCIRenumberedAttribute
- Returns:
- the length.
-
getNestedClassFileEntries
Description copied from class:ClassFileEntry
Returns an empty array.- Overrides:
getNestedClassFileEntries
in classAttribute
- Returns:
- an empty array.
-
getStartPCs
Description copied from class:BCIRenumberedAttribute
Gets the array of indices for the start of line numbers.- Specified by:
getStartPCs
in classBCIRenumberedAttribute
- Returns:
- the array of indices for the start of line numbers.
-
renumber
Description copied from class:BCIRenumberedAttribute
In Pack200, line number tables are BCI renumbered. This method takes the byteCodeOffsets (which is a List of Integers specifying the offset in the byte code array of each instruction) and updates the start_pcs so that it points to the instruction index itself, not the BCI renumbering of the instruction.- Overrides:
renumber
in classBCIRenumberedAttribute
- Parameters:
byteCodeOffsets
- List of Integer offsets of the byte code array.
-
resolve
Description copied from class:ClassFileEntry
Allows the constant pool entries to resolve their nested entries. -
toString
- Specified by:
toString
in classBCIRenumberedAttribute
-
writeBody
Description copied from class:Attribute
Writes this body to the given output stream.- Specified by:
writeBody
in classBCIRenumberedAttribute
- Parameters:
dos
- the output stream.- Throws:
IOException
- if an I/O error occurs.
-