Skip to content

Commit

Permalink
Fix nullable optionals (#207)
Browse files Browse the repository at this point in the history
* Initial commit

* Fix lint warnings about @nullable on Optional attributes.

This commit removes the @nullable annotation from Optional attributes in several files.
This was causing lint warnings because the combination of @nullable and Optional
is not recommended. The changes have been made in the following files:
- src/main/java/com/spotify/github/v3/activity/events/StatusEvent.java
- src/main/java/com/spotify/github/v3/issues/Issue.java
- src/main/java/com/spotify/github/v3/repos/RepositoryInvitation.java
- src/main/java/com/spotify/github/v3/prs/Review.java
- src/main/java/com/spotify/github/v3/activity/events/CreateEvent.java
- src/main/java/com/spotify/github/v3/activity/events/PushEvent.java

---------

Co-authored-by: labs-code-app[bot] <161369871+labs-code-app[bot]@users.noreply.github.com>
  • Loading branch information
jedborovik and google-labs-jules[bot] authored Jan 29, 2025
1 parent ec7d32a commit 8281c7a
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ public interface CreateEvent extends BaseEvent {
String masterBranch();

/** The repository's current description. */
@Nullable
Optional<String> description();

/** No doc found on github - Usually is "user". */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ public interface PushEvent {
List<PushCommit> commits();

/** The push commit object of the most recent commit on ref after the push. */
@Nullable
Optional<PushCommit> headCommit();

/** Pusher */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ public interface StatusEvent extends BaseEvent, UpdateTracking {
String context();

/** The optional human-readable description added to the status. */
@Nullable
Optional<String> description();

/** The new state. Can be pending, success, failure, or error. */
Expand Down
3 changes: 0 additions & 3 deletions src/main/java/com/spotify/github/v3/issues/Issue.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,9 @@ public interface Issue extends CloseTracking {
URI url();

/** Events URL. */
@Nullable
Optional<URI> eventsUrl();

/** Repository URL. */
@Nullable
Optional<URI> repositoryUrl();

/** Labels URL template. */
Expand Down Expand Up @@ -80,7 +78,6 @@ public interface Issue extends CloseTracking {
String title();

/** The contents of the issue. */
@Nullable
Optional<String> body();

/** User. */
Expand Down
1 change: 0 additions & 1 deletion src/main/java/com/spotify/github/v3/prs/Review.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ public interface Review {
User user();

/** Body. */
@Nullable
Optional<String> body();

/** Submitted at. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ public interface RepositoryInvitation {
ZonedDateTime createdAt();

/** Whether or not the invitation has expired */
@Nullable
Optional<Boolean> expired();

/** API URL */
Expand Down

0 comments on commit 8281c7a

Please sign in to comment.