class org.kohsuke.github.GHNotificationStream$1 extends java.lang.Object implements java.util.Iterator
{
private org.kohsuke.github.GHThread[] threads;
private int idx;
private long lastUpdated;
private java.lang.String lastModified;
private long nextCheckTime;
private org.kohsuke.github.GHThread next;
final org.kohsuke.github.Requester val$req;
final org.kohsuke.github.GHNotificationStream this$0;
void <init>(org.kohsuke.github.GHNotificationStream, org.kohsuke.github.Requester)
{
int v;
org.kohsuke.github.GHThread[] v;
org.kohsuke.github.Requester v;
org.kohsuke.github.GHNotificationStream$1 v;
org.kohsuke.github.GHNotificationStream v;
v := @this: org.kohsuke.github.GHNotificationStream$1;
v := @parameter: org.kohsuke.github.GHNotificationStream;
v := @parameter: org.kohsuke.github.Requester;
v.<org.kohsuke.github.GHNotificationStream$1: org.kohsuke.github.GHNotificationStream this$0> = v;
v.<org.kohsuke.github.GHNotificationStream$1: org.kohsuke.github.Requester val$req> = v;
specialinvoke v.<java.lang.Object: void <init>()>();
v = <org.kohsuke.github.GHNotificationStream: org.kohsuke.github.GHThread[] EMPTY_ARRAY>;
v.<org.kohsuke.github.GHNotificationStream$1: org.kohsuke.github.GHThread[] threads> = v;
v = (int) -1;
v.<org.kohsuke.github.GHNotificationStream$1: int idx> = v;
v.<org.kohsuke.github.GHNotificationStream$1: long lastUpdated> = -1L;
v.<org.kohsuke.github.GHNotificationStream$1: long nextCheckTime> = -1L;
return;
}
public org.kohsuke.github.GHThread next()
{
org.kohsuke.github.GHThread v, v, v, v;
java.util.NoSuchElementException v;
org.kohsuke.github.GHNotificationStream$1 v;
v := @this: org.kohsuke.github.GHNotificationStream$1;
v = v.<org.kohsuke.github.GHNotificationStream$1: org.kohsuke.github.GHThread next>;
if v != null goto label;
v = virtualinvoke v.<org.kohsuke.github.GHNotificationStream$1: org.kohsuke.github.GHThread fetch()>();
v.<org.kohsuke.github.GHNotificationStream$1: org.kohsuke.github.GHThread next> = v;
v = v.<org.kohsuke.github.GHNotificationStream$1: org.kohsuke.github.GHThread next>;
if v != null goto label;
v = new java.util.NoSuchElementException;
specialinvoke v.<java.util.NoSuchElementException: void <init>()>();
throw v;
label:
v = v.<org.kohsuke.github.GHNotificationStream$1: org.kohsuke.github.GHThread next>;
v.<org.kohsuke.github.GHNotificationStream$1: org.kohsuke.github.GHThread next> = null;
return v;
}
public boolean hasNext()
{
org.kohsuke.github.GHThread v, v, v;
org.kohsuke.github.GHNotificationStream$1 v;
boolean v;
v := @this: org.kohsuke.github.GHNotificationStream$1;
v = v.<org.kohsuke.github.GHNotificationStream$1: org.kohsuke.github.GHThread next>;
if v != null goto label;
v = virtualinvoke v.<org.kohsuke.github.GHNotificationStream$1: org.kohsuke.github.GHThread fetch()>();
v.<org.kohsuke.github.GHNotificationStream$1: org.kohsuke.github.GHThread next> = v;
label:
v = v.<org.kohsuke.github.GHNotificationStream$1: org.kohsuke.github.GHThread next>;
if v == null goto label;
v = 1;
goto label;
label:
v = 0;
label:
return v;
}
org.kohsuke.github.GHThread fetch()
{
java.util.Date v;
org.kohsuke.github.GHNotificationStream$1 v;
byte v, v, v;
org.kohsuke.github.PagedIterable v;
boolean v;
java.lang.Exception v;
org.kohsuke.github.GitHubResponse v;
org.kohsuke.github.Requester v, v;
org.kohsuke.github.GHThread v;
java.lang.String[] v;
long v, v, v, v, v, v, v, v, v, v, v, v;
org.kohsuke.github.GitHubRequest$Builder v;
int v, v, v, v, v;
org.kohsuke.github.GHThread[] v, v, v, v;
java.lang.String v, v, v;
org.kohsuke.github.GHNotificationStream v, v;
java.lang.RuntimeException v;
java.lang.Object v;
v := @this: org.kohsuke.github.GHNotificationStream$1;
label:
v = v.<org.kohsuke.github.GHNotificationStream$1: int idx>;
if v < 0 goto label;
v = v.<org.kohsuke.github.GHNotificationStream$1: org.kohsuke.github.GHThread[] threads>;
v = v.<org.kohsuke.github.GHNotificationStream$1: int idx>;
v = v - 1;
v.<org.kohsuke.github.GHNotificationStream$1: int idx> = v;
v = v[v];
v = virtualinvoke v.<org.kohsuke.github.GHThread: java.util.Date getUpdatedAt()>();
v = virtualinvoke v.<java.util.Date: long getTime()>();
v = v.<org.kohsuke.github.GHNotificationStream$1: long lastUpdated>;
v = v cmp v;
if v < 0 goto label;
v.<org.kohsuke.github.GHNotificationStream$1: long lastUpdated> = v;
label:
return v;
label:
v = v.<org.kohsuke.github.GHNotificationStream$1: org.kohsuke.github.GHNotificationStream this$0>;
v = v.<org.kohsuke.github.GHNotificationStream: boolean nonBlocking>;
if v == 0 goto label;
v = v.<org.kohsuke.github.GHNotificationStream$1: long nextCheckTime>;
v = v cmp 0L;
if v < 0 goto label;
label:
return null;
label:
v = staticinvoke <java.lang.System: long currentTimeMillis()>();
v = v.<org.kohsuke.github.GHNotificationStream$1: long nextCheckTime>;
v = v cmp v;
if v < 0 goto label;
v = v.<org.kohsuke.github.GHNotificationStream$1: long nextCheckTime>;
v = v - v;
v = staticinvoke <java.lang.Math: long max(long,long)>(v, 1000L);
v = staticinvoke <java.lang.Math: long min(long,long)>(v, 60000L);
staticinvoke <java.lang.Thread: void sleep(long)>(v);
goto label;
label:
v = v.<org.kohsuke.github.GHNotificationStream$1: org.kohsuke.github.Requester val$req>;
v = v.<org.kohsuke.github.GHNotificationStream$1: java.lang.String lastModified>;
virtualinvoke v.<org.kohsuke.github.Requester: org.kohsuke.github.GitHubRequest$Builder setHeader(java.lang.String,java.lang.String)>("If-Modified-Since", v);
v = v.<org.kohsuke.github.GHNotificationStream$1: org.kohsuke.github.Requester val$req>;
v = v.<org.kohsuke.github.GHNotificationStream$1: org.kohsuke.github.GHNotificationStream this$0>;
v = v.<org.kohsuke.github.GHNotificationStream: java.lang.String apiUrl>;
v = newarray (java.lang.String)[0];
v = virtualinvoke v.<org.kohsuke.github.Requester: org.kohsuke.github.GitHubRequest$Builder withUrlPath(java.lang.String,java.lang.String[])>(v, v);
v = virtualinvoke v.<org.kohsuke.github.Requester: org.kohsuke.github.PagedIterable toIterable(java.lang.Class,java.util.function.Consumer)>(class "[Lorg/kohsuke/github/GHThread;", null);
v = virtualinvoke v.<org.kohsuke.github.GitHubPageContentsIterable: org.kohsuke.github.GitHubResponse toResponse()>();
v = virtualinvoke v.<org.kohsuke.github.GitHubResponse: java.lang.Object body()>();
v.<org.kohsuke.github.GHNotificationStream$1: org.kohsuke.github.GHThread[] threads> = v;
v = v.<org.kohsuke.github.GHNotificationStream$1: org.kohsuke.github.GHThread[] threads>;
if v != null goto label;
v = <org.kohsuke.github.GHNotificationStream: org.kohsuke.github.GHThread[] EMPTY_ARRAY>;
v.<org.kohsuke.github.GHNotificationStream$1: org.kohsuke.github.GHThread[] threads> = v;
goto label;
label:
v = v.<org.kohsuke.github.GHNotificationStream$1: long lastUpdated>;
v = v + 1L;
v.<org.kohsuke.github.GHNotificationStream$1: long lastUpdated> = v;
label:
v = v.<org.kohsuke.github.GHNotificationStream$1: org.kohsuke.github.GHThread[] threads>;
v = lengthof v;
v = v - 1;
v.<org.kohsuke.github.GHNotificationStream$1: int idx> = v;
v = specialinvoke v.<org.kohsuke.github.GHNotificationStream$1: long calcNextCheckTime(org.kohsuke.github.GitHubResponse)>(v);
v.<org.kohsuke.github.GHNotificationStream$1: long nextCheckTime> = v;
v = virtualinvoke v.<org.kohsuke.github.GitHubResponse: java.lang.String header(java.lang.String)>("Last-Modified");
v.<org.kohsuke.github.GHNotificationStream$1: java.lang.String lastModified> = v;
goto label;
label:
v := @caughtexception;
v = new java.lang.RuntimeException;
specialinvoke v.<java.lang.RuntimeException: void <init>(java.lang.Throwable)>(v);
throw v;
catch java.io.IOException from label to label with label;
catch java.lang.InterruptedException from label to label with label;
catch java.io.IOException from label to label with label;
catch java.lang.InterruptedException from label to label with label;
}
private long calcNextCheckTime(org.kohsuke.github.GitHubResponse)
{
int v;
org.kohsuke.github.GitHubResponse v;
long v, v, v;
java.lang.String v;
org.kohsuke.github.GHNotificationStream$1 v;
v := @this: org.kohsuke.github.GHNotificationStream$1;
v := @parameter: org.kohsuke.github.GitHubResponse;
v = virtualinvoke v.<org.kohsuke.github.GitHubResponse: java.lang.String header(java.lang.String)>("X-Poll-Interval");
if v != null goto label;
v = "60";
label:
v = staticinvoke <java.lang.Integer: int parseInt(java.lang.String)>(v);
v = staticinvoke <java.lang.System: long currentTimeMillis()>();
v = v * 1000L;
v = v + v;
return v;
}
}