2424
2525package org .kohsuke .github ;
2626
27- import static org .kohsuke .github .Previews .SQUIRREL_GIRL ;
28-
2927import com .infradna .tool .bridge_method_injector .WithBridgeMethods ;
3028import edu .umd .cs .findbugs .annotations .SuppressFBWarnings ;
29+
3130import java .io .IOException ;
3231import java .net .URL ;
3332import java .util .ArrayList ;
3433import java .util .Arrays ;
3534import java .util .Collection ;
3635import java .util .Collections ;
3736import java .util .Date ;
38- import java .util .HashSet ;
3937import java .util .List ;
4038import java .util .Locale ;
41- import java .util .Set ;
39+
40+ import static org .kohsuke .github .Previews .SQUIRREL_GIRL ;
4241
4342/**
4443 * Represents an issue on GitHub.
@@ -179,7 +178,7 @@ public Collection<GHLabel> getLabels() throws IOException {
179178 if (labels == null ) {
180179 return Collections .emptyList ();
181180 }
182- return Collections .<GHLabel > unmodifiableList (labels );
181+ return Collections .<GHLabel >unmodifiableList (labels );
183182 }
184183
185184 /**
@@ -231,8 +230,8 @@ public void unlock() throws IOException {
231230 */
232231 @ WithBridgeMethods (void .class )
233232 public GHIssueComment comment (String message ) throws IOException {
234- GHIssueComment r = new Requester (root ).with ("body" , message ). to ( getIssuesApiRoute () + "/comments" ,
235- GHIssueComment .class );
233+ GHIssueComment r = new Requester (root ).with ("body" , message )
234+ . to ( getIssuesApiRoute () + "/comments" , GHIssueComment .class );
236235 return r .wrapUp (this );
237236 }
238237
@@ -443,22 +442,27 @@ public List<GHIssueComment> getComments() throws IOException {
443442 * the io exception
444443 */
445444 public PagedIterable <GHIssueComment > listComments () throws IOException {
446- return root .retrieve ().asPagedIterable (getIssuesApiRoute () + "/comments" , GHIssueComment [].class ,
447- item -> item .wrapUp (GHIssue .this ));
445+ return root .retrieve ()
446+ .asPagedIterable (getIssuesApiRoute () + "/comments" ,
447+ GHIssueComment [].class ,
448+ item -> item .wrapUp (GHIssue .this ));
448449 }
449450
450451 @ Preview
451452 @ Deprecated
452453 public GHReaction createReaction (ReactionContent content ) throws IOException {
453- return new Requester (owner .root ).withPreview (SQUIRREL_GIRL ).with ("content" , content .getContent ())
454- .to (getApiRoute () + "/reactions" , GHReaction .class ).wrap (root );
454+ return new Requester (owner .root ).withPreview (SQUIRREL_GIRL )
455+ .with ("content" , content .getContent ())
456+ .to (getApiRoute () + "/reactions" , GHReaction .class )
457+ .wrap (root );
455458 }
456459
457460 @ Preview
458461 @ Deprecated
459462 public PagedIterable <GHReaction > listReactions () {
460- return owner .root .retrieve ().withPreview (SQUIRREL_GIRL ).asPagedIterable (getApiRoute () + "/reactions" ,
461- GHReaction [].class , item -> item .wrap (owner .root ));
463+ return owner .root .retrieve ()
464+ .withPreview (SQUIRREL_GIRL )
465+ .asPagedIterable (getApiRoute () + "/reactions" , GHReaction [].class , item -> item .wrap (owner .root ));
462466 }
463467
464468 /**
@@ -482,8 +486,10 @@ public void addAssignees(GHUser... assignees) throws IOException {
482486 * the io exception
483487 */
484488 public void addAssignees (Collection <GHUser > assignees ) throws IOException {
485- root .retrieve ().method ("POST" ).with (ASSIGNEES , getLogins (assignees )).to (getIssuesApiRoute () + "/assignees" ,
486- this );
489+ root .retrieve ()
490+ .method ("POST" )
491+ .with (ASSIGNEES , getLogins (assignees ))
492+ .to (getIssuesApiRoute () + "/assignees" , this );
487493 }
488494
489495 /**
@@ -531,7 +537,10 @@ public void removeAssignees(GHUser... assignees) throws IOException {
531537 * the io exception
532538 */
533539 public void removeAssignees (Collection <GHUser > assignees ) throws IOException {
534- root .retrieve ().method ("DELETE" ).with (ASSIGNEES , getLogins (assignees )).inBody ()
540+ root .retrieve ()
541+ .method ("DELETE" )
542+ .with (ASSIGNEES , getLogins (assignees ))
543+ .inBody ()
535544 .to (getIssuesApiRoute () + "/assignees" , this );
536545 }
537546
@@ -645,8 +654,8 @@ public GHMilestone getMilestone() {
645654 /**
646655 * The type PullRequest.
647656 */
648- @ SuppressFBWarnings (value = { "UWF_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD" ,
649- "UWF_UNWRITTEN_FIELD" }, justification = "JSON API" )
657+ @ SuppressFBWarnings (value = { "UWF_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD" , "UWF_UNWRITTEN_FIELD" },
658+ justification = "JSON API" )
650659 public static class PullRequest {
651660 private String diff_url , patch_url , html_url ;
652661
@@ -694,7 +703,9 @@ protected static List<String> getLogins(Collection<GHUser> users) {
694703 * the io exception
695704 */
696705 public PagedIterable <GHIssueEvent > listEvents () throws IOException {
697- return root .retrieve ().asPagedIterable (owner .getApiTailUrl (String .format ("/issues/%s/events" , number )),
698- GHIssueEvent [].class , item -> item .wrapUp (GHIssue .this ));
706+ return root .retrieve ()
707+ .asPagedIterable (owner .getApiTailUrl (String .format ("/issues/%s/events" , number )),
708+ GHIssueEvent [].class ,
709+ item -> item .wrapUp (GHIssue .this ));
699710 }
700711}
0 commit comments