BuilderDebugItem.java revision 688611814ddff6babff935e81dcf51aff903563a
1package org.jf.dexlib2.builder;
2
3import org.jf.dexlib2.DebugItemType;
4import org.jf.dexlib2.iface.debug.*;
5import org.jf.dexlib2.iface.reference.StringReference;
6import org.jf.dexlib2.iface.reference.TypeReference;
7
8import javax.annotation.Nonnull;
9import javax.annotation.Nullable;
10
11public abstract class BuilderDebugItem implements DebugItem {
12    @Nullable MethodLocation location;
13
14    public BuilderDebugItem(@Nonnull MethodLocation location) {
15        this.location = location;
16    }
17
18    @Override public int getCodeAddress() {
19        if (location == null) {
20            throw new IllegalStateException("Cannot get the address of a BuilderDebugItem that isn't associated with " +
21                    "a method.");
22        }
23        return location.getCodeAddress();
24    }
25
26}
27