Skip to content

Commit

Permalink
8322175: test/langtools/tools/javac/classreader/BadMethodParameter.ja…
Browse files Browse the repository at this point in the history
…va doesn't compile

Reviewed-by: jlahoda
  • Loading branch information
cushon committed Dec 15, 2023
1 parent 20de541 commit bdebf19
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions test/langtools/tools/javac/classreader/BadMethodParameter.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,16 @@
* @modules
* jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.main
* java.base/jdk.internal.classfile
* java.base/jdk.internal.classfile.attribute
* @build toolbox.ToolBox toolbox.JavacTask
* @enablePreview
* @run main BadMethodParameter
*/

import jdk.internal.classfile.ClassModel;
import jdk.internal.classfile.ClassTransform;
import jdk.internal.classfile.Classfile;
import jdk.internal.classfile.MethodTransform;
import jdk.internal.classfile.attribute.MethodParametersAttribute;
import java.lang.classfile.ClassModel;
import java.lang.classfile.ClassTransform;
import java.lang.classfile.ClassFile;
import java.lang.classfile.MethodTransform;
import java.lang.classfile.attribute.MethodParametersAttribute;

import toolbox.JavacTask;
import toolbox.Task;
Expand Down Expand Up @@ -99,7 +98,9 @@ public static void f(int x, int y) {
Path classDir = getClassDir();
new JavacTask(tb)
.classpath(classes, classDir)
.options("-verbose", "-parameters", "-processor", P.class.getName())
.options("--enable-preview",
"-source", String.valueOf(Runtime.version().feature()),
"-verbose", "-parameters", "-processor", P.class.getName())
.classes(P.class.getName())
.outdir(classes)
.run(Task.Expect.SUCCESS);
Expand Down Expand Up @@ -132,7 +133,7 @@ public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment

private static void transform(Path path) throws IOException {
byte[] bytes = Files.readAllBytes(path);
Classfile cf = Classfile.of();
ClassFile cf = ClassFile.of();
ClassModel classModel = cf.parse(bytes);
MethodTransform methodTransform =
(mb, me) -> {
Expand Down

0 comments on commit bdebf19

Please sign in to comment.