Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasstamann committed Oct 9, 2023
2 parents b06114b + 3694d19 commit 6945e5a
Show file tree
Hide file tree
Showing 20 changed files with 44 additions and 44 deletions.
2 changes: 1 addition & 1 deletion annotationwrapper/api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<parent>
<groupId>io.toolisticon.aptk</groupId>
<artifactId>aptk-annotationwrapper-parent</artifactId>
<version>0.22.4</version>
<version>0.22.5</version>
</parent>

<name>aptk-annotationwrapper-api</name>
Expand Down
2 changes: 1 addition & 1 deletion annotationwrapper/integrationtest/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<parent>
<groupId>io.toolisticon.aptk</groupId>
<artifactId>aptk-annotationwrapper-parent</artifactId>
<version>0.22.4</version>
<version>0.22.5</version>
</parent>

<name>aptk-annotationwrapper-integrationTest</name>
Expand Down
2 changes: 1 addition & 1 deletion annotationwrapper/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<parent>
<groupId>io.toolisticon.aptk</groupId>
<artifactId>aptk-parent</artifactId>
<version>0.22.4</version>
<version>0.22.5</version>
</parent>


Expand Down
2 changes: 1 addition & 1 deletion annotationwrapper/processor/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<parent>
<groupId>io.toolisticon.aptk</groupId>
<artifactId>aptk-annotationwrapper-parent</artifactId>
<version>0.22.4</version>
<version>0.22.5</version>
</parent>

<name>aptk-annotationwrapper-processor</name>
Expand Down
2 changes: 1 addition & 1 deletion common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>io.toolisticon.aptk</groupId>
<artifactId>aptk-parent</artifactId>
<version>0.22.4</version>
<version>0.22.5</version>
</parent>

<name>aptk-common</name>
Expand Down
2 changes: 1 addition & 1 deletion compilermessages/api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<parent>
<groupId>io.toolisticon.aptk</groupId>
<artifactId>aptk-compilermessages-parent</artifactId>
<version>0.22.4</version>
<version>0.22.5</version>
</parent>

<name>aptk-compilermessages-api</name>
Expand Down
2 changes: 1 addition & 1 deletion compilermessages/integrationtest/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<parent>
<groupId>io.toolisticon.aptk</groupId>
<artifactId>aptk-compilermessages-parent</artifactId>
<version>0.22.4</version>
<version>0.22.5</version>
</parent>

<name>aptk-compilermessages-integrationTest</name>
Expand Down
2 changes: 1 addition & 1 deletion compilermessages/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<parent>
<groupId>io.toolisticon.aptk</groupId>
<artifactId>aptk-parent</artifactId>
<version>0.22.4</version>
<version>0.22.5</version>
</parent>


Expand Down
2 changes: 1 addition & 1 deletion compilermessages/processor/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<parent>
<groupId>io.toolisticon.aptk</groupId>
<artifactId>aptk-compilermessages-parent</artifactId>
<version>0.22.4</version>
<version>0.22.5</version>
</parent>

<name>aptk-compilermessages-processor</name>
Expand Down
2 changes: 1 addition & 1 deletion cute/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<parent>
<groupId>io.toolisticon.aptk</groupId>
<artifactId>aptk-parent</artifactId>
<version>0.22.4</version>
<version>0.22.5</version>
</parent>

<name>aptk-cute</name>
Expand Down
2 changes: 1 addition & 1 deletion example/example-annotationprocessor/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<parent>
<groupId>io.toolisticon.aptk</groupId>
<artifactId>aptk-example-parent</artifactId>
<version>0.22.4</version>
<version>0.22.5</version>
</parent>

<name>aptk-example-annotationprocessor</name>
Expand Down
2 changes: 1 addition & 1 deletion example/example-annotations/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>io.toolisticon.aptk</groupId>
<artifactId>aptk-example-parent</artifactId>
<version>0.22.4</version>
<version>0.22.5</version>
</parent>

<name>aptk-example-annotations</name>
Expand Down
2 changes: 1 addition & 1 deletion example/example-usecase/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>io.toolisticon.aptk</groupId>
<artifactId>aptk-example-parent</artifactId>
<version>0.22.4</version>
<version>0.22.5</version>
</parent>

<name>aptk-example-usecase</name>
Expand Down
2 changes: 1 addition & 1 deletion example/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>io.toolisticon.aptk</groupId>
<artifactId>aptk-parent</artifactId>
<version>0.22.4</version>
<version>0.22.5</version>
</parent>

<name>aptk-example-parent</name>
Expand Down
2 changes: 1 addition & 1 deletion extensions/java9/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<parent>
<groupId>io.toolisticon.aptk</groupId>
<artifactId>extension-parent</artifactId>
<version>0.22.4</version>
<version>0.22.5</version>
</parent>

<name>aptk-tools-java9</name>
Expand Down
2 changes: 1 addition & 1 deletion extensions/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>io.toolisticon.aptk</groupId>
<artifactId>aptk-parent</artifactId>
<version>0.22.4</version>
<version>0.22.5</version>
</parent>

<name>extension-parent</name>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>io.toolisticon.aptk</groupId>
<artifactId>aptk-parent</artifactId>
<version>0.22.4</version>
<version>0.22.5</version>
<packaging>pom</packaging>

<name>aptk-parent</name>
Expand Down
2 changes: 1 addition & 1 deletion templating/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>io.toolisticon.aptk</groupId>
<artifactId>aptk-parent</artifactId>
<version>0.22.4</version>
<version>0.22.5</version>
</parent>

<name>aptk-templating</name>
Expand Down
2 changes: 1 addition & 1 deletion tools/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<parent>
<groupId>io.toolisticon.aptk</groupId>
<artifactId>aptk-parent</artifactId>
<version>0.22.4</version>
<version>0.22.5</version>
</parent>

<name>aptk-tools</name>
Expand Down
50 changes: 25 additions & 25 deletions tools/src/main/java/io/toolisticon/aptk/tools/InterfaceUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -141,20 +141,23 @@ static TypeMirrorWrapper[] getTypeArgumentsForParentInterface(TypeMirrorWrapper
}


static class TVTypeMirrorWrapper extends TypeMirrorWrapper {
public static class TVTypeMirrorWrapper extends TypeMirrorWrapper {

private final TypeMirrorWrapper originalTypeMirror;
private final Map<String, TypeMirrorWrapper> typeVarMap;

TVTypeMirrorWrapper(TypeMirror typeMirror, Map<String, TypeMirrorWrapper> typeVarMap) {
super(typeMirror);
super(getTypeMirrorWithReplacedTypeVars(typeMirror, typeVarMap).unwrap());
this.originalTypeMirror = TypeMirrorWrapper.wrap(typeMirror);
this.typeVarMap = typeVarMap;
}

TypeMirrorWrapper getTypeMirrorWithReplacedTypeVars() {
if (isTypeVar() && typeVarMap.containsKey(getTypeVar().toString())) {
return typeVarMap.get(getTypeVar().toString());
static TypeMirrorWrapper getTypeMirrorWithReplacedTypeVars(TypeMirror typeMirror, Map<String, TypeMirrorWrapper> typeVarMap) {
TypeMirrorWrapper typeMirrorWrapper = TypeMirrorWrapper.wrap(typeMirror);
if (typeMirrorWrapper.isTypeVar() && typeVarMap.containsKey(typeMirrorWrapper.getTypeVar().toString())) {
return typeVarMap.get(typeMirrorWrapper.getTypeVar().toString());
} else {
return TypeMirrorWrapper.wrap(this.unwrap());
return typeMirrorWrapper;
}
}

Expand All @@ -167,26 +170,25 @@ TypeMirrorWrapper getTypeMirrorWithReplacedTypeVars() {
*/
public String getTypeDeclaration() {

TypeMirrorWrapper typeMirror = getTypeMirrorWithReplacedTypeVars();

if (typeMirror.getKind() == TypeKind.VOID) {
if (this.getKind() == TypeKind.VOID) {
return "void";
} else if (typeMirror.isPrimitive()) {
return typeMirror.toString();
} else if (typeMirror.isArray()) {
return getTypeDeclaration(typeMirror.getComponentType()) + "[]";
} else if (typeMirror.isTypeVar()) {
return typeMirror.toString();
} else if (typeMirror.isDeclared()) {

return typeMirror.getSimpleName() + (
typeMirror.hasTypeArguments() ? "<" + typeMirror.getWrappedTypeArguments().stream()
} else if (this.isPrimitive()) {
return this.toString();
} else if (this.isArray()) {
return getTypeDeclaration(this.getComponentType()) + "[]";
} else if (this.isTypeVar()) {
return this.toString();
} else if (this.isDeclared()) {

return this.getSimpleName() + (
this.hasTypeArguments() ? "<" + this.getWrappedTypeArguments().stream()
.map(e -> new TVTypeMirrorWrapper(e.unwrap(), typeVarMap))
.map(e -> e.getTypeDeclaration()).collect(Collectors.joining(", ")) + ">" : ""
);

} else if (typeMirror.isWildcardType()) {
WildcardType wildcardType = typeMirror.getWildcardType();
} else if (this.isWildcardType()) {
WildcardType wildcardType = this.getWildcardType();
if (wildcardType.getSuperBound() != null) {
return "? super " + new TVTypeMirrorWrapper(wildcardType.getSuperBound(), typeVarMap).getTypeDeclaration();
} else if (wildcardType.getExtendsBound() != null) {
Expand All @@ -196,13 +198,11 @@ public String getTypeDeclaration() {
}
}

return typeMirror.toString();
return this.toString();
}

@Override
public Set<String> getImports() {
return getTypeMirrorWithReplacedTypeVars().getImports();
}


}


Expand Down

0 comments on commit 6945e5a

Please sign in to comment.