Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[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 063acce
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
3 changes: 2 additions & 1 deletion changelog.html
Expand Up @@ -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>
Expand Down
20 changes: 18 additions & 2 deletions core/src/main/java/hudson/model/View.java
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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;
}
}

}
Expand Down

0 comments on commit 063acce

Please sign in to comment.