Skip to content

Commit 766cab5

Browse files
authored
fix: renaming empty sting (#1096)
1 parent 9d36fb3 commit 766cab5

File tree

7 files changed

+12
-12
lines changed

7 files changed

+12
-12
lines changed

operator-framework-core/src/main/java/io/javaoperatorsdk/operator/ReconcilerUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public static String getNameFor(Class<? extends Reconciler> reconcilerClass) {
7575
final var annotation = reconcilerClass.getAnnotation(ControllerConfiguration.class);
7676
if (annotation != null) {
7777
final var name = annotation.name();
78-
if (!Constants.EMPTY_STRING.equals(name)) {
78+
if (!Constants.NO_VALUE_SET.equals(name)) {
7979
return name;
8080
}
8181
}

operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/Constants.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
public final class Constants {
44

5-
public static final String EMPTY_STRING = "";
5+
public static final String NO_VALUE_SET = "";
66
public static final String WATCH_CURRENT_NAMESPACE = "JOSDK_WATCH_CURRENT";
77
public static final long NO_RECONCILIATION_MAX_INTERVAL = -1L;
88

operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/ControllerConfiguration.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
@Target({ElementType.TYPE})
1313
public @interface ControllerConfiguration {
1414

15-
String name() default Constants.EMPTY_STRING;
15+
String name() default Constants.NO_VALUE_SET;
1616

1717
/**
1818
* Optional finalizer name, if it is not provided, one will be automatically generated. Note that
@@ -22,7 +22,7 @@
2222
*
2323
* @return the finalizer name
2424
*/
25-
String finalizerName() default Constants.EMPTY_STRING;
25+
String finalizerName() default Constants.NO_VALUE_SET;
2626

2727
/**
2828
* If true, will dispatch new event to the controller if generation increased since the last
@@ -48,7 +48,7 @@
4848
*
4949
* @return the label selector
5050
*/
51-
String labelSelector() default Constants.EMPTY_STRING;
51+
String labelSelector() default Constants.NO_VALUE_SET;
5252

5353
/**
5454
* <p>
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
package io.javaoperatorsdk.operator.api.reconciler.dependent;
22

3-
import static io.javaoperatorsdk.operator.api.reconciler.Constants.EMPTY_STRING;
3+
import static io.javaoperatorsdk.operator.api.reconciler.Constants.NO_VALUE_SET;
44

55
public @interface Dependent {
66

77
@SuppressWarnings("rawtypes")
88
Class<? extends DependentResource> type();
99

10-
String name() default EMPTY_STRING;
10+
String name() default NO_VALUE_SET;
1111
}

operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/dependent/kubernetes/KubernetesDependent.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import java.lang.annotation.RetentionPolicy;
66
import java.lang.annotation.Target;
77

8-
import static io.javaoperatorsdk.operator.api.reconciler.Constants.EMPTY_STRING;
8+
import static io.javaoperatorsdk.operator.api.reconciler.Constants.NO_VALUE_SET;
99

1010
@Retention(RetentionPolicy.RUNTIME)
1111
@Target({ElementType.TYPE})
@@ -27,5 +27,5 @@
2727
*
2828
* @return the label selector
2929
*/
30-
String labelSelector() default EMPTY_STRING;
30+
String labelSelector() default NO_VALUE_SET;
3131
}

operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/dependent/kubernetes/KubernetesDependentResourceConfig.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
package io.javaoperatorsdk.operator.processing.dependent.kubernetes;
22

3-
import static io.javaoperatorsdk.operator.api.reconciler.Constants.EMPTY_STRING;
3+
import static io.javaoperatorsdk.operator.api.reconciler.Constants.NO_VALUE_SET;
44

55
public class KubernetesDependentResourceConfig {
66

77
private String[] namespaces = new String[0];
8-
private String labelSelector = EMPTY_STRING;
8+
private String labelSelector = NO_VALUE_SET;
99

1010
public KubernetesDependentResourceConfig() {}
1111

operator-framework-core/src/test/java/io/javaoperatorsdk/operator/processing/event/source/CustomResourceSelectorTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ public TestCustomResource newMyResource(String app, String namespace) {
134134
public static class MyConfiguration extends DefaultControllerConfiguration<TestCustomResource> {
135135

136136
public MyConfiguration() {
137-
super(MyController.class.getCanonicalName(), "mycontroller", null, Constants.EMPTY_STRING,
137+
super(MyController.class.getCanonicalName(), "mycontroller", null, Constants.NO_VALUE_SET,
138138
false, null,
139139
null, null, null, TestCustomResource.class, null, null);
140140
}

0 commit comments

Comments
 (0)