Skip to content

Commit 009974f

Browse files
authoredNov 29, 2022
Bulk formatting and removing unused imports (fabric8io#4517)
* fix fabric8io#3984: bulk formatting the rest of the codebase * fix fabric8io#3984: removing unused imports * fix fabric8io#3984: correcting headers
1 parent 432c48a commit 009974f

File tree

542 files changed

+8033
-7825
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

542 files changed

+8033
-7825
lines changed
 

‎crd-generator/api/src/main/java/io/fabric8/crd/generator/AbstractCustomResourceHandler.java

+17-15
Original file line numberDiff line numberDiff line change
@@ -64,33 +64,33 @@ public void handle(CustomResourceInfo config) {
6464
}
6565

6666
def = builder
67-
.accept(labelSelectorPathDetector)
68-
.accept(additionalPrinterColumnDetector)
69-
.accept(traversedClassesVisitor)
70-
.build();
67+
.accept(labelSelectorPathDetector)
68+
.accept(additionalPrinterColumnDetector)
69+
.accept(traversedClassesVisitor)
70+
.build();
7171

7272
addDecorators(config, def, specReplicasPathDetector.getPath(),
73-
statusReplicasPathDetector.getPath(), labelSelectorPathDetector.getPath());
73+
statusReplicasPathDetector.getPath(), labelSelectorPathDetector.getPath());
7474

7575
Map<String, Property> additionalPrinterColumns = new HashMap<>(additionalPrinterColumnDetector.getProperties());
7676
additionalPrinterColumns.forEach((path, property) -> {
7777
Map<String, Object> parameters = property.getAnnotations().stream()
78-
.filter(a -> a.getClassRef().getName().equals("PrinterColumn")).map(AnnotationRef::getParameters)
79-
.findFirst().orElse(Collections.emptyMap());
78+
.filter(a -> a.getClassRef().getName().equals("PrinterColumn")).map(AnnotationRef::getParameters)
79+
.findFirst().orElse(Collections.emptyMap());
8080
String type = AbstractJsonSchema.getSchemaTypeFor(property.getTypeRef());
8181
String column = (String) parameters.get("name");
8282
if (Utils.isNullOrEmpty(column)) {
8383
column = property.getName().toUpperCase();
8484
}
8585
String description = property.getComments().stream().filter(l -> !l.trim().startsWith("@"))
86-
.collect(Collectors.joining(" ")).trim();
86+
.collect(Collectors.joining(" ")).trim();
8787
String format = (String) parameters.get("format");
8888

8989
resources.decorate(
90-
getPrinterColumnDecorator(name, version, path, type, column, description, format));
90+
getPrinterColumnDecorator(name, version, path, type, column, description, format));
9191
});
9292
}
93-
93+
9494
/**
9595
* Provides the decorator implementation associated with the CRD generation version.
9696
*
@@ -104,19 +104,21 @@ public void handle(CustomResourceInfo config) {
104104
* @return the concrete decorator implementing the addition of a printer column to the currently built CRD
105105
*/
106106
protected abstract Decorator getPrinterColumnDecorator(String name, String version, String path,
107-
String type, String column, String description, String format);
107+
String type, String column, String description, String format);
108+
108109
/**
109110
* Adds all the necessary decorators to build the specific CRD version. For optional paths, see
110111
* https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.20/#customresourcesubresourcescale-v1-apiextensions-k8s-io
111112
* These paths
112113
*
113114
* @param config the gathered {@link CustomResourceInfo} used as basis for the CRD generation
114-
* @param def the {@link TypeDef} associated with the {@link io.fabric8.kubernetes.client.CustomResource} from which the CRD is generated
115+
* @param def the {@link TypeDef} associated with the {@link io.fabric8.kubernetes.client.CustomResource} from which the CRD
116+
* is generated
115117
* @param specReplicasPath an optionally detected path of field defining spec replicas
116118
* @param statusReplicasPath an optionally detected path of field defining status replicas
117-
* @param labelSelectorPath an optionally detected path of field defining `status.selector`
119+
* @param labelSelectorPath an optionally detected path of field defining `status.selector`
118120
*/
119121
protected abstract void addDecorators(CustomResourceInfo config, TypeDef def,
120-
Optional<String> specReplicasPath, Optional<String> statusReplicasPath,
121-
Optional<String> labelSelectorPath);
122+
Optional<String> specReplicasPath, Optional<String> statusReplicasPath,
123+
Optional<String> labelSelectorPath);
122124
}

‎crd-generator/api/src/main/java/io/fabric8/crd/generator/CRDGenerationInfo.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ public Map<String, Map<String, CRDInfo>> getCRDDetailsPerNameAndVersion() {
3737

3838
void add(String crdName, String version, URI fileURI) {
3939
crdNameToVersionToCRDInfoMap.computeIfAbsent(crdName, k -> new HashMap<>())
40-
.put(version, new CRDInfo(crdName, version, new File(fileURI).getAbsolutePath(), ClassDependenciesVisitor.getDependentClassesFromCRDName(crdName)));
40+
.put(version, new CRDInfo(crdName, version, new File(fileURI).getAbsolutePath(),
41+
ClassDependenciesVisitor.getDependentClassesFromCRDName(crdName)));
4142
}
4243

4344
public int numberOfGeneratedCRDs() {

0 commit comments

Comments
 (0)
Please sign in to comment.