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

chore: Avoid comparing potential nulls #18914

Closed
wants to merge 1 commit into from
Closed

Conversation

david-mackessy
Copy link
Contributor

No description provided.

Copy link

@@ -449,7 +449,7 @@
? jobType.getRelativeApiElements().get(field.getName())
: "";

if (relativeApiElements != null && !relativeApiElements.equals("")) {
if (relativeApiElements != null && !"".equals(relativeApiElements)) {

Check notice

Code scanning / CodeQL

Inefficient empty string test Note

Inefficient comparison to empty string, check for zero length instead.
@@ -54,57 +54,57 @@

// if we reach a field transformer, parse it out here (necessary to
// allow for () to be used to handle transformer parameters)
if ((c.equals(":") && fieldSplit[i + 1].equals(":")) || c.equals("~") || c.equals("|")) {
if ((":".equals(c) && ":".equals(fieldSplit[i + 1])) || "~".equals(c) || "|".equals(c)) {

Check failure

Code scanning / CodeQL

Array index out of bounds Error

This array access might be out of bounds, as the index might be equal to the array length.
@david-mackessy
Copy link
Contributor Author

testing open rewrite

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant