# Interface: com.pnfsoftware.jeb.core.units.code.android.ir.IDTryData

`dexdec` exception handling information, optionally provided by an [IR method context](IDMethodContext).

## Method: addProtectionFromBlock
- parameter: `srcBlkOffset`, type: `int`
- parameter: `dstBlkOffset`, type: `int`
- return type: `boolean`

Description: Append the protection of the source block on to the destination block.
parameter: srcBlkOffset: source block
parameter: dstBlkOffset: destination block
return: true if some protection information was appended; false if the source block was not         protected \(false does not indicate a failure, but simply that the source block was         not in any try\-block\)

## Method: compareHandlers
- parameter: `blkOffset1`, type: `int`
- parameter: `blkOffset2`, type: `int`
- return type: `boolean`

Description: Compare the protection information of two blocks.
parameter: blkOffset1: a block
parameter: blkOffset2: another block
return: true if the blocks are protected in the exact same way \(same handlers, same order,         etc.\), false otherwise

## Method: copy
- return type: `com.pnfsoftware.jeb.core.units.code.android.ir.IDTryData`

Description: Perform a deep\-copy this object.
return: a copy of this object

## Method: copyProtectedBlock
- parameter: `srcBlkOffset`, type: `int`
- parameter: `dstBlkOffset`, type: `int`
- return type: `boolean`

Description: Copy the protection information of a block to another block.
parameter: srcBlkOffset: source block, whose protection information will be copied over to the            destination block
parameter: dstBlkOffset: destination block, to be protected \(if it was protected, the original            protection information will be overwritten\)
return: true if some protection information was copied over; false if the source block was         not protected \(false does not indicate a failure, but simply that the source block         was not in any try\-block\)

## Method: getBlockHandlers
- parameter: `blkOffset`, type: `int`
- return type: `java.util.List<com.pnfsoftware.jeb.core.units.code.android.ir.IDExceptionHandler>`

Description: Retrieve the handlers protecting the provided block.
parameter: blkOffset: block
return: the list of handlers protecting the provided block

## Method: getHandledExceptionTypesAt
- parameter: `handlerOffset`, type: `int`
- return type: `java.util.Set<java.lang.Integer>`

Description: Retrieve all the exception types handled by the provided handler.
parameter: handlerOffset: offset of the handler block \(an entry\-point block when an exception is            caught\)
return: a set of exception type indices; the special value \-1 denotes the lowest\-level         throwable type \(java.lang.Throwable\)

## Method: getHandlers
- return type: `java.util.List<com.pnfsoftware.jeb.core.units.code.android.ir.IDExceptionHandler>`

Description: Retrieve a list of all handlers.
return: 

## Method: getHandlers
- parameter: `handlerAddress`, type: `int`
- return type: `java.util.List<com.pnfsoftware.jeb.core.units.code.android.ir.IDExceptionHandler>`

Description: 
parameter: handlerAddress: 
return: 

## Method: getProtectedBlocks
- return type: `java.util.List<java.lang.Integer>`

Description: Retrieve a copy of the list of protected blocks.
return: a copy of the list of block offsets, possibly empty

## Method: hasProtectedBlocks
- return type: `boolean`

Description: Determine whether this object carries some protection information. The reverse of [#isEmpty()](#isEmpty()).
return: true if at least one block is protected

## Method: isEmpty
- return type: `boolean`

Description: Determine whether this object carries some protection information. The reverse of [#hasProtectedBlocks()](#hasProtectedBlocks()).
return: true if not a single block is protected

## Method: isProtectedBlock
- parameter: `blkOffset`, type: `int`
- return type: `boolean`

Description: Determine whether a block is protected.
parameter: blkOffset: block
return: true if the block is protected \(by at least one handler\)

## Method: moveProtectedBlock
- parameter: `srcBlkOffset`, type: `int`
- parameter: `dstBlkOffset`, type: `int`
- return type: `boolean`

Description: Move the protection information of a block to another block. The source block will be left unprotected. The destination block will be protected as the source block was.
parameter: srcBlkOffset: source block
parameter: dstBlkOffset: destination
return: true if some protection information was copied over; false if the source block was         not protected \(false does not indicate a failure, but simply that the source block         was not in any try\-block\)

## Method: protectBlock
- parameter: `blkOffset`, type: `int`
- parameter: `exTypeIndex`, type: `int`
- parameter: `handlerOffset`, type: `int`
- parameter: `position`, type: `int`
- return type: `boolean`

Description: Add a handler to the list of exception handlers protecting the provided block. If no handler protects the block, a new list is created.
parameter: blkOffset: block
parameter: exTypeIndex: exception type index \(\-1 means untyped, i.e., all types\)
parameter: handlerOffset: offset of the handler entry\-point
parameter: position: insertion index \(negative value is allowed, e.g. \-1 means append\)
return: true if the handler was created; false if a previous handler \(before the insertion         point\) for the same type was found in the list of handlers for the block

## Method: replaceHandler
- parameter: `blkOffset`, type: `int`
- parameter: `handler`, type: `com.pnfsoftware.jeb.core.units.code.android.ir.IDExceptionHandler`
- parameter: `newHandler`, type: `com.pnfsoftware.jeb.core.units.code.android.ir.IDExceptionHandler`
- return type: `boolean`

Description: Replace or remove a handler by reference.
parameter: blkOffset: protected block offset
parameter: handler: mandatory handler
parameter: newHandler: new handler \(or null to remove the handler\)
return: true if the handler was replaced or removed

## Method: setBlockHandlers
- parameter: `blkOffset`, type: `int`
- parameter: `handlers`, type: `java.util.Collection<com.pnfsoftware.jeb.core.units.code.android.ir.IDExceptionHandler>`

Description: Set the handlers for the provided block. The list of provided handlers will be copied.
parameter: blkOffset: block
parameter: handlers: a list of handlers; empty to unprotect the block

## Method: unprotectBlock
- parameter: `blkOffset`, type: `int`
- return type: `boolean`

Description: Unprotect a block.
parameter: blkOffset: block
return: true if the block was protected and is now unprotected; false means the block was not         protected

## Method: unprotectBlock
- parameter: `blkOffset`, type: `int`
- parameter: `handlerOffset`, type: `int`
- return type: `boolean`

Description: Remove a specific protection for a block. All handling leading to the provided handler offset will be removed.
parameter: blkOffset: block
parameter: handlerOffset: offset of the handler
return: true if some changes took place; false otherwise \(no change\)

## Method: unprotectBlock
- parameter: `blkOffset`, type: `int`
- parameter: `handlerOffset`, type: `int`
- parameter: `exTypeIndex`, type: `int`
- return type: `boolean`

Description: Remove a specific specific protection for a block.
parameter: blkOffset: block
parameter: handlerOffset: offset of the handler
parameter: exTypeIndex: expected handled exception type
return: true if the handler was removed; false otherwise \(no change\)

## Method: updateHandlerAddress
- parameter: `handlerAddress`, type: `int`
- parameter: `newAddress`, type: `int`
- return type: `boolean`

Description: Update the address of a handler.
parameter: handlerAddress: 
parameter: newAddress: 
return: true if the handler was found and updated; false if no handler was found at that         address

## Method: updateTargets
- parameter: `oldToNewOffsets`, type: `java.util.Map<java.lang.Integer,java.lang.Integer>`
- return type: `int`

Description: Update the targets of this object. All block offsets \(protected blocks, handler blocks\) will be updated.
parameter: oldToNewOffsets: a map of old block offsets to new block offsets
return: the number of updated targets

## Method: updateTargets
- parameter: `oldToNewOffsets`, type: `java.util.Map<java.lang.Integer,java.lang.Integer>`
- parameter: `failOnMissedEntry`, type: `boolean`
- return type: `int`

Description: Update the targets of this object. All block offsets \(protected blocks, handler blocks\) will be updated.
parameter: oldToNewOffsets: a map of old block offsets to new block offsets
parameter: failOnMissedEntry: if true, the method will raise if a \(current\) branch target cannot            be mapped to a new target \(i.e., if there is no entry for a branch target in the            map\)
return: the number of updated targets

