diff options
author | zaaarf <zaaarf@proton.me> | 2023-03-25 21:48:53 +0100 |
---|---|---|
committer | zaaarf <zaaarf@proton.me> | 2023-03-25 21:48:53 +0100 |
commit | 3cea0d3e663e23f92649a85d5276aadab4fcb323 (patch) | |
tree | 967b69845226da7179069b01dffc46ec36a01f0e /src/main/java/ftbsc/lll/processor | |
parent | d2fe55db7a5a82f7f165df1bb57b8c9a19ab0525 (diff) |
fix: logical flaw in error handling
Diffstat (limited to 'src/main/java/ftbsc/lll/processor')
-rw-r--r-- | src/main/java/ftbsc/lll/processor/LilleroProcessor.java | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/main/java/ftbsc/lll/processor/LilleroProcessor.java b/src/main/java/ftbsc/lll/processor/LilleroProcessor.java index 39f680a..e0b8d72 100644 --- a/src/main/java/ftbsc/lll/processor/LilleroProcessor.java +++ b/src/main/java/ftbsc/lll/processor/LilleroProcessor.java @@ -248,18 +248,17 @@ public class LilleroProcessor extends AbstractProcessor { .stream() .filter(i -> i.getSimpleName().contentEquals(targetAnn.of())) .collect(Collectors.toList()); - } else if(injectors.size() == 1) { - //case 2: there is only one injector + } else if(injectors.size() == 1 && targets.size() == 1) { + //case 2: there is only one target, must use it for that injector finderCandidates = new ArrayList<>(); //no candidates injectorCandidates = new ArrayList<>(); injectorCandidates.add(injectors.get(0)); } else { - //case 3: try to match by injectTargetName or same name for finers - String inferredName = "inject" + tg.getSimpleName(); + //case 3: try to match by injectTargetName or same name for finders injectorCandidates = injectorCandidates .stream() - .filter(t -> t.getSimpleName().toString().equalsIgnoreCase(inferredName)) + .filter(t -> t.getSimpleName().toString().equalsIgnoreCase("inject" + tg.getSimpleName())) .collect(Collectors.toList()); finderCandidates = finderCandidates |