auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void openLine ( final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder m , boolean isForTableHeader ) { m.openTr ( ) ; m.openTd ( ) ; m.setStyleName ( Gerrit.RESOURCES.css ( ) . iconCell ( ) ) ; if ( isForTableHeader ) { m.addStyleName ( Gerrit.RESOURCES.css ( ) . fileColumnHeader ( ) ) ; } else { m.setAttribute ( "valign" , "top" ) ; } m.closeTd ( ) ; }

Target:
private void padLineNumberOnTableHeaderForSideB ( final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder m ) { m.openTd ( ) ; m.setStyleName ( Gerrit.RESOURCES.css ( ) . lineNumber ( ) ) ; m.addStyleName ( Gerrit.RESOURCES.css ( ) . fileColumnHeader ( ) ) ; m.closeTd ( ) ; }
Source:
public void setLimit ( int n ) { if ( n < 0 ) { limit = 10 ; } else if ( n == 0 ) { limit = com.google.gerrit.server.account.SuggestAccounts.MAX_RESULTS ; } else { limit = java.lang.Math.min ( n , com.google.gerrit.server.account.SuggestAccounts.MAX_RESULTS ) ; } queryProcessor.setLimit ( limit ) ; }

Target:
public void setLimit ( int n ) { queryProcessor.setLimit ( n ) ; if ( n < 0 ) { suggestLimit = 10 ; } else if ( n == 0 ) { suggestLimit = com.google.gerrit.server.account.QueryAccounts.MAX_SUGGEST_RESULTS ; } else { suggestLimit = java.lang.Math.min ( n , com.google.gerrit.server.account.QueryAccounts.MAX_SUGGEST_RESULTS ) ; } }
Source:
public void uncaughtException ( java.lang.Thread thread , java.lang.Throwable t ) { android.util.Log.e ( com.google.reviewit.app.ReviewItApp.TAG , "Application failure" , t ) ; if ( ( currentActivity ) != null ) { android.app.FragmentManager fragmentManager = currentActivity.getFragmentManager ( ) ; fragmentManager.beginTransaction ( ) . replace ( R.id.mainFrame , com.google.reviewit.ErrorFragment.create ( t ) ) . commit ( ) ; } }

Target:
public void uncaughtException ( java.lang.Thread thread , java.lang.Throwable t ) { android.util.Log.e ( com.google.reviewit.app.ReviewItApp.TAG , "Application failure" , t ) ; if ( ( currentActivity ) != null ) { android.support.v4.app.FragmentManager fragmentManager = currentActivity.getSupportFragmentManager ( ) ; fragmentManager.beginTransaction ( ) . replace ( R.id.mainFrame , com.google.reviewit.ErrorFragment.create ( t ) ) . commit ( ) ; } }
Source:
public void testEvictProjectListOK ( ) throws java.lang.Exception { java.lang.String key = "all" ; java.lang.String keyJson = new com.google.gson.GsonBuilder ( ) . create ( ) . toJson ( key ) ; org.mockito.Mockito.when ( httpSessionMock.post ( buildCacheEndpoint ( Constants.PROJECT_LIST ) , keyJson ) ) . thenReturn ( new com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpResponseHandler.HttpResult ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.RestForwarderTest.SUCCESSFUL , com.ericsson.gerrit.plugins.highavailability.forwarder.rest.RestForwarderTest.EMPTY_MSG ) ) ; com.google.common.truth.Truth.assertThat ( forwarder.evict ( Constants.PROJECT_LIST , key ) ) . isTrue ( ) ; }

Target:
public void testAddToProjectListThrowsException ( ) throws java.lang.Exception { java.lang.String projectName = "projectToAdd" ; org.mockito.Mockito.doThrow ( new java.io.IOException ( ) ) . when ( httpSessionMock ) . post ( buildProjectListCacheEndpoint ( projectName ) ) ; com.google.common.truth.Truth.assertThat ( forwarder.addToProjectList ( projectName ) ) . isFalse ( ) ; }
Source:
public void onSuccess ( com.google.gerrit.client.rpc.NativeMap < com.googlesource.gerrit.plugins.verifystatus.client.VerificationInfo > result ) { if ( ! ( result.isEmpty ( ) ) ) { final java.lang.String patchsetId = ( ( change.id ( ) ) + "," ) + ( rev.id ( ) ) ; display ( patchsetId , result ) ; } }

Target:
public void onSuccess ( com.google.gerrit.client.rpc.NativeMap < com.googlesource.gerrit.plugins.verifystatus.client.VerificationInfo > result ) { if ( ! ( result.isEmpty ( ) ) ) { final java.lang.String patchsetId = ( ( change._number ( ) ) + "/" ) + ( rev.id ( ) ) ; display ( patchsetId , result ) ; } }
Source:
private java.util.List < com.google.gerrit.reviewdb.client.AccountGroupMember > loadMembers ( ) throws com.google.gwtorm.server.OrmException { java.util.List < com.google.gerrit.reviewdb.client.AccountGroupMember > members = new java.util.ArrayList < > ( ) ; for ( com.google.gerrit.reviewdb.client.AccountGroupMember m : db.accountGroupMembers ( ) . byGroup ( groupId ) ) { if ( control.canSeeMember ( m.getAccountId ( ) ) ) { members.add ( m ) ; } } return members ; }

Target:
private com.google.common.collect.ImmutableSet < com.google.gerrit.reviewdb.client.Account.Id > loadMembers ( ) throws com.google.gwtorm.server.OrmException { return groups.getMembers ( db , groupId ) . filter ( control :: canSeeMember ) . collect ( com.google.common.collect.ImmutableSet.toImmutableSet ( ) ) ; }
Source:
public void testBlockPushDrafts ( ) { com.google.gerrit.server.project.Util.allow ( util.getParentConfig ( ) , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/for/refs/*" ) ; com.google.gerrit.server.project.Util.block ( util.getParentConfig ( ) , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/drafts/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local ) ; org.junit.Assert.assertTrue ( "can upload refs/heads/master" , u.controlForRef ( "refs/heads/master" ) . canUpload ( ) ) ; org.junit.Assert.assertTrue ( "push is blocked to refs/drafts/master" , u.controlForRef ( "refs/drafts/refs/heads/master" ) . isBlocked ( com.google.gerrit.common.data.Permission.PUSH ) ) ; }

Target:
public void testBlockPushDrafts ( ) { com.google.gerrit.server.project.Util.allow ( parent , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/for/refs/*" ) ; com.google.gerrit.server.project.Util.block ( parent , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/drafts/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local ) ; org.junit.Assert.assertTrue ( "can upload refs/heads/master" , u.controlForRef ( "refs/heads/master" ) . canUpload ( ) ) ; org.junit.Assert.assertTrue ( "push is blocked to refs/drafts/master" , u.controlForRef ( "refs/drafts/refs/heads/master" ) . isBlocked ( com.google.gerrit.common.data.Permission.PUSH ) ) ; }
Source:
private void removeOldEvents ( ) { try { getEventsDb ( ) . removeOldEvents ( maxAge ) ; } catch ( java.sql.SQLException e ) { com.ericsson.gerrit.plugins.eventslog.sql.SQLStore.log.warn ( "Cannot remove old entries from database" , e ) ; } }

Target:
private void setUp ( ) { try { getEventsDb ( ) . createDBIfNotCreated ( ) ; } catch ( java.sql.SQLException e ) { com.ericsson.gerrit.plugins.eventslog.sql.SQLStore.log.warn ( ( "Cannot start the database. Events will be stored locally " + "until database connection can be established" ) , e ) ; setOnline ( false ) ; } if ( online ) { restoreEventsFromLocal ( ) ; } getEventsDb ( ) . removeOldEvents ( maxAge ) ; }
Source:
private void deleteFile ( java.io.File f ) { if ( ( f.exists ( ) ) && ( ! ( f.delete ( ) ) ) ) { com.googlesource.gerrit.plugins.websession.flatfile.FlatFileWebSessionCache.log.warn ( ( ( ( "Cannot delete file " + ( f.getName ( ) ) ) + " from cache " ) + ( dir.getAbsolutePath ( ) ) ) ) ; } }

Target:
private java.util.List < java.nio.file.Path > listFiles ( ) { java.util.List < java.nio.file.Path > files = new java.util.ArrayList < > ( ) ; try ( java.nio.file.DirectoryStream < java.nio.file.Path > dirStream = java.nio.file.Files.newDirectoryStream ( dir ) ) { for ( java.nio.file.Path path : dirStream ) { files.add ( path ) ; } } catch ( java.io.IOException e ) { com.googlesource.gerrit.plugins.websession.flatfile.FlatFileWebSessionCache.log.error ( ( "Cannot list files in cache " + ( dir ) ) , e ) ; } return files ; }
Source:
private static java.lang.String randSuffix ( ) { com.google.common.hash.Hasher h = com.google.common.hash.Hashing.md5 ( ) . newHasher ( ) ; byte [ ] buf = new byte [ 8 ] ; org.eclipse.jgit.util.NB.encodeInt64 ( buf , 0 , com.google.gerrit.common.TimeUtil.nowMs ( ) ) ; h.putBytes ( buf ) ; com.google.gerrit.server.change.FileContentUtil.rng.nextBytes ( buf ) ; h.putBytes ( buf ) ; return h.hash ( ) . toString ( ) ; }

Target:
private static java.lang.String randSuffix ( ) { com.google.common.hash.Hasher h = com.google.common.hash.Hashing.murmur3_128 ( ) . newHasher ( ) ; byte [ ] buf = new byte [ 8 ] ; org.eclipse.jgit.util.NB.encodeInt64 ( buf , 0 , com.google.gerrit.common.TimeUtil.nowMs ( ) ) ; h.putBytes ( buf ) ; com.google.gerrit.server.change.FileContentUtil.rng.nextBytes ( buf ) ; h.putBytes ( buf ) ; return h.hash ( ) . toString ( ) ; }
Source:
public void setCommentLinks ( final java.util.List < com.google.gwtexpui.safehtml.client.RegexFindReplace > cl ) { commentLinks = cl ; }

Target:
public java.util.List < com.google.gwtexpui.safehtml.client.FindReplace > getCommentLinks ( ) { if ( ( findReplaceLinks ) == null ) { if ( ( commentLinks ) != null ) { findReplaceLinks = new java.util.ArrayList < com.google.gwtexpui.safehtml.client.FindReplace > ( commentLinks.size ( ) ) ; for ( com.google.gerrit.common.data.GerritConfig.CommentLink cl : commentLinks ) { findReplaceLinks.add ( cl.asFindReplace ( ) ) ; } findReplaceLinks = java.util.Collections.unmodifiableList ( findReplaceLinks ) ; } } return findReplaceLinks ; }
Source:
private java.util.List < com.google.gerrit.extensions.api.projects.BranchInfo > listBranches ( com.google.gerrit.server.api.projects.ListRefsRequest < com.google.gerrit.extensions.api.projects.BranchInfo > request ) throws com.google.gerrit.extensions.restapi.RestApiException { listBranches.setLimit ( request.getLimit ( ) ) ; listBranches.setStart ( request.getStart ( ) ) ; listBranches.setMatchSubstring ( request.getSubstring ( ) ) ; listBranches.setMatchRegex ( request.getRegex ( ) ) ; try { return listBranches.apply ( checkExists ( ) ) ; } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( "Cannot list branches" , e ) ; } }

Target:
public java.util.List < com.google.gerrit.extensions.api.projects.BranchInfo > get ( ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return listBranches.request ( this ) . apply ( checkExists ( ) ) ; } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( "Cannot list branches" , e ) ; } }
Source:
public com.google.gerrit.reviewdb.client.PatchSet getBasePatchSet ( com.google.gerrit.server.edit.ChangeEdit edit , org.eclipse.jgit.revwalk.RevCommit commit ) throws java.io.IOException { org.eclipse.jgit.revwalk.RevCommit parentCommit = commit.getParent ( 0 ) ; com.google.gerrit.reviewdb.client.RevId parentRev = new com.google.gerrit.reviewdb.client.RevId ( org.eclipse.jgit.lib.ObjectId.toString ( parentCommit.getId ( ) ) ) ; try { return com.google.common.collect.Iterables.getOnlyElement ( db.get ( ) . patchSets ( ) . byRevision ( parentRev ) . toList ( ) ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new java.io.IOException ( e ) ; } }

Target:
public void delete ( com.google.gerrit.server.edit.ChangeEdit edit ) throws java.io.IOException { com.google.gerrit.reviewdb.client.Change change = edit.getChange ( ) ; org.eclipse.jgit.lib.Repository repo = gitManager.openRepository ( change.getProject ( ) ) ; try { com.google.gerrit.server.edit.ChangeEditUtil.deleteRef ( repo , edit ) ; } finally { repo.close ( ) ; } }
Source:
private static void updateCurrentPatchSet ( final com.google.gerrit.reviewdb.server.ReviewDb db , final com.google.gerrit.reviewdb.client.Change change , final com.google.gerrit.reviewdb.client.PatchSetInfo psInfo ) throws com.google.gwtorm.server.OrmException { db.changes ( ) . atomicUpdate ( change.getId ( ) , new com.google.gwtorm.server.AtomicUpdate < com.google.gerrit.reviewdb.client.Change > ( ) { @ java.lang.Override public com.google.gerrit.reviewdb.client.Change update ( com.google.gerrit.reviewdb.client.Change c ) { c.setCurrentPatchSet ( psInfo ) ; com.google.gerrit.server.ChangeUtil.updated ( c ) ; return c ; } } ) ; }

Target:
private static void updateChange ( final com.google.gerrit.reviewdb.server.ReviewDb db , final com.google.gerrit.reviewdb.client.Change change , final com.google.gerrit.reviewdb.client.PatchSetInfo psInfo ) throws com.google.gwtorm.server.OrmException { db.changes ( ) . atomicUpdate ( change.getId ( ) , new com.google.gwtorm.server.AtomicUpdate < com.google.gerrit.reviewdb.client.Change > ( ) { @ java.lang.Override public com.google.gerrit.reviewdb.client.Change update ( com.google.gerrit.reviewdb.client.Change c ) { if ( psInfo != null ) { c.setCurrentPatchSet ( psInfo ) ; } com.google.gerrit.server.ChangeUtil.updated ( c ) ; return c ; } } ) ; }
Source:
private java.util.List < com.google.gerrit.reviewdb.client.Comment > publishComments ( com.google.gerrit.server.update.ChangeContext ctx ) throws com.google.gwtorm.server.OrmException { java.util.List < com.google.gerrit.reviewdb.client.Comment > comments = commentsUtil.draftByChangeAuthor ( ctx.getDb ( ) , ctx.getNotes ( ) , ctx.getUser ( ) . getAccountId ( ) ) ; commentsUtil.publish ( ctx , patchSetId , comments , com.google.gerrit.server.ChangeMessagesUtil.TAG_UPLOADED_PATCH_SET ) ; return comments ; }

Target:
private java.util.List < com.google.gerrit.reviewdb.client.Comment > publishComments ( com.google.gerrit.server.update.ChangeContext ctx , boolean workInProgress ) throws com.google.gwtorm.server.OrmException { java.util.List < com.google.gerrit.reviewdb.client.Comment > comments = commentsUtil.draftByChangeAuthor ( ctx.getDb ( ) , ctx.getNotes ( ) , ctx.getUser ( ) . getAccountId ( ) ) ; commentsUtil.publish ( ctx , patchSetId , comments , com.google.gerrit.server.ChangeMessagesUtil.uploadedPatchSetTag ( workInProgress ) ) ; return comments ; }
Source:
public void customConflictMessageWithHostNameTest ( ) throws java.lang.Exception { com.googlesource.gerrit.plugins.automerger.FailedMergeException fme = new com.googlesource.gerrit.plugins.automerger.FailedMergeException ( failedMergeBranches , currentRevision , hostName , "${hostname}: ${conflict}" , topic ) ; java.lang.String branch1String = ( hostName ) + ": branch1 merge conflict" ; java.lang.String branch2String = ( hostName ) + ": branch2 merge conflict" ; java.lang.String branch3String = ( hostName ) + ": branch3 merge conflict" ; com.google.common.truth.Truth.assertThat ( fme.getDisplayString ( ) . split ( "\\n" ) ) . asList ( ) . containsExactly ( branch1String , branch2String , branch3String ) ; }

Target:
public void customConflictMessageWithHostNameTest ( ) throws java.lang.Exception { com.googlesource.gerrit.plugins.automerger.FailedMergeException fme = new com.googlesource.gerrit.plugins.automerger.FailedMergeException ( failedMergeBranches , currentRevision , hostName , projectName , changeNumber , patchsetNumber , "${hostname}: ${conflict}" , topic ) ; java.lang.String branch1String = ( hostName ) + ": branch1 merge conflict" ; java.lang.String branch2String = ( hostName ) + ": branch2 merge conflict" ; java.lang.String branch3String = ( hostName ) + ": branch3 merge conflict" ; com.google.common.truth.Truth.assertThat ( fme.getDisplayString ( ) . split ( "\\n" ) ) . asList ( ) . containsExactly ( branch1String , branch2String , branch3String ) ; }
Source:
protected void alias ( final com.google.gerrit.sshd.CommandName parent , final java.lang.String name , final java.lang.Class < ? extends com.google.gerrit.sshd.BaseCommand > clazz ) { com.google.gerrit.sshd.CommandMetaData meta = ( ( com.google.gerrit.sshd.CommandMetaData ) ( clazz.getAnnotation ( com.google.gerrit.sshd.CommandMetaData.class ) ) ) ; if ( meta == null ) { throw new java.lang.IllegalStateException ( "no CommandMetaData annotation found" ) ; } bind ( com.google.gerrit.sshd.Commands.key ( parent , name , meta.descr ( ) ) ) . to ( clazz ) ; }

Target:
private static java.lang.String description ( com.google.gerrit.sshd.CommandMetaData meta ) { return com.google.common.base.Objects.firstNonNull ( com.google.common.base.Strings.emptyToNull ( meta.description ( ) ) , meta.descr ( ) ) ; }
Source:
private void matchChange ( java.util.Set < com.google.gerrit.reviewdb.Change.Id > matched , com.google.gerrit.reviewdb.Change change ) { try { if ( ( ( change != null ) && ( inProject ( change ) ) ) && ( changeControlFactory.controlFor ( change ) . isVisible ( ) ) ) { matched.add ( change.getId ( ) ) ; } } catch ( com.google.gerrit.server.project.NoSuchChangeException e ) { } }

Target:
private void matchChange ( java.util.Set < com.google.gerrit.reviewdb.Change.Id > matched , com.google.gerrit.reviewdb.Change change ) { try { if ( ( ( change != null ) && ( inProject ( change ) ) ) && ( changeControlFactory.controlFor ( change ) . isVisible ( db ) ) ) { matched.add ( change.getId ( ) ) ; } } catch ( com.google.gerrit.server.project.NoSuchChangeException e ) { } catch ( com.google.gwtorm.client.OrmException e ) { com.google.gerrit.sshd.commands.SetReviewersCommand.log.warn ( ( "Error reading change " + ( change.getId ( ) ) ) , e ) ; } }
Source:
public java.util.List < com.google.gerrit.extensions.common.WebLinkInfo > getPatchSetLinks ( java.lang.String project , java.lang.String commit ) { java.util.List < com.google.gerrit.extensions.common.WebLinkInfo > links = new java.util.ArrayList < > ( 4 ) ; for ( com.google.gerrit.extensions.webui.PatchSetWebLink webLink : patchSetLinks ) { links.add ( new com.google.gerrit.extensions.common.WebLinkInfo ( webLink.getLinkName ( ) , webLink.getImageUrl ( ) , webLink.getPatchSetUrl ( project , commit ) , webLink.getTarget ( ) ) ) ; } return links ; }

Target:
public com.google.common.collect.FluentIterable < com.google.gerrit.extensions.common.WebLinkInfo > getPatchSetLinks ( final java.lang.String project , final java.lang.String commit ) { return filterLinks ( patchSetLinks , new com.google.common.base.Function < com.google.gerrit.extensions.webui.WebLink , com.google.gerrit.extensions.common.WebLinkInfo > ( ) { @ java.lang.Override public com.google.gerrit.extensions.common.WebLinkInfo apply ( com.google.gerrit.extensions.webui.WebLink webLink ) { return ( ( com.google.gerrit.extensions.webui.PatchSetWebLink ) ( webLink ) ) . getPathSetWebLink ( project , commit ) ; } } ) ; }
Source:
static com.google.gerrit.extensions.api.projects.DashboardInfo newDashboardInfo ( java.lang.String id ) { com.google.gerrit.extensions.api.projects.DashboardInfo info = new com.google.gerrit.extensions.api.projects.DashboardInfo ( ) ; java.util.List < java.lang.String > parts = com.google.common.collect.Lists.newArrayList ( com.google.common.base.Splitter.on ( ':' ) . limit ( 2 ) . split ( id ) ) ; if ( ( parts.size ( ) ) != 2 ) { throw new java.lang.IllegalArgumentException ( ) ; } info.id = id ; info.ref = parts.get ( 0 ) ; info.path = parts.get ( 1 ) ; return info ; }

Target:
static com.google.gerrit.extensions.api.projects.DashboardInfo newDashboardInfo ( java.lang.String id ) throws com.google.gerrit.server.project.DashboardsCollection.InvalidDashboardId { com.google.gerrit.extensions.api.projects.DashboardInfo info = new com.google.gerrit.extensions.api.projects.DashboardInfo ( ) ; java.util.List < java.lang.String > parts = com.google.common.collect.Lists.newArrayList ( com.google.common.base.Splitter.on ( ':' ) . limit ( 2 ) . split ( id ) ) ; if ( ( parts.size ( ) ) != 2 ) { throw new com.google.gerrit.server.project.DashboardsCollection.InvalidDashboardId ( id ) ; } info.id = id ; info.ref = parts.get ( 0 ) ; info.path = parts.get ( 1 ) ; return info ; }
Source:
private static < T > com.google.gerrit.server.index.FieldDef < T , ? > checkSame ( com.google.gerrit.server.index.FieldDef < T , ? > f1 , com.google.gerrit.server.index.FieldDef < T , ? > f2 ) { com.google.common.base.Preconditions.checkState ( ( f1 == f2 ) , "Mismatched %s fields: %s != %s" , f1.getName ( ) , f1 , f2 ) ; return f1 ; }

Target:
private static < T > com.google.gerrit.index.FieldDef < T , ? > checkSame ( com.google.gerrit.index.FieldDef < T , ? > f1 , com.google.gerrit.index.FieldDef < T , ? > f2 ) { com.google.common.base.Preconditions.checkState ( ( f1 == f2 ) , "Mismatched %s fields: %s != %s" , f1.getName ( ) , f1 , f2 ) ; return f1 ; }
Source:
private void status ( int sc ) { if ( sc == ( javax.servlet.http.HttpServletResponse.SC_UNAUTHORIZED ) ) { java.lang.StringBuilder v = new java.lang.StringBuilder ( ) ; v.append ( com.google.gerrit.httpd.ProjectOAuthFilter.LIT_BASIC ) ; v.append ( "realm=\"" ) . append ( com.google.gerrit.httpd.ProjectOAuthFilter.REALM_NAME ) . append ( "\"" ) ; setHeader ( com.google.gerrit.httpd.ProjectOAuthFilter.Response.WWW_AUTHENTICATE , v.toString ( ) ) ; } else if ( containsHeader ( com.google.gerrit.httpd.ProjectOAuthFilter.Response.WWW_AUTHENTICATE ) ) { setHeader ( com.google.gerrit.httpd.ProjectOAuthFilter.Response.WWW_AUTHENTICATE , null ) ; } }

Target:
private void status ( int sc ) { if ( sc == ( javax.servlet.http.HttpServletResponse.SC_UNAUTHORIZED ) ) { java.lang.StringBuilder v = new java.lang.StringBuilder ( ) ; v.append ( com.google.gerrit.httpd.ProjectOAuthFilter.BASIC ) ; v.append ( "realm=\"" ) . append ( com.google.gerrit.httpd.ProjectOAuthFilter.REALM_NAME ) . append ( "\"" ) ; setHeader ( com.google.gerrit.httpd.ProjectOAuthFilter.Response.WWW_AUTHENTICATE , v.toString ( ) ) ; } else if ( containsHeader ( com.google.gerrit.httpd.ProjectOAuthFilter.Response.WWW_AUTHENTICATE ) ) { setHeader ( com.google.gerrit.httpd.ProjectOAuthFilter.Response.WWW_AUTHENTICATE , null ) ; } }
Source:
public com.google.common.util.concurrent.ListeningExecutorService createChangeUpdateExecutor ( @ com.google.gerrit.server.config.GerritServerConfig org.eclipse.jgit.lib.Config config ) { int poolSize = config.getInt ( "receive" , null , "changeUpdateThreads" , 1 ) ; if ( poolSize <= 1 ) { return com.google.common.util.concurrent.MoreExecutors.sameThreadExecutor ( ) ; } return com.google.common.util.concurrent.MoreExecutors.listeningDecorator ( com.google.common.util.concurrent.MoreExecutors.getExitingExecutorService ( new java.util.concurrent.ThreadPoolExecutor ( 1 , poolSize , 10 , java.util.concurrent.TimeUnit.MINUTES , new java.util.concurrent.ArrayBlockingQueue < java.lang.Runnable > ( poolSize ) , new com.google.common.util.concurrent.ThreadFactoryBuilder ( ) . setNameFormat ( "ChangeUpdate-%d" ) . setDaemon ( true ) . build ( ) , new java.util.concurrent.ThreadPoolExecutor.CallerRunsPolicy ( ) ) ) ) ; }

Target:
public com.google.common.util.concurrent.ListeningExecutorService createChangeUpdateExecutor ( @ com.google.gerrit.server.config.GerritServerConfig org.eclipse.jgit.lib.Config config ) { int poolSize = config.getInt ( "receive" , null , "changeUpdateThreads" , 1 ) ; if ( poolSize <= 1 ) { return com.google.common.util.concurrent.MoreExecutors.newDirectExecutorService ( ) ; } return com.google.common.util.concurrent.MoreExecutors.listeningDecorator ( com.google.common.util.concurrent.MoreExecutors.getExitingExecutorService ( new java.util.concurrent.ThreadPoolExecutor ( 1 , poolSize , 10 , java.util.concurrent.TimeUnit.MINUTES , new java.util.concurrent.ArrayBlockingQueue < java.lang.Runnable > ( poolSize ) , new com.google.common.util.concurrent.ThreadFactoryBuilder ( ) . setNameFormat ( "ChangeUpdate-%d" ) . setDaemon ( true ) . build ( ) , new java.util.concurrent.ThreadPoolExecutor.CallerRunsPolicy ( ) ) ) ) ; }
Source:
public com.google.gerrit.reviewdb.client.PatchSetInfo createValue ( com.googlecode.prolog_cafe.lang.Prolog engine ) { com.google.gerrit.reviewdb.client.PatchSet.Id patchSetId = com.google.gerrit.rules.StoredValues.PATCH_SET_ID.get ( engine ) ; com.google.gerrit.rules.PrologEnvironment env = ( ( com.google.gerrit.rules.PrologEnvironment ) ( engine.control ) ) ; com.google.gerrit.server.patch.PatchSetInfoFactory patchInfoFactory = env.getInjector ( ) . getInstance ( com.google.gerrit.server.patch.PatchSetInfoFactory.class ) ; try { return patchInfoFactory.get ( com.google.gerrit.rules.StoredValues.REVIEW_DB.get ( engine ) , patchSetId ) ; } catch ( com.google.gerrit.server.patch.PatchSetInfoNotAvailableException e ) { throw new com.googlecode.prolog_cafe.lang.SystemException ( e.getMessage ( ) ) ; } }

Target:
public com.google.gerrit.reviewdb.client.PatchSetInfo createValue ( com.googlecode.prolog_cafe.lang.Prolog engine ) { com.google.gerrit.reviewdb.client.Change change = com.google.gerrit.rules.StoredValues.CHANGE.get ( engine ) ; com.google.gerrit.reviewdb.client.PatchSet ps = com.google.gerrit.rules.StoredValues.PATCH_SET.get ( engine ) ; com.google.gerrit.rules.PrologEnvironment env = ( ( com.google.gerrit.rules.PrologEnvironment ) ( engine.control ) ) ; com.google.gerrit.server.patch.PatchSetInfoFactory patchInfoFactory = env.getInjector ( ) . getInstance ( com.google.gerrit.server.patch.PatchSetInfoFactory.class ) ; try { return patchInfoFactory.get ( change , ps ) ; } catch ( com.google.gerrit.server.patch.PatchSetInfoNotAvailableException e ) { throw new com.googlecode.prolog_cafe.lang.SystemException ( e.getMessage ( ) ) ; } }
Source:
void scheduleFullSync ( final com.google.gerrit.reviewdb.client.Project.NameKey project , final java.lang.String urlMatch , com.googlesource.gerrit.plugins.replication.ReplicationState state ) { if ( ! ( running ) ) { com.googlesource.gerrit.plugins.replication.ReplicationQueue.stateLog.warn ( "Replication plugin did not finish startup before event" , state ) ; return ; } for ( com.googlesource.gerrit.plugins.replication.Destination cfg : config.getDestinations ( FilterType.ALL ) ) { if ( cfg.wouldPushProject ( project ) ) { for ( org.eclipse.jgit.transport.URIish uri : cfg.getURIs ( project , urlMatch ) ) { cfg.schedule ( project , PushOne.ALL_REFS , uri , state ) ; } } } }

Target:
void scheduleFullSync ( com.google.gerrit.reviewdb.client.Project.NameKey project , java.lang.String urlMatch , com.googlesource.gerrit.plugins.replication.ReplicationState state , boolean now ) { if ( ! ( running ) ) { stateLog.warn ( "Replication plugin did not finish startup before event" , state ) ; return ; } for ( com.googlesource.gerrit.plugins.replication.Destination cfg : config.getDestinations ( FilterType.ALL ) ) { if ( cfg.wouldPushProject ( project ) ) { for ( org.eclipse.jgit.transport.URIish uri : cfg.getURIs ( project , urlMatch ) ) { cfg.schedule ( project , PushOne.ALL_REFS , uri , state , now ) ; } } } }
Source:
public void run ( ) { com.google.gerrit.server.config.PluginConfig cfg = p.getConfig ( ) . getPluginConfig ( pluginName ) ; for ( java.lang.String name : cfg.getNames ( ) ) { installCommand ( p.getProject ( ) . getNameKey ( ) , name , cfg.getString ( name ) ) ; } }

Target:
public void run ( ) { for ( com.google.gerrit.reviewdb.client.Project.NameKey p : projectCache.all ( ) ) { com.google.gerrit.server.project.ProjectState projectState = projectCache.get ( p ) ; if ( projectState != null ) { com.google.gerrit.server.config.PluginConfig cfg = projectState.getConfig ( ) . getPluginConfig ( pluginName ) ; for ( java.lang.String name : cfg.getNames ( ) ) { installCommand ( projectState.getProject ( ) . getNameKey ( ) , name , cfg.getString ( name ) ) ; } } } }
Source:
public static com.google.gerrit.common.data.LabelType withDefaultValues ( java.lang.String name ) { com.google.gerrit.common.data.LabelType.checkName ( name ) ; java.util.List < com.google.gerrit.common.data.LabelValue > values = new java.util.ArrayList < > ( 2 ) ; values.add ( new com.google.gerrit.common.data.LabelValue ( ( ( short ) ( 0 ) ) , "Rejected" ) ) ; values.add ( new com.google.gerrit.common.data.LabelValue ( ( ( short ) ( 1 ) ) , "Approved" ) ) ; return new com.google.gerrit.common.data.LabelType ( name , values ) ; }

Target:
public static com.google.gerrit.common.data.LabelType withDefaultValuesDoNotCheckName ( java.lang.String name ) { java.util.List < com.google.gerrit.common.data.LabelValue > values = new java.util.ArrayList < > ( 2 ) ; values.add ( new com.google.gerrit.common.data.LabelValue ( ( ( short ) ( 0 ) ) , "Rejected" ) ) ; values.add ( new com.google.gerrit.common.data.LabelValue ( ( ( short ) ( 1 ) ) , "Approved" ) ) ; return new com.google.gerrit.common.data.LabelType ( name , values ) ; }
Source:
public void blockPushDraftsUnblockAdmin ( ) { com.google.gerrit.server.project.Util.block ( parent , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/drafts/*" ) ; com.google.gerrit.server.project.Util.allow ( parent , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.ADMIN , "refs/drafts/*" ) ; com.google.gerrit.server.project.ProjectControl u = user ( local ) ; com.google.gerrit.server.project.ProjectControl a = user ( local , "a" , com.google.gerrit.server.project.Util.ADMIN ) ; assertBlocked ( com.google.gerrit.common.data.Permission.PUSH , "refs/drafts/refs/heads/master" , u ) ; assertNotBlocked ( com.google.gerrit.common.data.Permission.PUSH , "refs/drafts/refs/heads/master" , a ) ; }

Target:
public void inheritRead_SingleBranchDoesNotOverrideInherited ( ) { com.google.gerrit.server.project.testing.Util.allow ( parent , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/*" ) ; com.google.gerrit.server.project.testing.Util.allow ( parent , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/for/refs/*" ) ; com.google.gerrit.server.project.testing.Util.allow ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/foobar" ) ; com.google.gerrit.server.project.ProjectControl u = user ( local ) ; assertCanUpload ( u ) ; assertCreateChange ( "refs/heads/master" , u ) ; assertCreateChange ( "refs/heads/foobar" , u ) ; }
Source:
public void onBrowserEvent ( final com.google.gwt.user.client.Event event ) { if ( ( ( com.google.gwt.user.client.DOM.eventGetType ( event ) ) == ( com.google.gwt.user.client.Event.ONCLICK ) ) && ( com.google.gerrit.client.ui.Hyperlink.impl.handleAsClick ( event ) ) ) { com.google.gwt.user.client.DOM.eventPreventDefault ( event ) ; go ( ) ; } else { super . onBrowserEvent ( event ) ; } }

Target:
public void onBrowserEvent ( final com.google.gwt.user.client.Event event ) { if ( ( ( com.google.gwt.user.client.DOM.eventGetType ( event ) ) == ( com.google.gwt.user.client.Event.ONCLICK ) ) && ( com.google.gerrit.client.ui.Hyperlink.impl.handleAsClick ( event ) ) ) { event.preventDefault ( ) ; go ( ) ; } else { super . onBrowserEvent ( event ) ; } }
Source:
public void onShowView ( ) { super . onShowView ( ) ; if ( ( cmA ) != null ) { cmA.refresh ( ) ; } if ( ( cmB ) != null ) { cmB.refresh ( ) ; } }

Target:
public void onShowView ( ) { super . onShowView ( ) ; if ( ( cmA ) != null ) { cmA.refresh ( ) ; } if ( ( cmB ) != null ) { cmB.refresh ( ) ; } com.google.gwt.user.client.Window.enableScrolling ( false ) ; com.google.gwt.core.client.Scheduler.get ( ) . scheduleDeferred ( new com.google.gwt.core.client.Scheduler.ScheduledCommand ( ) { @ java.lang.Override public void execute ( ) { for ( java.lang.Runnable r : resizeCallbacks ) { r.run ( ) ; } resizeCallbacks = null ; } } ) ; }
Source:
public com.google.gwtjsonrpc.common.VoidResult run ( com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { if ( ! ( diffPref.getAccountId ( ) . equals ( getAccountId ( ) ) ) ) { throw new java.lang.IllegalArgumentException ( ( ( ( ( "diffPref.getAccountId() " + ( diffPref.getAccountId ( ) ) ) + " doesn't match" ) + " the accountId of the signed in user " ) + ( getAccountId ( ) ) ) ) ; } db.accountDiffPreferences ( ) . upsert ( java.util.Collections.singleton ( diffPref ) ) ; return com.google.gwtjsonrpc.common.VoidResult.INSTANCE ; }

Target:
public com.google.gwtjsonrpc.common.VoidResult run ( com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { if ( ! ( getUser ( ) . isIdentifiedUser ( ) ) ) { throw new java.lang.IllegalArgumentException ( "Not authenticated" ) ; } com.google.gerrit.server.IdentifiedUser me = getUser ( ) . asIdentifiedUser ( ) ; try { setDiff.apply ( new com.google.gerrit.server.account.AccountResource ( me ) , diffPref ) ; } catch ( com.google.gerrit.extensions.restapi.AuthException | com.google.gerrit.extensions.restapi.BadRequestException | org.eclipse.jgit.errors.ConfigInvalidException | java.io.IOException e ) { throw new com.google.gwtorm.server.OrmException ( "Cannot save diff preferences" , e ) ; } return com.google.gwtjsonrpc.common.VoidResult.INSTANCE ; }
Source:
public java.lang.Iterable < com.google.gerrit.reviewdb.Project.NameKey > all ( ) { return getAllNameKeys ( ) ; }

Target:
public org.eclipse.jgit.lib.Repository openRepository ( com.google.gerrit.reviewdb.Project.NameKey name ) throws org.eclipse.jgit.errors.RepositoryNotFoundException { if ( isUnreasonableName ( name ) ) { throw new org.eclipse.jgit.errors.RepositoryNotFoundException ( ( "Invalid name: " + name ) ) ; } try { final org.eclipse.jgit.lib.RepositoryCache.FileKey loc = org.eclipse.jgit.lib.RepositoryCache.FileKey.lenient ( gitDirOf ( name ) , FS.DETECTED ) ; return org.eclipse.jgit.lib.RepositoryCache.open ( loc ) ; } catch ( java.io.IOException e1 ) { final org.eclipse.jgit.errors.RepositoryNotFoundException e2 ; e2 = new org.eclipse.jgit.errors.RepositoryNotFoundException ( ( "Cannot open repository " + name ) ) ; e2.initCause ( e1 ) ; throw e2 ; } }
Source:
public java.util.List < com.google.gerrit.server.git.CodeReviewCommit > reduceToMinimalMerge ( com.google.gerrit.server.git.MergeSorter mergeSorter , java.util.Collection < com.google.gerrit.server.git.CodeReviewCommit > toSort ) throws com.google.gerrit.server.git.MergeException { java.util.List < com.google.gerrit.server.git.CodeReviewCommit > result = new java.util.ArrayList < > ( ) ; try { result.addAll ( mergeSorter.sort ( toSort ) ) ; } catch ( java.io.IOException e ) { throw new com.google.gerrit.server.git.MergeException ( "Branch head sorting failed" , e ) ; } java.util.Collections.sort ( result , CodeReviewCommit.ORDER ) ; return result ; }

Target:
public java.util.List < com.google.gerrit.server.git.CodeReviewCommit > reduceToMinimalMerge ( com.google.gerrit.server.git.MergeSorter mergeSorter , java.util.Collection < com.google.gerrit.server.git.CodeReviewCommit > toSort ) throws com.google.gerrit.server.git.IntegrationException { java.util.List < com.google.gerrit.server.git.CodeReviewCommit > result = new java.util.ArrayList < > ( ) ; try { result.addAll ( mergeSorter.sort ( toSort ) ) ; } catch ( java.io.IOException e ) { throw new com.google.gerrit.server.git.IntegrationException ( "Branch head sorting failed" , e ) ; } java.util.Collections.sort ( result , CodeReviewCommit.ORDER ) ; return result ; }
Source:
public void onSuccess ( com.google.gerrit.client.config.ServerInfo info ) { com.google.gerrit.client.Gerrit.myServerInfo = info ; }

Target:
public void onSuccess ( com.google.gerrit.client.config.ServerInfo info ) { com.google.gerrit.client.Gerrit.myServerInfo = info ; java.lang.String du = info.gerrit ( ) . docUrl ( ) ; if ( ( du != null ) && ( ! ( du.isEmpty ( ) ) ) ) { com.google.gerrit.client.Gerrit.hasDocumentation = true ; com.google.gerrit.client.Gerrit.docUrl = du ; } }
Source:
public void start ( ) { if ( ! ( started ) ) { org.apache.log4j.Logger deleteLogger = org.apache.log4j.LogManager.getLogger ( com.googlesource.gerrit.plugins.deleteproject.DeleteLog.DELETE_LOG_NAME ) ; deleteLogger.removeAllAppenders ( ) ; deleteLogger.addAppender ( systemLog.createAsyncAppender ( deleteLogger.getName ( ) , new com.googlesource.gerrit.plugins.deleteproject.DeleteLogLayout ( ) ) ) ; deleteLogger.setAdditivity ( false ) ; started = true ; } }

Target:
public void start ( ) { if ( ! ( started ) ) { org.apache.log4j.Logger deleteLogger = org.apache.log4j.LogManager.getLogger ( com.googlesource.gerrit.plugins.deleteproject.DeleteLog.DELETE_LOG_NAME ) ; java.lang.String loggerName = deleteLogger.getName ( ) ; org.apache.log4j.AsyncAppender asyncAppender = systemLog.createAsyncAppender ( loggerName , new com.googlesource.gerrit.plugins.deleteproject.DeleteLogLayout ( ) ) ; deleteLogger.removeAppender ( loggerName ) ; deleteLogger.addAppender ( asyncAppender ) ; deleteLogger.setAdditivity ( false ) ; started = true ; } }
Source:
protected void configure ( ) { install ( new com.google.gerrit.extensions.restapi.RestApiModule ( ) { @ java.lang.Override protected void configure ( ) { get ( com.google.gerrit.server.project.ProjectResource.PROJECT_KIND , "lfs:config-project" ) . to ( com.googlesource.gerrit.plugins.lfs.GetLfsProjectConfig.class ) ; get ( com.google.gerrit.server.project.ProjectResource.PROJECT_KIND , "lfs:config-global" ) . to ( com.googlesource.gerrit.plugins.lfs.GetLfsGlobalConfig.class ) ; put ( com.google.gerrit.server.project.ProjectResource.PROJECT_KIND , "lfs:config-global" ) . to ( com.googlesource.gerrit.plugins.lfs.PutLfsGlobalConfig.class ) ; } } ) ; factory ( S3LargeFileRepository.Factory.class ) ; factory ( LocalLargeFileRepository.Factory.class ) ; }

Target:
protected void configure ( ) { install ( new com.google.gerrit.extensions.restapi.RestApiModule ( ) { @ java.lang.Override protected void configure ( ) { get ( com.google.gerrit.server.project.ProjectResource.PROJECT_KIND , "lfs:config-project" ) . to ( com.googlesource.gerrit.plugins.lfs.GetLfsProjectConfig.class ) ; get ( com.google.gerrit.server.project.ProjectResource.PROJECT_KIND , "lfs:config-global" ) . to ( com.googlesource.gerrit.plugins.lfs.GetLfsGlobalConfig.class ) ; put ( com.google.gerrit.server.project.ProjectResource.PROJECT_KIND , "lfs:config-global" ) . to ( com.googlesource.gerrit.plugins.lfs.PutLfsGlobalConfig.class ) ; } } ) ; factory ( S3LargeFileRepository.Factory.class ) ; factory ( LocalLargeFileRepository.Factory.class ) ; factory ( LfsFsContentServlet.Factory.class ) ; }
Source:
public void onChangeRestored ( com.google.gerrit.extensions.events.ChangeRestoredListener.Event ev ) { try { hooks.doChangeRestoredHook ( getChange ( ev.getChange ( ) ) , getAccount ( ev.getRestorer ( ) ) , getPatchSet ( ev.getRevision ( ) ) , ev.getReason ( ) , db.get ( ) ) ; } catch ( com.google.gwtorm.server.OrmException e ) { com.google.gerrit.common.ChangeHookApiListener.log.error ( ( "ChangeRestored hook failed to run " + ( ev.getChange ( ) . _number ) ) , e ) ; } }

Target:
public void onChangeRestored ( com.google.gerrit.extensions.events.ChangeRestoredListener.Event ev ) { try { com.google.gerrit.server.notedb.ChangeNotes notes = getNotes ( ev.getChange ( ) ) ; hooks.doChangeRestoredHook ( notes.getChange ( ) , getAccount ( ev.getRestorer ( ) ) , getPatchSet ( notes , ev.getRevision ( ) ) , ev.getReason ( ) , db.get ( ) ) ; } catch ( com.google.gwtorm.server.OrmException e ) { com.google.gerrit.common.ChangeHookApiListener.log.error ( ( "ChangeRestored hook failed to run " + ( ev.getChange ( ) . _number ) ) , e ) ; } }
Source:
public static com.google.gitiles.BaseServlet notFoundServlet ( ) { return new com.google.gitiles.BaseServlet ( null ) { private static final long serialVersionUID = 1L ; @ java.lang.Override public void service ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse res ) { res.setStatus ( javax.servlet.http.HttpServletResponse.SC_NOT_FOUND ) ; } } ; }

Target:
public static com.google.gitiles.BaseServlet notFoundServlet ( ) { return new com.google.gitiles.BaseServlet ( new org.eclipse.jgit.lib.Config ( ) , null ) { private static final long serialVersionUID = 1L ; @ java.lang.Override public void service ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse res ) { res.setStatus ( javax.servlet.http.HttpServletResponse.SC_NOT_FOUND ) ; } } ; }
Source:
public void onPreMerge ( org.eclipse.jgit.lib.Repository repo , com.google.gerrit.server.git.CodeReviewCommit commit , com.google.gerrit.server.project.ProjectState destProject , com.google.gerrit.reviewdb.client.Branch.NameKey destBranch , com.google.gerrit.reviewdb.client.PatchSet.Id patchSetId , com.google.gerrit.server.IdentifiedUser caller ) throws com.google.gerrit.server.git.validators.MergeValidationException { if ( ( ! ( allUsersName.equals ( destProject.getNameKey ( ) ) ) ) || ( ( ! ( destBranch.get ( ) . startsWith ( RefNames.REFS_GROUPS ) ) ) && ( ! ( destBranch.get ( ) . equals ( RefNames.REFS_GROUPNAMES ) ) ) ) ) { return ; } throw new com.google.gerrit.server.git.validators.MergeValidationException ( "group update not allowed" ) ; }

Target:
public void onPreMerge ( org.eclipse.jgit.lib.Repository repo , com.google.gerrit.server.git.CodeReviewCommit commit , com.google.gerrit.server.project.ProjectState destProject , com.google.gerrit.reviewdb.client.Branch.NameKey destBranch , com.google.gerrit.reviewdb.client.PatchSet.Id patchSetId , com.google.gerrit.server.IdentifiedUser caller ) throws com.google.gerrit.server.git.validators.MergeValidationException { if ( ( ! ( allUsersName.equals ( destProject.getNameKey ( ) ) ) ) || ( ! ( com.google.gerrit.reviewdb.client.RefNames.isGroupRef ( destBranch.get ( ) ) ) ) ) { return ; } throw new com.google.gerrit.server.git.validators.MergeValidationException ( "group update not allowed" ) ; }
Source:
private com.google.inject.Injector createWebInjector ( ) { final java.util.List < com.google.inject.Module > modules = new java.util.ArrayList < com.google.inject.Module > ( ) ; modules.add ( sshInjector.getInstance ( com.google.gerrit.httpd.WebModule.class ) ) ; modules.add ( sshInjector.getInstance ( com.google.gerrit.httpd.WebSshGlueModule.class ) ) ; modules.add ( com.google.gerrit.httpd.CacheBasedWebSession.module ( ) ) ; return sysInjector.createChildInjector ( modules ) ; }

Target:
private com.google.inject.Injector createWebInjector ( ) { final java.util.List < com.google.inject.Module > modules = new java.util.ArrayList < com.google.inject.Module > ( ) ; modules.add ( sshInjector.getInstance ( com.google.gerrit.httpd.WebModule.class ) ) ; modules.add ( sysInjector.getInstance ( com.google.gerrit.httpd.GitOverHttpModule.class ) ) ; modules.add ( sshInjector.getInstance ( com.google.gerrit.httpd.WebSshGlueModule.class ) ) ; modules.add ( com.google.gerrit.httpd.CacheBasedWebSession.module ( ) ) ; return sysInjector.createChildInjector ( modules ) ; }
Source:
private static void publish ( java.lang.String token ) { 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 ( ) { java.lang.String p = "change,publish," ; if ( token.startsWith ( p ) ) return new com.google.gerrit.client.changes.PublishCommentScreen ( PatchSet.Id.parse ( com.google.gerrit.client.Dispatcher.skip ( p , token ) ) ) ; return new com.google.gerrit.client.NotFoundScreen ( ) ; } } . onSuccess ( ) ; }

Target:
private static java.lang.String legacyPatch ( java.lang.String token ) { if ( com.google.gerrit.client.Dispatcher.matchPrefix ( "patch,sidebyside," , token ) ) { return com.google.gerrit.client.Dispatcher.toPatchSideBySide ( Patch.Key.parse ( com.google.gerrit.client.Dispatcher.skip ( token ) ) ) ; } if ( com.google.gerrit.client.Dispatcher.matchPrefix ( "patch,unified," , token ) ) { return com.google.gerrit.client.Dispatcher.toPatchUnified ( Patch.Key.parse ( com.google.gerrit.client.Dispatcher.skip ( token ) ) ) ; } return null ; }
Source:
public void customLabelMaxWithBlock_NegativeVoteBlock ( ) throws java.lang.Exception { saveLabelConfig ( ) ; com.google.gerrit.acceptance.rest.change.ChangeInfo c = get ( disliked ( change ( ) ) ) ; com.google.gerrit.server.change.ChangeJson.LabelInfo q = c.labels.get ( Q.getName ( ) ) ; org.junit.Assert.assertEquals ( 1 , q.all.size ( ) ) ; org.junit.Assert.assertNull ( q.disliked ) ; org.junit.Assert.assertNotNull ( q.rejected ) ; }

Target:
public void customLabelMaxWithBlock_NegativeVoteBlock ( ) throws java.lang.Exception { saveLabelConfig ( ) ; com.google.gerrit.acceptance.rest.change.ChangeInfo c = get ( disliked ( change ( ) ) ) ; com.google.gerrit.server.change.ChangeJson.LabelInfo q = c.labels.get ( Q.getName ( ) ) ; org.junit.Assert.assertEquals ( 1 , q.all.size ( ) ) ; org.junit.Assert.assertNull ( q.disliked ) ; org.junit.Assert.assertNotNull ( q.rejected ) ; org.junit.Assert.assertTrue ( q.blocking ) ; }
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 testUpsertOneExisting ( ) throws com.google.gwtorm.server.OrmException , java.sql.SQLException { java.sql.PreparedStatement update = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.TestJdbcAccess.UPDATE , 1 ) ; java.sql.PreparedStatement insert = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.TestJdbcAccess.INSERT ) ; createClassUnderTest ( ) . upsert ( oneRow ) ; com.google.gwtorm.jdbc.TestJdbcAccess.assertUsedBatchingOnly ( update ) ; com.google.gwtorm.jdbc.TestJdbcAccess.assertNotUsed ( insert ) ; }
Source:
private void setMerged ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx , com.google.gerrit.reviewdb.client.ChangeMessage msg ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.Change c = ctx.getChange ( ) ; com.google.gerrit.reviewdb.server.ReviewDb db = ctx.getDb ( ) ; logDebug ( "Setting change merged" , c.getId ( ) ) ; c.setStatus ( Change.Status.MERGED ) ; c.setSubmissionId ( args.submissionId ) ; if ( msg != null ) { args.cmUtil.addChangeMessage ( db , ctx.getUpdate ( msg.getPatchSetId ( ) ) , msg ) ; } }

Target:
private void setMerged ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx , com.google.gerrit.reviewdb.client.ChangeMessage msg ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.Change c = ctx.getChange ( ) ; com.google.gerrit.reviewdb.server.ReviewDb db = ctx.getDb ( ) ; logDebug ( "Setting change merged" , c.getId ( ) ) ; c.setStatus ( Change.Status.MERGED ) ; c.setSubmissionId ( args.submissionId.toStringForStorage ( ) ) ; if ( msg != null ) { args.cmUtil.addChangeMessage ( db , ctx.getUpdate ( msg.getPatchSetId ( ) ) , msg ) ; } }
Source:
protected void add ( final com.google.gerrit.server.mail.RecipientType rt , final com.google.gerrit.client.reviewdb.Account.Id to ) { if ( rcptTo.add ( to ) ) { add ( rt , toAddress ( to ) ) ; } }

Target:
protected void add ( final com.google.gerrit.server.mail.RecipientType rt , final com.google.gerrit.client.reviewdb.Account.Id to ) { if ( ( ! ( rcptTo.contains ( to ) ) ) && ( isVisibleTo ( to ) ) ) { rcptTo.add ( to ) ; add ( rt , toAddress ( to ) ) ; } }
Source:
private void addMessage ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx , com.google.gerrit.server.notedb.ChangeUpdate update , com.google.gerrit.reviewdb.client.Account deleted ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.ChangeMessage cmsg = com.google.gerrit.server.ChangeMessagesUtil.newMessage ( ctx , ( "Assignee deleted: " + ( deleted.getName ( anonymousCowardName ) ) ) ) ; cmUtil.addChangeMessage ( ctx.getDb ( ) , update , cmsg ) ; }

Target:
private void addMessage ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx , com.google.gerrit.server.notedb.ChangeUpdate update , com.google.gerrit.reviewdb.client.Account deleted ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.ChangeMessage cmsg = com.google.gerrit.server.ChangeMessagesUtil.newMessage ( ctx , ( "Assignee deleted: " + ( deleted.getName ( anonymousCowardName ) ) ) , ChangeMessagesUtil.TAG_DELETE_ASSIGNEE ) ; cmUtil.addChangeMessage ( ctx.getDb ( ) , update , cmsg ) ; }