-
Notifications
You must be signed in to change notification settings - Fork 26
chore: code quality refinements (Optional accessors, serializer cleanup, unchecked warnings, Javadoc, JSON order) #476
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
Conversation
💡 Codex Reviewnostr-java/nostr-java-api/src/main/java/nostr/api/NIP04.java Lines 306 to 328 in 199764f
p tag is a GenericTag
The new implementation of ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting |
|
@codex address the comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refines code quality across multiple areas: Optional accessors for nullable tag fields, serializer cleanup eliminating @SuppressWarnings("unchecked") where possible, JSON serialization consistency with @JsonInclude and @JsonPropertyOrder, import reordering to follow static-last convention, Javadoc improvements with NIP references, and small efficiency tweaks inlining transient locals. Additionally, it removes deprecated code (legacy relay loader) and adds missing unit tests (PointTest, AddressableEventTest, etc.).
Reviewed Changes
Copilot reviewed 300 out of 362 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| Event tag classes (EventTag, PubKeyTag, ReferenceTag, etc.) | Added Optional accessors; adopted @JsonInclude/@JsonPropertyOrder; removed unchecked casts; updated Javadoc |
| Message codecs (ReqMessage, OkMessage, etc.) | Localized @SuppressWarnings("unchecked") to exact cast sites; reordered imports |
| Serializers (ReferenceTagSerializer, AddressTagSerializer) | Replaced null checks with Optional-based patterns |
| Event implementations (ChannelMessageEvent, ChannelMetadataEvent, ClassifiedListingEvent) | Adopted Optional accessors for filtering/building |
| Test files (unit and integration) | Reordered imports; added new test classes for AddressableEvent, EphemeralEvent, ClassifiedListingEvent, Point, RelayUri |
| Config & API support files | Removed deprecated legacyRelays() method; updated Javadoc with NIP-01 anchors; reordered imports |
| POMs | Version bumped to 1.0.1-SNAPSHOT |
|
Summary
Testing
|
Summary
Files: nostr-java-event/src/main/java/nostr/event/tag/EventTag.java
Files: nostr-java-event/src/main/java/nostr/event/tag/PubKeyTag.java
Files: nostr-java-event/src/main/java/nostr/event/tag/PriceTag.java
Files: nostr-java-event/src/main/java/nostr/event/tag/AddressTag.java
Files: nostr-java-event/src/main/java/nostr/event/tag/SubjectTag.java
Files: nostr-java-event/src/main/java/nostr/event/tag/ReferenceTag.java
Files: nostr-java-event/src/main/java/nostr/event/impl/ClassifiedListingEvent.java
Files: nostr-java-event/src/main/java/nostr/event/json/serializer/ReferenceTagSerializer.java, AddressTagSerializer.java
Files: nostr-java-event/src/main/java/nostr/event/impl/ChannelMessageEvent.java, ChannelMetadataEvent.java
LabelNamespaceTag.java
Testing