auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void install ( com.google.gerrit.server.plugins.Plugin plugin ) { com.google.inject.servlet.GuiceFilter filter = load ( plugin ) ; final java.lang.String name = plugin.getName ( ) ; final com.google.gerrit.httpd.plugins.PluginHolder holder = new com.google.gerrit.httpd.plugins.PluginHolder ( plugin , filter ) ; plugin.add ( new com.google.gerrit.extensions.registration.RegistrationHandle ( ) { @ java.lang.Override public void remove ( ) { plugins.remove ( name , holder ) ; } } ) ; plugins.put ( name , holder ) ; }

Target:
private void install ( com.google.gerrit.server.plugins.Plugin plugin ) { com.google.inject.servlet.GuiceFilter filter = load ( plugin ) ; final java.lang.String name = plugin.getName ( ) ; final com.google.gerrit.httpd.plugins.HttpPluginServlet.PluginHolder holder = new com.google.gerrit.httpd.plugins.HttpPluginServlet.PluginHolder ( plugin , filter ) ; plugin.add ( new com.google.gerrit.extensions.registration.RegistrationHandle ( ) { @ java.lang.Override public void remove ( ) { plugins.remove ( name , holder ) ; } } ) ; plugins.put ( name , holder ) ; }
Source:
public void testHostIndex ( ) throws java.lang.Exception { com.google.gitiles.GitilesView view = getView ( "/" ) ; assertEquals ( Type.HOST_INDEX , view.getType ( ) ) ; assertEquals ( "test-host" , view.getHostName ( ) ) ; assertNull ( view.getRepositoryName ( ) ) ; assertEquals ( Revision.NULL , view.getRevision ( ) ) ; assertEquals ( Revision.NULL , view.getOldRevision ( ) ) ; assertNull ( view.getPathPart ( ) ) ; }

Target:
public void hostIndex ( ) throws java.lang.Exception { com.google.gitiles.GitilesView view = getView ( "/" ) ; org.junit.Assert.assertEquals ( Type.HOST_INDEX , view.getType ( ) ) ; org.junit.Assert.assertEquals ( "test-host" , view.getHostName ( ) ) ; org.junit.Assert.assertNull ( view.getRepositoryName ( ) ) ; org.junit.Assert.assertEquals ( Revision.NULL , view.getRevision ( ) ) ; org.junit.Assert.assertEquals ( Revision.NULL , view.getOldRevision ( ) ) ; org.junit.Assert.assertNull ( view.getPathPart ( ) ) ; }
Source:
public void onFailure ( java.lang.Throwable caught ) { setEnabled ( true ) ; new com.google.gerrit.client.ErrorDialog ( caught ) . center ( ) ; }

Target:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { if ( ( ( ctx ) != null ) && ( ctx.has_popup ( ) ) ) { ctx.hide ( ) ; ctx = null ; return ; } if ( ( revision ) != null ) { com.google.gerrit.client.api.RevisionGlue.onAction ( change , revision , action , this ) ; } else { com.google.gerrit.client.api.ChangeGlue.onAction ( change , action , this ) ; } }
Source:
com.google.gerrit.server.git.strategy.SubmitStrategy.Arguments create ( com.google.gerrit.extensions.client.SubmitType submitType , com.google.gerrit.reviewdb.client.Branch.NameKey destBranch , com.google.gerrit.server.git.MergeOp.CommitStatus commits , com.google.gerrit.server.git.CodeReviewCommit.CodeReviewRevWalk rw , com.google.gerrit.server.IdentifiedUser caller , com.google.gerrit.server.git.MergeTip mergeTip , org.eclipse.jgit.lib.ObjectInserter inserter , org.eclipse.jgit.lib.Repository repo , org.eclipse.jgit.revwalk.RevFlag canMergeFlag , com.google.gerrit.reviewdb.server.ReviewDb db , java.util.Set < org.eclipse.jgit.revwalk.RevCommit > alreadyAccepted , java.lang.String submissionId , com.google.gerrit.extensions.api.changes.ReviewInput.NotifyHandling notifyHandling ) ;

Target:
com.google.gerrit.server.git.strategy.SubmitStrategy.Arguments create ( com.google.gerrit.extensions.client.SubmitType submitType , com.google.gerrit.reviewdb.client.Branch.NameKey destBranch , com.google.gerrit.server.git.MergeOp.CommitStatus commits , com.google.gerrit.server.git.CodeReviewCommit.CodeReviewRevWalk rw , com.google.gerrit.server.IdentifiedUser caller , com.google.gerrit.server.git.MergeTip mergeTip , org.eclipse.jgit.lib.ObjectInserter inserter , org.eclipse.jgit.lib.Repository repo , org.eclipse.jgit.revwalk.RevFlag canMergeFlag , com.google.gerrit.reviewdb.server.ReviewDb db , java.util.Set < org.eclipse.jgit.revwalk.RevCommit > alreadyAccepted , java.lang.String submissionId , com.google.gerrit.extensions.api.changes.NotifyHandling notifyHandling , com.google.gerrit.server.git.SubmoduleOp submoduleOp ) ;
Source:
public com.googlesource.gerrit.plugins.imagare.GetConfig.ConfigInfo apply ( com.google.gerrit.server.config.ConfigResource resource ) { com.googlesource.gerrit.plugins.imagare.GetConfig.ConfigInfo info = new com.googlesource.gerrit.plugins.imagare.GetConfig.ConfigInfo ( ) ; info.defaultProject = com.google.common.base.MoreObjects.firstNonNull ( cfg.getString ( "defaultProject" ) , "All-Projects" ) ; info.linkDecoration = cfg.getEnum ( "linkDecoration" , LinkDecoration.NONE ) ; if ( LinkDecoration.NONE.equals ( info.linkDecoration ) ) { info.linkDecoration = null ; } info.stage = cfg.getBoolean ( "stage" , false ) ; if ( ! ( info.stage ) ) { info.stage = null ; } return info ; }

Target:
public com.googlesource.gerrit.plugins.imagare.GetConfig.ConfigInfo apply ( com.google.gerrit.server.config.ConfigResource resource ) { com.googlesource.gerrit.plugins.imagare.GetConfig.ConfigInfo info = new com.googlesource.gerrit.plugins.imagare.GetConfig.ConfigInfo ( ) ; info.defaultProject = com.google.common.base.MoreObjects.firstNonNull ( cfg.getString ( "defaultProject" ) , "All-Projects" ) ; info.linkDecoration = cfg.getEnum ( "linkDecoration" , LinkDecoration.INLINE ) ; if ( LinkDecoration.NONE.equals ( info.linkDecoration ) ) { info.linkDecoration = null ; } info.stage = cfg.getBoolean ( "stage" , false ) ; if ( ! ( info.stage ) ) { info.stage = null ; } return info ; }
Source:
public boolean isDirectChild ( ) { com.google.gerrit.server.project.ProjectState parent = com.google.common.collect.Iterables.getFirst ( child.getProjectState ( ) . parents ( ) , null ) ; return ( parent != null ) && ( getNameKey ( ) . equals ( parent.getProject ( ) . getNameKey ( ) ) ) ; }

Target:
public boolean isDirectChild ( ) { com.google.gerrit.server.project.ProjectState firstParent = com.google.common.collect.Iterables.getFirst ( child.getProjectState ( ) . parents ( ) , null ) ; return ( firstParent != null ) && ( parent.getNameKey ( ) . equals ( firstParent.getProject ( ) . getNameKey ( ) ) ) ; }
Source:
com.google.common.collect.ImmutableList < com.google.gerrit.reviewdb.client.PatchLineComment > exportComments ( final com.google.gerrit.reviewdb.client.PatchLineComment.Status status ) { return com.google.common.collect.ImmutableList.copyOf ( com.google.common.collect.Lists.transform ( comments , new com.google.common.base.Function < com.google.gerrit.server.notedb.RevisionNoteData.Comment , com.google.gerrit.reviewdb.client.PatchLineComment > ( ) { @ java.lang.Override public com.google.gerrit.reviewdb.client.PatchLineComment apply ( com.google.gerrit.server.notedb.RevisionNoteData.Comment c ) { com.google.gerrit.reviewdb.client.PatchLineComment plc = c.export ( ) ; plc.setStatus ( status ) ; return plc ; } } ) ) ; }

Target:
com.google.common.collect.ImmutableList < com.google.gerrit.reviewdb.client.PatchLineComment > exportComments ( com.google.gerrit.reviewdb.client.PatchLineComment.Status status ) { return com.google.common.collect.ImmutableList.copyOf ( comments.stream ( ) . map ( ( c ) -> { com.google.gerrit.reviewdb.client.PatchLineComment plc = c.export ( ) ; plc.setStatus ( status ) ; return plc ; } ) . collect ( java.util.stream.Collectors.toList ( ) ) ) ; }
Source:
public com.google.gitiles.GitilesView.Builder copyFrom ( com.google.gitiles.GitilesView other ) { hostName = other.hostName ; servletPath = other.servletPath ; switch ( type ) { case LOG : case DIFF : oldRevision = other.oldRevision ; case PATH : path = other.path ; case REVISION : revision = other.revision ; case REFS : case REPOSITORY_INDEX : repositoryName = other.repositoryName ; default : break ; } return this ; }

Target:
public com.google.gitiles.GitilesView.Builder copyFrom ( com.google.gitiles.GitilesView other ) { hostName = other.hostName ; servletPath = other.servletPath ; switch ( type ) { case LOG : case DIFF : oldRevision = other.oldRevision ; case PATH : path = other.path ; case REVISION : revision = other.revision ; case DESCRIBE : case REFS : case REPOSITORY_INDEX : repositoryName = other.repositoryName ; default : break ; } return this ; }
Source:
void removeMyDrafts ( ) { org.eclipse.jgit.lib.Config cfg = getConfig ( ) ; for ( java.lang.String item : cfg.getSubsections ( com.google.gerrit.server.git.UserConfigSections.MY ) ) { if ( com.google.gerrit.server.schema.Schema_160.DEFAULT_DRAFT_ITEM.equals ( cfg.getString ( com.google.gerrit.server.git.UserConfigSections.MY , item , com.google.gerrit.server.git.UserConfigSections.KEY_URL ) ) ) { cfg.unsetSection ( com.google.gerrit.server.git.UserConfigSections.MY , item ) ; dirty = true ; } } }

Target:
void removeMyDrafts ( ) { org.eclipse.jgit.lib.Config cfg = getConfig ( ) ; for ( java.lang.String item : cfg.getSubsections ( com.google.gerrit.server.git.UserConfigSections.MY ) ) { java.lang.String value = cfg.getString ( com.google.gerrit.server.git.UserConfigSections.MY , item , com.google.gerrit.server.git.UserConfigSections.KEY_URL ) ; if ( com.google.gerrit.server.schema.Schema_160.DEFAULT_DRAFT_ITEMS.contains ( value ) ) { cfg.unsetSection ( com.google.gerrit.server.git.UserConfigSections.MY , item ) ; dirty = true ; } } }
Source:
void parseAll ( ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { walk.markStart ( walk.parseCommit ( tip ) ) ; try ( com.google.gerrit.metrics.Timer1.Context timer = metrics.parseLatency.start ( com.google.gerrit.server.notedb.NoteDbTable.CHANGES ) ) { com.google.gerrit.server.notedb.ChangeNotesCommit commit ; while ( ( commit = walk.next ( ) ) != null ) { parse ( commit ) ; } parseNotes ( ) ; allPastReviewers.addAll ( reviewers.keySet ( ) ) ; pruneReviewers ( ) ; updatePatchSetStates ( ) ; checkMandatoryFooters ( ) ; } }

Target:
void parseAll ( ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { walk.markStart ( walk.parseCommit ( tip ) ) ; try ( com.google.gerrit.metrics.Timer1.Context timer = metrics.parseLatency.start ( com.google.gerrit.server.notedb.NoteDbTable.CHANGES ) ) { com.google.gerrit.server.notedb.ChangeNotesCommit commit ; while ( ( commit = walk.next ( ) ) != null ) { parse ( commit ) ; } parseNotes ( ) ; allPastReviewers.addAll ( reviewers.rowKeySet ( ) ) ; pruneReviewers ( ) ; updatePatchSetStates ( ) ; checkMandatoryFooters ( ) ; } }
Source:
com.google.gerrit.reviewdb.client.ContactInformation toContactInformation ( ) { final com.google.gerrit.reviewdb.client.ContactInformation info ; if ( com.google.gerrit.client.Gerrit.getConfig ( ) . isUseContactInfo ( ) ) { info = new com.google.gerrit.reviewdb.client.ContactInformation ( ) ; info.setAddress ( addressTxt.getText ( ) ) ; info.setCountry ( countryTxt.getText ( ) ) ; info.setPhoneNumber ( phoneTxt.getText ( ) ) ; info.setFaxNumber ( faxTxt.getText ( ) ) ; } else { info = null ; } return info ; }

Target:
com.google.gerrit.reviewdb.client.ContactInformation toContactInformation ( ) { final com.google.gerrit.reviewdb.client.ContactInformation info ; if ( com.google.gerrit.client.Gerrit.info ( ) . hasContactStore ( ) ) { info = new com.google.gerrit.reviewdb.client.ContactInformation ( ) ; info.setAddress ( addressTxt.getText ( ) ) ; info.setCountry ( countryTxt.getText ( ) ) ; info.setPhoneNumber ( phoneTxt.getText ( ) ) ; info.setFaxNumber ( faxTxt.getText ( ) ) ; } else { info = null ; } return info ; }
Source:
public void tearDown ( ) throws java.lang.Exception { java.lang.String path = ( ( ( com.ericsson.gerrit.plugins.eventslog.SQLStoreTest.TEST_PATH ) + ( com.ericsson.gerrit.plugins.eventslog.SQLTable.TABLE_NAME ) ) + ";" ) + ( com.ericsson.gerrit.plugins.eventslog.SQLStoreTest.TEST_OPTIONS ) ; java.sql.Connection conn = java.sql.DriverManager.getConnection ( path ) ; java.sql.Statement stat = conn.createStatement ( ) ; stat.execute ( ( "DROP TABLE " + ( com.ericsson.gerrit.plugins.eventslog.SQLTable.TABLE_NAME ) ) ) ; }

Target:
public void tearDown ( ) throws java.lang.Exception { stat.execute ( ( "DROP TABLE " + ( com.ericsson.gerrit.plugins.eventslog.SQLTable.TABLE_NAME ) ) ) ; store.stop ( ) ; }
Source:
private boolean canAbandon ( com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { return ( ( ( ( ( isOwner ( ) ) || ( getRefControl ( ) . isOwner ( ) ) ) || ( getProjectControl ( ) . isOwner ( ) ) ) || ( getRefControl ( ) . canAbandon ( ) ) ) || ( getProjectControl ( ) . isAdmin ( ) ) ) && ( ! ( isPatchSetLocked ( db ) ) ) ; }

Target:
private boolean canAbandon ( com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { return ( ( ( ( ( isOwner ( ) ) || ( refControl.isOwner ( ) ) ) || ( getProjectControl ( ) . isOwner ( ) ) ) || ( refControl.canAbandon ( ) ) ) || ( getProjectControl ( ) . isAdmin ( ) ) ) && ( ! ( isPatchSetLocked ( db ) ) ) ; }
Source:
public void onDoubleClick ( com.google.gwt.event.dom.client.DoubleClickEvent event ) { if ( patchTableHeader.listA.fileExists ) { onCellDoubleClick ( 0 , 1 ) ; } }

Target:
protected void destroyCommentRow ( final int row ) { super . destroyCommentRow ( row ) ; if ( ( ( ( this . rowOfTableHeaderB ) + 1 ) == row ) && ( ( row + 1 ) == ( borderRowOfFileComment ) ) ) { table.removeRow ( row ) ; isFileCommentBorderRowExist = false ; } }
Source:
public void set ( ) throws java.lang.Exception { com.google.gerrit.server.account.PutUsername.Input in = new com.google.gerrit.server.account.PutUsername.Input ( ) ; in.username = "myUsername" ; com.google.gerrit.acceptance.RestResponse r = adminRestSession.put ( ( ( "/accounts/" + ( accountCreator.create ( ) . id.get ( ) ) ) + "/username" ) , in ) ; r.assertOK ( ) ; com.google.common.truth.Truth.assertThat ( newGson ( ) . fromJson ( r.getReader ( ) , java.lang.String.class ) ) . isEqualTo ( in.username ) ; }

Target:
public void set ( ) throws java.lang.Exception { com.google.gerrit.extensions.common.UsernameInput in = new com.google.gerrit.extensions.common.UsernameInput ( ) ; in.username = "myUsername" ; com.google.gerrit.acceptance.RestResponse r = adminRestSession.put ( ( ( "/accounts/" + ( accountCreator.create ( ) . id.get ( ) ) ) + "/username" ) , in ) ; r.assertOK ( ) ; com.google.common.truth.Truth.assertThat ( newGson ( ) . fromJson ( r.getReader ( ) , java.lang.String.class ) ) . isEqualTo ( in.username ) ; }
Source:
protected void configure ( ) { install ( new com.google.gerrit.server.config.FactoryModule ( ) { @ java.lang.Override public void configure ( ) { factory ( LuceneChangeIndex.Factory.class ) ; } } ) ; install ( new com.google.gerrit.server.index.IndexModule ( threads ) ) ; if ( ( singleVersion ) == null ) { listener ( ) . to ( com.google.gerrit.lucene.LuceneVersionManager.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; } else { install ( new com.google.gerrit.lucene.LuceneIndexModule.SingleVersionModule ( ) ) ; } }

Target:
protected void configure ( ) { install ( new com.google.gerrit.server.config.FactoryModule ( ) { @ java.lang.Override public void configure ( ) { factory ( LuceneChangeIndex.Factory.class ) ; } } ) ; install ( new com.google.gerrit.server.index.IndexModule ( threads ) ) ; if ( ( ( singleVersion ) == null ) && ( ( base ) == null ) ) { install ( new com.google.gerrit.lucene.LuceneIndexModule.MultiVersionModule ( ) ) ; } else { install ( new com.google.gerrit.lucene.LuceneIndexModule.SingleVersionModule ( ) ) ; } }
Source:
private java.lang.String readSshKey ( ) throws java.io.IOException , java.io.UnsupportedEncodingException { if ( ( sshKey ) == null ) { return null ; } if ( "-" . equals ( sshKey ) ) { sshKey = "" ; java.io.BufferedReader br = new java.io.BufferedReader ( new java.io.InputStreamReader ( in , "UTF-8" ) ) ; java.lang.String line ; while ( ( line = br.readLine ( ) ) != null ) { sshKey += line + "\n" ; } } return sshKey ; }

Target:
private java.lang.String readSshKey ( ) throws java.io.IOException { if ( ( sshKey ) == null ) { return null ; } if ( "-" . equals ( sshKey ) ) { sshKey = "" ; java.io.BufferedReader br = new java.io.BufferedReader ( new java.io.InputStreamReader ( in , java.nio.charset.StandardCharsets.UTF_8 ) ) ; java.lang.String line ; while ( ( line = br.readLine ( ) ) != null ) { sshKey += line + "\n" ; } } return sshKey ; }
Source:
public void newPatchSetOnWipChangeSettingReadyInNoteDb ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isTrue ( ) ; com.google.gerrit.acceptance.server.mail.StagedChange sc = stageWipChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) ; pushTo ( sc , "refs/for/master%ready" , sc.owner ) ; assertThat ( sender ) . sent ( "newpatchset" , sc ) . notTo ( sc.owner ) . to ( sc.reviewer ) . cc ( sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) ; assertThat ( sender ) . notSent ( ) ; }

Target:
public void newPatchSetOnWipChangeToReadyInReviewDb ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isFalse ( ) ; com.google.gerrit.acceptance.server.mail.StagedChange sc = stageWipChange ( ) ; pushTo ( sc , "refs/for/master%ready" , sc.owner ) ; assertThat ( sender ) . sent ( "newpatchset" , sc ) . to ( sc.reviewer , sc.ccer ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) . noOneElse ( ) ; }
Source:
public void setPatchLineComments ( java.util.List < com.google.gerrit.reviewdb.client.Comment > plc ) throws com.google.gwtorm.server.OrmException { inlineComments = plc ; java.util.Set < java.lang.String > paths = new java.util.HashSet < > ( ) ; for ( com.google.gerrit.reviewdb.client.Comment c : plc ) { if ( ! ( com.google.gerrit.reviewdb.client.Patch.isMagic ( c.key.filename ) ) ) { paths.add ( c.key.filename ) ; } } changeData.setCurrentFilePaths ( com.google.common.collect.Ordering.natural ( ) . sortedCopy ( paths ) ) ; }

Target:
public void setComments ( java.util.List < com.google.gerrit.reviewdb.client.Comment > comments ) throws com.google.gwtorm.server.OrmException { inlineComments = comments ; java.util.Set < java.lang.String > paths = new java.util.HashSet < > ( ) ; for ( com.google.gerrit.reviewdb.client.Comment c : comments ) { if ( ! ( com.google.gerrit.reviewdb.client.Patch.isMagic ( c.key.filename ) ) ) { paths.add ( c.key.filename ) ; } } changeData.setCurrentFilePaths ( com.google.common.collect.Ordering.natural ( ) . sortedCopy ( paths ) ) ; }
Source:
private void init ( ) { java.lang.String [ ] varParts = sectionAndKey.split ( "\\." ) ; if ( ( varParts.length ) != 2 ) { throw new java.lang.IllegalArgumentException ( ( ( "Invalid name '" + ( sectionAndKey ) ) + "': expected section.key format" ) ) ; } section = varParts [ 0 ] ; key = varParts [ 1 ] ; }

Target:
private void init ( ) { java.util.List < java.lang.String > varParts = com.google.common.base.Splitter.on ( '.' ) . splitToList ( sectionAndKey ) ; if ( ( varParts.size ( ) ) != 2 ) { throw new java.lang.IllegalArgumentException ( ( ( "Invalid name '" + ( sectionAndKey ) ) + "': expected section.key format" ) ) ; } section = varParts.get ( 0 ) ; key = varParts.get ( 1 ) ; }
Source:
public void start ( ) { if ( ! ( com.googlesource.gerrit.plugins.replication.ReplicationLogFile.started ) ) { org.apache.log4j.Logger replicationLogger = org.apache.log4j.LogManager.getLogger ( ReplicationQueue.REPLICATION_LOG_NAME ) ; replicationLogger.removeAllAppenders ( ) ; replicationLogger.addAppender ( systemLog.createAsyncAppender ( replicationLogger.getName ( ) , new org.apache.log4j.PatternLayout ( ( ( "[%d] [%X{" + ( PushOne.ID_MDC_KEY ) ) + "}] %m%n" ) ) ) ) ; replicationLogger.setAdditivity ( false ) ; com.googlesource.gerrit.plugins.replication.ReplicationLogFile.started = true ; } }

Target:
public void start ( ) { if ( ! ( com.googlesource.gerrit.plugins.replication.ReplicationLogFile.started ) ) { org.apache.log4j.Logger replicationLogger = org.apache.log4j.LogManager.getLogger ( ReplicationQueue.REPLICATION_LOG_NAME ) ; java.lang.String loggerName = replicationLogger.getName ( ) ; org.apache.log4j.AsyncAppender asyncAppender = systemLog.createAsyncAppender ( loggerName , new org.apache.log4j.PatternLayout ( ( ( "[%d] [%X{" + ( PushOne.ID_MDC_KEY ) ) + "}] %m%n" ) ) ) ; replicationLogger.removeAppender ( loggerName ) ; replicationLogger.addAppender ( asyncAppender ) ; replicationLogger.setAdditivity ( false ) ; com.googlesource.gerrit.plugins.replication.ReplicationLogFile.started = true ; } }
Source:
public boolean has ( com.google.gerrit.extensions.auth.oauth.OAuthUserInfo user ) { return user != null ? ( cache.getIfPresent ( user.getUserName ( ) ) ) != null : false ; }

Target:
public com.google.gerrit.extensions.auth.oauth.OAuthToken get ( com.google.gerrit.reviewdb.client.Account.Id id ) { com.google.gerrit.extensions.auth.oauth.OAuthToken accessToken = cache.getIfPresent ( id ) ; if ( accessToken == null ) { return null ; } accessToken = decrypt ( accessToken ) ; if ( accessToken.isExpired ( ) ) { cache.invalidate ( id ) ; return null ; } return accessToken ; }
Source:
public int compare ( com.google.gerrit.client.changes.ChangeInfo.RevisionInfo a , com.google.gerrit.client.changes.ChangeInfo.RevisionInfo b ) { int a_number = a._number ( ) ; int b_number = b._number ( ) ; if ( a_number == 0 ) { a_number = parent_edit_number ; } if ( b_number == 0 ) { b_number = parent_edit_number ; } return a_number - b_number ; }

Target:
private int num ( com.google.gerrit.client.changes.ChangeInfo.RevisionInfo r ) { return ! ( r.is_edit ( ) ) ? ( 2 * ( ( r._number ( ) ) - 1 ) ) + 1 : 2 * editParent ; }
Source:
public com.google.gerrit.server.change.Description getDescription ( com.google.gerrit.server.change.ChangeResource rsrc ) { return new com.google.gerrit.extensions.webui.UiAction.Description ( ) . setLabel ( "Unmute" ) . setTitle ( "Unmute the change" ) . setVisible ( ( ( ! ( rsrc.isUserOwner ( ) ) ) && ( isUnMuteable ( rsrc.getChange ( ) ) ) ) ) ; }

Target:
public com.google.gerrit.extensions.restapi.Response < java.lang.String > apply ( com.google.gerrit.server.change.ChangeResource rsrc , com.google.gerrit.server.change.Unmute.Input input ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.StarredChangesUtil.IllegalLabelException , com.google.gwtorm.server.OrmException { if ( ( rsrc.isUserOwner ( ) ) || ( ! ( isMuted ( rsrc ) ) ) ) { return com.google.gerrit.extensions.restapi.Response.ok ( "" ) ; } stars.unmute ( rsrc ) ; return com.google.gerrit.extensions.restapi.Response.ok ( "" ) ; }
Source:
public void moveChange_fullRef ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; com.google.gerrit.reviewdb.client.Branch.NameKey newBranch = new com.google.gerrit.reviewdb.client.Branch.NameKey ( r.getChange ( ) . change ( ) . getProject ( ) , "moveTest" ) ; createBranch ( newBranch ) ; move ( r.getChangeId ( ) , newBranch.get ( ) ) ; com.google.common.truth.Truth.assertThat ( r.getChange ( ) . change ( ) . getDest ( ) ) . isEqualTo ( newBranch ) ; }

Target:
public void moveChangeWithFullRef ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; com.google.gerrit.reviewdb.client.Branch.NameKey newBranch = new com.google.gerrit.reviewdb.client.Branch.NameKey ( r.getChange ( ) . change ( ) . getProject ( ) , "moveTest" ) ; createBranch ( newBranch ) ; move ( r.getChangeId ( ) , newBranch.get ( ) ) ; com.google.common.truth.Truth.assertThat ( r.getChange ( ) . change ( ) . getDest ( ) ) . isEqualTo ( newBranch ) ; }
Source:
public void testMIXED_FullyConfiguredUser ( ) { setFrom ( "MIXED" ) ; final java.lang.String name = "A U. Thor" ; final java.lang.String email = "a.u.thor@test.example.com" ; final com.google.gerrit.reviewdb.client.Account.Id user = user ( name , email ) ; org.easymock.EasyMock.replay ( accountCache ) ; final com.google.gerrit.server.mail.Address r = create ( ) . from ( user ) ; org.junit.Assert.assertNotNull ( r ) ; org.junit.Assert.assertEquals ( ( name + " (Code Review)" ) , r.name ) ; org.junit.Assert.assertEquals ( ident.getEmailAddress ( ) , r.email ) ; org.easymock.EasyMock.verify ( accountCache ) ; }

Target:
public void testMIXED_NullUser ( ) { setFrom ( "MIXED" ) ; org.easymock.EasyMock.replay ( accountCache ) ; final com.google.gerrit.server.mail.Address r = create ( ) . from ( null ) ; com.google.common.truth.Truth.assertThat ( r ) . isNotNull ( ) ; com.google.common.truth.Truth.assertThat ( r.name ) . isEqualTo ( ident.getName ( ) ) ; com.google.common.truth.Truth.assertThat ( r.email ) . isEqualTo ( ident.getEmailAddress ( ) ) ; org.easymock.EasyMock.verify ( accountCache ) ; }
Source:
public void run ( ) { skipManager.removeAll ( ) ; chunkManager.reset ( ) ; diffTable.sidePanel.clearDiffGutters ( ) ; setShowIntraline ( prefs.intralineDifference ( ) ) ; render ( diff ) ; skipManager.render ( prefs.context ( ) , diff ) ; }

Target:
public void run ( ) { skipManager.removeAll ( ) ; chunkManager.reset ( ) ; diffTable.overview.clearDiffGutters ( ) ; setShowIntraline ( prefs.intralineDifference ( ) ) ; render ( diff ) ; skipManager.render ( prefs.context ( ) , diff ) ; }
Source:
public void onSend ( ) { java.lang.String topic = newTopic.getText ( ) ; com.google.gerrit.client.changes.ChangeApi.topic ( change.getId ( ) . get ( ) , topic , getMessageText ( ) , new com.google.gerrit.client.rpc.GerritCallback < java.lang.String > ( ) { @ java.lang.Override public void onSuccess ( java.lang.String result ) { sent = true ; com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( change.getId ( ) ) ) ; hide ( ) ; } @ java.lang.Override public void onFailure ( final java.lang.Throwable caught ) { enableButtons ( true ) ; super . onFailure ( caught ) ; } } ) ; }

Target:
private void doTopicEdit ( ) { java.lang.String topic = newTopic.getText ( ) ; com.google.gerrit.client.changes.ChangeApi.topic ( change.getId ( ) . get ( ) , topic , getMessageText ( ) , new com.google.gerrit.client.rpc.GerritCallback < java.lang.String > ( ) { @ java.lang.Override public void onSuccess ( java.lang.String result ) { sent = true ; com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( change.getId ( ) ) ) ; hide ( ) ; } @ java.lang.Override public void onFailure ( final java.lang.Throwable caught ) { enableButtons ( true ) ; super . onFailure ( caught ) ; } } ) ; }
Source:
private org.apache.lucene.index.Term intTerm ( java.lang.String name , int value ) { org.apache.lucene.util.BytesRef bytes = new org.apache.lucene.util.BytesRef ( org.apache.lucene.util.NumericUtils.BUF_SIZE_INT ) ; org.apache.lucene.util.NumericUtils.intToPrefixCodedBytes ( value , 0 , bytes ) ; return new org.apache.lucene.index.Term ( name , bytes ) ; }

Target:
private static org.apache.lucene.index.IndexWriterConfig getIndexWriterConfig ( org.eclipse.jgit.lib.Config cfg , java.lang.String name ) { org.apache.lucene.index.IndexWriterConfig writerConfig = new org.apache.lucene.index.IndexWriterConfig ( com.google.gerrit.lucene.LuceneChangeIndex.LUCENE_VERSION , new org.apache.lucene.analysis.standard.StandardAnalyzer ( com.google.gerrit.lucene.LuceneChangeIndex.LUCENE_VERSION ) ) ; writerConfig.setOpenMode ( OpenMode.CREATE_OR_APPEND ) ; double m = 1 << 20 ; writerConfig.setRAMBufferSizeMB ( ( ( cfg.getLong ( "index" , name , "ramBufferSize" , ( ( long ) ( ( org.apache.lucene.index.IndexWriterConfig.DEFAULT_RAM_BUFFER_SIZE_MB ) * m ) ) ) ) / m ) ) ; writerConfig.setMaxBufferedDocs ( cfg.getInt ( "index" , name , "maxBufferedDocs" , IndexWriterConfig.DEFAULT_MAX_BUFFERED_DOCS ) ) ; return writerConfig ; }
Source:
protected void populate ( final int row , final com.google.gerrit.reviewdb.client.Project k ) { table.setWidget ( row , 1 , new com.google.gerrit.client.ui.Hyperlink ( k.getName ( ) , link ( k ) ) ) ; table.setText ( row , 2 , k.getDescription ( ) ) ; setRowItem ( row , k ) ; }

Target:
private java.lang.String link ( final com.google.gerrit.client.projects.ProjectInfo item ) { return com.google.gerrit.client.Dispatcher.toProjectAdmin ( item.name_key ( ) , ProjectScreen.INFO ) ; }
Source:
protected void bccWatches ( com.google.gerrit.reviewdb.client.AccountProjectWatch.NotifyType type ) { try { com.google.gerrit.server.mail.ChangeEmail.Watchers matching = getWatches ( type ) ; for ( com.google.gerrit.reviewdb.client.Account.Id user : matching.accounts ) { add ( RecipientType.BCC , user ) ; } for ( com.google.gerrit.server.mail.Address addr : matching.emails ) { add ( RecipientType.BCC , addr ) ; } } catch ( com.google.gwtorm.server.OrmException err ) { com.google.gerrit.server.mail.ChangeEmail.log.warn ( ( "Cannot BCC watchers for " + type ) , err ) ; } }

Target:
protected void add ( com.google.gerrit.server.mail.RecipientType type , com.google.gerrit.server.mail.ChangeEmail.Watchers.List list ) { for ( com.google.gerrit.reviewdb.client.Account.Id user : list.accounts ) { add ( type , user ) ; } for ( com.google.gerrit.server.mail.Address addr : list.emails ) { add ( type , addr ) ; } }
Source:
protected void doGet ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse rsp ) { if ( healthy ) { rsp.setStatus ( javax.servlet.http.HttpServletResponse.SC_NO_CONTENT ) ; } else { try { rsp.sendError ( javax.servlet.http.HttpServletResponse.SC_SERVICE_UNAVAILABLE ) ; } catch ( java.io.IOException e ) { com.ericsson.gerrit.plugins.highavailability.health.HealthServlet.log.error ( "Failed to send error response" , e ) ; } } }

Target:
protected void doGet ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse rsp ) { if ( healthy ) { rsp.setStatus ( javax.servlet.http.HttpServletResponse.SC_NO_CONTENT ) ; } else { try { rsp.sendError ( javax.servlet.http.HttpServletResponse.SC_SERVICE_UNAVAILABLE ) ; } catch ( java.io.IOException e ) { rsp.setStatus ( javax.servlet.http.HttpServletResponse.SC_INTERNAL_SERVER_ERROR ) ; com.ericsson.gerrit.plugins.highavailability.health.HealthServlet.log.error ( "Failed to send error response" , e ) ; } } }
Source:
public void mergeByOtherNotifyOwnerReviewers ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS , com.google.gerrit.server.account.WatchConfig.NotifyType.SUBMITTED_CHANGES ) ; merge ( sc.changeId , other , com.google.gerrit.extensions.api.changes.NotifyHandling.OWNER_REVIEWERS ) ; assertThat ( sender ) . sent ( "merged" , sc ) . to ( sc.owner ) . cc ( sc.reviewer , sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . notTo ( sc.starrer ) . notTo ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS , com.google.gerrit.server.account.WatchConfig.NotifyType.SUBMITTED_CHANGES ) ; }

Target:
public void mergeByOtherNotifyOwnerReviewers ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageChange ( ) ; merge ( sc.changeId , other , com.google.gerrit.extensions.api.changes.NotifyHandling.OWNER_REVIEWERS ) ; assertThat ( sender ) . sent ( "merged" , sc ) . to ( sc.owner ) . cc ( sc.reviewer , sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . noOneElse ( ) ; }
Source:
public void setEnabled ( final boolean on ) { for ( com.google.gwt.user.client.ui.Widget w : ( ( com.google.gwt.user.client.ui.HasWidgets ) ( getWidget ( ) ) ) ) { if ( w instanceof com.google.gwt.user.client.ui.FocusWidget ) { ( ( com.google.gwt.user.client.ui.FocusWidget ) ( w ) ) . setEnabled ( on ) ; } } toggleEnabledStatus ( on ) ; }

Target:
public void setEnabled ( final boolean on ) { if ( on ) { ( setEnabledCounter ) ++ ; } else { ( setEnabledCounter ) -- ; } if ( ( on && ( ( setEnabledCounter ) == 0 ) ) || ( ! on ) ) { for ( com.google.gwt.user.client.ui.Widget w : ( ( com.google.gwt.user.client.ui.HasWidgets ) ( getWidget ( ) ) ) ) { if ( w instanceof com.google.gwt.user.client.ui.FocusWidget ) { ( ( com.google.gwt.user.client.ui.FocusWidget ) ( w ) ) . setEnabled ( on ) ; } } toggleEnabledStatus ( on ) ; } }
Source:
protected void configure ( ) { listener ( ) . to ( LocalDiskRepositoryManager.Lifecycle.class ) ; }

Target:
protected void configure ( ) { install ( new com.google.gerrit.server.schema.SchemaVersion.Module ( ) ) ; bind ( org.eclipse.jgit.lib.PersonIdent.class ) . annotatedWith ( com.google.gerrit.server.GerritPersonIdent.class ) . toProvider ( com.google.gerrit.server.GerritPersonIdentProvider.class ) ; bind ( com.google.gerrit.server.config.AllProjectsName.class ) . toProvider ( com.google.gerrit.server.config.AllProjectsNameProvider.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; bind ( java.lang.String.class ) . annotatedWith ( com.google.gerrit.server.config.AnonymousCowardName.class ) . toProvider ( com.google.gerrit.server.config.AnonymousCowardNameProvider.class ) ; }
Source:
private static java.lang.String guessName ( com.google.gerrit.client.changes.ChangeList list ) { for ( com.google.gerrit.client.changes.ChangeInfo change : list.asList ( ) ) { if ( ( ( change.owner ( ) ) != null ) && ( ( change.owner ( ) . name ( ) ) != null ) ) { return change.owner ( ) . name ( ) ; } } return null ; }

Target:
private static java.lang.String guessName ( com.google.gerrit.client.changes.ChangeList list ) { for ( com.google.gerrit.client.changes.ChangeInfo change : com.google.gerrit.client.rpc.Natives.asList ( list ) ) { if ( ( ( change.owner ( ) ) != null ) && ( ( change.owner ( ) . name ( ) ) != null ) ) { return change.owner ( ) . name ( ) ; } } return null ; }
Source:
public void testCreateGroup ( ) throws java.lang.Exception { java.lang.String newGroupName = name ( "newGroup" ) ; com.google.gerrit.acceptance.RestResponse r = adminSession.put ( ( "/groups/" + newGroupName ) ) ; com.google.gerrit.extensions.common.GroupInfo g = newGson ( ) . fromJson ( r.getReader ( ) , com.google.gerrit.extensions.common.GroupInfo.class ) ; com.google.common.truth.Truth.assertThat ( g.name ) . isEqualTo ( newGroupName ) ; com.google.gerrit.reviewdb.client.AccountGroup group = groupCache.get ( new com.google.gerrit.reviewdb.client.AccountGroup.NameKey ( newGroupName ) ) ; com.google.common.truth.Truth.assertThat ( group ) . isNotNull ( ) ; com.google.gerrit.acceptance.api.group.GroupAssert.assertGroupInfo ( group , g ) ; }

Target:
public void testCreateGroup ( ) throws java.lang.Exception { java.lang.String newGroupName = name ( "newGroup" ) ; com.google.gerrit.extensions.common.GroupInfo g = gApi.groups ( ) . create ( newGroupName ) . get ( ) ; com.google.gerrit.acceptance.api.group.GroupAssert.assertGroupInfo ( getFromCache ( newGroupName ) , g ) ; }
Source:
private org.eclipse.jgit.lib.ObjectId commit ( final org.eclipse.jgit.merge.Merger m , final org.eclipse.jgit.lib.CommitBuilder mergeCommit ) throws java.io.IOException , java.io.UnsupportedEncodingException { org.eclipse.jgit.lib.ObjectInserter oi = m.getObjectInserter ( ) ; try { org.eclipse.jgit.lib.ObjectId id = oi.insert ( mergeCommit ) ; oi.flush ( ) ; return id ; } finally { oi.release ( ) ; } }

Target:
private org.eclipse.jgit.lib.ObjectId commit ( org.eclipse.jgit.lib.CommitBuilder mergeCommit ) throws java.io.IOException , java.io.UnsupportedEncodingException { org.eclipse.jgit.lib.ObjectId id = inserter.insert ( mergeCommit ) ; inserter.flush ( ) ; return id ; }
Source:
public void sendErrorThrowsIOException ( ) throws java.lang.Exception { rsp.sendError ( javax.servlet.http.HttpServletResponse.SC_NOT_FOUND , "Error trying to find a change \n" ) ; org.easymock.EasyMock.expectLastCall ( ) . andThrow ( new java.io.IOException ( "someError" ) ) ; setupPostMocks ( com.ericsson.gerrit.plugins.syncindex.SyncIndexRestApiServletTest.CHANGE_EXISTS , com.ericsson.gerrit.plugins.syncindex.SyncIndexRestApiServletTest.THROW_ORM_EXCEPTION ) ; verifyPost ( ) ; }

Target:
public void sendErrorThrowsIOException ( ) throws java.lang.Exception { org.mockito.Mockito.doThrow ( new java.io.IOException ( "someError" ) ) . when ( rsp ) . sendError ( javax.servlet.http.HttpServletResponse.SC_NOT_FOUND , "Error trying to find a change \n" ) ; setupPostMocks ( com.ericsson.gerrit.plugins.syncindex.SyncIndexRestApiServletTest.CHANGE_EXISTS , com.ericsson.gerrit.plugins.syncindex.SyncIndexRestApiServletTest.THROW_ORM_EXCEPTION ) ; syncIndexRestApiServlet.doPost ( req , rsp ) ; org.mockito.Mockito.verify ( rsp ) . sendError ( javax.servlet.http.HttpServletResponse.SC_NOT_FOUND , "Error trying to find a change \n" ) ; org.mockito.Mockito.verifyZeroInteractions ( indexer ) ; }
Source:
private java.lang.String replaceInUrl ( java.lang.String url , java.lang.String replacement ) { if ( ( ( replacement == null ) || ( url == null ) ) || ( ( url.contains ( com.googlesource.gerrit.plugins.avatars.external.ExternalUrlAvatarProvider.USER_PLACEHOLDER ) ) == false ) ) { return url ; } return url.replace ( com.googlesource.gerrit.plugins.avatars.external.ExternalUrlAvatarProvider.USER_PLACEHOLDER , com.google.gerrit.extensions.restapi.Url.encode ( replacement ) ) ; }

Target:
public java.lang.String getChangeAvatarUrl ( com.google.gerrit.server.IdentifiedUser forUser ) { java.lang.String userReplacedAvatarChangeURL = replaceInUrl ( com.googlesource.gerrit.plugins.avatars.external.ExternalUrlAvatarProvider.USER_PLACEHOLDER , avatarChangeUrl , forUser.getUserName ( ) ) ; return replaceInUrl ( com.googlesource.gerrit.plugins.avatars.external.ExternalUrlAvatarProvider.EMAIL_PLACEHOLDER , userReplacedAvatarChangeURL , forUser.getAccount ( ) . getPreferredEmail ( ) ) ; }
Source:
private java.util.Set < org.eclipse.jgit.revwalk.RevCommit > getAlreadyAccepted ( org.eclipse.jgit.lib.Repository repo , org.eclipse.jgit.revwalk.RevWalk rw ) throws com.google.gerrit.server.git.IntegrationException { try { java.util.Set < org.eclipse.jgit.revwalk.RevCommit > accepted = new java.util.HashSet < > ( ) ; com.google.gerrit.server.submit.SubmitDryRun.addCommits ( changeDataCache.getAlreadyAccepted ( repo ) , rw , accepted ) ; org.eclipse.jgit.lib.ObjectId tip = changeDataCache.getTestAgainst ( ) ; if ( tip != null ) { accepted.add ( rw.parseCommit ( tip ) ) ; } return accepted ; } catch ( com.google.gwtorm.server.OrmException | java.io.IOException e ) { throw new com.google.gerrit.server.git.IntegrationException ( "Failed to determine already accepted commits." , e ) ; } }

Target:
private java.util.Set < org.eclipse.jgit.revwalk.RevCommit > getAlreadyAccepted ( org.eclipse.jgit.lib.Repository repo , org.eclipse.jgit.revwalk.RevWalk rw ) throws com.google.gerrit.server.submit.IntegrationException { try { java.util.Set < org.eclipse.jgit.revwalk.RevCommit > accepted = new java.util.HashSet < > ( ) ; com.google.gerrit.server.submit.SubmitDryRun.addCommits ( changeDataCache.getAlreadyAccepted ( repo ) , rw , accepted ) ; org.eclipse.jgit.lib.ObjectId tip = changeDataCache.getTestAgainst ( ) ; if ( tip != null ) { accepted.add ( rw.parseCommit ( tip ) ) ; } return accepted ; } catch ( com.google.gwtorm.server.OrmException | java.io.IOException e ) { throw new com.google.gerrit.server.submit.IntegrationException ( "Failed to determine already accepted commits." , e ) ; } }
Source:
public com.google.gerrit.testutil.InMemoryDatabase create ( ) throws com.google.gwtorm.server.OrmException { if ( ! ( created ) ) { created = true ; try ( com.google.gerrit.reviewdb.server.ReviewDb c = open ( ) ) { schemaCreator.create ( c ) ; } catch ( java.io.IOException | org.eclipse.jgit.errors.ConfigInvalidException e ) { throw new com.google.gwtorm.server.OrmException ( "Cannot create in-memory database" , e ) ; } } return this ; }

Target:
public com.google.gerrit.testing.InMemoryDatabase create ( ) throws com.google.gwtorm.server.OrmException { if ( ! ( created ) ) { created = true ; try ( com.google.gerrit.reviewdb.server.ReviewDb c = open ( ) ) { schemaCreator.create ( c ) ; } catch ( java.io.IOException | org.eclipse.jgit.errors.ConfigInvalidException e ) { throw new com.google.gwtorm.server.OrmException ( "Cannot create in-memory database" , e ) ; } } return this ; }
Source:
public static void createTableIfNotExists ( java.lang.String url ) throws com.google.gwtorm.server.OrmException { try ( java.sql.Connection con = java.sql.DriverManager.getConnection ( url ) ; java.sql.Statement stmt = con.createStatement ( ) ) { stmt.executeUpdate ( ( "CREATE TABLE IF NOT EXISTS ACCOUNT_PATCH_REVIEWS (" + ( ( ( ( ( ( "ACCOUNT_ID INTEGER DEFAULT 0 NOT NULL, " + "CHANGE_ID INTEGER DEFAULT 0 NOT NULL, " ) + "PATCH_SET_ID INTEGER DEFAULT 0 NOT NULL, " ) + "FILE_NAME VARCHAR(255) DEFAULT '' NOT NULL, " ) + "CONSTRAINT PRIMARY_KEY_ACCOUNT_PATCH_REVIEWS " ) + "PRIMARY KEY (ACCOUNT_ID, CHANGE_ID, PATCH_SET_ID, FILE_NAME)" ) + ")" ) ) ) ; } catch ( java.sql.SQLException e ) { throw com.google.gerrit.server.schema.H2AccountPatchReviewStore.convertError ( "create" , e ) ; } }

Target:
private static void doCreateTable ( java.sql.Statement stmt ) throws java.sql.SQLException { stmt.executeUpdate ( ( "CREATE TABLE IF NOT EXISTS ACCOUNT_PATCH_REVIEWS (" + ( ( ( ( ( ( "ACCOUNT_ID INTEGER DEFAULT 0 NOT NULL, " + "CHANGE_ID INTEGER DEFAULT 0 NOT NULL, " ) + "PATCH_SET_ID INTEGER DEFAULT 0 NOT NULL, " ) + "FILE_NAME VARCHAR(255) DEFAULT '' NOT NULL, " ) + "CONSTRAINT PRIMARY_KEY_ACCOUNT_PATCH_REVIEWS " ) + "PRIMARY KEY (ACCOUNT_ID, CHANGE_ID, PATCH_SET_ID, FILE_NAME)" ) + ")" ) ) ) ; }
Source:
public void onSuccess ( final com.google.gerrit.common.data.HostPageData result ) { com.google.gerrit.client.Gerrit.myConfig = result.config ; if ( ( result.account ) != null ) { com.google.gerrit.client.Gerrit.myAccount = result.account ; } if ( ( result.accountDiffPref ) != null ) { com.google.gerrit.client.Gerrit.myAccountDiffPref = result.accountDiffPref ; } onModuleLoad2 ( ) ; }

Target:
public void onSuccess ( final com.google.gerrit.common.data.HostPageData result ) { com.google.gerrit.client.Gerrit.myConfig = result.config ; com.google.gerrit.client.Gerrit.myTheme = result.theme ; if ( ( result.account ) != null ) { com.google.gerrit.client.Gerrit.myAccount = result.account ; } if ( ( result.accountDiffPref ) != null ) { com.google.gerrit.client.Gerrit.myAccountDiffPref = result.accountDiffPref ; } onModuleLoad2 ( ) ; }
Source:
public void onSuccess ( com.google.gerrit.common.data.ProjectAccess access ) { enable ( true ) ; commitMessage.setText ( "" ) ; displayReadOnly ( access ) ; }

Target:
public void onSuccess ( com.google.gerrit.common.data.ProjectAccess newAccess ) { enable ( true ) ; commitMessage.setText ( "" ) ; error.clear ( ) ; final java.util.Set < java.lang.String > diffs = getDiffs ( access , newAccess ) ; if ( diffs.isEmpty ( ) ) { displayReadOnly ( newAccess ) ; } else { error.add ( new com.google.gwt.user.client.ui.Label ( Gerrit.C.projectAccessError ( ) ) ) ; for ( final java.lang.String diff : diffs ) { error.add ( new com.google.gwt.user.client.ui.Label ( diff ) ) ; } } }
Source:
public void run ( ) { java.lang.String mode = ( ( m != null ) && ( ! ( m.isEmpty ( ) ) ) ) ? m : null ; view.getCmFromSide ( DisplaySide.A ) . setOption ( "mode" , mode ) ; view.getCmFromSide ( DisplaySide.B ) . setOption ( "mode" , mode ) ; }

Target:
public void run ( ) { int v = prefs.tabSize ( ) ; view.getCmFromSide ( DisplaySide.A ) . setOption ( "tabSize" , v ) ; view.getCmFromSide ( DisplaySide.B ) . setOption ( "tabSize" , v ) ; }
Source:
protected void alias ( final com.google.gerrit.sshd.CommandName parent , final java.lang.String name , final java.lang.Class < ? extends com.google.gerrit.sshd.BaseCommand > clazz ) { com.google.gerrit.sshd.CommandMetaData meta = ( ( com.google.gerrit.sshd.CommandMetaData ) ( clazz.getAnnotation ( com.google.gerrit.sshd.CommandMetaData.class ) ) ) ; if ( meta == null ) { throw new java.lang.IllegalStateException ( "no CommandMetaData annotation found" ) ; } bind ( com.google.gerrit.sshd.Commands.key ( parent , name , meta.descr ( ) ) ) . to ( clazz ) ; }

Target:
protected void alias ( final com.google.gerrit.sshd.CommandName parent , final java.lang.String name , final java.lang.Class < ? extends com.google.gerrit.sshd.BaseCommand > clazz ) { com.google.gerrit.sshd.CommandMetaData meta = ( ( com.google.gerrit.sshd.CommandMetaData ) ( clazz.getAnnotation ( com.google.gerrit.sshd.CommandMetaData.class ) ) ) ; if ( meta == null ) { throw new java.lang.IllegalStateException ( "no CommandMetaData annotation found" ) ; } bind ( com.google.gerrit.sshd.Commands.key ( parent , name , com.google.gerrit.sshd.CommandModule.description ( meta ) ) ) . to ( clazz ) ; }
Source:
private void configureRequestScope ( ) { bind ( SshScope.Context.class ) . toProvider ( SshScope.ContextProvider.class ) ; bind ( com.google.gerrit.sshd.SshSession.class ) . toProvider ( SshScope.SshSessionProvider.class ) . in ( SshScope.REQUEST ) ; bind ( java.net.SocketAddress.class ) . annotatedWith ( com.google.gerrit.server.RemotePeer.class ) . toProvider ( com.google.gerrit.sshd.SshRemotePeerProvider.class ) . in ( SshScope.REQUEST ) ; bind ( WorkQueue.Executor.class ) . annotatedWith ( com.google.gerrit.sshd.CommandExecutor.class ) . toProvider ( com.google.gerrit.sshd.CommandExecutorProvider.class ) . in ( SshScope.REQUEST ) ; install ( new com.google.gerrit.server.config.GerritRequestModule ( ) ) ; }

Target:
private void configureRequestScope ( ) { bind ( SshScope.Context.class ) . toProvider ( SshScope.ContextProvider.class ) ; bind ( com.google.gerrit.sshd.SshSession.class ) . toProvider ( SshScope.SshSessionProvider.class ) . in ( SshScope.REQUEST ) ; bind ( java.net.SocketAddress.class ) . annotatedWith ( com.google.gerrit.server.RemotePeer.class ) . toProvider ( com.google.gerrit.sshd.SshRemotePeerProvider.class ) . in ( SshScope.REQUEST ) ; bind ( java.util.concurrent.ScheduledThreadPoolExecutor.class ) . annotatedWith ( com.google.gerrit.sshd.CommandExecutor.class ) . toProvider ( com.google.gerrit.sshd.CommandExecutorProvider.class ) . in ( SshScope.REQUEST ) ; install ( new com.google.gerrit.server.config.GerritRequestModule ( ) ) ; }
Source:
public void delete ( com.google.gerrit.server.query.change.ChangeData cd ) throws java.io.IOException { java.lang.String id = cd.getId ( ) . toString ( ) ; try { if ( cd.change ( ) . getStatus ( ) . isOpen ( ) ) { openIndex.deleteById ( id ) ; commit ( openIndex ) ; } else { closedIndex.deleteById ( id ) ; commit ( closedIndex ) ; } } catch ( com.google.gwtorm.server.OrmException | org.apache.solr.client.solrj.SolrServerException e ) { throw new java.io.IOException ( e ) ; } }

Target:
public void delete ( int id ) throws java.io.IOException { java.lang.String idString = java.lang.Integer.toString ( id ) ; delete ( idString , openIndex ) ; delete ( idString , closedIndex ) ; }
Source:
public void onSuccess ( com.google.gerrit.client.diff.DiffInfo diffInfo ) { if ( ( id == ( reloadVersionId ) ) && ( isAttached ( ) ) ) { diff = diffInfo ; operation ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { skipManager.removeAll ( ) ; clearMarkers ( ) ; diffTable.sidePanel.clearDiffGutters ( ) ; setShowIntraline ( prefs.intralineDifference ( ) ) ; render ( diff ) ; skipManager.render ( prefs.context ( ) , diff ) ; } } ) ; } }

Target:
public void onSuccess ( com.google.gerrit.client.diff.DiffInfo diffInfo ) { if ( ( id == ( reloadVersionId ) ) && ( isAttached ( ) ) ) { diff = diffInfo ; operation ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { skipManager.removeAll ( ) ; chunkManager.reset ( ) ; diffTable.sidePanel.clearDiffGutters ( ) ; setShowIntraline ( prefs.intralineDifference ( ) ) ; render ( diff ) ; skipManager.render ( prefs.context ( ) , diff ) ; } } ) ; } }
Source:
protected void configureServlets ( ) { rpc ( com.google.gerrit.httpd.auth.openid.OpenIdServiceImpl.class ) ; }

Target:
protected void configureServlets ( ) { serve ( "/login/*" ) . with ( com.google.gerrit.httpd.auth.openid.LoginForm.class ) ; serve ( ( "/" + ( OpenIdServiceImpl.RETURN_URL ) ) ) . with ( com.google.gerrit.httpd.auth.openid.OpenIdLoginServlet.class ) ; serve ( ( "/" + ( XrdsServlet.LOCATION ) ) ) . with ( com.google.gerrit.httpd.auth.openid.XrdsServlet.class ) ; filter ( "/" ) . through ( com.google.gerrit.httpd.auth.openid.XrdsFilter.class ) ; bind ( com.google.gerrit.httpd.auth.openid.OpenIdServiceImpl.class ) ; }