@@ -120,12 +120,6 @@ private static ConverterFactory getFactory(ArgumentClinic annotation, TypeElemen
120120 if (factory == null && annotation .args ().length != 0 ) {
121121 throw new ProcessingError (type , "No conversionClass specified but arguments were provided" );
122122 }
123- if (!annotation .customConversion ().isEmpty ()) {
124- if (factory != null ) {
125- throw new ProcessingError (type , "Cannot specify both conversionClass and customConversion" );
126- }
127- return ConverterFactory .forCustomConversion (type , annotation .customConversion ());
128- }
129123 if (factory != null ) {
130124 return factory ;
131125 }
@@ -135,22 +129,16 @@ private static ConverterFactory getFactory(ArgumentClinic annotation, TypeElemen
135129 return ConverterFactory .getBuiltin (annotation );
136130 }
137131
138- public static ArgumentClinicData create (ArgumentClinic annotation , TypeElement type , BuiltinAnnotation builtinAnnotation , int index , ConverterFactory ofactory ) throws ProcessingError {
132+ public static ArgumentClinicData create (ArgumentClinic annotation , TypeElement type , BuiltinAnnotation builtinAnnotation , int index , ConverterFactory annotationFactory )
133+ throws ProcessingError {
139134 if (annotation == null ) {
140135 return new ArgumentClinicData (null , index , new HashSet <>(Arrays .asList (PrimitiveType .values ())), null , Collections .emptySet ());
141136 }
142- ConverterFactory factory = getFactory (annotation , type , ofactory );
137+ ConverterFactory factory = getFactory (annotation , type , annotationFactory );
143138 if (annotation .args ().length != factory .extraParamCount ) {
144139 throw new ProcessingError (type , "Conversion %s.%s expects %d arguments" , factory .fullClassName , factory .methodName , factory .extraParamCount );
145140 }
146141
147- PrimitiveType [] acceptedPrimitives ;
148- if (annotation .shortCircuitPrimitive ().length > 0 ) {
149- acceptedPrimitives = annotation .shortCircuitPrimitive ();
150- } else {
151- acceptedPrimitives = factory .acceptedPrimitiveTypes ;
152- }
153-
154142 String [] args = new String [factory .params .length ];
155143 int extraParamIndex = 0 ;
156144 for (int i = 0 ; i < args .length ; ++i ) {
@@ -184,7 +172,7 @@ public static ArgumentClinicData create(ArgumentClinic annotation, TypeElement t
184172 imports .add ("com.oracle.graal.python.builtins.objects.PNone" );
185173 }
186174
187- return new ArgumentClinicData (annotation , index , new HashSet <>(Arrays .asList (acceptedPrimitives )), castNodeFactory , imports );
175+ return new ArgumentClinicData (annotation , index , new HashSet <>(Arrays .asList (factory . acceptedPrimitiveTypes )), castNodeFactory , imports );
188176 }
189177 }
190178}
0 commit comments