Exemplo n.º 1
0
 public void record() {
   if (this.creationRecord != null) {
     String value = ResourceLeakDetector.newRecord(2);
     synchronized (this.lastRecords) {
       int size = this.lastRecords.size();
       if ((size == 0) || (!((String) this.lastRecords.getLast()).equals(value))) {
         this.lastRecords.add(value);
       }
       if (size > 4) {
         this.lastRecords.removeFirst();
       }
     }
   }
 }
Exemplo n.º 2
0
 DefaultResourceLeak(Object referent) {
   super(referent != null ? ResourceLeakDetector.this.refQueue : null);
   ResourceLeakDetector.Level level;
   if (referent != null) {
     level = ResourceLeakDetector.getLevel();
     if (level.ordinal() >= ResourceLeakDetector.Level.ADVANCED.ordinal()) {
       this.creationRecord = ResourceLeakDetector.newRecord(3);
     } else {
       this.creationRecord = null;
     }
     synchronized (ResourceLeakDetector.this.head) {
       this.prev = ResourceLeakDetector.this.head;
       this.next = ResourceLeakDetector.this.head.next;
       ResourceLeakDetector.this.head.next.prev = this;
       ResourceLeakDetector.this.head.next = this;
       ResourceLeakDetector.access$408(ResourceLeakDetector.this);
     }
     this.freed = new AtomicBoolean();
   } else {
     this.creationRecord = null;
     this.freed = new AtomicBoolean(true);
   }
 }