diff --git a/src/main/java/jenkins/scm/api/SCMFileSystem.java b/src/main/java/jenkins/scm/api/SCMFileSystem.java index 899ecc7c..45d1df22 100644 --- a/src/main/java/jenkins/scm/api/SCMFileSystem.java +++ b/src/main/java/jenkins/scm/api/SCMFileSystem.java @@ -169,7 +169,7 @@ public boolean changesSince(@CheckForNull SCMRevision revision, @NonNull OutputS * @throws InterruptedException if the attempt to create a {@link SCMFileSystem} was interrupted. */ @CheckForNull - public static SCMFileSystem of(@NonNull Run build, @NonNull SCM scm) throws IOException, InterruptedException { + public static SCMFileSystem of(@NonNull Run build, @NonNull SCM scm) throws IOException, InterruptedException { return of(build, scm, null); } @@ -186,7 +186,7 @@ public static SCMFileSystem of(@NonNull Run build, @NonNull SCM scm) throws IOEx * @throws InterruptedException if the attempt to create a {@link SCMFileSystem} was interrupted. */ @CheckForNull - public static SCMFileSystem of(@NonNull Run build, @NonNull SCM scm, @CheckForNull SCMRevision rev) + public static SCMFileSystem of(@NonNull Run build, @NonNull SCM scm, @CheckForNull SCMRevision rev) throws IOException, InterruptedException { Objects.requireNonNull(scm); SCMFileSystem fallBack = null; @@ -568,8 +568,10 @@ public final boolean supports(SCMSourceDescriptor descriptor) { * @throws InterruptedException if the attempt to create a {@link SCMFileSystem} was interrupted. */ @CheckForNull - public abstract SCMFileSystem build(@NonNull Run build, @NonNull SCM scm, @CheckForNull SCMRevision rev) - throws IOException, InterruptedException; + public SCMFileSystem build(@NonNull Run build, @NonNull SCM scm, @CheckForNull SCMRevision rev) + throws IOException, InterruptedException { + return build(build.getParent(), scm, rev); + } /** * Given a {@link SCM} this should try to build a corresponding {@link SCMFileSystem} instance that diff --git a/src/test/java/jenkins/scm/impl/SCMFileSystemTest.java b/src/test/java/jenkins/scm/impl/SCMFileSystemTest.java index f1cad54a..ea130295 100644 --- a/src/test/java/jenkins/scm/impl/SCMFileSystemTest.java +++ b/src/test/java/jenkins/scm/impl/SCMFileSystemTest.java @@ -120,7 +120,7 @@ public SCMFileSystem build(@NonNull Item owner, @NonNull SCM scm, @CheckForNull @Override @CheckForNull - public SCMFileSystem build(@NonNull Run build, @NonNull SCM scm, @CheckForNull SCMRevision rev) + public SCMFileSystem build(@NonNull Run build, @NonNull SCM scm, @CheckForNull SCMRevision rev) throws IOException, InterruptedException { return null; } @@ -158,7 +158,7 @@ public SCMFileSystem build(@NonNull Item owner, @NonNull SCM scm, @CheckForNull @Override @CheckForNull - public SCMFileSystem build(@NonNull Run build, @NonNull SCM scm, @CheckForNull SCMRevision rev) + public SCMFileSystem build(@NonNull Run build, @NonNull SCM scm, @CheckForNull SCMRevision rev) throws IOException, InterruptedException { return null; }