< prev index next >

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

Print this page
@@ -1,7 +1,7 @@
  /*
-  * Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved.
+  * 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,11 @@
  import jdk.internal.classfile.AnnotationValue;
  import jdk.internal.classfile.ClassBuilder;
  import jdk.internal.classfile.Classfile;
  import jdk.internal.classfile.Label;
  import jdk.internal.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 +109,11 @@
          }));
      }
  
      private void buildClassInfo(ClassBuilder builder) {
          builder.withSuperclass(Bytecode.classDesc(Event.class));
-         builder.withFlags(AccessFlag.FINAL, AccessFlag.PUBLIC, AccessFlag.SUPER);
+         builder.withFlags(AccessFlag.FINAL, AccessFlag.PUBLIC, (PreviewFeatures.isEnabled() ? AccessFlag.IDENTITY : AccessFlag.SUPER));
          List<jdk.internal.classfile.Annotation> annotations = new ArrayList<>();
          for (jdk.jfr.AnnotationElement a : annotationElements) {
              List<jdk.internal.classfile.AnnotationElement> list = new ArrayList<>();
              for (ValueDescriptor v : a.getValueDescriptors()) {
                  // ValueDescriptor can only hold primitive
< prev index next >