mirror of
https://github.com/zaaarf/lillero-processor.git
synced 2024-11-22 09:54:51 +01:00
fix: logical flaw in error handling
This commit is contained in:
parent
d2fe55db7a
commit
3cea0d3e66
1 changed files with 4 additions and 5 deletions
|
@ -248,18 +248,17 @@ public class LilleroProcessor extends AbstractProcessor {
|
||||||
.stream()
|
.stream()
|
||||||
.filter(i -> i.getSimpleName().contentEquals(targetAnn.of()))
|
.filter(i -> i.getSimpleName().contentEquals(targetAnn.of()))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
} else if(injectors.size() == 1) {
|
} else if(injectors.size() == 1 && targets.size() == 1) {
|
||||||
//case 2: there is only one injector
|
//case 2: there is only one target, must use it for that injector
|
||||||
finderCandidates = new ArrayList<>(); //no candidates
|
finderCandidates = new ArrayList<>(); //no candidates
|
||||||
injectorCandidates = new ArrayList<>();
|
injectorCandidates = new ArrayList<>();
|
||||||
injectorCandidates.add(injectors.get(0));
|
injectorCandidates.add(injectors.get(0));
|
||||||
} else {
|
} else {
|
||||||
//case 3: try to match by injectTargetName or same name for finers
|
//case 3: try to match by injectTargetName or same name for finders
|
||||||
String inferredName = "inject" + tg.getSimpleName();
|
|
||||||
injectorCandidates =
|
injectorCandidates =
|
||||||
injectorCandidates
|
injectorCandidates
|
||||||
.stream()
|
.stream()
|
||||||
.filter(t -> t.getSimpleName().toString().equalsIgnoreCase(inferredName))
|
.filter(t -> t.getSimpleName().toString().equalsIgnoreCase("inject" + tg.getSimpleName()))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
finderCandidates =
|
finderCandidates =
|
||||||
finderCandidates
|
finderCandidates
|
||||||
|
|
Loading…
Reference in a new issue