Skip to content
Permalink
Browse files
[FIXED JENKINS-16397] Just displaying /asynchPeople constructed the e…
…xpensive People object merely to decide whether or not to display the “REST API” link.

(cherry picked from commit 063acce)

Conflicts:
	changelog.html
  • Loading branch information
jglick authored and vjuranek committed Jan 25, 2013
1 parent 4998a37 commit 991158b1f6266403c7e5377388827f73aacd3d2f
Showing with 21 additions and 2 deletions.
  1. +3 −0 changelog.html
  2. +18 −2 core/src/main/java/hudson/model/View.java
@@ -55,6 +55,9 @@
<!-- Record your changes in the trunk here. -->
<div id="trunk" style="display:none"><!--=TRUNK-BEGIN=-->
<ul class=image>
<li class=bug>
Improving responsiveness of <b>People</b> page.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-16397">issue 16397</a>)
<li class=bug>
Slow rendering of view pages in large installations due to eager check whether the “People” link would show anything.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-16244">issue 16244</a>)
@@ -28,7 +28,6 @@
import com.thoughtworks.xstream.io.StreamException;
import com.thoughtworks.xstream.io.xml.XppDriver;
import hudson.DescriptorExtensionList;
import hudson.Extension;
import hudson.ExtensionPoint;
import hudson.Functions;
import hudson.Indenter;
@@ -105,6 +104,8 @@

import static javax.servlet.http.HttpServletResponse.SC_BAD_REQUEST;
import static jenkins.model.Jenkins.*;
import org.kohsuke.accmod.Restricted;
import org.kohsuke.accmod.restrictions.NoExternalUse;

/**
* Encapsulates the rendering of the list of {@link TopLevelItem}s
@@ -846,7 +847,22 @@ public AsynchPeople(View parent) {
}

public Api getApi() {
return new Api(parent instanceof Jenkins ? new People((Jenkins) parent) : new People((View) parent));
return new Api(new People());
}

/** JENKINS-16397 workaround */
@Restricted(NoExternalUse.class)
@ExportedBean
public final class People {

private View.People people;

@Exported public synchronized List<UserInfo> getUsers() {
if (people == null) {
people = parent instanceof Jenkins ? new View.People((Jenkins) parent) : new View.People((View) parent);
}
return people.users;
}
}

}

0 comments on commit 991158b

Please sign in to comment.