@@ -2855,13 +2855,8 @@ Symbol findConstructor(DiagnosticPosition pos, Env<AttrContext> env,
28552855 List <Type > typeargtypes ,
28562856 boolean allowBoxing ,
28572857 boolean useVarargs ) {
2858- Symbol sym = findMethod (env , site ,
2859- names .init , argtypes ,
2860- typeargtypes , allowBoxing ,
2861- useVarargs );
2862- chk .checkDeprecated (pos , env .info .scope .owner , sym );
2863- chk .checkPreview (pos , sym );
2864- return sym ;
2858+ return findMethod (env , site , names .init , argtypes ,
2859+ typeargtypes , allowBoxing , useVarargs );
28652860 }
28662861
28672862 /** Resolve constructor using diamond inference.
@@ -2883,7 +2878,7 @@ Symbol resolveDiamond(DiagnosticPosition pos,
28832878 new BasicLookupHelper (names .init , site , argtypes , typeargtypes ) {
28842879 @ Override
28852880 Symbol doLookup (Env <AttrContext > env , MethodResolutionPhase phase ) {
2886- return findDiamond (pos , env , site , argtypes , typeargtypes ,
2881+ return findDiamond (env , site , argtypes , typeargtypes ,
28872882 phase .isBoxingRequired (),
28882883 phase .isVarargsRequired ());
28892884 }
@@ -2906,29 +2901,6 @@ Symbol access(Env<AttrContext> env, DiagnosticPosition pos, Symbol location, Sym
29062901 }});
29072902 }
29082903
2909- /** Find the constructor using diamond inference and do some checks(deprecated and preview).
2910- * @param pos The position to use for error reporting.
2911- * @param env The environment current at the constructor invocation.
2912- * @param site The type of class for which a constructor is searched.
2913- * The scope of this class has been touched in attribution.
2914- * @param argtypes The types of the constructor invocation's value arguments.
2915- * @param typeargtypes The types of the constructor invocation's type arguments.
2916- * @param allowBoxing Allow boxing conversions of arguments.
2917- * @param useVarargs Box trailing arguments into an array for varargs.
2918- */
2919- private Symbol findDiamond (DiagnosticPosition pos ,
2920- Env <AttrContext > env ,
2921- Type site ,
2922- List <Type > argtypes ,
2923- List <Type > typeargtypes ,
2924- boolean allowBoxing ,
2925- boolean useVarargs ) {
2926- Symbol sym = findDiamond (env , site , argtypes , typeargtypes , allowBoxing , useVarargs );
2927- chk .checkDeprecated (pos , env .info .scope .owner , sym );
2928- chk .checkPreview (pos , sym );
2929- return sym ;
2930- }
2931-
29322904 /** This method scans all the constructor symbol in a given class scope -
29332905 * assuming that the original scope contains a constructor of the kind:
29342906 * {@code Foo(X x, Y y)}, where X,Y are class type-variables declared in Foo,
0 commit comments