Suggestion : Improvement of String.equals("xxx") #4320
Labels
api: compute
Issues related to the Compute Engine API.
priority: p2
Moderately-important priority. Fix may not be included in next release.
type: bug
Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
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
The text was updated successfully, but these errors were encountered: