1 19 20 package edu.umd.cs.findbugs.ba; 21 22 public class ResourceValueFrame extends Frame<ResourceValue> { 23 26 public static final int ESCAPED = 0; 27 28 31 public static final int OPEN = 1; 32 33 36 public static final int OPEN_ON_EXCEPTION_PATH = 2; 37 38 41 public static final int CLOSED = 3; 42 43 46 public static final int CREATED = 4; 47 48 51 public static final int NONEXISTENT = 5; 52 53 private int status; 54 55 public ResourceValueFrame(int numSlots) { 56 super(numSlots); 57 this.status = NONEXISTENT; 58 } 59 60 public int getStatus() { 61 return status; 62 } 63 64 public void setStatus(int status) { 65 this.status = status; 66 } 67 68 @Override 69 public boolean sameAs(Frame<ResourceValue> other_) { 70 if (!super.sameAs(other_)) 71 return false; 72 73 ResourceValueFrame other = (ResourceValueFrame) other_; 74 return this.status == other.status; 75 } 76 77 @Override 78 public void copyFrom(Frame<ResourceValue> other_) { 79 super.copyFrom(other_); 80 ResourceValueFrame other = (ResourceValueFrame) other_; 81 this.status = other.status; 82 } 83 84 private static final String [] statusList = {"(escaped)", "(open)", "(open_exception)", "(closed)", "(created)", "(nonexistent)"}; 85 86 @Override 87 public String toString() { 88 return super.toString() + statusList[status]; 89 } 90 91 } 92 93 | Popular Tags |