Jkube: RunService.java: Use isEmpty() to check whether the collection is empty or not.

Created on 23 Jun 2021  路  5Comments  路  Source: eclipse/jkube

Description

The following statement is reported as a code smell by SonarCloud:

https://github.com/eclipse/jkube/blob/8ca3f342372128fe12ea1572db1e37d033406a94/jkube-kit/build/service/docker/src/main/java/org/eclipse/jkube/kit/build/service/docker/RunService.java#L411

Replace with .isEmpty:

return !ret.isEmpty() ? ret : null;

Bonus

Create a unit test to verify your changes (intermediate).

How to _manually_ test my changes

Kubernetes

If you don't have a real Kubernetes cluster available (most probably), you can use Minikube or Kind to test with a local cluster.

OpenShift

If you don't have a real OpenShift cluster available (most probably), you can use Red Hat's developer Sandbox for Red Hat OpenShift. The only requirement is to have a Red Hat account.

Once you have your Sandbox environment, you'll need to download the oc tool from the cluster console.
(Press the ? icon and from the context menu select Command line tools, you'll be redirected to https://$subdomain.openshiftapps.com/command-lines-tools where you'll be able to download the CLI for your platform)

first-timers-only good first issue

Most helpful comment

@manusa, I would love to work on this issue. can I?

All 5 comments

Sorry, just learning java, if it's OK, I can help with this too :)

first-timers-only issues are intended for new contributors. If you have already committed to the project or are already working on an issue you shouldn't apply for these ones.

@manusa, I would love to work on this issue. can I?

Hi @manusa, I fixed the issue. Please review my work. Thanks :)

@Jayita10 thanks for contributing to Eclipse JKube, you've now become part of the extensive list of contributors to JKube and to the Eclipse foundation

As stated in this comment, we'd be very happy if you stayed around and involved with the project. We'll try to label some new (a little bit more involved issues) with help wanted for you to pick up. Contributing to Open Source is not just about coding, but also about contributing to the community. Talking about the project, writing a blog or an article, helping with documentation, etc. are also other ways to collaborate with us.

Was this page helpful?
0 / 5 - 0 ratings