auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
BRANCH ( com.google.gerrit.server.git.a3f22a EmailMerge ) { provide = $missing$ ; user ( available ) ; try { if ( ( ( magicBranch ) != null ) && ( magicBranch.edit ) ) { return upsertEdit ( ) ; } try ( com.google.gerrit.server.git.RequestState state = requestState ( caller ) ) { return insertPatchSet ( state ) ; } } catch ( com.google.gwtorm.server.OrmException | java.io.IOException e ) { com.google.gerrit.server.git.ReceiveCommits.log.error ( "Failed to insert patch set" , e ) ; throw e ; } finally { synchronizedIncrement ( replaceProgress ) ; } }

Target:
public PatchSet.Id call ( ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gwtorm.server.OrmException , java.io.IOException { try { if ( ( ( magicBranch ) != null ) && ( magicBranch.edit ) ) { return upsertEdit ( ) ; } try ( com.google.gerrit.server.git.ReceiveCommits.RequestState state = requestState ( caller ) ) { return insertPatchSet ( state ) ; } } catch ( com.google.gwtorm.server.OrmException | java.io.IOException e ) { com.google.gerrit.server.git.ReceiveCommits.log.error ( "Failed to insert patch set" , e ) ; throw e ; } finally { com.google.gerrit.server.git.ReceiveCommits.synchronizedIncrement ( replaceProgress ) ; } }
Source:
public static org.spearce.jgit.lib.ObjectId read ( final java.io.ObjectInputStream in ) throws java.io.IOException { if ( in.readBoolean ( ) ) { final int w1 = in.readInt ( ) ; final int w2 = in.readInt ( ) ; final int w3 = in.readInt ( ) ; final int w4 = in.readInt ( ) ; final int w5 = in.readInt ( ) ; return new org.spearce.jgit.lib.ObjectId ( w1 , w2 , w3 , w4 , w5 ) ; } else { return null ; } }

Target:
public static org.spearce.jgit.lib.ObjectId readCanBeNull ( final java.io.InputStream in ) throws java.io.IOException { switch ( com.google.gerrit.server.ioutil.BasicSerialization.readVarInt32 ( in ) ) { case 0 : return null ; case 1 : return org.spearce.jgit.lib.ObjectIdSerialization.readNotNull ( in ) ; default : throw new java.io.IOException ( "Invalid flag before ObjectId" ) ; } }
Source:
private static void p ( final java.lang.StringBuilder r , final com.google.gerrit.reviewdb.Project.NameKey project ) { java.lang.String n = project.get ( ) ; if ( ! ( n.endsWith ( ".git" ) ) ) { n += ".git" ; } com.google.gerrit.common.data.GitwebLink.var ( r , "p" , n ) ; }

Target:
public java.lang.String toProject ( final com.google.gerrit.reviewdb.Project.NameKey project ) { com.google.gerrit.common.data.ParamertizedString pattern = new com.google.gerrit.common.data.ParamertizedString ( type.getProject ( ) ) ; final java.util.Map < java.lang.String , java.lang.String > p = new java.util.HashMap < java.lang.String , java.lang.String > ( ) ; p.put ( "project" , com.google.gwt.http.client.URL.encodeComponent ( project.get ( ) ) ) ; return ( baseUrl ) + ( pattern.replace ( p ) ) ; }
Source:
public void listNonEmptyGroupMembers ( ) throws java.lang.Exception { assertMembers ( GET ( "/groups/Administrators/members/" ) , admin.fullName ) ; accounts.create ( "admin2" , "Administrators" ) ; assertMembers ( GET ( "/groups/Administrators/members/" ) , admin.fullName , "admin2" ) ; }

Target:
public void listOneGroupMember ( ) throws java.lang.Exception { java.lang.String group = createGroup ( "group" ) ; java.lang.String user = createAccount ( "user1" , group ) ; assertMembers ( GET ( ( ( "/groups/" + group ) + "/members/" ) ) , user ) ; com.google.common.truth.Truth.assertThat ( GET_ONE ( ( ( ( "/groups/" + group ) + "/members/" ) + user ) ) . name ) . isEqualTo ( user ) ; }
Source:
public java.lang.String loginPhase1 ( javax.servlet.http.HttpServletRequest request , javax.servlet.http.HttpServletResponse response , java.util.Set < com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.Scope > scopes ) throws java.io.IOException { java.lang.String scopesString = getScope ( scopes ) ; com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.log.debug ( ( ( ( "Initiating GitHub Login for ClientId=" + ( config.gitHubClientId ) ) + " Scopes=" ) + scopesString ) ) ; java.lang.String state = newRandomState ( request.getRequestURI ( ) . toString ( ) ) ; response.sendRedirect ( java.lang.String.format ( "%s?client_id=%s%s&redirect_uri=%s&state=%s" , config.gitHubOAuthUrl , config.gitHubClientId , scopesString , com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.getURLEncoded ( config.oAuthFinalRedirectUrl ) , com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.getURLEncoded ( state ) ) ) ; return state ; }

Target:
public java.lang.String getAuthorizationUrl ( java.lang.String scopesString , java.lang.String state ) { return ( ( ( ( ( config.gitHubOAuthUrl ) + "?client_id=" ) + ( config.gitHubClientId ) ) + ( com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.getURLEncodedParameter ( "&scope=" , scopesString ) ) ) + ( com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.getURLEncodedParameter ( "&redirect_uri=" , config.oAuthFinalRedirectUrl ) ) ) + ( com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.getURLEncodedParameter ( "&state=" , state ) ) ; }
Source:
protected void doDelete ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse rsp ) { this . healthy = false ; rsp.setStatus ( javax.servlet.http.HttpServletResponse.SC_NO_CONTENT ) ; }

Target:
protected void doDelete ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse rsp ) { if ( ! ( currentUserProvider.get ( ) . getCapabilities ( ) . canAdministrateServer ( ) ) ) { sendError ( rsp , javax.servlet.http.HttpServletResponse.SC_FORBIDDEN ) ; return ; } try { setUnhealthy ( ) ; rsp.setStatus ( javax.servlet.http.HttpServletResponse.SC_NO_CONTENT ) ; } catch ( java.io.IOException e ) { com.ericsson.gerrit.plugins.highavailability.health.HealthServlet.log.error ( "Failed to set unhealthy" , e ) ; sendError ( rsp , javax.servlet.http.HttpServletResponse.SC_INTERNAL_SERVER_ERROR ) ; } }
Source:
public void start ( ) { queue.start ( ) ; if ( ( ( srvInfo.getState ( ) ) == ( ServerInformation.State.STARTUP ) ) && ( config.isReplicateAllOnPluginStart ( ) ) ) { com.googlesource.gerrit.plugins.replication.ReplicationState state = new com.googlesource.gerrit.plugins.replication.ReplicationState ( ) ; pushAllFuture.set ( pushAll.create ( null , com.googlesource.gerrit.plugins.replication.ReplicationFilter.all ( ) , state ) . schedule ( 30 , java.util.concurrent.TimeUnit.SECONDS ) ) ; } }

Target:
public void start ( ) { queue.start ( ) ; if ( ( ( srvInfo.getState ( ) ) == ( ServerInformation.State.STARTUP ) ) && ( config.isReplicateAllOnPluginStart ( ) ) ) { com.googlesource.gerrit.plugins.replication.ReplicationState state = new com.googlesource.gerrit.plugins.replication.ReplicationState ( new com.googlesource.gerrit.plugins.replication.PushResultProcessing.GitUpdateProcessing ( eventDispatcher.get ( ) , database ) ) ; pushAllFuture.set ( pushAll.create ( null , com.googlesource.gerrit.plugins.replication.ReplicationFilter.all ( ) , state ) . schedule ( 30 , java.util.concurrent.TimeUnit.SECONDS ) ) ; } }
Source:
private org.eclipse.jgit.lib.PersonIdent newAuthorIdent ( ) { com.google.gerrit.server.CurrentUser u = getUser ( ) ; if ( u instanceof com.google.gerrit.server.IdentifiedUser ) { return noteUtil.newIdent ( u.asIdentifiedUser ( ) . getAccount ( ) , when , serverIdent , anonymousCowardName ) ; } else if ( u instanceof com.google.gerrit.server.InternalUser ) { return serverIdent ; } throw new java.lang.IllegalStateException ( ) ; }

Target:
private static org.eclipse.jgit.lib.PersonIdent ident ( com.google.gerrit.server.notedb.ChangeNoteUtil noteUtil , org.eclipse.jgit.lib.PersonIdent serverIdent , java.lang.String anonymousCowardName , com.google.gerrit.server.CurrentUser u , java.util.Date when ) { com.google.gerrit.server.notedb.AbstractChangeUpdate.checkUserType ( u ) ; if ( u instanceof com.google.gerrit.server.IdentifiedUser ) { return noteUtil.newIdent ( u.asIdentifiedUser ( ) . getAccount ( ) , when , serverIdent , anonymousCowardName ) ; } else if ( u instanceof com.google.gerrit.server.InternalUser ) { return serverIdent ; } throw new java.lang.IllegalStateException ( ) ; }
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.common.TimeUtil.nowTs ( ) ) ; account.setActive ( false ) ; java.util.Collection < com.google.gerrit.reviewdb.client.AccountExternalId > ids = java.util.Collections.emptySet ( ) ; java.util.Collection < com.google.gerrit.reviewdb.client.AccountProjectWatch > projectWatches = 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 , projectWatches ) ; }

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.common.TimeUtil.nowTs ( ) ) ; account.setActive ( false ) ; 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 , new java.util.HashMap < com.google.gerrit.server.account.WatchConfig.ProjectWatchKey , java.util.Set < com.google.gerrit.reviewdb.client.AccountProjectWatch.NotifyType > > ( ) ) ; }
Source:
public void listNoChildren ( ) throws java.lang.Exception { com.google.gerrit.acceptance.RestResponse r = GET ( ( ( "/projects/" + ( allProjects.get ( ) ) ) + "/children/" ) ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( HttpStatus.SC_OK ) ; java.util.List < com.google.gerrit.extensions.common.ProjectInfo > projectInfoList = com.google.gerrit.acceptance.rest.project.ListChildProjectsIT.toProjectInfoList ( r ) ; com.google.common.truth.Truth.assertThat ( projectInfoList ) . hasSize ( 2 ) ; }

Target:
public void listNoChildren ( ) throws java.lang.Exception { com.google.gerrit.acceptance.rest.project.ProjectAssert.assertThatNameList ( gApi.projects ( ) . name ( allProjects.get ( ) ) . children ( ) ) . containsExactly ( allUsers , project ) . inOrder ( ) ; }
Source:
public void scheduleFullSync ( final com.google.gerrit.reviewdb.Project.NameKey project , final java.lang.String urlMatch ) { for ( final com.google.gerrit.server.git.PushReplication.ReplicationConfig cfg : configs ) { for ( final org.eclipse.jgit.transport.URIish uri : cfg.getURIs ( project , urlMatch ) ) { cfg.schedule ( project , PushOp.MIRROR_ALL , uri ) ; } } }

Target:
public void scheduleFullSync ( final com.google.gerrit.reviewdb.Project.NameKey project , final java.lang.String urlMatch ) { for ( final com.google.gerrit.server.git.PushReplication.ReplicationConfig cfg : configs ) { for ( final org.eclipse.jgit.transport.URIish uri : cfg.getURIs ( project , urlMatch ) ) { cfg.schedule ( project , PushOp.ALL_REFS , uri ) ; } } }
Source:
void display ( final com.google.gerrit.client.account.AgreementInfo result ) { while ( 1 < ( table.getRowCount ( ) ) ) table.removeRow ( ( ( table.getRowCount ( ) ) - 1 ) ) ; for ( final com.google.gerrit.client.reviewdb.AccountAgreement k : result.accepted ) { addOne ( result , k ) ; } }

Target:
void display ( final com.google.gerrit.client.account.AgreementInfo result ) { while ( 1 < ( table.getRowCount ( ) ) ) table.removeRow ( ( ( table.getRowCount ( ) ) - 1 ) ) ; for ( final com.google.gerrit.client.reviewdb.AccountAgreement k : result.userAccepted ) { addOne ( result , k ) ; } for ( final com.google.gerrit.client.reviewdb.AccountGroupAgreement k : result.groupAccepted ) { addOne ( result , k ) ; } }
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 { if ( ( receiveEvent.commit.getParentCount ( ) ) > 1 ) { if ( com.google.gerrit.server.util.MagicBranch.isForReview ( receiveEvent.command.getRefName ( ) ) ) { if ( ! ( refControl.canUploadMerges ( ) ) ) { throw new com.google.gerrit.server.git.validators.CommitValidationException ( "you are not allowed to upload merges for review" ) ; } } else { if ( ! ( refControl.canPushMerges ( ) ) ) { throw new com.google.gerrit.server.git.validators.CommitValidationException ( "you are not allowed to push merges directly bypassing code review" ) ; } } } return java.util.Collections.< com.google.gerrit.server.git.validators.CommitValidationMessage > emptyList ( ) ; }

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 { if ( ( ( receiveEvent.commit.getParentCount ( ) ) > 1 ) && ( ! ( refControl.canUploadMerges ( ) ) ) ) { throw new com.google.gerrit.server.git.validators.CommitValidationException ( "you are not allowed to upload merges" ) ; } return java.util.Collections.< com.google.gerrit.server.git.validators.CommitValidationMessage > emptyList ( ) ; }
Source:
public com.google.gitiles.GitilesView.Builder setRepositoryPrefix ( java.lang.String prefix ) { switch ( type ) { case HOST_INDEX : this . repositoryPrefix = ( prefix != null ) ? com.google.common.base.Strings.emptyToNull ( com.google.gitiles.GitilesView.maybeTrimLeadingAndTrailingSlash ( prefix ) ) : null ; return this ; default : throw new java.lang.IllegalStateException ( java.lang.String.format ( "cannot set repository prefix on %s view" , type ) ) ; } }

Target:
public com.google.gitiles.GitilesView.Builder setRepositoryPrefix ( java.lang.String prefix ) { if ( ( type ) == ( com.google.gitiles.GitilesView.Type.HOST_INDEX ) ) { this . repositoryPrefix = ( prefix != null ) ? com.google.common.base.Strings.emptyToNull ( com.google.gitiles.GitilesView.maybeTrimLeadingAndTrailingSlash ( prefix ) ) : null ; return this ; } throw new java.lang.IllegalStateException ( java.lang.String.format ( "cannot set repository prefix on %s view" , type ) ) ; }
Source:
private org.apache.lucene.search.Query exactQuery ( com.google.gerrit.server.index.IndexPredicate < com.google.gerrit.server.query.change.ChangeData > p ) { return new org.apache.lucene.search.TermQuery ( new org.apache.lucene.index.Term ( p.getOperator ( ) , p.getValue ( ) ) ) ; }

Target:
private org.apache.lucene.search.Query exactQuery ( com.google.gerrit.server.index.IndexPredicate < com.google.gerrit.server.query.change.ChangeData > p ) { if ( p instanceof com.google.gerrit.server.index.RegexPredicate < ? > ) { return regexQuery ( p ) ; } else { return new org.apache.lucene.search.TermQuery ( new org.apache.lucene.index.Term ( p.getField ( ) . getName ( ) , p.getValue ( ) ) ) ; } }
Source:
private void updatePublishedComment ( com.google.gerrit.reviewdb.client.PatchLineComment c ) throws com.google.gwtorm.server.OrmException { verifyComment ( c ) ; if ( ( notes ) == null ) { notes = getChangeNotes ( ) . load ( ) ; } com.google.common.base.Preconditions.checkArgument ( ( ! ( notes.containsCommentPublished ( c ) ) ) , "Cannot update a comment that has already been published and saved" ) ; if ( ( c.getSide ( ) ) == 0 ) { commentsForBase.add ( c ) ; } else { commentsForPs.add ( c ) ; } }

Target:
private void updatePublishedComment ( com.google.gerrit.reviewdb.client.PatchLineComment c ) throws com.google.gwtorm.server.OrmException { verifyComment ( c ) ; if ( ( notes ) == null ) { notes = getChangeNotes ( ) . load ( ) ; } if ( migration.readComments ( ) ) { com.google.common.base.Preconditions.checkArgument ( ( ! ( notes.containsCommentPublished ( c ) ) ) , "Cannot update a comment that has already been published and saved" ) ; } if ( ( c.getSide ( ) ) == 0 ) { commentsForBase.add ( c ) ; } else { commentsForPs.add ( c ) ; } }
Source:
public static < V > com.google.common.collect.ImmutableList < java.lang.Integer > getWithoutLatest ( com.google.gerrit.server.index.SchemaDefinitions < V > schemaDef ) { java.util.List < java.lang.Integer > schemaVersions = new java.util.ArrayList ( com.google.gerrit.testutil.IndexVersions.get ( schemaDef ) ) ; schemaVersions.remove ( java.lang.Integer.valueOf ( schemaDef.getLatest ( ) . getVersion ( ) ) ) ; return com.google.common.collect.ImmutableList.copyOf ( schemaVersions ) ; }

Target:
public static < V > com.google.common.collect.ImmutableList < java.lang.Integer > getWithoutLatest ( com.google.gerrit.index.SchemaDefinitions < V > schemaDef ) { java.util.List < java.lang.Integer > schemaVersions = new java.util.ArrayList ( com.google.gerrit.testutil.IndexVersions.get ( schemaDef ) ) ; schemaVersions.remove ( java.lang.Integer.valueOf ( schemaDef.getLatest ( ) . getVersion ( ) ) ) ; return com.google.common.collect.ImmutableList.copyOf ( schemaVersions ) ; }
Source:
protected void configure ( ) { bind ( com.google.gerrit.extensions.api.changes.Changes.class ) . to ( com.google.gerrit.server.api.changes.ChangesImpl.class ) ; factory ( ChangeApiImpl.Factory.class ) ; factory ( RevisionApiImpl.Factory.class ) ; factory ( FileApiImpl.Factory.class ) ; }

Target:
protected void configure ( ) { bind ( com.google.gerrit.extensions.api.changes.Changes.class ) . to ( com.google.gerrit.server.api.changes.ChangesImpl.class ) ; factory ( ChangeApiImpl.Factory.class ) ; factory ( CommentApiImpl.Factory.class ) ; factory ( DraftApiImpl.Factory.class ) ; factory ( RevisionApiImpl.Factory.class ) ; factory ( FileApiImpl.Factory.class ) ; }
Source:
public boolean contains ( com.google.gerrit.reviewdb.client.AccountGroup.UUID uuid ) { if ( uuid == null ) { return false ; } com.google.gerrit.server.account.GroupMembership m = membership ( uuid ) ; if ( m == null ) { com.google.gerrit.server.account.UniversalGroupBackend.log.warn ( ( "Unknown GroupMembership for UUID: " + uuid ) ) ; return false ; } return m.contains ( uuid ) ; }

Target:
public boolean contains ( com.google.gerrit.reviewdb.client.AccountGroup.UUID uuid ) { if ( uuid == null ) { return false ; } com.google.gerrit.server.account.GroupMembership m = membership ( uuid ) ; if ( m == null ) { com.google.gerrit.server.account.UniversalGroupBackend.log.debug ( ( "Unknown GroupMembership for UUID: " + uuid ) ) ; return false ; } return m.contains ( uuid ) ; }
Source:
public void noComments ( ) { com.google.gerrit.server.mail.receive.MailMessage.Builder b = newMailMessageBuilder ( ) ; b.htmlContent ( newHtmlBody ( null , null , null , null , null , null , null ) ) ; java.util.List < com.google.gerrit.reviewdb.client.Comment > comments = defaultComments ( ) ; java.util.List < com.google.gerrit.server.mail.receive.MailComment > parsedComments = com.google.gerrit.server.mail.receive.HtmlParser.parse ( b.build ( ) , comments , changeURL ) ; com.google.common.truth.Truth.assertThat ( parsedComments ) . isEmpty ( ) ; }

Target:
public void noComments ( ) { com.google.gerrit.server.mail.receive.MailMessage.Builder b = newMailMessageBuilder ( ) ; b.htmlContent ( newHtmlBody ( null , null , null , null , null , null , null ) ) ; java.util.List < com.google.gerrit.reviewdb.client.Comment > comments = defaultComments ( ) ; java.util.List < com.google.gerrit.server.mail.receive.MailComment > parsedComments = com.google.gerrit.server.mail.receive.HtmlParser.parse ( b.build ( ) , comments , com.google.gerrit.server.mail.receive.CHANGE_URL ) ; com.google.common.truth.Truth.assertThat ( parsedComments ) . isEmpty ( ) ; }
Source:
public void testUnblockInParentBlockInLocal ( ) { com.google.gerrit.server.project.Util.grant ( util.getParentConfig ( ) , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/*" ) . setBlock ( ) ; com.google.gerrit.server.project.Util.grant ( util.getParentConfig ( ) , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) ; com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) . setBlock ( ) ; com.google.gerrit.server.project.ProjectControl d = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; org.junit.Assert.assertFalse ( "u can't push" , d.controlForRef ( "refs/heads/master" ) . canUpdate ( ) ) ; }

Target:
public void testUnblockVisibilityByREGISTEREDUsers ( ) { com.google.gerrit.server.project.Util.block ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS ) ; org.junit.Assert.assertTrue ( "u can read" , u.controlForRef ( "refs/heads/master" ) . isVisibleByRegisteredUsers ( ) ) ; }
Source:
public void onSuccess ( final com.google.gerrit.client.data.PatchSetDetail result ) { fileList.display ( psid , result.getPatches ( ) ) ; }

Target:
protected void createReplyEditor ( final com.google.gerrit.client.patches.LineCommentPanel currentPanel ) { final int row = rowOf ( currentPanel.getElement ( ) ) ; if ( row >= 0 ) { final int column = columnOf ( currentPanel.getElement ( ) ) ; final com.google.gerrit.client.reviewdb.PatchLineComment c = currentPanel.comment ; final com.google.gerrit.client.reviewdb.PatchLineComment.Key k = c.getKey ( ) ; createCommentEditor ( row , column , c.getLine ( ) , c.getSide ( ) , k.get ( ) ) ; } }
Source:
public final java.lang.String describe ( ) { if ( isScheme ( com.google.gerrit.client.account.ExternalIdInfo.SCHEME_GERRIT ) ) { return getSchemeRest ( ) ; } else if ( isScheme ( com.google.gerrit.client.account.ExternalIdInfo.SCHEME_USERNAME ) ) { return getSchemeRest ( ) ; } else if ( isScheme ( com.google.gerrit.client.account.ExternalIdInfo.SCHEME_MAILTO ) ) { return "" ; } else if ( isScheme ( "https://www.google.com/accounts/o8/id" ) ) { return OpenIdUtil.C.nameGoogle ( ) ; } else if ( isScheme ( OpenIdUrls.URL_LAUNCHPAD ) ) { return OpenIdUtil.C.nameLaunchpad ( ) ; } else if ( isScheme ( OpenIdUrls.URL_YAHOO ) ) { return OpenIdUtil.C.nameYahoo ( ) ; } return identity ( ) ; }

Target:
public final java.lang.String describe ( ) { if ( isScheme ( com.google.gerrit.client.account.ExternalIdInfo.SCHEME_GERRIT ) ) { return getSchemeRest ( ) ; } else if ( isScheme ( com.google.gerrit.client.account.ExternalIdInfo.SCHEME_USERNAME ) ) { return getSchemeRest ( ) ; } else if ( isScheme ( com.google.gerrit.client.account.ExternalIdInfo.SCHEME_MAILTO ) ) { return "" ; } else if ( isScheme ( OpenIdUrls.URL_LAUNCHPAD ) ) { return OpenIdUtil.C.nameLaunchpad ( ) ; } else if ( isScheme ( OpenIdUrls.URL_YAHOO ) ) { return OpenIdUtil.C.nameYahoo ( ) ; } return identity ( ) ; }
Source:
private static void assertUsedBatchingOnly ( java.sql.PreparedStatement statement ) throws java.sql.SQLException { org.mockito.Mockito.verify ( statement , org.mockito.Mockito.atLeastOnce ( ) ) . addBatch ( ) ; org.mockito.Mockito.verify ( statement ) . executeBatch ( ) ; org.mockito.Mockito.verify ( statement , org.mockito.Mockito.never ( ) ) . executeUpdate ( ) ; }

Target:
protected static void assertUsedNonBatchingOnly ( java.sql.PreparedStatement ps , int ... ids ) throws java.sql.SQLException { org.mockito.Mockito.verify ( ps , org.mockito.Mockito.never ( ) ) . addBatch ( ) ; org.mockito.Mockito.verify ( ps , org.mockito.Mockito.never ( ) ) . executeBatch ( ) ; org.mockito.Mockito.verify ( ps , org.mockito.Mockito.times ( ids.length ) ) . executeUpdate ( ) ; com.google.gwtorm.jdbc.AbstractTestJdbcAccess.assertExpectedIdsUsed ( ps , ids ) ; }
Source:
public static void restore ( int id , java.lang.String msg , com.google.gwtjsonrpc.common.AsyncCallback < com.google.gerrit.client.changes.ChangeInfo > cb ) { com.google.gerrit.client.changes.ChangeApi.Input input = com.google.gerrit.client.changes.ChangeApi.Input.create ( ) ; input.message ( com.google.gerrit.client.changes.ChangeApi.emptyToNull ( msg ) ) ; com.google.gerrit.client.changes.ChangeApi.api ( id , "restore" ) . data ( input ) . post ( cb ) ; }

Target:
public static void restore ( int id , java.lang.String msg , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.changes.ChangeInfo > cb ) { com.google.gerrit.client.changes.ChangeApi.Input input = com.google.gerrit.client.changes.ChangeApi.Input.create ( ) ; input.message ( com.google.gerrit.client.changes.ChangeApi.emptyToNull ( msg ) ) ; com.google.gerrit.client.changes.ChangeApi.api ( id , "restore" ) . data ( input ) . post ( cb ) ; }
Source:
private void add ( java.util.List < com.google.gerrit.sshd.SshKeyCacheEntry > kl , com.google.gerrit.reviewdb.client.AccountSshKey k ) { try { kl.add ( new com.google.gerrit.sshd.SshKeyCacheEntry ( k.getKey ( ) , com.google.gerrit.sshd.SshUtil.parse ( k ) ) ) ; } catch ( java.lang.OutOfMemoryError e ) { throw e ; } catch ( java.lang.Throwable e ) { markInvalid ( k ) ; } }

Target:
private void add ( java.util.List < com.google.gerrit.sshd.SshKeyCacheEntry > kl , com.google.gerrit.server.account.AccountSshKey k ) { try { kl.add ( new com.google.gerrit.sshd.SshKeyCacheEntry ( k.getKey ( ) , com.google.gerrit.sshd.SshUtil.parse ( k ) ) ) ; } catch ( java.lang.OutOfMemoryError e ) { throw e ; } catch ( java.lang.Throwable e ) { markInvalid ( k ) ; } }
Source:
public boolean isVisibleTo ( com.google.gerrit.reviewdb.client.Account.Id account ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.server.IdentifiedUser who = identifiedUserFactory.create ( account ) ; try { permissionBackend.user ( who ) . project ( rsrc.getNameKey ( ) ) . check ( ProjectPermission.ACCESS ) ; return true ; } catch ( com.google.gerrit.extensions.restapi.AuthException | com.google.gerrit.server.permissions.PermissionBackendException e ) { return false ; } }

Target:
public boolean isVisibleTo ( com.google.gerrit.reviewdb.client.Account.Id account ) throws com.google.gwtorm.server.OrmException { return permissionBackend.user ( identifiedUserFactory.create ( account ) ) . project ( rsrc.getNameKey ( ) ) . testOrFalse ( ProjectPermission.ACCESS ) ; }
Source:
private javax.naming.directory.DirContext open ( ) throws javax.naming.NamingException { final java.util.Properties env = new java.util.Properties ( ) ; env.put ( javax.naming.Context.INITIAL_CONTEXT_FACTORY , com.google.gerrit.server.ldap.LdapRealm.LDAP ) ; env.put ( javax.naming.Context.PROVIDER_URL , server ) ; if ( ( username ) != null ) { env.put ( javax.naming.Context.SECURITY_PRINCIPAL , username ) ; env.put ( javax.naming.Context.SECURITY_CREDENTIALS , password ) ; } return new javax.naming.directory.InitialDirContext ( env ) ; }

Target:
private javax.naming.directory.DirContext open ( ) throws javax.naming.NamingException { final java.util.Properties env = new java.util.Properties ( ) ; env.put ( javax.naming.Context.INITIAL_CONTEXT_FACTORY , com.google.gerrit.server.ldap.LdapRealm.LDAP ) ; env.put ( javax.naming.Context.PROVIDER_URL , server ) ; if ( ( username ) != null ) { env.put ( javax.naming.Context.SECURITY_PRINCIPAL , username ) ; env.put ( javax.naming.Context.SECURITY_CREDENTIALS , ( ( password ) != null ? password : "" ) ) ; } return new javax.naming.directory.InitialDirContext ( env ) ; }
Source:
public void testLimitArgumentOverridesAllLimitPredicates ( ) throws java.lang.Exception { com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > in = parse ( "limit:1 file:a limit:3" ) ; com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > out = rewrite ( in , 5 ) ; org.junit.Assert.assertSame ( com.google.gerrit.server.query.change.AndSource.class , out.getClass ( ) ) ; org.junit.Assert.assertEquals ( com.google.common.collect.ImmutableList.of ( query ( in.getChild ( 1 ) , 5 ) , parse ( "limit:5" ) , parse ( "limit:5" ) ) , out.getChildren ( ) ) ; }

Target:
public void testLimitArgumentOverridesAllLimitPredicates ( ) throws java.lang.Exception { com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > in = parse ( "limit:1 file:a limit:3" ) ; com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > out = rewrite ( in , 5 ) ; com.google.common.truth.Truth.assertThat ( out.getClass ( ) ) . isEqualTo ( com.google.gerrit.server.query.change.AndSource.class ) ; com.google.common.truth.Truth.assertThat ( out.getChildren ( ) ) . containsExactly ( query ( in.getChild ( 1 ) , 5 ) , parse ( "limit:5" ) , parse ( "limit:5" ) ) . inOrder ( ) ; }
Source:
public void execute ( ) throws com.google.gwtorm.server.OrmException , java.io.IOException { if ( migration.failChangeWrites ( ) ) { throw new com.google.gwtorm.server.OrmException ( com.google.gerrit.server.notedb.NoteDbUpdateManager.CHANGES_READ_ONLY ) ; } if ( isEmpty ( ) ) { return ; } try ( com.google.gerrit.metrics.Timer1.Context timer = metrics.updateLatency.start ( com.google.gerrit.server.notedb.NoteDbTable.CHANGES ) ) { stage ( ) ; execute ( changeRepo ) ; execute ( allUsersRepo ) ; } finally { close ( ) ; } }

Target:
public org.eclipse.jgit.lib.BatchRefUpdate execute ( boolean dryrun ) throws com.google.gwtorm.server.OrmException , java.io.IOException { if ( migration.failChangeWrites ( ) ) { throw new com.google.gwtorm.server.OrmException ( com.google.gerrit.server.notedb.NoteDbUpdateManager.CHANGES_READ_ONLY ) ; } if ( isEmpty ( ) ) { return null ; } try ( com.google.gerrit.metrics.Timer1.Context timer = metrics.updateLatency.start ( com.google.gerrit.server.notedb.NoteDbTable.CHANGES ) ) { stage ( ) ; org.eclipse.jgit.lib.BatchRefUpdate result = execute ( changeRepo , dryrun ) ; execute ( allUsersRepo , dryrun ) ; return result ; } finally { close ( ) ; } }
Source:
private void loadDraftComments ( com.google.gerrit.reviewdb.client.Account.Id author ) throws com.google.gwtorm.server.OrmException { if ( ( ( draftCommentNotes ) == null ) || ( ! ( author.equals ( draftCommentNotes.getAuthor ( ) ) ) ) ) { draftCommentNotes = new com.google.gerrit.server.notedb.DraftCommentNotes ( args , change , author ) ; draftCommentNotes.load ( ) ; } }

Target:
private void loadDraftComments ( com.google.gerrit.reviewdb.client.Account.Id author ) throws com.google.gwtorm.server.OrmException { if ( ( ( draftCommentNotes ) == null ) || ( ! ( author.equals ( draftCommentNotes.getAuthor ( ) ) ) ) ) { draftCommentNotes = new com.google.gerrit.server.notedb.DraftCommentNotes ( args , change , author , autoRebuild ) ; draftCommentNotes.load ( ) ; } }
Source:
private void redirectChooseProvider ( final javax.servlet.http.HttpServletRequest req , final javax.servlet.http.HttpServletResponse rsp ) throws java.io.IOException { final java.lang.StringBuffer url = req.getRequestURL ( ) ; url.append ( "?" ) ; url.append ( RelyingParty.DEFAULT_PARAMETER ) ; url.append ( "=" ) ; url.append ( org.mortbay.util.UrlEncoded.encodeString ( GoogleAccountDiscovery.GOOGLE_ACCOUNT ) ) ; rsp.sendRedirect ( url.toString ( ) ) ; }

Target:
private void redirectChooseProvider ( final javax.servlet.http.HttpServletRequest req , final javax.servlet.http.HttpServletResponse rsp ) throws java.io.IOException { com.google.gerrit.server.LoginServlet.forceLogout ( rsp ) ; final java.lang.StringBuffer url = req.getRequestURL ( ) ; url.append ( "?" ) ; url.append ( RelyingParty.DEFAULT_PARAMETER ) ; url.append ( "=" ) ; url.append ( org.mortbay.util.UrlEncoded.encodeString ( GoogleAccountDiscovery.GOOGLE_ACCOUNT ) ) ; rsp.sendRedirect ( url.toString ( ) ) ; }
Source:
private org.spearce.jgit.lib.Repository open ( final com.google.gerrit.client.reviewdb.Project.NameKey key ) throws com.google.gerrit.git.InvalidRepositoryException { return server.getRepositoryCache ( ) . get ( key.get ( ) ) ; }

Target:
public java.lang.Object createEntry ( java.lang.Object genericKey ) throws java.lang.Exception { final com.google.gerrit.server.patch.DiffCacheKey key = ( ( com.google.gerrit.server.patch.DiffCacheKey ) ( genericKey ) ) ; final org.spearce.jgit.lib.Repository db = server.openRepository ( key.getProjectKey ( ) . get ( ) ) ; try { return createEntry ( key , db ) ; } finally { db.close ( ) ; } }
Source:
void loadChangeInfo ( boolean fg , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.changes.ChangeInfo > cb ) { com.google.gerrit.client.rpc.RestApi call = com.google.gerrit.client.changes.ChangeApi.detail ( changeId.get ( ) ) ; com.google.gerrit.client.changes.ChangeList.addOptions ( call , java.util.EnumSet.of ( ListChangesOption.CURRENT_ACTIONS , ListChangesOption.ALL_REVISIONS ) ) ; if ( ! fg ) { call.background ( ) ; } call.get ( cb ) ; }

Target:
void loadChangeInfo ( boolean fg , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.changes.ChangeInfo > cb ) { com.google.gerrit.client.rpc.RestApi call = com.google.gerrit.client.changes.ChangeApi.detail ( changeId.get ( ) ) ; com.google.gerrit.client.changes.ChangeList.addOptions ( call , java.util.EnumSet.of ( ListChangesOption.CHANGE_ACTIONS , ListChangesOption.ALL_REVISIONS ) ) ; if ( ! fg ) { call.background ( ) ; } call.get ( cb ) ; }
Source:
protected void run ( ) throws com.google.gerrit.sshd.commands.Failure { try { com.google.gerrit.extensions.api.projects.BanCommitInput input = com.google.gerrit.extensions.api.projects.BanCommitInput.fromCommits ( com.google.common.collect.Lists.transform ( commitsToBan , ObjectId :: getName ) ) ; input.reason = reason ; com.google.gerrit.server.project.BanCommit.BanResultInfo r = banCommit.apply ( new com.google.gerrit.server.project.ProjectResource ( projectState , user ) , input ) ; printCommits ( r.newlyBanned , "The following commits were banned" ) ; printCommits ( r.alreadyBanned , "The following commits were already banned" ) ; printCommits ( r.ignored , "The following ids do not represent commits and were ignored" ) ; } catch ( java.lang.Exception e ) { throw die ( e ) ; } }

Target:
protected void run ( ) throws com.google.gerrit.sshd.commands.Failure { try { com.google.gerrit.extensions.api.projects.BanCommitInput input = com.google.gerrit.extensions.api.projects.BanCommitInput.fromCommits ( com.google.common.collect.Lists.transform ( commitsToBan , ObjectId :: getName ) ) ; input.reason = reason ; com.google.gerrit.server.restapi.project.BanCommit.BanResultInfo r = banCommit.apply ( new com.google.gerrit.server.project.ProjectResource ( projectState , user ) , input ) ; printCommits ( r.newlyBanned , "The following commits were banned" ) ; printCommits ( r.alreadyBanned , "The following commits were already banned" ) ; printCommits ( r.ignored , "The following ids do not represent commits and were ignored" ) ; } catch ( java.lang.Exception e ) { throw die ( e ) ; } }
Source:
public void newPatchSetByOtherOnReviewableChangeOwnerSelfCcNotifyOwnerReviewersInReviewDb ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isFalse ( ) ; com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) ; pushTo ( sc , "refs/for/master%notify=OWNER_REVIEWERS" , other , EmailStrategy.CC_ON_OWN_COMMENTS ) ; assertThat ( sender ) . sent ( "newpatchset" , sc ) . notTo ( sc.starrer , other ) . notTo ( sc.reviewerByEmail , sc.ccerByEmail ) . to ( sc.owner , sc.reviewer , sc.ccer ) . notTo ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) ; }

Target:
public void newPatchSetByOtherOnReviewableChangeOwnerSelfCcNotifyOwnerReviewersInNoteDb ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isTrue ( ) ; com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; pushTo ( sc , "refs/for/master%notify=OWNER_REVIEWERS" , other , EmailStrategy.CC_ON_OWN_COMMENTS ) ; assertThat ( sender ) . sent ( "newpatchset" , sc ) . to ( sc.owner , sc.reviewer ) . cc ( sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . noOneElse ( ) ; }
Source:
public void listProjects ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Project.NameKey someProject = new com.google.gerrit.reviewdb.client.Project.NameKey ( "some-project" ) ; com.google.gerrit.acceptance.GitUtil.createProject ( sshSession , someProject.get ( ) ) ; com.google.gerrit.acceptance.RestResponse r = GET ( "/projects/" ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( HttpStatus.SC_OK ) ; java.util.Map < java.lang.String , com.google.gerrit.extensions.common.ProjectInfo > result = com.google.gerrit.acceptance.rest.project.ListProjectsIT.toProjectInfoMap ( r ) ; com.google.gerrit.acceptance.rest.project.ProjectAssert.assertProjects ( java.util.Arrays.asList ( allUsers , someProject , project ) , result.values ( ) ) ; }

Target:
public void listProjects ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Project.NameKey someProject = new com.google.gerrit.reviewdb.client.Project.NameKey ( "some-project" ) ; com.google.gerrit.acceptance.GitUtil.createProject ( sshSession , someProject.get ( ) ) ; com.google.gerrit.acceptance.rest.project.ProjectAssert.assertThatNameList ( gApi.projects ( ) . list ( ) . get ( ) ) . containsExactly ( allProjects , allUsers , project , someProject ) . inOrder ( ) ; }
Source:
private void loadFileContent ( ) { com.google.gerrit.client.changes.ChangeFileApi.getContent ( id , getText ( ) , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.changes.ChangeFileApi.FileContent > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.changes.ChangeFileApi.FileContent result ) { textArea.setText ( result.text ( ) ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { if ( com.google.gerrit.client.rpc.RestApi.isNotFound ( caught ) ) { } else { super . onFailure ( caught ) ; } } } ) ; }

Target:
private void loadFileContent ( ) { com.google.gerrit.client.changes.ChangeEditApi.get ( id , getText ( ) , new com.google.gerrit.client.rpc.HttpCallback < com.google.gerrit.client.rpc.NativeString > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.rpc.HttpResponse < com.google.gerrit.client.rpc.NativeString > result ) { textArea.setText ( result.getResult ( ) . asString ( ) ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { if ( com.google.gerrit.client.rpc.RestApi.isNotFound ( caught ) ) { } else { com.google.gerrit.client.rpc.GerritCallback.showFailure ( caught ) ; } } } ) ; }
Source:
public boolean equals ( java.lang.Object other ) { return ( other instanceof com.google.gerrit.server.permissions.LabelPermission.WithValue ) && ( label.equals ( ( ( com.google.gerrit.server.permissions.LabelPermission.WithValue ) ( other ) ) . label ) ) ; }

Target:
public boolean equals ( java.lang.Object other ) { if ( other instanceof com.google.gerrit.server.permissions.LabelPermission.WithValue ) { com.google.gerrit.server.permissions.LabelPermission.WithValue b = ( ( com.google.gerrit.server.permissions.LabelPermission.WithValue ) ( other ) ) ; return ( ( forUser ) == ( b.forUser ) ) && ( label.equals ( b.label ) ) ; } return false ; }
Source:
void rebuildForNewTags ( com.google.gerrit.server.git.TagMatcher m ) { m.tags = rebuild ( m.db , m.tags , null ) ; m.mask.clear ( ) ; m.newRefs.clear ( ) ; m.lostRefs.clear ( ) ; m.tags.prepare ( m ) ; }

Target:
void rebuildForNewTags ( com.google.gerrit.server.git.TagCache cache , com.google.gerrit.server.git.TagMatcher m ) { m.tags = rebuild ( cache , m.db , m.tags , null ) ; m.mask.clear ( ) ; m.newRefs.clear ( ) ; m.lostRefs.clear ( ) ; m.tags.prepare ( m ) ; }
Source:
public void submitWithMergeIfFastForwardPossible ( ) throws com.jcraft.jsch.JSchException , java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { org.eclipse.jgit.api.Git git = createProject ( ) ; org.eclipse.jgit.revwalk.RevCommit oldHead = getRemoteHead ( ) ; com.google.gerrit.acceptance.PushOneCommit.Result change = createChange ( git ) ; submit ( change.getChangeId ( ) ) ; org.eclipse.jgit.revwalk.RevCommit head = getRemoteHead ( ) ; org.junit.Assert.assertEquals ( 2 , head.getParentCount ( ) ) ; org.junit.Assert.assertEquals ( oldHead , head.getParent ( 0 ) ) ; org.junit.Assert.assertEquals ( change.getCommitId ( ) , head.getParent ( 1 ) ) ; }

Target:
public void submitWithMergeIfFastForwardPossible ( ) throws java.lang.Exception { org.eclipse.jgit.api.Git git = createProject ( ) ; org.eclipse.jgit.revwalk.RevCommit oldHead = getRemoteHead ( ) ; com.google.gerrit.acceptance.PushOneCommit.Result change = createChange ( git ) ; submit ( change.getChangeId ( ) ) ; org.eclipse.jgit.revwalk.RevCommit head = getRemoteHead ( ) ; org.junit.Assert.assertEquals ( 2 , head.getParentCount ( ) ) ; org.junit.Assert.assertEquals ( oldHead , head.getParent ( 0 ) ) ; org.junit.Assert.assertEquals ( change.getCommitId ( ) , head.getParent ( 1 ) ) ; assertSubmitter ( change.getChangeId ( ) , 1 ) ; }
Source:
private void fireEvent ( com.google.gerrit.reviewdb.client.Project.NameKey project , com.google.gerrit.server.events.ProjectCreatedEvent event ) { for ( com.google.gerrit.common.ChangeHookRunner.EventListenerHolder holder : listeners.values ( ) ) { if ( isVisibleTo ( project , event , holder.user ) ) { holder.listener.onEvent ( event ) ; } } fireEventForUnrestrictedListeners ( event ) ; }

Target:
private void fireEvent ( com.google.gerrit.reviewdb.client.Branch.NameKey branchName , com.google.gerrit.server.events.RefEvent event ) { for ( com.google.gerrit.common.ChangeHookRunner.EventListenerHolder holder : listeners.values ( ) ) { if ( isVisibleTo ( branchName , holder.user ) ) { holder.listener.onEvent ( event ) ; } } fireEventForUnrestrictedListeners ( event ) ; }
Source:
public void run ( ) { if ( ( prefs.context ( ) ) == ( com.google.gerrit.extensions.client.DiffPreferencesInfo.WHOLE_FILE_CONTEXT ) ) { contextEntireFile.setValue ( true ) ; } if ( view.canEnableRenderEntireFile ( prefs ) ) { renderEntireFile.setEnabled ( true ) ; } else { if ( prefs.renderEntireFile ( ) ) { prefs.renderEntireFile ( false ) ; renderEntireFile.setValue ( false ) ; view.updateRenderEntireFile ( ) ; } renderEntireFile.setEnabled ( false ) ; } view.setContext ( prefs.context ( ) ) ; }

Target:
void onCursoBlinkRate ( com.google.gwt.event.logical.shared.ValueChangeEvent < java.lang.String > e ) { java.lang.String v = e.getValue ( ) ; if ( ( v != null ) && ( ( v.length ( ) ) > 0 ) ) { prefs.cursorBlinkRate ( java.lang.Math.max ( 0 , java.lang.Integer.parseInt ( v ) ) ) ; view.getCmFromSide ( DisplaySide.A ) . setOption ( "cursorBlinkRate" , prefs.cursorBlinkRate ( ) ) ; view.getCmFromSide ( DisplaySide.B ) . setOption ( "cursorBlinkRate" , prefs.cursorBlinkRate ( ) ) ; } }
Source:
private java.lang.String getValue ( final org.eclipse.jgit.lib.Config config , final java.lang.String section , final java.lang.String setting , final java.lang.String fallback ) { final java.lang.String result = config.getString ( section , null , setting ) ; return result == null ? fallback : result ; }

Target:
private static java.nio.file.Path hook ( org.eclipse.jgit.lib.Config config , java.nio.file.Path path , java.lang.String name ) { java.lang.String setting = ( name.replace ( "-" , "" ) ) + "hook" ; java.lang.String value = config.getString ( "hooks" , null , setting ) ; return path.resolve ( ( value != null ? value : name ) ) ; }
Source:
private static synchronized void loadDriver ( final java.lang.String driver ) throws java.sql.SQLException { try { java.lang.Class.forName ( driver , true , com.google.gwtorm.jdbc.SimpleDataSource.threadCL ( ) ) ; } catch ( java.lang.ClassNotFoundException err ) { final java.sql.SQLException e ; e = new java.sql.SQLException ( ( ( "Driver class " + driver ) + " not available" ) ) ; e.initCause ( err ) ; throw e ; } }

Target:
private static synchronized java.sql.Driver loadDriver ( final java.lang.String driver , final java.lang.ClassLoader loader ) throws java.sql.SQLException { try { return ( ( java.sql.Driver ) ( java.lang.Class.forName ( driver , true , loader ) . newInstance ( ) ) ) ; } catch ( java.lang.Throwable err ) { final java.sql.SQLException e ; e = new java.sql.SQLException ( ( ( "Driver class " + driver ) + " not available" ) ) ; e.initCause ( err ) ; throw e ; } }
Source:
private void initWildCardProject ( final com.google.gerrit.client.reviewdb.ReviewDb c ) throws com.google.gwtorm.client.OrmException { final com.google.gerrit.client.reviewdb.Project proj ; proj = new com.google.gerrit.client.reviewdb.Project ( new com.google.gerrit.client.reviewdb.Project.NameKey ( "-- All Projects --" ) , com.google.gerrit.client.reviewdb.ProjectRight.WILD_PROJECT ) ; proj.setDescription ( "Rights inherited by all other projects" ) ; proj.setUseContributorAgreements ( false ) ; c.projects ( ) . insert ( java.util.Collections.singleton ( proj ) ) ; }

Target:
private void initWildCardProject ( final com.google.gerrit.client.reviewdb.ReviewDb c ) throws com.google.gwtorm.client.OrmException { final com.google.gerrit.client.reviewdb.Project p ; p = new com.google.gerrit.client.reviewdb.Project ( com.google.gerrit.server.config.SystemConfigProvider.DEFAULT_WILD_NAME , WildProjectNameProvider.WILD_PROJECT_ID ) ; p.setDescription ( "Rights inherited by all other projects" ) ; p.setUseContributorAgreements ( false ) ; c.projects ( ) . insert ( java.util.Collections.singleton ( p ) ) ; }
Source:
private com.google.gerrit.server.plugins.Plugin loadPlugin ( java.lang.String name , java.io.File srcPlugin , org.eclipse.jgit.internal.storage.file.FileSnapshot snapshot ) throws com.google.gerrit.server.plugins.InvalidPluginException { java.lang.String pluginName = srcPlugin.getName ( ) ; if ( com.google.gerrit.server.plugins.PluginLoader.isJsPlugin ( pluginName ) ) { return loadJsPlugin ( name , srcPlugin , snapshot ) ; } else if ( serverPluginFactory.handles ( srcPlugin ) ) { return loadServerPlugin ( srcPlugin , snapshot ) ; } else { throw new com.google.gerrit.server.plugins.InvalidPluginException ( java.lang.String.format ( "Unsupported plugin type: %s" , srcPlugin.getName ( ) ) ) ; } }

Target:
private com.google.gerrit.server.plugins.Plugin loadPlugin ( java.lang.String name , java.io.File srcPlugin , org.eclipse.jgit.internal.storage.file.FileSnapshot snapshot ) throws com.google.gerrit.server.plugins.InvalidPluginException { java.lang.String pluginName = srcPlugin.getName ( ) ; if ( com.google.gerrit.server.plugins.PluginLoader.isJsPlugin ( pluginName ) ) { return loadJsPlugin ( name , srcPlugin.toPath ( ) , snapshot ) ; } else if ( serverPluginFactory.handles ( srcPlugin ) ) { return loadServerPlugin ( srcPlugin , snapshot ) ; } else { throw new com.google.gerrit.server.plugins.InvalidPluginException ( java.lang.String.format ( "Unsupported plugin type: %s" , srcPlugin.getName ( ) ) ) ; } }
Source:
public void run ( ) { if ( running.compareAndSet ( false , true ) ) { try { task.run ( ) ; } finally { if ( isPeriodic ( ) ) { running.set ( false ) ; } } } }

Target:
public void run ( ) { if ( running.compareAndSet ( false , true ) ) { try { task.run ( ) ; } finally { if ( isPeriodic ( ) ) { running.set ( false ) ; } else { executor.remove ( this ) ; } } } }
Source:
void onSave ( com.google.gwt.event.dom.client.ClickEvent e ) { com.google.gerrit.client.changes.ChangeFileApi.putContent ( id , file , message.getText ( ) . trim ( ) , new com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.VoidResult > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.VoidResult result ) { com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( id.getParentKey ( ) ) ) ; hide ( ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { } } ) ; }

Target:
public void onTextChanged ( java.lang.String newText ) { save.setEnabled ( ( ( ! ( file.getText ( ) . trim ( ) . isEmpty ( ) ) ) && ( ! ( newText.trim ( ) . equals ( fileContent ) ) ) ) ) ; }