auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void addExtensionPoint ( com.google.gerrit.client.GerritUiExtensionPoint extensionPoint , com.google.gwt.user.client.ui.Panel p , com.google.gerrit.client.info.ChangeInfo change , com.google.gerrit.client.info.ChangeInfo.RevisionInfo rev ) { com.google.gerrit.client.api.ExtensionPanel extensionPanel = new com.google.gerrit.client.api.ExtensionPanel ( extensionPoint ) ; extensionPanel.putObject ( GerritUiExtensionPoint.Key.CHANGE_INFO , change ) ; extensionPanel.putObject ( GerritUiExtensionPoint.Key.REVISION_INFO , rev ) ; p.add ( extensionPanel ) ; }

Target:
private void addExtensionPoint ( com.google.gerrit.client.GerritUiExtensionPoint extensionPoint , com.google.gwt.user.client.ui.Panel p , com.google.gerrit.client.info.ChangeInfo change , com.google.gerrit.client.info.ChangeInfo.RevisionInfo rev , java.util.List < java.lang.String > panelNames ) { com.google.gerrit.client.api.ExtensionPanel extensionPanel = new com.google.gerrit.client.api.ExtensionPanel ( extensionPoint , panelNames ) ; extensionPanel.putObject ( GerritUiExtensionPoint.Key.CHANGE_INFO , change ) ; extensionPanel.putObject ( GerritUiExtensionPoint.Key.REVISION_INFO , rev ) ; p.add ( extensionPanel ) ; }
Source:
public java.lang.String getEmailFormat ( ) { return sConfig.emailFormat ; }

Target:
private com.google.gerrit.client.reviewdb.SystemConfig.LoginType getLoginType ( ) { java.lang.String type = getGerritConfig ( ) . getString ( "auth" , null , "type" ) ; if ( type == null ) { return com.google.gerrit.client.reviewdb.SystemConfig.LoginType.OPENID ; } for ( com.google.gerrit.client.reviewdb.SystemConfig.LoginType t : SystemConfig.LoginType.values ( ) ) { if ( type.equalsIgnoreCase ( t.name ( ) ) ) { return t ; } } throw new java.lang.IllegalStateException ( ( "Unsupported auth.type: " + type ) ) ; }
Source:
public void testTaggedCommitTime ( ) throws java.lang.Exception { org.eclipse.jgit.revwalk.RevCommit commit = repo.commit ( ) . create ( ) ; repo.tick ( 1 ) ; org.eclipse.jgit.revwalk.RevTag tag = repo.tag ( "tag" , commit ) ; assertEquals ( ( ( start ) + 1 ) , getTime ( commit ) ) ; assertEquals ( ( ( start ) + 2 ) , getTime ( tag ) ) ; }

Target:
public void taggedCommitTime ( ) throws java.lang.Exception { org.eclipse.jgit.revwalk.RevCommit commit = repo.commit ( ) . create ( ) ; repo.tick ( 1 ) ; org.eclipse.jgit.revwalk.RevTag tag = repo.tag ( "tag" , commit ) ; org.junit.Assert.assertEquals ( ( ( start ) + 1 ) , getTime ( commit ) ) ; org.junit.Assert.assertEquals ( ( ( start ) + 2 ) , getTime ( tag ) ) ; }
Source:
private static void append ( final java.lang.StringBuilder buffer , final java.lang.String name , final java.lang.String value ) { buffer.append ( '&' ) ; buffer.append ( name ) ; buffer.append ( '=' ) ; buffer.append ( org.mortbay.util.UrlEncoded.encodeString ( value ) ) ; }

Target:
private static void append ( final java.lang.StringBuilder buffer , final java.lang.String name , final java.lang.String value ) { if ( ( buffer.indexOf ( "?" ) ) >= 0 ) { buffer.append ( '&' ) ; } else { buffer.append ( '?' ) ; } buffer.append ( name ) ; buffer.append ( '=' ) ; buffer.append ( org.mortbay.util.UrlEncoded.encodeString ( value ) ) ; }
Source:
protected void bccStarredBy ( ) { try { for ( com.google.gerrit.reviewdb.client.StarredChange w : args.db.get ( ) . starredChanges ( ) . byChange ( change.getId ( ) ) ) { super . add ( RecipientType.BCC , w.getAccountId ( ) ) ; } } catch ( com.google.gwtorm.server.OrmException err ) { } }

Target:
protected void bccStarredBy ( ) { try { for ( com.google.gerrit.reviewdb.client.StarredChange w : args.db.get ( ) . starredChanges ( ) . byChange ( change.getId ( ) ) ) { super . add ( RecipientType.BCC , w.getAccountId ( ) ) ; } } catch ( com.google.gwtorm.server.OrmException err ) { com.google.gerrit.server.mail.ChangeEmail.log.warn ( "Cannot BCC users that starred updated change" , err ) ; } }
Source:
private static java.lang.String getFileNameOnly ( com.google.gerrit.reviewdb.Patch patch ) { java.lang.String fileName = patch.getFileName ( ) ; int s = fileName.lastIndexOf ( '/' ) ; if ( s >= 0 ) { fileName = fileName.substring ( ( s + 1 ) ) ; } return fileName ; }

Target:
private static java.lang.String getFileNameOnly ( com.google.gerrit.reviewdb.Patch patch ) { java.lang.String fileName = com.google.gerrit.client.changes.PatchTable.getDisplayFileName ( patch ) ; int s = fileName.lastIndexOf ( '/' ) ; if ( s >= 0 ) { fileName = fileName.substring ( ( s + 1 ) ) ; } return fileName ; }
Source:
public void byPathRegex ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < com.google.gerrit.testutil.InMemoryRepositoryManager.Repo > repo = createProject ( "repo" ) ; org.eclipse.jgit.revwalk.RevCommit commit = repo.parseBody ( repo.commit ( ) . message ( "one" ) . add ( "dir/file1" , "contents1" ) . add ( "dir/file2" , "contents2" ) . create ( ) ) ; com.google.gerrit.reviewdb.client.Change change = insert ( newChange ( repo , commit , null , null , null ) ) ; assertQuery ( "path:.*file.*" ) ; assertQuery ( "path:^dir.file.*" , change ) ; }

Target:
public void byAfter ( ) throws java.lang.Exception { com.google.gerrit.testutil.TestTimeUtil.resetWithClockStep ( 30 , java.util.concurrent.TimeUnit.HOURS ) ; org.eclipse.jgit.junit.TestRepository < com.google.gerrit.testutil.InMemoryRepositoryManager.Repo > repo = createProject ( "repo" ) ; com.google.gerrit.reviewdb.client.Change change1 = insert ( newChange ( repo ) ) ; com.google.gerrit.reviewdb.client.Change change2 = insert ( newChange ( repo ) ) ; com.google.gerrit.testutil.TestTimeUtil.setClockStep ( 0 , java.util.concurrent.TimeUnit.MILLISECONDS ) ; assertQuery ( "after:2009-10-03" ) ; assertQuery ( "after:\"2009-10-01 20:59:59 -0400\"" , change2 ) ; assertQuery ( "after:\"2009-10-01 20:59:59 -0000\"" , change2 ) ; assertQuery ( "after:2009-10-01" , change2 ) ; assertQuery ( "after:2009-09-30" , change2 , change1 ) ; }
Source:
protected void onLoad ( ) { super . onLoad ( ) ; Util.ACCOUNT_SVC.myProjectWatch ( new com.google.gerrit.client.rpc.GerritCallback < java.util.List < com.google.gerrit.common.data.AccountProjectWatchInfo > > ( ) { public void onSuccess ( final java.util.List < com.google.gerrit.common.data.AccountProjectWatchInfo > result ) { watches.display ( result ) ; } } ) ; }

Target:
protected void onLoad ( ) { super . onLoad ( ) ; Util.ACCOUNT_SVC.myProjectWatch ( new com.google.gerrit.client.rpc.ScreenLoadCallback < java.util.List < com.google.gerrit.common.data.AccountProjectWatchInfo > > ( this ) { public void preDisplay ( final java.util.List < com.google.gerrit.common.data.AccountProjectWatchInfo > result ) { watches.display ( result ) ; } } ) ; }
Source:
private void approve ( com.google.gerrit.acceptance.RestSession s , java.lang.String changeId , int expected ) throws java.io.IOException { com.google.gerrit.acceptance.RestResponse r = s.post ( ( ( "/changes/" + changeId ) + "/revisions/current/review" ) , new com.google.gerrit.extensions.api.changes.ReviewInput ( ) . label ( "Code-Review" , 2 ) ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( expected ) ; r.consume ( ) ; }

Target:
private void assertApproveFails ( com.google.gerrit.acceptance.TestAccount a , java.lang.String changeId ) throws java.lang.Exception { try { approve ( a , changeId ) ; } catch ( com.google.gerrit.extensions.restapi.AuthException expected ) { } }
Source:
public java.lang.String getGitHttpUrl ( ) throws java.net.UnknownHostException { java.lang.String httpListenUrl = getHttpListenUrl ( ) ; if ( httpListenUrl == null ) { return "" ; } java.lang.String httpUrl = com.google.common.base.Objects.firstNonNull ( canonicalWebUrlString , httpListenUrl ) ; httpUrl = httpUrl.replace ( "://" , ( ( "://" + ( com.googlesource.gerrit.plugins.gitblit.GitBlitUrlsConfig.GITBLIT_USER ) ) + "@" ) ) ; httpUrl += ( httpUrl.endsWith ( "/" ) ? "" : "/" ) + ( com.googlesource.gerrit.plugins.gitblit.GitBlitUrlsConfig.GITBLIT_REPO ) ; return httpUrl ; }

Target:
public java.lang.String getGitHttpUrl ( ) throws java.net.UnknownHostException { java.lang.String httpListenUrl = getHttpListenUrl ( ) ; if ( httpListenUrl == null ) { return "" ; } if ( ( ! ( downloadSchemes.isEmpty ( ) ) ) && ( ! ( downloadSchemes.contains ( "http" ) ) ) ) { return "" ; } java.lang.String httpUrl = com.google.common.base.Objects.firstNonNull ( canonicalWebUrlString , httpListenUrl ) ; httpUrl = httpUrl.replace ( "://" , ( ( "://" + ( com.googlesource.gerrit.plugins.gitblit.GitBlitUrlsConfig.GITBLIT_USER ) ) + "@" ) ) ; httpUrl += ( httpUrl.endsWith ( "/" ) ? "" : "/" ) + ( com.googlesource.gerrit.plugins.gitblit.GitBlitUrlsConfig.GITBLIT_REPO ) ; return httpUrl ; }
Source:
private void initUI ( ) { projects = new com.google.gerrit.client.admin.ProjectListScreen.ProjectTable ( ) ; projects.setSavePointerId ( Link.ADMIN_PROJECTS ) ; add ( projects ) ; final com.google.gwt.user.client.ui.VerticalPanel fp = new com.google.gwt.user.client.ui.VerticalPanel ( ) ; fp.setStyleName ( "gerrit-AddSshKeyPanel" ) ; fp.add ( new com.google.gerrit.client.ui.SmallHeading ( Util.C.headingCreateGroup ( ) ) ) ; }

Target:
protected void onInitUI ( ) { super . onInitUI ( ) ; setTitleText ( Util.C.projectListTitle ( ) ) ; projects = new com.google.gerrit.client.admin.ProjectListScreen.ProjectTable ( ) ; projects.setSavePointerId ( Link.ADMIN_PROJECTS ) ; add ( projects ) ; final com.google.gwt.user.client.ui.VerticalPanel fp = new com.google.gwt.user.client.ui.VerticalPanel ( ) ; fp.setStyleName ( "gerrit-AddSshKeyPanel" ) ; fp.add ( new com.google.gerrit.client.ui.SmallHeading ( Util.C.headingCreateGroup ( ) ) ) ; }
Source:
public void insertChange ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.reviewdb.client.PatchSet ps , org.eclipse.jgit.revwalk.RevCommit commit , com.google.gerrit.common.data.LabelTypes labelTypes , com.google.gerrit.reviewdb.client.PatchSetInfo info , java.util.Set < com.google.gerrit.reviewdb.client.Account.Id > reviewers ) throws com.google.gwtorm.server.OrmException { insertChange ( db , change , null , ps , commit , labelTypes , info , reviewers ) ; }

Target:
public com.google.gerrit.server.change.ChangeInserter setReviewers ( java.util.Set < com.google.gerrit.reviewdb.client.Account.Id > reviewers ) { this . reviewers = reviewers ; return this ; }
Source:
public void testUpdateOnePerson ( ) throws java.lang.Exception { final com.google.gwtorm.data.PhoneBookDb schema = open ( ) ; final com.google.gwtorm.data.TestPerson bob = new com.google.gwtorm.data.TestPerson ( new com.google.gwtorm.data.TestPerson.Key ( "Bob" ) , 18 ) ; schema.people ( ) . insert ( java.util.Collections.singleton ( bob ) ) ; bob.growOlder ( ) ; schema.people ( ) . update ( java.util.Collections.singleton ( bob ) ) ; }

Target:
public void testInsertManyPeople ( ) throws java.lang.Exception { final com.google.gwtorm.data.PhoneBookDb schema = open ( ) ; final java.util.ArrayList < com.google.gwtorm.data.Person > all = new java.util.ArrayList < com.google.gwtorm.data.Person > ( ) ; all.add ( new com.google.gwtorm.data.Person ( new com.google.gwtorm.data.Person.Key ( "Bob" ) , 18 ) ) ; all.add ( new com.google.gwtorm.data.Person ( new com.google.gwtorm.data.Person.Key ( "Mary" ) , 22 ) ) ; all.add ( new com.google.gwtorm.data.Person ( new com.google.gwtorm.data.Person.Key ( "Zak" ) , 33 ) ) ; schema.people ( ) . insert ( all ) ; }
Source:
public void withValidGroupName ( ) throws java.lang.Exception { java.lang.String newGroupName = "newGroup" ; adminRestSession.put ( ( "/groups/" + newGroupName ) ) ; java.lang.String newProjectName = "newProject" ; adminSshSession.exec ( ( ( ( "gerrit create-project --branch master --owner " + newGroupName ) + " " ) + newProjectName ) ) ; com.google.common.truth.Truth.assert_ ( ) . withMessage ( adminSshSession.getError ( ) ) . that ( adminSshSession.hasError ( ) ) . isFalse ( ) ; com.google.gerrit.server.project.ProjectState projectState = projectCache.get ( new com.google.gerrit.reviewdb.client.Project.NameKey ( newProjectName ) ) ; com.google.common.truth.Truth.assertThat ( projectState ) . isNotNull ( ) ; }

Target:
public void withValidGroupName ( ) throws java.lang.Exception { java.lang.String newGroupName = "newGroup" ; adminRestSession.put ( ( "/groups/" + newGroupName ) ) ; java.lang.String newProjectName = "newProject" ; adminSshSession.exec ( ( ( ( "gerrit create-project --branch master --owner " + newGroupName ) + " " ) + newProjectName ) ) ; com.google.common.truth.Truth.assertWithMessage ( adminSshSession.getError ( ) ) . that ( adminSshSession.hasError ( ) ) . isFalse ( ) ; com.google.gerrit.server.project.ProjectState projectState = projectCache.get ( new com.google.gerrit.reviewdb.client.Project.NameKey ( newProjectName ) ) ; com.google.common.truth.Truth.assertThat ( projectState ) . isNotNull ( ) ; }
Source:
private void displayView ( android.support.v4.app.Fragment fragment ) { android.support.v4.app.FragmentManager fragmentManager = getSupportFragmentManager ( ) ; fragmentManager.beginTransaction ( ) . replace ( R.id.mainFrame , fragment ) . addToBackStack ( null ) . commit ( ) ; }

Target:
private void displayView ( android.support.v4.app.Fragment fragment , boolean addToBackStack ) { android.support.v4.app.FragmentManager fragmentManager = getSupportFragmentManager ( ) ; android.support.v4.app.FragmentTransaction t = fragmentManager.beginTransaction ( ) . replace ( R.id.mainFrame , fragment ) ; if ( addToBackStack ) { t.addToBackStack ( null ) ; } t.commit ( ) ; }
Source:
private org.kohsuke.github.PagedIterable < org.kohsuke.github.GHRepository > getRepositories ( com.googlesource.gerrit.plugins.github.oauth.GitHubLogin hubLogin , java.lang.String organisation ) throws java.io.IOException { if ( organisation.equals ( hubLogin.getMyself ( ) . getLogin ( ) ) ) { return hubLogin.getMyself ( ) . listRepositories ( config.repositoryListPageSize ) ; } else { org.kohsuke.github.GHOrganization ghOrganisation = hubLogin.getMyself ( ) . getAllOrganizations ( ) . byLogin ( organisation ) ; return ghOrganisation.listRepositories ( config.repositoryListPageSize ) ; } }

Target:
private org.kohsuke.github.PagedIterable < org.kohsuke.github.GHRepository > getRepositories ( com.googlesource.gerrit.plugins.github.oauth.GitHubLogin hubLogin , java.lang.String organisation ) throws java.io.IOException { if ( organisation.equals ( hubLogin.getMyself ( ) . getLogin ( ) ) ) { return hubLogin.getMyself ( ) . listRepositories ( config.repositoryListPageSize , RepositoryListFilter.OWNER ) ; } else { org.kohsuke.github.GHOrganization ghOrganisation = hubLogin.getMyself ( ) . getAllOrganizations ( ) . byLogin ( organisation ) ; return ghOrganisation.listRepositories ( config.repositoryListPageSize ) ; } }
Source:
private com.google.gerrit.server.notedb.RevisionNoteData parseJson ( com.google.gerrit.server.notedb.ChangeNoteUtil noteUtil , byte [ ] raw , int offset ) throws java.io.IOException { try ( java.io.InputStream is = new java.io.ByteArrayInputStream ( raw , offset , ( ( raw.length ) - offset ) ) ; java.io.Reader r = new java.io.InputStreamReader ( is ) ) { return noteUtil.getGson ( ) . fromJson ( r , com.google.gerrit.server.notedb.RevisionNoteData.class ) ; } }

Target:
private com.google.gerrit.server.notedb.RevisionNoteData parseJson ( com.google.gerrit.server.notedb.ChangeNoteUtil noteUtil , byte [ ] raw , int offset ) throws java.io.IOException { try ( java.io.InputStream is = new java.io.ByteArrayInputStream ( raw , offset , ( ( raw.length ) - offset ) ) ; java.io.Reader r = new java.io.InputStreamReader ( is , java.nio.charset.StandardCharsets.UTF_8 ) ) { return noteUtil.getGson ( ) . fromJson ( r , com.google.gerrit.server.notedb.RevisionNoteData.class ) ; } }
Source:
public void doFilter ( javax.servlet.ServletRequest request , javax.servlet.ServletResponse response , javax.servlet.FilterChain chain ) throws java.io.IOException , javax.servlet.ServletException { javax.servlet.http.HttpServletRequest req = ( ( javax.servlet.http.HttpServletRequest ) ( request ) ) ; com.google.gerrit.httpd.ProjectDigestFilter.Response rsp = new com.google.gerrit.httpd.ProjectDigestFilter.Response ( ( ( javax.servlet.http.HttpServletResponse ) ( response ) ) ) ; if ( verify ( req , rsp ) ) { chain.doFilter ( req , rsp ) ; } }

Target:
public void doFilter ( javax.servlet.ServletRequest request , javax.servlet.ServletResponse response , javax.servlet.FilterChain chain ) throws java.io.IOException , javax.servlet.ServletException { javax.servlet.http.HttpServletRequest req = ( ( javax.servlet.http.HttpServletRequest ) ( request ) ) ; if ( ! ( org.eclipse.jgit.http.server.GitSmartHttpTools.isGitClient ( req ) ) ) { chain.doFilter ( request , response ) ; return ; } com.google.gerrit.httpd.ProjectDigestFilter.Response rsp = new com.google.gerrit.httpd.ProjectDigestFilter.Response ( ( ( javax.servlet.http.HttpServletResponse ) ( response ) ) ) ; if ( verify ( req , rsp ) ) { chain.doFilter ( req , rsp ) ; } }
Source:
public void onSuccess ( com.google.gerrit.client.rpc.NativeMap < com.google.gerrit.client.diff.FileInfo > m ) { files.setRevisions ( null , new com.google.gerrit.reviewdb.client.PatchSet.Id ( changeId , rev._number ( ) ) ) ; files.setValue ( m ) ; }

Target:
public void onSuccess ( com.google.gerrit.client.rpc.NativeMap < com.google.gerrit.client.diff.FileInfo > m ) { files.setRevisions ( null , new com.google.gerrit.reviewdb.client.PatchSet.Id ( changeId , rev._number ( ) ) ) ; files.setValue ( m , myLastReply , comments.get ( 0 ) , drafts.get ( 0 ) ) ; }
Source:
public void starChange ( java.lang.String changeId ) throws com.google.gerrit.extensions.restapi.RestApiException { try { com.google.gerrit.server.change.ChangeResource rsrc = changes.parse ( TopLevelResource.INSTANCE , com.google.gerrit.extensions.restapi.IdString.fromUrl ( changeId ) ) ; starredChangesCreate.setChange ( rsrc ) ; starredChangesCreate.apply ( account , new com.google.gerrit.server.account.StarredChanges.EmptyInput ( ) ) ; } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( "Cannot star change" , e ) ; } }

Target:
public void starChange ( java.lang.String changeId ) throws com.google.gerrit.extensions.restapi.RestApiException { try { com.google.gerrit.server.change.ChangeResource rsrc = changes.parse ( TopLevelResource.INSTANCE , com.google.gerrit.extensions.restapi.IdString.fromUrl ( changeId ) ) ; starredChangesCreate.setChange ( rsrc ) ; starredChangesCreate.apply ( account , new com.google.gerrit.server.restapi.account.StarredChanges.EmptyInput ( ) ) ; } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( "Cannot star change" , e ) ; } }
Source:
private static java.lang.Iterable < java.io.File > filterDisabledPlugins ( java.util.Collection < java.io.File > files ) { return com.google.common.collect.Iterables.filter ( files , new com.google.common.base.Predicate < java.io.File > ( ) { @ java.lang.Override public boolean apply ( java.io.File file ) { return ! ( file.getName ( ) . endsWith ( ".disabled" ) ) ; } } ) ; }

Target:
private static java.lang.Iterable < java.nio.file.Path > filterDisabledPlugins ( java.util.Collection < java.nio.file.Path > paths ) { return com.google.common.collect.Iterables.filter ( paths , new com.google.common.base.Predicate < java.nio.file.Path > ( ) { @ java.lang.Override public boolean apply ( java.nio.file.Path p ) { return ! ( p.getFileName ( ) . toString ( ) . endsWith ( ".disabled" ) ) ; } } ) ; }
Source:
private com.google.gerrit.acceptance.RestResponse publishPatchSet ( java.lang.String changeId ) throws com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.reviewdb.client.PatchSet patchSet = db.patchSets ( ) . get ( com.google.common.collect.Iterables.getOnlyElement ( db.changes ( ) . byKey ( new com.google.gerrit.reviewdb.client.Change.Key ( changeId ) ) ) . currentPatchSetId ( ) ) ; return adminSession.post ( ( ( ( ( "/changes/" + changeId ) + "/revisions/" ) + ( patchSet.getRevision ( ) . get ( ) ) ) + "/publish" ) ) ; }

Target:
private com.google.gerrit.acceptance.RestResponse publishPatchSet ( java.lang.String changeId ) throws com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.reviewdb.client.PatchSet patchSet = com.google.common.collect.Iterables.getOnlyElement ( queryProvider.get ( ) . byKeyPrefix ( changeId ) ) . currentPatchSet ( ) ; return adminSession.post ( ( ( ( ( "/changes/" + changeId ) + "/revisions/" ) + ( patchSet.getRevision ( ) . get ( ) ) ) + "/publish" ) ) ; }
Source:
public void onSignIn ( ) { if ( ( patchKey ) != null ) { PatchUtil.DETAIL_SVC.myDrafts ( patchKey , new com.google.gerrit.client.rpc.GerritCallback < java.util.List < com.google.gerrit.client.reviewdb.PatchLineComment > > ( ) { public void onSuccess ( final java.util.List < com.google.gerrit.client.reviewdb.PatchLineComment > result ) { if ( ! ( result.isEmpty ( ) ) ) { bindDrafts ( result ) ; } } } ) ; } }

Target:
public void display ( final com.google.gerrit.client.reviewdb.Patch.Key k , final com.google.gerrit.client.reviewdb.PatchSet.Id a , final com.google.gerrit.client.reviewdb.PatchSet.Id b , final com.google.gerrit.client.data.PatchScript s ) { patchKey = k ; idSideA = a ; idSideB = b ; render ( s ) ; }
Source:
private void bccWatchesNotifySubmittedChanges ( ) { if ( ( db ) != null ) { try { final com.google.gerrit.server.project.ProjectState ps = getProjectState ( ) ; if ( ps != null ) { for ( final com.google.gerrit.reviewdb.AccountProjectWatch w : getProjectWatches ( ) ) { if ( w.isNotifySubmittedChanges ( ) ) { add ( RecipientType.BCC , w.getAccountId ( ) ) ; } } } } catch ( com.google.gwtorm.client.OrmException err ) { } } }

Target:
private void bccWatchesNotifySubmittedChanges ( ) { try { for ( final com.google.gerrit.reviewdb.AccountProjectWatch w : getWatches ( ) ) { if ( w.isNotifySubmittedChanges ( ) ) { add ( RecipientType.BCC , w.getAccountId ( ) ) ; } } } catch ( com.google.gwtorm.client.OrmException err ) { } }
Source:
public org.parboiled.Rule cols ( ) { org.parboiled.support.StringBuilderVar body = new org.parboiled.support.StringBuilderVar ( ) ; return NodeSequence ( colsTag ( ) , Newline ( ) , oneOrMore ( testNot ( colsTag ( ) , Newline ( ) ) , Line ( body ) ) , colsTag ( ) , Newline ( ) , push ( new com.google.gitiles.doc.ColsNode ( parse ( body ) ) ) ) ; }

Target:
public org.parboiled.Rule cols ( ) { org.parboiled.support.StringBuilderVar body = new org.parboiled.support.StringBuilderVar ( ) ; return NodeSequence ( colsTag ( ) , columnWidths ( ) , Newline ( ) , oneOrMore ( testNot ( colsTag ( ) , Newline ( ) ) , Line ( body ) ) , colsTag ( ) , Newline ( ) , push ( new com.google.gitiles.doc.ColsNode ( ( ( java.util.List < com.google.gitiles.doc.ColsNode.Column > ) ( pop ( ) ) ) , com.google.gitiles.doc.GitilesMarkdown.parse ( body ) ) ) ) ; }
Source:
public com.google.gerrit.server.permissions.PermissionBackend.ForChange change ( com.google.gerrit.server.query.change.ChangeData cd ) { try { return cd.changeControl ( ) . forUser ( getUser ( ) ) . asForChange ( cd , db ) ; } catch ( com.google.gwtorm.server.OrmException e ) { return com.google.gerrit.server.permissions.FailedPermissionBackend.change ( "unavailable" , e ) ; } }

Target:
public com.google.gerrit.server.permissions.PermissionBackend.ForChange change ( com.google.gerrit.server.query.change.ChangeData cd ) { try { return getProjectControl ( ) . controlFor ( cd.db ( ) , cd.change ( ) ) . asForChange ( cd , com.google.inject.util.Providers.of ( cd.db ( ) ) ) ; } catch ( com.google.gwtorm.server.OrmException e ) { return com.google.gerrit.server.permissions.FailedPermissionBackend.change ( "unavailable" , e ) ; } }
Source:
public static java.lang.String robotCommentsRef ( com.google.gerrit.reviewdb.client.Change.Id id ) { java.lang.StringBuilder r = new java.lang.StringBuilder ( ) ; r.append ( com.google.gerrit.reviewdb.client.RefNames.REFS_CHANGES ) ; r.append ( com.google.gerrit.reviewdb.client.RefNames.shard ( id.get ( ) ) ) ; r.append ( com.google.gerrit.reviewdb.client.RefNames.ROBOT_COMMENTS_SUFFIX ) ; return r.toString ( ) ; }

Target:
public static java.lang.String refsUsers ( com.google.gerrit.reviewdb.client.Account.Id accountId ) { java.lang.StringBuilder r = com.google.gerrit.reviewdb.client.RefNames.newStringBuilder ( ) . append ( com.google.gerrit.reviewdb.client.RefNames.REFS_USERS ) ; return com.google.gerrit.reviewdb.client.RefNames.shard ( accountId.get ( ) , r ) . toString ( ) ; }
Source:
public boolean updateChange ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx ) throws com.google.gerrit.extensions.restapi.ResourceConflictException , com.google.gwtorm.server.OrmException { user = ctx.getIdentifiedUser ( ) ; notes = ctx.getNotes ( ) ; ps = psUtil.get ( ctx.getDb ( ) , ctx.getNotes ( ) , psId ) ; boolean dirty = false ; dirty |= insertComments ( ctx ) ; dirty |= updateLabels ( ctx ) ; dirty |= insertMessage ( ctx ) ; return dirty ; }

Target:
public boolean updateChange ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx ) throws com.google.gerrit.extensions.restapi.ResourceConflictException , com.google.gwtorm.server.OrmException { user = ctx.getIdentifiedUser ( ) ; notes = ctx.getNotes ( ) ; ps = psUtil.get ( ctx.getDb ( ) , ctx.getNotes ( ) , psId ) ; boolean dirty = false ; dirty |= insertComments ( ctx ) ; dirty |= insertRobotComments ( ctx ) ; dirty |= updateLabels ( ctx ) ; dirty |= insertMessage ( ctx ) ; return dirty ; }
Source:
private void initIgnoreWhitespace ( ) { ignoreWhitespace.addItem ( PatchUtil.C.whitespaceIGNORE_NONE ( ) , Whitespace.IGNORE_NONE.name ( ) ) ; ignoreWhitespace.addItem ( PatchUtil.C.whitespaceIGNORE_SPACE_AT_EOL ( ) , Whitespace.IGNORE_SPACE_AT_EOL.name ( ) ) ; ignoreWhitespace.addItem ( PatchUtil.C.whitespaceIGNORE_SPACE_CHANGE ( ) , Whitespace.IGNORE_SPACE_CHANGE.name ( ) ) ; ignoreWhitespace.addItem ( PatchUtil.C.whitespaceIGNORE_ALL_SPACE ( ) , Whitespace.IGNORE_ALL_SPACE.name ( ) ) ; }

Target:
private void initIgnoreWhitespace ( ) { ignoreWhitespace.addItem ( PatchUtil.C.whitespaceIGNORE_NONE ( ) , Whitespace.IGNORE_NONE.name ( ) ) ; ignoreWhitespace.addItem ( PatchUtil.C.whitespaceIGNORE_TRAILING ( ) , Whitespace.IGNORE_TRAILING.name ( ) ) ; ignoreWhitespace.addItem ( PatchUtil.C.whitespaceIGNORE_LEADING_AND_TRAILING ( ) , Whitespace.IGNORE_LEADING_AND_TRAILING.name ( ) ) ; ignoreWhitespace.addItem ( PatchUtil.C.whitespaceIGNORE_ALL ( ) , Whitespace.IGNORE_ALL.name ( ) ) ; }
Source:
void onChangeRevision ( @ java.lang.SuppressWarnings ( value = "unused" ) com.google.gwt.event.dom.client.ChangeEvent e ) { int idx = diffBase.getSelectedIndex ( ) ; if ( 0 <= idx ) { java.lang.String n = diffBase.getValue ( idx ) ; loadConfigInfo ( changeInfo , ( ! ( n.isEmpty ( ) ) ? n : null ) ) ; } }

Target:
void onChangeRevision ( @ java.lang.SuppressWarnings ( value = "unused" ) com.google.gwt.event.dom.client.ChangeEvent e ) { int idx = diffBase.getSelectedIndex ( ) ; if ( 0 <= idx ) { java.lang.String n = diffBase.getValue ( idx ) ; loadConfigInfo ( changeInfo , com.google.gerrit.client.DiffObject.parse ( changeInfo.legacyId ( ) , n ) ) ; } }
Source:
private com.google.gerrit.server.account.AuthResult create ( ) throws java.io.IOException { java.lang.String fakeId = ( com.google.gerrit.reviewdb.client.AccountExternalId.SCHEME_UUID ) + ( java.util.UUID.randomUUID ( ) ) ; try { return accountManager.authenticate ( new com.google.gerrit.server.account.AuthRequest ( fakeId ) ) ; } catch ( com.google.gerrit.server.account.AccountException e ) { getServletContext ( ) . log ( "cannot create new account" , e ) ; return null ; } }

Target:
private com.google.gerrit.server.account.AuthResult create ( ) throws java.io.IOException { try { return accountManager.authenticate ( new com.google.gerrit.server.account.AuthRequest ( ExternalId.Key.create ( com.google.gerrit.server.account.ExternalId.SCHEME_UUID , java.util.UUID.randomUUID ( ) . toString ( ) ) ) ) ; } catch ( com.google.gerrit.server.account.AccountException e ) { getServletContext ( ) . log ( "cannot create new account" , e ) ; return null ; } }
Source:
public com.google.gerrit.server.ReviewerSet reviewers ( ) throws com.google.gwtorm.server.OrmException { if ( ( reviewers ) == null ) { reviewers = approvalsUtil.getReviewers ( notes ( ) , approvals ( ) . values ( ) ) ; } return reviewers ; }

Target:
public com.google.gerrit.server.ReviewerSet reviewers ( ) throws com.google.gwtorm.server.OrmException { if ( ( reviewers ) == null ) { if ( ! ( lazyLoad ) ) { return com.google.gerrit.server.ReviewerSet.empty ( ) ; } reviewers = approvalsUtil.getReviewers ( notes ( ) , approvals ( ) . values ( ) ) ; } return reviewers ; }
Source:
protected void onShowView ( com.google.gerrit.client.ui.Screen view ) { final java.lang.String token = view.getToken ( ) ; if ( ! ( token.equals ( com.google.gwt.user.client.History.getToken ( ) ) ) ) { com.google.gwt.user.client.History.newItem ( token , false ) ; if ( ( com.google.gerrit.client.Gerrit.historyHooks ) != null ) { com.google.gerrit.client.Gerrit.dispatchHistoryHooks ( token ) ; } } if ( view instanceof com.google.gerrit.client.changes.ChangeListScreen ) { com.google.gerrit.client.Gerrit.lastChangeListToken = token ; } super . onShowView ( view ) ; view.onShowView ( ) ; }

Target:
private static void dispatchHistoryHooks ( final java.lang.String historyToken ) { if ( ( com.google.gerrit.client.Gerrit.signInAnchor ) != null ) { com.google.gerrit.client.Gerrit.signInAnchor.setHref ( com.google.gerrit.client.Gerrit.loginRedirect ( historyToken ) ) ; } if ( ( com.google.gerrit.client.Gerrit.historyHooks ) != null ) { final java.lang.String url = ( ( com.google.gwt.user.client.Window.Location.getPath ( ) ) + "#" ) + historyToken ; for ( final com.google.gwt.core.client.JavaScriptObject hook : com.google.gerrit.client.Gerrit.historyHooks ) { com.google.gerrit.client.Gerrit.callHistoryHook ( hook , url ) ; } } }
Source:
protected boolean isVisibleTo ( com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.server.CurrentUser user ) throws com.google.gwtorm.server.OrmException { if ( change == null ) { return false ; } com.google.gerrit.server.project.ProjectState pe = projectCache.get ( change.getProject ( ) ) ; if ( pe == null ) { return false ; } com.google.gerrit.server.project.ProjectControl pc = pe.controlFor ( user ) ; com.google.gerrit.reviewdb.server.ReviewDb db = dbProvider.get ( ) ; return pc.controlFor ( db , change ) . isVisible ( db ) ; }

Target:
protected boolean isVisibleTo ( com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.server.CurrentUser user ) throws com.google.gerrit.server.permissions.PermissionBackendException , com.google.gwtorm.server.OrmException { if ( change == null ) { return false ; } com.google.gerrit.server.project.ProjectState pe = projectCache.get ( change.getProject ( ) ) ; if ( pe == null ) { return false ; } com.google.gerrit.reviewdb.server.ReviewDb db = dbProvider.get ( ) ; return permissionBackend.user ( user ) . change ( notesFactory.createChecked ( db , change ) ) . database ( db ) . test ( ChangePermission.READ ) ; }
Source:
public void testBlockPushDraftsUnblockAdmin ( ) { com.google.gerrit.server.project.Util.block ( util.getParentConfig ( ) , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/drafts/*" ) ; com.google.gerrit.server.project.Util.allow ( util.getParentConfig ( ) , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.ADMIN , "refs/drafts/*" ) ; org.junit.Assert.assertTrue ( "push is blocked for anonymous to refs/drafts/master" , util.user ( local ) . controlForRef ( "refs/drafts/refs/heads/master" ) . isBlocked ( com.google.gerrit.common.data.Permission.PUSH ) ) ; org.junit.Assert.assertFalse ( "push is blocked for admin refs/drafts/master" , util.user ( local , "a" , com.google.gerrit.server.project.Util.ADMIN ) . controlForRef ( "refs/drafts/refs/heads/master" ) . isBlocked ( com.google.gerrit.common.data.Permission.PUSH ) ) ; }

Target:
public void testBlockPushDraftsUnblockAdmin ( ) { com.google.gerrit.server.project.Util.block ( parent , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/drafts/*" ) ; com.google.gerrit.server.project.Util.allow ( parent , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.ADMIN , "refs/drafts/*" ) ; org.junit.Assert.assertTrue ( "push is blocked for anonymous to refs/drafts/master" , util.user ( local ) . controlForRef ( "refs/drafts/refs/heads/master" ) . isBlocked ( com.google.gerrit.common.data.Permission.PUSH ) ) ; org.junit.Assert.assertFalse ( "push is blocked for admin refs/drafts/master" , util.user ( local , "a" , com.google.gerrit.server.project.Util.ADMIN ) . controlForRef ( "refs/drafts/refs/heads/master" ) . isBlocked ( com.google.gerrit.common.data.Permission.PUSH ) ) ; }
Source:
public void basicLog ( ) throws java.lang.Exception { org.eclipse.jgit.revwalk.RevCommit commit = repo.branch ( "HEAD" ) . commit ( ) . create ( ) ; repo.getRevWalk ( ) . parseBody ( commit ) ; com.google.gitiles.CommitJsonData.Log log = buildJson ( com.google.gitiles.LogServletTest.LOG , "/repo/+log" ) ; com.google.common.truth.Truth.assertThat ( log.log ) . hasSize ( 1 ) ; verifyJsonCommit ( log.log.get ( 0 ) , commit ) ; com.google.common.truth.Truth.assertThat ( log.log.get ( 0 ) . treeDiff ) . isNull ( ) ; }

Target:
public void basicLog ( ) throws java.lang.Exception { org.eclipse.jgit.revwalk.RevCommit commit = repo.branch ( "HEAD" ) . commit ( ) . create ( ) ; com.google.gitiles.CommitJsonData.Log response = buildJson ( com.google.gitiles.LogServletTest.LOG , "/repo/+log" ) ; com.google.common.truth.Truth.assertThat ( response.log ) . hasSize ( 1 ) ; verifyJsonCommit ( response.log.get ( 0 ) , commit ) ; com.google.common.truth.Truth.assertThat ( response.log.get ( 0 ) . treeDiff ) . isNull ( ) ; }
Source:
protected void mustHaveValidSite ( ) throws com.google.gerrit.common.Die { if ( ! ( new java.io.File ( new java.io.File ( getSitePath ( ) , "etc" ) , "gerrit.config" ) . exists ( ) ) ) { throw die ( ( ( ( "not a Gerrit site: '" + ( getSitePath ( ) ) ) + "\'\n" ) + "Perhaps you need to run init first?" ) ) ; } }

Target:
protected void mustHaveValidSite ( ) throws com.google.gerrit.common.Die { if ( ! ( java.nio.file.Files.exists ( sitePath.resolve ( "etc" ) . resolve ( "gerrit.config" ) ) ) ) { throw die ( ( ( ( "not a Gerrit site: '" + ( getSitePath ( ) ) ) + "\'\n" ) + "Perhaps you need to run init first?" ) ) ; } }
Source:
public com.googlecode.prolog_cafe.lang.Term getMessageTerm ( ) { com.googlecode.prolog_cafe.lang.Term [ ] args = new com.googlecode.prolog_cafe.lang.Term [ ] { new com.googlecode.prolog_cafe.lang.JavaObjectTerm ( goal ) , com.googlecode.prolog_cafe.lang.SymbolTerm.create ( operation ) , com.googlecode.prolog_cafe.lang.SymbolTerm.create ( permissionType ) , culprit , com.googlecode.prolog_cafe.lang.SymbolTerm.create ( message ) } ; return new com.googlecode.prolog_cafe.lang.StructureTerm ( com.googlecode.prolog_cafe.lang.PermissionException.PERMISSION_ERROR , args ) ; }

Target:
public com.googlecode.prolog_cafe.lang.Term getMessageTerm ( ) { com.googlecode.prolog_cafe.lang.Term [ ] args = new com.googlecode.prolog_cafe.lang.Term [ ] { new com.googlecode.prolog_cafe.lang.JavaObjectTerm ( goal ) , com.googlecode.prolog_cafe.lang.SymbolTerm.create ( operation ) , com.googlecode.prolog_cafe.lang.SymbolTerm.create ( permissionType ) , culprit , com.googlecode.prolog_cafe.lang.SymbolTerm.create ( message ) } ; return new com.googlecode.prolog_cafe.lang.StructureTerm ( com.googlecode.prolog_cafe.exceptions.PermissionException.PERMISSION_ERROR , args ) ; }
Source:
javax.servlet.http.HttpServlet getGwtUiServlet ( @ com.google.inject.name.Named ( value = com.google.gerrit.httpd.raw.StaticModule.CACHE ) com.google.common.cache.Cache < java.nio.file.Path , com.google.gerrit.httpd.raw.ResourceServlet.Resource > cache ) throws java.io.IOException { com.google.gerrit.httpd.raw.Paths p = getPaths ( ) ; if ( ( p.warFs ) != null ) { return new com.google.gerrit.httpd.raw.WarGwtUiServlet ( cache , p.warFs ) ; } else { return new com.google.gerrit.httpd.raw.DeveloperGwtUiServlet ( cache , p.unpackedWar ) ; } }

Target:
javax.servlet.http.HttpServlet getGwtUiServlet ( @ com.google.inject.name.Named ( value = com.google.gerrit.httpd.raw.StaticModule.CACHE ) com.google.common.cache.Cache < java.nio.file.Path , com.google.gerrit.httpd.raw.ResourceServlet.Resource > cache ) throws java.io.IOException { com.google.gerrit.httpd.raw.StaticModule.Paths p = getPaths ( ) ; if ( ( p.warFs ) != null ) { return new com.google.gerrit.httpd.raw.WarGwtUiServlet ( cache , p.warFs ) ; } else { return new com.google.gerrit.httpd.raw.DeveloperGwtUiServlet ( cache , p.unpackedWar ) ; } }
Source:
public void registerKeys ( ) { super . registerKeys ( ) ; cm.addKeyMap ( net.codemirror.lib.KeyMap.create ( ) . on ( "Ctrl-L" , gotoLine ( ) ) . on ( "Cmd-L" , gotoLine ( ) ) . on ( "Cmd-S" , save ( ) ) . on ( "Ctrl-S" , save ( ) ) ) ; }

Target:
public void registerKeys ( ) { super . registerKeys ( ) ; net.codemirror.lib.KeyMap localKeyMap = net.codemirror.lib.KeyMap.create ( ) ; localKeyMap.on ( "Ctrl-L" , gotoLine ( ) ) . on ( "Cmd-L" , gotoLine ( ) ) . on ( "Cmd-S" , save ( ) ) ; if ( ( prefs.keyMapType ( ) ) != ( com.google.gerrit.extensions.client.KeyMapType.EMACS ) ) { localKeyMap.on ( "Ctrl-S" , save ( ) ) ; } cm.addKeyMap ( localKeyMap ) ; }
Source:
private com.google.gerrit.client.diff.DraftBox addNewDraft ( net.codemirror.lib.CodeMirror cm , int line , net.codemirror.lib.TextMarker.FromTo fromTo ) { com.google.gerrit.client.diff.SideBySide2.DisplaySide side = getSideFromCm ( cm ) ; return addDraftBox ( com.google.gerrit.client.changes.CommentInfo.createRange ( path , getStoredSideFromDisplaySide ( side ) , ( line + 1 ) , null , null , com.google.gerrit.client.diff.CommentRange.create ( fromTo ) ) , side ) ; }

Target:
private com.google.gerrit.client.diff.DraftBox addNewDraft ( net.codemirror.lib.CodeMirror cm , int line , net.codemirror.lib.TextMarker.FromTo fromTo ) { com.google.gerrit.client.diff.DisplaySide side = getSideFromCm ( cm ) ; return addDraftBox ( com.google.gerrit.client.changes.CommentInfo.createRange ( path , getStoredSideFromDisplaySide ( side ) , ( line + 1 ) , null , null , com.google.gerrit.client.diff.CommentRange.create ( fromTo ) ) , side ) ; }
Source:
public void testSelectMIXED ( ) { setFrom ( "MIXED" ) ; org.junit.Assert.assertTrue ( ( ( create ( ) ) instanceof com.google.gerrit.server.mail.FromAddressGeneratorProvider.PatternGen ) ) ; setFrom ( "mixed" ) ; org.junit.Assert.assertTrue ( ( ( create ( ) ) instanceof com.google.gerrit.server.mail.FromAddressGeneratorProvider.PatternGen ) ) ; setFrom ( "mIxEd" ) ; org.junit.Assert.assertTrue ( ( ( create ( ) ) instanceof com.google.gerrit.server.mail.FromAddressGeneratorProvider.PatternGen ) ) ; }

Target:
public void testSelectMIXED ( ) { setFrom ( "MIXED" ) ; com.google.common.truth.Truth.assertThat ( create ( ) ) . isInstanceOf ( FromAddressGeneratorProvider.PatternGen.class ) ; setFrom ( "mixed" ) ; com.google.common.truth.Truth.assertThat ( create ( ) ) . isInstanceOf ( FromAddressGeneratorProvider.PatternGen.class ) ; setFrom ( "mIxEd" ) ; com.google.common.truth.Truth.assertThat ( create ( ) ) . isInstanceOf ( FromAddressGeneratorProvider.PatternGen.class ) ; }
Source:
public static void applyUserPreferences ( ) { if ( ( com.google.gerrit.client.Gerrit.myAccount ) != null ) { final com.google.gerrit.reviewdb.client.AccountGeneralPreferences p = com.google.gerrit.client.Gerrit.myAccount.getGeneralPreferences ( ) ; com.google.gwtexpui.clippy.client.CopyableLabel.setFlashEnabled ( p.isUseFlashClipboard ( ) ) ; if ( ( com.google.gerrit.client.Gerrit.siteHeader ) != null ) { com.google.gerrit.client.Gerrit.siteHeader.setVisible ( p.isShowSiteHeader ( ) ) ; } if ( ( com.google.gerrit.client.Gerrit.siteFooter ) != null ) { com.google.gerrit.client.Gerrit.siteFooter.setVisible ( p.isShowSiteHeader ( ) ) ; } com.google.gerrit.client.FormatUtil.setPreferences ( com.google.gerrit.client.Gerrit.myAccount.getGeneralPreferences ( ) ) ; } }

Target:
public static void setUserPreferences ( com.google.gerrit.client.info.GeneralPreferences prefs ) { com.google.gerrit.client.Gerrit.myPrefs = prefs ; com.google.gerrit.client.Gerrit.applyUserPreferences ( ) ; com.google.gerrit.client.Gerrit.refreshMenuBar ( ) ; }
Source:
private net.sf.ehcache.config.Configuration createCacheConfiguration ( ) { final net.sf.ehcache.config.Configuration mgrCfg = new net.sf.ehcache.config.Configuration ( ) ; configureDiskStore ( mgrCfg ) ; configureDefaultCache ( mgrCfg ) ; if ( ( sConfig.getLoginType ( ) ) == ( com.google.gerrit.client.reviewdb.SystemConfig.LoginType.OPENID ) ) { final net.sf.ehcache.config.CacheConfiguration c ; c = configureNamedCache ( mgrCfg , "openid" , false , 5 ) ; c.setTimeToLiveSeconds ( c.getTimeToIdleSeconds ( ) ) ; mgrCfg.addCache ( c ) ; } return mgrCfg ; }

Target:
private net.sf.ehcache.config.Configuration createCacheConfiguration ( ) { final net.sf.ehcache.config.Configuration mgrCfg = new net.sf.ehcache.config.Configuration ( ) ; configureDiskStore ( mgrCfg ) ; configureDefaultCache ( mgrCfg ) ; if ( ( sConfig.getLoginType ( ) ) == ( com.google.gerrit.client.reviewdb.SystemConfig.LoginType.OPENID ) ) { final net.sf.ehcache.config.CacheConfiguration c ; c = configureNamedCache ( mgrCfg , "openid" , false , 5 ) ; c.setTimeToLiveSeconds ( c.getTimeToIdleSeconds ( ) ) ; mgrCfg.addCache ( c ) ; } mgrCfg.addCache ( configureNamedCache ( mgrCfg , "diff" , true , 0 ) ) ; return mgrCfg ; }
Source:
public void onClick ( final com.google.gwt.event.dom.client.ClickEvent event ) { closePopup ( ) ; }

Target:
public void onClick ( final com.google.gwt.event.dom.client.ClickEvent event ) { int top = ( grid.getAbsoluteTop ( ) ) - 50 ; int left = 5 + ( java.lang.Math.max ( ( ( grid.getAbsoluteLeft ( ) ) + ( grid.getOffsetWidth ( ) ) ) , ( ( watchesTab.getAbsoluteLeft ( ) ) + ( watchesTab.getOffsetWidth ( ) ) ) ) ) ; projectsPopup.setPreferredCoordinates ( top , left ) ; projectsPopup.displayPopup ( ) ; }
Source:
public void onSuccess ( final com.google.gerrit.reviewdb.client.PatchLineComment result ) { notifyDraftDelta ( ( isNew ( ) ? 1 : 0 ) ) ; comment = result ; text.setReadOnly ( false ) ; save.setEnabled ( true ) ; cancel.setEnabled ( true ) ; discard.setEnabled ( true ) ; render ( ) ; onSave.onSuccess ( VoidResult.INSTANCE ) ; }

Target:
public void onSuccess ( com.google.gerrit.client.changes.CommentInfo result ) { notifyDraftDelta ( ( wasNew ? 1 : 0 ) ) ; comment = com.google.gerrit.client.patches.CommentEditorPanel.toComment ( psId , comment.getKey ( ) . get ( ) , result ) ; text.setReadOnly ( false ) ; save.setEnabled ( true ) ; cancel.setEnabled ( true ) ; discard.setEnabled ( true ) ; render ( ) ; onSave.onSuccess ( VoidResult.INSTANCE ) ; }
Source:
public void initConfig ( com.google.gerrit.pgm.init.Section database ) { database.string ( "URL" , "url" , null ) ; guessDriver ( database ) ; database.string ( "Driver class name" , "driver" , null ) ; database.string ( "Database username" , "username" , com.google.gerrit.pgm.init.InitUtil.username ( ) ) ; database.password ( "username" , "password" ) ; }

Target:
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" ) ; }
Source:
private java.util.Map < com.google.gerrit.client.reviewdb.ApprovalCategory.Id , java.util.Collection < com.google.gerrit.client.reviewdb.ProjectRight > > loadRights ( final com.google.gerrit.client.reviewdb.Project.Id projectId ) throws com.google.gwtorm.client.OrmException { final java.util.Map < com.google.gerrit.client.reviewdb.ApprovalCategory.Id , java.util.Collection < com.google.gerrit.client.reviewdb.ProjectRight > > rights = new java.util.HashMap < com.google.gerrit.client.reviewdb.ApprovalCategory.Id , java.util.Collection < com.google.gerrit.client.reviewdb.ProjectRight > > ( ) ; if ( projectId != null ) { loadRights ( rights , projectId ) ; } loadRights ( rights , ProjectRight.WILD_PROJECT ) ; return rights ; }

Target:
private java.util.Map < com.google.gerrit.client.reviewdb.ApprovalCategory.Id , java.util.Collection < com.google.gerrit.client.reviewdb.ProjectRight > > loadRights ( final com.google.gerrit.client.data.ProjectCache.Entry e ) { final java.util.Map < com.google.gerrit.client.reviewdb.ApprovalCategory.Id , java.util.Collection < com.google.gerrit.client.reviewdb.ProjectRight > > r ; r = new java.util.HashMap < com.google.gerrit.client.reviewdb.ApprovalCategory.Id , java.util.Collection < com.google.gerrit.client.reviewdb.ProjectRight > > ( ) ; if ( e != null ) { loadRights ( r , e.getRights ( ) ) ; } loadRights ( r , com.google.gerrit.client.rpc.Common.getProjectCache ( ) . getWildcardRights ( ) ) ; return r ; }
Source:
protected void configure ( ) { factory ( AddBranch.Factory.class ) ; factory ( ChangeProjectAccess.Factory.class ) ; factory ( CreateProjectHandler.Factory.class ) ; factory ( ChangeProjectSettings.Factory.class ) ; factory ( DeleteBranches.Factory.class ) ; factory ( ListBranches.Factory.class ) ; factory ( VisibleProjects.Factory.class ) ; factory ( VisibleProjectDetails.Factory.class ) ; factory ( ProjectAccessFactory.Factory.class ) ; factory ( ProjectDetailFactory.Factory.class ) ; factory ( SuggestParentCandidatesHandler.Factory.class ) ; }

Target:
protected void configure ( ) { factory ( AddBranch.Factory.class ) ; factory ( ChangeProjectAccess.Factory.class ) ; factory ( ReviewProjectAccess.Factory.class ) ; factory ( CreateProjectHandler.Factory.class ) ; factory ( ChangeProjectSettings.Factory.class ) ; factory ( DeleteBranches.Factory.class ) ; factory ( ListBranches.Factory.class ) ; factory ( VisibleProjectDetails.Factory.class ) ; factory ( ProjectAccessFactory.Factory.class ) ; factory ( ProjectDetailFactory.Factory.class ) ; }
Source:
public java.util.List < com.google.gerrit.extensions.api.projects.BranchInfo > apply ( com.google.gerrit.server.project.ProjectResource rsrc ) throws com.google.gerrit.extensions.restapi.BadRequestException , com.google.gerrit.extensions.restapi.ResourceNotFoundException , java.io.IOException { com.google.common.collect.FluentIterable < com.google.gerrit.extensions.api.projects.BranchInfo > branches = allBranches ( rsrc ) ; branches = filterBranches ( branches ) ; if ( ( start ) > 0 ) { branches = branches.skip ( start ) ; } if ( ( limit ) > 0 ) { branches = branches.limit ( limit ) ; } return branches.toList ( ) ; }

Target:
public java.util.List < com.google.gerrit.extensions.api.projects.BranchInfo > apply ( com.google.gerrit.server.project.ProjectResource rsrc ) throws com.google.gerrit.extensions.restapi.BadRequestException , com.google.gerrit.extensions.restapi.ResourceNotFoundException , java.io.IOException { return new com.google.gerrit.server.project.RefFilter < com.google.gerrit.extensions.api.projects.BranchInfo > ( org.eclipse.jgit.lib.Constants.R_HEADS ) . subString ( matchSubstring ) . regex ( matchRegex ) . start ( start ) . limit ( limit ) . filter ( allBranches ( rsrc ) ) ; }
Source:
private void setDefaultVisbilityCache ( ) { if ( ( visibilityCache ) == null ) { if ( config.getSubsections ( "cache" ) . contains ( "visibility" ) ) { visibilityCache = new com.google.gitiles.VisibilityCache ( false , com.google.gitiles.ConfigUtil.getCacheBuilder ( com.google.gitiles.VisibilityCache.newBuilder ( ) , config , "visibility" ) ) ; } else { visibilityCache = new com.google.gitiles.VisibilityCache ( false ) ; } } }

Target:
private void setDefaultVisibilityCache ( ) { if ( ( visibilityCache ) == null ) { if ( config.getSubsections ( "cache" ) . contains ( "visibility" ) ) { visibilityCache = new com.google.gitiles.VisibilityCache ( false , com.google.gitiles.ConfigUtil.getCacheBuilder ( com.google.gitiles.VisibilityCache.newBuilder ( ) , config , "visibility" ) ) ; } else { visibilityCache = new com.google.gitiles.VisibilityCache ( false ) ; } } }