Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Suggestion : Improvement of String.equals("xxx") #4320

@o0lwj0o

Description

@o0lwj0o

Hi,
I have found some usage of “String.equals("xxx")” in this project.

When using string.equals("a") ,it will get nullpointexception if string ==null.
The problem can be fixed by repalced with "a".equals(string) or Objects.equals(string,"a").

Detail websites and lines are listed below

77 80 83 86 89 92 95 98 101 104 | https://github.com/googleapis/google-cloud-java/blob/master/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InsertTargetTcpProxyHttpRequest.java

There are too many cases of "fieldName.equals("xxxxx")" .

Best regards

Metadata

Metadata

Assignees

Labels

api: computeIssues related to the Compute Engine API.priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions