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

Print this page




 334         this.tryCatchBlocks = new ArrayList<TryCatchBlockNode>();
 335         if (exceptions != null) {
 336             this.exceptions.addAll(Arrays.asList(exceptions));
 337         }
 338         this.instructions = new InsnList();
 339     }
 340 
 341     // ------------------------------------------------------------------------
 342     // Implementation of the MethodVisitor abstract class
 343     // ------------------------------------------------------------------------
 344 
 345     @Override
 346     public void visitParameter(String name, int access) {
 347         if (parameters == null) {
 348             parameters = new ArrayList<ParameterNode>(5);
 349         }
 350         parameters.add(new ParameterNode(name, access));
 351     }
 352 
 353     @Override

 354     public AnnotationVisitor visitAnnotationDefault() {
 355         return new AnnotationNode(new ArrayList<Object>(0) {
 356             @Override
 357             public boolean add(final Object o) {
 358                 annotationDefault = o;
 359                 return super.add(o);
 360             }
 361         });
 362     }
 363 
 364     @Override
 365     public AnnotationVisitor visitAnnotation(final String desc,
 366             final boolean visible) {
 367         AnnotationNode an = new AnnotationNode(desc);
 368         if (visible) {
 369             if (visibleAnnotations == null) {
 370                 visibleAnnotations = new ArrayList<AnnotationNode>(1);
 371             }
 372             visibleAnnotations.add(an);
 373         } else {




 334         this.tryCatchBlocks = new ArrayList<TryCatchBlockNode>();
 335         if (exceptions != null) {
 336             this.exceptions.addAll(Arrays.asList(exceptions));
 337         }
 338         this.instructions = new InsnList();
 339     }
 340 
 341     // ------------------------------------------------------------------------
 342     // Implementation of the MethodVisitor abstract class
 343     // ------------------------------------------------------------------------
 344 
 345     @Override
 346     public void visitParameter(String name, int access) {
 347         if (parameters == null) {
 348             parameters = new ArrayList<ParameterNode>(5);
 349         }
 350         parameters.add(new ParameterNode(name, access));
 351     }
 352 
 353     @Override
 354     @SuppressWarnings("serial") // Anonymous class
 355     public AnnotationVisitor visitAnnotationDefault() {
 356         return new AnnotationNode(new ArrayList<Object>(0) {
 357             @Override
 358             public boolean add(final Object o) {
 359                 annotationDefault = o;
 360                 return super.add(o);
 361             }
 362         });
 363     }
 364 
 365     @Override
 366     public AnnotationVisitor visitAnnotation(final String desc,
 367             final boolean visible) {
 368         AnnotationNode an = new AnnotationNode(desc);
 369         if (visible) {
 370             if (visibleAnnotations == null) {
 371                 visibleAnnotations = new ArrayList<AnnotationNode>(1);
 372             }
 373             visibleAnnotations.add(an);
 374         } else {