|
1 | 1 | package io.avaje.inject.generator;
|
2 | 2 |
|
3 | 3 | import static io.avaje.inject.generator.APContext.logError;
|
| 4 | + |
4 | 5 | import java.util.ArrayList;
|
5 | 6 | import java.util.Collections;
|
6 | 7 | import java.util.LinkedHashSet;
|
@@ -54,10 +55,15 @@ final class BeanReader {
|
54 | 55 | this.beanType = beanType;
|
55 | 56 | this.type = beanType.getQualifiedName().toString();
|
56 | 57 | this.shortName = shortName(beanType);
|
57 |
| - this.prototype = PrototypePrism.isPresent(beanType); |
| 58 | + this.prototype = |
| 59 | + PrototypePrism.isPresent(beanType) |
| 60 | + || importedComponent && ProcessingContext.isImportedPrototype(beanType); |
58 | 61 | this.primary = PrimaryPrism.isPresent(beanType);
|
59 | 62 | this.secondary = !primary && SecondaryPrism.isPresent(beanType);
|
60 |
| - this.lazy = !FactoryPrism.isPresent(beanType) && LazyPrism.isPresent(beanType); |
| 63 | + this.lazy = |
| 64 | + !FactoryPrism.isPresent(beanType) |
| 65 | + && (LazyPrism.isPresent(beanType) |
| 66 | + || importedComponent && ProcessingContext.isImportedLazy(beanType)); |
61 | 67 | final var beantypes = BeanTypesPrism.getOptionalOn(beanType);
|
62 | 68 | beantypes.ifPresent(p -> Util.validateBeanTypes(beanType, p.value()));
|
63 | 69 | this.typeReader =
|
@@ -371,7 +377,7 @@ private Set<String> importTypes() {
|
371 | 377 | }
|
372 | 378 | }
|
373 | 379 | checkImports();
|
374 |
| - if (!suppressGeneratedImport){ |
| 380 | + if (!suppressGeneratedImport) { |
375 | 381 | importTypes.add(Constants.GENERATED);
|
376 | 382 | }
|
377 | 383 | if (!suppressBuilderImport && !isGenerateProxy()) {
|
|
0 commit comments