-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Replace Hex.toHexString
in logging, toString etc to safer alternative
#1032
Comments
@zilm13 This looks like something simple that I can pick up, is it? |
@kishansagathiya sure, check |
Tried few different libraries, failed to find any null safe hex encoder. @zilm13 How about adding a null check before every call or create our own method that wraps this function with a null check, |
@kishansagathiya what you don't like in |
@zilm13 I thought that is one more thing that is not null safe method :), Anyway org.ethereum.util.ByteUtil.toHexString is perfect. I will use it. |
@zilm13 For something like ethereumj/ethereumj-core/src/main/java/org/ethereum/config/SystemProperties.java Line 687 in 4cdc799
You would rather want to through an error instead of setting to null, Right? |
@kishansagathiya I want to change |
…ersion This is does not include all such cases
This commit replaces use of `org.spongycastle.util.encoders.Hex.toHexString()` (Not null safe) with `org.ethereum.util.ByteUtil.toHexString()` (null safe) while logging. This covers only logging in the implementation(`/src/main`) and doesn't cover any logging in tests(`/src/tests`) Issue ethereum#1032
This commit replaces use of `org.spongycastle.util.encoders.Hex.toHexString()` (Not null safe) with `org.ethereum.util.ByteUtil.toHexString()` (null safe) while logging and in all toString() methods. This covers only logging in the implementation(`/src/main`) and doesn't cover any logging in tests(`/src/tests`) Issue ethereum#1032
This commit replaces use of `org.spongycastle.util.encoders.Hex.toHexString()` (Not null safe) with `org.ethereum.util.ByteUtil.toHexString()` (null safe) while logging and in all toString() methods. This covers only logging in the implementation(`/src/main`) and doesn't cover any logging in tests(`/src/tests`) Issue ethereum#1032
`hint` and `contract` are only being used in logs. Changing the toHexString function for them should not break anything. Issue ethereum#1032
Removed unused imports and other changes as asked for Issue ethereum#1032
More conversions Issue ethereum#1032
Issue #1032 Use null safe method for bytes to hex string conversion
resolved with #1069 |
Fails on null, pain.
The text was updated successfully, but these errors were encountered: