auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testOnlyVisibleGroupsReturned ( ) throws com.google.gwtorm.server.OrmException , com.jcraft.jsch.JSchException , java.io.IOException { java.util.Set < java.lang.String > expectedGroups = com.google.common.collect.Sets.newHashSet ( ) ; expectedGroups.add ( "Anonymous Users" ) ; expectedGroups.add ( "Registered Users" ) ; com.google.gerrit.acceptance.TestAccount user = accounts.create ( "user" , "user@example.com" , "User" ) ; com.google.gerrit.acceptance.RestResponse r = new com.google.gerrit.acceptance.RestSession ( server , user ) . get ( "/groups/" ) ; java.util.Map < java.lang.String , com.google.gerrit.acceptance.rest.group.GroupInfo > result = new com.google.gson.Gson ( ) . fromJson ( r.getReader ( ) , new com.google.gson.reflect.TypeToken < java.util.Map < java.lang.String , com.google.gerrit.acceptance.rest.group.GroupInfo > > ( ) { } . getType ( ) ) ; com.google.gerrit.acceptance.rest.group.GroupAssert.assertGroups ( expectedGroups , result.keySet ( ) ) ; }

Target:
public void testOnlyVisibleGroupsReturned ( ) throws com.google.gwtorm.server.OrmException , com.jcraft.jsch.JSchException , java.io.IOException { com.google.gerrit.acceptance.TestAccount user = accounts.create ( "user" , "user@example.com" , "User" ) ; com.google.gerrit.acceptance.RestSession userSession = new com.google.gerrit.acceptance.RestSession ( server , user ) ; java.lang.String newGroupName = "newGroup" ; com.google.gerrit.acceptance.rest.group.GroupInput in = new com.google.gerrit.acceptance.rest.group.GroupInput ( ) ; in.description = "a hidden group" ; in.visible_to_all = false ; in.owner_id = groupCache.get ( new com.google.gerrit.reviewdb.client.AccountGroup.NameKey ( "Administrators" ) ) . getGroupUUID ( ) . get ( ) ; session.put ( ( "/groups/" + newGroupName ) , in ) . consume ( ) ; java.util.Set < java.lang.String > expectedGroups = com.google.common.collect.Sets.newHashSet ( newGroupName ) ; com.google.gerrit.acceptance.RestResponse r = userSession.get ( "/groups/" ) ; java.util.Map < java.lang.String , com.google.gerrit.acceptance.rest.group.GroupInfo > result = new com.google.gson.Gson ( ) . fromJson ( r.getReader ( ) , new com.google.gson.reflect.TypeToken < java.util.Map < java.lang.String , com.google.gerrit.acceptance.rest.group.GroupInfo > > ( ) { } . getType ( ) ) ; org.junit.Assert.assertTrue ( "no groups visible" , result.isEmpty ( ) ) ; org.junit.Assert.assertEquals ( HttpStatus.SC_CREATED , session.put ( java.lang.String.format ( "/groups/%s/members/%s" , newGroupName , user.username ) ) . getStatusCode ( ) ) ; r = userSession.get ( "/groups/" ) ; result = new com.google.gson.Gson ( ) . fromJson ( r.getReader ( ) , new com.google.gson.reflect.TypeToken < java.util.Map < java.lang.String , com.google.gerrit.acceptance.rest.group.GroupInfo > > ( ) { } . getType ( ) ) ; com.google.gerrit.acceptance.rest.group.GroupAssert.assertGroups ( expectedGroups , result.keySet ( ) ) ; }
Source:
private java.util.HashMap < java.lang.String , java.lang.String > getGitblitInitParams ( ) { java.util.HashMap < java.lang.String , java.lang.String > props = new java.util.HashMap < java.lang.String , java.lang.String > ( ) ; props.put ( "filterMappingUrlPattern" , "/*" ) ; props.put ( "ignorePaths" , "pages/,feed/" ) ; return props ; }

Target:
private java.util.HashMap < java.lang.String , java.lang.String > getGitblitInitParams ( ) { java.util.HashMap < java.lang.String , java.lang.String > props = new java.util.HashMap < java.lang.String , java.lang.String > ( ) ; props.put ( "applicationClassName" , com.googlesource.gerrit.plugins.gitblit.app.GerritToGitBlitWebApp.class . getName ( ) ) ; props.put ( "filterMappingUrlPattern" , "/*" ) ; props.put ( "ignorePaths" , "pages/,feed/" ) ; return props ; }
Source:
public boolean isIgnoreWhitespace ( ) { return ( diffPrefs.getIgnoreWhitespace ( ) ) != ( com.google.gerrit.reviewdb.client.AccountDiffPreference.Whitespace.IGNORE_NONE ) ; }

Target:
public java.lang.Iterable < com.google.gerrit.prettify.common.EditList.Hunk > getHunks ( ) { int ctx = diffPrefs.context ; if ( ctx == ( com.google.gerrit.extensions.client.DiffPreferencesInfo.WHOLE_FILE_CONTEXT ) ) { ctx = java.lang.Math.max ( a.size ( ) , b.size ( ) ) ; } return new com.google.gerrit.prettify.common.EditList ( edits , ctx , a.size ( ) , b.size ( ) ) . getHunks ( ) ; }
Source:
public void onOpen ( com.google.gwt.event.logical.shared.OpenEvent < com.google.gwt.user.client.ui.DisclosurePanel > event ) { if ( ! ( loaded ) ) { Util.DETAIL_SVC.includedInDetail ( changeId , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.common.data.IncludedInDetail > ( ) { @ java.lang.Override public void onSuccess ( final com.google.gerrit.common.data.IncludedInDetail result ) { loadTable ( result ) ; } } ) ; } }

Target:
private java.util.List < java.lang.String > toList ( com.google.gwt.core.client.JsArrayString in ) { java.util.List < java.lang.String > r = new java.util.ArrayList < java.lang.String > ( ) ; if ( in != null ) { for ( int i = 0 ; i < ( in.length ( ) ) ; i ++ ) { r.add ( in.get ( i ) ) ; } } return r ; }
Source:
public void testDiffAgainstEmptyCommit ( ) throws java.lang.Exception { org.eclipse.jgit.revwalk.RevCommit master = repo.branch ( "refs/heads/master" ) . commit ( ) . create ( ) ; com.google.gitiles.GitilesView view = getView ( "/repo/+diff/master^!" ) ; assertEquals ( Type.DIFF , view.getType ( ) ) ; assertEquals ( "master" , view.getRevision ( ) . getName ( ) ) ; assertEquals ( master , view.getRevision ( ) . getId ( ) ) ; assertEquals ( Revision.NULL , view.getOldRevision ( ) ) ; assertEquals ( "" , view.getPathPart ( ) ) ; }

Target:
public void diffAgainstEmptyCommit ( ) throws java.lang.Exception { org.eclipse.jgit.revwalk.RevCommit master = repo.branch ( "refs/heads/master" ) . commit ( ) . create ( ) ; com.google.gitiles.GitilesView view = getView ( "/repo/+diff/master^!" ) ; org.junit.Assert.assertEquals ( Type.DIFF , view.getType ( ) ) ; org.junit.Assert.assertEquals ( "master" , view.getRevision ( ) . getName ( ) ) ; org.junit.Assert.assertEquals ( master , view.getRevision ( ) . getId ( ) ) ; org.junit.Assert.assertEquals ( Revision.NULL , view.getOldRevision ( ) ) ; org.junit.Assert.assertEquals ( "" , view.getPathPart ( ) ) ; }
Source:
PatchSet.Id getRevision ( ) { return revision ; }

Target:
private void countParents ( com.google.gerrit.client.rpc.CallbackGroup cbg ) { com.google.gerrit.client.changes.ChangeApi.revision ( changeId.get ( ) , revision.getId ( ) ) . view ( "commit" ) . get ( cbg.add ( new com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.info.ChangeInfo.CommitInfo > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.info.ChangeInfo.CommitInfo info ) { parents = info.parents ( ) . length ( ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { parents = 0 ; } } ) ) ; }
Source:
protected void onLoad ( ) { super . onLoad ( ) ; Util.GROUP_SVC.visibleGroups ( new com.google.gerrit.client.rpc.ScreenLoadCallback < com.google.gerrit.common.data.GroupList > ( this ) { @ java.lang.Override protected void preDisplay ( com.google.gerrit.common.data.GroupList result ) { addPanel.setVisible ( result.isCanCreateGroup ( ) ) ; groups.display ( result.getGroups ( ) ) ; groups.finishDisplay ( ) ; } } ) ; }

Target:
public void onSuccess ( com.google.gerrit.client.account.AccountCapabilities ac ) { addPanel.setVisible ( ac.canPerform ( com.google.gerrit.common.data.GlobalCapability.CREATE_GROUP ) ) ; }
Source:
private void execute ( final java.lang.String sql ) throws java.sql.SQLException { final java.sql.Statement stmt = db.createStatement ( ) ; try { stmt.execute ( sql ) ; } finally { stmt.close ( ) ; } }

Target:
protected void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; java.lang.Class.forName ( com.mysql.jdbc.Driver.class . getName ( ) ) ; final java.lang.String host = "localhost" ; final java.lang.String database = "gwtorm" ; final java.lang.String user = "gwtorm" ; final java.lang.String pass = "gwtorm" ; final java.lang.String url = ( ( "jdbc:mysql://" + host ) + "/" ) + database ; db = java.sql.DriverManager.getConnection ( url , user , pass ) ; executor = new com.google.gwtorm.jdbc.JdbcExecutor ( db ) ; dialect = new com.google.gwtorm.schema.sql.DialectMySQL ( ) . refine ( db ) ; final java.util.Properties p = new java.util.Properties ( ) ; p.setProperty ( "driver" , com.mysql.jdbc.Driver.class . getName ( ) ) ; p.setProperty ( "url" , db.getMetaData ( ) . getURL ( ) ) ; p.setProperty ( "user" , user ) ; p.setProperty ( "password" , pass ) ; phoneBook = new com.google.gwtorm.jdbc.Database < com.google.gwtorm.data.PhoneBookDb > ( new com.google.gwtorm.jdbc.SimpleDataSource ( p ) , com.google.gwtorm.data.PhoneBookDb.class ) ; phoneBook2 = new com.google.gwtorm.jdbc.Database < com.google.gwtorm.data.PhoneBookDb2 > ( new com.google.gwtorm.jdbc.SimpleDataSource ( p ) , com.google.gwtorm.data.PhoneBookDb2.class ) ; drop ( "TABLE address_id" ) ; drop ( "TABLE addresses" ) ; drop ( "TABLE cnt" ) ; drop ( "TABLE foo" ) ; drop ( "TABLE people" ) ; }
Source:
public void upsertOneNotExisting ( ) throws com.google.gwtorm.client.OrmException , java.sql.SQLException { java.sql.PreparedStatement update = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.AbstractTestJdbcAccess.UPDATE ) ; java.sql.PreparedStatement insert = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.AbstractTestJdbcAccess.INSERT , 1 ) ; classUnderTest.upsert ( oneRow ) ; assertCorrectUpdating ( update , 1 ) ; assertCorrectUpdating ( insert , 1 ) ; }

Target:
public void upsertOneNotExisting ( ) throws com.google.gwtorm.server.OrmException , java.sql.SQLException { java.sql.PreparedStatement update = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.AbstractTestJdbcAccess.UPDATE ) ; java.sql.PreparedStatement insert = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.AbstractTestJdbcAccess.INSERT , 1 ) ; classUnderTest.upsert ( oneRow ) ; assertCorrectAttempting ( update , 1 ) ; assertCorrectUpdating ( insert , 1 ) ; }
Source:
private org.eclipse.jgit.lib.ObjectId getEditRev ( ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException , java.io.IOException { edit = editReader.byChange ( change ) ; if ( edit.isPresent ( ) ) { return edit.get ( ) . getRef ( ) . getObjectId ( ) ; } throw new com.google.gerrit.server.project.NoSuchChangeException ( change.getId ( ) ) ; }

Target:
private org.eclipse.jgit.lib.ObjectId getEditRev ( ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gwtorm.server.OrmException , java.io.IOException { edit = editReader.byChange ( change ) ; if ( edit.isPresent ( ) ) { return edit.get ( ) . getEditCommit ( ) ; } throw new com.google.gerrit.server.project.NoSuchChangeException ( change.getId ( ) ) ; }
Source:
public java.lang.String passwordForKey ( java.lang.String prompt , java.lang.String passwordKey ) { java.lang.String ov = getSecure ( passwordKey ) ; if ( ov != null ) { if ( ( ui.isBatch ( ) ) || ( ! ( ui.yesno ( false , "Change %s" , passwordKey ) ) ) ) { return ov ; } } final java.lang.String nv = ui.password ( "%s" , prompt ) ; if ( ! ( com.google.gerrit.pgm.init.api.Section.eq ( ov , nv ) ) ) { setSecure ( passwordKey , nv ) ; } return nv ; }

Target:
public java.lang.String passwordForKey ( java.lang.String prompt , java.lang.String passwordKey ) { java.lang.String ov = getSecure ( passwordKey ) ; if ( ov != null ) { if ( ( ui.isBatch ( ) ) || ( ! ( ui.yesno ( false , "Change %s" , passwordKey ) ) ) ) { return ov ; } } final java.lang.String nv = ui.password ( "%s" , prompt ) ; if ( ! ( java.util.Objects.equals ( ov , nv ) ) ) { setSecure ( passwordKey , nv ) ; } return nv ; }
Source:
public void run ( ) { metric.set ( trigger.get ( ) ) ; }

Target:
public < V > void newCallbackMetric ( java.lang.String name , java.lang.Class < V > valueClass , com.google.gerrit.metrics.Description desc , com.google.common.base.Supplier < V > trigger ) { com.google.gerrit.metrics.CallbackMetric0 < V > metric = newCallbackMetric ( name , valueClass , desc ) ; newTrigger ( metric , ( ) -> { metric.set ( trigger.get ( ) ) ; } ) ; }
Source:
private com.google.gerrit.acceptance.rest.account.AccountInfo GET_ONE ( java.lang.String endpoint ) throws java.io.IOException { com.google.gerrit.acceptance.RestResponse r = session.get ( endpoint ) ; org.junit.Assert.assertEquals ( HttpStatus.SC_OK , r.getStatusCode ( ) ) ; return new com.google.gson.Gson ( ) . fromJson ( r.getReader ( ) , new com.google.gson.reflect.TypeToken < com.google.gerrit.acceptance.rest.account.AccountInfo > ( ) { } . getType ( ) ) ; }

Target:
private com.google.gerrit.server.account.AccountInfo GET_ONE ( java.lang.String endpoint ) throws java.io.IOException { com.google.gerrit.acceptance.RestResponse r = session.get ( endpoint ) ; org.junit.Assert.assertEquals ( HttpStatus.SC_OK , r.getStatusCode ( ) ) ; return newGson ( ) . fromJson ( r.getReader ( ) , com.google.gerrit.server.account.AccountInfo.class ) ; }
Source:
private com.google.gerrit.reviewdb.client.AccountGroup newGroup ( com.google.gerrit.reviewdb.server.ReviewDb c , java.lang.String name ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.AccountGroup.UUID uuid = com.google.gerrit.server.account.GroupUUID.make ( name , serverUser ) ; return new com.google.gerrit.reviewdb.client.AccountGroup ( new com.google.gerrit.reviewdb.client.AccountGroup.NameKey ( name ) , new com.google.gerrit.reviewdb.client.AccountGroup.Id ( c.nextAccountGroupId ( ) ) , uuid , com.google.gerrit.common.TimeUtil.nowTs ( ) ) ; }

Target:
private com.google.gerrit.common.data.GroupReference createGroupReference ( java.lang.String name ) { com.google.gerrit.reviewdb.client.AccountGroup.UUID groupUuid = com.google.gerrit.server.account.GroupUUID.make ( name , serverUser ) ; return new com.google.gerrit.common.data.GroupReference ( groupUuid , name ) ; }
Source:
private void updateSuperProjects ( com.google.gerrit.server.git.SubmoduleOp subOp , java.util.Collection < com.google.gerrit.reviewdb.client.Branch.NameKey > branches ) { logDebug ( "Updating superprojects" ) ; try { subOp.updateSuperProjects ( db , branches , submissionId ) ; logDebug ( "Updating superprojects done" ) ; } catch ( com.google.gerrit.server.git.SubmoduleException e ) { logError ( ( "The gitlinks were not updated according to the " + "subscriptions" ) , e ) ; } }

Target:
private void updateSuperProjects ( java.util.Collection < com.google.gerrit.reviewdb.client.Branch.NameKey > branches ) { logDebug ( "Updating superprojects" ) ; com.google.gerrit.server.git.SubmoduleOp subOp = subOpProvider.get ( ) ; try { subOp.updateSuperProjects ( db , branches , submissionId , orm ) ; logDebug ( "Updating superprojects done" ) ; } catch ( com.google.gerrit.server.git.SubmoduleException e ) { logError ( ( "The gitlinks were not updated according to the " + "subscriptions" ) , e ) ; } }
Source:
public static synchronized void setClockStep ( long clockStep , java.util.concurrent.TimeUnit clockStepUnit ) { com.google.common.base.Preconditions.checkState ( ( ( com.google.gerrit.testutil.TestTimeUtil.clockMs ) != null ) , "call resetWithClockStep first" ) ; com.google.gerrit.testutil.TestTimeUtil.clockStepMs = java.util.concurrent.TimeUnit.MILLISECONDS.convert ( clockStep , clockStepUnit ) ; org.joda.time.DateTimeUtils.setCurrentMillisProvider ( new org.joda.time.DateTimeUtils.MillisProvider ( ) { @ java.lang.Override public long getMillis ( ) { return com.google.gerrit.testutil.TestTimeUtil.clockMs.getAndAdd ( com.google.gerrit.testutil.TestTimeUtil.clockStepMs ) ; } } ) ; }

Target:
public org.eclipse.jgit.storage.file.FileBasedConfig openSystemConfig ( org.eclipse.jgit.lib.Config parent , org.eclipse.jgit.util.FS fs ) { return defaultReader.openSystemConfig ( parent , fs ) ; }
Source:
public void createEditByDeletingExistingFileRest ( ) throws java.lang.Exception { adminSession.delete ( urlEditFile ( ) ) . assertNoContent ( ) ; com.google.common.base.Optional < com.google.gerrit.server.edit.ChangeEdit > edit = editUtil.byChange ( change ) ; exception.expect ( com.google.gerrit.extensions.restapi.ResourceNotFoundException.class ) ; fileUtil.getContent ( projectCache.get ( edit.get ( ) . getChange ( ) . getProject ( ) ) , org.eclipse.jgit.lib.ObjectId.fromString ( edit.get ( ) . getRevision ( ) . get ( ) ) , com.google.gerrit.acceptance.edit.ChangeEditIT.FILE_NAME ) ; }

Target:
public void createEditByDeletingExistingFileRest ( ) throws java.lang.Exception { adminRestSession.delete ( urlEditFile ( ) ) . assertNoContent ( ) ; com.google.common.base.Optional < com.google.gerrit.server.edit.ChangeEdit > edit = editUtil.byChange ( change ) ; exception.expect ( com.google.gerrit.extensions.restapi.ResourceNotFoundException.class ) ; fileUtil.getContent ( projectCache.get ( edit.get ( ) . getChange ( ) . getProject ( ) ) , org.eclipse.jgit.lib.ObjectId.fromString ( edit.get ( ) . getRevision ( ) . get ( ) ) , com.google.gerrit.acceptance.edit.ChangeEditIT.FILE_NAME ) ; }
Source:
private static void checkSchema ( com.google.gerrit.server.index.Schema < com.google.gerrit.server.query.change.ChangeData > schema ) { com.google.common.base.Preconditions.checkArgument ( schema.hasField ( ChangeField.REVIEWEDBY ) , "Schema %s missing field %s" , schema.getVersion ( ) , ChangeField.REVIEWEDBY.getName ( ) ) ; }

Target:
private static com.google.gerrit.server.index.FieldDef < com.google.gerrit.server.query.change.ChangeData , ? > getField ( com.google.gerrit.server.index.Schema < com.google.gerrit.server.query.change.ChangeData > schema ) { com.google.common.base.Optional < com.google.gerrit.server.index.FieldDef < com.google.gerrit.server.query.change.ChangeData , ? > > f = schema.getField ( com.google.gerrit.server.index.ChangeField.REVIEWEDBY , com.google.gerrit.server.index.ChangeField.LEGACY_REVIEWED ) ; com.google.common.base.Preconditions.checkState ( f.isPresent ( ) , "Schema %s missing field %s" , schema.getVersion ( ) , com.google.gerrit.server.index.ChangeField.REVIEWEDBY.getName ( ) ) ; return f.get ( ) ; }
Source:
protected void onLoad ( ) { super . onLoad ( ) ; java.lang.String who = ( mine ) ? "self" : ownerId.toString ( ) ; com.google.gerrit.client.changes.ChangeList.query ( new com.google.gerrit.client.rpc.ScreenLoadCallback < com.google.gwt.core.client.JsArray < com.google.gerrit.client.changes.ChangeList > > ( this ) { @ java.lang.Override protected void preDisplay ( com.google.gwt.core.client.JsArray < com.google.gerrit.client.changes.ChangeList > result ) { display ( result ) ; } } , ( "is:open owner:" + who ) , ( ( ( "is:open reviewer:" + who ) + " -owner:" ) + who ) , ( ( "is:closed owner:" + who ) + " -age:1w limit:10" ) ) ; }

Target:
protected void onLoad ( ) { super . onLoad ( ) ; java.lang.String who = ( mine ) ? "self" : ownerId.toString ( ) ; com.google.gerrit.client.changes.ChangeList.query ( new com.google.gerrit.client.rpc.ScreenLoadCallback < com.google.gwt.core.client.JsArray < com.google.gerrit.client.changes.ChangeList > > ( this ) { @ java.lang.Override protected void preDisplay ( com.google.gwt.core.client.JsArray < com.google.gerrit.client.changes.ChangeList > result ) { display ( result ) ; } } , ( "is:open owner:" + who ) , ( ( ( "is:open reviewer:" + who ) + " -owner:" ) + who ) , ( ( "is:closed owner:" + who ) + " -age:4w limit:10" ) ) ; }
Source:
private void merge ( com.google.gerrit.acceptance.PushOneCommit.Result r ) throws java.lang.Exception { revision ( r ) . review ( com.google.gerrit.extensions.api.changes.ReviewInput.approve ( ) ) ; revision ( r ) . submit ( ) ; try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( project ) ) { com.google.common.truth.Truth.assertThat ( repo.getRef ( "refs/heads/master" ) . getObjectId ( ) ) . isEqualTo ( r.getCommitId ( ) ) ; } }

Target:
public void failChangedLabelValueOnClosedChange ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; merge ( r ) ; exception.expect ( com.google.gerrit.extensions.restapi.ResourceConflictException.class ) ; exception.expectMessage ( "change is closed" ) ; revision ( r ) . review ( com.google.gerrit.extensions.api.changes.ReviewInput.reject ( ) ) ; }
Source:
private com.google.gerrit.client.ui.InlineHyperlink createLink ( java.lang.String label , com.google.gerrit.reviewdb.client.PatchSet.Id id ) { assert ( other ) != null ; if ( sideA ) { assert ( other.idActive ) != null ; } return new com.google.gerrit.client.ui.InlineHyperlink ( label , com.google.gerrit.client.Dispatcher.toPatchSideBySide2 ( ( sideA ? id : other.idActive ) , ( sideA ? other.idActive : id ) , path ) ) ; }

Target:
private com.google.gerrit.client.ui.InlineHyperlink createLink ( java.lang.String label , com.google.gerrit.reviewdb.client.PatchSet.Id id ) { assert ( other ) != null ; if ( sideA ) { assert ( other.idActive ) != null ; } return new com.google.gerrit.client.ui.InlineHyperlink ( label , com.google.gerrit.client.Dispatcher.toSideBySide ( ( sideA ? id : other.idActive ) , ( sideA ? other.idActive : id ) , path ) ) ; }
Source:
private void appendFileHeader ( final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder m , final java.lang.String line ) { openLine ( m ) ; padLineNumberForSideA ( m ) ; padLineNumberForSideB ( m ) ; m.openTd ( ) ; m.addStyleName ( Gerrit.RESOURCES.css ( ) . diffText ( ) ) ; m.addStyleName ( Gerrit.RESOURCES.css ( ) . diffTextFileHeader ( ) ) ; m.append ( line ) ; m.closeTd ( ) ; closeLine ( m ) ; }

Target:
private void appendFileHeader ( final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder m , final java.lang.String line ) { openLine ( m ) ; padLineNumberForSideA ( m ) ; padLineNumberForSideB ( m ) ; m.openTd ( ) ; m.setStyleName ( Gerrit.RESOURCES.css ( ) . fileLine ( ) ) ; m.addStyleName ( Gerrit.RESOURCES.css ( ) . diffText ( ) ) ; m.addStyleName ( Gerrit.RESOURCES.css ( ) . diffTextFileHeader ( ) ) ; m.append ( line ) ; m.closeTd ( ) ; closeLine ( m ) ; }
Source:
public com.google.gerrit.server.notedb.NoteDbUpdateManager stage ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Change.Id changeId ) throws com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException , java.io.IOException { db = com.google.gerrit.reviewdb.server.ReviewDbUtil.unwrapDb ( db ) ; com.google.gerrit.reviewdb.client.Change change = db.changes ( ) . get ( changeId ) ; if ( change == null ) { throw new com.google.gerrit.server.project.NoSuchChangeException ( changeId ) ; } com.google.gerrit.server.notedb.NoteDbUpdateManager manager = updateManagerFactory.create ( change.getProject ( ) ) ; buildUpdates ( manager , com.google.gerrit.server.notedb.ChangeBundle.fromReviewDb ( db , changeId ) ) ; manager.stage ( ) ; return manager ; }

Target:
public com.google.gerrit.server.notedb.NoteDbUpdateManager stage ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Change.Id changeId ) throws com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException , java.io.IOException { db = com.google.gerrit.reviewdb.server.ReviewDbUtil.unwrapDb ( db ) ; com.google.gerrit.reviewdb.client.Change change = db.changes ( ) . get ( changeId ) ; if ( change == null ) { throw new com.google.gerrit.server.project.NoSuchChangeException ( changeId ) ; } com.google.gerrit.server.notedb.NoteDbUpdateManager manager = updateManagerFactory.create ( change.getProject ( ) ) ; buildUpdates ( manager , bundleReader.fromReviewDb ( db , changeId ) ) ; manager.stage ( ) ; return manager ; }
Source:
protected void configure ( ) { com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < com.google.gerrit.httpd.AdvertisedObjectsCacheKey , java.util.Set < org.eclipse.jgit.lib.ObjectId > > > cache = new com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < com.google.gerrit.httpd.AdvertisedObjectsCacheKey , java.util.Set < org.eclipse.jgit.lib.ObjectId > > > ( ) { } ; core ( cache , com.google.gerrit.httpd.ProjectServlet.ID_CACHE ) . memoryLimit ( 4096 ) . maxAge ( 10 , java.util.concurrent.TimeUnit.MINUTES ) ; }

Target:
protected void configure ( ) { com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < com.google.gerrit.httpd.AdvertisedObjectsCacheKey , java.util.Set < org.eclipse.jgit.lib.ObjectId > > > cache = new com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < com.google.gerrit.httpd.AdvertisedObjectsCacheKey , java.util.Set < org.eclipse.jgit.lib.ObjectId > > > ( ) { } ; core ( cache , com.google.gerrit.httpd.GitOverHttpFilter.ID_CACHE ) . memoryLimit ( 4096 ) . maxAge ( 10 , java.util.concurrent.TimeUnit.MINUTES ) ; }
Source:
public void onTopicEdited ( com.google.gerrit.extensions.events.TopicEditedListener.Event ev ) { try { hooks.doTopicChangedHook ( getChange ( ev.getChange ( ) ) , getAccount ( ev.getEditor ( ) ) , ev.getOldTopic ( ) , db.get ( ) ) ; } catch ( com.google.gwtorm.server.OrmException e ) { com.google.gerrit.common.ChangeHookApiListener.log.error ( ( "TopicChanged hook failed to run " + ( ev.getChange ( ) . _number ) ) , e ) ; } }

Target:
public void onTopicEdited ( com.google.gerrit.extensions.events.TopicEditedListener.Event ev ) { try { hooks.doTopicChangedHook ( getNotes ( ev.getChange ( ) ) . getChange ( ) , getAccount ( ev.getEditor ( ) ) , ev.getOldTopic ( ) , db.get ( ) ) ; } catch ( com.google.gwtorm.server.OrmException e ) { com.google.gerrit.common.ChangeHookApiListener.log.error ( ( "TopicChanged hook failed to run " + ( ev.getChange ( ) . _number ) ) , e ) ; } }
Source:
private static java.lang.String format ( final com.google.gerrit.server.git.WorkQueue.Task < ? > task ) { return task.getRunnable ( ) . toString ( ) ; }

Target:
private java.lang.String format ( final com.google.gerrit.server.git.WorkQueue.Task < ? > task ) { java.lang.String s = task.toString ( ) ; if ( ( s.length ( ) ) < ( taskNameWidth ) ) { return s ; } else { return s.substring ( 0 , taskNameWidth ) ; } }
Source:
private void setupDeleteMocks ( boolean exception ) throws java.io.IOException { indexer.delete ( id ) ; if ( exception ) { org.easymock.EasyMock.expectLastCall ( ) . andThrow ( new java.io.IOException ( ) ) ; } else { org.easymock.EasyMock.expectLastCall ( ) . once ( ) ; } replayAll ( ) ; }

Target:
public void changeIsDeletedFromIndex ( ) throws java.lang.Exception { syncIndexRestApiServlet.doDelete ( req , rsp ) ; org.mockito.Mockito.verify ( indexer , org.mockito.Mockito.times ( 1 ) ) . delete ( id ) ; org.mockito.Mockito.verify ( rsp ) . setStatus ( javax.servlet.http.HttpServletResponse.SC_NO_CONTENT ) ; }
Source:
public void deleteReviewerFromWipChange ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageWipChange ( ) ; removeReviewer ( sc , extraReviewer ) ; assertThat ( sender ) . sent ( "deleteReviewer" , sc ) . notTo ( sc.owner ) . to ( extraReviewer ) . to ( sc.reviewerByEmail ) . cc ( extraCcer , sc.reviewer , sc.ccer ) . cc ( sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; }

Target:
public void deleteReviewerFromWipChange ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageWipChange ( ) ; removeReviewer ( sc , extraReviewer ) ; assertThat ( sender ) . notSent ( ) ; }
Source:
private static java.util.SortedMap < java.lang.String , com.google.gerrit.server.project.RefControl.RefRightsForPattern > sortedRightsByPattern ( java.util.List < com.google.gerrit.reviewdb.RefRight > actionRights ) { java.util.SortedMap < java.lang.String , com.google.gerrit.server.project.RefControl.RefRightsForPattern > rights = new java.util.TreeMap < java.lang.String , com.google.gerrit.server.project.RefControl.RefRightsForPattern > ( com.google.gerrit.server.project.RefControl.DESCENDING_SORT ) ; for ( com.google.gerrit.reviewdb.RefRight actionRight : actionRights ) { com.google.gerrit.server.project.RefControl.RefRightsForPattern patternRights = rights.get ( actionRight.getRefPattern ( ) ) ; if ( patternRights == null ) { patternRights = new com.google.gerrit.server.project.RefControl.RefRightsForPattern ( ) ; rights.put ( actionRight.getRefPattern ( ) , patternRights ) ; } patternRights.addRight ( actionRight ) ; } return rights ; }

Target:
private java.util.SortedMap < java.lang.String , com.google.gerrit.server.project.RefControl.RefRightsForPattern > sortedRightsByPattern ( java.util.List < com.google.gerrit.reviewdb.RefRight > actionRights ) { java.util.SortedMap < java.lang.String , com.google.gerrit.server.project.RefControl.RefRightsForPattern > rights = new java.util.TreeMap < java.lang.String , com.google.gerrit.server.project.RefControl.RefRightsForPattern > ( BY_MOST_SPECIFIC_SORT ) ; for ( com.google.gerrit.reviewdb.RefRight actionRight : actionRights ) { com.google.gerrit.server.project.RefControl.RefRightsForPattern patternRights = rights.get ( actionRight.getRefPattern ( ) ) ; if ( patternRights == null ) { patternRights = new com.google.gerrit.server.project.RefControl.RefRightsForPattern ( ) ; rights.put ( actionRight.getRefPattern ( ) , patternRights ) ; } patternRights.addRight ( actionRight ) ; } return rights ; }
Source:
private org.eclipse.jgit.revwalk.RevCommit commit ( com.google.gerrit.server.notedb.ChangeUpdate update ) throws java.io.IOException { com.google.gerrit.server.git.MetaDataUpdate md = new com.google.gerrit.server.git.MetaDataUpdate ( com.google.gerrit.server.extensions.events.GitReferenceUpdated.DISABLED , project , repo ) ; md.getCommitBuilder ( ) . setAuthor ( update.getUser ( ) . newCommitterIdent ( update.getWhen ( ) , com.google.gerrit.server.notedb.ChangeNotesTest.TZ ) ) ; return update.commit ( md ) ; }

Target:
private static com.google.gerrit.common.data.SubmitRecord submitRecord ( java.lang.String status , java.lang.String errorMessage , com.google.gerrit.common.data.SubmitRecord ... labels ) { com.google.gerrit.common.data.SubmitRecord rec = new com.google.gerrit.common.data.SubmitRecord ( ) ; rec.status = SubmitRecord.Status.valueOf ( status ) ; rec.errorMessage = errorMessage ; if ( ( labels.length ) > 0 ) { rec.labels = com.google.common.collect.ImmutableList.copyOf ( labels ) ; } return rec ; }
Source:
private com.google.inject.Injector createSysInjector ( ) { final java.util.List < com.google.inject.Module > modules = new java.util.ArrayList < com.google.inject.Module > ( ) ; modules.add ( cfgInjector.getInstance ( com.google.gerrit.server.config.GerritGlobalModule.class ) ) ; modules.add ( new com.google.gerrit.server.config.CanonicalWebUrlModule ( ) { @ java.lang.Override protected java.lang.Class < ? extends com.google.inject.Provider < java.lang.String > > provider ( ) { return com.google.gerrit.httpd.HttpCanonicalWebUrlProvider.class ; } } ) ; modules.add ( new com.google.gerrit.server.config.MasterNodeStartup ( ) ) ; return cfgInjector.createChildInjector ( modules ) ; }

Target:
private com.google.inject.Injector createSysInjector ( ) { final java.util.List < com.google.inject.Module > modules = new java.util.ArrayList < com.google.inject.Module > ( ) ; modules.add ( cfgInjector.getInstance ( com.google.gerrit.server.config.GerritGlobalModule.class ) ) ; modules.add ( new com.google.gerrit.server.mail.SmtpEmailSender.Module ( ) ) ; modules.add ( new com.google.gerrit.server.config.CanonicalWebUrlModule ( ) { @ java.lang.Override protected java.lang.Class < ? extends com.google.inject.Provider < java.lang.String > > provider ( ) { return com.google.gerrit.httpd.HttpCanonicalWebUrlProvider.class ; } } ) ; modules.add ( new com.google.gerrit.server.config.MasterNodeStartup ( ) ) ; return cfgInjector.createChildInjector ( modules ) ; }
Source:
public void createNewDraftChangeNotAllowed ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( isAllowDrafts ( ) ) . isFalse ( ) ; com.google.gerrit.extensions.common.ChangeInput ci = newChangeInput ( ChangeStatus.DRAFT ) ; assertCreateFails ( ci , com.google.gerrit.extensions.restapi.MethodNotAllowedException.class , "draft workflow is disabled" ) ; }

Target:
public void createChangeWithoutAccessToParentCommitFails ( ) throws java.lang.Exception { java.util.Map < java.lang.String , com.google.gerrit.acceptance.PushOneCommit.Result > results = changeInTwoBranches ( "invisible-branch" , "a.txt" , "visible-branch" , "b.txt" ) ; block ( project , "refs/heads/invisible-branch" , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS ) ; com.google.gerrit.extensions.common.ChangeInput in = newChangeInput ( ChangeStatus.NEW ) ; in.branch = "visible-branch" ; in.baseChange = results.get ( "invisible-branch" ) . getChangeId ( ) ; assertCreateFails ( in , com.google.gerrit.extensions.restapi.UnprocessableEntityException.class , ( "Base change not found: " + ( in.baseChange ) ) ) ; }
Source:
public void setPatchLineComments ( final java.util.List < com.google.gerrit.reviewdb.PatchLineComment > plc ) { inlineComments = plc ; }

Target:
public void setPatchLineComments ( final java.util.List < com.google.gerrit.reviewdb.PatchLineComment > plc ) { inlineComments = plc ; java.util.Set < java.lang.String > paths = new java.util.HashSet < java.lang.String > ( ) ; for ( com.google.gerrit.reviewdb.PatchLineComment c : plc ) { com.google.gerrit.reviewdb.Patch.Key p = c.getKey ( ) . getParentKey ( ) ; paths.add ( p.getFileName ( ) ) ; } changeData.setCurrentFilePaths ( paths ) ; }
Source:
void resizePaddingWidget ( ) { com.google.gwt.core.client.Scheduler.get ( ) . scheduleDeferred ( new com.google.gwt.core.client.Scheduler.ScheduledCommand ( ) { public void execute ( ) { assert ( selfWidget ) != null ; assert ( widgetManager ) != null ; selfWidget.changed ( ) ; widgetManager.resizePaddingWidget ( ) ; } } ) ; }

Target:
void setParent ( com.google.gerrit.client.diff.SideBySide2 parent ) { this . parent = parent ; }
Source:
public static void submit ( int id , java.lang.String commit , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.changes.SubmitInfo > cb ) { com.google.gerrit.client.changes.ChangeApi.SubmitInput in = com.google.gerrit.client.changes.ChangeApi.SubmitInput.create ( ) ; in.waitForMerge ( true ) ; com.google.gerrit.client.changes.ChangeApi.call ( id , commit , "submit" ) . post ( in , cb ) ; }

Target:
public static void submit ( int id , java.lang.String commit , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.changes.SubmitInfo > cb ) { com.google.gwt.core.client.JavaScriptObject in = com.google.gwt.core.client.JavaScriptObject.createObject ( ) ; com.google.gerrit.client.changes.ChangeApi.call ( id , commit , "submit" ) . post ( in , cb ) ; }
Source:
public boolean next ( ) { if ( ( ! ( in ( curEdit ) ) ) && ( ( ++ ( curIdx ) ) < ( edits.size ( ) ) ) ) { curEdit = edits.get ( curIdx ) ; } return ( ( aCur ) < ( aEnd ) ) || ( ( bCur ) < ( bEnd ) ) ; }

Target:
public boolean next ( ) { if ( ! ( in ( curEdit ) ) ) { if ( ( curIdx ) < ( endIdx ) ) { curEdit = edits.get ( ( ++ ( curIdx ) ) ) ; } } return ( ( aCur ) < ( aEnd ) ) || ( ( bCur ) < ( bEnd ) ) ; }
Source:
public void setUp ( ) { when ( immediateExecutor.submit ( org.mockito.Matchers.any ( java.lang.Runnable.class ) ) ) . thenAnswer ( new org.mockito.stubbing.Answer < java.util.concurrent.Future < ? > > ( ) { @ java.lang.Override public java.util.concurrent.Future < ? > answer ( org.mockito.invocation.InvocationOnMock invocation ) throws java.lang.Throwable { java.lang.Runnable task = ( ( java.lang.Runnable ) ( invocation.getArguments ( ) [ 0 ] ) ) ; task.run ( ) ; return null ; } } ) ; asyncListener = new com.googlesource.gerrit.plugins.hooks.rtc.filters.ChangeListenerAsyncDecorator < com.google.gerrit.common.ChangeListener > ( listener , executor ) ; }

Target:
public void setUp ( ) { org.mockito.Mockito.when ( immediateExecutor.submit ( org.mockito.Matchers.any ( java.lang.Runnable.class ) ) ) . thenAnswer ( new org.mockito.stubbing.Answer < java.util.concurrent.Future < ? > > ( ) { @ java.lang.Override public java.util.concurrent.Future < ? > answer ( org.mockito.invocation.InvocationOnMock invocation ) throws java.lang.Throwable { java.lang.Runnable task = ( ( java.lang.Runnable ) ( invocation.getArguments ( ) [ 0 ] ) ) ; task.run ( ) ; return null ; } } ) ; asyncListener = new com.googlesource.gerrit.plugins.hooks.rtc.filters.ChangeListenerAsyncDecorator < com.google.gerrit.common.EventListener > ( listener , executor ) ; }
Source:
public void fetch ( ) throws com.google.gwtorm.client.OrmException { if ( ! ( toFetch.isEmpty ( ) ) ) { for ( final com.google.gerrit.client.reviewdb.Account a : db.accounts ( ) . get ( toFetch ) ) { cache.put ( a.getId ( ) , a ) ; } toFetch.clear ( ) ; } }

Target:
public void fetch ( ) { if ( ! ( toFetch.isEmpty ( ) ) ) { for ( final com.google.gerrit.client.reviewdb.Account a : com.google.gerrit.client.rpc.Common.getAccountCache ( ) . get ( toFetch , db ) ) { cache.put ( a.getId ( ) , a ) ; } toFetch.clear ( ) ; } }
Source:
protected void configure ( ) { bind ( com.google.gerrit.httpd.GerritOptions.class ) . toInstance ( new com.google.gerrit.httpd.GerritOptions ( headless , slave ) ) ; if ( test ) { bind ( com.google.gerrit.server.securestore.SecureStore.class ) . toProvider ( com.google.gerrit.server.securestore.SecureStoreProvider.class ) ; } }

Target:
protected void configure ( ) { bind ( com.google.gerrit.httpd.GerritOptions.class ) . toInstance ( new com.google.gerrit.httpd.GerritOptions ( headless , slave ) ) ; if ( test ) { bind ( java.lang.String.class ) . annotatedWith ( com.google.gerrit.server.securestore.SecureStoreClassName.class ) . toInstance ( com.google.gerrit.server.securestore.DefaultSecureStore.class . getName ( ) ) ; bind ( com.google.gerrit.server.securestore.SecureStore.class ) . toProvider ( com.google.gerrit.server.securestore.SecureStoreProvider.class ) ; } }
Source:
public void newPatchSetOnWipChangeSettingReadyInReviewDb ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isFalse ( ) ; 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 , 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 newPatchSetOnWipChangeSettingReadyInNoteDb ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isTrue ( ) ; 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 ) . cc ( sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) . noOneElse ( ) ; assertThat ( sender ) . notSent ( ) ; }
Source:
private < T > T executeWithAttemptCount ( com.google.gerrit.server.update.RetryHelper.ActionType actionType , com.google.gerrit.server.update.RetryHelper.Action < T > action , com.google.gerrit.server.update.RetryHelper.Options opts , com.google.common.base.Predicate < java.lang.Throwable > exceptionPredicate ) throws java.lang.Throwable { com.google.gerrit.server.update.RetryHelper.MetricListener listener = new com.google.gerrit.server.update.RetryHelper.MetricListener ( ) ; try { com.github.rholder.retry.RetryerBuilder < T > retryerBuilder = createRetryerBuilder ( opts , exceptionPredicate ) ; retryerBuilder.withRetryListener ( listener ) ; return executeWithTimeoutCount ( actionType , action , retryerBuilder.build ( ) ) ; } finally { metrics.attemptCounts.record ( actionType , listener.getAttemptCount ( ) ) ; } }

Target:
private < T > T executeWithAttemptAndTimeoutCount ( com.google.gerrit.server.update.RetryHelper.ActionType actionType , com.google.gerrit.server.update.RetryHelper.Action < T > action , com.google.gerrit.server.update.RetryHelper.Options opts , com.google.common.base.Predicate < java.lang.Throwable > exceptionPredicate ) throws java.lang.Throwable { com.google.gerrit.server.update.RetryHelper.MetricListener listener = new com.google.gerrit.server.update.RetryHelper.MetricListener ( ) ; try { com.github.rholder.retry.RetryerBuilder < T > retryerBuilder = createRetryerBuilder ( actionType , opts , exceptionPredicate ) ; retryerBuilder.withRetryListener ( listener ) ; return executeWithTimeoutCount ( actionType , action , retryerBuilder.build ( ) ) ; } finally { metrics.attemptCounts.record ( actionType , listener.getAttemptCount ( ) ) ; } }
Source:
public void testMissingDownstreamMerges ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result result = createChange ( "subject" , "filename" , "content" , "testtopic" ) ; pushConfig ( "automerger.config" , result.getChange ( ) . project ( ) . get ( ) ) ; result.assertOkStatus ( ) ; int changeNumber = result.getChange ( ) . getId ( ) . id ; exception.expect ( com.google.gerrit.extensions.restapi.ResourceConflictException.class ) ; exception.expectMessage ( ( ( "Failed to submit 1 change due to the following problems:\nChange " + changeNumber ) + ": Missing downstream branches ds_one. Please recreate the automerges." ) ) ; merge ( result ) ; }

Target:
public void testMissingDownstreamMerges_custom ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result result = createChange ( "subject" , "filename" , "content" , "testtopic" ) ; pushConfig ( "alternate.config" , result.getChange ( ) . project ( ) . get ( ) , "ds_one" ) ; result.assertOkStatus ( ) ; int changeNumber = result.getChange ( ) . getId ( ) . id ; exception.expect ( com.google.gerrit.extensions.restapi.ResourceConflictException.class ) ; exception.expectMessage ( ( ( "Failed to submit 1 change due to the following problems:\nChange " + changeNumber ) + ": there is no ds_one" ) ) ; merge ( result ) ; }
Source:
public void setUp ( ) { mem = com.google.common.cache.CacheBuilder.newBuilder ( ) . build ( ) ; com.google.inject.TypeLiteral < java.lang.String > keyType = new com.google.inject.TypeLiteral < java.lang.String > ( ) { } ; com.google.gerrit.server.cache.h2.H2CacheImpl.SqlStore < java.lang.String , java.lang.Boolean > store = new com.google.gerrit.server.cache.h2.H2CacheImpl.SqlStore ( ( ( "jdbc:h2:mem:" + "Test_" ) + ( ++ ( com.google.gerrit.server.cache.h2.H2CacheTest.dbCnt ) ) ) , keyType , ( 1 << 20 ) , 0 ) ; impl = new com.google.gerrit.server.cache.h2.H2CacheImpl ( com.google.common.util.concurrent.MoreExecutors.directExecutor ( ) , store , keyType , mem ) ; }

Target:
public void setUp ( ) { mem = com.google.common.cache.CacheBuilder.newBuilder ( ) . build ( ) ; com.google.inject.TypeLiteral < java.lang.String > keyType = new com.google.inject.TypeLiteral < java.lang.String > ( ) { } ; com.google.gerrit.server.cache.h2.H2CacheImpl.SqlStore < java.lang.String , java.lang.Boolean > store = new com.google.gerrit.server.cache.h2.H2CacheImpl.SqlStore ( ( "jdbc:h2:mem:Test_" + ( ++ ( com.google.gerrit.server.cache.h2.H2CacheTest.dbCnt ) ) ) , keyType , ( 1 << 20 ) , 0 ) ; impl = new com.google.gerrit.server.cache.h2.H2CacheImpl ( com.google.common.util.concurrent.MoreExecutors.directExecutor ( ) , store , keyType , mem ) ; }
Source:
private void setTheme ( com.google.gerrit.extensions.common.Theme v ) { java.lang.String name = ( v != null ) ? v.name ( ) : Theme.DEFAULT.name ( ) ; for ( int i = 0 ; i < ( theme.getItemCount ( ) ) ; i ++ ) { if ( theme.getValue ( i ) . equals ( name ) ) { theme.setSelectedIndex ( i ) ; return ; } } theme.setSelectedIndex ( 0 ) ; }

Target:
private void setTheme ( com.google.gerrit.extensions.client.Theme v ) { java.lang.String name = ( v != null ) ? v.name ( ) : Theme.DEFAULT.name ( ) ; for ( int i = 0 ; i < ( theme.getItemCount ( ) ) ; i ++ ) { if ( theme.getValue ( i ) . equals ( name ) ) { theme.setSelectedIndex ( i ) ; return ; } } theme.setSelectedIndex ( 0 ) ; }
Source:
public void go ( ) { if ( ( com.google.gerrit.client.Gerrit.patchScreen ) != null ) { if ( type == ( com.google.gerrit.client.Gerrit.patchScreen.getPatchScreenType ( ) ) ) { com.google.gerrit.client.Gerrit.patchScreen.setTopView ( PatchScreen.TopView.MAIN ) ; com.google.gwt.dom.client.AnchorElement.as ( getElement ( ) ) . blur ( ) ; } else { final com.google.gerrit.reviewdb.Patch.Key id = com.google.gerrit.client.Gerrit.patchScreen.getPatchKey ( ) ; setTargetHistoryToken ( com.google.gerrit.client.Dispatcher.toPatch ( type , id ) ) ; super . go ( ) ; } } }

Target:
public void go ( ) { if ( ( com.google.gerrit.client.Gerrit.patchScreen ) != null ) { if ( type == ( com.google.gerrit.client.Gerrit.patchScreen.getPatchScreenType ( ) ) ) { com.google.gerrit.client.Gerrit.patchScreen.setTopView ( PatchScreen.TopView.MAIN ) ; com.google.gwt.dom.client.AnchorElement.as ( getElement ( ) ) . blur ( ) ; } else { new com.google.gerrit.client.ui.PatchLink ( "" , type , com.google.gerrit.client.Gerrit.patchScreen ) . go ( ) ; } } }
Source:
public void onKeyPress ( com.google.gwt.event.dom.client.KeyPressEvent event ) { submitOnSelection = false ; if ( ( event.getNativeEvent ( ) . getKeyCode ( ) ) == ( com.google.gwt.event.dom.client.KeyCodes.KEY_ENTER ) ) { if ( nameTxt.isSuggestionListShowing ( ) ) { submitOnSelection = true ; } else { doAdd ( ) ; } } }

Target:
public void onKeyPress ( com.google.gwt.event.dom.client.KeyPressEvent event ) { submitOnSelection = false ; if ( ( event.getNativeEvent ( ) . getKeyCode ( ) ) == ( com.google.gwt.event.dom.client.KeyCodes.KEY_ENTER ) ) { if ( ( ( com.google.gwt.user.client.ui.SuggestBox.DefaultSuggestionDisplay ) ( nameTxt.getSuggestionDisplay ( ) ) ) . isSuggestionListShowing ( ) ) { submitOnSelection = true ; } else { doAdd ( ) ; } } }
Source:
public void start ( final org.apache.sshd.server.Environment env ) throws java.io.IOException { com.google.gerrit.sshd.SshScope.Context old = com.google.gerrit.sshd.SshScope.set ( context ) ; java.lang.String message ; try { message = messageFactory.get ( ) . getMessage ( ) ; } finally { com.google.gerrit.sshd.SshScope.set ( old ) ; } err.write ( org.eclipse.jgit.lib.Constants.encode ( message.toString ( ) ) ) ; err.flush ( ) ; in.close ( ) ; out.close ( ) ; err.close ( ) ; exit.onExit ( 127 ) ; }

Target:
public void start ( final org.apache.sshd.server.Environment env ) throws java.io.IOException { com.google.gerrit.sshd.SshScope.Context old = sshScope.set ( context ) ; java.lang.String message ; try { message = messageFactory.get ( ) . getMessage ( ) ; } finally { sshScope.set ( old ) ; } err.write ( org.eclipse.jgit.lib.Constants.encode ( message.toString ( ) ) ) ; err.flush ( ) ; in.close ( ) ; out.close ( ) ; err.close ( ) ; exit.onExit ( 127 ) ; }
Source:
public void createdOnIsPopulatedForGroupsCreatedAfterAudit ( ) throws java.lang.Exception { java.sql.Timestamp testStartTime = com.google.gerrit.common.TimeUtil.nowTs ( ) ; com.google.gerrit.reviewdb.client.AccountGroup.Id groupId = createGroup ( "Group for schema migration" ) ; setCreatedOnToVeryOldTimestamp ( groupId ) ; schema151.migrateData ( db , new com.google.gerrit.testing.TestUpdateUI ( ) ) ; java.sql.Timestamp createdOn = getCreatedOn ( groupId ) ; com.google.common.truth.Truth.assertThat ( createdOn ) . isAtLeast ( testStartTime ) ; }

Target:
public void unwrapDb ( ) { jdbcSchema = com.google.gerrit.reviewdb.server.ReviewDbWrapper.unwrapJbdcSchema ( db ) ; }