Skip to content

Commit e2d0685

Browse files
committed
Use types directly using describeConstable().orElseThrow() like the official documentation of classfile API recommends (#14597)
1 parent 6a25349 commit e2d0685

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lucene/expressions/src/java/org/apache/lucene/expressions/js/JavascriptCompiler.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,9 @@ public final class JavascriptCompiler {
114114
private static final ClassDesc
115115
CD_CompiledExpression =
116116
ClassDesc.of(JavascriptCompiler.class.getName() + "$CompiledExpression"),
117-
CD_Expression = Expression.class.describeConstable().get(),
118-
CD_DoubleValues = DoubleValues.class.describeConstable().get(),
119-
CD_JavascriptCompiler = JavascriptCompiler.class.describeConstable().get();
117+
CD_Expression = Expression.class.describeConstable().orElseThrow(),
118+
CD_DoubleValues = DoubleValues.class.describeConstable().orElseThrow(),
119+
CD_JavascriptCompiler = JavascriptCompiler.class.describeConstable().orElseThrow();
120120
private static final MethodTypeDesc
121121
MTD_EXPRESSION_CTOR =
122122
MethodTypeDesc.of(
@@ -134,7 +134,7 @@ public final class JavascriptCompiler {
134134
ConstantDescs.CD_String);
135135

136136
private static final ExceptionsAttribute ATTR_THROWS_IOEXCEPTION =
137-
ExceptionsAttribute.ofSymbols(IOException.class.describeConstable().get());
137+
ExceptionsAttribute.ofSymbols(IOException.class.describeConstable().orElseThrow());
138138

139139
final String sourceText;
140140
final Map<String, MethodHandle> functions;
@@ -447,7 +447,7 @@ public Void visitExternal(JavascriptParser.ExternalContext ctx) {
447447
gen.invokevirtual(
448448
ConstantDescs.CD_MethodHandle,
449449
"invokeExact",
450-
MethodTypeDesc.ofDescriptor(mh.type().descriptorString()));
450+
mh.type().describeConstable().orElseThrow());
451451

452452
gen.conversion(TypeKind.DOUBLE, typeStack.peek());
453453
} else if (!parens || arguments == 0 && text.contains(".")) {

0 commit comments

Comments
 (0)