Buggy code:
public class DockerBuilder extends Builder { private final String repoName ; private final boolean noCache ; private final String dockerfilePath ; private final boolean skipBuild ; private final boolean skipDecorate ; private String repoTag ; private boolean skipPush = true ; private final boolean skipTagLatest ; @ DataBoundConstructor public DockerBuilder ( String repoName , String repoTag , boolean skipPush , boolean noCache , boolean skipBuild , boolean skipDecorate , boolean skipTagLatest , String dockerfilePath ) { } public String getRepoName ( ) { } public String getRepoTag ( ) { } public boolean isSkipPush ( ) { } public boolean isSkipBuild ( ) { } public boolean isSkipDecorate ( ) { } public boolean isSkipTagLatest ( ) { } public boolean isNoCache ( ) { } public String getDockerfilePath ( ) { } private boolean defined ( String s ) { } private ArgumentListBuilder dockerLoginCommand ( ) { } @ Override public boolean perform ( AbstractBuild build , Launcher launcher , BuildListener listener ) { } private static class Result { final boolean result ; final String stdout ; private Result ( ) { } private Result ( boolean result , String stdout ) { } } private class Perform { private final AbstractBuild build ; private final Launcher launcher ; private final BuildListener listener ; private Perform ( AbstractBuild build , Launcher launcher , BuildListener listener ) { } private boolean exec ( ) { } private String expandAll ( String s ) throws IOException , InterruptedException , MacroEvaluationException { } private List < String > getNameAndTag ( ) throws IOException , InterruptedException , MacroEvaluationException { } private boolean maybeTagOnly ( ) throws IOException , InterruptedException , MacroEvaluationException { } private boolean buildAndTag ( ) throws IOException , InterruptedException , MacroEvaluationException { String context = ( defined ( getDockerfilePath ( ) ) ) ? getDockerfilePath ( ) : "." ; Iterator < String > i = getNameAndTag ( ) . iterator ( ) ; DockerBuilder . Result lastResult = new DockerBuilder . Result ( ) ; if ( i . hasNext ( ) ) { lastResult = executeCmd ( ( ( ( ( "docker<seq2seq4repair_space>build<seq2seq4repair_space>-t<seq2seq4repair_space>" + ( i . next ( ) ) ) + ( isNoCache ( ) ? "<seq2seq4repair_space>--no-cache=true<seq2seq4repair_space>" : "" ) ) + "<seq2seq4repair_space>" ) + context ) ) ; } <START_BUG> Pattern p = Pattern . compile ( ".*?Successfully<seq2seq4repair_space>built<seq2seq4repair_space>([0-9a-z]).*?" ) ; <END_BUG> Matcher m = p . matcher ( lastResult . stdout ) ; String image = ( m . find ( ) ) ? m . group ( 1 ) : null ; if ( image != null ) { while ( ( lastResult . result ) && ( i . hasNext ( ) ) ) { lastResult = executeCmd ( ( ( ( "docker<seq2seq4repair_space>tag<seq2seq4repair_space>--force=true<seq2seq4repair_space>" + image ) + "<seq2seq4repair_space>" ) + ( i . next ( ) ) ) ) ; } } else { while ( ( lastResult . result ) && ( i . hasNext ( ) ) ) { lastResult = executeCmd ( ( ( ( ( "docker<seq2seq4repair_space>build<seq2seq4repair_space>-t<seq2seq4repair_space>" + ( i . next ( ) ) ) + ( isNoCache ( ) ? "<seq2seq4repair_space>--no-cache=true<seq2seq4repair_space>" : "" ) ) + "<seq2seq4repair_space>" ) + context ) ) ; } } return lastResult . result ; } private boolean dockerPushCommand ( ) throws IOException , InterruptedException , MacroEvaluationException { } private boolean maybeLogin ( ) throws IOException , InterruptedException { } private boolean executeCmd ( ArgumentListBuilder args ) throws IOException , InterruptedException { } private boolean executeCmd ( List < String > cmds ) throws IOException , InterruptedException { } private DockerBuilder . Result executeCmd ( String cmd ) throws IOException , InterruptedException { } private boolean recordException ( Exception e ) { } } @ Override public DockerBuilder . DescriptorImpl getDescriptor ( ) { } @ Extension public static final class DescriptorImpl extends BuildStepDescriptor < Builder > { public String getUserName ( ) { } public String getPassword ( ) { } public String getEmail ( ) { } public String getRegistryUrl ( ) { } private String userName ; private String password ; private String email ; private String registryUrl ; public DescriptorImpl ( ) { } public FormValidation doCheckRepoName ( @ QueryParameter String value ) throws IOException , ServletException { } public boolean isApplicable ( Class < ? extends AbstractProject > aClass ) { } public String getDisplayName ( ) { } @ Override public boolean configure ( StaplerRequest req , JSONObject formData ) throws FormException { } } }

Fix:
Pattern p = Pattern . compile ( ".*?Successfully<seq2seq4repair_space>built<seq2seq4repair_space>([0-9a-z]*).*?" ) ;