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.
  • Loading branch information
jglick committed Jan 17, 2013
1 parent 1639cfb commit 063acce1e1886b8f30ba8657b1dbe7c7804e7796
Showing with 20 additions and 3 deletions.
  1. +2 −1 changelog.html
  2. +18 −2 core/src/main/java/hudson/model/View.java
@@ -59,8 +59,9 @@
Reduced size of memory leak in render-on-demand functionality used e.g. in configuration pages.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-16341">issue 16341</a>)
<li class=bug>
Improving responsiveness of <b>People</b> page when using Gravatar plugin.
Improving responsiveness of <b>People</b> page.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-16342">issue 16342</a>)
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-16397">issue 16397</a>)
<li class=bug>
Improved logging and error output from SSHD in Jenkins.
<li class=rfe>
@@ -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;
@@ -100,6 +99,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
@@ -849,7 +850,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 063acce

Please sign in to comment.