Skip to content

Commit bd98bd6

Browse files
authored
Merge pull request #486 from SentryMan/proxy
Simply Proxy Generation
2 parents 35fae66 + cadb0f8 commit bd98bd6

File tree

3 files changed

+4
-11
lines changed

3 files changed

+4
-11
lines changed

inject-generator/src/main/java/io/avaje/inject/generator/BeanReader.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,9 @@ final class BeanReader {
6060
this.constructor = typeReader.constructor();
6161
this.importedComponent = importedComponent && (constructor != null && constructor.isPublic());
6262

63-
var proxyPrism = ProxyPrism.getInstanceOn(beanType);
64-
if (proxyPrism != null) {
63+
if (ProxyPrism.isPresent(beanType)) {
6564
this.proxy = true;
66-
var proxyMirror = proxyPrism.value();
67-
if (!"Void".equals(proxyMirror.toString())) {
68-
conditions.readAll(APContext.asTypeElement(proxyMirror));
69-
}
65+
conditions.readAll(APContext.asTypeElement(beanType.getSuperclass()));
7066
} else {
7167
conditions.readAll(beanType);
7268
this.proxy = false;

inject-generator/src/main/java/io/avaje/inject/generator/SimpleBeanProxyWriter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ private void writeClassEnd() {
102102
}
103103

104104
private void writeClassStart() {
105-
writer.append(Constants.AT_PROXY).append("(%s.class)", shortName).eol();
105+
writer.append(Constants.AT_PROXY).eol();
106106
writer.append(Constants.AT_GENERATED).eol();
107107
writer.append("public final class %s%s extends %s {", shortName, suffix, shortName).eol().eol();
108108
}

inject/src/main/java/io/avaje/inject/spi/Proxy.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,4 @@
88
/** Marks the type as being a Proxy. */
99
@Target(ElementType.TYPE)
1010
@Retention(RetentionPolicy.RUNTIME)
11-
public @interface Proxy {
12-
/** The class being proxied */
13-
Class<?> value() default Void.class;
14-
}
11+
public @interface Proxy {}

0 commit comments

Comments
 (0)