< prev index next >

src/jdk.jfr/share/classes/jdk/jfr/internal/EventClassBuilder.java

Print this page
*** 1,7 ***
  /*
!  * Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved.
   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   *
   * This code is free software; you can redistribute it and/or modify it
   * under the terms of the GNU General Public License version 2 only, as
   * published by the Free Software Foundation.  Oracle designates this
--- 1,7 ---
  /*
!  * Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   *
   * This code is free software; you can redistribute it and/or modify it
   * under the terms of the GNU General Public License version 2 only, as
   * published by the Free Software Foundation.  Oracle designates this

*** 37,10 ***
--- 37,13 ---
  import java.lang.classfile.AnnotationValue;
  import java.lang.classfile.ClassBuilder;
  import java.lang.classfile.ClassFile;
  import java.lang.classfile.Label;
  import java.lang.classfile.attribute.RuntimeVisibleAnnotationsAttribute;
+ 
+ import jdk.internal.misc.PreviewFeatures;
+ 
  import jdk.jfr.AnnotationElement;
  import jdk.jfr.Event;
  import jdk.jfr.ValueDescriptor;
  import jdk.jfr.internal.util.Bytecode;
  import jdk.jfr.internal.util.Bytecode.MethodDesc;

*** 108,11 ***
          }));
      }
  
      private void buildClassInfo(ClassBuilder builder) {
          builder.withSuperclass(Bytecode.classDesc(Event.class));
!         builder.withFlags(AccessFlag.FINAL, AccessFlag.PUBLIC, AccessFlag.SUPER);
          List<java.lang.classfile.Annotation> annotations = new ArrayList<>();
          for (jdk.jfr.AnnotationElement a : annotationElements) {
              List<java.lang.classfile.AnnotationElement> list = new ArrayList<>();
              for (ValueDescriptor v : a.getValueDescriptors()) {
                  // ValueDescriptor can only hold primitive
--- 111,11 ---
          }));
      }
  
      private void buildClassInfo(ClassBuilder builder) {
          builder.withSuperclass(Bytecode.classDesc(Event.class));
!         builder.withFlags(AccessFlag.FINAL, AccessFlag.PUBLIC, (PreviewFeatures.isEnabled() ? AccessFlag.IDENTITY : AccessFlag.SUPER));
          List<java.lang.classfile.Annotation> annotations = new ArrayList<>();
          for (jdk.jfr.AnnotationElement a : annotationElements) {
              List<java.lang.classfile.AnnotationElement> list = new ArrayList<>();
              for (ValueDescriptor v : a.getValueDescriptors()) {
                  // ValueDescriptor can only hold primitive
< prev index next >