mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-14 04:22:16 +00:00
Marking them as a bad example.
See https://groups.google.com/forum/#!topic/jenkinsci-dev/yf8i1v5XSDg
This commit is contained in:
1 parent
535247e169
commit
807e3c81d4
5 files changed
+35
-13
No files matched your search
@@ -66,9 +66,10 @@ import hudson.util.CopyOnWriteMap;
|
||||
import hudson.util.DescribableList;
|
||||
import hudson.util.FormValidation;
|
||||
import hudson.util.FormValidation.Kind;
|
||||
import jenkins.model.ModelObjectWithChildren;
|
||||
import jenkins.scm.SCMCheckoutStrategyDescriptor;
|
||||
import net.sf.json.JSONObject;
|
||||
import org.kohsuke.accmod.Restricted;
|
||||
import org.kohsuke.accmod.restrictions.NoExternalUse;
|
||||
import org.kohsuke.stapler.HttpResponse;
|
||||
import org.kohsuke.stapler.StaplerRequest;
|
||||
import org.kohsuke.stapler.StaplerResponse;
|
||||
@@ -897,9 +898,14 @@ public class MatrixProject extends AbstractProject<MatrixProject,MatrixBuild> im
|
||||
}
|
||||
|
||||
public DescriptorImpl getDescriptor() {
|
||||
return DESCRIPTOR;
|
||||
return (DescriptorImpl)Jenkins.getInstance().getDescriptorOrDie(getClass());
|
||||
}
|
||||
|
||||
/**
|
||||
* Descriptor is instantiated as a field purely for backward compatibility.
|
||||
* Do not do this in your code. Put @Extension on your DescriptorImpl class instead.
|
||||
*/
|
||||
@Restricted(NoExternalUse.class)
|
||||
@Extension
|
||||
public static final DescriptorImpl DESCRIPTOR = new DescriptorImpl();
|
||||
|
||||
|
||||
@@ -25,6 +25,8 @@ package hudson.model;
|
||||
|
||||
import hudson.Extension;
|
||||
import jenkins.model.Jenkins;
|
||||
import org.kohsuke.accmod.Restricted;
|
||||
import org.kohsuke.accmod.restrictions.NoExternalUse;
|
||||
|
||||
/**
|
||||
* Free-style software project.
|
||||
@@ -50,9 +52,14 @@ public class FreeStyleProject extends Project<FreeStyleProject,FreeStyleBuild> i
|
||||
}
|
||||
|
||||
public DescriptorImpl getDescriptor() {
|
||||
return DESCRIPTOR;
|
||||
return (DescriptorImpl)Jenkins.getInstance().getDescriptorOrDie(getClass());
|
||||
}
|
||||
|
||||
/**
|
||||
* Descriptor is instantiated as a field purely for backward compatibility.
|
||||
* Do not do this in your code. Put @Extension on your DescriptorImpl class instead.
|
||||
*/
|
||||
@Restricted(NoExternalUse.class)
|
||||
@Extension(ordinal=1000)
|
||||
public static final DescriptorImpl DESCRIPTOR = new DescriptorImpl();
|
||||
|
||||
|
||||
Reference in new issue
Block a user