Skip to content

Commit 0178aec

Browse files
author
Soroosh Sarabadani
committed
remove collectAllInterfaces method
1 parent 5b2af37 commit 0178aec

File tree

1 file changed

+7
-24
lines changed

1 file changed

+7
-24
lines changed

operator-framework/src/main/java/io/javaoperatorsdk/operator/processing/annotation/ControllerAnnotationProcessor.java

Lines changed: 7 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -156,23 +156,6 @@ private TypeMirror findResourceType(TypeElement controllerClassSymbol) throws Ex
156156
}
157157
}
158158

159-
private List<TypeMirror> collectAllInterfaces(TypeElement element) {
160-
try {
161-
List<TypeMirror> interfaces = new ArrayList<>(element.getInterfaces());
162-
interfaces.add(element.getSuperclass());
163-
TypeElement superclass = ((TypeElement) ((DeclaredType) element.getSuperclass()).asElement());
164-
while (superclass.getSuperclass().getKind() != TypeKind.NONE) {
165-
interfaces.addAll(superclass.getInterfaces());
166-
superclass = ((TypeElement) ((DeclaredType) superclass.getSuperclass()).asElement());
167-
interfaces.add(element.getSuperclass());
168-
}
169-
return interfaces;
170-
} catch (Exception e) {
171-
e.printStackTrace();
172-
return null;
173-
}
174-
}
175-
176159
private String makeQualifiedClassName(String packageName, String className) {
177160
if (packageName.equals("")) {
178161
return className;
@@ -212,13 +195,13 @@ private List<DeclaredType> findChain(DeclaredType declaredType) {
212195
final var marchingInterfaces =
213196
((TypeElement) lastFoundInterface.asElement())
214197
.getInterfaces().stream()
215-
.filter(
216-
intface ->
217-
processingEnv
218-
.getTypeUtils()
219-
.isAssignable(intface, resourceControllerType))
220-
.map(i -> (DeclaredType) i)
221-
.collect(Collectors.toList());
198+
.filter(
199+
intface ->
200+
processingEnv
201+
.getTypeUtils()
202+
.isAssignable(intface, resourceControllerType))
203+
.map(i -> (DeclaredType) i)
204+
.collect(Collectors.toList());
222205

223206
if (marchingInterfaces.size() > 0) {
224207
result.addAll(marchingInterfaces);

0 commit comments

Comments
 (0)