@@ -1220,46 +1220,42 @@ private Expression convertFieldAccess(JCFieldAccess fieldAccess) {
12201220 }
12211221
12221222 private Expression convertNewClass (JCNewClass expression ) {
1223- Type anonymousInnerClass =
1223+ var anonymousInnerClass =
12241224 expression .getClassBody () != null
12251225 ? convertClassDeclaration (expression .getClassBody (), expression )
12261226 : null ;
12271227
1228- MethodSymbol constructorElement = (MethodSymbol ) expression .constructor ;
1228+ var constructorSymbol = (MethodSymbol ) expression .constructor . baseSymbol () ;
12291229 // Obtain @NullMarked scope from the enclosing type declaration so that both the enclosing type
12301230 // descriptor and the MethodDescriptor are created in the right context.
1231- TypeElement typeElement = (TypeElement ) expression .type .asElement ();
1232- boolean inNullMarkedScope = environment .createTypeDeclaration (typeElement ).isNullMarked ();
1233- DeclaredTypeDescriptor enclosingTypeDescriptor =
1231+ var typeElement = (TypeElement ) expression .type .asElement ();
1232+ var inNullMarkedScope = environment .createTypeDeclaration (typeElement ).isNullMarked ();
1233+ var enclosingTypeDescriptor =
12341234 environment .createDeclaredTypeDescriptor (expression .type , inNullMarkedScope );
12351235
1236- MethodType methodType = expression .constructor . type .asMethodType ();
1236+ var methodType = expression .constructorType . baseType () .asMethodType ();
12371237 var typeArguments =
12381238 convertTypeArguments (
12391239 expression .getTypeArguments (),
1240- constructorElement ,
1240+ constructorSymbol ,
12411241 methodType ,
12421242 enclosingTypeDescriptor .getTypeDeclaration ().isNullMarked ());
12431243
1244- MethodDescriptor constructorMethodDescriptor =
1244+ var constructorMethodDescriptor =
12451245 environment .createMethodDescriptor (
1246- /* enclosingTypeDescriptor= */ enclosingTypeDescriptor ,
1247- /* methodType= */ environment .convertToMemberOf (constructorElement , expression .type ),
1248- /* declarationMethodElement= */ constructorElement ,
1249- typeArguments );
1250- Expression qualifier = convertExpressionOrNull (expression .getEnclosingExpression ());
1251- List <Expression > arguments =
1252- convertArguments (constructorMethodDescriptor , expression .getArguments ());
1253- DeclaredTypeDescriptor targetClassDescriptor =
1254- constructorMethodDescriptor .getEnclosingTypeDescriptor ();
1246+ enclosingTypeDescriptor , methodType , constructorSymbol , typeArguments );
1247+
1248+ var qualifier = convertExpressionOrNull (expression .getEnclosingExpression ());
1249+ var arguments = convertArguments (constructorMethodDescriptor , expression .getArguments ());
1250+ var targetClassDescriptor = constructorMethodDescriptor .getEnclosingTypeDescriptor ();
12551251
12561252 if (targetClassDescriptor .getTypeDeclaration ().isAnonymous () && qualifier != null ) {
12571253 // This is the qualifier to for the super invocation, pass as first parameter, since the
12581254 // constructor for the anonymous class expects it there.
12591255 arguments .add (0 , qualifier );
12601256 qualifier = null ;
12611257 }
1262- boolean needsQualifier =
1258+ var needsQualifier =
12631259 constructorMethodDescriptor
12641260 .getEnclosingTypeDescriptor ()
12651261 .getTypeDeclaration ()
0 commit comments