auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private com.google.gerrit.server.query.Predicate < T > operator ( final java.lang.String name , final java.lang.String value ) throws com.google.gerrit.server.query.QueryParseException { final com.google.gerrit.server.query.QueryBuilder.OperatorFactory f = opFactories.get ( name ) ; if ( f == null ) { throw com.google.gerrit.server.query.QueryBuilder.error ( ( ( ( "Unsupported operator " + name ) + ":" ) + value ) ) ; } return f.create ( this , value ) ; }

Target:
private com.google.gerrit.server.query.Predicate < T > operator ( final java.lang.String name , final java.lang.String value ) throws com.google.gerrit.server.query.QueryParseException { @ java.lang.SuppressWarnings ( value = "rawtypes" ) com.google.gerrit.server.query.QueryBuilder.OperatorFactory f = opFactories.get ( name ) ; if ( f == null ) { throw com.google.gerrit.server.query.QueryBuilder.error ( ( ( ( "Unsupported operator " + name ) + ":" ) + value ) ) ; } return f.create ( this , value ) ; }
Source:
protected void configure ( ) { bind ( com.google.gerrit.extensions.api.GerritApi.class ) . to ( com.google.gerrit.server.api.GerritApiImpl.class ) ; install ( new com.google.gerrit.server.api.Module ( ) ) ; install ( new com.google.gerrit.server.api.Module ( ) ) ; install ( new com.google.gerrit.server.api.Module ( ) ) ; install ( new com.google.gerrit.server.api.Module ( ) ) ; install ( new com.google.gerrit.server.api.Module ( ) ) ; install ( new com.google.gerrit.server.api.Module ( ) ) ; }

Target:
protected void configure ( ) { bind ( com.google.gerrit.extensions.api.GerritApi.class ) . to ( com.google.gerrit.server.api.GerritApiImpl.class ) ; install ( new com.google.gerrit.server.api.Module ( ) ) ; install ( new com.google.gerrit.server.api.Module ( ) ) ; install ( new com.google.gerrit.server.api.Module ( ) ) ; install ( new com.google.gerrit.server.api.Module ( ) ) ; install ( new com.google.gerrit.server.api.Module ( ) ) ; }
Source:
private void doList ( ) { for ( java.lang.String name : ( ( java.util.List < java.lang.String > ) ( listCaches.get ( ) . setFormat ( OutputFormat.LIST ) . apply ( new com.google.gerrit.server.config.ConfigResource ( ) ) ) ) ) { stderr.print ( name ) ; stderr.print ( '\n' ) ; } stderr.flush ( ) ; }

Target:
private void doList ( ) { for ( java.lang.String name : ( ( java.util.List < java.lang.String > ) ( listCaches.setFormat ( OutputFormat.LIST ) . apply ( new com.google.gerrit.server.config.ConfigResource ( ) ) ) ) ) { stderr.print ( name ) ; stderr.print ( '\n' ) ; } stderr.flush ( ) ; }
Source:
public void delete ( com.google.gerrit.server.query.change.ChangeData cd ) throws java.io.IOException { java.lang.String id = cd.getId ( ) . toString ( ) ; try { if ( cd.change ( ) . getStatus ( ) . isOpen ( ) ) { openIndex.deleteById ( id ) ; commit ( openIndex ) ; } else { closedIndex.deleteById ( id ) ; commit ( closedIndex ) ; } } catch ( com.google.gwtorm.server.OrmException | org.apache.solr.client.solrj.SolrServerException e ) { throw new java.io.IOException ( e ) ; } }

Target:
public void delete ( com.google.gerrit.server.query.change.ChangeData cd ) throws java.io.IOException { java.lang.String id = cd.getId ( ) . toString ( ) ; try { if ( cd.change ( ) . getStatus ( ) . isOpen ( ) ) { delete ( id , openIndex ) ; } else { delete ( id , closedIndex ) ; } } catch ( com.google.gwtorm.server.OrmException e ) { throw new java.io.IOException ( e ) ; } }
Source:
void onAutoHideDiffTableHeader ( com.google.gwt.event.logical.shared.ValueChangeEvent < java.lang.Boolean > e ) { prefs.autoHideDiffTableHeader ( ( ! ( e.getValue ( ) ) ) ) ; view.setAutoHideDiffHeader ( ( ! ( e.getValue ( ) ) ) ) ; view.resizeCodeMirror ( ) ; }

Target:
void onAutoHideDiffTableHeader ( com.google.gwt.event.logical.shared.ValueChangeEvent < java.lang.Boolean > e ) { prefs.autoHideDiffTableHeader ( ( ! ( e.getValue ( ) ) ) ) ; if ( ( view ) != null ) { view.setAutoHideDiffHeader ( ( ! ( e.getValue ( ) ) ) ) ; } }
Source:
protected void configure ( ) { bind ( com.google.gerrit.common.ChangeHookRunner.class ) ; bind ( com.google.gerrit.common.ChangeHooks.class ) . to ( com.google.gerrit.common.ChangeHookRunner.class ) ; bind ( com.google.gerrit.common.EventDispatcher.class ) . to ( com.google.gerrit.common.ChangeHookRunner.class ) ; bind ( com.google.gerrit.common.EventSource.class ) . to ( com.google.gerrit.common.ChangeHookRunner.class ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.extensions.events.NewProjectCreatedListener.class ) . to ( com.google.gerrit.common.ChangeHookRunner.class ) ; listener ( ) . to ( com.google.gerrit.common.ChangeHookRunner.class ) ; }

Target:
protected void configure ( ) { bind ( com.google.gerrit.common.ChangeHookRunner.class ) ; bind ( com.google.gerrit.common.ChangeHooks.class ) . to ( com.google.gerrit.common.ChangeHookRunner.class ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.extensions.events.NewProjectCreatedListener.class ) . to ( com.google.gerrit.common.ChangeHookRunner.class ) ; listener ( ) . to ( com.google.gerrit.common.ChangeHookRunner.class ) ; }
Source:
private void createAdminsGroup ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.Sequences seqs , org.eclipse.jgit.lib.Repository allUsersRepo , com.google.gerrit.common.data.GroupReference groupReference ) throws com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { com.google.gerrit.server.group.db.InternalGroupCreation groupCreation = getGroupCreation ( seqs , groupReference ) ; com.google.gerrit.server.group.db.InternalGroupUpdate groupUpdate = com.google.gerrit.server.group.db.InternalGroupUpdate.builder ( ) . setDescription ( "Gerrit Site Administrators" ) . build ( ) ; createGroup ( db , allUsersRepo , groupCreation , groupUpdate ) ; }

Target:
private void createAdminsGroup ( com.google.gerrit.server.Sequences seqs , org.eclipse.jgit.lib.Repository allUsersRepo , com.google.gerrit.common.data.GroupReference groupReference ) throws com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { com.google.gerrit.server.group.db.InternalGroupCreation groupCreation = getGroupCreation ( seqs , groupReference ) ; com.google.gerrit.server.group.db.InternalGroupUpdate groupUpdate = com.google.gerrit.server.group.db.InternalGroupUpdate.builder ( ) . setDescription ( "Gerrit Site Administrators" ) . build ( ) ; createGroup ( allUsersRepo , groupCreation , groupUpdate ) ; }
Source:
private java.util.Set < com.google.gerrit.server.git.CodeReviewCommit > commits ( java.util.List < com.google.gerrit.server.query.change.ChangeData > cds ) throws com.google.gwtorm.server.OrmException { java.util.LinkedHashSet < com.google.gerrit.server.git.CodeReviewCommit > result = com.google.common.collect.Sets.newLinkedHashSetWithExpectedSize ( cds.size ( ) ) ; for ( com.google.gerrit.server.query.change.ChangeData cd : cds ) { com.google.gerrit.server.git.CodeReviewCommit commit = commits.get ( cd.getId ( ) ) ; com.google.common.base.Preconditions.checkState ( ( commit != null ) , "commit for %s not found by validateChangeList" , cd.change ( ) . getId ( ) ) ; result.add ( commit ) ; } return result ; }

Target:
private java.util.Set < com.google.gerrit.server.git.CodeReviewCommit > commits ( java.util.List < com.google.gerrit.server.query.change.ChangeData > cds ) { java.util.LinkedHashSet < com.google.gerrit.server.git.CodeReviewCommit > result = com.google.common.collect.Sets.newLinkedHashSetWithExpectedSize ( cds.size ( ) ) ; for ( com.google.gerrit.server.query.change.ChangeData cd : cds ) { com.google.gerrit.server.git.CodeReviewCommit commit = commits.get ( cd.getId ( ) ) ; com.google.common.base.Preconditions.checkState ( ( commit != null ) , "commit for %s not found by validateChangeList" , cd.getId ( ) ) ; result.add ( commit ) ; } return result ; }
Source:
public void testBlockedExtensions ( ) throws java.lang.Exception { org.eclipse.jgit.revwalk.RevCommit c = makeCommit ( com.googlesource.gerrit.plugins.uploadvalidator.FileExtensionValidatorTest.BLOCKED_EXTENSIONS_LC ) ; java.util.List < com.google.gerrit.server.git.validators.CommitValidationMessage > m = com.googlesource.gerrit.plugins.uploadvalidator.FileExtensionValidator.performValidation ( repo , c , com.googlesource.gerrit.plugins.uploadvalidator.FileExtensionValidatorTest.BLOCKED_EXTENSIONS_LC ) ; java.util.List < java.lang.String > expected = new java.util.ArrayList < > ( ) ; for ( java.lang.String extension : com.googlesource.gerrit.plugins.uploadvalidator.FileExtensionValidatorTest.BLOCKED_EXTENSIONS_LC ) { expected.add ( ( "ERROR: blocked file: foo." + extension ) ) ; } com.google.common.truth.Truth.assertThat ( com.googlesource.gerrit.plugins.uploadvalidator.TestUtils.transformMessages ( m ) ) . containsExactlyElementsIn ( expected ) ; }

Target:
public void testBlockedExtensions ( ) throws java.lang.Exception { try ( org.eclipse.jgit.revwalk.RevWalk rw = new org.eclipse.jgit.revwalk.RevWalk ( repo ) ) { org.eclipse.jgit.revwalk.RevCommit c = makeCommit ( rw , com.googlesource.gerrit.plugins.uploadvalidator.FileExtensionValidatorTest.BLOCKED_EXTENSIONS_LC ) ; java.util.List < com.google.gerrit.server.git.validators.CommitValidationMessage > m = com.googlesource.gerrit.plugins.uploadvalidator.FileExtensionValidator.performValidation ( repo , c , rw , com.googlesource.gerrit.plugins.uploadvalidator.FileExtensionValidatorTest.BLOCKED_EXTENSIONS_LC ) ; java.util.List < java.lang.String > expected = new java.util.ArrayList < > ( ) ; for ( java.lang.String extension : com.googlesource.gerrit.plugins.uploadvalidator.FileExtensionValidatorTest.BLOCKED_EXTENSIONS_LC ) { expected.add ( ( "ERROR: blocked file: foo." + extension ) ) ; } com.google.common.truth.Truth.assertThat ( com.googlesource.gerrit.plugins.uploadvalidator.TestUtils.transformMessages ( m ) ) . containsExactlyElementsIn ( expected ) ; } }
Source:
public void advertiseRefs ( org.eclipse.jgit.transport.BaseReceivePack rp ) throws org.eclipse.jgit.transport.ServiceMayNotContinueException { allRefs = rp.getAdvertisedRefs ( ) ; if ( ( allRefs ) == null ) { try { allRefs = rp.getRepository ( ) . getRefDatabase ( ) . getRefs ( org.eclipse.jgit.lib.RefDatabase.ALL ) ; } catch ( java.io.IOException e ) { org.eclipse.jgit.transport.ServiceMayNotContinueException ex = new org.eclipse.jgit.transport.ServiceMayNotContinueException ( e.getMessage ( ) ) ; ex.initCause ( e ) ; throw ex ; } } rp.setAdvertisedRefs ( allRefs , rp.getAdvertisedObjects ( ) ) ; }

Target:
public void advertiseRefs ( org.eclipse.jgit.transport.BaseReceivePack rp ) throws org.eclipse.jgit.transport.ServiceMayNotContinueException { allRefs = rp.getAdvertisedRefs ( ) ; if ( ( allRefs ) == null ) { try { allRefs = rp.getRepository ( ) . getRefDatabase ( ) . getRefs ( org.eclipse.jgit.lib.RefDatabase.ALL ) ; } catch ( org.eclipse.jgit.transport.ServiceMayNotContinueException e ) { throw e ; } catch ( java.io.IOException e ) { org.eclipse.jgit.transport.ServiceMayNotContinueException ex = new org.eclipse.jgit.transport.ServiceMayNotContinueException ( ) ; ex.initCause ( e ) ; throw ex ; } } rp.setAdvertisedRefs ( allRefs , rp.getAdvertisedObjects ( ) ) ; }
Source:
public synchronized void onStartPlugin ( com.google.gerrit.server.plugins.Plugin plugin ) { if ( ( pending ) != null ) { pending.add ( plugin ) ; } else { com.google.inject.servlet.GuiceFilter filter = load ( plugin ) ; if ( filter != null ) { plugins.put ( plugin.getName ( ) , filter ) ; } } }

Target:
public synchronized void onStartPlugin ( com.google.gerrit.server.plugins.Plugin plugin ) { if ( ( pending ) != null ) { pending.add ( plugin ) ; } else { install ( plugin ) ; } }
Source:
static com.google.gerrit.server.project.SectionMatcher wrap ( com.google.gerrit.reviewdb.client.Project.NameKey project , com.google.gerrit.common.data.AccessSection section ) { java.lang.String ref = section.getName ( ) ; if ( com.google.gerrit.common.data.AccessSection.isValid ( ref ) ) { return new com.google.gerrit.server.project.SectionMatcher ( project , section , getMatcher ( ref ) ) ; } else { return null ; } }

Target:
static com.google.gerrit.server.project.SectionMatcher wrap ( com.google.gerrit.reviewdb.client.Project.NameKey project , com.google.gerrit.common.data.AccessSection section ) { java.lang.String ref = section.getName ( ) ; if ( com.google.gerrit.common.data.AccessSection.isValid ( ref ) ) { return new com.google.gerrit.server.project.SectionMatcher ( project , section , getMatcher ( ref ) ) ; } return null ; }
Source:
public void populate ( com.google.gerrit.reviewdb.client.Patch.Key pk , com.google.gerrit.client.changes.PatchTable pt , int patchIndex , com.google.gerrit.client.patches.PatchScreen.Type patchScreenType ) { patchKey = pk ; fileList = pt ; reviewedLink = createReviewedLink ( patchIndex , patchScreenType ) ; top.clear ( ) ; checkBoxTop = createReviewedCheckbox ( ) ; top.add ( checkBoxTop ) ; top.add ( createReviewedAnchor ( ) ) ; bottom.clear ( ) ; checkBoxBottom = createReviewedCheckbox ( ) ; bottom.add ( checkBoxBottom ) ; bottom.add ( createReviewedAnchor ( ) ) ; }

Target:
public void populate ( com.google.gerrit.reviewdb.client.Patch.Key pk , com.google.gerrit.client.changes.PatchTable pt , int patchIndex ) { patchKey = pk ; fileList = pt ; reviewedLink = createReviewedLink ( patchIndex ) ; top.clear ( ) ; checkBoxTop = createReviewedCheckbox ( ) ; top.add ( checkBoxTop ) ; top.add ( createReviewedAnchor ( ) ) ; bottom.clear ( ) ; checkBoxBottom = createReviewedCheckbox ( ) ; bottom.add ( checkBoxBottom ) ; bottom.add ( createReviewedAnchor ( ) ) ; }
Source:
private static void export ( org.spearce.jgit.lib.RepositoryConfig config , java.sql.ResultSet rs ) throws java.sql.SQLException { com.google.gerrit.pgm.ConvertSystemConfig.sshd ( config , rs ) ; com.google.gerrit.pgm.ConvertSystemConfig.contactstore ( config , rs ) ; com.google.gerrit.pgm.ConvertSystemConfig.user ( config , rs ) ; com.google.gerrit.pgm.ConvertSystemConfig.auth ( config , rs ) ; com.google.gerrit.pgm.ConvertSystemConfig.gitweb ( config , rs ) ; com.google.gerrit.pgm.ConvertSystemConfig.repo ( config , rs ) ; }

Target:
private static void export ( org.spearce.jgit.lib.RepositoryConfig config , java.sql.ResultSet rs ) throws java.sql.SQLException { com.google.gerrit.pgm.ConvertSystemConfig.gerrit ( config , rs ) ; com.google.gerrit.pgm.ConvertSystemConfig.sshd ( config , rs ) ; com.google.gerrit.pgm.ConvertSystemConfig.contactstore ( config , rs ) ; com.google.gerrit.pgm.ConvertSystemConfig.user ( config , rs ) ; com.google.gerrit.pgm.ConvertSystemConfig.auth ( config , rs ) ; com.google.gerrit.pgm.ConvertSystemConfig.gitweb ( config , rs ) ; com.google.gerrit.pgm.ConvertSystemConfig.repo ( config , rs ) ; }
Source:
private void updateHead ( org.eclipse.jgit.transport.URIish replicateURI , java.lang.String newHead ) { if ( ! ( replicateURI.isRemote ( ) ) ) { com.googlesource.gerrit.plugins.replication.ReplicationQueue.updateHeadLocally ( replicateURI , newHead ) ; } else if ( com.googlesource.gerrit.plugins.replication.ReplicationQueue.isSSH ( replicateURI ) ) { com.googlesource.gerrit.plugins.replication.ReplicationQueue.updateHeadRemoteSsh ( replicateURI , newHead ) ; } else { com.googlesource.gerrit.plugins.replication.ReplicationQueue.repLog.warn ( java.lang.String.format ( ( "Cannot update HEAD of project on remote site %s." + ( " Only local paths and SSH URLs are supported" + " for remote HEAD update." ) ) , replicateURI ) ) ; } }

Target:
private void updateHead ( org.eclipse.jgit.transport.URIish replicateURI , java.lang.String newHead ) { if ( ! ( replicateURI.isRemote ( ) ) ) { com.googlesource.gerrit.plugins.replication.ReplicationQueue.updateHeadLocally ( replicateURI , newHead ) ; } else if ( com.googlesource.gerrit.plugins.replication.ReplicationQueue.isSSH ( replicateURI ) ) { updateHeadRemoteSsh ( replicateURI , newHead ) ; } else { com.googlesource.gerrit.plugins.replication.ReplicationQueue.repLog.warn ( java.lang.String.format ( ( "Cannot update HEAD of project on remote site %s." + ( " Only local paths and SSH URLs are supported" + " for remote HEAD update." ) ) , replicateURI ) ) ; } }
Source:
public void testCreateGroup ( ) throws java.lang.Exception { final java.lang.String newGroupName = "newGroup" ; com.google.gerrit.acceptance.RestResponse r = adminSession.put ( ( "/groups/" + newGroupName ) ) ; com.google.gerrit.server.group.GroupJson.GroupInfo g = newGson ( ) . fromJson ( r.getReader ( ) , com.google.gerrit.server.group.GroupJson.GroupInfo.class ) ; com.google.common.truth.Truth.assertThat ( g.name ) . isEqualTo ( newGroupName ) ; com.google.gerrit.reviewdb.client.AccountGroup group = groupCache.get ( new com.google.gerrit.reviewdb.client.AccountGroup.NameKey ( newGroupName ) ) ; com.google.common.truth.Truth.assertThat ( group ) . isNotNull ( ) ; com.google.gerrit.acceptance.rest.group.GroupAssert.assertGroupInfo ( group , g ) ; }

Target:
public void testCreateGroup ( ) throws java.lang.Exception { java.lang.String newGroupName = name ( "newGroup" ) ; com.google.gerrit.acceptance.RestResponse r = adminSession.put ( ( "/groups/" + newGroupName ) ) ; com.google.gerrit.server.group.GroupJson.GroupInfo g = newGson ( ) . fromJson ( r.getReader ( ) , com.google.gerrit.server.group.GroupJson.GroupInfo.class ) ; com.google.common.truth.Truth.assertThat ( g.name ) . isEqualTo ( newGroupName ) ; com.google.gerrit.reviewdb.client.AccountGroup group = groupCache.get ( new com.google.gerrit.reviewdb.client.AccountGroup.NameKey ( newGroupName ) ) ; com.google.common.truth.Truth.assertThat ( group ) . isNotNull ( ) ; com.google.gerrit.acceptance.rest.group.GroupAssert.assertGroupInfo ( group , g ) ; }
Source:
public void testHostname ( ) { assertEquals ( "*" , com.google.gerrit.server.util.SocketUtil.hostname ( new java.net.InetSocketAddress ( 80 ) ) ) ; assertEquals ( "localhost" , com.google.gerrit.server.util.SocketUtil.hostname ( new java.net.InetSocketAddress ( "localhost" , 80 ) ) ) ; assertEquals ( "foo" , com.google.gerrit.server.util.SocketUtil.hostname ( java.net.InetSocketAddress.createUnresolved ( "foo" , 80 ) ) ) ; }

Target:
public void testHostname ( ) { org.junit.Assert.assertEquals ( "*" , com.google.gerrit.server.util.SocketUtil.hostname ( new java.net.InetSocketAddress ( 80 ) ) ) ; org.junit.Assert.assertEquals ( "localhost" , com.google.gerrit.server.util.SocketUtil.hostname ( new java.net.InetSocketAddress ( "localhost" , 80 ) ) ) ; org.junit.Assert.assertEquals ( "foo" , com.google.gerrit.server.util.SocketUtil.hostname ( java.net.InetSocketAddress.createUnresolved ( "foo" , 80 ) ) ) ; }
Source:
public void testInheritRead_OverrideWithDeny ( ) { com.google.gerrit.server.project.Util.grant ( util.getParentConfig ( ) , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.project.Util.REGISTERED , "refs/*" ) ; com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.project.Util.REGISTERED , "refs/*" ) . setDeny ( ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local ) ; assertFalse ( "can't read" , u.isVisible ( ) ) ; }

Target:
public void testInheritRead_OverrideWithDeny ( ) { com.google.gerrit.server.project.Util.grant ( util.getParentConfig ( ) , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.project.Util.REGISTERED , "refs/*" ) ; com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.project.Util.REGISTERED , "refs/*" ) . setDeny ( ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local ) ; org.junit.Assert.assertFalse ( "can't read" , u.isVisible ( ) ) ; }
Source:
private com.google.gerrit.server.util.RequestContext newRequestContext ( com.google.gerrit.reviewdb.client.Account.Id requestUserId ) { final com.google.gerrit.server.CurrentUser requestUser = userFactory.create ( com.google.inject.util.Providers.of ( db ) , requestUserId ) ; return new com.google.gerrit.server.util.RequestContext ( ) { @ java.lang.Override public com.google.gerrit.server.CurrentUser getCurrentUser ( ) { return requestUser ; } @ java.lang.Override public com.google.inject.Provider < com.google.gerrit.reviewdb.server.ReviewDb > getReviewDbProvider ( ) { return com.google.inject.util.Providers.of ( db ) ; } } ; }

Target:
protected com.google.gerrit.server.util.RequestContext newRequestContext ( com.google.gerrit.reviewdb.client.Account.Id requestUserId ) { final com.google.gerrit.server.CurrentUser requestUser = userFactory.create ( com.google.inject.util.Providers.of ( db ) , requestUserId ) ; return new com.google.gerrit.server.util.RequestContext ( ) { @ java.lang.Override public com.google.gerrit.server.CurrentUser getCurrentUser ( ) { return requestUser ; } @ java.lang.Override public com.google.inject.Provider < com.google.gerrit.reviewdb.server.ReviewDb > getReviewDbProvider ( ) { return com.google.inject.util.Providers.of ( db ) ; } } ; }
Source:
public com.google.common.base.Optional < com.google.gerrit.reviewdb.client.AccountGroup > load ( final com.google.gerrit.reviewdb.client.AccountGroup.Id key ) throws java.lang.Exception { final com.google.gerrit.reviewdb.server.ReviewDb db = schema.open ( ) ; try { return com.google.common.base.Optional.fromNullable ( db.accountGroups ( ) . get ( key ) ) ; } finally { db.close ( ) ; } }

Target:
public com.google.common.base.Optional < com.google.gerrit.reviewdb.client.AccountGroup > load ( final com.google.gerrit.reviewdb.client.AccountGroup.Id key ) throws java.lang.Exception { try ( com.google.gerrit.reviewdb.server.ReviewDb db = schema.open ( ) ) { return com.google.common.base.Optional.fromNullable ( db.accountGroups ( ) . get ( key ) ) ; } }
Source:
private boolean canCreateServiceUser ( ) { if ( userProvider.get ( ) . isIdentifiedUser ( ) ) { return ( permissionBackend.user ( userProvider ) . testOrFalse ( new com.google.gerrit.extensions.api.access.PluginPermission ( pluginName , CreateServiceUserCapability.ID ) ) ) && ( permissionBackend.user ( userProvider ) . testOrFalse ( com.google.gerrit.server.permissions.GlobalPermission.ADMINISTRATE_SERVER ) ) ; } else { return false ; } }

Target:
private boolean canCreateServiceUser ( ) { if ( userProvider.get ( ) . isIdentifiedUser ( ) ) { return ( permissionBackend.user ( userProvider ) . testOrFalse ( new com.google.gerrit.extensions.api.access.PluginPermission ( pluginName , CreateServiceUserCapability.ID ) ) ) || ( permissionBackend.user ( userProvider ) . testOrFalse ( com.google.gerrit.server.permissions.GlobalPermission.ADMINISTRATE_SERVER ) ) ; } return false ; }
Source:
protected java.lang.String textTemplate ( java.lang.String name ) throws com.google.gerrit.common.errors.EmailException { java.lang.String velocityName = name + ".vm" ; java.nio.file.Path filePath = args.site.mail_dir.resolve ( velocityName ) ; if ( java.nio.file.Files.isRegularFile ( filePath ) ) { return velocifyFile ( velocityName ) ; } else { return soyTextTemplate ( name ) ; } }

Target:
protected java.lang.String textTemplate ( java.lang.String name ) throws com.google.gerrit.common.errors.EmailException { java.lang.String velocityName = name + ".vm" ; java.nio.file.Path filePath = args.site.mail_dir.resolve ( velocityName ) ; if ( java.nio.file.Files.isRegularFile ( filePath ) ) { return velocifyFile ( velocityName ) ; } return soyTextTemplate ( name ) ; }
Source:
public void setUpMocks ( ) { indexRestApiServlet = new com.ericsson.gerrit.plugins.highavailability.forwarder.rest.IndexChangeRestApiServlet ( indexerMock , schemaFactoryMock ) ; id = Change.Id.parse ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.IndexChangeRestApiServletTest.CHANGE_NUMBER ) ; org.mockito.Mockito.when ( requestMock.getPathInfo ( ) ) . thenReturn ( ( "/index/change/" + ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.IndexChangeRestApiServletTest.CHANGE_NUMBER ) ) ) ; change = new com.google.gerrit.reviewdb.client.Change ( null , id , null , null , com.google.gerrit.common.TimeUtil.nowTs ( ) ) ; }

Target:
public void setUpMocks ( ) { indexRestApiServlet = new com.ericsson.gerrit.plugins.highavailability.forwarder.rest.IndexChangeRestApiServlet ( indexerMock , schemaFactoryMock ) ; id = new com.google.gerrit.reviewdb.client.Change.Id ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.IndexChangeRestApiServletTest.CHANGE_NUMBER ) ; org.mockito.Mockito.when ( requestMock.getPathInfo ( ) ) . thenReturn ( ( "/index/change/" + ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.IndexChangeRestApiServletTest.CHANGE_NUMBER ) ) ) ; change = new com.google.gerrit.reviewdb.client.Change ( null , id , null , null , com.google.gerrit.common.TimeUtil.nowTs ( ) ) ; }
Source:
private void status ( int sc ) { if ( sc == ( javax.servlet.http.HttpServletResponse.SC_UNAUTHORIZED ) ) { java.lang.StringBuilder v = new java.lang.StringBuilder ( ) ; v.append ( com.google.gerrit.httpd.ProjectBasicAuthFilter.LIT_BASIC ) ; v.append ( ( ( "realm=\"" + ( com.google.gerrit.httpd.ProjectBasicAuthFilter.REALM_NAME ) ) + "\"" ) ) ; setHeader ( com.google.gerrit.httpd.ProjectBasicAuthFilter.Response.WWW_AUTHENTICATE , v.toString ( ) ) ; } else if ( containsHeader ( com.google.gerrit.httpd.ProjectBasicAuthFilter.Response.WWW_AUTHENTICATE ) ) { setHeader ( com.google.gerrit.httpd.ProjectBasicAuthFilter.Response.WWW_AUTHENTICATE , null ) ; } }

Target:
private void status ( int sc ) { if ( sc == ( javax.servlet.http.HttpServletResponse.SC_UNAUTHORIZED ) ) { java.lang.StringBuilder v = new java.lang.StringBuilder ( ) ; v.append ( com.google.gerrit.httpd.ProjectBasicAuthFilter.LIT_BASIC ) ; v.append ( "realm=\"" ) . append ( com.google.gerrit.httpd.ProjectBasicAuthFilter.REALM_NAME ) . append ( "\"" ) ; setHeader ( com.google.gerrit.httpd.ProjectBasicAuthFilter.Response.WWW_AUTHENTICATE , v.toString ( ) ) ; } else if ( containsHeader ( com.google.gerrit.httpd.ProjectBasicAuthFilter.Response.WWW_AUTHENTICATE ) ) { setHeader ( com.google.gerrit.httpd.ProjectBasicAuthFilter.Response.WWW_AUTHENTICATE , null ) ; } }
Source:
public int length ( ) { int count = 0 ; com.googlecode.prolog_cafe.lang.Term t = this ; while ( t.isList ( ) ) { count ++ ; t = ( ( com.googlecode.prolog_cafe.lang.ListTerm ) ( t ) ) . cdr ( ) . dereference ( ) ; } return count ; }

Target:
public int length ( ) { int count = 0 ; com.googlecode.prolog_cafe.lang.Term t = this ; while ( t instanceof com.googlecode.prolog_cafe.lang.ListTerm ) { count ++ ; t = ( ( com.googlecode.prolog_cafe.lang.ListTerm ) ( t ) ) . cdr ( ) . dereference ( ) ; } return count ; }
Source:
public void updateProjectWatch ( final com.google.gerrit.client.reviewdb.AccountProjectWatch watch , final com.google.gwt.user.client.rpc.AsyncCallback < com.google.gwtjsonrpc.client.VoidResult > callback ) { if ( ! ( com.google.gerrit.client.rpc.Common.getAccountId ( ) . equals ( watch.getAccountId ( ) ) ) ) { callback.onFailure ( new com.google.gerrit.client.rpc.NoSuchEntityException ( ) ) ; return ; } run ( callback , new com.google.gerrit.server.rpc.account.Action < com.google.gwtjsonrpc.client.VoidResult > ( ) { public com.google.gwtjsonrpc.client.VoidResult run ( com.google.gerrit.client.reviewdb.ReviewDb db ) throws com.google.gwtorm.client.OrmException { db.accountProjectWatches ( ) . update ( java.util.Collections.singleton ( watch ) ) ; return com.google.gwtjsonrpc.client.VoidResult.INSTANCE ; } } ) ; }

Target:
public void updateProjectWatch ( final com.google.gerrit.client.reviewdb.AccountProjectWatch watch , final com.google.gwt.user.client.rpc.AsyncCallback < com.google.gwtjsonrpc.client.VoidResult > callback ) { if ( ! ( getAccountId ( ) . equals ( watch.getAccountId ( ) ) ) ) { callback.onFailure ( new com.google.gerrit.client.rpc.NoSuchEntityException ( ) ) ; return ; } run ( callback , new com.google.gerrit.server.rpc.account.Action < com.google.gwtjsonrpc.client.VoidResult > ( ) { public com.google.gwtjsonrpc.client.VoidResult run ( com.google.gerrit.client.reviewdb.ReviewDb db ) throws com.google.gwtorm.client.OrmException { db.accountProjectWatches ( ) . update ( java.util.Collections.singleton ( watch ) ) ; return com.google.gwtjsonrpc.client.VoidResult.INSTANCE ; } } ) ; }
Source:
public void testMIXED_NoPreferredEmailUser ( ) { setFrom ( "MIXED" ) ; final java.lang.String name = "A U. Thor" ; final com.google.gerrit.reviewdb.client.Account.Id user = user ( name , null ) ; org.easymock.EasyMock.replay ( accountCache ) ; final com.google.gerrit.server.mail.Address r = create ( ) . from ( user ) ; assertNotNull ( r ) ; assertEquals ( ( name + " (Code Review)" ) , r.name ) ; assertEquals ( ident.getEmailAddress ( ) , r.email ) ; org.easymock.EasyMock.verify ( accountCache ) ; }

Target:
public void testMIXED_NoPreferredEmailUser ( ) { setFrom ( "MIXED" ) ; final java.lang.String name = "A U. Thor" ; final com.google.gerrit.reviewdb.client.Account.Id user = user ( name , null ) ; org.easymock.EasyMock.replay ( accountCache ) ; final com.google.gerrit.server.mail.Address r = create ( ) . from ( user ) ; org.junit.Assert.assertNotNull ( r ) ; org.junit.Assert.assertEquals ( ( name + " (Code Review)" ) , r.name ) ; org.junit.Assert.assertEquals ( ident.getEmailAddress ( ) , r.email ) ; org.easymock.EasyMock.verify ( accountCache ) ; }
Source:
private void assertReviewers ( com.google.gerrit.reviewdb.client.Change c , com.google.gerrit.acceptance.TestAccount ... expectedReviewers ) throws com.google.gwtorm.server.OrmException { java.lang.Iterable < com.google.gerrit.reviewdb.client.Account.Id > actualIds = approvalsUtil.getReviewers ( db , notesFactory.create ( c ) ) . values ( ) ; com.google.common.truth.Truth.assertThat ( actualIds ) . containsExactlyElementsIn ( com.google.common.collect.Sets.newHashSet ( com.google.gerrit.acceptance.TestAccount.ids ( expectedReviewers ) ) ) ; }

Target:
private void assertReviewers ( com.google.gerrit.reviewdb.client.Change c , com.google.gerrit.acceptance.TestAccount ... expectedReviewers ) throws com.google.gwtorm.server.OrmException { java.lang.Iterable < com.google.gerrit.reviewdb.client.Account.Id > actualIds = approvalsUtil.getReviewers ( db , notesFactory.create ( db , c ) ) . values ( ) ; com.google.common.truth.Truth.assertThat ( actualIds ) . containsExactlyElementsIn ( com.google.common.collect.Sets.newHashSet ( com.google.gerrit.acceptance.TestAccount.ids ( expectedReviewers ) ) ) ; }
Source:
protected void initColumnHeaders ( ) { super . initColumnHeaders ( ) ; if ( ( com.google.gerrit.client.Gerrit.getGitwebLink ( ) ) != null ) { table.setText ( 0 , ProjectsTable.C_REPO_BROWSER , Util.C.projectRepoBrowser ( ) ) ; table.getFlexCellFormatter ( ) . addStyleName ( 0 , ProjectsTable.C_REPO_BROWSER , Gerrit.RESOURCES.css ( ) . dataHeader ( ) ) ; } }

Target:
protected void initColumnHeaders ( ) { super . initColumnHeaders ( ) ; table.setText ( 0 , ProjectsTable.C_REPO_BROWSER , Util.C.projectRepoBrowser ( ) ) ; table.getFlexCellFormatter ( ) . addStyleName ( 0 , ProjectsTable.C_REPO_BROWSER , Gerrit.RESOURCES.css ( ) . dataHeader ( ) ) ; }
Source:
private static com.google.gerrit.server.account.AccountState missing ( com.google.gerrit.reviewdb.client.Account.Id accountId ) { com.google.gerrit.reviewdb.client.Account account = new com.google.gerrit.reviewdb.client.Account ( accountId , com.google.gerrit.server.util.TimeUtil.nowTs ( ) ) ; java.util.Collection < com.google.gerrit.reviewdb.client.AccountExternalId > ids = java.util.Collections.emptySet ( ) ; java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.UUID > anon = com.google.common.collect.ImmutableSet.of ( AccountGroup.ANONYMOUS_USERS ) ; return new com.google.gerrit.server.account.AccountState ( account , anon , ids ) ; }

Target:
private static com.google.gerrit.server.account.AccountState missing ( com.google.gerrit.reviewdb.client.Account.Id accountId ) { com.google.gerrit.reviewdb.client.Account account = new com.google.gerrit.reviewdb.client.Account ( accountId , com.google.gerrit.server.util.TimeUtil.nowTs ( ) ) ; java.util.Collection < com.google.gerrit.reviewdb.client.AccountExternalId > ids = java.util.Collections.emptySet ( ) ; java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.UUID > anon = com.google.common.collect.ImmutableSet.of ( ) ; return new com.google.gerrit.server.account.AccountState ( account , anon , ids ) ; }
Source:
private com.google.inject.Injector createWebInjector ( ) { final java.util.List < com.google.inject.Module > modules = new java.util.ArrayList < com.google.inject.Module > ( ) ; modules.add ( sshInjector.getInstance ( com.google.gerrit.httpd.WebModule.class ) ) ; modules.add ( sysInjector.getInstance ( com.google.gerrit.httpd.GitOverHttpModule.class ) ) ; modules.add ( sshInjector.getInstance ( com.google.gerrit.httpd.WebSshGlueModule.class ) ) ; modules.add ( com.google.gerrit.httpd.CacheBasedWebSession.module ( ) ) ; modules.add ( com.google.gerrit.server.contact.HttpContactStoreConnection.module ( ) ) ; return sysInjector.createChildInjector ( modules ) ; }

Target:
private com.google.inject.Injector createWebInjector ( ) { final java.util.List < com.google.inject.Module > modules = new java.util.ArrayList < com.google.inject.Module > ( ) ; modules.add ( sysInjector.getInstance ( com.google.gerrit.httpd.GitOverHttpModule.class ) ) ; modules.add ( sshInjector.getInstance ( com.google.gerrit.httpd.WebModule.class ) ) ; modules.add ( sshInjector.getInstance ( com.google.gerrit.httpd.WebSshGlueModule.class ) ) ; modules.add ( com.google.gerrit.httpd.CacheBasedWebSession.module ( ) ) ; modules.add ( com.google.gerrit.server.contact.HttpContactStoreConnection.module ( ) ) ; return sysInjector.createChildInjector ( modules ) ; }
Source:
static int getMinOwnerVoteLevel ( com.google.gerrit.server.query.change.ChangeData changeData ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.Project.NameKey project = changeData.change ( ) . getProject ( ) ; try { return ( ( com.googlesource.gerrit.plugins.findowners.Config.config ) == null ) || ( project == null ) ? com.googlesource.gerrit.plugins.findowners.Config.minOwnerVoteLevel : com.googlesource.gerrit.plugins.findowners.Config.config.getFromProjectConfigWithInheritance ( project , com.googlesource.gerrit.plugins.findowners.Config.PLUGIN_NAME ) . getInt ( com.googlesource.gerrit.plugins.findowners.Config.MIN_OWNER_VOTE_LEVEL , com.googlesource.gerrit.plugins.findowners.Config.minOwnerVoteLevel ) ; } catch ( com.google.gerrit.server.project.NoSuchProjectException e ) { com.googlesource.gerrit.plugins.findowners.Config.log.error ( ( "Cannot find project: " + project ) ) ; return com.googlesource.gerrit.plugins.findowners.Config.minOwnerVoteLevel ; } }

Target:
static int getMinOwnerVoteLevel ( com.google.gerrit.server.query.change.ChangeData changeData ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.Project.NameKey project = changeData.change ( ) . getProject ( ) ; try { return ( ( com.googlesource.gerrit.plugins.findowners.Config.config ) == null ) || ( project == null ) ? com.googlesource.gerrit.plugins.findowners.Config.minOwnerVoteLevel : com.googlesource.gerrit.plugins.findowners.Config.config.getFromProjectConfigWithInheritance ( project , com.googlesource.gerrit.plugins.findowners.Config.PLUGIN_NAME ) . getInt ( com.googlesource.gerrit.plugins.findowners.Config.MIN_OWNER_VOTE_LEVEL , com.googlesource.gerrit.plugins.findowners.Config.minOwnerVoteLevel ) ; } catch ( com.google.gerrit.server.project.NoSuchProjectException e ) { com.googlesource.gerrit.plugins.findowners.Config.log.error ( ( "Cannot find project: " + project ) , e ) ; return com.googlesource.gerrit.plugins.findowners.Config.minOwnerVoteLevel ; } }
Source:
public void updateRepo ( com.google.gerrit.server.git.BatchUpdate.RepoContext ctx ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.ResourceConflictException , com.google.gwtorm.server.OrmException , java.io.IOException { init ( ) ; validate ( ctx ) ; ctx.addRefUpdate ( new org.eclipse.jgit.transport.ReceiveCommand ( org.eclipse.jgit.lib.ObjectId.zeroId ( ) , commit , getPatchSetId ( ) . toRefName ( ) , ReceiveCommand.Type.CREATE ) ) ; }

Target:
public void updateRepo ( com.google.gerrit.server.git.BatchUpdate.RepoContext ctx ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.ResourceConflictException , com.google.gwtorm.server.OrmException , java.io.IOException { validate ( ctx ) ; ctx.addRefUpdate ( new org.eclipse.jgit.transport.ReceiveCommand ( org.eclipse.jgit.lib.ObjectId.zeroId ( ) , commit , getPatchSetId ( ) . toRefName ( ) , ReceiveCommand.Type.CREATE ) ) ; }
Source:
public com.google.gerrit.extensions.api.changes.ChangeApi rebase ( ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return changes.id ( rebase.get ( ) . apply ( revision , null ) . _number ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot rebase ps" , e ) ; } catch ( com.google.gerrit.common.errors.EmailException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot rebase ps" , e ) ; } }

Target:
public com.google.gerrit.extensions.api.changes.ChangeApi rebase ( ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return changes.id ( rebase.get ( ) . apply ( revision , null ) . _number ) ; } catch ( com.google.gwtorm.server.OrmException | com.google.gerrit.common.errors.EmailException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot rebase ps" , e ) ; } }
Source:
public void setUp ( ) throws java.lang.Exception { final java.util.Properties p = new java.util.Properties ( ) ; p.setProperty ( "driver" , org.h2.Driver.class . getName ( ) ) ; p.setProperty ( "url" , ( "jdbc:h2:mem:PhoneBookDb" + ( ( com.google.gwtorm.server.PhoneBookDbTestCase.runCount ) ++ ) ) ) ; db = new com.google.gwtorm.jdbc.Database < com.google.gwtorm.data.PhoneBookDb > ( new com.google.gwtorm.jdbc.SimpleDataSource ( p ) , com.google.gwtorm.data.PhoneBookDb.class ) ; openSchemas = new java.util.ArrayList < com.google.gwtorm.data.PhoneBookDb > ( ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { final java.util.Properties p = new java.util.Properties ( ) ; p.setProperty ( "driver" , org.h2.Driver.class . getName ( ) ) ; p.setProperty ( "url" , ( "jdbc:h2:mem:PhoneBookDb" + ( ( com.google.gwtorm.server.PhoneBookDbTestCase.runCount ) ++ ) ) ) ; db = new com.google.gwtorm.jdbc.Database ( new com.google.gwtorm.jdbc.SimpleDataSource ( p ) , com.google.gwtorm.data.PhoneBookDb.class ) ; openSchemas = new java.util.ArrayList < > ( ) ; }
Source:
private void doGetFile ( com.google.gerrit.server.tools.ToolsCatalog.Entry ent , javax.servlet.http.HttpServletResponse rsp ) throws java.io.IOException { byte [ ] tosend = ent.getBytes ( ) ; rsp.setDateHeader ( org.eclipse.jgit.util.HttpSupport.HDR_EXPIRES , 0L ) ; rsp.setHeader ( org.eclipse.jgit.util.HttpSupport.HDR_PRAGMA , "no-cache" ) ; rsp.setHeader ( org.eclipse.jgit.util.HttpSupport.HDR_CACHE_CONTROL , "no-cache, must-revalidate" ) ; rsp.setContentType ( "application/octet-stream" ) ; rsp.setContentLength ( tosend.length ) ; final java.io.OutputStream out = rsp.getOutputStream ( ) ; try { out.write ( tosend ) ; } finally { out.close ( ) ; } }

Target:
private void doGetFile ( com.google.gerrit.server.tools.ToolsCatalog.Entry ent , javax.servlet.http.HttpServletResponse rsp ) throws java.io.IOException { byte [ ] tosend = ent.getBytes ( ) ; rsp.setDateHeader ( org.eclipse.jgit.util.HttpSupport.HDR_EXPIRES , 0L ) ; rsp.setHeader ( org.eclipse.jgit.util.HttpSupport.HDR_PRAGMA , "no-cache" ) ; rsp.setHeader ( org.eclipse.jgit.util.HttpSupport.HDR_CACHE_CONTROL , "no-cache, must-revalidate" ) ; rsp.setContentType ( "application/octet-stream" ) ; rsp.setContentLength ( tosend.length ) ; try ( java.io.OutputStream out = rsp.getOutputStream ( ) ) { out.write ( tosend ) ; } }
Source:
protected com.google.gerrit.common.data.ProjectAccess updateProjectConfig ( com.google.gerrit.server.project.ProjectControl projectControl , com.google.gerrit.server.git.ProjectConfig config , com.google.gerrit.server.git.MetaDataUpdate md , boolean parentProjectUpdate ) throws com.google.gerrit.server.permissions.PermissionBackendException , com.google.gerrit.server.project.NoSuchProjectException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { org.eclipse.jgit.revwalk.RevCommit commit = config.commit ( md ) ; gitRefUpdated.fire ( config.getProject ( ) . getNameKey ( ) , RefNames.REFS_CONFIG , base , commit.getId ( ) , projectControl.getUser ( ) . asIdentifiedUser ( ) . getAccount ( ) ) ; projectCache.evict ( config.getProject ( ) ) ; return projectAccessFactory.create ( projectName ) . call ( ) ; }

Target:
protected com.google.gerrit.common.data.ProjectAccess updateProjectConfig ( com.google.gerrit.server.git.ProjectConfig config , com.google.gerrit.server.git.MetaDataUpdate md , boolean parentProjectUpdate ) throws com.google.gerrit.server.permissions.PermissionBackendException , com.google.gerrit.server.project.NoSuchProjectException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { org.eclipse.jgit.revwalk.RevCommit commit = config.commit ( md ) ; gitRefUpdated.fire ( config.getProject ( ) . getNameKey ( ) , RefNames.REFS_CONFIG , base , commit.getId ( ) , user.asIdentifiedUser ( ) . getAccount ( ) ) ; projectCache.evict ( config.getProject ( ) ) ; return projectAccessFactory.create ( projectName ) . call ( ) ; }
Source:
private static java.util.Properties loadBuckProperties ( java.io.File gen ) throws java.io.FileNotFoundException , java.io.IOException { java.util.Properties properties = new java.util.Properties ( ) ; java.io.InputStream in = new java.io.FileInputStream ( new java.io.File ( new java.io.File ( gen , "tools" ) , "buck.properties" ) ) ; try { properties.load ( in ) ; } finally { in.close ( ) ; } return properties ; }

Target:
private static java.util.Properties loadBuckProperties ( java.io.File gen ) throws java.io.FileNotFoundException , java.io.IOException { java.util.Properties properties = new java.util.Properties ( ) ; try ( java.io.InputStream in = new java.io.FileInputStream ( new java.io.File ( new java.io.File ( gen , "tools" ) , "buck.properties" ) ) ) { properties.load ( in ) ; } return properties ; }
Source:
void onSaveSuccess ( final com.google.gerrit.client.reviewdb.Account result ) { registerNewEmail.setEnabled ( false ) ; final com.google.gerrit.client.reviewdb.Account me = com.google.gerrit.client.Gerrit.getUserAccount ( ) ; me.setFullName ( result.getFullName ( ) ) ; me.setPreferredEmail ( result.getPreferredEmail ( ) ) ; com.google.gerrit.client.Gerrit.refreshMenuBar ( ) ; if ( ( accountSettings ) != null ) { accountSettings.display ( me ) ; } }

Target:
void onSaveSuccess ( final com.google.gerrit.client.reviewdb.Account result ) { final com.google.gerrit.client.reviewdb.Account me = com.google.gerrit.client.Gerrit.getUserAccount ( ) ; me.setFullName ( result.getFullName ( ) ) ; me.setPreferredEmail ( result.getPreferredEmail ( ) ) ; com.google.gerrit.client.Gerrit.refreshMenuBar ( ) ; if ( ( accountSettings ) != null ) { accountSettings.display ( me ) ; } }
Source:
private com.googlesource.gerrit.plugins.xdocs.ConfigSection getFormatterConfig ( java.lang.String formatterName , com.google.gerrit.server.project.ProjectState project ) { for ( com.google.gerrit.server.project.ProjectState p : project.tree ( ) ) { org.eclipse.jgit.lib.Config cfg = pluginCfgFactory.getProjectPluginConfig ( p , pluginName ) ; if ( cfg.getSubsections ( com.googlesource.gerrit.plugins.xdocs.XDocGlobalConfig.SECTION_FORMATTER ) . contains ( formatterName ) ) { return new com.googlesource.gerrit.plugins.xdocs.XDocGlobalConfig ( cfg ) . getFormatterConfig ( formatterName ) ; } } return new com.googlesource.gerrit.plugins.xdocs.XDocGlobalConfig ( pluginCfgFactory.getGlobalPluginConfig ( pluginName ) ) . getFormatterConfig ( formatterName ) ; }

Target:
public com.googlesource.gerrit.plugins.xdocs.ConfigSection getFormatterConfig ( java.lang.String formatterName , com.google.gerrit.server.project.ProjectState project ) { for ( com.google.gerrit.server.project.ProjectState p : project.tree ( ) ) { org.eclipse.jgit.lib.Config cfg = pluginCfgFactory.getProjectPluginConfig ( p , pluginName ) ; if ( cfg.getSubsections ( com.googlesource.gerrit.plugins.xdocs.XDocGlobalConfig.SECTION_FORMATTER ) . contains ( formatterName ) ) { return new com.googlesource.gerrit.plugins.xdocs.XDocGlobalConfig ( cfg ) . getFormatterConfig ( formatterName ) ; } } return new com.googlesource.gerrit.plugins.xdocs.XDocGlobalConfig ( pluginCfgFactory.getGlobalPluginConfig ( pluginName ) ) . getFormatterConfig ( formatterName ) ; }
Source:
public boolean match ( final com.google.gerrit.server.query.change.ChangeData object ) throws com.google.gwtorm.server.OrmException { for ( com.google.gerrit.reviewdb.client.PatchSetApproval p : object.approvals ( dbProvider ) ) { final com.google.gerrit.server.IdentifiedUser reviewer = userFactory.create ( dbProvider , p.getAccountId ( ) ) ; if ( reviewer.getEffectiveGroups ( ) . contains ( uuid ) ) { return true ; } } return false ; }

Target:
public boolean match ( final com.google.gerrit.server.query.change.ChangeData object ) throws com.google.gwtorm.server.OrmException { for ( com.google.gerrit.reviewdb.client.PatchSetApproval p : object.approvals ( ) ) { final com.google.gerrit.server.IdentifiedUser reviewer = userFactory.create ( dbProvider , p.getAccountId ( ) ) ; if ( reviewer.getEffectiveGroups ( ) . contains ( uuid ) ) { return true ; } } return false ; }
Source:
void addChange ( java.lang.String token ) { try { changeArgumentParser.addChange ( token , changes , null , false ) ; } catch ( com.google.gerrit.sshd.commands.UnloggedFailure e ) { writeError ( "warning" , e.getMessage ( ) ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new java.lang.IllegalArgumentException ( "database is down" , e ) ; } }

Target:
void addChange ( java.lang.String token ) { try { changeArgumentParser.addChange ( token , changes , null , false ) ; } catch ( com.google.gerrit.sshd.commands.UnloggedFailure | com.google.gwtorm.server.OrmException e ) { writeError ( "warning" , e.getMessage ( ) ) ; } }
Source:
com.google.gerrit.common.data.PatchScript toPatchScript ( final com.google.gerrit.server.patch.PatchListEntry content , final com.google.gerrit.common.data.CommentDetail comments , final java.util.List < com.google.gerrit.reviewdb.client.Patch > history ) throws java.io.IOException { reader = db.newObjectReader ( ) ; try { return build ( content , comments , history ) ; } finally { reader.release ( ) ; } }

Target:
com.google.gerrit.common.data.PatchScript toPatchScript ( final com.google.gerrit.server.patch.PatchListEntry content , final com.google.gerrit.common.data.CommentDetail comments , final java.util.List < com.google.gerrit.reviewdb.client.Patch > history ) throws java.io.IOException { reader = db.newObjectReader ( ) ; try { return build ( content , comments , history ) ; } finally { reader.close ( ) ; } }
Source:
public void queryChangesMultipleTerms ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r1 = createChange ( ) ; createChange ( ) ; java.util.List < com.google.gerrit.extensions.common.ChangeInfo > results = gApi.changes ( ) . query ( ( "status:open " + ( r1.getChangeId ( ) ) ) ) . get ( ) ; org.junit.Assert.assertEquals ( r1.getChangeId ( ) , com.google.common.collect.Iterables.getOnlyElement ( results ) . changeId ) ; }

Target:
public void queryChangesMultipleTerms ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r1 = createChange ( ) ; createChange ( ) ; java.util.List < com.google.gerrit.extensions.common.ChangeInfo > results = query ( ( "status:open " + ( r1.getChangeId ( ) ) ) ) ; org.junit.Assert.assertEquals ( r1.getChangeId ( ) , com.google.common.collect.Iterables.getOnlyElement ( results ) . changeId ) ; }