< prev index next >

src/java.base/share/classes/jdk/internal/org/objectweb/asm/tree/InsnList.java

Print this page
rev 47452 : imported patch jdk-new-asmv6.patch


 617             if (next == null) {
 618                 return size();
 619             }
 620             if (cache == null) {
 621                 cache = toArray();
 622             }
 623             return next.index;
 624         }
 625 
 626         public int previousIndex() {
 627             if (prev == null) {
 628                 return -1;
 629             }
 630             if (cache == null) {
 631                 cache = toArray();
 632             }
 633             return prev.index;
 634         }
 635 
 636         public void add(Object o) {

 637             InsnList.this.insertBefore(next, (AbstractInsnNode) o);





 638             prev = (AbstractInsnNode) o;
 639             remove = null;
 640         }
 641 
 642         public void set(Object o) {
 643             InsnList.this.set(next.prev, (AbstractInsnNode) o);


 644             prev = (AbstractInsnNode) o;


 645         }


 646     }


 647 }


 617             if (next == null) {
 618                 return size();
 619             }
 620             if (cache == null) {
 621                 cache = toArray();
 622             }
 623             return next.index;
 624         }
 625 
 626         public int previousIndex() {
 627             if (prev == null) {
 628                 return -1;
 629             }
 630             if (cache == null) {
 631                 cache = toArray();
 632             }
 633             return prev.index;
 634         }
 635 
 636         public void add(Object o) {
 637             if (next != null) {
 638                 InsnList.this.insertBefore(next, (AbstractInsnNode) o);
 639             } else if (prev != null) {
 640                 InsnList.this.insert(prev, (AbstractInsnNode) o);
 641             } else {
 642                 InsnList.this.add((AbstractInsnNode) o);
 643             }
 644             prev = (AbstractInsnNode) o;
 645             remove = null;
 646         }
 647 
 648         public void set(Object o) {
 649             if (remove != null) {
 650                 InsnList.this.set(remove, (AbstractInsnNode) o);
 651                 if (remove == prev) {
 652                     prev = (AbstractInsnNode) o;
 653                 } else {
 654                     next = (AbstractInsnNode) o;
 655                 }
 656             } else {
 657                 throw new IllegalStateException();
 658             }
 659         }
 660     }
 661 }
< prev index next >