auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private org.eclipse.jgit.lib.ObjectId pushChangeTo ( org.eclipse.jgit.junit.TestRepository < ? > repo , java.lang.String branch , java.lang.String message ) throws java.lang.Exception { repo.branch ( "HEAD" ) . commit ( ) . insertChangeId ( ) . message ( message ) . add ( "a.txt" , "a contents" ) . create ( ) ; repo.git ( ) . push ( ) . setRemote ( "origin" ) . setRefSpecs ( new org.eclipse.jgit.transport.RefSpec ( ( "HEAD:refs/heads/" + branch ) ) ) . call ( ) ; return repo.getRepository ( ) . resolve ( "HEAD" ) ; }

Target:
private org.eclipse.jgit.lib.ObjectId pushChangeTo ( org.eclipse.jgit.junit.TestRepository < ? > repo , java.lang.String branch , java.lang.String message ) throws java.lang.Exception { org.eclipse.jgit.lib.ObjectId ret = repo.branch ( "HEAD" ) . commit ( ) . insertChangeId ( ) . message ( message ) . add ( "a.txt" , ( "a contents: " + ( com.google.gerrit.acceptance.git.SubmoduleSubscriptionsIT.contentCounter.addAndGet ( 1 ) ) ) ) . create ( ) ; repo.git ( ) . push ( ) . setRemote ( "origin" ) . setRefSpecs ( new org.eclipse.jgit.transport.RefSpec ( ( "HEAD:refs/heads/" + branch ) ) ) . call ( ) ; return ret ; }
Source:
public void testIsEnabledEventMultiBranchExact ( ) { java.lang.String [ ] branches = new java.lang.String [ ] { "refs/heads/foo" , "refs/heads/testBranch" } ; setupIsEnabled ( "true" , null , branches ) ; com.google.gerrit.server.events.PatchSetCreatedEvent event = new com.google.gerrit.server.events.PatchSetCreatedEvent ( ) ; event.change = new com.google.gerrit.server.data.ChangeAttribute ( ) ; event.change.project = "testProject" ; event.change.branch = "testBranch" ; com.googlesource.gerrit.plugins.its.base.its.ItsConfig itsConfig = createItsConfig ( ) ; replayMocks ( ) ; assertTrue ( itsConfig.isEnabled ( event ) ) ; }

Target:
public void testIsEnabledEventSingleBranchRegExp ( ) { java.lang.String [ ] branches = new java.lang.String [ ] { "^refs/heads/test.*" } ; setupIsEnabled ( "true" , null , branches ) ; com.google.gerrit.server.events.PatchSetCreatedEvent event = new com.google.gerrit.server.events.PatchSetCreatedEvent ( ) ; com.google.gerrit.server.data.ChangeAttribute changeAttribute = new com.google.gerrit.server.data.ChangeAttribute ( ) ; changeAttribute.project = "testProject" ; changeAttribute.branch = "testBranch" ; event.change = com.google.common.base.Suppliers.ofInstance ( changeAttribute ) ; com.googlesource.gerrit.plugins.its.base.its.ItsConfig itsConfig = createItsConfig ( ) ; replayMocks ( ) ; assertTrue ( itsConfig.isEnabled ( event ) ) ; }
Source:
public java.util.Collection < com.google.gerrit.client.reviewdb.ProjectRight > getWildcardRights ( final com.google.gerrit.client.reviewdb.ApprovalCategory.Id id ) { if ( ( wildcardRights ) == null ) { wildcardRights = com.google.gerrit.server.workflow.FunctionState.index ( com.google.gerrit.client.rpc.Common.getProjectCache ( ) . getWildcardRights ( ) ) ; } final java.util.Collection < com.google.gerrit.client.reviewdb.ProjectRight > l = wildcardRights.get ( id ) ; return l != null ? l : java.util.Collections.< com.google.gerrit.client.reviewdb.ProjectRight > emptySet ( ) ; }

Target:
public java.util.Collection < com.google.gerrit.client.reviewdb.ProjectRight > getWildcardRights ( final com.google.gerrit.client.reviewdb.ApprovalCategory.Id id ) { if ( ( wildcardRights ) == null ) { wildcardRights = com.google.gerrit.server.workflow.FunctionState.index ( projectCache.getWildcardRights ( ) ) ; } final java.util.Collection < com.google.gerrit.client.reviewdb.ProjectRight > l = wildcardRights.get ( id ) ; return l != null ? l : java.util.Collections.< com.google.gerrit.client.reviewdb.ProjectRight > emptySet ( ) ; }
Source:
private void readObject ( final java.io.ObjectInputStream in ) throws java.io.IOException { oldId = org.eclipse.jgit.lib.ObjectIdSerialization.readCanBeNull ( in ) ; newId = org.eclipse.jgit.lib.ObjectIdSerialization.readNotNull ( in ) ; whitespace = com.google.gerrit.server.ioutil.BasicSerialization.readEnum ( in , com.google.gerrit.reviewdb.client.AccountDiffPreference.Whitespace.values ( ) ) ; }

Target:
private void readObject ( final java.io.ObjectInputStream in ) throws java.io.IOException { oldId = org.eclipse.jgit.lib.ObjectIdSerialization.readCanBeNull ( in ) ; newId = org.eclipse.jgit.lib.ObjectIdSerialization.readNotNull ( in ) ; char t = in.readChar ( ) ; whitespace = com.google.gerrit.server.patch.PatchListKey.WHITESPACE_TYPES.inverse ( ) . get ( t ) ; if ( ( whitespace ) == null ) { throw new java.io.IOException ( ( "Invalid whitespace type code: " + t ) ) ; } }
Source:
protected void configure ( ) { factory ( AbandonChange.Factory.class ) ; factory ( RestoreChange.Factory.class ) ; factory ( RevertChange.Factory.class ) ; factory ( ChangeDetailFactory.Factory.class ) ; factory ( IncludedInDetailFactory.Factory.class ) ; factory ( PatchSetDetailFactory.Factory.class ) ; factory ( PatchSetPublishDetailFactory.Factory.class ) ; factory ( SubmitAction.Factory.class ) ; factory ( PublishAction.Factory.class ) ; factory ( DeleteDraftChange.Factory.class ) ; }

Target:
protected void configure ( ) { factory ( AbandonChangeHandler.Factory.class ) ; factory ( RestoreChange.Factory.class ) ; factory ( RevertChange.Factory.class ) ; factory ( ChangeDetailFactory.Factory.class ) ; factory ( IncludedInDetailFactory.Factory.class ) ; factory ( PatchSetDetailFactory.Factory.class ) ; factory ( PatchSetPublishDetailFactory.Factory.class ) ; factory ( SubmitAction.Factory.class ) ; factory ( PublishAction.Factory.class ) ; factory ( DeleteDraftChange.Factory.class ) ; }
Source:
public void testDoPostWrongMediaType ( ) throws java.lang.Exception { resetAll ( ) ; org.easymock.EasyMock.expect ( req.getContentType ( ) ) . andReturn ( com.google.common.net.MediaType.APPLICATION_XML_UTF_8.toString ( ) ) . anyTimes ( ) ; rsp.sendError ( javax.servlet.http.HttpServletResponse.SC_UNSUPPORTED_MEDIA_TYPE , ( ( "Expecting " + ( com.google.common.net.MediaType.JSON_UTF_8.toString ( ) ) ) + " content type" ) ) ; org.easymock.EasyMock.expectLastCall ( ) . once ( ) ; replayAll ( ) ; syncEventsRestApiServlet.doPost ( req , rsp ) ; verifyAll ( ) ; }

Target:
public void testDoPostErrorWhileSendingErrorMessage ( ) throws java.lang.Exception { org.mockito.Mockito.doThrow ( new java.io.IOException ( com.ericsson.gerrit.plugins.syncevents.SyncEventsRestApiServletTest.ERR_MSG ) ) . when ( req ) . getReader ( ) ; org.mockito.Mockito.doThrow ( new java.io.IOException ( "someOtherError" ) ) . when ( rsp ) . sendError ( javax.servlet.http.HttpServletResponse.SC_BAD_REQUEST , com.ericsson.gerrit.plugins.syncevents.SyncEventsRestApiServletTest.ERR_MSG ) ; syncEventsRestApiServlet.doPost ( req , rsp ) ; }
Source:
private boolean canPushWithForce ( ) { if ( ( ! ( canWrite ( ) ) ) || ( ( GitRepositoryManager.REF_CONFIG.equals ( refName ) ) && ( ! ( projectControl.isOwner ( ) ) ) ) ) { return false ; } return canForcePerform ( Permission.PUSH ) ; }

Target:
private boolean canPushWithForce ( ) { if ( ( ! ( canWrite ( ) ) ) || ( ( RefNames.REFS_CONFIG.equals ( refName ) ) && ( ! ( projectControl.isOwner ( ) ) ) ) ) { return false ; } return canForcePerform ( Permission.PUSH ) ; }
Source:
protected void configure ( ) { com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.extensions.events.GitReferenceUpdatedListener.class ) . to ( com.googlesource.gerrit.plugins.supermanifest.SuperManifestRefUpdatedListener.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.extensions.events.LifecycleListener.class ) . to ( com.googlesource.gerrit.plugins.supermanifest.SuperManifestRefUpdatedListener.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; }

Target:
protected void configure ( ) { com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.extensions.events.GitReferenceUpdatedListener.class ) . to ( com.googlesource.gerrit.plugins.supermanifest.SuperManifestRefUpdatedListener.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.extensions.events.LifecycleListener.class ) . to ( com.googlesource.gerrit.plugins.supermanifest.SuperManifestRefUpdatedListener.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; post ( com.google.gerrit.server.project.BranchResource.BRANCH_KIND , "update_manifest" ) . to ( com.googlesource.gerrit.plugins.supermanifest.SuperManifestRefUpdatedListener.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; }
Source:
private static java.lang.String getFileNameOnly ( java.lang.String path ) { java.lang.String fileName = ( Patch.COMMIT_MSG.equals ( path ) ) ? Util.C.commitMessage ( ) : path ; int s = fileName.lastIndexOf ( '/' ) ; return s >= 0 ? fileName.substring ( ( s + 1 ) ) : fileName ; }

Target:
private static java.lang.String getFileName ( java.lang.String path ) { java.lang.String fileName = ( Patch.COMMIT_MSG.equals ( path ) ) ? Util.C.commitMessage ( ) : path ; int s = fileName.lastIndexOf ( '/' ) ; return s >= 0 ? fileName.substring ( ( s + 1 ) ) : fileName ; }
Source:
public java.lang.Object createEntry ( final java.lang.Object key ) throws java.lang.Exception { return lookup ( ( ( com.google.gerrit.client.reviewdb.Project.NameKey ) ( key ) ) ) ; }

Target:
protected void configure ( ) { final com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < com.google.gerrit.client.reviewdb.Project.NameKey , com.google.gerrit.server.project.ProjectState > > type = new com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < com.google.gerrit.client.reviewdb.Project.NameKey , com.google.gerrit.server.project.ProjectState > > ( ) { } ; core ( type , com.google.gerrit.server.project.ProjectCache.CACHE_NAME ) ; bind ( com.google.gerrit.server.project.ProjectCache.class ) ; }
Source:
public java.util.Map < java.lang.String , com.google.gerrit.extensions.api.access.ProjectAccessInfo > apply ( com.google.gerrit.extensions.restapi.TopLevelResource resource ) throws com.google.gerrit.extensions.restapi.ResourceConflictException , com.google.gerrit.extensions.restapi.ResourceNotFoundException , java.io.IOException { java.util.Map < java.lang.String , com.google.gerrit.extensions.api.access.ProjectAccessInfo > access = com.google.common.collect.Maps.newTreeMap ( ) ; for ( java.lang.String p : projects ) { com.google.gerrit.reviewdb.client.Project.NameKey projectName = new com.google.gerrit.reviewdb.client.Project.NameKey ( p ) ; access.put ( p , getAccess.apply ( projectName ) ) ; } return access ; }

Target:
public java.util.Map < java.lang.String , com.google.gerrit.extensions.api.access.ProjectAccessInfo > apply ( com.google.gerrit.extensions.restapi.TopLevelResource resource ) throws com.google.gerrit.extensions.restapi.ResourceConflictException , com.google.gerrit.extensions.restapi.ResourceNotFoundException , java.io.IOException { java.util.Map < java.lang.String , com.google.gerrit.extensions.api.access.ProjectAccessInfo > access = new java.util.TreeMap < > ( ) ; for ( java.lang.String p : projects ) { com.google.gerrit.reviewdb.client.Project.NameKey projectName = new com.google.gerrit.reviewdb.client.Project.NameKey ( p ) ; access.put ( p , getAccess.apply ( projectName ) ) ; } return access ; }
Source:
private void assertHS266AccessToken ( com.googlesource.gerrit.plugins.cfoauth.AccessToken accessToken ) { assertEquals ( com.googlesource.gerrit.plugins.cfoauth.UAAClientTest.HS256_TEST_TOKEN , accessToken.getValue ( ) ) ; assertEquals ( 1436232932L , accessToken.getExpiresAt ( ) ) ; assertEquals ( "external:marissa" , accessToken.getExternalId ( ) ) ; assertEquals ( "marissa" , accessToken.getUserName ( ) ) ; assertEquals ( "marissa@test.org" , accessToken.getEmailAddress ( ) ) ; }

Target:
private void assertHS266AccessToken ( com.googlesource.gerrit.plugins.cfoauth.AccessToken accessToken ) { assertEquals ( com.googlesource.gerrit.plugins.cfoauth.UAAClientTest.HS256_TEST_TOKEN , accessToken.getValue ( ) ) ; assertEquals ( 1436232932L , accessToken.getExpiresAt ( ) ) ; com.googlesource.gerrit.plugins.cfoauth.UserInfo userInfo = accessToken.getUserInfo ( ) ; assertEquals ( "external:marissa" , userInfo.getExternalId ( ) ) ; assertEquals ( "marissa" , userInfo.getUserName ( ) ) ; assertEquals ( "marissa@test.org" , userInfo.getEmailAddress ( ) ) ; }
Source:
static com.google.gerrit.server.auth.ldap.LdapType guessType ( final javax.naming.directory.DirContext ctx ) throws javax.naming.NamingException { final javax.naming.directory.Attributes rootAtts = ctx.getAttributes ( "" ) ; javax.naming.directory.Attribute supported = rootAtts.get ( "supportedCapabilities" ) ; if ( ( supported != null ) && ( supported.contains ( "1.2.840.113556.1.4.800" ) ) ) { return new com.google.gerrit.server.auth.ldap.LdapType.ActiveDirectory ( rootAtts ) ; } return com.google.gerrit.server.auth.ldap.LdapType.RFC_2307 ; }

Target:
static com.google.gerrit.server.auth.ldap.LdapType guessType ( final javax.naming.directory.DirContext ctx ) throws javax.naming.NamingException { final javax.naming.directory.Attributes rootAtts = ctx.getAttributes ( "" ) ; javax.naming.directory.Attribute supported = rootAtts.get ( "supportedCapabilities" ) ; if ( ( supported != null ) && ( ( supported.contains ( "1.2.840.113556.1.4.800" ) ) || ( supported.contains ( "1.2.840.113556.1.4.1851" ) ) ) ) { return new com.google.gerrit.server.auth.ldap.LdapType.ActiveDirectory ( ) ; } return com.google.gerrit.server.auth.ldap.LdapType.RFC_2307 ; }
Source:
private static boolean computeWin32 ( ) { final java.lang.String osDotName = java.security.AccessController.doPrivileged ( new java.security.PrivilegedAction < java.lang.String > ( ) { @ java.lang.Override public java.lang.String run ( ) { return java.lang.System.getProperty ( "os.name" ) ; } } ) ; return ( osDotName != null ) && ( osDotName.toLowerCase ( ) . contains ( "windows" ) ) ; }

Target:
private static boolean compute ( java.lang.String platform ) { final java.lang.String osDotName = java.security.AccessController.doPrivileged ( new java.security.PrivilegedAction < java.lang.String > ( ) { @ java.lang.Override public java.lang.String run ( ) { return java.lang.System.getProperty ( "os.name" ) ; } } ) ; return ( osDotName != null ) && ( osDotName.toLowerCase ( ) . contains ( platform ) ) ; }
Source:
public static java.lang.String messageUUID ( final com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { final byte [ ] raw = new byte [ 8 ] ; com.google.gerrit.server.ChangeUtil.fill ( raw , db ) ; return com.google.common.base.CharMatcher.is ( 'A' ) . trimLeadingFrom ( com.google.common.base.CharMatcher.is ( '=' ) . trimTrailingFrom ( org.eclipse.jgit.util.Base64.encodeBytes ( raw ) ) ) . replace ( '+' , '.' ) . replace ( '/' , '-' ) ; }

Target:
public static java.lang.String messageUUID ( com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { int p ; int s ; synchronized ( com.google.gerrit.server.ChangeUtil.uuidLock ) { if ( ( com.google.gerrit.server.ChangeUtil.uuidSeq ) == 0 ) { com.google.gerrit.server.ChangeUtil.uuidPrefix = db.nextChangeMessageId ( ) ; com.google.gerrit.server.ChangeUtil.uuidSeq = java.lang.Integer.MAX_VALUE ; } p = com.google.gerrit.server.ChangeUtil.uuidPrefix ; s = ( com.google.gerrit.server.ChangeUtil.uuidSeq ) -- ; } java.lang.String u = com.google.gerrit.server.util.IdGenerator.format ( com.google.gerrit.server.util.IdGenerator.mix ( com.google.gerrit.server.ChangeUtil.SEED , p ) ) ; java.lang.String l = com.google.gerrit.server.util.IdGenerator.format ( com.google.gerrit.server.util.IdGenerator.mix ( p , s ) ) ; return ( u + '_' ) + l ; }
Source:
public < T > com.google.gwtjsonrpc.common.AsyncCallback < T > addGwtjsonrpc ( final com.google.gwtjsonrpc.common.AsyncCallback < T > cb ) { callbacks.add ( cb ) ; return new com.google.gwtjsonrpc.common.AsyncCallback < com.google.gerrit.client.rpc.T > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.rpc.T result ) { results.put ( cb , result ) ; com.google.gerrit.client.rpc.CallbackGroup.this . onSuccess ( ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { com.google.gerrit.client.rpc.CallbackGroup.this . onFailure ( caught ) ; } } ; }

Target:
private void applyAllSuccess ( ) { if ( ( ( ! ( failed ) ) && ( finalAdded ) ) && ( remaining.isEmpty ( ) ) ) { for ( com.google.gerrit.client.rpc.CallbackGroup.CallbackImpl < ? > cb : callbacks ) { cb.applySuccess ( ) ; } callbacks.clear ( ) ; } }
Source:
private void parseDelete ( final org.eclipse.jgit.transport.ReceiveCommand cmd ) { com.google.gerrit.server.project.RefControl ctl = projectControl.controlForRef ( cmd.getRefName ( ) ) ; if ( ctl.canDelete ( ) ) { } else { com.google.gerrit.server.git.ReceiveCommits.reject ( cmd , "can not delete references" ) ; } }

Target:
private void parseDelete ( final org.eclipse.jgit.transport.ReceiveCommand cmd ) { com.google.gerrit.server.project.RefControl ctl = projectControl.controlForRef ( cmd.getRefName ( ) ) ; if ( ctl.canDelete ( ) ) { cmd.execute ( rp ) ; } else { if ( GitRepositoryManager.REF_CONFIG.equals ( ctl.getRefName ( ) ) ) { reject ( cmd , "cannot delete project configuration" ) ; } else { errors.put ( com.google.gerrit.server.git.ReceiveCommits.Error.DELETE , ctl.getRefName ( ) ) ; reject ( cmd , "can not delete references" ) ; } } }
Source:
public void deleteMembers ( java.lang.String ... members ) throws com.google.gerrit.extensions.restapi.RestApiException { try { deleteMembers.apply ( rsrc , AddMembers.Input.fromMembers ( java.util.Arrays.asList ( members ) ) ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot delete group members" , e ) ; } }

Target:
public java.util.List < com.google.gerrit.extensions.common.AccountInfo > members ( boolean recursive ) throws com.google.gerrit.extensions.restapi.RestApiException { com.google.gerrit.server.group.ListMembers list = listMembers.get ( ) ; list.setRecursive ( recursive ) ; try { return list.apply ( rsrc ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot list group members" , e ) ; } }
Source:
public void onPluginLoad ( ) { com.google.gerrit.plugin.client.Plugin.get ( ) . screen ( "create" , new com.googlesource.gerrit.plugins.serviceuser.client.CreateServiceUserScreen.Factory ( ) ) ; com.google.gerrit.plugin.client.Plugin.get ( ) . screen ( "admin" , new com.googlesource.gerrit.plugins.serviceuser.client.ServiceUserAdminScreen.Factory ( ) ) ; }

Target:
public void onPluginLoad ( ) { com.google.gerrit.plugin.client.Plugin.get ( ) . screen ( "create" , new com.googlesource.gerrit.plugins.serviceuser.client.CreateServiceUserScreen.Factory ( ) ) ; com.google.gerrit.plugin.client.Plugin.get ( ) . screen ( "admin" , new com.googlesource.gerrit.plugins.serviceuser.client.ServiceUserAdminScreen.Factory ( ) ) ; com.google.gerrit.plugin.client.Plugin.get ( ) . screen ( "list" , new com.googlesource.gerrit.plugins.serviceuser.client.ServiceUserListScreen.Factory ( ) ) ; }
Source:
private void beforeTest ( org.junit.runner.Description description ) throws java.lang.Exception { serverDesc = GerritServer.Description.forTestMethod ( description , configName ) ; sitePaths = new com.google.gerrit.server.config.SitePaths ( tempSiteDir.getRoot ( ) . toPath ( ) ) ; com.google.gerrit.acceptance.GerritServer.init ( serverDesc , baseConfig , sitePaths.site_path ) ; }

Target:
private void beforeTest ( org.junit.runner.Description description ) throws java.lang.Exception { oldSystemReader = com.google.gerrit.acceptance.StandaloneSiteTest.setFakeSystemReader ( tempSiteDir.getRoot ( ) ) ; serverDesc = GerritServer.Description.forTestMethod ( description , configName ) ; sitePaths = new com.google.gerrit.server.config.SitePaths ( tempSiteDir.getRoot ( ) . toPath ( ) ) ; com.google.gerrit.acceptance.GerritServer.init ( serverDesc , baseConfig , sitePaths.site_path ) ; }
Source:
public java.util.List < com.google.gerrit.server.git.validators.CommitValidationMessage > onCommitReceived ( com.google.gerrit.server.events.CommitReceivedEvent receiveEvent ) throws com.google.gerrit.server.git.validators.CommitValidationException { try { if ( rejectCommits.contains ( receiveEvent.commit ) ) { throw new com.google.gerrit.server.git.validators.CommitValidationException ( ( "contains banned commit " + ( receiveEvent.commit.getName ( ) ) ) ) ; } return java.util.Collections.emptyList ( ) ; } catch ( java.io.IOException e ) { throw new com.google.gerrit.server.git.validators.CommitValidationException ( e.getMessage ( ) , e ) ; } }

Target:
public java.util.List < com.google.gerrit.server.git.validators.CommitValidationMessage > onCommitReceived ( com.google.gerrit.server.events.CommitReceivedEvent receiveEvent ) throws com.google.gerrit.server.git.validators.CommitValidationException { try { if ( rejectCommits.contains ( receiveEvent.commit ) ) { throw new com.google.gerrit.server.git.validators.CommitValidationException ( ( "contains banned commit " + ( receiveEvent.commit.getName ( ) ) ) ) ; } return java.util.Collections.emptyList ( ) ; } catch ( java.io.IOException e ) { java.lang.String m = "error checking banned commits" ; com.google.gerrit.server.git.validators.CommitValidators.log.warn ( m , e ) ; throw new com.google.gerrit.server.git.validators.CommitValidationException ( m , e ) ; } }
Source:
protected java.lang.String getTaskDescription ( ) { java.lang.StringBuilder m = new java.lang.StringBuilder ( ) ; m.append ( context.getCommandLine ( ) ) ; return m.toString ( ) ; }

Target:
protected java.lang.String getTaskDescription ( ) { java.lang.StringBuilder m = new java.lang.StringBuilder ( commandName ) ; java.lang.String [ ] ta = getTrimmedArguments ( ) ; if ( ta != null ) { m.append ( com.google.common.base.Joiner.on ( " " ) . join ( ta ) ) ; } return m.toString ( ) ; }
Source:
private org.eclipse.jgit.lib.ObjectId getMetaRef ( com.google.gerrit.reviewdb.client.Project.NameKey p , java.lang.String name ) throws java.lang.Exception { try ( org.eclipse.jgit.lib.Repository repo = repoManager.openMetadataRepository ( p ) ) { org.eclipse.jgit.lib.Ref ref = repo.exactRef ( name ) ; return ref != null ? ref.getObjectId ( ) : null ; } }

Target:
private org.eclipse.jgit.lib.ObjectId getMetaRef ( com.google.gerrit.reviewdb.client.Project.NameKey p , java.lang.String name ) throws java.lang.Exception { try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( p ) ) { org.eclipse.jgit.lib.Ref ref = repo.exactRef ( name ) ; return ref != null ? ref.getObjectId ( ) : null ; } }
Source:
public static PatchSet.Id nextPatchSetId ( java.util.Map < java.lang.String , org.eclipse.jgit.lib.Ref > allRefs , com.google.gerrit.reviewdb.client.PatchSet.Id id ) { com.google.gerrit.reviewdb.client.PatchSet.Id next = com.google.gerrit.server.ChangeUtil.nextPatchSetId ( id ) ; while ( allRefs.containsKey ( next.toRefName ( ) ) ) { next = com.google.gerrit.server.ChangeUtil.nextPatchSetId ( next ) ; } return next ; }

Target:
public static PatchSet.Id nextPatchSetIdFromAllRefsMap ( java.util.Map < java.lang.String , org.eclipse.jgit.lib.Ref > allRefs , com.google.gerrit.reviewdb.client.PatchSet.Id id ) { com.google.gerrit.reviewdb.client.PatchSet.Id next = com.google.gerrit.server.ChangeUtil.nextPatchSetId ( id ) ; while ( allRefs.containsKey ( next.toRefName ( ) ) ) { next = com.google.gerrit.server.ChangeUtil.nextPatchSetId ( next ) ; } return next ; }
Source:
protected com.google.gerrit.client.reviewdb.ReviewDb openReviewDb ( ) throws com.google.gerrit.server.ssh.AbstractCommand.Failure { if ( ( db ) == null ) { try { db = schema.open ( ) ; } catch ( com.google.gwtorm.client.OrmException e ) { throw new com.google.gerrit.server.ssh.AbstractCommand.Failure ( 1 , "fatal: Gerrit database is offline" , e ) ; } } return db ; }

Target:
protected com.google.gerrit.client.reviewdb.ReviewDb openReviewDb ( ) throws com.google.gerrit.server.ssh.Failure { if ( ( db ) == null ) { try { db = schema.open ( ) ; } catch ( com.google.gwtorm.client.OrmException e ) { throw new com.google.gerrit.server.ssh.Failure ( 1 , "fatal: Gerrit database is offline" , e ) ; } } return db ; }
Source:
public com.google.common.collect.ImmutableMultimap < com.google.gerrit.reviewdb.client.Account.Id , java.lang.String > stars ( ) throws com.google.gwtorm.server.OrmException { if ( ( stars ) == null ) { if ( ! ( lazyLoad ) ) { return com.google.common.collect.ImmutableMultimap.of ( ) ; } stars = com.google.common.base.Preconditions.checkNotNull ( starredChangesUtil ) . byChange ( legacyId ) ; } return stars ; }

Target:
public com.google.common.collect.ImmutableList < byte [ ] > getRefStatePatterns ( ) { return refStatePatterns ; }
Source:
public void testBulletList5 ( ) { final com.google.gwtexpui.safehtml.client.SafeHtml o = com.google.gwtexpui.safehtml.client.SafeHtml_WikifyListTest.html ( ( "To see this bug,\n" + ( ( "you have to:\n" + "* Be on IMAP or EAS (not on POP)\n" ) + "* Be very unlucky\n" ) ) ) ; final com.google.gwtexpui.safehtml.client.SafeHtml n = o.wikify ( ) ; org.junit.Assert.assertNotSame ( o , n ) ; org.junit.Assert.assertEquals ( ( ( ( ( "<p>To see this bug, you have to:</p>" + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyListTest.BEGIN_LIST ) ) + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyListTest.item ( "Be on IMAP or EAS (not on POP)" ) ) ) + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyListTest.item ( "Be very unlucky" ) ) ) + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyListTest.END_LIST ) ) , n.asString ( ) ) ; }

Target:
public void testBulletList5 ( ) { final com.google.gwtexpui.safehtml.client.SafeHtml o = com.google.gwtexpui.safehtml.client.SafeHtml_WikifyListTest.html ( ( "To see this bug,\n" + ( ( "you have to:\n" + "* Be on IMAP or EAS (not on POP)\n" ) + "* Be very unlucky\n" ) ) ) ; final com.google.gwtexpui.safehtml.client.SafeHtml n = o.wikify ( ) ; com.google.common.truth.Truth.assertThat ( o ) . isNotSameAs ( n ) ; com.google.common.truth.Truth.assertThat ( n.asString ( ) ) . isEqualTo ( ( ( ( ( "<p>To see this bug, you have to:</p>" + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyListTest.BEGIN_LIST ) ) + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyListTest.item ( "Be on IMAP or EAS (not on POP)" ) ) ) + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyListTest.item ( "Be very unlucky" ) ) ) + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyListTest.END_LIST ) ) ) ; }
Source:
private com.google.gerrit.extensions.api.changes.ReviewInput reviewFromJson ( ) throws com.google.gerrit.sshd.commands.UnloggedFailure { try ( java.io.InputStreamReader r = new java.io.InputStreamReader ( in , java.nio.charset.StandardCharsets.UTF_8 ) ) { return OutputFormat.JSON.newGson ( ) . fromJson ( com.google.common.io.CharStreams.toString ( r ) , com.google.gerrit.extensions.api.changes.ReviewInput.class ) ; } catch ( java.io.IOException | com.google.gson.JsonSyntaxException e ) { writeError ( ( ( e.getMessage ( ) ) + '\n' ) ) ; throw die ( "internal error while reading review input" ) ; } }

Target:
private com.google.gerrit.extensions.api.changes.ReviewInput reviewFromJson ( ) throws com.google.gerrit.sshd.commands.UnloggedFailure { try ( java.io.InputStreamReader r = new java.io.InputStreamReader ( in , java.nio.charset.StandardCharsets.UTF_8 ) ) { return OutputFormat.JSON.newGson ( ) . fromJson ( com.google.common.io.CharStreams.toString ( r ) , com.google.gerrit.extensions.api.changes.ReviewInput.class ) ; } catch ( java.io.IOException | com.google.gson.JsonSyntaxException e ) { writeError ( "error" , ( ( e.getMessage ( ) ) + '\n' ) ) ; throw die ( "internal error while reading review input" ) ; } }
Source:
private boolean canEditTopicName ( ) { if ( getChange ( ) . getStatus ( ) . isOpen ( ) ) { return ( ( ( ( isOwner ( ) ) || ( getRefControl ( ) . isOwner ( ) ) ) || ( getProjectControl ( ) . isOwner ( ) ) ) || ( getUser ( ) . getCapabilities ( ) . canAdministrateServer ( ) ) ) || ( getRefControl ( ) . canEditTopicName ( ) ) ; } return getRefControl ( ) . canForceEditTopicName ( ) ; }

Target:
private boolean canEditTopicName ( ) { if ( getChange ( ) . getStatus ( ) . isOpen ( ) ) { return ( ( ( ( isOwner ( ) ) || ( getRefControl ( ) . isOwner ( ) ) ) || ( getProjectControl ( ) . isOwner ( ) ) ) || ( getUser ( ) . getCapabilities ( ) . isAdmin_DoNotUse ( ) ) ) || ( getRefControl ( ) . canEditTopicName ( ) ) ; } return getRefControl ( ) . canForceEditTopicName ( ) ; }
Source:
private void assertChangeSetMergeable ( com.google.gerrit.server.query.change.ChangeData change , boolean expected ) throws com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.errors.IncorrectObjectTypeException , org.eclipse.jgit.errors.MissingObjectException { com.google.gerrit.server.git.ChangeSet cs = mergeSuperSet.completeChangeSet ( db , change.change ( ) ) ; com.google.common.truth.Truth.assertThat ( submit.isPatchSetMergeable ( cs ) ) . isEqualTo ( expected ) ; }

Target:
private void assertChangeSetMergeable ( com.google.gerrit.server.query.change.ChangeData change , boolean expected ) throws com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.errors.IncorrectObjectTypeException , org.eclipse.jgit.errors.MissingObjectException { com.google.gerrit.server.git.ChangeSet cs = mergeSuperSet.completeChangeSet ( db , change.change ( ) ) ; if ( expected ) { com.google.common.truth.Truth.assertThat ( submit.unmergeableChanges ( cs ) ) . isEmpty ( ) ; } else { com.google.common.truth.Truth.assertThat ( submit.unmergeableChanges ( cs ) ) . isNotEmpty ( ) ; } }
Source:
void resizeCodeMirror ( ) { int rest = ( ( ( com.google.gerrit.client.Gerrit.getHeaderFooterHeight ( ) ) + ( header.getOffsetHeight ( ) ) ) + ( diffTable.getHeaderHeight ( ) ) ) + 5 ; int h = ( com.google.gwt.user.client.Window.getClientHeight ( ) ) - rest ; cmA.setHeight ( h ) ; cmB.setHeight ( h ) ; cmA.refresh ( ) ; cmB.refresh ( ) ; diffTable.sidePanel.adjustGutters ( cmB ) ; }

Target:
void resizeCodeMirror ( ) { int height = getCodeMirrorHeight ( ) ; cmA.setHeight ( height ) ; cmB.setHeight ( height ) ; diffTable.sidePanel.adjustGutters ( cmB ) ; }
Source:
public void reviewTriplet ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; gApi.changes ( ) . id ( ( "p~master~" + ( r.getChangeId ( ) ) ) ) . revision ( r.getCommit ( ) . name ( ) ) . review ( com.google.gerrit.extensions.api.changes.ReviewInput.approve ( ) ) ; }

Target:
public void reviewTriplet ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; gApi.changes ( ) . id ( ( ( ( project.get ( ) ) + "~master~" ) + ( r.getChangeId ( ) ) ) ) . revision ( r.getCommit ( ) . name ( ) ) . review ( com.google.gerrit.extensions.api.changes.ReviewInput.approve ( ) ) ; }
Source:
protected java.lang.Object runMethod ( java.lang.Class < ? > klazz , java.lang.Object instance , java.lang.String name , java.lang.Class < ? > [ ] sig , java.lang.Object [ ] args ) { try { return runMethod0 ( klazz , instance , name , sig , args ) ; } catch ( java.lang.reflect.InvocationTargetException e ) { throw com.google.gerrit.pgm.shell.JythonShell.cannotStart ( e ) ; } }

Target:
protected java.lang.Object runMethod ( java.lang.Class < ? > klazz , java.lang.Object instance , java.lang.String name , java.lang.Class < ? > [ ] sig , java.lang.Object [ ] args ) { try { return runMethod0 ( klazz , instance , name , sig , args ) ; } catch ( java.lang.reflect.InvocationTargetException e ) { throw com.google.gerrit.pgm.JythonShell.cannotStart ( e ) ; } }
Source:
public static boolean isNoteDbTestEnabled ( ) { java.util.List < java.lang.String > runValues = com.google.common.collect.ImmutableList.of ( "yes" , "y" , "true" , "1" ) ; java.lang.String value = java.lang.System.getenv ( "GERRIT_ENABLE_NOTEDB" ) ; return ( value != null ) && ( runValues.contains ( value.toLowerCase ( ) ) ) ; }

Target:
public static boolean isEnvVarTrue ( java.lang.String name ) { java.lang.String value = java.lang.System.getenv ( name ) ; return ( value != null ) && ( com.google.gerrit.testutil.GerritServerTests.ENV_VAR_TRUE_VALUES.contains ( value.toLowerCase ( ) ) ) ; }
Source:
public void run ( ) throws java.lang.Exception { parseCommandLine ( ) ; validate ( ) ; setAccount ( ) ; }

Target:
private void putPreferred ( java.lang.String email ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gwtorm.server.OrmException { for ( com.google.gerrit.server.account.GetEmails.EmailInfo e : getEmails.apply ( rsrc ) ) { if ( e.email.equals ( email ) ) { putPreferred.apply ( new com.google.gerrit.server.account.AccountResource.Email ( user , email ) , null ) ; return ; } } stderr.println ( ( "preferred email not found: " + email ) ) ; }
Source:
private static void checkCounterDescription ( com.google.gerrit.metrics.Description desc ) { com.google.common.base.Preconditions.checkArgument ( ( ! ( desc.isConstant ( ) ) ) , "counters must not be constant" ) ; com.google.common.base.Preconditions.checkArgument ( ( ! ( desc.isGauge ( ) ) ) , "counters must not be gauge" ) ; }

Target:
private static void checkCounterDescription ( java.lang.String name , com.google.gerrit.metrics.Description desc ) { com.google.gerrit.metrics.dropwizard.DropWizardMetricMaker.checkMetricName ( name ) ; com.google.common.base.Preconditions.checkArgument ( ( ! ( desc.isConstant ( ) ) ) , "counters must not be constant" ) ; com.google.common.base.Preconditions.checkArgument ( ( ! ( desc.isGauge ( ) ) ) , "counters must not be gauge" ) ; }
Source:
public void simpleReadmeDoc ( ) throws java.lang.Exception { java.lang.String title = "DocServletTest simpleDoc" ; java.lang.String url = "http://daringfireball.net/projects/markdown/syntax" ; java.lang.String markdown = ( ( ( ( ( ( "# " + title ) + "\n" ) + "\n" ) + "Tests the rendering of " ) + "[Markdown](" ) + url ) + ")." ; repo.branch ( "master" ) . commit ( ) . add ( "README.md" , markdown ) . create ( ) ; java.lang.String html = buildHtml ( "/repo/+doc/master/README.md" ) ; org.junit.Assert.assertTrue ( html.contains ( ( ( "<title>" + title ) + "</title>" ) ) ) ; org.junit.Assert.assertTrue ( html.contains ( ( ( "<h1>" + title ) + "</h1>" ) ) ) ; org.junit.Assert.assertTrue ( html.contains ( ( ( "<a href=\"" + url ) + "\">Markdown</a>" ) ) ) ; }

Target:
public void simpleReadmeDoc ( ) throws java.lang.Exception { java.lang.String title = "DocServletTest simpleDoc" ; java.lang.String url = "http://daringfireball.net/projects/markdown/syntax" ; java.lang.String markdown = ( ( ( ( ( ( "# " + title ) + "\n" ) + "\n" ) + "Tests the rendering of " ) + "[Markdown](" ) + url ) + ")." ; repo.branch ( "master" ) . commit ( ) . add ( "README.md" , markdown ) . create ( ) ; java.lang.String html = buildHtml ( "/repo/+doc/master/README.md" ) ; org.junit.Assert.assertTrue ( html.contains ( ( ( "<title>" + title ) + "</title>" ) ) ) ; org.junit.Assert.assertTrue ( html.contains ( ( ( "<h1 id=\"DocServletTest-simpleDoc\">" + title ) + "</h1>" ) ) ) ; org.junit.Assert.assertTrue ( html.contains ( ( ( "<a href=\"" + url ) + "\">Markdown</a>" ) ) ) ; }
Source:
public UiAction.Description getDescription ( com.google.gerrit.server.change.ChangeResource rsrc ) { return new com.google.gerrit.extensions.webui.UiAction.Description ( ) . setLabel ( "Restore" ) . setTitle ( "Restore the change" ) . setVisible ( ( ( ( rsrc.getChange ( ) . getStatus ( ) ) == ( com.google.gerrit.reviewdb.client.Change.Status.ABANDONED ) ) && ( rsrc.permissions ( ) . database ( dbProvider ) . testOrFalse ( ChangePermission.RESTORE ) ) ) ) ; }

Target:
public UiAction.Description getDescription ( com.google.gerrit.server.change.ChangeResource rsrc ) { return new com.google.gerrit.extensions.webui.UiAction.Description ( ) . setLabel ( "Restore" ) . setTitle ( "Restore the change" ) . setVisible ( com.google.gerrit.extensions.conditions.BooleanCondition.and ( ( ( rsrc.getChange ( ) . getStatus ( ) ) == ( com.google.gerrit.reviewdb.client.Change.Status.ABANDONED ) ) , rsrc.permissions ( ) . database ( dbProvider ) . testCond ( ChangePermission.RESTORE ) ) ) ; }
Source:
public void setActive ( boolean active ) throws com.google.gerrit.extensions.restapi.RestApiException { try { if ( active ) { putActive.apply ( account , new com.google.gerrit.server.account.PutActive.Input ( ) ) ; } else { deleteActive.apply ( account , new com.google.gerrit.server.account.DeleteActive.Input ( ) ) ; } } catch ( com.google.gwtorm.server.OrmException | java.io.IOException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot set active" , e ) ; } }

Target:
public void setActive ( boolean active ) throws com.google.gerrit.extensions.restapi.RestApiException { try { if ( active ) { putActive.apply ( account , new com.google.gerrit.server.account.PutActive.Input ( ) ) ; } else { deleteActive.apply ( account , new com.google.gerrit.server.account.DeleteActive.Input ( ) ) ; } } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( "Cannot set active" , e ) ; } }
Source:
public void setMillisProvider ( ) { clockStepMs = java.util.concurrent.TimeUnit.MILLISECONDS.convert ( 1 , java.util.concurrent.TimeUnit.SECONDS ) ; final java.util.concurrent.atomic.AtomicLong clockMs = new java.util.concurrent.atomic.AtomicLong ( ( ( java.util.concurrent.TimeUnit.MILLISECONDS.convert ( ChangeUtil.SORT_KEY_EPOCH_MINS , java.util.concurrent.TimeUnit.MINUTES ) ) + ( java.util.concurrent.TimeUnit.MILLISECONDS.convert ( 60 , java.util.concurrent.TimeUnit.DAYS ) ) ) ) ; org.joda.time.DateTimeUtils.setCurrentMillisProvider ( new org.joda.time.DateTimeUtils.MillisProvider ( ) { @ java.lang.Override public long getMillis ( ) { return clockMs.getAndAdd ( clockStepMs ) ; } } ) ; }

Target:
private void setTimeForTesting ( ) { systemTimeZone = java.lang.System.setProperty ( "user.timezone" , "US/Eastern" ) ; clockStepMs = java.util.concurrent.TimeUnit.MILLISECONDS.convert ( 1 , java.util.concurrent.TimeUnit.SECONDS ) ; final java.util.concurrent.atomic.AtomicLong clockMs = new java.util.concurrent.atomic.AtomicLong ( new org.joda.time.DateTime ( 2009 , 9 , 30 , 17 , 0 , 0 ) . getMillis ( ) ) ; org.joda.time.DateTimeUtils.setCurrentMillisProvider ( new org.joda.time.DateTimeUtils.MillisProvider ( ) { @ java.lang.Override public long getMillis ( ) { return clockMs.getAndAdd ( clockStepMs ) ; } } ) ; }
Source:
public static void display ( final java.lang.String historyToken , final com.google.gerrit.client.ui.Screen view ) { com.google.gwt.user.client.History.newItem ( historyToken , false ) ; com.google.gerrit.client.Gerrit.display ( view ) ; if ( ( com.google.gerrit.client.Gerrit.historyHooks ) != null ) { com.google.gerrit.client.Gerrit.dispatchHistoryHooks ( historyToken ) ; } }

Target:
public static void display ( final java.lang.String token , final com.google.gerrit.client.ui.Screen view ) { if ( ( view.isRequiresSignIn ( ) ) && ( ! ( com.google.gerrit.client.Gerrit.isSignedIn ( ) ) ) ) { com.google.gerrit.client.Gerrit.doSignIn ( token ) ; } else { view.setToken ( token ) ; com.google.gerrit.client.Gerrit.body.setView ( view ) ; } }
Source:
public void testParseQuoteLeadSpace ( ) { java.lang.String comment = " > Quote text" ; java.util.List < com.google.gerrit.server.mail.send.CommentFormatter.Block > result = com.google.gerrit.server.mail.send.CommentFormatter.parse ( comment ) ; com.google.common.truth.Truth.assertThat ( result ) . hasSize ( 1 ) ; assertBlock ( result , 0 , BlockType.QUOTE , "Quote text" ) ; }

Target:
public void testParseQuoteLeadSpace ( ) { java.lang.String comment = " > Quote text" ; java.util.List < com.google.gerrit.server.mail.send.CommentFormatter.Block > result = com.google.gerrit.server.mail.send.CommentFormatter.parse ( comment ) ; com.google.common.truth.Truth.assertThat ( result ) . hasSize ( 1 ) ; assertQuoteBlock ( result , 0 , 1 ) ; assertBlock ( result.get ( 0 ) . quotedBlocks , 0 , BlockType.PARAGRAPH , "Quote text" ) ; }
Source:
public void testVerifyAgainstInvalidToken ( ) throws java.lang.Exception { java.lang.String token = auth.generateToken ( "o" , org.eclipse.jgit.lfs.lib.LongObjectId.zeroId ( ) , 1 ) ; com.google.common.truth.Truth.assertThat ( auth.verifyAgainstToken ( ( ( ( token.substring ( 1 , 2 ) ) + ( token.substring ( 0 , 1 ) ) ) + ( token.substring ( 2 ) ) ) , "o" , org.eclipse.jgit.lfs.lib.LongObjectId.zeroId ( ) ) ) . isFalse ( ) ; }

Target:
public void testVerifyAgainstDifferentOperation ( ) throws java.lang.Exception { com.googlesource.gerrit.plugins.lfs.fs.LfsFsRequestAuthorizer.AuthInfo info = auth.generateAuthInfo ( "o" , org.eclipse.jgit.lfs.lib.LongObjectId.zeroId ( ) , 1 ) ; com.google.common.truth.Truth.assertThat ( auth.verifyAuthInfo ( info.authToken , "p" , org.eclipse.jgit.lfs.lib.LongObjectId.zeroId ( ) ) ) . isFalse ( ) ; }
Source:
private java.util.List < com.google.gerrit.server.project.ChangeControl > asChangeControls ( java.util.List < com.google.gerrit.server.query.change.ChangeData > cds ) throws com.google.gwtorm.server.OrmException { java.util.List < com.google.gerrit.server.project.ChangeControl > ctls = new java.util.ArrayList ( cds.size ( ) ) ; for ( com.google.gerrit.server.query.change.ChangeData cd : cds ) { ctls.add ( cd.changeControl ( user.get ( ) ) ) ; } return ctls ; }

Target:
private java.util.List < com.google.gerrit.server.project.ChangeControl > asChangeControls ( java.util.List < com.google.gerrit.server.query.change.ChangeData > cds , com.google.gerrit.server.CurrentUser user ) throws com.google.gwtorm.server.OrmException { java.util.List < com.google.gerrit.server.project.ChangeControl > ctls = new java.util.ArrayList ( cds.size ( ) ) ; for ( com.google.gerrit.server.query.change.ChangeData cd : cds ) { ctls.add ( cd.changeControl ( user ) ) ; } return ctls ; }
Source:
public void noConflictingChanges ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result change = createChange ( git , true ) ; createChange ( git , false ) ; java.util.Set < java.lang.String > changes = queryConflictingChanges ( change ) ; org.junit.Assert.assertEquals ( 0 , changes.size ( ) ) ; }

Target:
public void noConflictingChanges ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result change = createChange ( git , true ) ; createChange ( git , false ) ; java.util.Set < java.lang.String > changes = queryConflictingChanges ( change ) ; com.google.common.truth.Truth.assertThat ( ( ( java.lang.Iterable < ? > ) ( changes ) ) ) . isEmpty ( ) ; }
Source:
public void onOpen ( final com.google.gwt.user.client.ui.DisclosureEvent event ) { if ( ( infoTable ) == null ) { ensureLoaded ( ) ; } }

Target:
public void onOpen ( final com.google.gwt.user.client.ui.DisclosureEvent event ) { if ( ( infoTable ) == null ) { Util.DETAIL_SVC.patchSetDetail ( patchSet.getKey ( ) , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.data.PatchSetDetail > ( ) { public void onSuccess ( final com.google.gerrit.client.data.PatchSetDetail result ) { ensureLoaded ( result ) ; } } ) ; } }
Source:
void restore ( com.googlecode.prolog_cafe.lang.Prolog engine ) { engine.cont = this . cont ; engine.areg1 = this . areg1 ; engine.areg2 = this . areg2 ; engine.areg3 = this . areg3 ; engine.areg4 = this . areg4 ; engine.areg5 = this . areg5 ; engine.areg6 = this . areg6 ; engine.areg7 = this . areg7 ; engine.areg8 = this . areg8 ; }

Target:
void restore ( com.googlecode.prolog_cafe.lang.Prolog engine ) { engine.cont = this . cont ; engine.r1 = this . r1 ; engine.r2 = this . r2 ; engine.r3 = this . r3 ; engine.r4 = this . r4 ; engine.r5 = this . r5 ; engine.r6 = this . r6 ; engine.r7 = this . r7 ; engine.r8 = this . r8 ; }
Source:
public java.util.Collection < com.google.gwtorm.schema.ColumnModel > getDependentColumns ( ) { final java.util.ArrayList < com.google.gwtorm.schema.ColumnModel > r = new java.util.ArrayList < com.google.gwtorm.schema.ColumnModel > ( ) ; for ( final com.google.gwtorm.schema.ColumnModel c : columnsByColumnName.values ( ) ) { if ( ! ( c.inPrimaryKey ) ) { r.add ( c ) ; } } return r ; }

Target:
public java.util.Collection < com.google.gwtorm.schema.ColumnModel > getDependentColumns ( ) { final java.util.ArrayList < com.google.gwtorm.schema.ColumnModel > r = new java.util.ArrayList < com.google.gwtorm.schema.ColumnModel > ( ) ; for ( final com.google.gwtorm.schema.ColumnModel c : columnsByColumnName.values ( ) ) { if ( ( ! ( c.inPrimaryKey ) ) && ( ! ( c.rowVersion ) ) ) { r.add ( c ) ; } } return r ; }
Source:
public void evaluate ( ) throws java.lang.Throwable { boolean mem = ( description.getAnnotation ( com.google.gerrit.acceptance.UseLocalDisk.class ) ) == null ; boolean enableHttpd = ( ( description.getAnnotation ( com.google.gerrit.acceptance.NoHttpd.class ) ) == null ) && ( ( description.getTestClass ( ) . getAnnotation ( com.google.gerrit.acceptance.NoHttpd.class ) ) == null ) ; beforeTest ( config ( description ) , mem , enableHttpd ) ; base.evaluate ( ) ; afterTest ( ) ; }

Target:
protected org.eclipse.jgit.internal.storage.dfs.InMemoryRepository repo ( ) { return testRepo.getRepository ( ) ; }
Source:
public void run ( ) { ui.header ( "Git Repositories" ) ; java.io.File d = gerrit.path ( "Location of Git repositories" , "basePath" , "git" ) ; if ( d == null ) { throw com.google.gerrit.pgm.init.InitUtil.die ( "gerrit.basePath is required" ) ; } if ( ( ! ( d.exists ( ) ) ) && ( ! ( d.mkdirs ( ) ) ) ) { throw com.google.gerrit.pgm.init.InitUtil.die ( ( "Cannot create " + d ) ) ; } }

Target:
public void run ( ) { ui.header ( "Git Repositories" ) ; java.io.File d = gerrit.path ( "Location of Git repositories" , "basePath" , "git" ) ; if ( d == null ) { throw com.google.gerrit.pgm.init.api.InitUtil.die ( "gerrit.basePath is required" ) ; } if ( ( ! ( d.exists ( ) ) ) && ( ! ( d.mkdirs ( ) ) ) ) { throw com.google.gerrit.pgm.init.api.InitUtil.die ( ( "Cannot create " + d ) ) ; } }
Source:
public java.util.List < com.google.gerrit.extensions.common.CommitInfo > get ( ) throws com.google.gerrit.extensions.restapi.RestApiException { try { com.google.gerrit.server.change.GetMergeList gml = getMergeList.get ( ) ; gml.setUninterestingParent ( getUninterestingParent ( ) ) ; gml.setAddLinks ( getAddLinks ( ) ) ; return gml.apply ( revision ) . value ( ) ; } catch ( java.io.IOException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot get merge list" , e ) ; } }

Target:
public java.util.List < com.google.gerrit.extensions.common.CommitInfo > get ( ) throws com.google.gerrit.extensions.restapi.RestApiException { try { com.google.gerrit.server.change.GetMergeList gml = getMergeList.get ( ) ; gml.setUninterestingParent ( getUninterestingParent ( ) ) ; gml.setAddLinks ( getAddLinks ( ) ) ; return gml.apply ( revision ) . value ( ) ; } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( "Cannot get merge list" , e ) ; } }
Source:
public java.util.List < com.google.gerrit.client.reviewdb.AccountGroup > run ( final com.google.gerrit.client.reviewdb.ReviewDb db ) throws com.google.gwtorm.client.OrmException { final java.lang.String a = query ; final java.lang.String b = a + "￿" ; final int max = 10 ; final int n = ( limit <= 0 ) ? max : java.lang.Math.min ( limit , max ) ; return db.accountGroups ( ) . suggestByName ( a , b , n ) . toList ( ) ; }

Target:
public java.util.List < com.google.gerrit.client.reviewdb.AccountGroup > run ( final com.google.gerrit.client.reviewdb.ReviewDb db ) throws com.google.gwtorm.client.OrmException { final java.lang.String a = query ; final java.lang.String b = a + ( com.google.gerrit.client.ui.SuggestServiceImpl.MAX_SUFFIX ) ; final int max = 10 ; final int n = ( limit <= 0 ) ? max : java.lang.Math.min ( limit , max ) ; return db.accountGroups ( ) . suggestByName ( a , b , n ) . toList ( ) ; }