Source:
private void parseCommands ( final java.util.Collection < org.eclipse.jgit.transport.ReceiveCommand > commands ) { for ( final org.eclipse.jgit.transport.ReceiveCommand cmd : commands ) { if ( ( cmd.getResult ( ) ) != ( org.eclipse.jgit.transport.ReceiveCommand.Result.NOT_ATTEMPTED ) ) { continue ; } if ( ( ! ( org.eclipse.jgit.lib.Repository.isValidRefName ( cmd.getRefName ( ) ) ) ) || ( cmd.getRefName ( ) . contains ( "//" ) ) ) { com.google.gerrit.server.git.ReceiveCommits.reject ( cmd , "not valid ref" ) ; continue ; } if ( cmd.getRefName ( ) . startsWith ( com.google.gerrit.server.git.ReceiveCommits.NEW_CHANGE ) ) { parseNewChangeCommand ( cmd ) ; continue ; } final java.util.regex.Matcher m = com.google.gerrit.server.git.ReceiveCommits.NEW_PATCHSET.matcher ( cmd.getRefName ( ) ) ; if ( m.matches ( ) ) { final com.google.gerrit.reviewdb.Change.Id changeId = Change.Id.parse ( m.group ( 1 ) ) ; parseReplaceCommand ( cmd , changeId ) ; continue ; } switch ( cmd.getType ( ) ) { case CREATE : parseCreate ( cmd ) ; break ; case UPDATE : parseUpdate ( cmd ) ; break ; case DELETE : parseDelete ( cmd ) ; break ; case UPDATE_NONFASTFORWARD : parseRewind ( cmd ) ; break ; default : com.google.gerrit.server.git.ReceiveCommits.reject ( cmd ) ; continue ; } if ( ( cmd.getResult ( ) ) != ( org.eclipse.jgit.transport.ReceiveCommand.Result.NOT_ATTEMPTED ) ) { continue ; } if ( com.google.gerrit.server.git.ReceiveCommits.isConfig ( cmd ) ) { if ( ! ( projectControl.isOwner ( ) ) ) { com.google.gerrit.server.git.ReceiveCommits.reject ( cmd , "not project owner" ) ; continue ; } switch ( cmd.getType ( ) ) { case CREATE : case UPDATE : case UPDATE_NONFASTFORWARD : try { com.google.gerrit.server.git.ProjectConfig cfg = new com.google.gerrit.server.git.ProjectConfig ( project.getNameKey ( ) ) ; cfg.load ( repo , cmd.getNewId ( ) ) ; } catch ( java.lang.Exception e ) { com.google.gerrit.server.git.ReceiveCommits.reject ( cmd , "invalid project configuration" ) ; com.google.gerrit.server.git.ReceiveCommits.log.error ( ( ( ( ( ( "User " + ( currentUser.getUserName ( ) ) ) + " tried to push invalid project configuration " ) + ( cmd.getNewId ( ) . name ( ) ) ) + " for " ) + ( project.getName ( ) ) ) , e ) ; continue ; } break ; case DELETE : break ; default : com.google.gerrit.server.git.ReceiveCommits.reject ( cmd ) ; continue ; } } } }

Target:
private void parseCommands ( final java.util.Collection < org.eclipse.jgit.transport.ReceiveCommand > commands ) { for ( final org.eclipse.jgit.transport.ReceiveCommand cmd : commands ) { if ( ( cmd.getResult ( ) ) != ( org.eclipse.jgit.transport.ReceiveCommand.Result.NOT_ATTEMPTED ) ) { continue ; } if ( ( ! ( org.eclipse.jgit.lib.Repository.isValidRefName ( cmd.getRefName ( ) ) ) ) || ( cmd.getRefName ( ) . contains ( "//" ) ) ) { com.google.gerrit.server.git.ReceiveCommits.reject ( cmd , "not valid ref" ) ; continue ; } if ( cmd.getRefName ( ) . startsWith ( com.google.gerrit.server.git.ReceiveCommits.NEW_CHANGE ) ) { parseNewChangeCommand ( cmd ) ; continue ; } final java.util.regex.Matcher m = com.google.gerrit.server.git.ReceiveCommits.NEW_PATCHSET.matcher ( cmd.getRefName ( ) ) ; if ( m.matches ( ) ) { final com.google.gerrit.reviewdb.Change.Id changeId = Change.Id.parse ( m.group ( 1 ) ) ; parseReplaceCommand ( cmd , changeId ) ; continue ; } switch ( cmd.getType ( ) ) { case CREATE : parseCreate ( cmd ) ; continue ; case UPDATE : parseUpdate ( cmd ) ; continue ; case DELETE : parseDelete ( cmd ) ; continue ; case UPDATE_NONFASTFORWARD : parseRewind ( cmd ) ; continue ; } com.google.gerrit.server.git.ReceiveCommits.reject ( cmd ) ; } }