auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void write ( int b ) throws java.io.IOException { actualBody.write ( b ) ; }

Target:
public synchronized javax.servlet.ServletOutputStream getOutputStream ( ) { com.google.common.base.Preconditions.checkState ( ( ( writer ) == null ) , "getWriter() already called" ) ; if ( ( outputStream ) == null ) { final java.io.PrintWriter osWriter = new java.io.PrintWriter ( actualBody ) ; outputStream = new javax.servlet.ServletOutputStream ( ) { @ java.lang.Override public void write ( int c ) throws java.io.IOException { osWriter.write ( c ) ; osWriter.flush ( ) ; } } ; } return outputStream ; }
Source:
public void remove ( ) { descriptions.remove ( name ) ; registry.remove ( name ) ; }

Target:
public synchronized < F1 , F2 > com.google.gerrit.metrics.Counter2 < F1 , F2 > newCounter ( java.lang.String name , com.google.gerrit.metrics.Description desc , com.google.gerrit.metrics.Field < F1 > field1 , com.google.gerrit.metrics.Field < F2 > field2 ) { com.google.gerrit.metrics.dropwizard.DropWizardMetricMaker.checkCounterDescription ( desc ) ; com.google.gerrit.metrics.dropwizard.CounterImplN m = new com.google.gerrit.metrics.dropwizard.CounterImplN ( this , name , desc , field1 , field2 ) ; define ( name , desc ) ; bucketed.put ( name , m ) ; return m.counter2 ( ) ; }
Source:
public static < T > void setOf ( com.google.inject.Binder binder , com.google.inject.TypeLiteral < T > member ) { @ java.lang.SuppressWarnings ( value = "unchecked" ) com.google.inject.Key < com.google.gerrit.extensions.registration.DynamicSet < T > > key = ( ( com.google.inject.Key < com.google.gerrit.extensions.registration.DynamicSet < T > > ) ( com.google.inject.Key.get ( com.google.inject.util.Types.newParameterizedType ( com.google.gerrit.extensions.registration.DynamicSet.class , member.getType ( ) ) ) ) ) ; binder.bind ( key ) . toProvider ( new com.google.gerrit.extensions.registration.DynamicSetProvider ( member ) ) . in ( Scopes.SINGLETON ) ; }

Target:
public static < T > void setOf ( com.google.inject.Binder binder , com.google.inject.TypeLiteral < T > member ) { @ java.lang.SuppressWarnings ( value = "unchecked" ) com.google.inject.Key < com.google.gerrit.extensions.registration.DynamicSet < T > > key = ( ( com.google.inject.Key < com.google.gerrit.extensions.registration.DynamicSet < T > > ) ( com.google.inject.Key.get ( com.google.inject.util.Types.newParameterizedType ( com.google.gerrit.extensions.registration.DynamicSet.class , member.getType ( ) ) ) ) ) ; binder.disableCircularProxies ( ) ; binder.bind ( key ) . toProvider ( new com.google.gerrit.extensions.registration.DynamicSetProvider ( member ) ) . in ( Scopes.SINGLETON ) ; }
Source:
public void testIsEnabledRefNoParentNonMatchingBranchEnabled ( ) { java.lang.String [ ] branches = new java.lang.String [ ] { "^refs/heads/foo.*" } ; setupIsEnabled ( "true" , null , branches ) ; com.googlesource.gerrit.plugins.its.base.its.ItsConfig itsConfig = createItsConfig ( ) ; replayMocks ( ) ; assertFalse ( itsConfig.isEnabled ( "testProject" , "refs/heads/testBranch" ) ) ; }

Target:
public void testIsEnabledRefNoParentMatchingBranchEnforced ( ) { java.lang.String [ ] branches = new java.lang.String [ ] { "^refs/heads/test.*" } ; setupIsEnabled ( "enforced" , null , branches ) ; com.googlesource.gerrit.plugins.its.base.its.ItsConfig itsConfig = createItsConfig ( ) ; replayMocks ( ) ; com.google.gerrit.reviewdb.client.Project.NameKey projectNK = new com.google.gerrit.reviewdb.client.Project.NameKey ( "testProject" ) ; assertTrue ( itsConfig.isEnabled ( projectNK , "refs/heads/testBranch" ) ) ; }
Source:
public void delete ( com.google.gerrit.server.query.change.ChangeData cd ) throws java.io.IOException { org.apache.lucene.index.Term id = com.google.gerrit.lucene.QueryBuilder.idTerm ( cd ) ; try { com.google.common.util.concurrent.Futures.allAsList ( openIndex.delete ( id ) , closedIndex.delete ( id ) ) . get ( ) ; } catch ( java.util.concurrent.ExecutionException | java.lang.InterruptedException e ) { throw new java.io.IOException ( e ) ; } }

Target:
public void delete ( com.google.gerrit.reviewdb.client.Change.Id id ) throws java.io.IOException { org.apache.lucene.index.Term idTerm = com.google.gerrit.lucene.LuceneChangeIndex.idTerm ( id ) ; try { com.google.common.util.concurrent.Futures.allAsList ( openIndex.delete ( idTerm ) , closedIndex.delete ( idTerm ) ) . get ( ) ; } catch ( java.util.concurrent.ExecutionException | java.lang.InterruptedException e ) { throw new java.io.IOException ( e ) ; } }
Source:
private com.google.gerrit.server.account.AuthResult byPreferredEmail ( java.lang.String email ) { try ( com.google.gerrit.reviewdb.server.ReviewDb db = schema.open ( ) ) { java.util.Optional < com.google.gerrit.reviewdb.client.Account > match = queryProvider.get ( ) . byPreferredEmail ( email ) . stream ( ) . map ( AccountState :: getAccount ) . findFirst ( ) ; return match.isPresent ( ) ? auth ( match.get ( ) ) : null ; } catch ( com.google.gwtorm.server.OrmException e ) { getServletContext ( ) . log ( "cannot query database" , e ) ; return null ; } }

Target:
private com.google.gerrit.server.account.AuthResult byPreferredEmail ( java.lang.String email ) { try ( com.google.gerrit.reviewdb.server.ReviewDb db = schema.open ( ) ) { java.util.Optional < com.google.gerrit.server.account.AccountState > match = queryProvider.get ( ) . byPreferredEmail ( email ) . stream ( ) . findFirst ( ) ; return match.isPresent ( ) ? auth ( match.get ( ) ) : null ; } catch ( com.google.gwtorm.server.OrmException e ) { getServletContext ( ) . log ( "cannot query database" , e ) ; return null ; } }
Source:
private void initChangeAction ( com.google.gerrit.client.changes.ChangeInfo info ) { if ( ( info.status ( ) ) == ( com.google.gerrit.reviewdb.client.Change.Status.DRAFT ) ) { com.google.gerrit.client.rpc.NativeMap < com.google.gerrit.client.actions.ActionInfo > actions = ( info.has_actions ( ) ) ? info.actions ( ) : com.google.gerrit.client.rpc.NativeMap.< com.google.gerrit.client.actions.ActionInfo > create ( ) ; actions.copyKeysIntoChildren ( "id" ) ; if ( actions.containsKey ( "/" ) ) { deleteChange.setVisible ( true ) ; deleteChange.setTitle ( actions.get ( "/" ) . title ( ) ) ; } } }

Target:
private void initChangeAction ( com.google.gerrit.client.info.ChangeInfo info ) { if ( ( info.status ( ) ) == ( com.google.gerrit.reviewdb.client.Change.Status.DRAFT ) ) { com.google.gerrit.client.rpc.NativeMap < com.google.gerrit.client.info.ActionInfo > actions = ( info.hasActions ( ) ) ? info.actions ( ) : com.google.gerrit.client.rpc.NativeMap.< com.google.gerrit.client.info.ActionInfo > create ( ) ; actions.copyKeysIntoChildren ( "id" ) ; if ( actions.containsKey ( "/" ) ) { deleteChange.setVisible ( true ) ; deleteChange.setTitle ( actions.get ( "/" ) . title ( ) ) ; } } }
Source:
private void fakeClick ( final com.google.gerrit.client.patches.HistoryTable.HistoryRadio b ) { if ( ( ! ( b.isChecked ( ) ) ) && ( b.isEnabled ( ) ) ) { for ( final com.google.gerrit.client.patches.HistoryTable.HistoryRadio a : all ) { if ( ( a.isChecked ( ) ) && ( a.getName ( ) . equals ( b.getName ( ) ) ) ) { a.setChecked ( false ) ; break ; } } b.setChecked ( true ) ; onClick ( b ) ; } }

Target:
private void fakeClick ( final com.google.gerrit.client.patches.HistoryTable.HistoryRadio b ) { if ( ( ! ( b.getValue ( ) ) ) && ( b.isEnabled ( ) ) ) { for ( final com.google.gerrit.client.patches.HistoryTable.HistoryRadio a : all ) { if ( ( a.getValue ( ) ) && ( a.getName ( ) . equals ( b.getName ( ) ) ) ) { a.setValue ( false ) ; break ; } } b.setValue ( true ) ; onClick ( b ) ; } }
Source:
void setExpandAllComments ( boolean b ) { for ( com.google.gerrit.client.diff.CommentGroup g : sideA.values ( ) ) { g.setOpenAll ( b ) ; } for ( com.google.gerrit.client.diff.CommentGroup g : sideB.values ( ) ) { g.setOpenAll ( b ) ; } }

Target:
void setExpandAllComments ( boolean b ) { expandAll = b ; for ( com.google.gerrit.client.diff.CommentGroup g : sideA.values ( ) ) { g.setOpenAll ( b ) ; } for ( com.google.gerrit.client.diff.CommentGroup g : sideB.values ( ) ) { g.setOpenAll ( b ) ; } }
Source:
public void testUpsertTwoNotExistsing ( ) throws com.google.gwtorm.client.OrmException , java.sql.SQLException { stubExecuteBatchOK ( com.google.gwtorm.jdbc.TestJdbcAccess.UPDATE ) ; java.sql.PreparedStatement insert = stubExecuteBatchOK ( com.google.gwtorm.jdbc.TestJdbcAccess.INSERT , 1 , 1 ) ; createClassUnderTest ( ) . upsert ( com.google.gwtorm.jdbc.TestJdbcAccess.TWO_ROWS ) ; verifyIds ( insert , 1 , 2 ) ; }

Target:
public void testUpdateOneConcurrentlyModifiedException ( ) throws com.google.gwtorm.server.OrmException , java.sql.SQLException { java.sql.PreparedStatement update = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.TestJdbcAccess.UPDATE , 0 ) ; com.google.gwtorm.jdbc.JdbcAccess < com.google.gwtorm.jdbc.TestJdbcAccess.Data , com.google.gwtorm.jdbc.TestJdbcAccess.Data.DataKey > classUnderTest = createClassUnderTest ( ) ; try { classUnderTest.update ( oneRow ) ; org.junit.Assert.fail ( "missing OrmConcurrencyException" ) ; } catch ( com.google.gwtorm.server.OrmConcurrencyException e ) { } com.google.gwtorm.jdbc.TestJdbcAccess.assertUsedBatchingOnly ( update ) ; }
Source:
private static void error ( final javax.servlet.http.HttpServletResponse resp , final int status , final java.lang.String message ) throws java.io.IOException { resp.setStatus ( status ) ; resp.setContentType ( ( "text/plain; charset=" + ( com.google.gwtjsonrpc.server.JsonServlet.ENC ) ) ) ; final java.io.Writer w = new java.io.OutputStreamWriter ( resp.getOutputStream ( ) , com.google.gwtjsonrpc.server.JsonServlet.ENC ) ; try { w.write ( message ) ; } finally { w.close ( ) ; } }

Target:
private static void error ( final com.google.gwtjsonrpc.server.ActiveCall call , final int status , final java.lang.String message ) throws java.io.IOException { final javax.servlet.http.HttpServletResponse r = call.httpResponse ; r.setStatus ( status ) ; r.setContentType ( ( "text/plain; charset=" + ( com.google.gwtjsonrpc.server.JsonServlet.ENC ) ) ) ; final java.io.Writer w = new java.io.OutputStreamWriter ( r.getOutputStream ( ) , com.google.gwtjsonrpc.server.JsonServlet.ENC ) ; try { w.write ( message ) ; } finally { w.close ( ) ; } }
Source:
private void parseDelete ( final org.eclipse.jgit.transport.ReceiveCommand cmd ) { com.google.gerrit.server.project.RefControl ctl = projectControl.controlForRef ( cmd.getRefName ( ) ) ; if ( ctl.canDelete ( ) ) { cmd.execute ( rp ) ; } else { if ( GitRepositoryManager.REF_CONFIG.equals ( ctl.getRefName ( ) ) ) { reject ( cmd , "cannot delete project configuration" ) ; } else { errors.put ( com.google.gerrit.server.git.ReceiveCommits.Error.DELETE , ctl.getRefName ( ) ) ; reject ( cmd , "can not delete references" ) ; } } }

Target:
private void parseDelete ( final org.eclipse.jgit.transport.ReceiveCommand cmd ) { com.google.gerrit.server.project.RefControl ctl = projectControl.controlForRef ( cmd.getRefName ( ) ) ; if ( ctl.canDelete ( ) ) { batch.addCommand ( cmd ) ; } else { if ( GitRepositoryManager.REF_CONFIG.equals ( ctl.getRefName ( ) ) ) { reject ( cmd , "cannot delete project configuration" ) ; } else { errors.put ( com.google.gerrit.server.git.ReceiveCommits.Error.DELETE , ctl.getRefName ( ) ) ; reject ( cmd , "cannot delete references" ) ; } } }
Source:
public com.google.gerrit.reviewdb.client.AccountSshKey create ( com.google.gerrit.reviewdb.client.AccountSshKey.Id id , java.lang.String encoded ) throws com.google.gerrit.common.errors.InvalidSshKeyException { try { com.google.gerrit.reviewdb.client.AccountSshKey key = new com.google.gerrit.reviewdb.client.AccountSshKey ( id , com.google.gerrit.sshd.SshUtil.toOpenSshPublicKey ( encoded ) ) ; com.google.gerrit.sshd.SshUtil.parse ( key ) ; return key ; } catch ( java.security.NoSuchAlgorithmException | java.security.spec.InvalidKeySpecException e ) { throw new com.google.gerrit.common.errors.InvalidSshKeyException ( ) ; } catch ( java.security.NoSuchProviderException e ) { com.google.gerrit.sshd.SshKeyCreatorImpl.log.error ( "Cannot parse SSH key" , e ) ; throw new com.google.gerrit.common.errors.InvalidSshKeyException ( ) ; } }

Target:
public com.google.gerrit.server.account.AccountSshKey create ( com.google.gerrit.server.account.AccountSshKey.Id id , java.lang.String encoded ) throws com.google.gerrit.common.errors.InvalidSshKeyException { try { com.google.gerrit.server.account.AccountSshKey key = new com.google.gerrit.server.account.AccountSshKey ( id , com.google.gerrit.sshd.SshUtil.toOpenSshPublicKey ( encoded ) ) ; com.google.gerrit.sshd.SshUtil.parse ( key ) ; return key ; } catch ( java.security.NoSuchAlgorithmException | java.security.spec.InvalidKeySpecException e ) { throw new com.google.gerrit.common.errors.InvalidSshKeyException ( ) ; } catch ( java.security.NoSuchProviderException e ) { com.google.gerrit.sshd.SshKeyCreatorImpl.log.error ( "Cannot parse SSH key" , e ) ; throw new com.google.gerrit.common.errors.InvalidSshKeyException ( ) ; } }
Source:
private void restoreSelection ( ) { if ( ( ( getFromTo ( ) ) != null ) && ( ( comment.in_reply_to ( ) ) == null ) ) { getCm ( ) . setSelection ( getFromTo ( ) . from ( ) , getFromTo ( ) . to ( ) ) ; } }

Target:
private void restoreSelection ( ) { if ( ( ( getFromTo ( ) ) != null ) && ( ( comment.inReplyTo ( ) ) == null ) ) { getCm ( ) . setSelection ( getFromTo ( ) . from ( ) , getFromTo ( ) . to ( ) ) ; } }
Source:
public static boolean compareCommitValidationMessage ( com.google.gerrit.server.git.validators.CommitValidationMessage msg1 , com.google.gerrit.server.git.validators.CommitValidationMessage msg2 ) { if ( ( msg1.getMessage ( ) . equals ( msg2.getMessage ( ) ) ) && ( ( msg1.isError ( ) ) == ( msg2.isError ( ) ) ) ) { return true ; } else { return false ; } }

Target:
public java.lang.String apply ( com.google.gerrit.server.git.validators.CommitValidationMessage input ) { java.lang.String pre = ( input.isError ( ) ) ? "ERROR: " : "MSG: " ; return pre + ( input.getMessage ( ) ) ; }
Source:
public void postUpdate ( com.google.gerrit.server.git.BatchUpdate.Context ctx ) { if ( ( changeMessage ) == null ) { return ; } emailReviewers ( ctx.getProject ( ) , currChange , del , changeMessage ) ; try { hooks.doReviewerDeletedHook ( currChange , reviewer , currPs , changeMessage.getMessage ( ) , newApprovals , oldApprovals , dbProvider.get ( ) ) ; } catch ( com.google.gwtorm.server.OrmException e ) { com.google.gerrit.server.change.DeleteReviewer.log.warn ( "ChangeHook.doCommentAddedHook delivery failed" , e ) ; } }

Target:
public void postUpdate ( com.google.gerrit.server.git.BatchUpdate.Context ctx ) { if ( ( changeMessage ) == null ) { return ; } emailReviewers ( ctx.getProject ( ) , currChange , del , changeMessage ) ; try { hooks.doReviewerDeletedHook ( currChange , reviewer , currPs , changeMessage.getMessage ( ) , newApprovals , oldApprovals , dbProvider.get ( ) ) ; } catch ( com.google.gwtorm.server.OrmException e ) { com.google.gerrit.server.change.DeleteReviewer.log.warn ( "ChangeHook.doReviewerDeletedHook invocation failed" , e ) ; } }
Source:
public void onError ( com.google.gwt.http.client.Request req , java.lang.Throwable err ) { RpcStatus.INSTANCE.onRpcComplete ( ) ; if ( err.getMessage ( ) . contains ( "XmlHttpRequest.status" ) ) { cb.onFailure ( new com.google.gwt.user.client.rpc.StatusCodeException ( com.google.gerrit.client.rpc.RestApi.SC_UNAVAILABLE , RpcConstants.C.errorServerUnavailable ( ) ) ) ; } else { cb.onFailure ( new com.google.gwt.user.client.rpc.StatusCodeException ( com.google.gerrit.client.rpc.RestApi.SC_BAD_TRANSPORT , err.getMessage ( ) ) ) ; } }

Target:
public void onError ( com.google.gwt.http.client.Request req , java.lang.Throwable err ) { if ( ! ( background ) ) { RpcStatus.INSTANCE.onRpcComplete ( ) ; } if ( err.getMessage ( ) . contains ( "XmlHttpRequest.status" ) ) { cb.onFailure ( new com.google.gwt.user.client.rpc.StatusCodeException ( com.google.gerrit.client.rpc.RestApi.SC_UNAVAILABLE , RpcConstants.C.errorServerUnavailable ( ) ) ) ; } else { cb.onFailure ( new com.google.gwt.user.client.rpc.StatusCodeException ( com.google.gerrit.client.rpc.RestApi.SC_BAD_TRANSPORT , err.getMessage ( ) ) ) ; } }
Source:
private static void publish ( final com.google.gerrit.reviewdb.client.PatchSet.Id ps ) { java.lang.String token = com.google.gerrit.client.Dispatcher.toPublish ( ps ) ; new com.google.gerrit.client.Dispatcher.AsyncSplit ( token ) { public void onSuccess ( ) { com.google.gerrit.client.Gerrit.display ( token , select ( ) ) ; } private com.google.gerrit.client.ui.Screen select ( ) { return new com.google.gerrit.client.changes.PublishCommentScreen ( ps ) ; } } . onSuccess ( ) ; }

Target:
private static void unified1 ( final java.lang.String token , final com.google.gerrit.reviewdb.client.PatchSet.Id baseId , final com.google.gerrit.reviewdb.client.Patch.Key id ) { com.google.gwt.core.client.GWT.runAsync ( new com.google.gerrit.client.Dispatcher.AsyncSplit ( token ) { @ java.lang.Override public void onSuccess ( ) { com.google.gerrit.client.patches.UnifiedPatchScreen.TopView top = com.google.gerrit.client.Gerrit.getPatchScreenTopView ( ) ; com.google.gerrit.client.Gerrit.display ( token , new com.google.gerrit.client.patches.UnifiedPatchScreen ( id , top , baseId ) ) ; } } ) ; }
Source:
public void evictAfterRename ( final com.google.gerrit.reviewdb.client.AccountGroup.NameKey oldName , final com.google.gerrit.reviewdb.client.AccountGroup.NameKey newName ) { byName.remove ( oldName ) ; updateGroupList ( oldName , newName ) ; }

Target:
public com.google.gerrit.reviewdb.client.AccountGroup get ( final com.google.gerrit.reviewdb.client.AccountGroup.Id groupId ) { try { com.google.common.base.Optional < com.google.gerrit.reviewdb.client.AccountGroup > g = byId.get ( groupId ) ; return g.isPresent ( ) ? g.get ( ) : com.google.gerrit.server.account.GroupCacheImpl.missing ( groupId ) ; } catch ( java.util.concurrent.ExecutionException e ) { com.google.gerrit.server.account.GroupCacheImpl.log.warn ( ( "Cannot load group " + groupId ) , e ) ; return com.google.gerrit.server.account.GroupCacheImpl.missing ( groupId ) ; } }
Source:
public int compare ( java.io.File a , java.io.File b ) { int cmp = java.lang.Long.compare ( b.lastModified ( ) , a.lastModified ( ) ) ; if ( cmp != 0 ) { return cmp ; } return a.getName ( ) . compareTo ( b.getName ( ) ) ; }

Target:
public int compare ( java.nio.file.Path a , java.nio.file.Path b ) { return com.google.common.collect.ComparisonChain.start ( ) . compare ( com.google.gerrit.common.SiteLibraryLoaderUtil.lastModified ( b ) , com.google.gerrit.common.SiteLibraryLoaderUtil.lastModified ( a ) ) . compare ( a , b ) . result ( ) ; }
Source:
private java.lang.String url ( ) { if ( ( info.hasChangeNumber ( ) ) && ( info.hasRevisionNumber ( ) ) ) { return "#" + ( com.google.gerrit.common.PageLinks.toChange ( info.patchSetId ( ) ) ) ; } com.google.gerrit.client.info.GitwebInfo gw = com.google.gerrit.client.Gerrit.info ( ) . gitweb ( ) ; if ( ( gw != null ) && ( ( project ) != null ) ) { return gw.toRevision ( project , info.commit ( ) . commit ( ) ) ; } return null ; }

Target:
private java.lang.String url ( ) { if ( ( info.hasChangeNumber ( ) ) && ( ( info._changeNumber ( ) ) == 0 ) ) { return null ; } if ( ( info.hasChangeNumber ( ) ) && ( info.hasRevisionNumber ( ) ) ) { return "#" + ( com.google.gerrit.common.PageLinks.toChange ( info.patchSetId ( ) ) ) ; } return null ; }
Source:
public void display ( final java.util.List < com.google.gerrit.client.reviewdb.Patch > list ) { final java.lang.StringBuilder nc = new java.lang.StringBuilder ( ) ; appendHeader ( nc ) ; for ( final com.google.gerrit.client.reviewdb.Patch p : list ) { appendRow ( nc , p ) ; } appendRow ( nc , null ) ; resetHtml ( nc.toString ( ) ) ; int row = 1 ; for ( final com.google.gerrit.client.reviewdb.Patch p : list ) { setRowItem ( ( row ++ ) , p ) ; } }

Target:
public void display ( final com.google.gerrit.client.reviewdb.PatchSet.Id id , final java.util.List < com.google.gerrit.client.reviewdb.Patch > list ) { psid = id ; final com.google.gerrit.client.changes.PatchTable.DisplayCommand cmd = new com.google.gerrit.client.changes.PatchTable.DisplayCommand ( list ) ; if ( cmd.execute ( ) ) { cmd.initMeter ( ) ; com.google.gwt.user.client.DeferredCommand.addCommand ( cmd ) ; } }
Source:
public void testCreate ( ) throws java.io.FileNotFoundException { final com.google.gerrit.server.config.SitePaths site = new com.google.gerrit.server.config.SitePaths ( new java.io.File ( "." ) ) ; final com.google.gerrit.pgm.util.ConsoleUI ui = org.easymock.EasyMock.createStrictMock ( com.google.gerrit.pgm.util.ConsoleUI.class ) ; org.easymock.EasyMock.replay ( ui ) ; com.google.gerrit.pgm.init.Libraries lib = new com.google.gerrit.pgm.init.Libraries ( new com.google.inject.Provider < com.google.gerrit.pgm.init.LibraryDownloader > ( ) { @ java.lang.Override public com.google.gerrit.pgm.init.LibraryDownloader get ( ) { return new com.google.gerrit.pgm.init.LibraryDownloader ( ui , site ) ; } } ) ; org.junit.Assert.assertNotNull ( lib.bouncyCastleProvider ) ; org.junit.Assert.assertNotNull ( lib.mysqlDriver ) ; org.easymock.EasyMock.verify ( ui ) ; }

Target:
public void testCreate ( ) throws java.io.FileNotFoundException { final com.google.gerrit.server.config.SitePaths site = new com.google.gerrit.server.config.SitePaths ( new java.io.File ( "." ) ) ; final com.google.gerrit.pgm.init.ConsoleUI ui = org.easymock.EasyMock.createStrictMock ( com.google.gerrit.pgm.init.ConsoleUI.class ) ; org.easymock.EasyMock.replay ( ui ) ; com.google.gerrit.pgm.init.Libraries lib = new com.google.gerrit.pgm.init.Libraries ( new com.google.inject.Provider < com.google.gerrit.pgm.init.LibraryDownloader > ( ) { @ java.lang.Override public com.google.gerrit.pgm.init.LibraryDownloader get ( ) { return new com.google.gerrit.pgm.init.LibraryDownloader ( ui , site ) ; } } ) ; org.junit.Assert.assertNotNull ( lib.bouncyCastleProvider ) ; org.junit.Assert.assertNotNull ( lib.mysqlDriver ) ; org.easymock.EasyMock.verify ( ui ) ; }
Source:
public void createEdit ( org.eclipse.jgit.lib.Repository repository , com.google.gerrit.server.project.ChangeControl changeControl ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.server.project.InvalidChangeOperationException , com.google.gwtorm.server.OrmException , java.io.IOException { ensureAuthenticatedAndPermitted ( changeControl ) ; java.util.Optional < com.google.gerrit.server.edit.ChangeEdit > changeEdit = lookupChangeEdit ( changeControl ) ; if ( changeEdit.isPresent ( ) ) { throw new com.google.gerrit.server.project.InvalidChangeOperationException ( java.lang.String.format ( "A change edit already exists for change %s" , changeControl.getId ( ) ) ) ; } com.google.gerrit.reviewdb.client.PatchSet currentPatchSet = lookupCurrentPatchSet ( changeControl ) ; org.eclipse.jgit.lib.ObjectId patchSetCommitId = com.google.gerrit.server.edit.ChangeEditModifier.getPatchSetCommitId ( currentPatchSet ) ; createEdit ( repository , changeControl , currentPatchSet , patchSetCommitId , com.google.gerrit.common.TimeUtil.nowTs ( ) ) ; }

Target:
public void createEdit ( org.eclipse.jgit.lib.Repository repository , com.google.gerrit.server.project.ChangeControl changeControl ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.server.permissions.PermissionBackendException , com.google.gerrit.server.project.InvalidChangeOperationException , com.google.gwtorm.server.OrmException , java.io.IOException { assertCanEdit ( changeControl ) ; java.util.Optional < com.google.gerrit.server.edit.ChangeEdit > changeEdit = lookupChangeEdit ( changeControl ) ; if ( changeEdit.isPresent ( ) ) { throw new com.google.gerrit.server.project.InvalidChangeOperationException ( java.lang.String.format ( "A change edit already exists for change %s" , changeControl.getId ( ) ) ) ; } com.google.gerrit.reviewdb.client.PatchSet currentPatchSet = lookupCurrentPatchSet ( changeControl ) ; org.eclipse.jgit.lib.ObjectId patchSetCommitId = com.google.gerrit.server.edit.ChangeEditModifier.getPatchSetCommitId ( currentPatchSet ) ; createEdit ( repository , changeControl , currentPatchSet , patchSetCommitId , com.google.gerrit.common.TimeUtil.nowTs ( ) ) ; }
Source:
private static org.eclipse.jgit.lib.ObjectId resolveBlob ( com.google.gitiles.GitilesView view , org.eclipse.jgit.revwalk.RevWalk rw ) throws java.io.IOException { try { org.eclipse.jgit.treewalk.TreeWalk tw = org.eclipse.jgit.treewalk.TreeWalk.forPath ( rw.getObjectReader ( ) , view.getPathPart ( ) , rw.parseTree ( view.getRevision ( ) . getId ( ) ) ) ; if ( ( ( tw.getRawMode ( 0 ) ) & ( org.eclipse.jgit.lib.FileMode.TYPE_FILE ) ) == 0 ) { return null ; } return tw.getObjectId ( 0 ) ; } catch ( org.eclipse.jgit.errors.IncorrectObjectTypeException e ) { return null ; } }

Target:
private static org.eclipse.jgit.lib.ObjectId resolveBlob ( com.google.gitiles.GitilesView view , org.eclipse.jgit.revwalk.RevWalk rw , org.eclipse.jgit.revwalk.RevCommit commit ) throws java.io.IOException { try { org.eclipse.jgit.treewalk.TreeWalk tw = org.eclipse.jgit.treewalk.TreeWalk.forPath ( rw.getObjectReader ( ) , view.getPathPart ( ) , commit.getTree ( ) ) ; if ( ( ( tw.getRawMode ( 0 ) ) & ( org.eclipse.jgit.lib.FileMode.TYPE_FILE ) ) == 0 ) { return null ; } return tw.getObjectId ( 0 ) ; } catch ( org.eclipse.jgit.errors.IncorrectObjectTypeException e ) { return null ; } }
Source:
private static boolean sameUpdate ( com.google.gerrit.server.notedb.ChangeRebuilder.Event event , com.google.gerrit.server.notedb.ChangeUpdate update ) { return ( ( ( update != null ) && ( ( com.google.gerrit.server.notedb.ChangeRebuilder.round ( event.when ) ) == ( com.google.gerrit.server.notedb.ChangeRebuilder.round ( update.getWhen ( ) ) ) ) ) && ( event.who.equals ( update.getUser ( ) . getAccountId ( ) ) ) ) && ( event.psId.equals ( update.getPatchSetId ( ) ) ) ; }

Target:
private static boolean sameUpdate ( com.google.gerrit.server.notedb.ChangeRebuilder.Event event , com.google.gerrit.server.notedb.ChangeUpdate update ) { return ( ( ( ( update != null ) && ( ( com.google.gerrit.server.notedb.ChangeRebuilder.round ( event.when ) ) == ( com.google.gerrit.server.notedb.ChangeRebuilder.round ( update.getWhen ( ) ) ) ) ) && ( event.who.equals ( update.getUser ( ) . getAccountId ( ) ) ) ) && ( event.psId.equals ( update.getPatchSetId ( ) ) ) ) && ( ! ( event instanceof com.google.gerrit.server.notedb.ChangeRebuilder.FinalUpdatesEvent ) ) ; }
Source:
private com.google.gerrit.reviewdb.server.ReviewDb unwrapDb ( ) { com.google.gerrit.reviewdb.server.ReviewDb db = dbProvider.get ( ) ; if ( db instanceof com.google.gerrit.server.schema.DisabledChangesReviewDbWrapper ) { db = ( ( com.google.gerrit.server.schema.DisabledChangesReviewDbWrapper ) ( db ) ) . unsafeGetDelegate ( ) ; } return db ; }

Target:
private void assertChangesReadOnly ( com.google.gerrit.extensions.restapi.RestApiException e ) throws java.lang.Exception { java.lang.Throwable cause = e.getCause ( ) ; com.google.common.truth.Truth.assertThat ( cause ) . isInstanceOf ( com.google.gerrit.server.git.UpdateException.class ) ; com.google.common.truth.Truth.assertThat ( cause.getCause ( ) ) . isInstanceOf ( com.google.gwtorm.server.OrmException.class ) ; com.google.common.truth.Truth.assertThat ( cause.getCause ( ) ) . hasMessage ( NoteDbUpdateManager.CHANGES_READ_ONLY ) ; }
Source:
private com.google.inject.Injector createSshInjector ( ) { final java.util.List < com.google.inject.Module > modules = new java.util.ArrayList < com.google.inject.Module > ( ) ; modules.add ( sysInjector.getInstance ( com.google.gerrit.sshd.SshModule.class ) ) ; modules.add ( new com.google.gerrit.sshd.commands.MasterCommandModule ( ) ) ; return sysInjector.createChildInjector ( modules ) ; }

Target:
private com.google.inject.Injector createSshInjector ( ) { final java.util.List < com.google.inject.Module > modules = new java.util.ArrayList < > ( ) ; modules.add ( sysInjector.getInstance ( com.google.gerrit.sshd.SshModule.class ) ) ; modules.add ( new com.google.gerrit.sshd.SshHostKeyModule ( ) ) ; modules.add ( new com.google.gerrit.sshd.commands.DefaultCommandModule ( false ) ) ; return sysInjector.createChildInjector ( modules ) ; }
Source:
protected void applyDataRowStyle ( final int row ) { super . applyDataRowStyle ( row ) ; final com.google.gwt.user.client.ui.HTMLTable.CellFormatter fmt = table.getCellFormatter ( ) ; fmt.addStyleName ( row , com.google.gerrit.client.changes.ChangeTable.C_STAR , com.google.gerrit.client.changes.S_ICON_CELL ) ; for ( int i = com.google.gerrit.client.changes.ChangeTable.C_ID ; i < ( com.google.gerrit.client.changes.ChangeTable.COLUMNS ) ; i ++ ) { fmt.addStyleName ( row , i , com.google.gerrit.client.changes.S_DATA_CELL ) ; } fmt.addStyleName ( row , com.google.gerrit.client.changes.ChangeTable.C_ID , com.google.gerrit.client.changes.ChangeTable.S_C_ID ) ; }

Target:
protected void applyDataRowStyle ( final int row ) { super . applyDataRowStyle ( row ) ; final com.google.gwt.user.client.ui.HTMLTable.CellFormatter fmt = table.getCellFormatter ( ) ; fmt.addStyleName ( row , com.google.gerrit.client.changes.ChangeTable.C_STAR , com.google.gerrit.client.changes.S_ICON_CELL ) ; for ( int i = com.google.gerrit.client.changes.ChangeTable.C_ID ; i < ( com.google.gerrit.client.changes.ChangeTable.COLUMNS ) ; i ++ ) { fmt.addStyleName ( row , i , com.google.gerrit.client.changes.S_DATA_CELL ) ; } fmt.addStyleName ( row , com.google.gerrit.client.changes.ChangeTable.C_ID , com.google.gerrit.client.changes.ChangeTable.S_C_ID ) ; fmt.addStyleName ( row , com.google.gerrit.client.changes.ChangeTable.C_SUBJECT , com.google.gerrit.client.changes.ChangeTable.S_C_SUBJECT ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { repo = new org.eclipse.jgit.junit.TestRepository ( repoManager.openRepository ( project ) ) ; com.google.gerrit.server.git.ProjectConfig pc = projectCache.checkedGet ( allProjects ) . getConfig ( ) ; for ( com.google.gerrit.common.data.AccessSection sec : pc.getAccessSections ( ) ) { sec.removePermission ( Permission.READ ) ; } saveProjectConfig ( allProjects , pc ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { repo = com.google.gerrit.acceptance.GitUtil.newTestRepository ( repoManager.openRepository ( project ) ) ; com.google.gerrit.server.git.ProjectConfig pc = projectCache.checkedGet ( allProjects ) . getConfig ( ) ; for ( com.google.gerrit.common.data.AccessSection sec : pc.getAccessSections ( ) ) { sec.removePermission ( Permission.READ ) ; } saveProjectConfig ( allProjects , pc ) ; }
Source:
public boolean apply ( com.google.gerrit.server.project.ListBranches.BranchInfo in ) { if ( ! ( in.ref.startsWith ( Constants.R_HEADS ) ) ) { return a.run ( in.ref ) ; } else { return a.run ( in.ref.substring ( Constants.R_HEADS.length ( ) ) ) ; } }

Target:
public boolean apply ( com.google.gerrit.extensions.api.projects.BranchInfo in ) { if ( ! ( in.ref.startsWith ( Constants.R_HEADS ) ) ) { return a.run ( in.ref ) ; } else { return a.run ( in.ref.substring ( Constants.R_HEADS.length ( ) ) ) ; } }
Source:
private static java.lang.String getLabel ( com.google.gerrit.reviewdb.client.AccountGeneralPreferences.ChangeScreen ui ) { if ( ui == null ) { return "" ; } switch ( ui ) { case OLD_UI : return Util.C.changeScreenOldUi ( ) ; case CHANGE_SCREEN2 : return Util.C.changeScreenNewUi ( ) ; default : return ui.name ( ) ; } }

Target:
public void onSuccess ( com.google.gerrit.client.account.Preferences p ) { this . display ( p.my ( ) ) ; widget.setEnabled ( true ) ; }
Source:
public void onSuccess ( com.google.gwt.core.client.JsArray < com.google.gerrit.client.change.ReviewerSuggestOracle.SuggestReviewerInfo > result ) { final java.util.List < com.google.gerrit.client.change.ReviewerSuggestOracle.RestReviewerSuggestion > r = new java.util.ArrayList ( result.length ( ) ) ; for ( final com.google.gerrit.client.change.ReviewerSuggestOracle.SuggestReviewerInfo reviewer : com.google.gerrit.client.rpc.Natives.asList ( result ) ) { r.add ( new com.google.gerrit.client.change.ReviewerSuggestOracle.RestReviewerSuggestion ( reviewer ) ) ; } callback.onSuggestionsReady ( req , new com.google.gerrit.client.change.Response ( r ) ) ; }

Target:
public void onSuccess ( com.google.gwt.core.client.JsArray < com.google.gerrit.client.change.ReviewerSuggestOracle.SuggestReviewerInfo > result ) { java.util.List < com.google.gerrit.client.change.ReviewerSuggestOracle.RestReviewerSuggestion > r = new java.util.ArrayList ( result.length ( ) ) ; for ( com.google.gerrit.client.change.ReviewerSuggestOracle.SuggestReviewerInfo reviewer : com.google.gerrit.client.rpc.Natives.asList ( result ) ) { r.add ( new com.google.gerrit.client.change.ReviewerSuggestOracle.RestReviewerSuggestion ( reviewer ) ) ; } cb.onSuggestionsReady ( req , new com.google.gerrit.client.change.Response ( r ) ) ; }
Source:
private com.google.gerrit.common.data.PermissionRule grant ( com.google.gerrit.server.git.ProjectConfig project , java.lang.String permissionName , com.google.gerrit.common.data.PermissionRule rule , java.lang.String ref ) { project.getAccessSection ( ref , true ) . getPermission ( permissionName , true ) . add ( rule ) ; return rule ; }

Target:
public void testUnblockInLocalForceEditTopicName_Fails ( ) { com.google.gerrit.server.project.Util.grant ( util.getParentConfig ( ) , com.google.gerrit.common.data.Permission.EDIT_TOPIC_NAME , com.google.gerrit.server.project.Util.ANONYMOUS , "refs/heads/*" ) . setBlock ( ) ; com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.EDIT_TOPIC_NAME , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) . setForce ( true ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.REGISTERED ) ; assertFalse ( "u can't edit topic name" , u.controlForRef ( "refs/heads/master" ) . canForceEditTopicName ( ) ) ; }
Source:
private static void deleteLocally ( org.eclipse.jgit.transport.URIish uri ) { try { com.googlesource.gerrit.plugins.replication.ReplicationQueue.recursivelyDelete ( new java.io.File ( uri.getPath ( ) ) ) ; } catch ( java.io.IOException e ) { com.googlesource.gerrit.plugins.replication.ReplicationQueue.repLog.error ( "Error deleting local repository {}:\n" , uri.getPath ( ) , e ) ; } }

Target:
private static void deleteLocally ( org.eclipse.jgit.transport.URIish uri ) { try { com.googlesource.gerrit.plugins.replication.ReplicationQueue.recursivelyDelete ( new java.io.File ( uri.getPath ( ) ) ) ; com.googlesource.gerrit.plugins.replication.ReplicationQueue.repLog.info ( "Deleted local repository: {}" , uri ) ; } catch ( java.io.IOException e ) { com.googlesource.gerrit.plugins.replication.ReplicationQueue.repLog.error ( "Error deleting local repository {}:\n" , uri.getPath ( ) , e ) ; } }
Source:
protected void configure ( ) { factory ( AbandonChange.Factory.class ) ; factory ( ChangeDetailFactory.Factory.class ) ; factory ( IncludedInDetailFactory.Factory.class ) ; factory ( PatchSetDetailFactory.Factory.class ) ; factory ( PatchSetPublishDetailFactory.Factory.class ) ; factory ( SubmitAction.Factory.class ) ; }

Target:
protected void configure ( ) { factory ( AbandonChange.Factory.class ) ; factory ( RestoreChange.Factory.class ) ; factory ( ChangeDetailFactory.Factory.class ) ; factory ( IncludedInDetailFactory.Factory.class ) ; factory ( PatchSetDetailFactory.Factory.class ) ; factory ( PatchSetPublishDetailFactory.Factory.class ) ; factory ( SubmitAction.Factory.class ) ; }
Source:
private void initMode ( ) { mode.addItem ( "" , "" ) ; for ( java.util.Map.Entry < java.lang.String , java.lang.String > e : com.google.gerrit.client.diff.PreferencesBox.NAME_TO_MODE.entrySet ( ) ) { mode.addItem ( e.getKey ( ) , e.getValue ( ) ) ; } }

Target:
private void initMode ( ) { mode.addItem ( "" , "" ) ; for ( net.codemirror.mode.ModeInfo m : com.google.gerrit.client.rpc.Natives.asList ( net.codemirror.mode.ModeInfo.all ( ) ) ) { mode.addItem ( m.name ( ) , m.mime ( ) ) ; } }
Source:
public com.google.gerrit.extensions.registration.DynamicMap < T > get ( ) { com.google.gerrit.extensions.registration.PrivateInternals_DynamicMapImpl < T > m = new com.google.gerrit.extensions.registration.PrivateInternals_DynamicMapImpl < T > ( ) ; java.util.List < com.google.inject.Binding < T > > bindings = injector.findBindingsByType ( type ) ; if ( bindings != null ) { for ( com.google.inject.Binding < T > b : bindings ) { m.put ( "gerrit" , b.getKey ( ) , b.getProvider ( ) ) ; } } return m ; }

Target:
public com.google.gerrit.extensions.registration.DynamicMap < T > get ( ) { com.google.gerrit.extensions.registration.PrivateInternals_DynamicMapImpl < T > m = new com.google.gerrit.extensions.registration.PrivateInternals_DynamicMapImpl < T > ( ) ; java.util.List < com.google.inject.Binding < T > > bindings = injector.findBindingsByType ( type ) ; if ( bindings != null ) { for ( com.google.inject.Binding < T > b : bindings ) { if ( ( b.getKey ( ) . getAnnotation ( ) ) != null ) { m.put ( "gerrit" , b.getKey ( ) , b.getProvider ( ) ) ; } } } return m ; }
Source:
com.googlesource.gerrit.plugins.findowners.OwnersDb get ( com.google.gerrit.server.account.AccountCache accountCache , com.google.gerrit.server.account.Emails emails , org.eclipse.jgit.lib.Repository repository , com.google.gerrit.server.query.change.ChangeData changeData , int patchset ) throws com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.reviewdb.client.Project.NameKey project = changeData.change ( ) . getProject ( ) ; java.lang.String branch = changeData.change ( ) . getDest ( ) . get ( ) ; java.lang.String dbKey = com.googlesource.gerrit.plugins.findowners.Cache.makeKey ( changeData.getId ( ) . get ( ) , patchset , branch ) ; return get ( accountCache , emails , dbKey , repository , changeData , project , branch , changeData.currentFilePaths ( ) ) ; }

Target:
com.googlesource.gerrit.plugins.findowners.OwnersDb get ( com.google.gerrit.server.project.ProjectState projectState , com.google.gerrit.server.account.AccountCache accountCache , com.google.gerrit.server.account.Emails emails , org.eclipse.jgit.lib.Repository repository , com.google.gerrit.server.query.change.ChangeData changeData , int patchset ) throws com.google.gwtorm.server.OrmException , java.io.IOException { java.lang.String branch = changeData.change ( ) . getDest ( ) . get ( ) ; java.lang.String dbKey = com.googlesource.gerrit.plugins.findowners.Cache.makeKey ( changeData.getId ( ) . get ( ) , patchset , branch ) ; return get ( projectState , accountCache , emails , dbKey , repository , changeData , branch , changeData.currentFilePaths ( ) ) ; }
Source:
public void configure ( ) { factory ( ChangeUpdate.Factory.class ) ; factory ( ChangeDraftUpdate.Factory.class ) ; factory ( DraftCommentNotes.Factory.class ) ; factory ( NoteDbUpdateManager.Factory.class ) ; }

Target:
public void configure ( ) { factory ( ChangeUpdate.Factory.class ) ; factory ( ChangeDraftUpdate.Factory.class ) ; factory ( DraftCommentNotes.Factory.class ) ; factory ( NoteDbUpdateManager.Factory.class ) ; if ( ! ( useTestBindings ) ) { bind ( com.google.gerrit.server.notedb.ChangeRebuilder.class ) . to ( com.google.gerrit.server.notedb.ChangeRebuilderImpl.class ) ; } else { bind ( com.google.gerrit.server.notedb.ChangeRebuilder.class ) . toInstance ( new com.google.gerrit.server.notedb.ChangeRebuilder ( null ) { @ java.lang.Override public com.google.gerrit.server.notedb.NoteDbChangeState rebuild ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Change.Id changeId ) throws com.google.gwtorm.server.OrmException { return null ; } } ) ; } }
Source:
protected void configureServlets ( ) { install ( new com.google.gerrit.server.config.FactoryModule ( ) { @ java.lang.Override protected void configure ( ) { factory ( AgreementInfoFactory.Factory.class ) ; factory ( DeleteExternalIds.Factory.class ) ; factory ( ExternalIdDetailFactory.Factory.class ) ; } } ) ; rpc ( com.google.gerrit.httpd.rpc.account.AccountSecurityImpl.class ) ; rpc ( com.google.gerrit.httpd.rpc.account.AccountServiceImpl.class ) ; }

Target:
protected void configureServlets ( ) { install ( new com.google.gerrit.extensions.config.FactoryModule ( ) { @ java.lang.Override protected void configure ( ) { factory ( AgreementInfoFactory.Factory.class ) ; factory ( DeleteExternalIds.Factory.class ) ; factory ( ExternalIdDetailFactory.Factory.class ) ; } } ) ; rpc ( com.google.gerrit.httpd.rpc.account.AccountSecurityImpl.class ) ; rpc ( com.google.gerrit.httpd.rpc.account.AccountServiceImpl.class ) ; }
Source:
protected void doPost ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse rsp ) { try { setHealthy ( ) ; rsp.setStatus ( javax.servlet.http.HttpServletResponse.SC_NO_CONTENT ) ; } catch ( java.io.IOException e ) { com.ericsson.gerrit.plugins.highavailability.health.HealthServlet.log.error ( "Failed to set healthy" , e ) ; sendError ( rsp , javax.servlet.http.HttpServletResponse.SC_INTERNAL_SERVER_ERROR ) ; } }

Target:
protected void doGet ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse rsp ) { if ( healthy ) { rsp.setStatus ( javax.servlet.http.HttpServletResponse.SC_NO_CONTENT ) ; } else { sendError ( rsp , javax.servlet.http.HttpServletResponse.SC_SERVICE_UNAVAILABLE ) ; } }
Source:
private static void validateLabels ( java.util.Set < java.lang.String > labels ) { if ( labels == null ) { return ; } java.util.SortedSet < java.lang.String > invalidLabels = new java.util.TreeSet < > ( ) ; for ( java.lang.String label : labels ) { if ( com.google.common.base.CharMatcher.WHITESPACE.matchesAnyOf ( label ) ) { invalidLabels.add ( label ) ; } } if ( ! ( invalidLabels.isEmpty ( ) ) ) { throw com.google.gerrit.server.StarredChangesUtil.IllegalLabelException.invalidLabels ( invalidLabels ) ; } }

Target:
private static void validateLabels ( java.util.Set < java.lang.String > labels ) { if ( labels == null ) { return ; } java.util.SortedSet < java.lang.String > invalidLabels = new java.util.TreeSet < > ( ) ; for ( java.lang.String label : labels ) { if ( com.google.common.base.CharMatcher.whitespace ( ) . matchesAnyOf ( label ) ) { invalidLabels.add ( label ) ; } } if ( ! ( invalidLabels.isEmpty ( ) ) ) { throw com.google.gerrit.server.StarredChangesUtil.IllegalLabelException.invalidLabels ( invalidLabels ) ; } }
Source:
private void addExtensionPoint ( com.google.gerrit.client.GerritUiExtensionPoint extensionPoint , com.google.gwt.user.client.ui.Panel p , com.google.gerrit.client.info.ChangeInfo change ) { com.google.gerrit.client.api.ExtensionPanel extensionPanel = new com.google.gerrit.client.api.ExtensionPanel ( extensionPoint ) ; extensionPanel.putObject ( GerritUiExtensionPoint.Key.CHANGE_INFO , change ) ; p.add ( extensionPanel ) ; }

Target:
private void addExtensionPoint ( com.google.gerrit.client.GerritUiExtensionPoint extensionPoint , com.google.gwt.user.client.ui.Panel p , com.google.gerrit.client.info.ChangeInfo change , com.google.gerrit.client.info.ChangeInfo.RevisionInfo rev ) { com.google.gerrit.client.api.ExtensionPanel extensionPanel = new com.google.gerrit.client.api.ExtensionPanel ( extensionPoint ) ; extensionPanel.putObject ( GerritUiExtensionPoint.Key.CHANGE_INFO , change ) ; extensionPanel.putObject ( GerritUiExtensionPoint.Key.REVISION_INFO , rev ) ; p.add ( extensionPanel ) ; }
Source:
private boolean isParent ( java.io.File parent , java.io.File child ) throws java.io.IOException { java.io.File p = parent.getCanonicalFile ( ) ; java.io.File c = child.getCanonicalFile ( ) ; for ( ; ; ) { c = c.getParentFile ( ) ; if ( c == null ) { return false ; } if ( c.equals ( p ) ) { return true ; } } }

Target:
private boolean isParent ( java.nio.file.Path parent , java.nio.file.Path child ) throws java.io.IOException { java.nio.file.Path p = child ; for ( ; ; ) { p = p.getParent ( ) ; if ( p == null ) { return false ; } if ( java.nio.file.Files.isSameFile ( p , parent ) ) { return true ; } } }
Source:
public java.util.List < com.google.gerrit.extensions.common.ProjectInfo > apply ( com.google.gerrit.server.project.ProjectResource rsrc ) { if ( recursive ) { return getChildProjectsRecursively ( rsrc.getNameKey ( ) , rsrc.getControl ( ) . getCurrentUser ( ) ) ; } else { return getDirectChildProjects ( rsrc.getNameKey ( ) ) ; } }

Target:
public java.util.List < com.google.gerrit.extensions.common.ProjectInfo > apply ( com.google.gerrit.server.project.ProjectResource rsrc ) { if ( recursive ) { return getChildProjectsRecursively ( rsrc.getNameKey ( ) , rsrc.getControl ( ) . getUser ( ) ) ; } else { return getDirectChildProjects ( rsrc.getNameKey ( ) ) ; } }
Source:
private static com.google.common.collect.ImmutableListMultimap < com.google.gerrit.reviewdb.client.Project.NameKey , com.google.gerrit.server.query.change.ChangeData > byProject ( java.lang.Iterable < com.google.gerrit.server.query.change.ChangeData > changes ) throws com.google.gwtorm.server.OrmException { com.google.common.collect.ImmutableListMultimap.Builder < com.google.gerrit.reviewdb.client.Project.NameKey , com.google.gerrit.server.query.change.ChangeData > builder = new com.google.common.collect.ImmutableListMultimap.Builder < > ( ) ; for ( com.google.gerrit.server.query.change.ChangeData cd : changes ) { builder.put ( cd.change ( ) . getProject ( ) , cd ) ; } return builder.build ( ) ; }

Target:
public com.google.gerrit.server.git.MergeSuperSet setMergeOpRepoManager ( com.google.gerrit.server.git.MergeOpRepoManager orm ) { com.google.common.base.Preconditions.checkState ( ( ( this . orm ) == null ) ) ; this . orm = com.google.common.base.Preconditions.checkNotNull ( orm ) ; closeOrm = false ; return this ; }
Source:
public static com.google.gerrit.server.index.IndexConfig create ( int maxLimit , int maxPages , int maxTerms , int maxPrefixTerms ) { return new com.google.gerrit.server.index.AutoValue_IndexConfig ( com.google.gerrit.server.index.IndexConfig.checkLimit ( maxLimit , "maxLimit" , java.lang.Integer.MAX_VALUE ) , com.google.gerrit.server.index.IndexConfig.checkLimit ( maxPages , "maxPages" , java.lang.Integer.MAX_VALUE ) , com.google.gerrit.server.index.IndexConfig.checkLimit ( maxTerms , "maxTerms" , java.lang.Integer.MAX_VALUE ) , com.google.gerrit.server.index.IndexConfig.checkLimit ( maxPrefixTerms , "maxPrefixTerms" , com.google.gerrit.server.index.IndexConfig.DEFAULT_MAX_PREFIX_TERMS ) ) ; }

Target:
public static com.google.gerrit.server.index.IndexConfig create ( int maxLimit , int maxPages , int maxTerms , int maxPrefixTerms ) { return new com.google.gerrit.server.index.AutoValue_IndexConfig ( com.google.gerrit.server.index.IndexConfig.checkLimit ( maxLimit , "maxLimit" , java.lang.Integer.MAX_VALUE ) , com.google.gerrit.server.index.IndexConfig.checkLimit ( maxPages , "maxPages" , java.lang.Integer.MAX_VALUE ) , com.google.gerrit.server.index.IndexConfig.checkLimit ( maxTerms , "maxTerms" , com.google.gerrit.server.index.IndexConfig.DEFAULT_MAX_TERMS ) , com.google.gerrit.server.index.IndexConfig.checkLimit ( maxPrefixTerms , "maxPrefixTerms" , com.google.gerrit.server.index.IndexConfig.DEFAULT_MAX_PREFIX_TERMS ) ) ; }
Source:
public java.lang.String newToken ( final java.lang.String user , final java.lang.String resource ) throws com.google.gwtjsonrpc.server.XsrfException { final byte [ ] buf = new byte [ tokenLength ] ; com.google.gwtjsonrpc.server.XsrfUtil.encodeInt ( buf , com.google.gwtjsonrpc.server.XsrfUtil.now ( ) ) ; computeToken ( buf , user , resource ) ; return com.google.gwtjsonrpc.server.XsrfUtil.encodeBase64 ( buf ) ; }

Target:
public java.lang.String newToken ( final java.lang.String text ) throws com.google.gwtjsonrpc.server.XsrfException { final int q = rng.nextInt ( ) ; final byte [ ] buf = new byte [ tokenLength ] ; com.google.gwtjsonrpc.server.SignedToken.encodeInt ( buf , 0 , q ) ; com.google.gwtjsonrpc.server.SignedToken.encodeInt ( buf , com.google.gwtjsonrpc.server.SignedToken.INT_SZ , ( ( com.google.gwtjsonrpc.server.SignedToken.now ( ) ) ^ q ) ) ; computeToken ( buf , text ) ; return ( ( com.google.gwtjsonrpc.server.SignedToken.encodeBase64 ( buf ) ) + '$' ) + text ; }