mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-13 12:02:20 +00:00
when Descriptor is manually added/removed, ExtensionList<Descriptor> needs to be updated.
This commit is contained in:
1 parent
50a8046b41
commit
46472e809a
2 files changed
+14
-1
No files matched your search
@@ -133,6 +133,19 @@ public class DescriptorExtensionList<T extends Describable<T>, D extends Descrip
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean add(D d) {
|
||||
boolean r = super.add(d);
|
||||
hudson.getExtensionList(Descriptor.class).add(d);
|
||||
return r;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean remove(Object o) {
|
||||
hudson.getExtensionList(Descriptor.class).remove(o);
|
||||
return super.remove(o);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@link #load()} in the descriptor is not a real load activity, so locking against "this" is enough.
|
||||
*/
|
||||
|
||||
@@ -156,7 +156,7 @@ public class ExtensionList<T> extends AbstractList<T> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized T remove(int index) {
|
||||
public final synchronized T remove(int index) {
|
||||
T t = get(index);
|
||||
remove(t);
|
||||
return t;
|
||||
|
||||
Reference in new issue
Block a user