Skip to content

Commit e69eaa1

Browse files
committed
Remove unneccesary new Builder2 class
1 parent c476053 commit e69eaa1

File tree

1 file changed

+9
-15
lines changed

1 file changed

+9
-15
lines changed

src/main/java/jenkins/scm/api/SCMFileSystem.java

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -216,14 +216,7 @@ public static SCMFileSystem of(@NonNull Item owner, @NonNull SCM scm,
216216
for (Builder b : ExtensionList.lookup(Builder.class)) {
217217
if (b.supports(scm)) {
218218
try {
219-
SCMFileSystem inspector;
220-
if (b instanceof Builder2)
221-
{
222-
inspector = ((Builder2)b).build(owner,scm,rev, build);
223-
} else
224-
{
225-
inspector = b.build(owner, scm, rev);
226-
}
219+
SCMFileSystem inspector = b.build(owner, scm, rev, build);
227220

228221
if (inspector != null) {
229222
if (inspector.isFixedRevision()) {
@@ -561,9 +554,6 @@ private boolean isEnclosedByDescribable(Descriptor<?> descriptor) {
561554
Class<?> enclosingClass = getClass().getEnclosingClass();
562555
return enclosingClass != null && descriptor.clazz.isAssignableFrom(enclosingClass);
563556
}
564-
}
565-
566-
public abstract static class Builder2 extends Builder {
567557

568558
/**
569559
* Given a {@link SCM} this should try to build a corresponding {@link SCMFileSystem} instance that
@@ -575,16 +565,20 @@ public abstract static class Builder2 extends Builder {
575565
* @param owner the owner of the {@link SCM}
576566
* @param scm the {@link SCM}.
577567
* @param rev the specified {@link SCMRevision}.
578-
* @param build the specified {@link Run}.
568+
* @param _build the specified {@link Run}.
579569
* @return the corresponding {@link SCMFileSystem} or {@code null} if this builder cannot create a {@link
580570
* SCMFileSystem} for the specified {@link SCM}.
581571
* @throws IOException if the attempt to create a {@link SCMFileSystem} failed due to an IO error
582572
* (such as the remote system being unavailable)
583573
* @throws InterruptedException if the attempt to create a {@link SCMFileSystem} was interrupted.
584574
*/
585575
@CheckForNull
586-
public abstract SCMFileSystem build(@NonNull Item owner, @NonNull SCM scm, @CheckForNull SCMRevision rev,
587-
@CheckForNull Run<?,?> build)
588-
throws IOException, InterruptedException;
576+
public SCMFileSystem build(@NonNull Item owner, @NonNull SCM scm, @CheckForNull SCMRevision rev,
577+
@CheckForNull Run<?,?> _build)
578+
throws IOException, InterruptedException
579+
{
580+
// if this is not overriden, fallback to the previous implementation
581+
return build(owner,scm, rev);
582+
}
589583
}
590584
}

0 commit comments

Comments
 (0)