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

Remove dependency on JDK 17 HexFormat #85

Merged
merged 1 commit into from
Sep 3, 2024

Conversation

msgilligan
Copy link
Member

Add ByteArray, ByteUtils, and HexFormat classes to do it.

@msgilligan msgilligan added this to the Version 0.0.2 milestone Sep 2, 2024
Add ByteArray, ByteUtils, and HexFormat classes
to do it.
Copy link
Member

@schildbach schildbach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a bit unfortunate that this PR duplicates a couple of classes from base.internal. But I guess since it's internal, secp can't use it?

import java.util.Comparator;

/**
*
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An empty comment?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For now...

return ARRAY_UNSIGNED_COMPARATOR;
}

// In Java 9, this can be replaced with Arrays.compareUnsigned()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume you're planning for JDK 8? Otherweise you as per comment you could replace this.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, planning for JDK 8!

@msgilligan
Copy link
Member Author

It's a bit unfortunate that this PR duplicates a couple of classes from base.internal. But I guess since it's internal, secp can't use it?

I think the duplication is ok, for now. But I envision the following strategy:

  1. Port secp-api and secp-bouncy the rest of the way back to JDK 8
  2. In the bitcoinj release that is refactored to use secp-api, have base depend on secp-api and remove the duplication then.

@msgilligan
Copy link
Member Author

There are definitely a few things in here that need cleanup, but I'm going to merge and we can fix them later.

@msgilligan msgilligan merged commit 4ff1e42 into master Sep 3, 2024
6 checks passed
@msgilligan msgilligan deleted the msgilligan/ByteArray-ByteUtils-HexFormat branch September 3, 2024 00:14
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.

2 participants