Skip to content

Commit fd64777

Browse files
committed
No point checking for null, the constructor handles the null the same as the default constructor which just passes null directly into this constructor anyway. So if there's a value we get what we want, and if there's not, we still get what we want. Simpler is better.
1 parent fd5f201 commit fd64777

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/main/java/org/csanchez/jenkins/plugins/kubernetes/pipeline/PodTemplateStepExecution.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,7 @@ public boolean start() throws Exception {
8585
String name = String.format(NAME_FORMAT, stepName, randString);
8686
String namespace = checkNamespace(cloud, podTemplateContext);
8787

88-
if (step.getId() != null) {
89-
newTemplate = new PodTemplate(step.getId());
90-
} else {
91-
newTemplate = new PodTemplate();
92-
}
93-
88+
newTemplate = new PodTemplate(step.getId());
9489
newTemplate.setName(name);
9590
newTemplate.setNamespace(namespace);
9691

0 commit comments

Comments
 (0)