auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void dateOneOnly ( ) throws java.lang.Exception { java.util.Map < java.lang.String , java.lang.String > params = new java.util.HashMap < > ( ) ; java.lang.String oldDate = "1990-10-10 10:00:00" ; params.put ( "t1" , oldDate ) ; java.lang.String query = com.ericsson.gerrit.plugins.eventslog.QueryMakerTest.queryMaker.formQueryFromRequestParameters ( params ) ; org.junit.Assert.assertTrue ( query.contains ( java.lang.String.format ( "'%s' and " , oldDate ) ) ) ; }

Target:
public void dateOneOnly ( ) throws java.lang.Exception { java.util.Map < java.lang.String , java.lang.String > params = new java.util.HashMap < > ( ) ; java.lang.String oldDate = "1990-10-10 10:00:00" ; params.put ( "t1" , oldDate ) ; java.lang.String query = com.ericsson.gerrit.plugins.eventslog.QueryMakerTest.queryMaker.formQueryFromRequestParameters ( params ) ; com.google.common.truth.Truth.assertThat ( query ) . contains ( java.lang.String.format ( "'%s' and " , oldDate ) ) ; }
Source:
private static boolean onSupportedJavaVersion ( ) { final java.lang.String version = java.lang.System.getProperty ( "java.specification.version" ) ; if ( 1.7 <= ( Main.parse ( version ) ) ) { return true ; } else { java.lang.System.err.println ( "fatal: Gerrit Code Review requires Java 7 or later" ) ; java.lang.System.err.println ( ( ( " (trying to run on Java " + version ) + ")" ) ) ; return false ; } }

Target:
private static boolean onSupportedJavaVersion ( ) { final java.lang.String version = java.lang.System.getProperty ( "java.specification.version" ) ; if ( 1.7 <= ( Main.parse ( version ) ) ) { return true ; } java.lang.System.err.println ( "fatal: Gerrit Code Review requires Java 7 or later" ) ; java.lang.System.err.println ( ( ( " (trying to run on Java " + version ) + ")" ) ) ; return false ; }
Source:
public void start ( ) { queue.start ( ) ; if ( ( ( srvInfo.getState ( ) ) == ( ServerInformation.State.STARTUP ) ) && ( config.isReplicateAllOnPluginStart ( ) ) ) { com.googlesource.gerrit.plugins.replication.ReplicationState state = new com.googlesource.gerrit.plugins.replication.ReplicationState ( new com.googlesource.gerrit.plugins.replication.PushResultProcessing.GitUpdateProcessing ( eventDispatcher , database ) ) ; pushAllFuture.set ( pushAll.create ( null , com.googlesource.gerrit.plugins.replication.ReplicationFilter.all ( ) , state ) . schedule ( 30 , java.util.concurrent.TimeUnit.SECONDS ) ) ; } }

Target:
public void start ( ) { queue.start ( ) ; if ( ( ( srvInfo.getState ( ) ) == ( ServerInformation.State.STARTUP ) ) && ( config.isReplicateAllOnPluginStart ( ) ) ) { com.googlesource.gerrit.plugins.replication.ReplicationState state = new com.googlesource.gerrit.plugins.replication.ReplicationState ( new com.googlesource.gerrit.plugins.replication.PushResultProcessing.GitUpdateProcessing ( eventDispatcher.get ( ) , database ) ) ; pushAllFuture.set ( pushAll.create ( null , com.googlesource.gerrit.plugins.replication.ReplicationFilter.all ( ) , state ) . schedule ( 30 , java.util.concurrent.TimeUnit.SECONDS ) ) ; } }
Source:
void onDelete ( int idx ) { java.lang.String path = list.get ( idx ) . path ( ) ; com.google.gerrit.client.changes.ChangeEditApi.delete ( curr.getParentKey ( ) . get ( ) , path , new com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.VoidResult > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.VoidResult result ) { com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChangeInEditMode ( curr.getParentKey ( ) ) ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { } } ) ; }

Target:
void onDelete ( int idx ) { java.lang.String path = list.get ( idx ) . path ( ) ; com.google.gerrit.client.changes.ChangeEditApi.delete ( project.get ( ) , curr.getParentKey ( ) . get ( ) , path , new com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.VoidResult > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.VoidResult result ) { com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChangeInEditMode ( project , curr.getParentKey ( ) ) ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { } } ) ; }
Source:
private void savePatchSet ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gwtorm.server.OrmException { if ( ! ( patchSet.isDraft ( ) ) ) { throw new com.google.gerrit.extensions.restapi.ResourceConflictException ( "Patch set is not a draft" ) ; } psUtil.publish ( ctx.getDb ( ) , ctx.getUpdate ( psId ) , patchSet ) ; if ( ! ( wasDraftChange ) ) { ctx.saveChange ( ) ; } }

Target:
private void savePatchSet ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gwtorm.server.OrmException { if ( ! ( patchSet.isDraft ( ) ) ) { throw new com.google.gerrit.extensions.restapi.ResourceConflictException ( "Patch set is not a draft" ) ; } psUtil.publish ( ctx.getDb ( ) , ctx.getUpdate ( psId ) , patchSet ) ; }
Source:
public void removePublisher ( final com.googlesource.gerrit.plugins.rabbitmq.message.Publisher publisher ) { HEAD ( f7e22d ) ; com.googlesource.gerrit.plugins.rabbitmq.worker.Remove obsolete ; com.googlesource.gerrit.plugins.rabbitmq.worker.manifest entries ; com.google.gerrit.extensions.registration.RegistrationHandle registration = eventListenerRegistrations.remove ( publisher ) ; if ( registration != null ) { registration.remove ( ) ; } source.removeEventListener ( publisher.getEventListener ( ) ) ; }

Target:
public void removePublisher ( final com.googlesource.gerrit.plugins.rabbitmq.message.Publisher publisher ) { com.google.gerrit.extensions.registration.RegistrationHandle registration = eventListenerRegistrations.remove ( publisher ) ; if ( registration != null ) { registration.remove ( ) ; } }
Source:
public final void onSuccess ( com.google.gerrit.client.changes.ChangeList result ) { if ( isAttached ( ) ) { if ( ( ( result.length ( ) ) == 1 ) && ( com.google.gerrit.client.changes.QueryScreen.isSingleQuery ( query ) ) ) { com.google.gerrit.client.changes.ChangeInfo c = result.get ( 0 ) ; com.google.gerrit.reviewdb.client.Change.Id id = c.legacy_id ( ) ; com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( id ) , new com.google.gerrit.client.changes.ChangeScreen ( id ) ) ; } else { display ( result ) ; this . display ( ) ; } } }

Target:
public final void onSuccess ( com.google.gerrit.client.changes.ChangeList result ) { if ( isAttached ( ) ) { if ( ( ( result.length ( ) ) == 1 ) && ( com.google.gerrit.client.changes.QueryScreen.isSingleQuery ( query ) ) ) { com.google.gerrit.client.changes.ChangeInfo c = result.get ( 0 ) ; com.google.gerrit.reviewdb.client.Change.Id id = c.legacy_id ( ) ; com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( id ) ) ; } else { display ( result ) ; this . display ( ) ; } } }
Source:
public void onLoad ( ) { super . onLoad ( ) ; Util.ACCOUNT_SEC.validateEmail ( magicToken , new com.google.gerrit.client.rpc.ScreenLoadCallback < com.google.gwtjsonrpc.client.VoidResult > ( this ) { @ java.lang.Override protected void preDisplay ( final com.google.gwtjsonrpc.client.VoidResult result ) { } @ java.lang.Override protected void postDisplay ( ) { com.google.gwt.user.client.History.newItem ( Link.SETTINGS_CONTACT , true ) ; } } ) ; }

Target:
protected void onLoad ( ) { super . onLoad ( ) ; Util.ACCOUNT_SEC.validateEmail ( magicToken , new com.google.gerrit.client.rpc.ScreenLoadCallback < com.google.gwtjsonrpc.client.VoidResult > ( this ) { @ java.lang.Override protected void preDisplay ( final com.google.gwtjsonrpc.client.VoidResult result ) { } @ java.lang.Override protected void postDisplay ( ) { com.google.gwt.user.client.History.newItem ( Link.SETTINGS_CONTACT , true ) ; } } ) ; }
Source:
public java.lang.String apply ( com.google.gerrit.server.project.ProjectResource rsrc , com.googlesource.gerrit.plugins.cookbook.HelloProjectAction.Input input ) { final java.lang.String greeting = ( input.french ) ? "Bonjour" : "Hello" ; return java.lang.String.format ( "%s %s from project %s!" , greeting , ( com.google.common.base.Strings.isNullOrEmpty ( input.message ) ? com.google.common.base.MoreObjects.firstNonNull ( user.get ( ) . getUserName ( ) , "world" ) : input.message ) , rsrc.getName ( ) ) ; }

Target:
public java.lang.String apply ( com.google.gerrit.server.project.ProjectResource rsrc , com.googlesource.gerrit.plugins.cookbook.HelloProjectAction.Input input ) { final java.lang.String greeting = ( input.french ) ? "Bonjour" : "Hello" ; return java.lang.String.format ( "%s %s from project %s!" , greeting , ( isNullOrEmpty ( input.message ) ? firstNonNull ( user.get ( ) . getUserName ( ) , "world" ) : input.message ) , rsrc.getName ( ) ) ; }
Source:
private boolean isRevisionOutOfDate ( ) { try ( org.eclipse.jgit.lib.Repository git = gitMgr.openRepository ( getProject ( ) . getNameKey ( ) ) ) { org.eclipse.jgit.lib.Ref ref = git.getRefDatabase ( ) . exactRef ( RefNames.REFS_CONFIG ) ; if ( ( ref == null ) || ( ( ref.getObjectId ( ) ) == null ) ) { return true ; } return ! ( ref.getObjectId ( ) . equals ( config.getRevision ( ) ) ) ; } catch ( java.io.IOException gone ) { return true ; } }

Target:
private boolean isRevisionOutOfDate ( ) { try ( org.eclipse.jgit.lib.Repository git = gitMgr.openRepository ( getNameKey ( ) ) ) { org.eclipse.jgit.lib.Ref ref = git.getRefDatabase ( ) . exactRef ( RefNames.REFS_CONFIG ) ; if ( ( ref == null ) || ( ( ref.getObjectId ( ) ) == null ) ) { return true ; } return ! ( ref.getObjectId ( ) . equals ( config.getRevision ( ) ) ) ; } catch ( java.io.IOException gone ) { return true ; } }
Source:
private void addExtensionPoint ( com.google.gerrit.client.GerritUiExtensionPoint extensionPoint , com.google.gwt.user.client.ui.Panel p , com.google.gerrit.client.info.ChangeInfo change , com.google.gerrit.client.info.ChangeInfo.RevisionInfo rev ) { com.google.gerrit.client.api.ExtensionPanel extensionPanel = new com.google.gerrit.client.api.ExtensionPanel ( extensionPoint ) ; extensionPanel.putObject ( GerritUiExtensionPoint.Key.CHANGE_INFO , change ) ; extensionPanel.putObject ( GerritUiExtensionPoint.Key.REVISION_INFO , rev ) ; p.add ( extensionPanel ) ; }

Target:
private void addExtensionPoint ( com.google.gerrit.client.GerritUiExtensionPoint extensionPoint , com.google.gwt.user.client.ui.Panel p , com.google.gerrit.client.info.ChangeInfo change ) { com.google.gerrit.client.api.ExtensionPanel extensionPanel = new com.google.gerrit.client.api.ExtensionPanel ( extensionPoint ) ; extensionPanel.putObject ( GerritUiExtensionPoint.Key.CHANGE_INFO , change ) ; p.add ( extensionPanel ) ; }
Source:
public java.lang.Iterable < com.google.gerrit.server.query.change.ChangeData > byCommitsOnBranchNotMerged ( com.google.gerrit.reviewdb.client.Branch.NameKey branch , java.util.List < java.lang.String > hashes ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.server.index.Schema < com.google.gerrit.server.query.change.ChangeData > schema = com.google.gerrit.server.query.change.InternalChangeQuery.schema ( indexes ) ; if ( schema.hasField ( ChangeField.EXACT_COMMIT ) ) { return query ( com.google.gerrit.server.query.change.InternalChangeQuery.commitsOnBranchNotMerged ( branch , com.google.gerrit.server.query.change.InternalChangeQuery.commits ( schema , hashes ) ) ) ; } else { return byCommitsOnBranchNotMerged ( schema , branch , hashes , indexConfig.maxPrefixTerms ( ) ) ; } }

Target:
public java.lang.Iterable < com.google.gerrit.server.query.change.ChangeData > byCommitsOnBranchNotMerged ( com.google.gerrit.reviewdb.client.Branch.NameKey branch , java.util.List < java.lang.String > hashes ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.server.index.Schema < com.google.gerrit.server.query.change.ChangeData > schema = com.google.gerrit.server.query.change.InternalChangeQuery.schema ( indexes ) ; if ( ( schema != null ) && ( schema.hasField ( ChangeField.EXACT_COMMIT ) ) ) { return query ( com.google.gerrit.server.query.change.InternalChangeQuery.commitsOnBranchNotMerged ( branch , com.google.gerrit.server.query.change.InternalChangeQuery.commits ( schema , hashes ) ) ) ; } else { return byCommitsOnBranchNotMerged ( schema , branch , hashes , indexConfig.maxPrefixTerms ( ) ) ; } }
Source:
public void display ( final com.google.gerrit.common.data.ChangeDetail detail ) { clear ( ) ; final com.google.gerrit.reviewdb.PatchSet currps = detail.getCurrentPatchSet ( ) ; currentPatchSetId = currps.getPatchSetId ( ) ; for ( final com.google.gerrit.reviewdb.PatchSet ps : detail.getPatchSets ( ) ) { if ( ps == currps ) { add ( new com.google.gerrit.client.changes.PatchSetComplexDisclosurePanel ( parent , detail , detail.getCurrentPatchSetDetail ( ) ) ) ; } else { add ( new com.google.gerrit.client.changes.PatchSetComplexDisclosurePanel ( parent , detail , ps ) ) ; } } }

Target:
public void display ( final com.google.gerrit.common.data.ChangeDetail detail ) { clear ( ) ; final com.google.gerrit.reviewdb.PatchSet currps = detail.getCurrentPatchSet ( ) ; currentPatchSetId = currps.getId ( ) ; patchSets = detail.getPatchSets ( ) ; for ( final com.google.gerrit.reviewdb.PatchSet ps : patchSets ) { if ( ps == currps ) { add ( new com.google.gerrit.client.changes.PatchSetComplexDisclosurePanel ( parent , detail , detail.getCurrentPatchSetDetail ( ) ) ) ; } else { add ( new com.google.gerrit.client.changes.PatchSetComplexDisclosurePanel ( parent , detail , ps ) ) ; } } }
Source:
private void display ( com.google.gerrit.reviewdb.client.AccountExternalId id ) { java.lang.String user ; java.lang.String pass ; if ( id != null ) { user = id.getSchemeRest ( ) ; pass = id.getPassword ( ) ; } else { user = null ; pass = null ; } this . id = id ; com.google.gerrit.client.Gerrit.getUserAccount ( ) . setUserName ( user ) ; password.setText ( ( pass != null ? pass : "" ) ) ; password.setVisible ( ( pass != null ) ) ; enableUI ( true ) ; }

Target:
private void display ( java.lang.String pass ) { password.setText ( ( pass != null ? pass : "" ) ) ; password.setVisible ( ( pass != null ) ) ; enableUI ( true ) ; }
Source:
public java.util.Map < com.google.gerrit.server.account.WatchConfig.ProjectWatchKey , java.util.Set < com.google.gerrit.reviewdb.client.AccountProjectWatch.NotifyType > > getProjectWatches ( com.google.gerrit.reviewdb.client.Account.Id accountId ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { try ( org.eclipse.jgit.lib.Repository git = repoManager.openRepository ( allUsersName ) ; com.google.gerrit.server.account.WatchConfig watchConfig = new com.google.gerrit.server.account.WatchConfig ( accountId ) ) { watchConfig.load ( git ) ; return watchConfig.getProjectWatches ( ) ; } }

Target:
public java.util.Map < com.google.gerrit.server.account.WatchConfig.ProjectWatchKey , java.util.Set < com.google.gerrit.reviewdb.client.AccountProjectWatch.NotifyType > > getProjectWatches ( com.google.gerrit.reviewdb.client.Account.Id accountId ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { try ( org.eclipse.jgit.lib.Repository git = repoManager.openRepository ( allUsersName ) ) { com.google.gerrit.server.account.WatchConfig watchConfig = new com.google.gerrit.server.account.WatchConfig ( accountId ) ; watchConfig.load ( git ) ; return watchConfig.getProjectWatches ( ) ; } }
Source:
public com.google.gerrit.server.change.ChangeResource parse ( com.google.gerrit.extensions.restapi.TopLevelResource root , com.google.gerrit.extensions.restapi.IdString id ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException , com.google.gwtorm.server.OrmException , java.io.UnsupportedEncodingException { java.util.List < com.google.gerrit.reviewdb.client.Change > changes = findChanges ( id.encoded ( ) ) ; if ( ( changes.size ( ) ) != 1 ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( id ) ; } com.google.gerrit.server.project.ChangeControl control ; try { control = changeControlFactory.validateFor ( changes.get ( 0 ) ) ; } catch ( com.google.gerrit.server.project.NoSuchChangeException e ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( id ) ; } return new com.google.gerrit.server.change.ChangeResource ( control ) ; }

Target:
public com.google.gerrit.server.change.ChangeResource parse ( com.google.gerrit.extensions.restapi.TopLevelResource root , com.google.gerrit.extensions.restapi.IdString id ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException , com.google.gwtorm.server.OrmException { java.util.List < com.google.gerrit.reviewdb.client.Change > changes = findChanges ( id.encoded ( ) ) ; if ( ( changes.size ( ) ) != 1 ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( id ) ; } com.google.gerrit.server.project.ChangeControl control ; try { control = changeControlFactory.validateFor ( changes.get ( 0 ) , user.get ( ) ) ; } catch ( com.google.gerrit.server.project.NoSuchChangeException e ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( id ) ; } return new com.google.gerrit.server.change.ChangeResource ( control ) ; }
Source:
public com.google.gerrit.extensions.api.projects.BranchApi create ( com.google.gerrit.extensions.api.projects.BranchInput in ) throws com.google.gerrit.extensions.restapi.RestApiException { try { com.google.gerrit.server.project.CreateBranch.Input input = new com.google.gerrit.server.project.CreateBranch.Input ( ) ; input.ref = ref ; input.revision = in.revision ; createBranchFactory.create ( ref ) . apply ( project , input ) ; return this ; } catch ( java.io.IOException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot create branch" , e ) ; } }

Target:
public com.google.gerrit.extensions.api.projects.BranchApi create ( com.google.gerrit.extensions.api.projects.BranchInput input ) throws com.google.gerrit.extensions.restapi.RestApiException { try { createBranchFactory.create ( ref ) . apply ( project , input ) ; return this ; } catch ( java.io.IOException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot create branch" , e ) ; } }
Source:
private static void assertNoDiffs ( com.google.gerrit.server.notedb.ChangeBundle a , com.google.gerrit.server.notedb.ChangeBundle b ) { com.google.common.truth.Truth.assertThat ( a.differencesFrom ( b ) ) . isEmpty ( ) ; com.google.common.truth.Truth.assertThat ( b.differencesFrom ( a ) ) . isEmpty ( ) ; com.google.common.truth.Truth.assertThat ( a ) . isEqualTo ( b ) ; com.google.common.truth.Truth.assertThat ( b ) . isEqualTo ( a ) ; com.google.common.truth.Truth.assertThat ( a.hashCode ( ) ) . isEqualTo ( b.hashCode ( ) ) ; }

Target:
private static void assertNoDiffs ( com.google.gerrit.server.notedb.ChangeBundle a , com.google.gerrit.server.notedb.ChangeBundle b ) { com.google.common.truth.Truth.assertThat ( a.differencesFrom ( b ) ) . isEmpty ( ) ; com.google.common.truth.Truth.assertThat ( b.differencesFrom ( a ) ) . isEmpty ( ) ; }
Source:
public void byProjectPrefix ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < com.google.gerrit.testutil.InMemoryRepositoryManager.Repo > repo1 = createProject ( "repo1" ) ; org.eclipse.jgit.junit.TestRepository < com.google.gerrit.testutil.InMemoryRepositoryManager.Repo > repo2 = createProject ( "repo2" ) ; com.google.gerrit.reviewdb.client.Change change1 = insert ( newChange ( repo1 , null , null , null , null ) ) ; com.google.gerrit.reviewdb.client.Change change2 = insert ( newChange ( repo2 , null , null , null , null ) ) ; assertQuery ( "projects:foo" ) ; assertQuery ( "projects:repo1" , change1 ) ; assertQuery ( "projects:repo2" , change2 ) ; assertQuery ( "projects:repo" , change2 , change1 ) ; }

Target:
public void byProjectPrefix ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < com.google.gerrit.testutil.InMemoryRepositoryManager.Repo > repo1 = createProject ( "repo1" ) ; org.eclipse.jgit.junit.TestRepository < com.google.gerrit.testutil.InMemoryRepositoryManager.Repo > repo2 = createProject ( "repo2" ) ; com.google.gerrit.reviewdb.client.Change change1 = insert ( newChange ( repo1 ) ) ; com.google.gerrit.reviewdb.client.Change change2 = insert ( newChange ( repo2 ) ) ; assertQuery ( "projects:foo" ) ; assertQuery ( "projects:repo1" , change1 ) ; assertQuery ( "projects:repo2" , change2 ) ; assertQuery ( "projects:repo" , change2 , change1 ) ; }
Source:
public java.lang.String toRevision ( final com.google.gerrit.reviewdb.client.Project.NameKey project , final com.google.gerrit.reviewdb.client.PatchSet ps ) { com.google.gerrit.common.data.ParameterizedString pattern = new com.google.gerrit.common.data.ParameterizedString ( type.getRevision ( ) ) ; final java.util.Map < java.lang.String , java.lang.String > p = new java.util.HashMap < java.lang.String , java.lang.String > ( ) ; p.put ( "project" , encode ( project.get ( ) ) ) ; p.put ( "commit" , encode ( ps.getRevision ( ) . get ( ) ) ) ; return ( baseUrl ) + ( pattern.replace ( p ) ) ; }

Target:
public java.lang.String toRevision ( java.lang.String project , java.lang.String commit ) { com.google.gerrit.common.data.ParameterizedString pattern = new com.google.gerrit.common.data.ParameterizedString ( type.getRevision ( ) ) ; java.util.Map < java.lang.String , java.lang.String > p = new java.util.HashMap < java.lang.String , java.lang.String > ( ) ; p.put ( "project" , encode ( project ) ) ; p.put ( "commit" , encode ( commit ) ) ; return ( baseUrl ) + ( pattern.replace ( p ) ) ; }
Source:
public void badRequestCausedByCacheNotFound ( ) throws java.lang.Exception { java.lang.String pluginName = "somePlugin" ; java.lang.String cacheName = "nonexistingCache" ; configureMocksFor ( pluginName , cacheName ) ; com.ericsson.gerrit.plugins.highavailability.forwarder.CacheNotFoundException e = new com.ericsson.gerrit.plugins.highavailability.forwarder.CacheNotFoundException ( pluginName , cacheName ) ; org.mockito.Mockito.doThrow ( e ) . when ( evictCacheMock ) . evict ( org.mockito.ArgumentMatchers.eq ( pluginName ) , org.mockito.ArgumentMatchers.eq ( cacheName ) , org.mockito.ArgumentMatchers.any ( ) ) ; servlet.doPost ( requestMock , responseMock ) ; org.mockito.Mockito.verify ( responseMock ) . sendError ( javax.servlet.http.HttpServletResponse.SC_BAD_REQUEST , e.getMessage ( ) ) ; }

Target:
public void badRequestCausedByCacheNotFound ( ) throws java.lang.Exception { java.lang.String pluginName = "somePlugin" ; java.lang.String cacheName = "nonexistingCache" ; configureMocksFor ( pluginName , cacheName ) ; com.ericsson.gerrit.plugins.highavailability.forwarder.CacheNotFoundException e = new com.ericsson.gerrit.plugins.highavailability.forwarder.CacheNotFoundException ( pluginName , cacheName ) ; org.mockito.Mockito.doThrow ( e ) . when ( evictCacheMock ) . evict ( org.mockito.ArgumentMatchers.any ( ) ) ; servlet.doPost ( requestMock , responseMock ) ; org.mockito.Mockito.verify ( responseMock ) . sendError ( javax.servlet.http.HttpServletResponse.SC_BAD_REQUEST , e.getMessage ( ) ) ; }
Source:
public void testProjectCreation ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Project.NameKey projectA = new com.google.gerrit.reviewdb.client.Project.NameKey ( "projectA" ) ; repoManager.createRepository ( projectA ) ; com.google.common.truth.Truth.assertThat ( repoManager.openRepository ( projectA ) ) . isNotNull ( ) ; com.google.common.truth.Truth.assertThat ( ( ( java.lang.Iterable < ? > ) ( repoManager.list ( ) ) ) ) . containsExactly ( projectA ) ; }

Target:
public void testProjectCreation ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Project.NameKey projectA = new com.google.gerrit.reviewdb.client.Project.NameKey ( "projectA" ) ; try ( org.eclipse.jgit.lib.Repository repo = repoManager.createRepository ( projectA ) ) { com.google.common.truth.Truth.assertThat ( repo ) . isNotNull ( ) ; } try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( projectA ) ) { com.google.common.truth.Truth.assertThat ( repo ) . isNotNull ( ) ; } com.google.common.truth.Truth.assertThat ( repoManager.list ( ) ) . containsExactly ( projectA ) ; }
Source:
private static byte [ ] readWholeEntry ( com.google.gerrit.server.plugins.PluginContentScanner scanner , com.google.gerrit.server.plugins.PluginEntry entry ) throws java.io.IOException { byte [ ] data = new byte [ entry.getSize ( ) . get ( ) . intValue ( ) ] ; java.io.InputStream in = scanner.getInputStream ( entry ) ; try { org.eclipse.jgit.util.IO.readFully ( in , data , 0 , data.length ) ; } finally { in.close ( ) ; } return data ; }

Target:
private static byte [ ] readWholeEntry ( com.google.gerrit.server.plugins.PluginContentScanner scanner , com.google.gerrit.server.plugins.PluginEntry entry ) throws java.io.IOException { byte [ ] data = new byte [ entry.getSize ( ) . get ( ) . intValue ( ) ] ; try ( java.io.InputStream in = scanner.getInputStream ( entry ) ) { org.eclipse.jgit.util.IO.readFully ( in , data , 0 , data.length ) ; } return data ; }
Source:
public void onKeyUp ( com.google.gwt.event.dom.client.KeyUpEvent event ) { com.google.gerrit.client.admin.ProjectBranchesScreen.Query q = new com.google.gerrit.client.admin.ProjectBranchesScreen.Query ( filterTxt.getValue ( ) ) ; if ( match.equals ( q.qMatch ) ) { q.start ( start ) ; } else if ( ( query ) == null ) { q.run ( ) ; query = q ; } }

Target:
public void onKeyUp ( com.google.gwt.event.dom.client.KeyUpEvent event ) { com.google.gerrit.client.admin.ProjectBranchesScreen.Query q = new com.google.gerrit.client.admin.ProjectBranchesScreen.Query ( filterTxt.getValue ( ) ) ; if ( match.equals ( q.qMatch ) ) { q.start ( start ) ; } else { if ( ( query ) == null ) { q.run ( ) ; } query = q ; } }
Source:
public static void all ( com.google.gwtjsonrpc.common.AsyncCallback < com.google.gerrit.client.account.AccountCapabilities > cb , java.lang.String ... filter ) { com.google.gerrit.client.rpc.RestApi api = new com.google.gerrit.client.rpc.RestApi ( "/accounts/self/capabilities" ) ; for ( java.lang.String name : filter ) { api.addParameter ( "q" , name ) ; } api.send ( cb ) ; }

Target:
public static void all ( com.google.gwtjsonrpc.common.AsyncCallback < com.google.gerrit.client.account.AccountCapabilities > cb , java.lang.String ... filter ) { new com.google.gerrit.client.rpc.RestApi ( "/accounts/self/capabilities" ) . addParameter ( "q" , filter ) . get ( cb ) ; }
Source:
protected void saveProjectConfig ( com.google.gerrit.reviewdb.client.Project.NameKey p , com.google.gerrit.server.git.ProjectConfig cfg ) throws java.lang.Exception { com.google.gerrit.server.git.MetaDataUpdate md = metaDataUpdateFactory.create ( p ) ; try { cfg.commit ( md ) ; } finally { md.close ( ) ; } projectCache.evict ( cfg.getProject ( ) ) ; }

Target:
protected void saveProjectConfig ( com.google.gerrit.reviewdb.client.Project.NameKey p , com.google.gerrit.server.git.ProjectConfig cfg ) throws java.lang.Exception { try ( com.google.gerrit.server.git.MetaDataUpdate md = metaDataUpdateFactory.create ( p ) ) { cfg.commit ( md ) ; } projectCache.evict ( cfg.getProject ( ) ) ; }
Source:
public com.google.gwtorm.client.OrmException convertError ( final java.lang.String op , final java.lang.String entity , final java.sql.SQLException err ) { if ( ( ( err.getCause ( ) ) == null ) && ( ( err.getNextException ( ) ) != null ) ) { err.initCause ( err.getNextException ( ) ) ; } return new com.google.gwtorm.client.OrmException ( ( ( op + " failure on " ) + entity ) , err ) ; }

Target:
public com.google.gwtorm.server.OrmException convertError ( final java.lang.String op , final java.lang.String entity , final java.sql.SQLException err ) { if ( ( ( err.getCause ( ) ) == null ) && ( ( err.getNextException ( ) ) != null ) ) { err.initCause ( err.getNextException ( ) ) ; } return new com.google.gwtorm.server.OrmException ( ( ( op + " failure on " ) + entity ) , err ) ; }
Source:
private java.util.Map < java.lang.String , com.google.gerrit.reviewdb.client.PatchLineComment > scanDraftComments ( com.google.gerrit.server.change.RevisionResource rsrc ) throws com.google.gwtorm.server.OrmException { java.util.Map < java.lang.String , com.google.gerrit.reviewdb.client.PatchLineComment > drafts = com.google.common.collect.Maps.newHashMap ( ) ; for ( com.google.gerrit.reviewdb.client.PatchLineComment c : db.patchComments ( ) . draftByPatchSetAuthor ( rsrc.getPatchSet ( ) . getId ( ) , rsrc.getAuthorId ( ) ) ) { drafts.put ( c.getKey ( ) . get ( ) , c ) ; } return drafts ; }

Target:
private java.util.Map < java.lang.String , com.google.gerrit.reviewdb.client.PatchLineComment > scanDraftComments ( com.google.gerrit.server.change.RevisionResource rsrc ) throws com.google.gwtorm.server.OrmException { java.util.Map < java.lang.String , com.google.gerrit.reviewdb.client.PatchLineComment > drafts = com.google.common.collect.Maps.newHashMap ( ) ; for ( com.google.gerrit.reviewdb.client.PatchLineComment c : db.patchComments ( ) . draftByPatchSetAuthor ( rsrc.getPatchSet ( ) . getId ( ) , rsrc.getAccountId ( ) ) ) { drafts.put ( c.getKey ( ) . get ( ) , c ) ; } return drafts ; }
Source:
public void onSuccess ( com.google.gerrit.client.rpc.NativeMap < com.google.gerrit.client.diff.FileInfo > m ) { files.set ( ( base != null ? new com.google.gerrit.reviewdb.client.PatchSet.Id ( changeId , base._number ( ) ) : null ) , new com.google.gerrit.reviewdb.client.PatchSet.Id ( changeId , rev._number ( ) , rev.edit ( ) ) , style , editMessage , reply ) ; files.setValue ( m , myLastReply , comments.get ( 0 ) , drafts.get ( 0 ) , fileTableMode ) ; }

Target:
public void onSuccess ( com.google.gerrit.client.rpc.NativeMap < com.google.gerrit.client.diff.FileInfo > m ) { files.set ( ( base != null ? new com.google.gerrit.reviewdb.client.PatchSet.Id ( changeId , base._number ( ) ) : null ) , new com.google.gerrit.reviewdb.client.PatchSet.Id ( changeId , rev._number ( ) ) , style , editMessage , reply ) ; files.setValue ( m , myLastReply , comments.get ( 0 ) , drafts.get ( 0 ) , fileTableMode ) ; }
Source:
protected void assertApproved ( java.lang.String changeId ) throws java.io.IOException { com.google.gerrit.extensions.common.ChangeInfo c = getChange ( changeId , com.google.gerrit.extensions.client.ListChangesOption.DETAILED_LABELS ) ; com.google.gerrit.extensions.common.LabelInfo cr = c.labels.get ( "Code-Review" ) ; com.google.common.truth.Truth.assertThat ( cr.all ) . hasSize ( 1 ) ; com.google.common.truth.Truth.assertThat ( cr.all.get ( 0 ) . value.intValue ( ) ) . isEqualTo ( 2 ) ; com.google.common.truth.Truth.assertThat ( new com.google.gerrit.reviewdb.client.Account.Id ( cr.all.get ( 0 ) . _accountId ) ) . isEqualTo ( admin.getId ( ) ) ; }

Target:
protected void assertApproved ( java.lang.String changeId ) throws java.io.IOException { com.google.gerrit.extensions.common.ChangeInfo c = getChange ( changeId , com.google.gerrit.extensions.client.ListChangesOption.DETAILED_LABELS ) ; com.google.gerrit.extensions.common.LabelInfo cr = c.labels.get ( "Code-Review" ) ; com.google.common.truth.Truth.assertThat ( cr.all ) . hasSize ( 1 ) ; com.google.common.truth.Truth.assertThat ( cr.all.get ( 0 ) . value ) . isEqualTo ( 2 ) ; com.google.common.truth.Truth.assertThat ( new com.google.gerrit.reviewdb.client.Account.Id ( cr.all.get ( 0 ) . _accountId ) ) . isEqualTo ( admin.getId ( ) ) ; }
Source:
private org.eclipse.jgit.dircache.DirCacheEntry file ( final java.lang.String name ) throws java.io.IOException { final org.eclipse.jgit.lib.ObjectInserter oi = repository.newObjectInserter ( ) ; try { final org.eclipse.jgit.dircache.DirCacheEntry e = new org.eclipse.jgit.dircache.DirCacheEntry ( name ) ; e.setFileMode ( FileMode.REGULAR_FILE ) ; e.setObjectId ( oi.insert ( Constants.OBJ_BLOB , org.eclipse.jgit.lib.Constants.encode ( name ) ) ) ; oi.flush ( ) ; return e ; } finally { oi.release ( ) ; } }

Target:
private org.eclipse.jgit.dircache.DirCacheEntry file ( final java.lang.String name ) throws java.io.IOException { final org.eclipse.jgit.lib.ObjectInserter oi = repository.newObjectInserter ( ) ; try { final org.eclipse.jgit.dircache.DirCacheEntry e = new org.eclipse.jgit.dircache.DirCacheEntry ( name ) ; e.setFileMode ( FileMode.REGULAR_FILE ) ; e.setObjectId ( oi.insert ( Constants.OBJ_BLOB , org.eclipse.jgit.lib.Constants.encode ( name ) ) ) ; oi.flush ( ) ; return e ; } finally { oi.close ( ) ; } }
Source:
private void serveGwtUi ( ) { serve ( "/gerrit_ui/*" ) . with ( com.google.inject.Key.get ( javax.servlet.http.HttpServlet.class , com.google.inject.name.Names.named ( com.google.gerrit.httpd.raw.StaticModule.GWT_UI_SERVLET ) ) ) ; if ( ( warFs ) == null ) { filter ( "/" ) . through ( new com.google.gerrit.httpd.raw.RecompileGwtUiFilter ( buckOut , unpackedWar ) ) ; } }

Target:
private void serveGwtUi ( ) { serve ( "/gerrit_ui/*" ) . with ( com.google.inject.Key.get ( javax.servlet.http.HttpServlet.class , com.google.inject.name.Names.named ( com.google.gerrit.httpd.raw.StaticModule.GWT_UI_SERVLET ) ) ) ; if ( ( ( warFs ) == null ) && ( ( buckOut ) != null ) ) { filter ( "/" ) . through ( new com.google.gerrit.httpd.raw.RecompileGwtUiFilter ( buckOut , unpackedWar ) ) ; } }
Source:
com.googlesource.gerrit.plugins.lfs.LfsSshRequestAuthorizer.SshAuthInfo generateAuthInfo ( com.google.gerrit.server.CurrentUser user , java.lang.String project , java.lang.String operation ) { com.googlesource.gerrit.plugins.lfs.LfsSshRequestAuthorizer.LfsSshAuthToken token = new com.googlesource.gerrit.plugins.lfs.LfsSshRequestAuthorizer.LfsSshAuthToken ( user.getUserName ( ) , project , operation , expirationSeconds ) ; return new com.googlesource.gerrit.plugins.lfs.LfsSshRequestAuthorizer.SshAuthInfo ( processor.serialize ( token ) , token.expiresAt ) ; }

Target:
com.googlesource.gerrit.plugins.lfs.LfsSshRequestAuthorizer.SshAuthInfo generateAuthInfo ( com.google.gerrit.server.CurrentUser user , java.lang.String project , java.lang.String operation ) { com.googlesource.gerrit.plugins.lfs.LfsSshRequestAuthorizer.LfsSshAuthToken token = new com.googlesource.gerrit.plugins.lfs.LfsSshRequestAuthorizer.LfsSshAuthToken ( user.getUserName ( ) . get ( ) , project , operation , expirationSeconds ) ; return new com.googlesource.gerrit.plugins.lfs.LfsSshRequestAuthorizer.SshAuthInfo ( processor.serialize ( token ) , token.expiresAt ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { gApiMock = org.mockito.Mockito.mock ( com.google.gerrit.extensions.api.GerritApi.class , Mockito.RETURNS_DEEP_STUBS ) ; configMock = org.mockito.Mockito.mock ( com.googlesource.gerrit.plugins.automerger.ConfigLoader.class ) ; org.mockito.Mockito.when ( configMock.getCodeReviewLabel ( ) ) . thenReturn ( "Code-Review" ) ; ds = new com.googlesource.gerrit.plugins.automerger.DownstreamCreator ( gApiMock , configMock ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { gApiMock = org.mockito.Mockito.mock ( com.google.gerrit.extensions.api.GerritApi.class , Mockito.RETURNS_DEEP_STUBS ) ; configMock = org.mockito.Mockito.mock ( com.googlesource.gerrit.plugins.automerger.ConfigLoader.class ) ; ds = new com.googlesource.gerrit.plugins.automerger.DownstreamCreator ( gApiMock , configMock ) ; }
Source:
public java.util.Enumeration < com.google.gerrit.server.plugins.PluginEntry > entries ( ) { return java.util.Collections.enumeration ( com.google.common.collect.Lists.transform ( java.util.Collections.list ( jarFile.entries ( ) ) , new com.google.common.base.Function < java.util.jar.JarEntry , com.google.gerrit.server.plugins.PluginEntry > ( ) { @ java.lang.Override public com.google.gerrit.server.plugins.PluginEntry apply ( java.util.jar.JarEntry jarEntry ) { try { return resourceOf ( jarEntry ) ; } catch ( java.io.IOException e ) { throw new java.lang.IllegalArgumentException ( ( ( "Cannot convert jar entry " + jarEntry ) + " to a resource" ) , e ) ; } } } ) ) ; }

Target:
public java.util.Enumeration < com.google.gerrit.server.plugins.PluginEntry > entries ( ) { return java.util.Collections.enumeration ( com.google.common.collect.Lists.transform ( java.util.Collections.list ( jarFile.entries ( ) ) , ( jarEntry ) -> { try { return resourceOf ( jarEntry ) ; } catch ( java.io.IOException e ) { throw new java.lang.IllegalArgumentException ( ( ( "Cannot convert jar entry " + jarEntry ) + " to a resource" ) , e ) ; } } ) ) ; }
Source:
public void update ( ) throws com.google.gerrit.server.git.SubmoduleException { try { schema = schemaFactory.open ( ) ; updateSubmoduleSubscriptions ( ) ; updateSuperProjects ( destBranch , mergeTip.getId ( ) . toObjectId ( ) , null ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new com.google.gerrit.server.git.SubmoduleException ( "Cannot open database" , e ) ; } finally { if ( ( schema ) != null ) { schema.close ( ) ; schema = null ; } } }

Target:
public void update ( ) throws com.google.gerrit.server.git.SubmoduleException { try { schema = schemaFactory.open ( ) ; updateSubmoduleSubscriptions ( ) ; updateSuperProjects ( destBranch , rw , mergeTip.getId ( ) . toObjectId ( ) , null ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new com.google.gerrit.server.git.SubmoduleException ( "Cannot open database" , e ) ; } finally { if ( ( schema ) != null ) { schema.close ( ) ; schema = null ; } } }
Source:
public void testUnblockForceEditTopicName ( ) { com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.EDIT_TOPIC_NAME , com.google.gerrit.server.project.Util.ANONYMOUS , "refs/heads/*" ) . setBlock ( ) ; com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.EDIT_TOPIC_NAME , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) . setForce ( true ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; assertTrue ( "u can edit topic name" , u.controlForRef ( "refs/heads/master" ) . canForceEditTopicName ( ) ) ; }

Target:
public void testUnblockForceEditTopicName ( ) { com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.EDIT_TOPIC_NAME , com.google.gerrit.server.project.Util.ANONYMOUS , "refs/heads/*" ) . setBlock ( ) ; com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.EDIT_TOPIC_NAME , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) . setForce ( true ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; org.junit.Assert.assertTrue ( "u can edit topic name" , u.controlForRef ( "refs/heads/master" ) . canForceEditTopicName ( ) ) ; }
Source:
public void testUsernamePatternWithRegex ( ) { com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.project.Util.DEVS , "^refs/sb/${username}/heads/.*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , "d.v" , com.google.gerrit.server.project.Util.DEVS ) ; com.google.gerrit.server.project.ProjectControl d = util.user ( local , "dev" , com.google.gerrit.server.project.Util.DEVS ) ; assertFalse ( "u can't read" , u.controlForRef ( "refs/sb/dev/heads/foobar" ) . isVisible ( ) ) ; assertTrue ( "d can read" , d.controlForRef ( "refs/sb/dev/heads/foobar" ) . isVisible ( ) ) ; }

Target:
public void testUsernamePatternWithRegex ( ) { com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.project.Util.DEVS , "^refs/sb/${username}/heads/.*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , "d.v" , com.google.gerrit.server.project.Util.DEVS ) ; com.google.gerrit.server.project.ProjectControl d = util.user ( local , "dev" , com.google.gerrit.server.project.Util.DEVS ) ; org.junit.Assert.assertFalse ( "u can't read" , u.controlForRef ( "refs/sb/dev/heads/foobar" ) . isVisible ( ) ) ; org.junit.Assert.assertTrue ( "d can read" , d.controlForRef ( "refs/sb/dev/heads/foobar" ) . isVisible ( ) ) ; }
Source:
protected java.util.SortedSet < java.lang.String > cacheNames ( ) { final java.util.SortedSet < java.lang.String > names = new java.util.TreeSet < java.lang.String > ( ) ; names.add ( "groups" ) ; names.add ( "projects" ) ; names.add ( "accounts" ) ; for ( final net.sf.ehcache.Ehcache c : getAllCaches ( ) ) { names.add ( c.getName ( ) ) ; } return names ; }

Target:
protected java.util.SortedSet < java.lang.String > cacheNames ( ) { final java.util.SortedSet < java.lang.String > names = new java.util.TreeSet < java.lang.String > ( ) ; names.add ( "groups" ) ; names.add ( "accounts" ) ; for ( final net.sf.ehcache.Ehcache c : getAllCaches ( ) ) { names.add ( c.getName ( ) ) ; } return names ; }
Source:
public static void zipFile ( java.io.File file , java.lang.String name , java.util.zip.ZipOutputStream zip ) throws java.io.IOException { zip.putNextEntry ( new java.util.zip.ZipEntry ( name ) ) ; java.io.FileInputStream input = new java.io.FileInputStream ( file ) ; com.google.common.io.ByteStreams.copy ( input , zip ) ; input.close ( ) ; zip.closeEntry ( ) ; }

Target:
public static void zipFile ( java.io.File file , java.lang.String name , java.util.zip.ZipOutputStream zip ) throws java.io.IOException { zip.putNextEntry ( new java.util.zip.ZipEntry ( name ) ) ; try ( java.io.FileInputStream input = new java.io.FileInputStream ( file ) ) { com.google.common.io.ByteStreams.copy ( input , zip ) ; } zip.closeEntry ( ) ; }
Source:
private java.util.List < com.google.gerrit.reviewdb.client.PatchSetInfo.ParentInfo > toParentInfos ( final org.eclipse.jgit.revwalk.RevCommit [ ] parents , final org.eclipse.jgit.revwalk.RevWalk walk ) throws java.io.IOException , org.eclipse.jgit.errors.MissingObjectException { java.util.List < com.google.gerrit.reviewdb.client.PatchSetInfo.ParentInfo > pInfos = new java.util.ArrayList < com.google.gerrit.reviewdb.client.PatchSetInfo.ParentInfo > ( parents.length ) ; for ( org.eclipse.jgit.revwalk.RevCommit parent : parents ) { walk.parseBody ( parent ) ; com.google.gerrit.reviewdb.client.RevId rev = new com.google.gerrit.reviewdb.client.RevId ( parent.getId ( ) . name ( ) ) ; java.lang.String msg = parent.getShortMessage ( ) ; pInfos.add ( new com.google.gerrit.reviewdb.client.PatchSetInfo.ParentInfo ( rev , msg ) ) ; } return pInfos ; }

Target:
private java.util.List < com.google.gerrit.reviewdb.client.PatchSetInfo.ParentInfo > toParentInfos ( final org.eclipse.jgit.revwalk.RevCommit [ ] parents , final org.eclipse.jgit.revwalk.RevWalk walk ) throws java.io.IOException , org.eclipse.jgit.errors.MissingObjectException { java.util.List < com.google.gerrit.reviewdb.client.PatchSetInfo.ParentInfo > pInfos = new java.util.ArrayList ( parents.length ) ; for ( org.eclipse.jgit.revwalk.RevCommit parent : parents ) { walk.parseBody ( parent ) ; com.google.gerrit.reviewdb.client.RevId rev = new com.google.gerrit.reviewdb.client.RevId ( parent.getId ( ) . name ( ) ) ; java.lang.String msg = parent.getShortMessage ( ) ; pInfos.add ( new com.google.gerrit.reviewdb.client.PatchSetInfo.ParentInfo ( rev , msg ) ) ; } return pInfos ; }
Source:
public int compare ( com.google.gerrit.server.query.change.ChangeData a , com.google.gerrit.server.query.change.ChangeData b ) { try { return a.change ( db ) . getSortKey ( ) . compareTo ( b.change ( db ) . getSortKey ( ) ) ; } catch ( com.google.gwtorm.server.OrmException e ) { return 0 ; } }

Target:
public int compare ( com.google.gerrit.server.query.change.ChangeData a , com.google.gerrit.server.query.change.ChangeData b ) { try { return a.change ( ) . getSortKey ( ) . compareTo ( b.change ( ) . getSortKey ( ) ) ; } catch ( com.google.gwtorm.server.OrmException e ) { return 0 ; } }
Source:
private void applyReview ( com.google.gerrit.reviewdb.client.PatchSet patchSet , final com.google.gerrit.extensions.api.changes.ReviewInput review ) throws com.google.gerrit.extensions.restapi.RestApiException { com.google.gerrit.sshd.commands.line arguments ; com.google.gerrit.sshd.commands.task name ; com.google.gerrit.sshd.commands.and ssh_log ; gApi.changes ( ) . id ( patchSet.getId ( ) . getParentKey ( ) . get ( ) ) . revision ( patchSet.getRevision ( ) . get ( ) ) . review ( review ) ; }

Target:
private void applyReview ( com.google.gerrit.reviewdb.client.PatchSet patchSet , com.google.gerrit.extensions.api.changes.ReviewInput review ) throws com.google.gerrit.extensions.restapi.RestApiException { gApi.changes ( ) . id ( patchSet.getId ( ) . getParentKey ( ) . get ( ) ) . revision ( patchSet.getRevision ( ) . get ( ) ) . review ( review ) ; }
Source:
public void onUnload ( ) { if ( ( regNavigation ) != null ) { regNavigation.removeHandler ( ) ; regNavigation = null ; } if ( ( regAction ) != null ) { regAction.removeHandler ( ) ; regAction = null ; } super . onUnload ( ) ; }

Target:
protected void onUnload ( ) { if ( ( regNavigation ) != null ) { regNavigation.removeHandler ( ) ; regNavigation = null ; } if ( ( regAction ) != null ) { regAction.removeHandler ( ) ; regAction = null ; } super . onUnload ( ) ; }
Source:
public boolean updateChange ( com.google.gerrit.server.update.ChangeContext ctx ) throws com.google.gerrit.extensions.restapi.ResourceConflictException , com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.Change change = ctx.getChange ( ) ; com.google.gerrit.server.notedb.ChangeUpdate update = ctx.getUpdate ( change.currentPatchSetId ( ) ) ; change.setPrivate ( isPrivate ) ; change.setLastUpdatedOn ( ctx.getWhen ( ) ) ; update.setPrivate ( isPrivate ) ; addMessage ( ctx , update ) ; return true ; }

Target:
public boolean updateChange ( com.google.gerrit.server.update.ChangeContext ctx ) throws com.google.gerrit.extensions.restapi.ResourceConflictException , com.google.gwtorm.server.OrmException { change = ctx.getChange ( ) ; com.google.gerrit.server.notedb.ChangeUpdate update = ctx.getUpdate ( change.currentPatchSetId ( ) ) ; change.setPrivate ( isPrivate ) ; change.setLastUpdatedOn ( ctx.getWhen ( ) ) ; update.setPrivate ( isPrivate ) ; addMessage ( ctx , update ) ; return true ; }
Source:
public static void cherrypick ( int id , java.lang.String commit , java.lang.String destination , java.lang.String message , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.info.ChangeInfo > cb ) { com.google.gerrit.client.changes.ChangeApi.CherryPickInput cherryPickInput = com.google.gerrit.client.changes.ChangeApi.CherryPickInput.create ( ) ; cherryPickInput.setMessage ( message ) ; cherryPickInput.setDestination ( destination ) ; com.google.gerrit.client.changes.ChangeApi.call ( id , commit , "cherrypick" ) . post ( cherryPickInput , cb ) ; }

Target:
public static void cherrypick ( java.lang.String project , int id , java.lang.String commit , java.lang.String destination , java.lang.String message , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.info.ChangeInfo > cb ) { com.google.gerrit.client.changes.ChangeApi.CherryPickInput cherryPickInput = com.google.gerrit.client.changes.ChangeApi.CherryPickInput.create ( ) ; cherryPickInput.setMessage ( message ) ; cherryPickInput.setDestination ( destination ) ; com.google.gerrit.client.changes.ChangeApi.call ( project , id , commit , "cherrypick" ) . post ( cherryPickInput , cb ) ; }
Source:
private void init ( ) { android.widget.TextView commitMsg = ( ( android.widget.TextView ) ( v ( R.id.commitMessage ) ) ) ; commitMsg.setLinksClickable ( true ) ; v ( R.id.reviewButton ) . setOnClickListener ( new android.view.View.OnClickListener ( ) { @ java.lang.Override public void onClick ( android.view.View v ) { display ( com.google.reviewit.UnifiedDiffFragment.class ) ; } } ) ; com.google.reviewit.util.WidgetUtil.underline ( tv ( R.id.showMore ) ) ; com.google.reviewit.util.WidgetUtil.underline ( tv ( R.id.showAll ) ) ; }

Target:
private void init ( ) { tv ( R.id.commitMessage ) . setLinksClickable ( true ) ; }