auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void setSubmitType ( final com.google.gerrit.reviewdb.Project.SubmitType newSubmitType ) { if ( ( submitType ) != null ) { for ( int i = 0 ; i < ( submitType.getItemCount ( ) ) ; i ++ ) { if ( newSubmitType.name ( ) . equals ( submitType.getValue ( i ) ) ) { submitType.setSelectedIndex ( i ) ; return ; } } submitType.setSelectedIndex ( ( - 1 ) ) ; } }

Target:
private void setEnabledForUseContentMerge ( ) { if ( SubmitType.FAST_FORWARD_ONLY.equals ( Project.SubmitType.valueOf ( submitType.getValue ( submitType.getSelectedIndex ( ) ) ) ) ) { useContentMerge.setEnabled ( false ) ; useContentMerge.setValue ( false ) ; } else { useContentMerge.setEnabled ( true ) ; } }
Source:
void setEdit ( boolean edit ) { if ( edit ) { setOpen ( true ) ; removeStyleName ( draftStyle.view ( ) ) ; addStyleName ( draftStyle.edit ( ) ) ; editArea.setText ( contentPanelMessage.getText ( ) ) ; editArea.setFocus ( true ) ; } else { removeStyleName ( draftStyle.edit ( ) ) ; addStyleName ( draftStyle.view ( ) ) ; } resizePaddingWidget ( ) ; }

Target:
void setEdit ( boolean edit ) { if ( edit ) { setOpen ( true ) ; removeStyleName ( draftStyle.view ( ) ) ; addStyleName ( draftStyle.edit ( ) ) ; editArea.setText ( getOriginal ( ) . message ( ) ) ; expandText ( ) ; editArea.setFocus ( true ) ; disableClickFocusHandler ( ) ; } else { expandTimer.cancel ( ) ; removeStyleName ( draftStyle.edit ( ) ) ; addStyleName ( draftStyle.view ( ) ) ; enableClickFocusHandler ( ) ; } resizePaddingWidget ( ) ; }
Source:
public boolean equals ( final java.lang.Object o ) { return ( ( o instanceof com.google.gerrit.client.reviewdb.StarredChange.Key ) && ( ( ( com.google.gerrit.client.reviewdb.StarredChange.Key ) ( o ) ) . accountId.equals ( accountId ) ) ) && ( ( ( com.google.gerrit.client.reviewdb.StarredChange.Key ) ( o ) ) . changeId.equals ( changeId ) ) ; }

Target:
public com.google.gerrit.client.reviewdb.com.google.gwtorm [ ] members ( ) { return new com.google.gwtorm.client.Key < ? > [ ] { changeId } ; }
Source:
public void testAppend_int ( ) { final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder b = new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) ; assertSame ( b , b.append ( 4 ) ) ; assertSame ( b , b.append ( 2 ) ) ; assertSame ( b , b.append ( ( - 100 ) ) ) ; assertEquals ( "42-100" , b.asString ( ) ) ; }

Target:
public void testAppend_long ( ) { final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder b = new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) ; org.junit.Assert.assertSame ( b , b.append ( 4L ) ) ; org.junit.Assert.assertSame ( b , b.append ( 2L ) ) ; org.junit.Assert.assertEquals ( "42" , b.asString ( ) ) ; }
Source:
public static java.nio.file.FileSystem getDistributionArchiveFileSystem ( ) throws java.io.FileNotFoundException , java.io.IOException { com.google.gerrit.launcher.GerritLauncher.getDistributionArchive ( ) ; return com.google.gerrit.launcher.GerritLauncher.myArchiveFs ; }

Target:
public static synchronized java.nio.file.FileSystem getZipFileSystem ( java.nio.file.Path zip ) throws java.io.IOException { zip = zip.toRealPath ( ) ; java.nio.file.FileSystem zipFs = com.google.gerrit.launcher.GerritLauncher.zipFileSystems.get ( zip ) ; if ( zipFs == null ) { zipFs = java.nio.file.FileSystems.newFileSystem ( java.net.URI.create ( ( "jar:" + ( zip.toUri ( ) ) ) ) , java.util.Collections.< java.lang.String , java.lang.String > emptyMap ( ) ) ; com.google.gerrit.launcher.GerritLauncher.zipFileSystems.put ( zip , zipFs ) ; } return zipFs ; }
Source:
private com.google.gerrit.server.git.TagSet build ( org.eclipse.jgit.lib.Repository db ) { synchronized ( buildLock ) { com.google.gerrit.server.git.TagSet tags = this . tags ; if ( tags == null ) { tags = new com.google.gerrit.server.git.TagSet ( projectName ) ; tags.build ( db , null , null ) ; this . tags = tags ; } return tags ; } }

Target:
private com.google.gerrit.server.git.TagSet build ( com.google.gerrit.server.git.TagCache cache , org.eclipse.jgit.lib.Repository db ) { synchronized ( buildLock ) { com.google.gerrit.server.git.TagSet tags = this . tags ; if ( tags == null ) { tags = new com.google.gerrit.server.git.TagSet ( projectName ) ; tags.build ( db , null , null ) ; this . tags = tags ; cache.put ( projectName , this ) ; } return tags ; } }
Source:
public void commentOnReviewableWipChangeByBot ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableWipChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; com.google.gerrit.acceptance.TestAccount bot = sc.testAccount ( "bot" ) ; review ( bot , sc.changeId , com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy.ENABLED , null , "tag" ) ; assertThat ( sender ) . sent ( "comment" , sc ) . to ( sc.owner ) . notTo ( sc.reviewer , sc.ccer ) . notTo ( sc.reviewerByEmail , sc.ccerByEmail ) . notTo ( sc.starrer ) . notTo ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; }

Target:
public void commentOnWipChangeByBot ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageWipChange ( ) ; com.google.gerrit.acceptance.TestAccount bot = sc.testAccount ( "bot" ) ; review ( bot , sc.changeId , com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy.ENABLED , null , "tag" ) ; assertThat ( sender ) . sent ( "comment" , sc ) . to ( sc.owner ) . noOneElse ( ) ; }
Source:
public boolean accept ( java.io.File pathname ) { java.lang.String n = pathname.getName ( ) ; return ( ( n.endsWith ( ".jar" ) ) || ( n.endsWith ( ".jar.disabled" ) ) ) && ( pathname.isFile ( ) ) ; }

Target:
public boolean accept ( java.io.File pathname ) { java.lang.String n = pathname.getName ( ) ; return ( ( ( ( com.google.gerrit.server.plugins.PluginLoader.isJarPlugin ( n ) ) || ( com.google.gerrit.server.plugins.PluginLoader.isJsPlugin ( n ) ) ) && ( ! ( n.startsWith ( ".last_" ) ) ) ) && ( ! ( n.startsWith ( ".next_" ) ) ) ) && ( pathname.isFile ( ) ) ; }
Source:
public java.lang.String apply ( com.google.gerrit.reviewdb.client.AccountGroup.UUID id ) { return id.get ( ) ; }

Target:
private void addIncludedGroups ( com.google.gerrit.server.group.GroupResource rsrc ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gwtorm.server.OrmException { com.google.gerrit.server.group.AddIncludedGroups.Input input = AddIncludedGroups.Input.fromGroups ( initialGroups.stream ( ) . map ( com.google.gerrit.reviewdb.client.AccountGroup.UUID :: get ) . collect ( java.util.stream.Collectors.toList ( ) ) ) ; addIncludedGroups.apply ( rsrc , input ) ; }
Source:
private java.lang.String format ( final com.google.gerrit.server.git.WorkQueue.Task < ? > task ) { java.lang.String s = task.toString ( ) ; if ( ( s.length ( ) ) < ( taskNameWidth ) ) { return s ; } else { return s.substring ( 0 , taskNameWidth ) ; } }

Target:
public int compare ( com.google.gerrit.sshd.commands.ShowQueue.QueueTaskInfo a , com.google.gerrit.sshd.commands.ShowQueue.QueueTaskInfo b ) { if ( ( a.state ) != ( b.state ) ) { return ( a.state.ordinal ( ) ) - ( b.state.ordinal ( ) ) ; } int cmp = java.lang.Long.signum ( ( ( a.delayMillis ) - ( b.delayMillis ) ) ) ; if ( cmp != 0 ) { return cmp ; } return a.getTaskString ( taskNameWidth ) . compareTo ( b.getTaskString ( taskNameWidth ) ) ; }
Source:
public com.google.gerrit.server.change.ConsistencyChecker.Result check ( com.google.gerrit.server.query.change.ChangeData cd ) { return check ( cd , null ) ; }

Target:
public com.google.gerrit.server.change.ConsistencyChecker.Result check ( com.google.gerrit.server.project.ChangeControl cc , @ com.google.gerrit.common.Nullable com.google.gerrit.extensions.api.changes.FixInput f ) { com.google.common.base.Preconditions.checkNotNull ( cc ) ; try { reset ( ) ; ctl = cc ; fix = f ; checkImpl ( ) ; return result ( ) ; } finally { if ( ( rw ) != null ) { rw.close ( ) ; } if ( ( repo ) != null ) { repo.close ( ) ; } } }
Source:
public void go ( ) { if ( ( com.google.gerrit.client.Gerrit.patchScreen ) != null ) { com.google.gerrit.client.Gerrit.patchScreen.setTopView ( PatchScreen.TopView.MAIN ) ; if ( type == ( com.google.gerrit.client.Gerrit.patchScreen.getPatchScreenType ( ) ) ) { com.google.gwt.dom.client.AnchorElement.as ( getElement ( ) ) . blur ( ) ; } else { new com.google.gerrit.client.ui.PatchLink ( "" , type , com.google.gerrit.client.Gerrit.patchScreen ) . go ( ) ; } } }

Target:
public void go ( ) { if ( ( com.google.gerrit.client.Gerrit.projectKey ) != null ) { com.google.gerrit.client.Gerrit.display ( com.google.gerrit.client.Dispatcher.toProjectAdmin ( com.google.gerrit.client.Gerrit.projectKey , panel ) ) ; } com.google.gwt.dom.client.AnchorElement.as ( getElement ( ) ) . blur ( ) ; }
Source:
public static com.google.gerrit.reviewdb.client.Account.Id fromRef ( java.lang.String name ) { if ( name == null ) { return null ; } if ( name.startsWith ( com.google.gerrit.reviewdb.client.RefNames.REFS_USER ) ) { return com.google.gerrit.reviewdb.client.Account.Id.fromRefPart ( name.substring ( com.google.gerrit.reviewdb.client.RefNames.REFS_USER.length ( ) ) ) ; } return null ; }

Target:
public static com.google.gerrit.reviewdb.client.Account.Id fromRef ( java.lang.String name ) { if ( name == null ) { return null ; } if ( name.startsWith ( com.google.gerrit.reviewdb.client.RefNames.REFS_USERS ) ) { return com.google.gerrit.reviewdb.client.Account.Id.fromRefPart ( name.substring ( com.google.gerrit.reviewdb.client.RefNames.REFS_USERS.length ( ) ) ) ; } return null ; }
Source:
public void rescheduleOnRecoverableException ( ) throws java.io.IOException { org.mockito.Mockito.when ( session.post ( com.googlesource.gerrit.plugins.webhooks.PostTaskTest.WEBHOOK_URL , com.googlesource.gerrit.plugins.webhooks.PostTaskTest.BODY ) ) . thenThrow ( java.io.IOException.class ) ; task.run ( ) ; org.mockito.Mockito.verify ( executor , org.mockito.Mockito.times ( 1 ) ) . schedule ( task , com.googlesource.gerrit.plugins.webhooks.PostTaskTest.RETRY_INTERVAL , java.util.concurrent.TimeUnit.MILLISECONDS ) ; }

Target:
public void rescheduleOnRecoverableException ( ) throws java.io.IOException { org.mockito.Mockito.when ( session.post ( org.mockito.ArgumentMatchers.eq ( com.googlesource.gerrit.plugins.webhooks.PostTaskTest.WEBHOOK_URL ) , org.mockito.ArgumentMatchers.eq ( content ) ) ) . thenThrow ( java.io.IOException.class ) ; task.run ( ) ; org.mockito.Mockito.verify ( executor , org.mockito.Mockito.times ( 1 ) ) . schedule ( task , com.googlesource.gerrit.plugins.webhooks.PostTaskTest.RETRY_INTERVAL , java.util.concurrent.TimeUnit.MILLISECONDS ) ; }
Source:
public void banCommit_Forbidden ( ) throws java.lang.Exception { com.google.gerrit.acceptance.RestResponse r = userSession.put ( ( ( "/projects/" + ( project.get ( ) ) ) + "/ban/" ) , BanCommit.Input.fromCommits ( "a8a477efffbbf3b44169bb9a1d3a334cbbd9aa96" ) ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( HttpStatus.SC_FORBIDDEN ) ; }

Target:
public void banCommit_Forbidden ( ) throws java.lang.Exception { userSession.put ( ( ( "/projects/" + ( project.get ( ) ) ) + "/ban/" ) , BanCommit.Input.fromCommits ( "a8a477efffbbf3b44169bb9a1d3a334cbbd9aa96" ) ) . assertForbidden ( ) ; }
Source:
public static int findApproval ( com.googlecode.prolog_cafe.lang.Prolog engine , int minVoteLevel ) { try { com.google.gerrit.server.query.change.ChangeData changeData = StoredValues.CHANGE_DATA.get ( engine ) ; org.eclipse.jgit.lib.Repository repository = StoredValues.REPOSITORY.get ( engine ) ; return new com.googlesource.gerrit.plugins.findowners.Checker ( repository , changeData , minVoteLevel ) . findApproval ( ) ; } catch ( com.google.gwtorm.server.OrmException e ) { com.googlesource.gerrit.plugins.findowners.Checker.log.error ( "Exception" , e ) ; return 0 ; } }

Target:
public static int findApproval ( com.googlecode.prolog_cafe.lang.Prolog engine , int minVoteLevel ) { try { com.google.gerrit.server.account.AccountCache accountCache = StoredValues.ACCOUNT_CACHE.get ( engine ) ; com.google.gerrit.server.query.change.ChangeData changeData = StoredValues.CHANGE_DATA.get ( engine ) ; org.eclipse.jgit.lib.Repository repository = StoredValues.REPOSITORY.get ( engine ) ; return new com.googlesource.gerrit.plugins.findowners.Checker ( repository , changeData , minVoteLevel ) . findApproval ( accountCache ) ; } catch ( com.google.gwtorm.server.OrmException e ) { com.googlesource.gerrit.plugins.findowners.Checker.log.error ( "Exception" , e ) ; return 0 ; } }
Source:
public com.google.gerrit.server.patch.IntraLineDiff get ( org.eclipse.jgit.lib.ObjectId aId , com.google.gerrit.server.patch.Text aText , org.eclipse.jgit.lib.ObjectId bId , com.google.gerrit.server.patch.Text bText , java.util.List < org.eclipse.jgit.diff.Edit > edits ) { if ( computeIntraline ) { com.google.gerrit.server.patch.IntraLineDiffKey key = new com.google.gerrit.server.patch.IntraLineDiffKey ( aId , aText , bId , bText , edits ) ; return intraCache.get ( key ) ; } else { return null ; } }

Target:
public com.google.gerrit.server.patch.IntraLineDiff getIntraLineDiff ( org.eclipse.jgit.lib.ObjectId aId , com.google.gerrit.server.patch.Text aText , org.eclipse.jgit.lib.ObjectId bId , com.google.gerrit.server.patch.Text bText , java.util.List < org.eclipse.jgit.diff.Edit > edits ) { if ( computeIntraline ) { com.google.gerrit.server.patch.IntraLineDiffKey key = new com.google.gerrit.server.patch.IntraLineDiffKey ( aId , aText , bId , bText , edits ) ; return intraCache.get ( key ) ; } else { return null ; } }
Source:
private static java.lang.String oldFileName ( final com.google.gerrit.server.patch.DiffCacheKey key , final org.spearce.jgit.patch.FileHeader fh ) { if ( fh != null ) { if ( ( org.spearce.jgit.lib.FileMode.MISSING ) == ( fh.getOldMode ( ) ) ) { return null ; } if ( FileHeader.DEV_NULL.equals ( fh.getOldName ( ) ) ) { return null ; } return fh.getOldName ( ) ; } if ( ( key.getSourceFileName ( ) ) != null ) { return key.getSourceFileName ( ) ; } return key.getFileName ( ) ; }

Target:
private static java.lang.String oldName ( final com.google.gerrit.server.patch.PatchListEntry entry ) { switch ( entry.getChangeType ( ) ) { case ADDED : return null ; case DELETED : case MODIFIED : return entry.getNewName ( ) ; case COPIED : case RENAMED : default : return entry.getOldName ( ) ; } }
Source:
public com.google.gerrit.extensions.api.projects.ConfigInfo apply ( com.google.gerrit.server.project.ProjectResource rsrc , com.google.gerrit.extensions.api.projects.ConfigInput input ) throws com.google.gerrit.extensions.restapi.BadRequestException , com.google.gerrit.extensions.restapi.ResourceConflictException , com.google.gerrit.extensions.restapi.ResourceNotFoundException { if ( ! ( rsrc.getControl ( ) . isOwner ( ) ) ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( rsrc.getName ( ) ) ; } return apply ( rsrc.getControl ( ) , input ) ; }

Target:
public com.google.gerrit.extensions.api.projects.ConfigInfo apply ( com.google.gerrit.server.project.ProjectResource rsrc , com.google.gerrit.extensions.api.projects.ConfigInput input ) throws com.google.gerrit.extensions.restapi.RestApiException { if ( ! ( rsrc.getControl ( ) . isOwner ( ) ) ) { throw new com.google.gerrit.extensions.restapi.AuthException ( "restricted to project owner" ) ; } return apply ( rsrc.getControl ( ) , input ) ; }
Source:
protected void configure ( ) { bind ( java.util.concurrent.Executor.class ) . annotatedWith ( com.ericsson.gerrit.plugins.highavailability.cache.CacheExecutor.class ) . toProvider ( com.ericsson.gerrit.plugins.highavailability.cache.CacheExecutorProvider.class ) ; listener ( ) . to ( com.ericsson.gerrit.plugins.highavailability.cache.CacheExecutorProvider.class ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.server.cache.CacheRemovalListener.class ) . to ( com.ericsson.gerrit.plugins.highavailability.cache.CacheEvictionHandler.class ) ; }

Target:
protected void configure ( ) { bind ( java.util.concurrent.Executor.class ) . annotatedWith ( com.ericsson.gerrit.plugins.highavailability.cache.CacheExecutor.class ) . toProvider ( com.ericsson.gerrit.plugins.highavailability.cache.CacheExecutorProvider.class ) ; listener ( ) . to ( com.ericsson.gerrit.plugins.highavailability.cache.CacheExecutorProvider.class ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.server.cache.CacheRemovalListener.class ) . to ( com.ericsson.gerrit.plugins.highavailability.cache.CacheEvictionHandler.class ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.extensions.events.NewProjectCreatedListener.class ) . to ( com.ericsson.gerrit.plugins.highavailability.cache.ProjectListUpdateHandler.class ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.extensions.events.ProjectDeletedListener.class ) . to ( com.ericsson.gerrit.plugins.highavailability.cache.ProjectListUpdateHandler.class ) ; }
Source:
public PerThreadRequestScope.Scoper provideScoper ( final com.google.gerrit.server.git.PerThreadRequestScope.Propagator propagator ) { final com.google.gerrit.server.util.RequestContext requestContext = new com.google.gerrit.server.util.RequestContext ( ) { @ java.lang.Override public com.google.gerrit.server.CurrentUser getCurrentUser ( ) { return remoteUser ; } } ; return new com.google.gerrit.server.git.PerThreadRequestScope.Scoper ( ) { @ java.lang.Override public < T > java.util.concurrent.Callable < T > scope ( java.util.concurrent.Callable < T > callable ) { return propagator.scope ( requestContext , callable ) ; } } ; }

Target:
public com.google.inject.Provider < com.google.gerrit.reviewdb.server.ReviewDb > getReviewDbProvider ( ) { return dbProvider.get ( ) ; }
Source:
public java.util.Optional < com.google.gerrit.server.group.InternalGroup > load ( com.google.gerrit.reviewdb.client.AccountGroup.Id key ) throws java.lang.Exception { if ( hasGroupIndex ) { return groupQueryProvider.get ( ) . byId ( key ) ; } try ( com.google.gerrit.reviewdb.server.ReviewDb db = schema.open ( ) ) { return groups.getGroup ( db , key ) ; } }

Target:
public java.util.Optional < com.google.gerrit.server.group.InternalGroup > load ( com.google.gerrit.reviewdb.client.AccountGroup.Id key ) throws java.lang.Exception { if ( hasGroupIndex.getAsBoolean ( ) ) { return groupQueryProvider.get ( ) . byId ( key ) ; } try ( com.google.gerrit.reviewdb.server.ReviewDb db = schema.open ( ) ) { return groups.getGroup ( db , key ) ; } }
Source:
public void deleteChange ( ) throws java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { java.lang.String changeId = createChange ( ) ; com.google.gerrit.server.change.ChangeJson.ChangeInfo c = getChange ( changeId ) ; org.junit.Assert.assertEquals ( ( "p~master~" + changeId ) , c.id ) ; org.junit.Assert.assertEquals ( Change.Status.NEW , c.status ) ; com.google.gerrit.acceptance.RestResponse r = com.google.gerrit.acceptance.rest.change.DeleteDraftChangeIT.deleteChange ( changeId , adminSession ) ; org.junit.Assert.assertEquals ( "Change is not a draft" , r.getEntityContent ( ) ) ; org.junit.Assert.assertEquals ( 409 , r.getStatusCode ( ) ) ; }

Target:
public void deleteDraftChange ( ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { java.lang.String changeId = createDraftChange ( ) ; java.lang.String triplet = "p~master~" + changeId ; com.google.gerrit.extensions.common.ChangeInfo c = get ( triplet ) ; org.junit.Assert.assertEquals ( triplet , c.id ) ; org.junit.Assert.assertEquals ( ChangeStatus.DRAFT , c.status ) ; com.google.gerrit.acceptance.RestResponse r = com.google.gerrit.acceptance.rest.change.DeleteDraftChangeIT.deleteChange ( changeId , adminSession ) ; org.junit.Assert.assertEquals ( 204 , r.getStatusCode ( ) ) ; }
Source:
static void postSignIn ( final boolean success ) { final com.google.gerrit.client.SignInDialog d = com.google.gerrit.client.SignInDialog.current ; assert d != null ; if ( success ) { com.google.gerrit.client.Gerrit.postSignIn ( ) ; d.hide ( ) ; if ( ( d.callback ) != null ) { d.callback.onSuccess ( null ) ; } } else { d.hide ( ) ; } }

Target:
public void execute ( ) { ac.onSuccess ( null ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { failedMergeBranches = new java.util.TreeMap < java.lang.String , java.lang.String > ( ) ; failedMergeBranches.put ( "branch1" , "branch1 merge conflict" ) ; failedMergeBranches.put ( "branch2" , "branch2 merge conflict" ) ; failedMergeBranches.put ( "branch3" , "branch3 merge conflict" ) ; currentRevision = "d3adb33f" ; hostName = "livingbeef.example.com" ; topic = "testtopic" ; }

Target:
public void setUp ( ) throws java.lang.Exception { failedMergeBranches = new java.util.TreeMap < java.lang.String , java.lang.String > ( ) ; failedMergeBranches.put ( "branch1" , "branch1 merge conflict" ) ; failedMergeBranches.put ( "branch2" , "branch2 merge conflict" ) ; failedMergeBranches.put ( "branch3" , "branch3 merge conflict" ) ; currentRevision = "d3adb33f" ; hostName = "livingbeef.example.com" ; projectName = "testproject" ; changeNumber = 15 ; patchsetNumber = 2 ; topic = "testtopic" ; }
Source:
com.google.gitiles.GitilesServlet getServlet ( @ com.google.inject.name.Named ( value = "gitiles" ) org.eclipse.jgit.lib.Config cfg , com.google.gitiles.GitilesUrls urls , com.google.gitiles.GitilesAccess.Factory accessFactory , org.eclipse.jgit.transport.resolver.RepositoryResolver < javax.servlet.http.HttpServletRequest > resolver ) { return new com.google.gitiles.GitilesServlet ( cfg , null , urls , accessFactory , resolver , null , null , null ) ; }

Target:
com.google.gitiles.GitilesServlet getServlet ( @ com.google.inject.name.Named ( value = "gitiles" ) org.eclipse.jgit.lib.Config cfg , com.google.gitiles.GitilesUrls urls , com.google.gitiles.GitilesAccess.Factory accessFactory , org.eclipse.jgit.transport.resolver.RepositoryResolver < javax.servlet.http.HttpServletRequest > resolver , com.googlesource.gerrit.plugins.gitiles.MenuFilter menuFilter ) throws javax.servlet.ServletException { com.google.gitiles.GitilesServlet s = new com.google.gitiles.GitilesServlet ( cfg , null , urls , accessFactory , resolver , null , null , null ) ; for ( com.google.gitiles.GitilesView.Type view : GitilesView.Type.values ( ) ) { s.addFilter ( view , menuFilter ) ; } return s ; }
Source:
private boolean isTrusted ( final com.google.gerrit.reviewdb.client.AccountExternalId id ) { if ( id.isScheme ( AccountExternalId.LEGACY_GAE ) ) { return isAllowGoogleAccountUpgrade ( ) ; } if ( id.isScheme ( AccountExternalId.SCHEME_MAILTO ) ) { return true ; } if ( id.isScheme ( AccountExternalId.SCHEME_UUID ) ) { return true ; } if ( id.isScheme ( AccountExternalId.SCHEME_USERNAME ) ) { return true ; } for ( final com.google.gerrit.common.auth.openid.OpenIdProviderPattern p : trustedOpenIDs ) { if ( p.matches ( id ) ) { return true ; } } return false ; }

Target:
private boolean isTrusted ( final com.google.gerrit.reviewdb.client.AccountExternalId id ) { if ( id.isScheme ( AccountExternalId.LEGACY_GAE ) ) { return isAllowGoogleAccountUpgrade ( ) ; } if ( id.isScheme ( AccountExternalId.SCHEME_MAILTO ) ) { return true ; } if ( id.isScheme ( AccountExternalId.SCHEME_UUID ) ) { return true ; } if ( id.isScheme ( AccountExternalId.SCHEME_USERNAME ) ) { return true ; } for ( final com.google.gerrit.server.auth.openid.OpenIdProviderPattern p : trustedOpenIDs ) { if ( p.matches ( id ) ) { return true ; } } return false ; }
Source:
public com.googlecode.prolog_cafe.lang.Operation exec ( com.googlecode.prolog_cafe.lang.Prolog engine ) { com.googlecode.prolog_cafe.lang.Term a1 = engine.areg1 ; com.googlecode.prolog_cafe.lang.Term result = engine.areg2 ; java.util.regex.Matcher matcher = ( ( java.util.regex.Matcher ) ( ( ( com.googlecode.prolog_cafe.lang.JavaObjectTerm ) ( a1 ) ) . object ( ) ) ) ; com.googlecode.prolog_cafe.lang.Term matches = com.googlecode.prolog_cafe.builtin.PRED_regex_match_3.getMatches ( matcher ) ; if ( ( matches == ( com.googlecode.prolog_cafe.lang.Prolog.Nil ) ) || ( ! ( result.unify ( matches , engine.trail ) ) ) ) { return engine.fail ( ) ; } return engine.cont ; }

Target:
public com.googlecode.prolog_cafe.lang.Operation exec ( com.googlecode.prolog_cafe.lang.Prolog engine ) { com.googlecode.prolog_cafe.lang.Term a1 = engine.r1 ; com.googlecode.prolog_cafe.lang.Term result = engine.r2 ; java.util.regex.Matcher matcher = ( ( java.util.regex.Matcher ) ( ( ( com.googlecode.prolog_cafe.lang.JavaObjectTerm ) ( a1 ) ) . object ( ) ) ) ; com.googlecode.prolog_cafe.lang.Term matches = com.googlecode.prolog_cafe.builtin.PRED_regex_match_3.getMatches ( matcher ) ; if ( ( matches == ( com.googlecode.prolog_cafe.lang.Prolog.Nil ) ) || ( ! ( result.unify ( matches , engine.trail ) ) ) ) { return engine.fail ( ) ; } return engine.cont ; }
Source:
private static final java.net.InetSocketAddress newPort ( ) throws java.io.IOException { java.net.ServerSocket s = new java.net.ServerSocket ( 0 , 0 , com.google.gerrit.acceptance.GerritServer.getLocalHost ( ) ) ; try { return ( ( java.net.InetSocketAddress ) ( s.getLocalSocketAddress ( ) ) ) ; } finally { s.close ( ) ; } }

Target:
private static void mergeTestConfig ( org.eclipse.jgit.lib.Config cfg ) throws java.io.IOException { java.lang.String forceEphemeralPort = java.lang.String.format ( "%s:0" , com.google.gerrit.acceptance.GerritServer.getLocalHost ( ) . getHostName ( ) ) ; java.lang.String url = ( "http://" + forceEphemeralPort ) + "/" ; cfg.setString ( "gerrit" , null , "canonicalWebUrl" , url ) ; cfg.setString ( "httpd" , null , "listenUrl" , url ) ; cfg.setString ( "sshd" , null , "listenAddress" , forceEphemeralPort ) ; cfg.setString ( "cache" , null , "directory" , null ) ; cfg.setBoolean ( "sendemail" , null , "enable" , false ) ; cfg.setInt ( "cache" , "projects" , "checkFrequency" , 0 ) ; cfg.setInt ( "plugins" , null , "checkFrequency" , 0 ) ; }
Source:
public void deleteReviewerFromReviewableChangeByOwnerCcingSelf ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; setEmailStrategy ( sc.owner , EmailStrategy.CC_ON_OWN_COMMENTS ) ; removeReviewer ( sc , extraReviewer ) ; assertThat ( sender ) . sent ( "deleteReviewer" , sc ) . to ( sc.owner , extraReviewer ) . cc ( extraCcer , sc.reviewer , sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; }

Target:
public void deleteReviewerFromReviewableChangeByOwnerCcingSelf ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChangeWithExtraReviewer ( ) ; setEmailStrategy ( sc.owner , EmailStrategy.CC_ON_OWN_COMMENTS ) ; removeReviewer ( sc , extraReviewer ) ; assertThat ( sender ) . sent ( "deleteReviewer" , sc ) . to ( sc.owner , extraReviewer ) . cc ( extraCcer , sc.reviewer , sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) . noOneElse ( ) ; }
Source:
private void scan ( org.pegdown.ast.Node node , com.google.common.collect.Multimap < java.lang.String , com.google.gitiles.doc.TocFormatter.TocEntry > entries , java.util.Deque < org.pegdown.ast.HeaderNode > stack ) { if ( node instanceof org.pegdown.ast.HeaderNode ) { scan ( ( ( org.pegdown.ast.HeaderNode ) ( node ) ) , entries , stack ) ; } else { for ( org.pegdown.ast.Node child : node.getChildren ( ) ) { scan ( child , entries , stack ) ; } } }

Target:
private void scan ( org.commonmark.node.Node node , com.google.common.collect.Multimap < java.lang.String , com.google.gitiles.doc.TocFormatter.TocEntry > entries , java.util.Deque < org.commonmark.node.Heading > stack ) { if ( node instanceof org.commonmark.node.Heading ) { scan ( ( ( org.commonmark.node.Heading ) ( node ) ) , entries , stack ) ; } else { for ( org.commonmark.node.Node c = node.getFirstChild ( ) ; c != null ; c = c.getNext ( ) ) { scan ( c , entries , stack ) ; } } }
Source:
void onBeginAddRule ( com.google.gwt.event.dom.client.ClickEvent event ) { addStage1.getStyle ( ) . setDisplay ( Display.NONE ) ; addStage2.getStyle ( ) . setDisplay ( Display.BLOCK ) ; com.google.gwt.core.client.Scheduler.get ( ) . scheduleDeferred ( new com.google.gwt.core.client.Scheduler.ScheduledCommand ( ) { @ java.lang.Override public void execute ( ) { groupToAdd.setFocus ( true ) ; } } ) ; }

Target:
void onBeginAddRule ( com.google.gwt.event.dom.client.ClickEvent event ) { beginAddRule ( ) ; }
Source:
public void initConfig ( com.google.gerrit.pgm.init.Section database ) { boolean hasUrl = ( com.google.common.base.Strings.emptyToNull ( database.get ( "url" ) ) ) != null ; database.string ( "URL" , "url" , null ) ; guessDriver ( database ) ; database.string ( "Driver class name" , "driver" , null ) ; database.string ( "Database username" , "username" , ( hasUrl ? null : com.google.gerrit.pgm.init.InitUtil.username ( ) ) ) ; database.password ( "username" , "password" ) ; }

Target:
public void initConfig ( com.google.gerrit.pgm.init.api.Section database ) { boolean hasUrl = ( com.google.common.base.Strings.emptyToNull ( database.get ( "url" ) ) ) != null ; database.string ( "URL" , "url" , null ) ; guessDriver ( database ) ; database.string ( "Driver class name" , "driver" , null ) ; database.string ( "Database username" , "username" , ( hasUrl ? null : com.google.gerrit.pgm.init.InitUtil.username ( ) ) ) ; database.password ( "username" , "password" ) ; }
Source:
public boolean isOwner ( ) { if ( canPerform ( com.google.gerrit.reviewdb.ApprovalCategory.OWN , ( ( short ) ( 1 ) ) ) ) { return true ; } if ( getRefName ( ) . equals ( RefRight.ALL.substring ( 0 , ( ( RefRight.ALL.length ( ) ) - 1 ) ) ) ) { return getCurrentUser ( ) . isAdministrator ( ) ; } else { return getProjectControl ( ) . isOwner ( ) ; } }

Target:
public boolean isOwner ( ) { if ( ( owner ) == null ) { if ( canPerform ( Permission.OWNER ) ) { owner = true ; } else if ( getRefName ( ) . equals ( AccessSection.ALL.substring ( 0 , ( ( AccessSection.ALL.length ( ) ) - 1 ) ) ) ) { owner = getCurrentUser ( ) . isAdministrator ( ) ; } else { owner = getProjectControl ( ) . isOwner ( ) ; } } return owner ; }
Source:
public void onShowView ( ) { super . onShowView ( ) ; com.google.gwt.user.client.Window.enableScrolling ( false ) ; final int height = getCodeMirrorHeight ( ) ; cmA.setHeight ( height ) ; cmB.setHeight ( height ) ; diffTable.sidePanel.adjustGutters ( cmB ) ; cmB.setCursor ( net.codemirror.lib.LineCharacter.create ( 0 ) ) ; cmB.focus ( ) ; prefetchNextFile ( ) ; }

Target:
public void onShowView ( ) { super . onShowView ( ) ; com.google.gwt.user.client.Window.enableScrolling ( false ) ; if ( prefs.hideTopMenu ( ) ) { com.google.gerrit.client.Gerrit.setHeaderVisible ( false ) ; } final int height = getCodeMirrorHeight ( ) ; cmA.setHeight ( height ) ; cmB.setHeight ( height ) ; diffTable.sidePanel.adjustGutters ( cmB ) ; cmB.setCursor ( net.codemirror.lib.LineCharacter.create ( 0 ) ) ; cmB.focus ( ) ; prefetchNextFile ( ) ; }
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 ( ) ) { 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 ( 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 ) ; } } } }
Source:
public boolean hasMissingDependencies ( final com.google.gerrit.server.git.MergeSorter mergeSorter , final com.google.gerrit.server.git.CodeReviewCommit toMerge ) throws com.google.gerrit.server.git.MergeException { try { return ! ( mergeSorter.sort ( java.util.Collections.singleton ( toMerge ) ) . contains ( toMerge ) ) ; } catch ( java.io.IOException e ) { throw new com.google.gerrit.server.git.MergeException ( "Branch head sorting failed" , e ) ; } }

Target:
public boolean hasMissingDependencies ( final com.google.gerrit.server.git.MergeSorter mergeSorter , final com.google.gerrit.server.git.CodeReviewCommit toMerge ) throws com.google.gerrit.server.git.IntegrationException { try { return ! ( mergeSorter.sort ( java.util.Collections.singleton ( toMerge ) ) . contains ( toMerge ) ) ; } catch ( java.io.IOException e ) { throw new com.google.gerrit.server.git.IntegrationException ( "Branch head sorting failed" , e ) ; } }
Source:
public void run ( ) { for ( int line = start ; line < end ; line ++ ) { cm.removeLineClass ( line , where , className ) ; } }

Target:
void colorLines ( final net.codemirror.lib.CodeMirror cm , final net.codemirror.lib.CodeMirror.LineClassWhere where , final java.lang.String className , final int start , final int end ) { if ( start < end ) { for ( int line = start ; line < end ; line ++ ) { cm.addLineClass ( line , where , className ) ; } undo.add ( ( ) -> { for ( int line = start ; line < end ; line ++ ) { cm.removeLineClass ( line , where , className ) ; } } ) ; } }
Source:
private void display ( final com.google.gerrit.reviewdb.AccountGeneralPreferences p ) { showSiteHeader.setValue ( p.isShowSiteHeader ( ) ) ; useFlashClipboard.setValue ( p.isUseFlashClipboard ( ) ) ; setListBox ( maximumPageSize , com.google.gerrit.reviewdb.AccountGeneralPreferences.DEFAULT_PAGESIZE , p.getMaximumPageSize ( ) ) ; setListBox ( defaultContext , com.google.gerrit.reviewdb.AccountGeneralPreferences.DEFAULT_CONTEXT , p.getDefaultContext ( ) ) ; }

Target:
private void display ( final com.google.gerrit.reviewdb.AccountGeneralPreferences p ) { showSiteHeader.setValue ( p.isShowSiteHeader ( ) ) ; useFlashClipboard.setValue ( p.isUseFlashClipboard ( ) ) ; copySelfOnEmails.setValue ( p.isCopySelfOnEmails ( ) ) ; setListBox ( maximumPageSize , com.google.gerrit.reviewdb.AccountGeneralPreferences.DEFAULT_PAGESIZE , p.getMaximumPageSize ( ) ) ; setListBox ( defaultContext , com.google.gerrit.reviewdb.AccountGeneralPreferences.DEFAULT_CONTEXT , p.getDefaultContext ( ) ) ; }
Source:
private static void validateDiffMode ( com.googlesource.gerrit.plugins.xdocs.XDocServlet.ResourceKey key , eu.medsea.mimeutil.MimeType mimeType ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException { if ( ( ( key.diffMode ) != ( DiffMode.NO_DIFF ) ) && ( ( ( key.revisionB ) == null ) || ( com.googlesource.gerrit.plugins.xdocs.XDocServlet.isImage ( mimeType ) ) ) ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( ) ; } }

Target:
private static void validateDiffMode ( com.googlesource.gerrit.plugins.xdocs.XDocServlet.ResourceKey key , com.googlesource.gerrit.plugins.xdocs.formatter.Formatters.FormatterProvider formatter , eu.medsea.mimeutil.MimeType mimeType ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException { if ( ( ( key.diffMode ) != ( DiffMode.NO_DIFF ) ) && ( ( ( key.revisionB ) == null ) || ( ( formatter == null ) && ( com.googlesource.gerrit.plugins.xdocs.XDocServlet.isImage ( mimeType ) ) ) ) ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( ) ; } }
Source:
private static org.bouncycastle.openpgp.PGPPublicKeyRingCollection readPubRing ( final java.io.File pub ) { java.io.InputStream fin = new java.io.FileInputStream ( pub ) ; java.io.InputStream in = org.bouncycastle.openpgp.PGPUtil.getDecoderStream ( fin ) ; HEAD ( 5758.0F ) ; }

Target:
private static org.bouncycastle.openpgp.PGPPublicKeyRingCollection readPubRing ( final java.io.File pub ) { try ( java.io.InputStream fin = new java.io.FileInputStream ( pub ) ; java.io.InputStream in = org.bouncycastle.openpgp.PGPUtil.getDecoderStream ( fin ) ) { return new org.bouncycastle.openpgp.bc.BcPGPPublicKeyRingCollection ( in ) ; } catch ( java.io.IOException | org.bouncycastle.openpgp.PGPException e ) { throw new com.google.inject.ProvisionException ( ( "Cannot read " + pub ) , e ) ; } }
Source:
public boolean contains ( com.google.gerrit.reviewdb.client.AccountGroup.UUID id ) { if ( id == null ) { return false ; } java.lang.Boolean b = memberOf.get ( id ) ; if ( b != null ) { return b ; } memberOf.put ( id , false ) ; if ( search ( includeCache.membersOf ( id ) ) ) { memberOf.put ( id , true ) ; return true ; } return false ; }

Target:
public boolean contains ( com.google.gerrit.reviewdb.client.AccountGroup.UUID id ) { if ( id == null ) { return false ; } java.lang.Boolean b = memberOf.get ( id ) ; return b != null ? b : containsAnyOf ( com.google.common.collect.ImmutableSet.of ( id ) ) ; }
Source:
public UiAction.Description getDescription ( com.google.gerrit.server.change.ChangeResource resource ) { return new com.google.gerrit.extensions.webui.UiAction.Description ( ) . setLabel ( "Revert" ) . setTitle ( "Revert the change" ) . setVisible ( ( ( ( resource.getChange ( ) . getStatus ( ) ) == ( com.google.gerrit.reviewdb.client.Change.Status.MERGED ) ) && ( resource.getControl ( ) . getRefControl ( ) . canUpload ( ) ) ) ) ; }

Target:
public UiAction.Description getDescription ( com.google.gerrit.server.change.ChangeResource rsrc ) { com.google.gerrit.reviewdb.client.Change change = rsrc.getChange ( ) ; return new com.google.gerrit.extensions.webui.UiAction.Description ( ) . setLabel ( "Revert" ) . setTitle ( "Revert the change" ) . setVisible ( ( ( ( change.getStatus ( ) ) == ( Change.Status.MERGED ) ) && ( permissionBackend.user ( user ) . ref ( change.getDest ( ) ) . testOrFalse ( com.google.gerrit.server.permissions.RefPermission.CREATE_CHANGE ) ) ) ) ; }
Source:
public void testDeleteResponseOK ( ) throws java.lang.Exception { com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpSessionTest.wireMockRule.givenThat ( com.github.tomakehurst.wiremock.client.WireMock.delete ( com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpSessionTest.ENDPOINT ) ) . willReturn ( com.github.tomakehurst.wiremock.client.WireMock.aResponse ( ) . withStatus ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpSessionTest.OK ) ) ) ; com.google.common.truth.Truth.assertThat ( httpSession.delete ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpSessionTest.ENDPOINT ) . isSuccessful ( ) ) . isTrue ( ) ; }

Target:
public void testDeleteResponseOK ( ) throws java.lang.Exception { com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpSessionTest.wireMockRule.givenThat ( com.github.tomakehurst.wiremock.client.WireMock.delete ( com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpSessionTest.ENDPOINT ) ) . willReturn ( com.github.tomakehurst.wiremock.client.WireMock.aResponse ( ) . withStatus ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpSessionTest.NO_CONTENT ) ) ) ; com.google.common.truth.Truth.assertThat ( httpSession.delete ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpSessionTest.ENDPOINT ) . isSuccessful ( ) ) . isTrue ( ) ; }
Source:
public void invalidRevision ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isFalse ( ) ; com.google.gerrit.server.project.ChangeControl ctl = insertChange ( ) ; com.google.gerrit.reviewdb.client.PatchSet ps = com.google.gerrit.testutil.TestChanges.newPatchSet ( ctl.getChange ( ) . currentPatchSetId ( ) , "fooooooooooooooooooooooooooooooooooooooo" , adminId ) ; db.patchSets ( ) . update ( java.util.Collections.singleton ( ps ) ) ; assertProblems ( ctl , null , com.google.gerrit.acceptance.server.change.ConsistencyCheckerIT.problem ( "Invalid revision on patch set 1: fooooooooooooooooooooooooooooooooooooooo" ) ) ; }

Target:
public void invalidRevision ( ) throws java.lang.Exception { assumeNoteDbDisabled ( ) ; com.google.gerrit.server.project.ChangeControl ctl = insertChange ( ) ; com.google.gerrit.reviewdb.client.PatchSet ps = com.google.gerrit.testutil.TestChanges.newPatchSet ( ctl.getChange ( ) . currentPatchSetId ( ) , "fooooooooooooooooooooooooooooooooooooooo" , adminId ) ; db.patchSets ( ) . update ( java.util.Collections.singleton ( ps ) ) ; assertProblems ( ctl , null , com.google.gerrit.acceptance.server.change.ConsistencyCheckerIT.problem ( "Invalid revision on patch set 1: fooooooooooooooooooooooooooooooooooooooo" ) ) ; }
Source:
private static com.google.common.collect.Multimap < java.lang.String , java.io.File > asMultimap ( java.util.List < java.io.File > plugins ) throws java.io.IOException { com.google.common.collect.Multimap < java.lang.String , java.io.File > map = com.google.common.collect.LinkedHashMultimap.create ( ) ; for ( java.io.File srcFile : plugins ) { map.put ( com.google.common.base.Objects.firstNonNull ( com.google.gerrit.server.plugins.PluginLoader.getGerritPluginName ( srcFile ) , com.google.gerrit.server.plugins.PluginLoader.nameOf ( srcFile ) ) , srcFile ) ; } return map ; }

Target:
public static java.lang.String getPluginName ( java.io.File srcFile ) throws java.io.IOException { return com.google.common.base.Objects.firstNonNull ( com.google.gerrit.server.plugins.PluginLoader.getGerritPluginName ( srcFile ) , com.google.gerrit.server.plugins.PluginLoader.nameOf ( srcFile ) ) . toLowerCase ( ) ; }
Source:
public void onClick ( com.google.gwt.user.client.ui.Widget sender ) { if ( sender == ( edit ) ) { edit ( ) ; } else if ( sender == ( save ) ) { onSave ( ) ; } else if ( sender == ( cancel ) ) { render ( ) ; } else if ( sender == ( discard ) ) { onDiscard ( ) ; } }

Target:
public void onClick ( final com.google.gwt.event.dom.client.ClickEvent event ) { final com.google.gwt.user.client.ui.Widget sender = ( ( com.google.gwt.user.client.ui.Widget ) ( event.getSource ( ) ) ) ; if ( sender == ( edit ) ) { edit ( ) ; } else if ( sender == ( save ) ) { onSave ( ) ; } else if ( sender == ( cancel ) ) { render ( ) ; } else if ( sender == ( discard ) ) { onDiscard ( ) ; } }
Source:
protected void configure ( ) { final com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < com.google.gerrit.server.patch.PatchListKey , com.google.gerrit.server.patch.PatchList > > type = new com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < com.google.gerrit.server.patch.PatchListKey , com.google.gerrit.server.patch.PatchList > > ( ) { } ; disk ( type , com.google.gerrit.server.patch.PatchListCache.CACHE_NAME ) ; bind ( com.google.gerrit.server.patch.PatchListCache.class ) ; }

Target:
protected void configure ( ) { final com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < com.google.gerrit.server.patch.PatchListKey , com.google.gerrit.server.patch.PatchList > > type = new com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < com.google.gerrit.server.patch.PatchListKey , com.google.gerrit.server.patch.PatchList > > ( ) { } ; disk ( type , com.google.gerrit.server.patch.PatchListCache.CACHE_NAME ) . memoryLimit ( 128 ) . evictionPolicy ( EvictionPolicy.LRU ) ; bind ( com.google.gerrit.server.patch.PatchListCache.class ) ; }
Source:
private void unpackImpl ( ) throws com.google.codereview.manager.unpack.UnpackException { com.google.codereview.manager.unpack.UnpackBundleOp.LOG.debug ( ( "Unpacking bundle " + ( in.getBundleKey ( ) ) ) ) ; openRepository ( ) ; unpackTip ( ) ; createChanges ( newCommits ( ) ) ; }

Target:
private void unpackImpl ( ) throws com.google.codereview.manager.unpack.UnpackException { com.google.codereview.manager.unpack.UnpackBundleOp.LOG.debug ( ( "Unpacking bundle " + ( in.getBundleKey ( ) ) ) ) ; for ( final com.google.codereview.internal.NextReceivedBundle.ReplacePatchSet p : in.getReplaceList ( ) ) { replacements.put ( org.spearce.jgit.lib.ObjectId.fromString ( p.getObjectId ( ) ) , p ) ; } openRepository ( ) ; unpackTip ( ) ; createChanges ( newCommits ( ) ) ; }
Source:
public void testCUSTOM_FullyConfiguredUser ( ) { setFrom ( "A ${user} B <my.server@email.address>" ) ; final java.lang.String name = "A U. Thor" ; final java.lang.String email = "a.u.thor@test.example.com" ; final com.google.gerrit.reviewdb.client.Account.Id user = user ( name , email ) ; org.easymock.EasyMock.replay ( accountCache ) ; final com.google.gerrit.server.mail.Address r = create ( ) . from ( user ) ; assertNotNull ( r ) ; assertEquals ( ( ( "A " + name ) + " B" ) , r.name ) ; assertEquals ( "my.server@email.address" , r.email ) ; org.easymock.EasyMock.verify ( accountCache ) ; }

Target:
public void testCUSTOM_NoFullNameUser ( ) { setFrom ( "A ${user} B <my.server@email.address>" ) ; final java.lang.String email = "a.u.thor@test.example.com" ; final com.google.gerrit.reviewdb.client.Account.Id user = user ( null , email ) ; org.easymock.EasyMock.replay ( accountCache ) ; final com.google.gerrit.server.mail.Address r = create ( ) . from ( user ) ; org.junit.Assert.assertNotNull ( r ) ; org.junit.Assert.assertEquals ( "A Anonymous Coward B" , r.name ) ; org.junit.Assert.assertEquals ( "my.server@email.address" , r.email ) ; org.easymock.EasyMock.verify ( accountCache ) ; }
Source:
public void testTaggedTagTime ( ) throws java.lang.Exception { repo.tick ( 2 ) ; org.eclipse.jgit.revwalk.RevTag tag = repo.tag ( "tag" , repo.commit ( ) . create ( ) ) ; repo.tick ( ( - 1 ) ) ; org.eclipse.jgit.revwalk.RevTag tagTag = repo.tag ( "tagtag" , tag ) ; assertEquals ( ( ( start ) + 3 ) , getTime ( tag ) ) ; assertEquals ( ( ( start ) + 2 ) , getTime ( tagTag ) ) ; }

Target:
public void taggedTagTime ( ) throws java.lang.Exception { repo.tick ( 2 ) ; org.eclipse.jgit.revwalk.RevTag tag = repo.tag ( "tag" , repo.commit ( ) . create ( ) ) ; repo.tick ( ( - 1 ) ) ; org.eclipse.jgit.revwalk.RevTag tagTag = repo.tag ( "tagtag" , tag ) ; org.junit.Assert.assertEquals ( ( ( start ) + 3 ) , getTime ( tag ) ) ; org.junit.Assert.assertEquals ( ( ( start ) + 2 ) , getTime ( tagTag ) ) ; }
Source:
private static boolean missing ( final java.lang.String value ) { return ( value == null ) || ( value.trim ( ) . equals ( "" ) ) ; }

Target:
private void parseUpdate ( final org.eclipse.jgit.transport.ReceiveCommand cmd ) { com.google.gerrit.server.project.RefControl ctl = projectControl.controlForRef ( cmd.getRefName ( ) ) ; if ( ctl.canUpdate ( ) ) { if ( ( com.google.gerrit.server.git.ReceiveCommits.isHead ( cmd ) ) && ( ! ( isCommit ( cmd ) ) ) ) { return ; } validateNewCommits ( ctl , cmd ) ; } else { com.google.gerrit.server.git.ReceiveCommits.reject ( cmd , "can not update the reference as a fast forward" ) ; } }
Source:
public void testCreateSchema ( ) throws java.lang.Exception { final com.google.gwtorm.data.PhoneBookDb schema = open ( ) ; schema.updateSchema ( ) ; }

Target:
public void testCreateSchema ( ) throws java.lang.Exception { final com.google.gwtorm.data.PhoneBookDb schema = open ( ) ; final com.google.gwtorm.jdbc.JdbcExecutor e = new com.google.gwtorm.jdbc.JdbcExecutor ( ( ( com.google.gwtorm.jdbc.JdbcSchema ) ( schema ) ) ) ; try { schema.updateSchema ( e ) ; } finally { e.close ( ) ; } }