Skip to content

Commit

Permalink
Noting deprecations more widely.
Browse files Browse the repository at this point in the history
  • Loading branch information
jglick committed Apr 11, 2015
1 parent 8dd079a commit 37167d5
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions core/src/main/java/hudson/DescriptorExtensionList.java
Expand Up @@ -109,6 +109,7 @@ protected DescriptorExtensionList(Jenkins jenkins, Class<T> describableType) {
*
* @param fqcn
* Fully qualified name of the descriptor, not the describable.
* @deprecated {@link Descriptor#getId} is supposed to be used for new code, not the descriptor class name.
*/
public D find(String fqcn) {
return Descriptor.find(this,fqcn);
Expand Down
3 changes: 2 additions & 1 deletion core/src/main/java/hudson/model/ComputerSet.java
Expand Up @@ -289,7 +289,8 @@ public synchronized void doDoCreateItem( StaplerRequest req, StaplerResponse rsp

JSONObject formData = req.getSubmittedForm();
formData.put("name", fixedName);


// TODO type is probably NodeDescriptor.id but confirm
Node result = NodeDescriptor.all().find(type).newInstance(req, formData);
app.addNode(result);

Expand Down
3 changes: 3 additions & 0 deletions core/src/main/java/hudson/model/Items.java
Expand Up @@ -148,6 +148,9 @@ public static List<TopLevelItemDescriptor> all(Authentication a, ItemGroup c) {
return result;
}

/**
* @deprecated Underspecified what the parameter is. {@link Descriptor#getId}? A {@link Describable} class name?
*/
public static TopLevelItemDescriptor getDescriptor(String fqcn) {
return Descriptor.find(all(), fqcn);
}
Expand Down
Expand Up @@ -167,6 +167,7 @@ public String getHome() {
return home;
}

@SuppressWarnings("deprecation") // TODO this was mistakenly made to be the ToolDescriptor class name, rather than .id as you would expect; now baked into serial form
public ToolDescriptor getType() {
if (descriptor == null) {
descriptor = (ToolDescriptor) Descriptor.find(type);
Expand Down
1 change: 1 addition & 0 deletions core/src/main/java/hudson/util/DescriptorList.java
Expand Up @@ -196,6 +196,7 @@ public void load(Class<? extends Describable> c) {

/**
* Finds the descriptor that has the matching fully-qualified class name.
* @deprecated Underspecified what the parameter is. {@link Descriptor#getId}? A {@link Describable} class name?
*/
public Descriptor<T> find(String fqcn) {
return Descriptor.find(this,fqcn);
Expand Down

0 comments on commit 37167d5

Please sign in to comment.