提交 eb7a23f9 编写于 作者: J Jesse Glick

[FIXED JENKINS-14983] hpi:run fails with IllegalAccessError.

上级 fc67a14c
......@@ -66,7 +66,9 @@ Upcoming changes</a>
<li class=bug>
<code>TarArchiver.visitSymlink</code> can throw undeclared <code>PosixException</code>.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-14922">issue 14922</a>)
<li class=>
<li class=bug>
<code>hpi:run</code> failed due to <code>IllegalAccessError</code>s.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-14983">issue 14983</a>)
</ul>
</div><!--=TRUNK-END=-->
......
......@@ -26,6 +26,8 @@ package hudson;
import hudson.model.Describable;
import hudson.model.Descriptor;
import java.util.logging.Level;
import java.util.logging.Logger;
import jenkins.ExtensionFilter;
/**
......@@ -38,6 +40,7 @@ import jenkins.ExtensionFilter;
* @see ExtensionFilter
*/
public class ExtensionComponent<T> implements Comparable<ExtensionComponent<T>> {
private static final Logger LOG = Logger.getLogger(ExtensionComponent.class.getName());
private final T instance;
private final double ordinal;
......@@ -90,9 +93,14 @@ public class ExtensionComponent<T> implements Comparable<ExtensionComponent<T>>
// make the order bit more deterministic among extensions of the same ordinal
if (this.instance instanceof Descriptor && that.instance instanceof Descriptor) {
return Util.fixNull(((Descriptor)this.instance).getDisplayName()).compareTo(Util.fixNull(((Descriptor)that.instance).getDisplayName()));
} else {
return this.instance.getClass().getName().compareTo(that.instance.getClass().getName());
try {
return Util.fixNull(((Descriptor)this.instance).getDisplayName()).compareTo(Util.fixNull(((Descriptor)that.instance).getDisplayName()));
} catch (RuntimeException x) {
LOG.log(Level.WARNING, null, x);
} catch (LinkageError x) {
LOG.log(Level.WARNING, null, x);
}
}
return this.instance.getClass().getName().compareTo(that.instance.getClass().getName());
}
}
......@@ -55,9 +55,9 @@ public class DropdownList extends UISample {
public static final class DescriptorImpl extends UISampleDescriptor {
}
public static class Fruit implements ExtensionPoint, Describable<Fruit> {
public static abstract class Fruit implements ExtensionPoint, Describable<Fruit> {
protected String name;
private Fruit(String name) { this.name = name; }
protected Fruit(String name) { this.name = name; }
public Descriptor<Fruit> getDescriptor() {
return Jenkins.getInstance().getDescriptor(getClass());
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册