GT-2872 - Search - review fixes

This commit is contained in:
dragonmacher 2019-05-16 11:56:33 -04:00
parent 96788aa7fc
commit 8a7a58a297
3 changed files with 31 additions and 11 deletions

View file

@ -165,12 +165,11 @@ public interface Address extends Comparable<Address> {
public int getSize();
/**
* Calculates the displacement between two addresses (<code>this -
* addr</code>).
*
* @param addr the Address to subtract from <code>this</code> address.
* @return the difference. (thisAddress.offset - thatAddress.offset
* Calculates the displacement between two addresses (<code>this - addr</code>)
*
* @param addr the Address to subtract from <code>this</code> address
* @return the difference (thisAddress.offset - thatAddress.offset)
* @throws IllegalArgumentException if the two addresses are not in the same address space
*/
public long subtract(Address addr);

View file

@ -29,7 +29,7 @@ import ghidra.util.datastruct.RedBlackTree;
public class AddressSet implements AddressSetView {
private final static double LOGBASE2 = Math.log(2);
private RedBlackTree<Address, Address> rbTree = new RedBlackTree<Address, Address>();
private RedBlackTree<Address, Address> rbTree = new RedBlackTree<>();
private RedBlackEntry<Address, Address> lastNode;
private long addressCount = 0;
@ -282,7 +282,7 @@ public class AddressSet implements AddressSetView {
/**
* Deletes a range of addresses from this set
* @param start the starting address of the range to be removed
* @param end the ending address of the range to be removed
* @param end the ending address of the range to be removed (inclusive)
*/
public final void delete(Address start, Address end) {
if (start.compareTo(end) > 0) {
@ -403,7 +403,7 @@ public class AddressSet implements AddressSetView {
* @return a list of the AddressRanges in this set.
*/
public List<AddressRange> toList() {
ArrayList<AddressRange> list = new ArrayList<AddressRange>();
ArrayList<AddressRange> list = new ArrayList<>();
for (AddressRange range : this) {
list.add(range);
}