@@ -57,7 +57,7 @@ public Coercion findCoercion(
57
57
return handle (optionalInfo , basicInfo , paramName , mapperClass , collectorClass );
58
58
} catch (TmpException e ) {
59
59
throw e .asValidationException (sourceMethod );
60
- } catch (SearchHintException e ) {
60
+ } catch (UnknownTypeException e ) {
61
61
Optional <String > hint = HintProvider .instance ().findHint (optionalInfo , basicInfo );
62
62
throw hint .map (m -> e .asValidationException (sourceMethod , m ))
63
63
.orElseGet (() -> e .asValidationException (sourceMethod ));
@@ -69,7 +69,7 @@ private Coercion handle(
69
69
BasicInfo basicInfo ,
70
70
String paramName ,
71
71
TypeElement mapperClass ,
72
- TypeElement collectorClass ) throws TmpException , SearchHintException {
72
+ TypeElement collectorClass ) throws TmpException , UnknownTypeException {
73
73
boolean auto = mapperClass == null ;
74
74
if (basicInfo .repeatable ) {
75
75
if (auto ) {
@@ -89,7 +89,7 @@ private Coercion handle(
89
89
// no mapper, not repeatable
90
90
private Coercion handleSingleAuto (
91
91
Optional <TypeMirror > optionalInfo ,
92
- BasicInfo basicInfo ) throws TmpException , SearchHintException {
92
+ BasicInfo basicInfo ) throws TmpException , UnknownTypeException {
93
93
CoercionFactory factory = findCoercion (optionalInfo .orElse (basicInfo .returnType ()));
94
94
return factory .getCoercion (basicInfo , optionalInfo , Optional .empty ());
95
95
}
@@ -122,20 +122,20 @@ private Coercion handleRepeatable(
122
122
// repeatable without mapper
123
123
private Coercion handleRepeatableAuto (
124
124
TypeElement collectorClass ,
125
- BasicInfo basicInfo ) throws TmpException , SearchHintException {
125
+ BasicInfo basicInfo ) throws TmpException , UnknownTypeException {
126
126
CollectorInfo collectorInfo = collectorInfo (basicInfo .returnType (), collectorClass );
127
127
CoercionFactory coercion = findCoercion (collectorInfo .inputType );
128
128
return coercion .getCoercion (basicInfo , Optional .empty (), collectorInfo .collectorType ());
129
129
}
130
130
131
- private CoercionFactory findCoercion (TypeMirror mirror ) throws TmpException , SearchHintException {
131
+ private CoercionFactory findCoercion (TypeMirror mirror ) throws TmpException , UnknownTypeException {
132
132
CoercionFactory standardCoercion = StandardCoercions .get (mirror );
133
133
if (standardCoercion != null ) {
134
134
return standardCoercion ;
135
135
}
136
136
boolean isEnum = isEnumType (mirror );
137
137
if (!isEnum ) {
138
- throw SearchHintException .create ("Unknown parameter type. Define a custom mapper." );
138
+ throw UnknownTypeException .create ();
139
139
}
140
140
return EnumCoercion .create (mirror );
141
141
}
@@ -166,11 +166,11 @@ private CollectorInfo collectorInfo(
166
166
}
167
167
TypeTool tool = TypeTool .get ();
168
168
if (!tool .isSameErasure (returnType , List .class )) {
169
- throw TmpException .create ("Either define a custom collector, or return List" );
169
+ throw TmpException .create ("Either define a custom collector, or return List. " );
170
170
}
171
171
List <? extends TypeMirror > typeParameters = tool .typeargs (returnType );
172
172
if (typeParameters .isEmpty ()) {
173
- throw TmpException .create ("Either define a custom collector, or return List " );
173
+ throw TmpException .create ("Add a type parameter. " );
174
174
}
175
175
return CollectorInfo .listCollector (typeParameters .get (0 ));
176
176
}
0 commit comments