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

SpotBugs: generated com.hedera*Codec.toJSON() methods compares string as Objects not as their values. Must use isEmpty() #307

Open
alex-kuzmin-hg opened this issue Aug 15, 2024 · 1 comment
Labels
Bug An error that causes the feature to behave differently than what was expected based on design.

Comments

@alex-kuzmin-hg
Copy link

Description

Comparison of String objects using == or != in in all methods com.hedera*Codec.toJSON()

for example:

generated file ./hapi/build/generated/source/pbj-proto/main/java/com/hedera/hapi/node/token/codec/AccountInfoJsonCodec.java
line:
if (data.memo() != "") fieldLines.add(field("memo", data.memo()));

Steps to reproduce

  1. ./gradlew clean assemble
  2. check ./hapi/build/generated/source/pbj-proto/main/java/com/hedera/hapi/node/token/codec/AccountInfoJsonCodec.java methid toJSON()

Additional context

No response

Hedera network

other

Version

0.53

Operating system

Other

@alex-kuzmin-hg alex-kuzmin-hg added the Bug An error that causes the feature to behave differently than what was expected based on design. label Sep 13, 2024
@poulok poulok transferred this issue from hashgraph/hedera-services Oct 22, 2024
@poulok
Copy link
Member

poulok commented Nov 26, 2024

@alex-kuzmin-hg please move this ticket to the PBJ repo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug An error that causes the feature to behave differently than what was expected based on design.
Projects
None yet
Development

No branches or pull requests

2 participants