auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void addMissingLabel ( java.lang.String text ) { com.google.gwt.user.client.Element li = com.google.gwt.user.client.DOM.createElement ( "li" ) ; li.setClassName ( Gerrit.RESOURCES.css ( ) . missingApproval ( ) ) ; li.setInnerText ( text ) ; com.google.gwt.user.client.DOM.appendChild ( missing.getElement ( ) , li ) ; }

Target:
private void addMissingLabel ( java.lang.String text ) { com.google.gwt.dom.client.Element li = com.google.gwt.user.client.DOM.createElement ( "li" ) ; li.setClassName ( Gerrit.RESOURCES.css ( ) . missingApproval ( ) ) ; li.setInnerText ( text ) ; com.google.gwt.user.client.DOM.appendChild ( missing.getElement ( ) , li ) ; }
Source:
java.util.Set < java.lang.String > getOrganizationsForUser ( java.lang.String username ) { try { return orgTeamsByUsername.get ( username ) . keySet ( ) ; } catch ( java.util.concurrent.ExecutionException e ) { com.googlesource.gerrit.plugins.github.group.GitHubGroupsCache.log.warn ( ( ( "Cannot get GitHub organisations for user '" + username ) + "'" ) , e ) ; return java.util.Collections.emptySet ( ) ; } }

Target:
java.util.Set < java.lang.String > getTeamsForUser ( java.lang.String organizationName , java.lang.String username ) { try { return new com.google.common.collect.ImmutableSet.Builder < java.lang.String > ( ) . addAll ( orgTeamsByUsername.get ( username ) . get ( organizationName ) ) . build ( ) ; } catch ( java.util.concurrent.ExecutionException e ) { com.googlesource.gerrit.plugins.github.group.GitHubGroupsCache.log.warn ( ( ( ( ( "Cannot get Teams membership for organisation '" + organizationName ) + "' and user '" ) + username ) + "'" ) , e ) ; return java.util.Collections.emptySet ( ) ; } }
Source:
public void createChangeOnInvisibleBranchFails ( ) throws java.lang.Exception { changeInTwoBranches ( "invisible-branch" , "a.txt" , "branchB" , "b.txt" ) ; block ( project , "refs/heads/invisible-branch" , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS ) ; com.google.gerrit.extensions.common.ChangeInput in = newChangeInput ( ChangeStatus.NEW ) ; in.branch = "invisible-branch" ; assertCreateFails ( in , com.google.gerrit.extensions.restapi.AuthException.class , "cannot upload review" ) ; }

Target:
public void createChangeOnInvisibleBranchFails ( ) throws java.lang.Exception { changeInTwoBranches ( "invisible-branch" , "a.txt" , "branchB" , "b.txt" ) ; block ( project , "refs/heads/invisible-branch" , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS ) ; com.google.gerrit.extensions.common.ChangeInput in = newChangeInput ( ChangeStatus.NEW ) ; in.branch = "invisible-branch" ; assertCreateFails ( in , com.google.gerrit.extensions.restapi.ResourceNotFoundException.class , "" ) ; }
Source:
public org.eclipse.jgit.lib.Repository getRepository ( ) throws java.io.IOException { initRepository ( ) ; return repo ; }

Target:
private void initRepository ( ) throws java.io.IOException { if ( ( repo ) == null ) { this . repo = repoManager.openRepository ( project ) ; closeRepo = true ; inserter = repo.newObjectInserter ( ) ; revWalk = new org.eclipse.jgit.revwalk.RevWalk ( inserter.newReader ( ) ) ; commands = new com.google.gerrit.server.git.ChainedReceiveCommands ( repo ) ; } }
Source:
public void doFilter ( javax.servlet.ServletRequest request , javax.servlet.ServletResponse res , javax.servlet.FilterChain chain ) throws java.io.IOException , javax.servlet.ServletException { java.lang.String pkg = "gerrit-gwtui" ; java.lang.String target = "ui_" + ( rule.select ( ( ( javax.servlet.http.HttpServletRequest ) ( request ) ) ) ) ; java.lang.String rule = ( ( "//" + pkg ) + ":" ) + target ; java.io.File zip = new java.io.File ( new java.io.File ( gen , pkg ) , ( target + ".zip" ) ) ; synchronized ( this ) { try { com.google.gerrit.pgm.http.jetty.JettyServer.build ( root , gen , rule ) ; } catch ( com.google.gerrit.pgm.http.jetty.JettyServer.BuildFailureException e ) { displayFailure ( rule , e.why , ( ( javax.servlet.http.HttpServletResponse ) ( res ) ) ) ; return ; } if ( ( ! ( target.equals ( lastTarget ) ) ) || ( ( lastTime ) != ( zip.lastModified ( ) ) ) ) { lastTarget = target ; lastTime = zip.lastModified ( ) ; com.google.gerrit.pgm.http.jetty.JettyServer.unpack ( zip , dstwar ) ; } } chain.doFilter ( request , res ) ; }

Target:
public void doFilter ( javax.servlet.ServletRequest request , javax.servlet.ServletResponse res , javax.servlet.FilterChain chain ) throws java.io.IOException , javax.servlet.ServletException { java.lang.String pkg = "gerrit-gwtui" ; java.lang.String target = "ui_" + ( rule.select ( ( ( javax.servlet.http.HttpServletRequest ) ( request ) ) ) ) ; java.lang.String rule = ( ( "//" + pkg ) + ":" ) + target ; java.lang.String child = java.lang.String.format ( "%s/__gwt_binary_%s__" , pkg , target ) ; java.io.File zip = new java.io.File ( new java.io.File ( gen , child ) , ( target + ".zip" ) ) ; synchronized ( this ) { try { com.google.gerrit.pgm.http.jetty.JettyServer.build ( root , gen , rule ) ; } catch ( com.google.gerrit.pgm.http.jetty.JettyServer.BuildFailureException e ) { displayFailure ( rule , e.why , ( ( javax.servlet.http.HttpServletResponse ) ( res ) ) ) ; return ; } if ( ( ! ( target.equals ( lastTarget ) ) ) || ( ( lastTime ) != ( zip.lastModified ( ) ) ) ) { lastTarget = target ; lastTime = zip.lastModified ( ) ; com.google.gerrit.pgm.http.jetty.JettyServer.unpack ( zip , dstwar ) ; } } chain.doFilter ( request , res ) ; }
Source:
public void filterOutAllResults ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < com.google.gerrit.testutil.InMemoryRepositoryManager.Repo > repo = createProject ( "repo" ) ; com.google.gerrit.reviewdb.client.Account.Id user2 = accountManager.authenticate ( com.google.gerrit.server.account.AuthRequest.forUser ( "anotheruser" ) ) . getAccountId ( ) ; for ( int i = 0 ; i < 5 ; i ++ ) { insert ( newChangeForUser ( repo , user2 ) ) ; } assertQuery ( "status:new ownerin:Administrators" ) ; assertQuery ( "status:new ownerin:Administrators limit:2" ) ; }

Target:
public void filterOutAllResults ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < com.google.gerrit.testutil.InMemoryRepositoryManager.Repo > repo = createProject ( "repo" ) ; com.google.gerrit.reviewdb.client.Account.Id user2 = accountManager.authenticate ( com.google.gerrit.server.account.AuthRequest.forUser ( "anotheruser" ) ) . getAccountId ( ) ; for ( int i = 0 ; i < 5 ; i ++ ) { insert ( repo , newChange ( repo ) , user2 ) ; } assertQuery ( "status:new ownerin:Administrators" ) ; assertQuery ( "status:new ownerin:Administrators limit:2" ) ; }
Source:
protected void preDisplay ( com.google.gerrit.client.projects.ConfigInfoCache.Entry result ) { loaded = true ; commentLinkProcessor = result.getCommentLinkProcessor ( ) ; setTheme ( result.getTheme ( ) ) ; renderChangeInfo ( info ) ; loadRevisionInfo ( ) ; }

Target:
public void onKeyPress ( com.google.gwt.event.dom.client.KeyPressEvent event ) { if ( com.google.gerrit.client.Gerrit.isSignedIn ( ) ) { if ( ( event.getNativeEvent ( ) . getCharCode ( ) ) == 0 ) { Window.Location.reload ( ) ; return ; } if ( topic.canEdit ( ) ) { topic.onEdit ( ) ; } } else { com.google.gerrit.client.Gerrit.doSignIn ( getToken ( ) ) ; } }
Source:
private com.google.gerrit.server.change.ReviewerJson.PostResult putAccount ( com.google.gerrit.server.change.ReviewerResource rsrc ) throws com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.reviewdb.client.Account member = rsrc.getUser ( ) . getAccount ( ) ; com.google.gerrit.server.project.ChangeControl control = rsrc.getControl ( ) ; com.google.gerrit.server.change.ReviewerJson.PostResult result = new com.google.gerrit.server.change.ReviewerJson.PostResult ( ) ; if ( isValidReviewer ( member , control ) ) { addReviewers ( rsrc , result , com.google.common.collect.ImmutableMap.of ( member.getId ( ) , control ) ) ; } return result ; }

Target:
private com.google.gerrit.server.change.ReviewerJson.PostResult putAccount ( com.google.gerrit.server.change.ReviewerResource rsrc ) throws com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.reviewdb.client.Account member = rsrc.getReviewerUser ( ) . getAccount ( ) ; com.google.gerrit.server.project.ChangeControl control = rsrc.getReviewerControl ( ) ; com.google.gerrit.server.change.ReviewerJson.PostResult result = new com.google.gerrit.server.change.ReviewerJson.PostResult ( ) ; if ( isValidReviewer ( member , control ) ) { addReviewers ( rsrc.getChangeResource ( ) , result , com.google.common.collect.ImmutableMap.of ( member.getId ( ) , control ) ) ; } return result ; }
Source:
private java.lang.String healthCheckAccess ( ) throws java.io.IOException { client ( ) . sysInfo ( ) ; final java.lang.String result = ( "{\"status\"=\"ok\",\"username\"=\"" + ( getUsername ( ) ) ) + "\"}" ; log.debug ( "Healtheck on access result: {}" , result ) ; return result ; }

Target:
private java.lang.String healthCheckSysinfo ( ) throws java.io.IOException { com.googlesource.gerrit.plugins.its.jira.restapi.JiraServerInfo info = client ( ) . sysInfo ( ) ; final java.lang.String result = ( ( ( ( ( "{\"status\"=\"ok\",\"system\"=\"Jira\",\"version\"=\"" + ( info.getVersion ( ) ) ) + "\",\"url\"=\"" ) + ( getUrl ( ) ) ) + "\",\"build\"=\"" ) + ( info.getBuildNumber ( ) ) ) + "\"}" ; log.debug ( "Health check on sysinfo result: {}" , result ) ; return result ; }
Source:
private void initBranchLink ( com.google.gerrit.client.changes.ChangeInfo info ) { branchLink.setText ( info.branch ( ) ) ; branchLink.setTargetHistoryToken ( com.google.gerrit.common.PageLinks.toChangeQuery ( com.google.gerrit.client.ui.BranchLink.query ( info.projectNameKey ( ) , info.status ( ) , info.branch ( ) , null ) ) ) ; }

Target:
private void initBranchLink ( com.google.gerrit.client.info.ChangeInfo info ) { branchLink.setText ( info.branch ( ) ) ; branchLink.setTargetHistoryToken ( com.google.gerrit.common.PageLinks.toChangeQuery ( com.google.gerrit.client.ui.BranchLink.query ( info.projectNameKey ( ) , info.status ( ) , info.branch ( ) , null ) ) ) ; }
Source:
protected void configure ( ) { bind ( new com.google.inject.TypeLiteral < com.google.gwtorm.client.SchemaFactory < com.google.gerrit.reviewdb.ReviewDb > > ( ) { } ) . toInstance ( db ) ; bind ( com.google.gerrit.server.config.SitePaths.class ) . toInstance ( paths ) ; install ( new com.google.gerrit.server.schema.SchemaVersion.Module ( ) ) ; org.eclipse.jgit.lib.Config cfg = new org.eclipse.jgit.lib.Config ( ) ; cfg.setString ( "gerrit" , null , "basePath" , "git" ) ; cfg.setString ( "user" , null , "name" , "Gerrit Code Review" ) ; cfg.setString ( "user" , null , "email" , "gerrit@localhost" ) ; bind ( org.eclipse.jgit.lib.Config.class ) . annotatedWith ( com.google.gerrit.server.config.GerritServerConfig.class ) . toInstance ( cfg ) ; bind ( org.eclipse.jgit.lib.PersonIdent.class ) . annotatedWith ( com.google.gerrit.server.GerritPersonIdent.class ) . toProvider ( com.google.gerrit.server.GerritPersonIdentProvider.class ) ; bind ( com.google.gerrit.server.git.GitRepositoryManager.class ) . to ( com.google.gerrit.server.git.LocalDiskRepositoryManager.class ) ; }

Target:
protected void configure ( ) { bind ( new com.google.inject.TypeLiteral < com.google.gwtorm.client.SchemaFactory < com.google.gerrit.reviewdb.ReviewDb > > ( ) { } ) . toInstance ( db ) ; bind ( com.google.gerrit.server.config.SitePaths.class ) . toInstance ( paths ) ; install ( new com.google.gerrit.server.schema.SchemaVersion.Module ( ) ) ; org.eclipse.jgit.lib.Config cfg = new org.eclipse.jgit.lib.Config ( ) ; cfg.setString ( "gerrit" , null , "basePath" , "git" ) ; cfg.setString ( "user" , null , "name" , "Gerrit Code Review" ) ; cfg.setString ( "user" , null , "email" , "gerrit@localhost" ) ; bind ( org.eclipse.jgit.lib.Config.class ) . annotatedWith ( com.google.gerrit.server.config.GerritServerConfig.class ) . toInstance ( cfg ) ; bind ( org.eclipse.jgit.lib.PersonIdent.class ) . annotatedWith ( com.google.gerrit.server.GerritPersonIdent.class ) . toProvider ( com.google.gerrit.server.GerritPersonIdentProvider.class ) ; bind ( com.google.gerrit.server.config.AllProjectsName.class ) . toInstance ( new com.google.gerrit.server.config.AllProjectsName ( "All-Projects" ) ) ; bind ( com.google.gerrit.server.git.GitRepositoryManager.class ) . to ( com.google.gerrit.server.git.LocalDiskRepositoryManager.class ) ; }
Source:
private com.google.gerrit.reviewdb.client.ChangeMessage newMessage ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx ) throws com.google.gwtorm.server.OrmException { java.lang.StringBuilder msg = new java.lang.StringBuilder ( ) ; msg.append ( "Abandoned" ) ; if ( ! ( com.google.common.base.Strings.nullToEmpty ( msgTxt ) . trim ( ) . isEmpty ( ) ) ) { msg.append ( "\n\n" ) ; msg.append ( msgTxt.trim ( ) ) ; } return com.google.gerrit.server.ChangeMessagesUtil.newMessage ( ctx , msg.toString ( ) ) ; }

Target:
private com.google.gerrit.reviewdb.client.ChangeMessage newMessage ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx ) throws com.google.gwtorm.server.OrmException { java.lang.StringBuilder msg = new java.lang.StringBuilder ( ) ; msg.append ( "Abandoned" ) ; if ( ! ( com.google.common.base.Strings.nullToEmpty ( msgTxt ) . trim ( ) . isEmpty ( ) ) ) { msg.append ( "\n\n" ) ; msg.append ( msgTxt.trim ( ) ) ; } return com.google.gerrit.server.ChangeMessagesUtil.newMessage ( ctx , msg.toString ( ) , ChangeMessagesUtil.TAG_ABANDON ) ; }
Source:
private com.google.gerrit.common.ChangeHookRunner.ApprovalAttribute getApprovalAttribute ( java.util.Map.Entry < com.google.gerrit.reviewdb.ApprovalCategory.Id , com.google.gerrit.reviewdb.ApprovalCategoryValue.Id > approval ) { com.google.gerrit.common.ChangeHookRunner.ApprovalAttribute a = new com.google.gerrit.common.ChangeHookRunner.ApprovalAttribute ( ) ; a.type = approval.getKey ( ) . get ( ) ; final com.google.gerrit.common.data.ApprovalType at = approvalTypes.getApprovalType ( approval.getKey ( ) ) ; a.description = at.getCategory ( ) . getName ( ) ; a.value = java.lang.Short.toString ( approval.getValue ( ) . get ( ) ) ; return a ; }

Target:
private com.google.gerrit.server.events.ApprovalAttribute getApprovalAttribute ( java.util.Map.Entry < com.google.gerrit.reviewdb.ApprovalCategory.Id , com.google.gerrit.reviewdb.ApprovalCategoryValue.Id > approval ) { com.google.gerrit.server.events.ApprovalAttribute a = new com.google.gerrit.server.events.ApprovalAttribute ( ) ; a.type = approval.getKey ( ) . get ( ) ; final com.google.gerrit.common.data.ApprovalType at = approvalTypes.getApprovalType ( approval.getKey ( ) ) ; a.description = at.getCategory ( ) . getName ( ) ; a.value = java.lang.Short.toString ( approval.getValue ( ) . get ( ) ) ; return a ; }
Source:
public java.lang.Iterable < com.google.gerrit.extensions.common.WebLinkInfo > getBranchLinks ( java.lang.String project , java.lang.String branch ) { java.util.List < com.google.gerrit.extensions.common.WebLinkInfo > links = com.google.common.collect.Lists.newArrayList ( ) ; for ( com.google.gerrit.extensions.webui.BranchWebLink webLink : branchLinks ) { links.add ( new com.google.gerrit.extensions.common.WebLinkInfo ( webLink.getLinkName ( ) , webLink.getImageUrl ( ) , webLink.getBranchUrl ( project , branch ) , webLink.getTarget ( ) ) ) ; } return links ; }

Target:
public com.google.common.collect.FluentIterable < com.google.gerrit.extensions.common.WebLinkInfo > getBranchLinks ( final java.lang.String project , final java.lang.String branch ) { return filterLinks ( branchLinks , 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.BranchWebLink ) ( webLink ) ) . getBranchWebLink ( project , branch ) ; } } ) ; }
Source:
protected void configureServlets ( ) { filter ( "/p/*" ) . through ( com.google.gerrit.httpd.ProjectAccessPathFilter.class ) ; if ( authConfig.isTrustContainerAuth ( ) ) { filter ( "/p/*" ) . through ( com.google.gerrit.httpd.ContainerAuthFilter.class ) ; } else { filter ( "/p/*" ) . through ( com.google.gerrit.httpd.ProjectDigestFilter.class ) ; } serve ( "/p/*" ) . with ( com.google.gerrit.httpd.ProjectServlet.class ) ; }

Target:
protected void configureServlets ( ) { install ( new com.google.gerrit.httpd.ProjectServlet.Module ( ) ) ; filter ( "/p/*" ) . through ( com.google.gerrit.httpd.ProjectAccessPathFilter.class ) ; if ( authConfig.isTrustContainerAuth ( ) ) { filter ( "/p/*" ) . through ( com.google.gerrit.httpd.ContainerAuthFilter.class ) ; } else { filter ( "/p/*" ) . through ( com.google.gerrit.httpd.ProjectDigestFilter.class ) ; } serve ( "/p/*" ) . with ( com.google.gerrit.httpd.ProjectServlet.class ) ; }
Source:
private void renderLinks ( ) { for ( com.google.gerrit.client.ui.InlineHyperlink link : getLinks ( ) ) { linkPanel.add ( link ) ; } }

Target:
private void renderLinks ( com.google.gerrit.client.editor.EditFileInfo info , com.google.gerrit.client.diff.DiffInfo diffInfo ) { for ( com.google.gerrit.client.ui.InlineHyperlink link : getLinks ( ) ) { linkPanel.add ( link ) ; } if ( info != null ) { renderPluginLinks ( com.google.gerrit.client.rpc.Natives.asList ( info.web_links ( ) ) ) ; } else if ( diffInfo != null ) { renderPluginLinks ( com.google.gerrit.client.rpc.Natives.asList ( diffInfo.web_links ( ) ) ) ; } }
Source:
public void dontSkipByDefault ( ) throws java.lang.Exception { com.googlesource.gerrit.plugins.uploadvalidator.ValidatorConfig validatorConfig = new com.googlesource.gerrit.plugins.uploadvalidator.ValidatorConfig ( new com.googlesource.gerrit.plugins.uploadvalidator.FakeConfigFactory ( projectName , "" ) , new com.googlesource.gerrit.plugins.uploadvalidator.FakeUserProvider ( ) , new com.googlesource.gerrit.plugins.uploadvalidator.FakeGroupCacheUUIDByName ( ) ) ; com.google.common.truth.Truth.assertThat ( validatorConfig.isEnabledForRef ( projectName , "anyRef" , "anyOp" ) ) . isTrue ( ) ; }

Target:
public void dontSkipByDefault ( ) throws java.lang.Exception { com.googlesource.gerrit.plugins.uploadvalidator.ValidatorConfig validatorConfig = new com.googlesource.gerrit.plugins.uploadvalidator.ValidatorConfig ( new com.googlesource.gerrit.plugins.uploadvalidator.FakeConfigFactory ( projectName , "" ) , new com.googlesource.gerrit.plugins.uploadvalidator.FakeGroupCacheUUIDByName ( ) ) ; com.google.common.truth.Truth.assertThat ( validatorConfig.isEnabledForRef ( anyUser , projectName , "anyRef" , "anyOp" ) ) . isTrue ( ) ; }
Source:
public void onSuccess ( final com.google.gerrit.reviewdb.AccountSshKey result ) { addNew.setEnabled ( true ) ; addTxt.setText ( "" ) ; keys.addOneKey ( result ) ; if ( ! ( keys.isVisible ( ) ) ) { showAddKeyBlock ( false ) ; setKeyTableVisible ( true ) ; keys.updateDeleteButton ( ) ; } }

Target:
public void onSuccess ( final java.util.List < com.google.gerrit.common.data.SshHostKey > result ) { serverKeys.clear ( ) ; for ( final com.google.gerrit.common.data.SshHostKey keyInfo : result ) { serverKeys.add ( new com.google.gerrit.client.account.SshHostKeyPanel ( keyInfo ) ) ; } if ( ( ++ ( loadCount ) ) == 2 ) { display ( ) ; } }
Source:
private void assertUnchangedMessage ( com.google.common.base.Optional < com.google.gerrit.server.edit.ChangeEdit > edit , java.lang.String message ) throws java.lang.Exception { try { modifier.modifyMessage ( edit.get ( ) , message ) ; fail ( "UnchangedCommitMessageException expected" ) ; } catch ( com.google.gerrit.server.edit.UnchangedCommitMessageException ex ) { com.google.common.truth.Truth.assertThat ( ex.getMessage ( ) ) . isEqualTo ( "New commit message cannot be same as existing commit message" ) ; } }

Target:
private void assertUnchangedMessage ( com.google.common.base.Optional < com.google.gerrit.server.edit.ChangeEdit > edit , java.lang.String message ) throws java.lang.Exception { exception.expect ( com.google.gerrit.server.edit.UnchangedCommitMessageException.class ) ; exception.expectMessage ( "New commit message cannot be same as existing commit message" ) ; modifier.modifyMessage ( edit.get ( ) , message ) ; }
Source:
public T call ( ) throws java.lang.Exception { com.google.gerrit.server.RequestCleanup cleanup = scope.scope ( com.google.inject.Key.get ( com.google.gerrit.server.RequestCleanup.class ) , new com.google.inject.Provider < com.google.gerrit.server.RequestCleanup > ( ) { @ java.lang.Override public com.google.gerrit.server.RequestCleanup get ( ) { return new com.google.gerrit.server.RequestCleanup ( ) ; } } ) . get ( ) ; try { return callable.call ( ) ; } finally { cleanup.run ( ) ; } }

Target:
protected < T > java.util.concurrent.Callable < T > cleanup ( final java.util.concurrent.Callable < T > callable ) { return ( ) -> { com.google.gerrit.server.RequestCleanup cleanup = scope.scope ( com.google.inject.Key.get ( com.google.gerrit.server.RequestCleanup.class ) , new com.google.inject.Provider < com.google.gerrit.server.RequestCleanup > ( ) { @ java.lang.Override public com.google.gerrit.server.RequestCleanup get ( ) { return new com.google.gerrit.server.RequestCleanup ( ) ; } } ) . get ( ) ; try { return callable.call ( ) ; } finally { cleanup.run ( ) ; } } ; }
Source:
private void fireHook ( ) { final java.util.Map < com.google.gerrit.reviewdb.ApprovalCategory.Id , com.google.gerrit.reviewdb.ApprovalCategoryValue.Id > changed = new java.util.HashMap < com.google.gerrit.reviewdb.ApprovalCategory.Id , com.google.gerrit.reviewdb.ApprovalCategoryValue.Id > ( ) ; for ( com.google.gerrit.reviewdb.ApprovalCategoryValue.Id v : approvals ) { changed.put ( v.getParentKey ( ) , v ) ; } hooks.doCommentAddedHook ( change , user.getAccount ( ) , patchSet , messageText , changed ) ; }

Target:
private void fireHook ( ) throws com.google.gwtorm.client.OrmException { final java.util.Map < com.google.gerrit.reviewdb.ApprovalCategory.Id , com.google.gerrit.reviewdb.ApprovalCategoryValue.Id > changed = new java.util.HashMap < com.google.gerrit.reviewdb.ApprovalCategory.Id , com.google.gerrit.reviewdb.ApprovalCategoryValue.Id > ( ) ; for ( com.google.gerrit.reviewdb.ApprovalCategoryValue.Id v : approvals ) { changed.put ( v.getParentKey ( ) , v ) ; } hooks.doCommentAddedHook ( change , user.getAccount ( ) , patchSet , messageText , changed , db ) ; }
Source:
protected PushOneCommit.Result createChange ( org.eclipse.jgit.api.Git git , java.lang.String subject , java.lang.String fileName , java.lang.String content ) throws java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , admin.getIdent ( ) , git , subject , fileName , content ) ; return push.to ( "refs/for/master" ) ; }

Target:
protected PushOneCommit.Result createChange ( java.lang.String subject , java.lang.String fileName , java.lang.String content , java.lang.String topic ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , admin.getIdent ( ) , testRepo , subject , fileName , content ) ; return push.to ( ( "refs/for/master/" + topic ) ) ; }
Source:
private void deleteRemoteSsh ( org.eclipse.jgit.transport.URIish uri ) { java.lang.String quotedPath = QuotedString.BOURNE.quote ( uri.getPath ( ) ) ; java.lang.String cmd = "rm -rf " + quotedPath ; java.io.OutputStream errStream = com.googlesource.gerrit.plugins.replication.ReplicationQueue.newErrorBufferStream ( ) ; try { executeRemoteSsh ( uri , cmd , errStream ) ; } catch ( java.io.IOException e ) { com.googlesource.gerrit.plugins.replication.ReplicationQueue.repLog.error ( java.lang.String.format ( ( "Error deleting remote repository at %s:\n" + ( ( " Exception: %s\n" + " Command: %s\n" ) + " Output: %s" ) ) , uri , e , cmd , errStream ) , e ) ; } }

Target:
private void deleteRemoteSsh ( org.eclipse.jgit.transport.URIish uri ) { java.lang.String quotedPath = QuotedString.BOURNE.quote ( uri.getPath ( ) ) ; java.lang.String cmd = "rm -rf " + quotedPath ; java.io.OutputStream errStream = sshHelper.newErrorBufferStream ( ) ; try { sshHelper.executeRemoteSsh ( uri , cmd , errStream ) ; } catch ( java.io.IOException e ) { com.googlesource.gerrit.plugins.replication.ReplicationQueue.repLog.error ( java.lang.String.format ( ( "Error deleting remote repository at %s:\n" + ( ( " Exception: %s\n" + " Command: %s\n" ) + " Output: %s" ) ) , uri , e , cmd , errStream ) , e ) ; } }
Source:
public java.lang.Object createTest ( ) throws java.lang.Exception { java.lang.Object test = getTestClass ( ) . getJavaClass ( ) . newInstance ( ) ; parameterField.set ( test , com.google.gerrit.testutil.ConfigSuite.callConfigMethod ( configMethod ) ) ; return test ; }

Target:
public java.lang.Object createTest ( ) throws java.lang.Exception { java.lang.Object test = getTestClass ( ) . getJavaClass ( ) . newInstance ( ) ; parameterField.set ( test , com.google.gerrit.testutil.ConfigSuite.callConfigMethod ( configMethod ) ) ; if ( ( nameField ) != null ) { nameField.set ( test , name ) ; } return test ; }
Source:
public void onSuccess ( com.google.gerrit.reviewdb.client.Account currentUser ) { box.hide ( ) ; if ( ( com.google.gerrit.client.Gerrit.getConfig ( ) . getAuthType ( ) ) == ( com.google.gerrit.reviewdb.client.AuthType.DEVELOPMENT_BECOME_ANY_ACCOUNT ) ) { currentEmail = addr ; if ( ( emailPick.getItemCount ( ) ) == 0 ) { onSaveSuccess ( currentUser ) ; } else { save.setEnabled ( true ) ; } updateEmailList ( ) ; } }

Target:
public void onSuccess ( com.google.gerrit.client.rpc.NativeString result ) { box.hide ( ) ; if ( ( com.google.gerrit.client.Gerrit.getConfig ( ) . getAuthType ( ) ) == ( com.google.gerrit.reviewdb.client.AuthType.DEVELOPMENT_BECOME_ANY_ACCOUNT ) ) { currentEmail = addr ; if ( ( emailPick.getItemCount ( ) ) == 0 ) { final com.google.gerrit.reviewdb.client.Account me = com.google.gerrit.client.Gerrit.getUserAccount ( ) ; me.setPreferredEmail ( addr ) ; onSaveSuccess ( me ) ; } else { save.setEnabled ( true ) ; } updateEmailList ( ) ; } }
Source:
public static void restoreContent ( com.google.gerrit.reviewdb.client.PatchSet.Id id , java.lang.String filename , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.VoidResult > result ) { com.google.gerrit.client.changes.ChangeFileApi.Input in = com.google.gerrit.client.changes.ChangeFileApi.Input.create ( ) ; in.path ( filename ) ; in.restore ( true ) ; com.google.gerrit.client.changes.ChangeApi.edit ( id.getParentKey ( ) . get ( ) ) . post ( in , result ) ; }

Target:
public static void restoreContent ( com.google.gerrit.reviewdb.client.PatchSet.Id id , java.lang.String filename , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.VoidResult > result ) { com.google.gerrit.client.changes.ChangeFileApi.Input in = com.google.gerrit.client.changes.ChangeFileApi.Input.create ( ) ; in.restore_path ( filename ) ; com.google.gerrit.client.changes.ChangeApi.edit ( id.getParentKey ( ) . get ( ) ) . post ( in , result ) ; }
Source:
static void call ( final com.google.gerrit.reviewdb.client.Change.Id id , java.lang.String revision ) { com.google.gerrit.client.changes.ChangeApi.rebase ( id.get ( ) , revision , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.changes.ChangeInfo > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.changes.ChangeInfo result ) { com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( id ) ) ; } } ) ; }

Target:
public void onFailure ( java.lang.Throwable caught ) { enableButtons ( true ) ; super . onFailure ( caught ) ; }
Source:
public void restoreFile ( java.lang.String filePath ) throws com.google.gerrit.extensions.restapi.RestApiException { try { com.google.gerrit.server.change.ChangeEdits.Post.Input restoreInput = new com.google.gerrit.server.change.ChangeEdits.Post.Input ( ) ; restoreInput.restorePath = filePath ; changeEditsPost.apply ( changeResource , restoreInput ) ; } catch ( java.io.IOException | com.google.gwtorm.server.OrmException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot restore file of change edit" , e ) ; } }

Target:
public void restoreFile ( java.lang.String filePath ) throws com.google.gerrit.extensions.restapi.RestApiException { try { com.google.gerrit.server.change.ChangeEdits.Post.Input restoreInput = new com.google.gerrit.server.change.ChangeEdits.Post.Input ( ) ; restoreInput.restorePath = filePath ; changeEditsPost.apply ( changeResource , restoreInput ) ; } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( "Cannot restore file of change edit" , e ) ; } }
Source:
public void patchSets ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; com.google.gerrit.reviewdb.client.Change.Id id = r.getPatchSetId ( ) . getParentKey ( ) ; r = amendChange ( r.getChangeId ( ) ) ; checker.checkChanges ( id ) ; }

Target:
public void rebuildViaRestApi ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; com.google.gerrit.reviewdb.client.Change.Id id = r.getPatchSetId ( ) . getParentKey ( ) ; notesMigration.setWriteChanges ( true ) ; checker.assertNoChangeRef ( project , id ) ; rebuildHandler.apply ( parseChangeResource ( r.getChangeId ( ) ) , new com.google.gerrit.server.change.Rebuild.Input ( ) ) ; checker.checkChanges ( id ) ; }
Source:
private void load ( ) throws java.io.IOException { if ( ( migration.write ( ) ) && ( ( getRevision ( ) ) == null ) ) { org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( getProjectName ( ) ) ; try { load ( repo ) ; } catch ( org.eclipse.jgit.errors.ConfigInvalidException e ) { throw new java.io.IOException ( e ) ; } finally { repo.close ( ) ; } } }

Target:
private void load ( ) throws java.io.IOException { if ( ( migration.writeChanges ( ) ) && ( ( getRevision ( ) ) == null ) ) { org.eclipse.jgit.lib.Repository repo = repoManager.openMetadataRepository ( getProjectName ( ) ) ; try { load ( repo ) ; } catch ( org.eclipse.jgit.errors.ConfigInvalidException e ) { throw new java.io.IOException ( e ) ; } finally { repo.close ( ) ; } } }
Source:
public void testNoCommand ( ) throws java.lang.Exception { assertEquals ( Type.HOST_INDEX , getView ( "/" ) . getType ( ) ) ; assertEquals ( Type.REPOSITORY_INDEX , getView ( "/repo" ) . getType ( ) ) ; assertNull ( getView ( "/repo/+" ) ) ; assertNull ( getView ( "/repo/+/" ) ) ; }

Target:
public void noCommand ( ) throws java.lang.Exception { org.junit.Assert.assertEquals ( Type.HOST_INDEX , getView ( "/" ) . getType ( ) ) ; org.junit.Assert.assertEquals ( Type.REPOSITORY_INDEX , getView ( "/repo" ) . getType ( ) ) ; org.junit.Assert.assertNull ( getView ( "/repo/+" ) ) ; org.junit.Assert.assertNull ( getView ( "/repo/+/" ) ) ; }
Source:
private boolean can ( com.google.gerrit.server.permissions.LabelPermission.WithValue perm ) { com.google.gerrit.common.data.PermissionRange r = label ( perm.permissionName ( ) . get ( ) ) ; if ( ( ( perm.forUser ( ) ) == ( com.google.gerrit.server.permissions.LabelPermission.ForUser.ON_BEHALF_OF ) ) && ( r.isEmpty ( ) ) ) { return false ; } return r.contains ( perm.value ( ) ) ; }

Target:
private boolean can ( com.google.gerrit.server.permissions.LabelPermission.WithValue perm ) { com.google.gerrit.common.data.PermissionRange r = label ( perm.permissionName ( ) . get ( ) ) ; if ( ( ( perm.forUser ( ) ) == ( ForUser.ON_BEHALF_OF ) ) && ( r.isEmpty ( ) ) ) { return false ; } return r.contains ( perm.value ( ) ) ; }
Source:
private void deleteRemoteSsh ( org.eclipse.jgit.transport.URIish uri ) { java.lang.String quotedPath = QuotedString.BOURNE.quote ( uri.getPath ( ) ) ; java.lang.String cmd = "rm -rf " + quotedPath ; java.io.OutputStream errStream = sshHelper.newErrorBufferStream ( ) ; HEAD ( ( 5723.0F - 2.15 ) ) ; sshHelper.executeRemoteSsh ( uri , cmd , errStream ) ; }

Target:
private void deleteRemoteSsh ( org.eclipse.jgit.transport.URIish uri ) { java.lang.String quotedPath = QuotedString.BOURNE.quote ( uri.getPath ( ) ) ; java.lang.String cmd = "rm -rf " + quotedPath ; java.io.OutputStream errStream = sshHelper.newErrorBufferStream ( ) ; try { sshHelper.executeRemoteSsh ( uri , cmd , errStream ) ; com.googlesource.gerrit.plugins.replication.ReplicationQueue.repLog.info ( "Deleted remote repository: {}" , uri ) ; } catch ( java.io.IOException e ) { com.googlesource.gerrit.plugins.replication.ReplicationQueue.repLog.error ( ( "Error deleting remote repository at {}:\n" + ( ( " Exception: {}\n" + " Command: {}\n" ) + " Output: {}" ) ) , uri , e , cmd , errStream , e ) ; } }
Source:
public void onSuccess ( final com.google.gerrit.client.VoidResult result ) { for ( int row = 1 ; row < ( table.getRowCount ( ) ) ; ) { final com.google.gerrit.client.groups.MemberInfo i = getRowItem ( row ) ; if ( ( i != null ) && ( ids.contains ( i.getAccountId ( ) ) ) ) { table.removeRow ( row ) ; } else { row ++ ; } } }

Target:
public void onSuccess ( final com.google.gerrit.client.VoidResult result ) { for ( int row = 1 ; row < ( table.getRowCount ( ) ) ; ) { final com.google.gerrit.client.account.AccountInfo i = getRowItem ( row ) ; if ( ( i != null ) && ( ids.contains ( i._account_id ( ) ) ) ) { table.removeRow ( row ) ; } else { row ++ ; } } }
Source:
public java.util.SortedSet < com.google.gerrit.reviewdb.client.Project.NameKey > list ( ) { namesUpdateLock.lock ( ) ; try { com.google.gerrit.server.git.LocalDiskRepositoryManager.ProjectVisitor visitor = new com.google.gerrit.server.git.LocalDiskRepositoryManager.ProjectVisitor ( basePath ) ; scanProjects ( visitor ) ; return java.util.Collections.unmodifiableSortedSet ( visitor.found ) ; } finally { namesUpdateLock.unlock ( ) ; } }

Target:
public java.util.SortedSet < com.google.gerrit.reviewdb.client.Project.NameKey > list ( ) { com.google.gerrit.server.git.LocalDiskRepositoryManager.ProjectVisitor visitor = new com.google.gerrit.server.git.LocalDiskRepositoryManager.ProjectVisitor ( basePath ) ; scanProjects ( visitor ) ; namesUpdateLock.lock ( ) ; try { names = java.util.Collections.unmodifiableSortedSet ( visitor.found ) ; } finally { namesUpdateLock.unlock ( ) ; } return names ; }
Source:
protected void assertQuery ( com.google.gerrit.extensions.api.changes.Changes.QueryRequest query , com.google.gerrit.reviewdb.client.Change ... changes ) throws java.lang.Exception { com.google.common.truth.Truth.assertThat ( com.google.gerrit.server.query.change.AbstractQueryChangesTest.query ( query ) ) . named ( query.toString ( ) ) . containsExactlyElementsIn ( com.google.gerrit.server.query.change.AbstractQueryChangesTest.ids ( changes ) ) . inOrder ( ) ; }

Target:
protected java.util.List < com.google.gerrit.extensions.common.ChangeInfo > assertQuery ( com.google.gerrit.extensions.api.changes.Changes.QueryRequest query , com.google.gerrit.reviewdb.client.Change ... changes ) throws java.lang.Exception { java.util.List < com.google.gerrit.extensions.common.ChangeInfo > result = query.get ( ) ; java.lang.Iterable < java.lang.Integer > ids = com.google.gerrit.server.query.change.AbstractQueryChangesTest.ids ( result ) ; com.google.common.truth.Truth.assertThat ( ids ) . named ( ids.toString ( ) ) . containsExactlyElementsIn ( com.google.gerrit.server.query.change.AbstractQueryChangesTest.ids ( changes ) ) . inOrder ( ) ; return result ; }
Source:
protected void doInsert ( final java.lang.Iterable < T > instances , final com.google.gwtorm.jdbc.JdbcTransaction txn ) throws com.google.gwtorm.client.OrmException { try { if ( schema.getDialect ( ) . canDetermineIndividualBatchUpdateCounts ( ) ) { insertAsBatch ( instances ) ; } else { insertIndividually ( instances ) ; } } catch ( java.sql.SQLException e ) { throw convertError ( "insert" , e ) ; } }

Target:
public void insert ( final java.lang.Iterable < T > instances ) throws com.google.gwtorm.server.OrmException { try { if ( schema.getDialect ( ) . canDetermineTotalBatchUpdateCount ( ) ) { insertAsBatch ( instances ) ; } else { insertIndividually ( instances ) ; } } catch ( java.sql.SQLException e ) { throw convertError ( "insert" , e ) ; } }
Source:
private static synchronized java.util.concurrent.ScheduledThreadPoolExecutor shutdown ( ) { final java.util.concurrent.ScheduledThreadPoolExecutor p = com.google.gerrit.git.WorkQueue.pool ; if ( p != null ) { p.shutdown ( ) ; com.google.gerrit.git.WorkQueue.pool = null ; return p ; } return null ; }

Target:
public static com.google.gerrit.git.WorkQueue.Task < ? > [ ] getTasks ( ) { final java.util.List < com.google.gerrit.git.WorkQueue.Task < ? > > r = new java.util.ArrayList < com.google.gerrit.git.WorkQueue.Task < ? > > ( ) ; for ( final com.google.gerrit.git.WorkQueue.Executor e : com.google.gerrit.git.WorkQueue.queues ) { e.addAllTo ( r ) ; } return r.toArray ( new com.google.gerrit.git.WorkQueue.Task [ r.size ( ) ] ) ; }
Source:
public java.util.List < com.googlesource.gerrit.plugins.github.MenuEntry > getEntries ( ) { if ( ( userProvider.get ( ) ) instanceof com.google.gerrit.server.IdentifiedUser ) { return menuEntries ; } else { return java.util.Collections.emptyList ( ) ; } }

Target:
public java.util.List < com.googlesource.gerrit.plugins.github.MenuEntry > getEntries ( ) { if ( ( ( userProvider.get ( ) ) instanceof com.google.gerrit.server.IdentifiedUser ) && ( authConfig.getAuthType ( ) . equals ( AuthType.HTTP ) ) ) { return menuEntries ; } else { return java.util.Collections.emptyList ( ) ; } }
Source:
public < V > com.google.gerrit.metrics.CallbackMetric < V > newCallbackMetric ( java.lang.String name , java.lang.Class < V > valueClass , com.google.gerrit.metrics.Description desc ) { checkNotDefined ( name ) ; return new com.google.gerrit.metrics.dropwizard.DropWizardMetricMaker.CallbackMetricImpl < V > ( name , valueClass ) ; }

Target:
public < V > com.google.gerrit.metrics.CallbackMetric < V > newCallbackMetric ( java.lang.String name , java.lang.Class < V > valueClass , com.google.gerrit.metrics.Description desc ) { checkNotDefined ( name ) ; descriptions.put ( name , desc.getAnnotations ( ) ) ; return new com.google.gerrit.metrics.dropwizard.DropWizardMetricMaker.CallbackMetricImpl < V > ( name , valueClass ) ; }
Source:
public void byCommit ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < com.google.gerrit.testutil.InMemoryRepositoryManager.Repo > repo = createProject ( "repo" ) ; com.google.gerrit.server.change.ChangeInserter ins = newChange ( repo ) ; insert ( repo , ins ) ; java.lang.String sha = ins.getPatchSet ( ) . getRevision ( ) . get ( ) ; assertQuery ( "0000000000000000000000000000000000000000" ) ; for ( int i = 0 ; i <= 36 ; i ++ ) { java.lang.String q = sha.substring ( 0 , ( 40 - i ) ) ; assertQuery ( q , ins.getChange ( ) ) ; } }

Target:
public void byCommit ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < com.google.gerrit.testutil.InMemoryRepositoryManager.Repo > repo = createProject ( "repo" ) ; com.google.gerrit.server.change.ChangeInserter ins = newChange ( repo ) ; insert ( repo , ins ) ; java.lang.String sha = ins.getCommit ( ) . name ( ) ; assertQuery ( "0000000000000000000000000000000000000000" ) ; for ( int i = 0 ; i <= 36 ; i ++ ) { java.lang.String q = sha.substring ( 0 , ( 40 - i ) ) ; assertQuery ( q , ins.getChange ( ) ) ; } }
Source:
private boolean isIndexPredicate ( com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > in , com.google.gerrit.server.index.ChangeIndex index ) { if ( ! ( in instanceof com.google.gerrit.server.index.IndexPredicate ) ) { return false ; } com.google.gerrit.server.index.IndexPredicate < com.google.gerrit.server.query.change.ChangeData > p = ( ( com.google.gerrit.server.index.IndexPredicate < com.google.gerrit.server.query.change.ChangeData > ) ( in ) ) ; return index.getSchema ( ) . getFields ( ) . containsKey ( p.getField ( ) . getName ( ) ) ; }

Target:
private boolean isIndexPredicate ( com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > in , com.google.gerrit.server.index.ChangeIndex index ) { if ( ! ( in instanceof com.google.gerrit.server.index.IndexPredicate ) ) { return false ; } com.google.gerrit.server.index.IndexPredicate < com.google.gerrit.server.query.change.ChangeData > p = ( ( com.google.gerrit.server.index.IndexPredicate < com.google.gerrit.server.query.change.ChangeData > ) ( in ) ) ; return index.getSchema ( ) . hasField ( p.getField ( ) ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { java.lang.Class.forName ( com.mysql.jdbc.Driver.class . getName ( ) ) ; final java.lang.String host = "localhost" ; final java.lang.String database = "gwtorm" ; final java.lang.String user = "gwtorm" ; final java.lang.String pass = "gwtorm" ; final java.lang.String url = ( ( "jdbc:mysql://" + host ) + "/" ) + database ; db = java.sql.DriverManager.getConnection ( url , user , pass ) ; executor = new com.google.gwtorm.jdbc.JdbcExecutor ( db ) ; dialect = new com.google.gwtorm.schema.sql.DialectMySQL ( ) . refine ( db ) ; final java.util.Properties p = new java.util.Properties ( ) ; p.setProperty ( "driver" , com.mysql.jdbc.Driver.class . getName ( ) ) ; p.setProperty ( "url" , db.getMetaData ( ) . getURL ( ) ) ; p.setProperty ( "user" , user ) ; p.setProperty ( "password" , pass ) ; phoneBook = new com.google.gwtorm.jdbc.Database < com.google.gwtorm.data.PhoneBookDb > ( new com.google.gwtorm.jdbc.SimpleDataSource ( p ) , com.google.gwtorm.data.PhoneBookDb.class ) ; phoneBook2 = new com.google.gwtorm.jdbc.Database < com.google.gwtorm.data.PhoneBookDb2 > ( new com.google.gwtorm.jdbc.SimpleDataSource ( p ) , com.google.gwtorm.data.PhoneBookDb2.class ) ; drop ( "TABLE address_id" ) ; drop ( "TABLE addresses" ) ; drop ( "TABLE cnt" ) ; drop ( "TABLE foo" ) ; drop ( "TABLE people" ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { java.lang.Class.forName ( com.mysql.jdbc.Driver.class . getName ( ) ) ; final java.lang.String host = "localhost" ; final java.lang.String database = "gwtorm" ; final java.lang.String user = "gwtorm" ; final java.lang.String pass = "gwtorm" ; final java.lang.String url = ( ( "jdbc:mysql://" + host ) + "/" ) + database ; try { db = java.sql.DriverManager.getConnection ( url , user , pass ) ; } catch ( java.lang.Throwable t ) { org.junit.Assume.assumeNoException ( t ) ; } executor = new com.google.gwtorm.jdbc.JdbcExecutor ( db ) ; dialect = new com.google.gwtorm.schema.sql.DialectMySQL ( ) . refine ( db ) ; final java.util.Properties p = new java.util.Properties ( ) ; p.setProperty ( "driver" , com.mysql.jdbc.Driver.class . getName ( ) ) ; p.setProperty ( "url" , db.getMetaData ( ) . getURL ( ) ) ; p.setProperty ( "user" , user ) ; p.setProperty ( "password" , pass ) ; phoneBook = new com.google.gwtorm.jdbc.Database < com.google.gwtorm.data.PhoneBookDb > ( new com.google.gwtorm.jdbc.SimpleDataSource ( p ) , com.google.gwtorm.data.PhoneBookDb.class ) ; phoneBook2 = new com.google.gwtorm.jdbc.Database < com.google.gwtorm.data.PhoneBookDb2 > ( new com.google.gwtorm.jdbc.SimpleDataSource ( p ) , com.google.gwtorm.data.PhoneBookDb2.class ) ; drop ( "TABLE address_id" ) ; drop ( "TABLE addresses" ) ; drop ( "TABLE cnt" ) ; drop ( "TABLE foo" ) ; drop ( "TABLE people" ) ; }
Source:
public void onSuccess ( com.google.gerrit.client.rpc.NativeList < com.google.gerrit.client.changes.ChangeList > result ) { updateColumnsForLabels ( result.asList ( ) . toArray ( new com.google.gerrit.client.changes.ChangeList [ result.size ( ) ] ) ) ; for ( int i = 0 ; i < ( result.size ( ) ) ; i ++ ) { sections.get ( i ) . display ( result.get ( i ) ) ; } finishDisplay ( ) ; }

Target:
public void onSuccess ( com.google.gwt.core.client.JsArray < com.google.gerrit.client.changes.ChangeList > result ) { java.util.List < com.google.gerrit.client.changes.ChangeList > cls = com.google.gerrit.client.rpc.Natives.asList ( result ) ; updateColumnsForLabels ( cls.toArray ( new com.google.gerrit.client.changes.ChangeList [ cls.size ( ) ] ) ) ; for ( int i = 0 ; i < ( cls.size ( ) ) ; i ++ ) { sections.get ( i ) . display ( cls.get ( i ) ) ; } finishDisplay ( ) ; }
Source:
public void onSuccess ( final com.google.gwtjsonrpc.client.VoidResult result ) { for ( int row = 1 ; row < ( table.getRowCount ( ) ) ; ) { final com.google.gerrit.common.data.AccountProjectWatchInfo k = getRowItem ( row ) ; if ( ( k != null ) && ( ids.contains ( k.getWatch ( ) . getKey ( ) ) ) ) { table.removeRow ( row ) ; } else { row ++ ; } } }

Target:
public void onSuccess ( final com.google.gwtjsonrpc.client.VoidResult result ) { remove ( ids ) ; }
Source:
public static com.google.gerrit.server.change.PostReview.CommentSetEntry create ( com.google.gerrit.reviewdb.client.PatchLineComment comment ) { return com.google.gerrit.server.change.PostReview.CommentSetEntry.create ( comment.getKey ( ) . getParentKey ( ) , comment.getLine ( ) , com.google.gerrit.extensions.client.Side.fromShort ( comment.getSide ( ) ) , com.google.common.hash.Hashing.sha1 ( ) . hashString ( comment.getMessage ( ) , java.nio.charset.StandardCharsets.UTF_8 ) , comment.getRange ( ) ) ; }

Target:
public static com.google.gerrit.server.change.PostReview.CommentSetEntry create ( com.google.gerrit.reviewdb.client.Comment comment ) { return com.google.gerrit.server.change.PostReview.CommentSetEntry.create ( comment.key.filename , comment.key.patchSetId , comment.lineNbr , com.google.gerrit.extensions.client.Side.fromShort ( comment.side ) , com.google.common.hash.Hashing.sha1 ( ) . hashString ( comment.message , java.nio.charset.StandardCharsets.UTF_8 ) , comment.range ) ; }
Source:
private static java.lang.String providersListToString ( java.lang.Iterable < com.google.gerrit.server.plugins.ServerPluginProvider > providersHandlers ) { java.lang.Iterable < java.lang.String > providerNames = com.google.common.collect.Iterables.transform ( providersHandlers , new com.google.common.base.Function < com.google.gerrit.server.plugins.ServerPluginProvider , java.lang.String > ( ) { @ java.lang.Override public java.lang.String apply ( com.google.gerrit.server.plugins.ServerPluginProvider provider ) { return provider.getProviderPluginName ( ) ; } } ) ; return com.google.common.base.Joiner.on ( ", " ) . join ( providerNames ) ; }

Target:
private static java.lang.String providersListToString ( java.lang.Iterable < com.google.gerrit.server.plugins.ServerPluginProvider > providersHandlers ) { return java.util.stream.StreamSupport.stream ( providersHandlers.spliterator ( ) , false ) . map ( ServerPluginProvider :: getProviderPluginName ) . collect ( java.util.stream.Collectors.joining ( ", " ) ) ; }
Source:
public com.google.gerrit.client.data.ChangeDetail run ( final com.google.gerrit.client.reviewdb.ReviewDb db ) throws com.google.gerrit.client.changes.Failure , com.google.gwtorm.client.OrmException { final com.google.gerrit.client.reviewdb.Change change = db.changes ( ) . get ( id ) ; if ( change == null ) { throw new com.google.gerrit.client.changes.Failure ( new com.google.gerrit.client.rpc.NoSuchEntityException ( ) ) ; } final com.google.gerrit.client.data.ChangeDetail d = new com.google.gerrit.client.data.ChangeDetail ( ) ; d.load ( db , new com.google.gerrit.client.data.AccountCache ( db ) , change ) ; return d ; }

Target:
public com.google.gerrit.client.data.ChangeDetail run ( final com.google.gerrit.client.reviewdb.ReviewDb db ) throws com.google.gerrit.client.changes.Failure , com.google.gwtorm.client.OrmException { final com.google.gerrit.client.reviewdb.Change change = db.changes ( ) . get ( id ) ; if ( change == null ) { throw new com.google.gerrit.client.changes.Failure ( new com.google.gerrit.client.rpc.NoSuchEntityException ( ) ) ; } final com.google.gerrit.client.data.ChangeDetail d = new com.google.gerrit.client.data.ChangeDetail ( ) ; d.load ( db , new com.google.gerrit.client.data.AccountInfoCacheFactory ( db ) , change ) ; return d ; }