Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ValidationUtil : Replace String concatenation arguments with StringBuilder.append() call #2840

Open
rohanKanojia opened this issue Mar 20, 2024 · 4 comments
Labels
first-timers-only Is this your first time contributing? This could be a good place to start! good first issue Good for newcomers

Comments

@rohanKanojia
Copy link
Member

Component

JKube Kit

Task description

Description

We are using string concatenation within a String builder call:
https://github.com/eclipse/jkube/blob/b10c54f17d33974c80c1fc4a26ce6a44ef29dcf7/jkube-kit/common/src/main/java/org/eclipse/jkube/kit/common/util/ValidationUtil.java#L45

Sonar flags them as a code smell. We should refactor this code to use chained .append calls like this:

builder.append(violation.getPropertyPath()).append(" ").append(violation.getMessage()).append(" on bean: ").append(leafBean);

Expected Behavior

String concatenation is replaced with .append calls

Before you start 🔴

👇 👇 👇 👇 👇 👇 👇 👇 👇 👇👇👇👇👇👇👇
Make sure you read the contributing guide first. Pay special attention to the ECA agreement section and the requirement to sign-off your commit.

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)

@rohanKanojia rohanKanojia added good first issue Good for newcomers first-timers-only Is this your first time contributing? This could be a good place to start! labels Mar 20, 2024
@rohanKanojia rohanKanojia changed the title ValidationUtil : Replace String concatenation arguments with 'StringBuilder.append()' call ValidationUtil : Replace String concatenation arguments with StringBuilder.append() call Mar 20, 2024
@s-mathavan
Copy link

I like to help you with this

s-mathavan added a commit to s-mathavan/jkube that referenced this issue Mar 21, 2024
Replace String concatenation arguments with StringBuilder.append() call eclipse-jkube#2840
s-mathavan added a commit to s-mathavan/jkube that referenced this issue Mar 21, 2024
ValidationUtil : Replace String concatenation arguments with StringBuilder.append() call eclipse-jkube#2840
@Prab-27
Copy link

Prab-27 commented Apr 9, 2024

@s-mathavan is this issue still open? I am a first time contributor and want to contribute

@rohanKanojia
Copy link
Member Author

@Prab-27 : There is a pull request open #2846 but it's not complying with Eclipse Contributor Legal Requirements.

Pea88 added a commit to Pea88/jkube-append-issue that referenced this issue Apr 13, 2024
Resolution for below issue

ValidationUtil : Replace String concatenation arguments with StringBuilder.append() call eclipse-jkube#2840
@ngthhu
Copy link
Contributor

ngthhu commented Apr 20, 2024

Can I work on this?

ngthhu added a commit to ngthhu/jkube that referenced this issue Apr 20, 2024
…ngBuilder.append() call (eclipse-jkube#2840)

Signed-off-by: ngthhu <hungnt.code@proton.me>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
first-timers-only Is this your first time contributing? This could be a good place to start! good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

4 participants