提交 7045be86 编写于 作者: A Antonio Muñiz

API use restricted and simplified logic in Functions

上级 81c8f152
...@@ -130,7 +130,6 @@ import javax.servlet.http.HttpServletResponse; ...@@ -130,7 +130,6 @@ import javax.servlet.http.HttpServletResponse;
import jenkins.model.GlobalConfiguration; import jenkins.model.GlobalConfiguration;
import jenkins.model.GlobalConfigurationCategory; import jenkins.model.GlobalConfigurationCategory;
import jenkins.model.GlobalConfigurationCategory.Unclassified;
import jenkins.model.Jenkins; import jenkins.model.Jenkins;
import jenkins.model.ModelObjectWithChildren; import jenkins.model.ModelObjectWithChildren;
import jenkins.model.ModelObjectWithContextMenu; import jenkins.model.ModelObjectWithContextMenu;
...@@ -965,14 +964,8 @@ public class Functions { ...@@ -965,14 +964,8 @@ public class Functions {
Descriptor d = c.getInstance(); Descriptor d = c.getInstance();
if (d.getGlobalConfigPage()==null) continue; if (d.getGlobalConfigPage()==null) continue;
if (d instanceof GlobalConfiguration) { if (predicate.apply(d.getCategory())) {
if (predicate.apply((d.getCategory()))) { r.add(new Tag(c.ordinal(), d));
r.add(new Tag(c.ordinal(), d));
}
} else {
if (predicate.apply(d.getCategory())) {
r.add(new Tag(0, d));
}
} }
} }
Collections.sort(r); Collections.sort(r);
......
...@@ -33,6 +33,9 @@ import hudson.util.FormApply; ...@@ -33,6 +33,9 @@ import hudson.util.FormApply;
import jenkins.model.GlobalConfigurationCategory; import jenkins.model.GlobalConfigurationCategory;
import jenkins.model.Jenkins; import jenkins.model.Jenkins;
import net.sf.json.JSONObject; import net.sf.json.JSONObject;
import org.kohsuke.accmod.Restricted;
import org.kohsuke.accmod.restrictions.NoExternalUse;
import org.kohsuke.stapler.StaplerRequest; import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.StaplerResponse; import org.kohsuke.stapler.StaplerResponse;
...@@ -42,6 +45,7 @@ import java.util.logging.Level; ...@@ -42,6 +45,7 @@ import java.util.logging.Level;
import java.util.logging.Logger; import java.util.logging.Logger;
@Extension(ordinal = Integer.MAX_VALUE - 220) @Extension(ordinal = Integer.MAX_VALUE - 220)
@Restricted(NoExternalUse.class)
public class GlobalToolConfiguration extends ManagementLink { public class GlobalToolConfiguration extends ManagementLink {
@Override @Override
......
...@@ -6,7 +6,7 @@ import jenkins.model.GlobalConfigurationCategory; ...@@ -6,7 +6,7 @@ import jenkins.model.GlobalConfigurationCategory;
/** /**
* Global configuration of tool locations and installers. * Global configuration of tool locations and installers.
* *
* @since TODO * @since 2.0
*/ */
@Extension @Extension
public class ToolConfigurationCategory extends GlobalConfigurationCategory { public class ToolConfigurationCategory extends GlobalConfigurationCategory {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册