提交 253943e1 编写于 作者: J Jesse Glick

[JENKINS-5756] Removing workarounds for HotSpot bug.

https://bugs.openjdk.java.net/browse/JDK-6933067 claims to be fixed as of Java 6, our baseline.
上级 28dfd90d
......@@ -340,7 +340,7 @@ public class ClassicPluginStrategy implements PluginStrategy {
List<ExtensionComponent<T>> r = Lists.newArrayList();
for (ExtensionFinder finder : finders) {
try {
r.addAll(finder._find(type, hudson));
r.addAll(finder.find(type, hudson));
} catch (AbstractMethodError e) {
// backward compatibility
for (T t : finder.findExtensions(type, hudson))
......
......@@ -143,10 +143,7 @@ public abstract class ExtensionFinder implements ExtensionPoint {
*/
public abstract <T> Collection<ExtensionComponent<T>> find(Class<T> type, Hudson jenkins);
/**
* A pointless function to work around what appears to be a HotSpot problem. See JENKINS-5756 and bug 6933067
* on BugParade for more details.
*/
@Deprecated
public <T> Collection<ExtensionComponent<T>> _find(Class<T> type, Hudson hudson) {
return find(type, hudson);
}
......
......@@ -1856,7 +1856,7 @@ public final class FilePath implements Serializable {
private void syncIO() throws InterruptedException {
try {
if (channel!=null)
_syncIO();
channel.syncLocalIO();
} catch (AbstractMethodError e) {
// legacy slave.jar. Handle this gracefully
try {
......@@ -1867,14 +1867,6 @@ public final class FilePath implements Serializable {
}
}
/**
* A pointless function to work around what appears to be a HotSpot problem. See JENKINS-5756 and bug 6933067
* on BugParade for more details.
*/
private void _syncIO() throws InterruptedException {
channel.syncLocalIO();
}
/**
* Remoting interface used for {@link FilePath#copyRecursiveTo(String, FilePath)}.
*
......
......@@ -301,25 +301,17 @@ public abstract class AbstractItem extends Actionable implements Item, HttpDelet
doSetName(oldName);
}
callOnRenamed(newName, parent, oldName);
try {
parent.onRenamed(this, oldName, newName);
} catch (AbstractMethodError _) {
// ignore
}
ItemListener.fireLocationChange(this, oldFullName);
}
}
}
/**
* A pointless function to work around what appears to be a HotSpot problem. See JENKINS-5756 and bug 6933067
* on BugParade for more details.
*/
private void callOnRenamed(String newName, ItemGroup parent, String oldName) throws IOException {
try {
parent.onRenamed(this, oldName, newName);
} catch (AbstractMethodError _) {
// ignore
}
}
/**
* Gets all the jobs that this {@link Item} contains as descendants.
*/
......@@ -560,16 +552,8 @@ public abstract class AbstractItem extends Actionable implements Item, HttpDelet
synchronized (this) { // could just make performDelete synchronized but overriders might not honor that
performDelete();
} // JENKINS-19446: leave synch block, but JENKINS-22001: still notify synchronously
invokeOnDeleted();
Jenkins.getInstance().rebuildDependencyGraphAsync();
}
/**
* A pointless function to work around what appears to be a HotSpot problem. See JENKINS-5756 and bug 6933067
* on BugParade for more details.
*/
private void invokeOnDeleted() throws IOException {
getParent().onDeleted(AbstractItem.this);
Jenkins.getInstance().rebuildDependencyGraphAsync();
}
/**
......
......@@ -1266,7 +1266,7 @@ public abstract class AbstractProject<P extends AbstractProject<P,R>,R extends A
SCMRevisionState baseline = build.getAction(SCMRevisionState.class);
if (baseline==null) {
try {
baseline = getScm()._calcRevisionsFromBuild(build, launcher, listener);
baseline = getScm().calcRevisionsFromBuild(build, launcher, listener);
} catch (AbstractMethodError e) {
baseline = SCMRevisionState.NONE; // pre-1.345 SCM implementations, which doesn't use the baseline in polling
}
......
......@@ -255,20 +255,12 @@ public abstract class View extends AbstractModelObject implements AccessControll
*/
public ItemGroup<? extends TopLevelItem> getOwnerItemGroup() {
try {
return _getOwnerItemGroup();
return owner.getItemGroup();
} catch (AbstractMethodError e) {
return Jenkins.getInstance();
}
}
/**
* A pointless function to work around what appears to be a HotSpot problem. See JENKINS-5756 and bug 6933067
* on BugParade for more details.
*/
private ItemGroup<? extends TopLevelItem> _getOwnerItemGroup() {
return owner.getItemGroup();
}
public View getOwnerPrimaryView() {
try {
return _getOwnerPrimaryView();
......
......@@ -40,7 +40,7 @@ public class Executables {
*/
public static @Nonnull SubTask getParentOf(Executable e) {
try {
return _getParentOf(e);
return e.getParent();
} catch (AbstractMethodError _) {
try {
Method m = e.getClass().getMethod("getParent");
......@@ -59,14 +59,6 @@ public class Executables {
}
}
/**
* A pointless function to work around what appears to be a HotSpot problem. See JENKINS-5756 and bug 6933067
* on BugParade for more details.
*/
private static SubTask _getParentOf(Executable e) {
return e.getParent();
}
/**
* Returns the estimated duration for the executable.
* Protects against {@link AbstractMethodError}s if the {@link Executable} implementation
......@@ -74,17 +66,10 @@ public class Executables {
*/
public static long getEstimatedDurationFor(Executable e) {
try {
return _getEstimatedDuration(e);
return e.getEstimatedDuration();
} catch (AbstractMethodError error) {
return e.getParent().getEstimatedDuration();
}
}
/**
* A pointless function to work around what appears to be a HotSpot problem. See JENKINS-5756 and bug 6933067
* on BugParade for more details.
*/
private static long _getEstimatedDuration(Executable e) {
return e.getEstimatedDuration();
}
}
......@@ -41,62 +41,30 @@ import jenkins.security.QueueItemAuthenticatorConfiguration;
*/
public class Tasks {
/**
* A pointless function to work around what appears to be a HotSpot problem. See JENKINS-5756 and bug 6933067
* on BugParade for more details.
*/
private static Collection<? extends SubTask> _getSubTasksOf(Task task) {
return task.getSubTasks();
}
public static Collection<? extends SubTask> getSubTasksOf(Task task) {
try {
return _getSubTasksOf(task);
return task.getSubTasks();
} catch (AbstractMethodError e) {
return Collections.singleton(task);
}
}
/**
* A pointless function to work around what appears to be a HotSpot problem. See JENKINS-5756 and bug 6933067
* on BugParade for more details.
*/
private static Object _getSameNodeConstraintOf(SubTask t) {
return t.getSameNodeConstraint();
}
public static Object getSameNodeConstraintOf(SubTask t) {
try {
return _getSameNodeConstraintOf(t);
return t.getSameNodeConstraint();
} catch (AbstractMethodError e) {
return null;
}
}
/**
* A pointless function to work around what appears to be a HotSpot problem. See JENKINS-5756 and bug 6933067
* on BugParade for more details.
*/
public static Task _getOwnerTaskOf(SubTask t) {
return t.getOwnerTask();
}
public static @Nonnull Task getOwnerTaskOf(@Nonnull SubTask t) {
try {
return _getOwnerTaskOf(t);
return t.getOwnerTask();
} catch (AbstractMethodError e) {
return (Task)t;
}
}
/**
* A pointless function to work around what appears to be a HotSpot problem. See JENKINS-5756 and bug 6933067
* on BugParade for more details.
*/
private static Authentication _getDefaultAuthenticationOf(Task t) {
return t.getDefaultAuthentication();
}
/**
* @param t a task
* @return {@link Task#getDefaultAuthentication}, or {@link ACL#SYSTEM}
......@@ -104,7 +72,7 @@ public class Tasks {
*/
public static Authentication getDefaultAuthenticationOf(Task t) {
try {
return _getDefaultAuthenticationOf(t);
return t.getDefaultAuthentication();
} catch (AbstractMethodError e) {
return ACL.SYSTEM;
}
......
......@@ -321,10 +321,6 @@ public abstract class SCM implements Describable<SCM>, ExtensionPoint {
return calcRevisionsFromBuild(build, launcher != null ? build.getWorkspace() : null, launcher, listener);
}
/**
* A pointless function to work around what appears to be a HotSpot problem. See JENKINS-5756 and bug 6933067
* on BugParade for more details.
*/
@Deprecated
public SCMRevisionState _calcRevisionsFromBuild(AbstractBuild<?, ?> build, Launcher launcher, TaskListener listener) throws IOException, InterruptedException {
return calcRevisionsFromBuild(build, launcher, listener);
......@@ -395,7 +391,7 @@ public abstract class SCM implements Describable<SCM>, ExtensionPoint {
if (baseline!=SCMRevisionState.NONE) {
baseline2 = baseline;
} else {
baseline2 = _calcRevisionsFromBuild(project.getLastBuild(), launcher, listener);
baseline2 = calcRevisionsFromBuild(project.getLastBuild(), launcher, listener);
}
return compareRemoteRevisionWith(project, launcher, workspace, listener, baseline2);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册