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