Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[FIXED JENKINS-22142] Removed obsolete method.
Hoping nobody uses it programmatically.

Also, added @restricted to the new one.

(cherry picked from commit b264fa6)
  • Loading branch information
daniel-beck authored and olivergondza committed May 5, 2014
1 parent 1335246 commit 77a3440
Showing 1 changed file with 3 additions and 25 deletions.
28 changes: 3 additions & 25 deletions core/src/main/java/hudson/model/ViewDescriptor.java
Expand Up @@ -27,6 +27,8 @@
import hudson.views.ListViewColumnDescriptor;
import hudson.views.ViewJobFilter;
import jenkins.model.Jenkins;
import org.kohsuke.accmod.Restricted;
import org.kohsuke.accmod.restrictions.DoNotUse;
import org.kohsuke.stapler.QueryParameter;
import org.kohsuke.stapler.AncestorInPath;

Expand Down Expand Up @@ -68,35 +70,11 @@ protected ViewDescriptor(Class<? extends View> clazz) {
protected ViewDescriptor() {
}

@Deprecated
public AutoCompletionCandidates doAutoCompleteCopyNewItemFrom(final String prefix) {
final AutoCompletionCandidates r = new AutoCompletionCandidates();

new ItemVisitor() {
@Override
public void onItemGroup(ItemGroup<?> group) {
// only dig deep when the path matches what's typed.
// for example, if 'foo/bar' is typed, we want to show 'foo/barcode'
if (prefix.startsWith(group.getFullName()))
super.onItemGroup(group);
}

@Override
public void onItem(Item i) {
if (i.getFullName().startsWith(prefix)) {
r.add((i.getFullName()));
super.onItem(i);
}
}
}.onItemGroup(Jenkins.getInstance());

return r;
}

/**
* Auto-completion for the "copy from" field in the new job page.
* @since 1.553
*/
@Restricted(DoNotUse.class)
public AutoCompletionCandidates doAutoCompleteCopyNewItemFrom(@QueryParameter final String value, @AncestorInPath ItemGroup container) {
return AutoCompletionCandidates.ofJobNames(TopLevelItem.class, value, container);
}
Expand Down

0 comments on commit 77a3440

Please sign in to comment.