@@ -120,12 +120,6 @@ private static ConverterFactory getFactory(ArgumentClinic annotation, TypeElemen
120
120
if (factory == null && annotation .args ().length != 0 ) {
121
121
throw new ProcessingError (type , "No conversionClass specified but arguments were provided" );
122
122
}
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
- }
129
123
if (factory != null ) {
130
124
return factory ;
131
125
}
@@ -135,22 +129,16 @@ private static ConverterFactory getFactory(ArgumentClinic annotation, TypeElemen
135
129
return ConverterFactory .getBuiltin (annotation );
136
130
}
137
131
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 {
139
134
if (annotation == null ) {
140
135
return new ArgumentClinicData (null , index , new HashSet <>(Arrays .asList (PrimitiveType .values ())), null , Collections .emptySet ());
141
136
}
142
- ConverterFactory factory = getFactory (annotation , type , ofactory );
137
+ ConverterFactory factory = getFactory (annotation , type , annotationFactory );
143
138
if (annotation .args ().length != factory .extraParamCount ) {
144
139
throw new ProcessingError (type , "Conversion %s.%s expects %d arguments" , factory .fullClassName , factory .methodName , factory .extraParamCount );
145
140
}
146
141
147
- PrimitiveType [] acceptedPrimitives ;
148
- if (annotation .shortCircuitPrimitive ().length > 0 ) {
149
- acceptedPrimitives = annotation .shortCircuitPrimitive ();
150
- } else {
151
- acceptedPrimitives = factory .acceptedPrimitiveTypes ;
152
- }
153
-
154
142
String [] args = new String [factory .params .length ];
155
143
int extraParamIndex = 0 ;
156
144
for (int i = 0 ; i < args .length ; ++i ) {
@@ -184,7 +172,7 @@ public static ArgumentClinicData create(ArgumentClinic annotation, TypeElement t
184
172
imports .add ("com.oracle.graal.python.builtins.objects.PNone" );
185
173
}
186
174
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 );
188
176
}
189
177
}
190
178
}
0 commit comments