diff --git a/core/src/main/java/hudson/model/AbstractProject.java b/core/src/main/java/hudson/model/AbstractProject.java
index a1a2dd59d7..b616ab7129 100644
--- a/core/src/main/java/hudson/model/AbstractProject.java
+++ b/core/src/main/java/hudson/model/AbstractProject.java
@@ -1049,7 +1049,7 @@ public abstract class AbstractProject
,R extends A
SCMRevisionState baseline = build.getAction(SCMRevisionState.class);
if (baseline==null) {
try {
- baseline = safeCalcRevisionsFromBuild(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
}
@@ -1063,7 +1063,7 @@ public abstract class AbstractProject
,R extends A
* For reasons I don't understand, if I inline this method, AbstractMethodError escapes try/catch block.
*/
private SCMRevisionState safeCalcRevisionsFromBuild(AbstractBuild build, Launcher launcher, TaskListener listener) throws IOException, InterruptedException {
- return getScm().calcRevisionsFromBuild(build, launcher, listener);
+ return getScm()._calcRevisionsFromBuild(build, launcher, listener);
}
/**
diff --git a/core/src/main/java/hudson/scm/SCM.java b/core/src/main/java/hudson/scm/SCM.java
index e56934474f..48a1383bd1 100644
--- a/core/src/main/java/hudson/scm/SCM.java
+++ b/core/src/main/java/hudson/scm/SCM.java
@@ -293,6 +293,14 @@ public abstract class SCM implements Describable, ExtensionPoint {
*/
public abstract SCMRevisionState calcRevisionsFromBuild(AbstractBuild,?> build, Launcher launcher, TaskListener listener) throws IOException, InterruptedException;
+ /**
+ * A pointless function to work around what appears to be a HotSpot problem. See HUDSON-5756 and bug 6933067
+ * on BugParade for more details.
+ */
+ public SCMRevisionState _calcRevisionsFromBuild(AbstractBuild, ?> build, Launcher launcher, TaskListener listener) throws IOException, InterruptedException {
+ return calcRevisionsFromBuild(build, launcher, listener);
+ }
+
/**
* Compares the current state of the remote repository against the given baseline {@link SCMRevisionState}.
*
@@ -335,6 +343,14 @@ public abstract class SCM implements Describable, ExtensionPoint {
*/
protected abstract PollingResult compareRemoteRevisionWith(AbstractProject,?> project, Launcher launcher, FilePath workspace, TaskListener listener, SCMRevisionState baseline) throws IOException, InterruptedException;
+ /**
+ * A pointless function to work around what appears to be a HotSpot problem. See HUDSON-5756 and bug 6933067
+ * on BugParade for more details.
+ */
+ private PollingResult _compareRemoteRevisionWith(AbstractProject, ?> project, Launcher launcher, FilePath workspace, TaskListener listener, SCMRevisionState baseline2) throws IOException, InterruptedException {
+ return compareRemoteRevisionWith(project, launcher, workspace, listener, baseline2);
+ }
+
/**
* Convenience method for the caller to handle the backward compatibility between pre 1.345 SCMs.
*/
@@ -346,7 +362,7 @@ public abstract class SCM implements Describable, 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);
@@ -365,14 +381,6 @@ public abstract class SCM implements Describable, ExtensionPoint {
return false;
}
- /**
- * A pointless function to work around what appears to be a HotSpot problem. See HUDSON-5756 and bug 6933067
- * on BugParade for more details.
- */
- private PollingResult _compareRemoteRevisionWith(AbstractProject, ?> project, Launcher launcher, FilePath workspace, TaskListener listener, SCMRevisionState baseline2) throws IOException, InterruptedException {
- return compareRemoteRevisionWith(project, launcher, workspace, listener, baseline2);
- }
-
/**
* Obtains a fresh workspace of the module(s) into the specified directory
* of the specified machine.