@@ -215,14 +215,7 @@ public static SCMFileSystem of(@NonNull Item owner, @NonNull SCM scm,
215215 for (Builder b : ExtensionList .lookup (Builder .class )) {
216216 if (b .supports (scm )) {
217217 try {
218- SCMFileSystem inspector ;
219- if (b instanceof Builder2 )
220- {
221- inspector = ((Builder2 )b ).build (owner ,scm ,rev , build );
222- } else
223- {
224- inspector = b .build (owner , scm , rev );
225- }
218+ SCMFileSystem inspector = b .build (owner , scm , rev , build );
226219
227220 if (inspector != null ) {
228221 if (inspector .isFixedRevision ()) {
@@ -555,9 +548,6 @@ public SCMFileSystem build(@NonNull SCMSource source, @NonNull SCMHead head,
555548 }
556549 return build (owner , source .build (head , rev ), rev );
557550 }
558- }
559-
560- public abstract static class Builder2 extends Builder {
561551
562552 /**
563553 * Given a {@link SCM} this should try to build a corresponding {@link SCMFileSystem} instance that
@@ -569,16 +559,21 @@ public abstract static class Builder2 extends Builder {
569559 * @param owner the owner of the {@link SCM}
570560 * @param scm the {@link SCM}.
571561 * @param rev the specified {@link SCMRevision}.
572- * @param build the specified {@link Run}.
562+ * @param _build the specified {@link Run}.
573563 * @return the corresponding {@link SCMFileSystem} or {@code null} if this builder cannot create a {@link
574564 * SCMFileSystem} for the specified {@link SCM}.
575565 * @throws IOException if the attempt to create a {@link SCMFileSystem} failed due to an IO error
576566 * (such as the remote system being unavailable)
577567 * @throws InterruptedException if the attempt to create a {@link SCMFileSystem} was interrupted.
578568 */
579569 @ CheckForNull
580- public abstract SCMFileSystem build (@ NonNull Item owner , @ NonNull SCM scm , @ CheckForNull SCMRevision rev ,
581- @ CheckForNull Run <?,?> build )
582- throws IOException , InterruptedException ;
570+ public SCMFileSystem build (@ NonNull Item owner , @ NonNull SCM scm , @ CheckForNull SCMRevision rev ,
571+ @ CheckForNull Run <?,?> _build )
572+ throws IOException , InterruptedException
573+ {
574+ // if this is not overriden, fallback to the previous implementation
575+ return build (owner ,scm , rev );
576+ }
583577 }
578+
584579}
0 commit comments