auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void onFailure ( java.lang.Throwable caught ) { if ( ( ! ( isNoSuchEntity ( caught ) ) ) && ( ( rpcSequence ) == rpcseq ) ) { super . onFailure ( caught ) ; } }

Target:
protected void refresh ( final boolean isFirst ) { final int rpcseq = ++ ( rpcSequence ) ; PatchUtil.DETAIL_SVC.patchScript ( patchKey , idSideA , idSideB , scriptSettings , new com.google.gerrit.client.rpc.ScreenLoadCallback < com.google.gerrit.common.data.PatchScript > ( this ) { @ java.lang.Override protected void preDisplay ( final com.google.gerrit.common.data.PatchScript result ) { if ( ( rpcSequence ) == rpcseq ) { onResult ( result , isFirst ) ; } } @ java.lang.Override public void onFailure ( final java.lang.Throwable caught ) { if ( ( rpcSequence ) == rpcseq ) { super . onFailure ( caught ) ; } } } ) ; }
Source:
public UiAction.Description getDescription ( com.google.gerrit.server.change.RevisionResource rsrc ) { try { return new com.google.gerrit.extensions.webui.UiAction.Description ( ) . setLabel ( "Publish" ) . setTitle ( java.lang.String.format ( "Publish revision %d" , rsrc.getPatchSet ( ) . getPatchSetId ( ) ) ) . setVisible ( ( ( rsrc.getPatchSet ( ) . isDraft ( ) ) && ( rsrc.getControl ( ) . canPublish ( dbProvider.get ( ) ) ) ) ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new java.lang.IllegalStateException ( e ) ; } }

Target:
public UiAction.Description getDescription ( com.google.gerrit.server.change.RevisionResource rsrc ) { try { return new com.google.gerrit.extensions.webui.UiAction.Description ( ) . setLabel ( "Publish" ) . setTitle ( java.lang.String.format ( "Publish revision %d" , rsrc.getPatchSet ( ) . getPatchSetId ( ) ) ) . setVisible ( ( ( rsrc.getPatchSet ( ) . isDraft ( ) ) && ( changeControlFactory.controlFor ( rsrc.getNotes ( ) , rsrc.getUser ( ) ) . canPublish ( dbProvider.get ( ) ) ) ) ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new java.lang.IllegalStateException ( e ) ; } }
Source:
static void fireDialogVisible ( com.google.gwt.user.client.ui.Widget w , boolean visible ) { com.google.gwtexpui.user.client.UserAgent.bus.fireEvent ( new com.google.gwtexpui.user.client.DialogVisibleEvent ( w , visible ) ) ; }

Target:
private static int major ( java.lang.String ua , java.lang.String product ) { int entry = ua.indexOf ( product ) ; if ( entry >= 0 ) { java.lang.String s = ua.substring ( ( entry + ( product.length ( ) ) ) ) ; java.lang.String p = s.split ( "[ /;,.)]" , 2 ) [ 0 ] ; try { return java.lang.Integer.parseInt ( p ) ; } catch ( java.lang.NumberFormatException nan ) { } } return - 1 ; }
Source:
private static java.lang.String oldName ( com.google.gerrit.server.patch.PatchListEntry entry ) { switch ( entry.getChangeType ( ) ) { case ADDED : return null ; case DELETED : case MODIFIED : case REWRITE : return entry.getNewName ( ) ; case COPIED : case RENAMED : default : return entry.getOldName ( ) ; } }

Target:
private static java.lang.String oldName ( com.google.gerrit.server.diff.PatchListEntry entry ) { switch ( entry.getChangeType ( ) ) { case ADDED : return null ; case DELETED : case MODIFIED : case REWRITE : return entry.getNewName ( ) ; case COPIED : case RENAMED : default : return entry.getOldName ( ) ; } }
Source:
public void testWithSlashesInPath ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Project.NameKey p = createProject ( "a" ) ; org.eclipse.jgit.lib.Config cfg = new org.eclipse.jgit.lib.Config ( ) ; java.lang.String gitmodules = ( ( ( "" + ( ( "[submodule \"a\"]\n" + "path = a/b/c/d/e\n" ) + "url = http://localhost:80/" ) ) + ( p.get ( ) ) ) + "\n" ) + "branch = master\n" ; cfg.fromText ( gitmodules ) ; java.lang.String thisServer = com.google.gerrit.acceptance.git.SubmoduleSectionParserIT.THIS_SERVER ; com.google.gerrit.reviewdb.client.Branch.NameKey targetBranch = new com.google.gerrit.reviewdb.client.Branch.NameKey ( new com.google.gerrit.reviewdb.client.Project.NameKey ( "project" ) , "master" ) ; java.util.Set < com.google.gerrit.reviewdb.client.SubmoduleSubscription > res = new com.google.gerrit.server.util.SubmoduleSectionParser ( projectCache , cfg , thisServer , targetBranch ) . parseAllSections ( ) ; java.util.Set < com.google.gerrit.reviewdb.client.SubmoduleSubscription > expected = com.google.common.collect.Sets.newHashSet ( new com.google.gerrit.reviewdb.client.SubmoduleSubscription ( targetBranch , new com.google.gerrit.reviewdb.client.Branch.NameKey ( p , "master" ) , "a/b/c/d/e" ) ) ; com.google.common.truth.Truth.assertThat ( res ) . containsExactlyElementsIn ( expected ) ; }

Target:
public void testWithSlashesInPath ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Project.NameKey p = createProject ( "a" ) ; org.eclipse.jgit.lib.Config cfg = new org.eclipse.jgit.lib.Config ( ) ; cfg.fromText ( ( ( ( ( "" + ( ( "[submodule \"a\"]\n" + "path = a/b/c/d/e\n" ) + "url = http://localhost:80/" ) ) + ( p.get ( ) ) ) + "\n" ) + "branch = master\n" ) ) ; com.google.gerrit.reviewdb.client.Branch.NameKey targetBranch = new com.google.gerrit.reviewdb.client.Branch.NameKey ( new com.google.gerrit.reviewdb.client.Project.NameKey ( "project" ) , "master" ) ; java.util.Set < com.google.gerrit.reviewdb.client.SubmoduleSubscription > res = new com.google.gerrit.server.util.SubmoduleSectionParser ( projectCache , cfg , com.google.gerrit.acceptance.git.SubmoduleSectionParserIT.THIS_SERVER , targetBranch ) . parseAllSections ( ) ; java.util.Set < com.google.gerrit.reviewdb.client.SubmoduleSubscription > expected = com.google.common.collect.Sets.newHashSet ( new com.google.gerrit.reviewdb.client.SubmoduleSubscription ( targetBranch , new com.google.gerrit.reviewdb.client.Branch.NameKey ( p , "master" ) , "a/b/c/d/e" ) ) ; com.google.common.truth.Truth.assertThat ( res ) . containsExactlyElementsIn ( expected ) ; }
Source:
public void onRevisionCreated ( com.google.gerrit.extensions.events.RevisionCreatedListener.Event event ) { com.google.gerrit.extensions.common.ChangeInfo c = event.getChange ( ) ; onEvent ( new com.google.gerrit.reviewdb.client.Project.NameKey ( c.project ) , c._number , event.getWho ( ) . email ) ; }

Target:
public void onRevisionCreated ( com.google.gerrit.extensions.events.RevisionCreatedListener.Event event ) { com.google.gerrit.extensions.common.ChangeInfo c = event.getChange ( ) ; if ( ( ignoreDrafts ) && ( ( c.status ) == ( com.google.gerrit.extensions.client.ChangeStatus.DRAFT ) ) ) { com.googlesource.gerrit.plugins.reviewers.ChangeEventListener.log.debug ( "Ignoring draft change" ) ; return ; } onEvent ( new com.google.gerrit.reviewdb.client.Project.NameKey ( c.project ) , c._number , event.getWho ( ) . email ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { executorMock = org.mockito.Mockito.mock ( WorkQueue.Executor.class ) ; com.google.gerrit.server.git.WorkQueue workQueueMock = org.mockito.Mockito.mock ( com.google.gerrit.server.git.WorkQueue.class ) ; org.mockito.Mockito.when ( workQueueMock.createQueue ( 4 , "Sync remote index" ) ) . thenReturn ( executorMock ) ; com.ericsson.gerrit.plugins.syncindex.Configuration configMock = org.mockito.Mockito.mock ( com.ericsson.gerrit.plugins.syncindex.Configuration.class ) ; org.mockito.Mockito.when ( configMock.getThreadPoolSize ( ) ) . thenReturn ( 4 ) ; syncIndexExecutorProvider = new com.ericsson.gerrit.plugins.syncindex.SyncIndexExecutorProvider ( workQueueMock , configMock ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { executorMock = org.mockito.Mockito.mock ( WorkQueue.Executor.class ) ; com.google.gerrit.server.git.WorkQueue workQueueMock = org.mockito.Mockito.mock ( com.google.gerrit.server.git.WorkQueue.class ) ; org.mockito.Mockito.when ( workQueueMock.createQueue ( 4 , "Sync remote index" ) ) . thenReturn ( executorMock ) ; com.ericsson.gerrit.plugins.multimaster.Configuration configMock = org.mockito.Mockito.mock ( com.ericsson.gerrit.plugins.multimaster.Configuration.class ) ; org.mockito.Mockito.when ( configMock.getThreadPoolSize ( ) ) . thenReturn ( 4 ) ; syncIndexExecutorProvider = new com.ericsson.gerrit.plugins.multimaster.SyncIndexExecutorProvider ( workQueueMock , configMock ) ; }
Source:
public static com.google.gerrit.common.data.PermissionRule allow ( com.google.gerrit.server.git.ProjectConfig project , java.lang.String capabilityName , com.google.gerrit.reviewdb.client.AccountGroup.UUID group ) { com.google.gerrit.common.data.PermissionRule rule = com.google.gerrit.server.project.testing.Util.newRule ( project , group ) ; project.getAccessSection ( AccessSection.GLOBAL_CAPABILITIES , true ) . getPermission ( capabilityName , true ) . add ( rule ) ; if ( com.google.gerrit.common.data.GlobalCapability.hasRange ( capabilityName ) ) { com.google.gerrit.common.data.PermissionRange.WithDefaults range = com.google.gerrit.common.data.GlobalCapability.getRange ( capabilityName ) ; if ( range != null ) { rule.setRange ( range.getDefaultMin ( ) , range.getDefaultMax ( ) ) ; } } return rule ; }

Target:
public static com.google.gerrit.common.data.PermissionRule allow ( com.google.gerrit.server.project.ProjectConfig project , java.lang.String capabilityName , com.google.gerrit.reviewdb.client.AccountGroup.UUID group ) { com.google.gerrit.common.data.PermissionRule rule = com.google.gerrit.server.project.testing.Util.newRule ( project , group ) ; project.getAccessSection ( AccessSection.GLOBAL_CAPABILITIES , true ) . getPermission ( capabilityName , true ) . add ( rule ) ; if ( com.google.gerrit.common.data.GlobalCapability.hasRange ( capabilityName ) ) { com.google.gerrit.common.data.PermissionRange.WithDefaults range = com.google.gerrit.common.data.GlobalCapability.getRange ( capabilityName ) ; if ( range != null ) { rule.setRange ( range.getDefaultMin ( ) , range.getDefaultMax ( ) ) ; } } return rule ; }
Source:
protected void configure ( ) { install ( new com.google.gerrit.server.rules.PrologModule.EnvironmentModule ( ) ) ; bind ( PrologEnvironment.Args.class ) ; bind ( com.google.gerrit.server.rules.PrologRule.class ) ; factory ( PrologRuleEvaluator.Factory.class ) ; }

Target:
protected void configure ( ) { install ( new com.google.gerrit.server.rules.PrologModule.EnvironmentModule ( ) ) ; bind ( PrologEnvironment.Args.class ) ; factory ( PrologRuleEvaluator.Factory.class ) ; bind ( com.google.gerrit.server.rules.SubmitRule.class ) . annotatedWith ( com.google.gerrit.extensions.annotations.Exports.named ( "PrologRule" ) ) . to ( com.google.gerrit.server.rules.PrologRule.class ) ; }
Source:
com.google.common.util.concurrent.ListeningExecutorService getBatchIndexExecutor ( @ com.google.gerrit.server.config.GerritServerConfig org.eclipse.jgit.lib.Config config , com.google.gerrit.server.git.WorkQueue workQueue ) { if ( ( batchExecutor ) != null ) { return batchExecutor ; } int threads = config.getInt ( "index" , null , "batchThreads" , 0 ) ; if ( threads <= 0 ) { threads = java.lang.Runtime.getRuntime ( ) . availableProcessors ( ) ; } return com.google.common.util.concurrent.MoreExecutors.listeningDecorator ( workQueue.createQueue ( threads , "Index-Batch" ) ) ; }

Target:
com.google.common.util.concurrent.ListeningExecutorService getBatchIndexExecutor ( @ com.google.gerrit.server.config.GerritServerConfig org.eclipse.jgit.lib.Config config , com.google.gerrit.server.git.WorkQueue workQueue ) { if ( ( batchExecutor ) != null ) { return batchExecutor ; } int batchThreads = this . threads ; if ( batchThreads <= 0 ) { batchThreads = config.getInt ( "index" , null , "batchThreads" , 0 ) ; } if ( batchThreads <= 0 ) { batchThreads = java.lang.Runtime.getRuntime ( ) . availableProcessors ( ) ; } return com.google.common.util.concurrent.MoreExecutors.listeningDecorator ( workQueue.createQueue ( batchThreads , "Index-Batch" ) ) ; }
Source:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { java.util.List < java.lang.String > value = getValues ( row ) ; java.util.List < java.lang.String > nextValue = getValues ( ( row + 1 ) ) ; populate ( row , nextValue , false ) ; populate ( ( row + 1 ) , value , ( ( row + 1 ) == ( ( table.getRowCount ( ) ) - 1 ) ) ) ; widget.setEnabled ( true ) ; }

Target:
void moveDown ( int row ) { swap ( row , ( row + 1 ) ) ; }
Source:
private java.util.List < com.google.gerrit.extensions.common.SuggestedReviewerInfo > suggestReviewers ( com.google.gerrit.server.api.changes.SuggestedReviewersRequest r ) throws com.google.gerrit.extensions.restapi.RestApiException { try { com.google.gerrit.server.change.SuggestReviewers mySuggestReviewers = suggestReviewers.get ( ) ; mySuggestReviewers.setQuery ( r.getQuery ( ) ) ; mySuggestReviewers.setLimit ( r.getLimit ( ) ) ; return mySuggestReviewers.apply ( change ) ; } catch ( com.google.gwtorm.server.OrmException | java.io.IOException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot retrieve suggested reviewers" , e ) ; } }

Target:
private java.util.List < com.google.gerrit.extensions.common.SuggestedReviewerInfo > suggestReviewers ( com.google.gerrit.server.api.changes.SuggestedReviewersRequest r ) throws com.google.gerrit.extensions.restapi.RestApiException { try { com.google.gerrit.server.change.SuggestChangeReviewers mySuggestReviewers = suggestReviewers.get ( ) ; mySuggestReviewers.setQuery ( r.getQuery ( ) ) ; mySuggestReviewers.setLimit ( r.getLimit ( ) ) ; return mySuggestReviewers.apply ( change ) ; } catch ( com.google.gwtorm.server.OrmException | java.io.IOException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot retrieve suggested reviewers" , e ) ; } }
Source:
public < T > com.google.gwtjsonrpc.common.AsyncCallback < T > addGwtjsonrpc ( final com.google.gwtjsonrpc.common.AsyncCallback < T > cb ) { callbacks.add ( cb ) ; return new com.google.gwtjsonrpc.common.AsyncCallback < com.google.gerrit.client.rpc.T > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.rpc.T result ) { results.put ( cb , result ) ; com.google.gerrit.client.rpc.CallbackGroup.this . onSuccess ( ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { com.google.gerrit.client.rpc.CallbackGroup.this . onFailure ( caught ) ; } } ; }

Target:
public < T > com.google.gerrit.client.rpc.CallbackGroup.Callback < T > addFinal ( final com.google.gwt.user.client.rpc.AsyncCallback < T > cb ) { checkFinalAdded ( ) ; finalAdded = true ; return handleAdd ( cb ) ; }
Source:
public void testIsEnabledEventSingleBranchNonMatchingRegExp ( ) { java.lang.String [ ] branches = new java.lang.String [ ] { "^refs/heads/foo.*" } ; setupIsEnabled ( "true" , null , branches ) ; com.google.gerrit.server.events.PatchSetCreatedEvent event = new com.google.gerrit.server.events.PatchSetCreatedEvent ( ) ; event.change = new com.google.gerrit.server.data.ChangeAttribute ( ) ; event.change.project = "testProject" ; event.change.branch = "testBranch" ; com.googlesource.gerrit.plugins.its.base.its.ItsConfig itsConfig = createItsConfig ( ) ; replayMocks ( ) ; assertFalse ( itsConfig.isEnabled ( event ) ) ; }

Target:
public void testIsEnabledEventSingleBranchRegExp ( ) { java.lang.String [ ] branches = new java.lang.String [ ] { "^refs/heads/test.*" } ; setupIsEnabled ( "true" , null , branches ) ; com.google.gerrit.server.events.PatchSetCreatedEvent event = new com.google.gerrit.server.events.PatchSetCreatedEvent ( ) ; com.google.gerrit.server.data.ChangeAttribute changeAttribute = new com.google.gerrit.server.data.ChangeAttribute ( ) ; changeAttribute.project = "testProject" ; changeAttribute.branch = "testBranch" ; event.change = com.google.common.base.Suppliers.ofInstance ( changeAttribute ) ; com.googlesource.gerrit.plugins.its.base.its.ItsConfig itsConfig = createItsConfig ( ) ; replayMocks ( ) ; assertTrue ( itsConfig.isEnabled ( event ) ) ; }
Source:
private com.google.inject.Injector createSysInjector ( ) { return dbInjector.createChildInjector ( new com.google.inject.AbstractModule ( ) { @ java.lang.Override public void configure ( ) { install ( dbInjector.getInstance ( com.google.gerrit.pgm.util.BatchProgramModule.class ) ) ; install ( com.google.gerrit.server.git.SearchingChangeCacheImpl.module ( ) ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.extensions.events.GitReferenceUpdatedListener.class ) . to ( com.google.gerrit.server.index.change.ReindexAfterUpdate.class ) ; install ( new com.google.gerrit.server.index.DummyIndexModule ( ) ) ; } } ) ; }

Target:
private com.google.inject.Injector createSysInjector ( ) { return dbInjector.createChildInjector ( new com.google.gerrit.extensions.config.FactoryModule ( ) { @ java.lang.Override public void configure ( ) { install ( dbInjector.getInstance ( com.google.gerrit.pgm.util.BatchProgramModule.class ) ) ; install ( com.google.gerrit.server.git.SearchingChangeCacheImpl.module ( ) ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.extensions.events.GitReferenceUpdatedListener.class ) . to ( com.google.gerrit.server.index.change.ReindexAfterUpdate.class ) ; install ( new com.google.gerrit.server.index.DummyIndexModule ( ) ) ; factory ( ChangeResource.Factory.class ) ; } } ) ; }
Source:
public void testUnblockLargerScope_Fails ( ) { com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.ANONYMOUS , "refs/heads/master" ) . setBlock ( ) ; com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; org.junit.Assert.assertFalse ( "u can't push" , u.controlForRef ( "refs/heads/master" ) . canUpdate ( ) ) ; }

Target:
public void testUnblockLargerScope_Fails ( ) { com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/master" ) . setBlock ( ) ; com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; org.junit.Assert.assertFalse ( "u can't push" , u.controlForRef ( "refs/heads/master" ) . canUpdate ( ) ) ; }
Source:
private static com.google.gerrit.client.change.PatchSetsBox getRevisionBox ( com.google.gwt.dom.client.NativeEvent event ) { com.google.gerrit.client.change.Element e = event.getEventTarget ( ) . cast ( ) ; for ( e = com.google.gwt.user.client.DOM.getParent ( e ) ; e != null ; e = com.google.gwt.user.client.DOM.getParent ( e ) ) { com.google.gwt.user.client.EventListener l = com.google.gwt.user.client.DOM.getEventListener ( e ) ; if ( l instanceof com.google.gerrit.client.change.PatchSetsBox ) { return ( ( com.google.gerrit.client.change.PatchSetsBox ) ( l ) ) ; } } return null ; }

Target:
private static com.google.gerrit.client.change.PatchSetsBox getRevisionBox ( com.google.gwt.dom.client.NativeEvent event ) { com.google.gwt.dom.client.Element e = event.getEventTarget ( ) . cast ( ) ; for ( e = com.google.gwt.user.client.DOM.getParent ( e ) ; e != null ; e = com.google.gwt.user.client.DOM.getParent ( e ) ) { com.google.gwt.user.client.EventListener l = com.google.gwt.user.client.DOM.getEventListener ( e ) ; if ( l instanceof com.google.gerrit.client.change.PatchSetsBox ) { return ( ( com.google.gerrit.client.change.PatchSetsBox ) ( l ) ) ; } } return null ; }
Source:
void restore ( com.googlecode.prolog_cafe.lang.Prolog engine ) { engine.cont = this . cont ; engine.areg1 = this . areg1 ; engine.areg2 = this . areg2 ; engine.areg3 = this . areg3 ; engine.areg4 = this . areg4 ; engine.areg5 = this . areg5 ; engine.areg6 = this . areg6 ; engine.areg7 = this . areg7 ; }

Target:
void restore ( com.googlecode.prolog_cafe.lang.Prolog engine ) { engine.cont = this . cont ; engine.r1 = this . r1 ; engine.r2 = this . r2 ; engine.r3 = this . r3 ; engine.r4 = this . r4 ; engine.r5 = this . r5 ; engine.r6 = this . r6 ; engine.r7 = this . r7 ; }
Source:
com.google.gerrit.client.diff.DraftBox addReply ( com.google.gerrit.client.changes.CommentInfo replyTo , java.lang.String initMessage , boolean doSave ) { com.google.gerrit.common.changes.Side side = replyTo.side ( ) ; int line = replyTo.line ( ) ; com.google.gerrit.client.changes.CommentInfo info = com.google.gerrit.client.changes.CommentInfo.create ( path , side , line , replyTo.id ( ) , initMessage ) ; return addDraftBox ( info , doSave ) ; }

Target:
private com.google.gerrit.client.diff.DraftBox addNewDraft ( net.codemirror.lib.CodeMirror cm , int line ) { return addDraftBox ( com.google.gerrit.client.changes.CommentInfo.createLine ( path , getSideFromCm ( cm ) , ( line + 1 ) , null , null ) ) ; }
Source:
protected void configure ( ) { factory ( ForwardingRemovalListener.Factory.class ) ; }

Target:
protected void configure ( ) { factory ( ForwardingRemovalListener.Factory.class ) ; bind ( com.google.gerrit.server.cache.h2.DefaultCacheFactory.class ) ; bind ( com.google.gerrit.server.cache.MemoryCacheFactory.class ) . to ( com.google.gerrit.server.cache.h2.DefaultCacheFactory.class ) ; bind ( com.google.gerrit.server.cache.PersistentCacheFactory.class ) . to ( com.google.gerrit.server.cache.h2.H2CacheFactory.class ) ; listener ( ) . to ( com.google.gerrit.server.cache.h2.H2CacheFactory.class ) ; }
Source:
public static void writeString ( final java.io.OutputStream output , final java.lang.String s ) throws java.io.IOException { if ( s == null ) { com.google.gerrit.server.ioutil.BasicSerialization.writeVarInt32 ( output , 0 ) ; } else { com.google.gerrit.server.ioutil.BasicSerialization.writeBytes ( output , s.getBytes ( "UTF-8" ) ) ; } }

Target:
public static void writeString ( final java.io.OutputStream output , final java.lang.String s ) throws java.io.IOException { if ( s == null ) { com.google.gerrit.server.ioutil.BasicSerialization.writeVarInt32 ( output , 0 ) ; } else { com.google.gerrit.server.ioutil.BasicSerialization.writeBytes ( output , s.getBytes ( java.nio.charset.StandardCharsets.UTF_8 ) ) ; } }
Source:
public com.google.gitiles.GitilesView.Builder setRevision ( com.google.gitiles.Revision revision ) { switch ( type ) { case HOST_INDEX : case REPOSITORY_INDEX : throw new java.lang.IllegalStateException ( java.lang.String.format ( "cannot set revision on %s view" , type ) ) ; default : this . revision = com.google.common.base.Preconditions.checkNotNull ( revision ) ; return this ; } }

Target:
public com.google.gitiles.GitilesView.Builder setRevision ( com.google.gitiles.Revision revision ) { switch ( type ) { case HOST_INDEX : case REPOSITORY_INDEX : case REFS : throw new java.lang.IllegalStateException ( java.lang.String.format ( "cannot set revision on %s view" , type ) ) ; default : this . revision = com.google.common.base.Preconditions.checkNotNull ( revision ) ; return this ; } }
Source:
private void assertDeleteForbidden ( ) throws java.lang.Exception { com.google.common.truth.Truth.assertThat ( branch ( ) . get ( ) . canDelete ) . isNull ( ) ; exception.expect ( com.google.gerrit.extensions.restapi.AuthException.class ) ; exception.expectMessage ( "delete not permitted" ) ; branch ( ) . delete ( ) ; }

Target:
private void assertDeleteByRestSucceeds ( com.google.gerrit.reviewdb.client.Branch.NameKey branch , java.lang.String ref ) throws java.lang.Exception { com.google.gerrit.acceptance.RestResponse r = userRestSession.delete ( ( ( ( "/projects/" + ( com.google.gerrit.extensions.restapi.IdString.fromDecoded ( project.get ( ) ) . encoded ( ) ) ) + "/branches/" ) + ( com.google.gerrit.extensions.restapi.IdString.fromDecoded ( ref ) . encoded ( ) ) ) ) ; r.assertNoContent ( ) ; exception.expect ( com.google.gerrit.extensions.restapi.ResourceNotFoundException.class ) ; branch ( branch ) . get ( ) ; }
Source:
protected void configureServlets ( ) { java.lang.Class < ? extends javax.servlet.Filter > authFilter ; if ( authConfig.isTrustContainerAuth ( ) ) { authFilter = com.google.gerrit.httpd.ContainerAuthFilter.class ; } else if ( authConfig.isGitBasicAuth ( ) ) { authFilter = com.google.gerrit.httpd.ProjectBasicAuthFilter.class ; } else { authFilter = com.google.gerrit.httpd.ProjectDigestFilter.class ; } java.lang.String git = GitOverHttpServlet.URL_REGEX ; filterRegex ( git ) . through ( authFilter ) ; serveRegex ( git ) . with ( com.google.gerrit.httpd.GitOverHttpServlet.class ) ; filter ( "/a/*" ) . through ( authFilter ) ; }

Target:
protected void configureServlets ( ) { java.lang.Class < ? extends javax.servlet.Filter > authFilter ; if ( authConfig.isTrustContainerAuth ( ) ) { authFilter = com.google.gerrit.httpd.ContainerAuthFilter.class ; } else if ( authConfig.isGitBasicAuth ( ) ) { authFilter = com.google.gerrit.httpd.ProjectBasicAuthFilter.class ; } else { authFilter = com.google.gerrit.httpd.ProjectDigestFilter.class ; } if ( isHttpEnabled ( ) ) { java.lang.String git = GitOverHttpServlet.URL_REGEX ; filterRegex ( git ) . through ( authFilter ) ; serveRegex ( git ) . with ( com.google.gerrit.httpd.GitOverHttpServlet.class ) ; } filter ( "/a/*" ) . through ( authFilter ) ; }
Source:
public boolean canDelete ( ) { if ( ( ! ( canWrite ( ) ) ) || ( RefNames.REFS_CONFIG.equals ( refName ) ) ) { return false ; } switch ( getCurrentUser ( ) . getAccessPath ( ) ) { case GIT : return canPushWithForce ( ) ; default : return ( ( getCurrentUser ( ) . getCapabilities ( ) . canAdministrateServer ( ) ) || ( ( isOwner ( ) ) && ( ! ( isForceBlocked ( Permission.PUSH ) ) ) ) ) || ( canPushWithForce ( ) ) ; } }

Target:
public boolean canDelete ( ) { if ( ( ! ( canWrite ( ) ) ) || ( RefNames.REFS_CONFIG.equals ( refName ) ) ) { return false ; } switch ( getUser ( ) . getAccessPath ( ) ) { case GIT : return canPushWithForce ( ) ; default : return ( ( getUser ( ) . getCapabilities ( ) . canAdministrateServer ( ) ) || ( ( isOwner ( ) ) && ( ! ( isForceBlocked ( Permission.PUSH ) ) ) ) ) || ( canPushWithForce ( ) ) ; } }
Source:
public java.util.List < com.google.gerrit.server.group.MembersCollection.MemberInfo > apply ( final com.google.gerrit.server.group.GroupResource resource ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.BadRequestException , com.google.gerrit.extensions.restapi.ResourceConflictException , java.lang.Exception { return com.google.common.collect.Lists.newLinkedList ( getMembers ( resource.getGroupUUID ( ) , recursive , new java.util.HashSet < com.google.gerrit.reviewdb.client.AccountGroup.UUID > ( ) ) . values ( ) ) ; }

Target:
public int compare ( com.google.gerrit.server.group.MembersCollection.MemberInfo a , com.google.gerrit.server.group.MembersCollection.MemberInfo b ) { return com.google.common.collect.ComparisonChain.start ( ) . compare ( a.fullName , b.fullName , com.google.common.collect.Ordering.natural ( ) . nullsFirst ( ) ) . compare ( a.preferredEmail , b.preferredEmail , com.google.common.collect.Ordering.natural ( ) . nullsFirst ( ) ) . compare ( a.id , b.id , com.google.common.collect.Ordering.natural ( ) . nullsFirst ( ) ) . result ( ) ; }
Source:
public com.google.gitiles.GitilesView.Builder setRevision ( com.google.gitiles.Revision revision ) { switch ( type ) { case HOST_INDEX : case REPOSITORY_INDEX : case REFS : case DESCRIBE : throw new java.lang.IllegalStateException ( java.lang.String.format ( "cannot set revision on %s view" , type ) ) ; default : this . revision = com.google.common.base.Preconditions.checkNotNull ( revision ) ; return this ; } }

Target:
public com.google.gitiles.GitilesView.Builder setRevision ( com.google.gitiles.Revision revision ) { switch ( type ) { case HOST_INDEX : case REPOSITORY_INDEX : case REFS : case DESCRIBE : throw new java.lang.IllegalStateException ( java.lang.String.format ( "cannot set revision on %s view" , type ) ) ; case ARCHIVE : case BLAME : case DIFF : case DOC : case LOG : case PATH : case REVISION : case ROOTED_DOC : case SHOW : default : this . revision = com.google.common.base.Preconditions.checkNotNull ( revision ) ; return this ; } }
Source:
private void checkUserSession ( javax.servlet.http.HttpServletRequest req ) throws com.google.gerrit.extensions.restapi.AuthException { com.google.gerrit.server.CurrentUser user = globals.currentUser.get ( ) ; if ( com.google.gerrit.httpd.restapi.RestApiServlet.isStateChange ( req ) ) { if ( user instanceof com.google.gerrit.server.AnonymousUser ) { throw new com.google.gerrit.extensions.restapi.AuthException ( "Authentication required" ) ; } else if ( ! ( globals.webSession.get ( ) . isAccessPathOk ( AccessPath.REST_API ) ) ) { throw new com.google.gerrit.extensions.restapi.AuthException ( ( "Invalid authentication method. In order to authenticate, " + "prefix the REST endpoint URL with /a/ (e.g. http://example.com/a/projects/)." ) ) ; } } user.setAccessPath ( AccessPath.REST_API ) ; }

Target:
private void checkUserSession ( javax.servlet.http.HttpServletRequest req ) throws com.google.gerrit.extensions.restapi.AuthException { com.google.gerrit.server.CurrentUser user = globals.currentUser.get ( ) ; if ( com.google.gerrit.httpd.restapi.RestApiServlet.isRead ( req ) ) { user.setAccessPath ( AccessPath.REST_API ) ; } else if ( user instanceof com.google.gerrit.server.AnonymousUser ) { throw new com.google.gerrit.extensions.restapi.AuthException ( "Authentication required" ) ; } else if ( ! ( globals.webSession.get ( ) . isAccessPathOk ( AccessPath.REST_API ) ) ) { throw new com.google.gerrit.extensions.restapi.AuthException ( ( "Invalid authentication method. In order to authenticate, " + "prefix the REST endpoint URL with /a/ (e.g. http://example.com/a/projects/)." ) ) ; } }
Source:
protected void configure ( ) { install ( new com.google.inject.assistedinject.FactoryModuleBuilder ( ) . implement ( com.google.gerrit.server.index.change.ChangeIndex.class , com.google.gerrit.lucene.LuceneChangeIndex.class ) . build ( ChangeIndex.Factory.class ) ) ; install ( new com.google.inject.assistedinject.FactoryModuleBuilder ( ) . implement ( com.google.gerrit.server.index.account.AccountIndex.class , com.google.gerrit.lucene.LuceneAccountIndex.class ) . build ( AccountIndex.Factory.class ) ) ; install ( new com.google.gerrit.server.index.IndexModule ( threads ) ) ; if ( ( singleVersions ) == null ) { install ( new com.google.gerrit.lucene.LuceneIndexModule.MultiVersionModule ( ) ) ; } else { install ( new com.google.gerrit.lucene.LuceneIndexModule.SingleVersionModule ( singleVersions ) ) ; } }

Target:
protected void configure ( ) { install ( new com.google.inject.assistedinject.FactoryModuleBuilder ( ) . implement ( com.google.gerrit.server.index.change.ChangeIndex.class , com.google.gerrit.lucene.LuceneChangeIndex.class ) . build ( ChangeIndex.Factory.class ) ) ; install ( new com.google.inject.assistedinject.FactoryModuleBuilder ( ) . implement ( com.google.gerrit.server.index.account.AccountIndex.class , com.google.gerrit.lucene.LuceneAccountIndex.class ) . build ( AccountIndex.Factory.class ) ) ; install ( new com.google.gerrit.server.index.IndexModule ( threads ) ) ; if ( ( singleVersions ) == null ) { install ( new com.google.gerrit.lucene.LuceneIndexModule.MultiVersionModule ( ) ) ; } else { install ( new com.google.gerrit.index.SingleVersionModule ( singleVersions ) ) ; } }
Source:
private static void addExtensionLink ( final com.google.gerrit.client.ui.LinkMenuBar m , final com.google.gerrit.client.extensions.TopMenuItem item ) { final com.google.gwt.user.client.ui.Anchor atag = com.google.gerrit.client.Gerrit.anchor ( item.getName ( ) , item.getUrl ( ) ) ; atag.setTarget ( item.getTarget ( ) ) ; if ( ( item.getId ( ) ) != null ) { atag.getElement ( ) . setAttribute ( "id" , item.getId ( ) ) ; } m.add ( atag ) ; }

Target:
private static void addExtensionLink ( com.google.gerrit.client.ui.LinkMenuBar m , com.google.gerrit.client.extensions.TopMenuItem item ) { com.google.gwt.user.client.ui.Anchor atag = com.google.gerrit.client.Gerrit.anchor ( item.getName ( ) , com.google.gerrit.client.Gerrit.selfRedirect ( item.getUrl ( ) ) ) ; atag.setTarget ( item.getTarget ( ) ) ; if ( ( item.getId ( ) ) != null ) { atag.getElement ( ) . setAttribute ( "id" , item.getId ( ) ) ; } m.add ( atag ) ; }
Source:
protected static java.util.List < java.lang.Integer > query ( com.google.gerrit.extensions.api.changes.Changes.QueryRequest query ) throws java.lang.Exception { return com.google.common.collect.FluentIterable.from ( query.get ( ) ) . transform ( new com.google.common.base.Function < com.google.gerrit.extensions.common.ChangeInfo , java.lang.Integer > ( ) { @ java.lang.Override public java.lang.Integer apply ( com.google.gerrit.extensions.common.ChangeInfo in ) { return in._number ; } } ) . toList ( ) ; }

Target:
protected void assertBadQuery ( com.google.gerrit.extensions.api.changes.Changes.QueryRequest query ) throws java.lang.Exception { exception.expect ( com.google.gerrit.extensions.restapi.BadRequestException.class ) ; query.get ( ) ; }
Source:
private static java.lang.String imgSrc ( java.lang.String val ) { if ( ( ( val.startsWith ( "http:" ) ) || ( val.startsWith ( "https:" ) ) ) && ( com.google.gitiles.doc.html.HtmlBuilder.URI.getValueFilter ( ) . matcher ( val ) . find ( ) ) ) { return com.google.gitiles.doc.html.HtmlBuilder.URI.escape ( val ) ; } if ( com.google.gitiles.doc.html.HtmlBuilder.IMAGE_DATA.getValueFilter ( ) . matcher ( val ) . find ( ) ) { return val ; } return com.google.gitiles.doc.html.HtmlBuilder.IMAGE_DATA.getInnocuousOutput ( ) ; }

Target:
public static boolean isImageDataUri ( java.lang.String url ) { return com.google.gitiles.doc.html.HtmlBuilder.IMAGE_DATA.getValueFilter ( ) . matcher ( url ) . find ( ) ; }
Source:
private void restoreSelection ( ) { if ( ( getFromTo ( ) ) != null ) { getCm ( ) . setSelection ( getFromTo ( ) . getFrom ( ) , getFromTo ( ) . getTo ( ) ) ; } }

Target:
private void restoreSelection ( ) { if ( ( ( getFromTo ( ) ) != null ) && ( ( comment.in_reply_to ( ) ) == null ) ) { getCm ( ) . setSelection ( getFromTo ( ) . getFrom ( ) , getFromTo ( ) . getTo ( ) ) ; } }
Source:
public com.googlesource.gerrit.plugins.github.oauth.GitHubLogin get ( java.lang.String username ) { try { com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.AccessToken accessToken = newAccessTokenFromUser ( username ) ; if ( accessToken != null ) { com.googlesource.gerrit.plugins.github.oauth.GitHubLogin login = new com.googlesource.gerrit.plugins.github.oauth.GitHubLogin ( config ) ; login.login ( accessToken ) ; return login ; } return null ; } catch ( java.io.IOException e ) { com.googlesource.gerrit.plugins.github.oauth.IdentifiedUserGitHubLoginProvider.log.error ( ( ( "Cannot login to GitHub as '" + username ) + "'" ) , e ) ; return null ; } }

Target:
public com.googlesource.gerrit.plugins.github.oauth.GitHubLogin get ( java.lang.String username ) { try { com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.AccessToken accessToken = newAccessTokenFromUser ( username ) ; if ( accessToken != null ) { com.googlesource.gerrit.plugins.github.oauth.GitHubLogin login = new com.googlesource.gerrit.plugins.github.oauth.GitHubLogin ( config , httpConnector ) ; login.login ( accessToken ) ; return login ; } return null ; } catch ( java.io.IOException e ) { com.googlesource.gerrit.plugins.github.oauth.IdentifiedUserGitHubLoginProvider.log.error ( ( ( "Cannot login to GitHub as '" + username ) + "'" ) , e ) ; return null ; } }
Source:
public void start ( ) { queue.start ( ) ; if ( ( ( srvInfo.getState ( ) ) == ( ServerInformation.State.STARTUP ) ) && ( config.isReplicateAllOnPluginStart ( ) ) ) { com.googlesource.gerrit.plugins.replication.ReplicationState state = new com.googlesource.gerrit.plugins.replication.ReplicationState ( ) ; pushAllFuture.set ( pushAll.create ( null , 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 ( ) ; pushAllFuture.set ( pushAll.create ( null , com.googlesource.gerrit.plugins.replication.ReplicationFilter.all ( ) , state ) . schedule ( 30 , java.util.concurrent.TimeUnit.SECONDS ) ) ; } }
Source:
public com.google.gwtjsonrpc.client.VoidResult call ( ) throws com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.client.OrmException , java.io.IOException { final com.google.gerrit.reviewdb.Change.Id changeId = patchSetId.getParentKey ( ) ; final com.google.gerrit.server.project.ChangeControl control = changeControlFactory.validateFor ( changeId ) ; if ( ! ( control.canDelete ( db ) ) ) { throw new com.google.gerrit.server.project.NoSuchChangeException ( changeId ) ; } com.google.gerrit.server.ChangeUtil.deleteDraftChange ( patchSetId , gitManager , replication , db ) ; return com.google.gwtjsonrpc.client.VoidResult.INSTANCE ; }

Target:
public com.google.gwtjsonrpc.client.VoidResult call ( ) throws com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.client.OrmException , java.io.IOException { final com.google.gerrit.reviewdb.Change.Id changeId = patchSetId.getParentKey ( ) ; final com.google.gerrit.server.project.ChangeControl control = changeControlFactory.validateFor ( changeId ) ; if ( ! ( control.canDeleteDraft ( db ) ) ) { throw new com.google.gerrit.server.project.NoSuchChangeException ( changeId ) ; } com.google.gerrit.server.ChangeUtil.deleteDraftChange ( patchSetId , gitManager , replication , db ) ; return com.google.gwtjsonrpc.client.VoidResult.INSTANCE ; }
Source:
public int compare ( com.google.gerrit.extensions.common.AccountInfo a , com.google.gerrit.extensions.common.AccountInfo b ) { return com.google.common.collect.ComparisonChain.start ( ) . compare ( a.name , b.name , com.google.common.collect.Ordering.natural ( ) . nullsFirst ( ) ) . compare ( a.email , b.email , com.google.common.collect.Ordering.natural ( ) . nullsFirst ( ) ) . compare ( a._accountId , b._accountId , com.google.common.collect.Ordering.natural ( ) . nullsFirst ( ) ) . result ( ) ; }

Target:
private java.util.Collection < com.google.gerrit.extensions.common.AccountInfo > toAccountInfo ( java.util.Collection < com.google.gerrit.reviewdb.client.Account.Id > accounts ) { return com.google.common.collect.FluentIterable.from ( accounts ) . transform ( new com.google.common.base.Function < com.google.gerrit.reviewdb.client.Account.Id , com.google.gerrit.extensions.common.AccountInfo > ( ) { @ java.lang.Override public com.google.gerrit.extensions.common.AccountInfo apply ( com.google.gerrit.reviewdb.client.Account.Id id ) { return accountLoader.get ( id ) ; } } ) . toSortedList ( AccountInfoComparator.ORDER_NULLS_FIRST ) ; }
Source:
void apply ( com.google.gerrit.server.notedb.ChangeUpdate update ) throws com.google.gwtorm.server.OrmException { checkUpdate ( update ) ; update.fixStatus ( status ) ; noteDbChange.setStatus ( status ) ; }

Target:
void apply ( com.google.gerrit.server.notedb.ChangeUpdate update ) throws com.google.gwtorm.server.OrmException { checkUpdate ( update ) ; update.fixStatus ( status ) ; noteDbChange.setStatus ( status ) ; if ( ( status ) == ( Change.Status.MERGED ) ) { update.setSubmissionId ( change.getSubmissionId ( ) ) ; noteDbChange.setSubmissionId ( change.getSubmissionId ( ) ) ; } }
Source:
protected com.google.gerrit.server.change.ChangeJson.ChangeInfo queryOne ( java.lang.Object query ) throws java.lang.Exception { java.util.List < com.google.gerrit.server.change.ChangeJson.ChangeInfo > results = query ( query ) ; org.junit.Assert.assertTrue ( java.lang.String.format ( "expected singleton List<ChangeInfo>, found %s for [%s]" , results , query ) , ( ( results.size ( ) ) == 1 ) ) ; return results.get ( 0 ) ; }

Target:
protected com.google.gerrit.extensions.common.ChangeInfo queryOne ( java.lang.Object query ) throws java.lang.Exception { java.util.List < com.google.gerrit.extensions.common.ChangeInfo > results = query ( query ) ; com.google.common.truth.Truth.assert_ ( ) . withFailureMessage ( java.lang.String.format ( "expected singleton List<ChangeInfo>, found %s for [%s]" , results , query ) ) . that ( results ) . hasSize ( 1 ) ; return results.get ( 0 ) ; }
Source:
public void linkifyMessageNoMatch ( ) throws java.lang.Exception { com.google.gitiles.Linkifier l = new com.google.gitiles.Linkifier ( TestGitilesUrls.URLS ) ; org.junit.Assert.assertEquals ( com.google.common.collect.ImmutableList.of ( com.google.common.collect.ImmutableMap.of ( "text" , "some message text" ) ) , l.linkify ( com.google.gitiles.FakeHttpServletRequest.newRequest ( ) , "some message text" ) ) ; }

Target:
public void linkifyMessageNoMatch ( ) throws java.lang.Exception { org.eclipse.jgit.lib.Config config = new org.eclipse.jgit.lib.Config ( ) ; com.google.gitiles.Linkifier l = new com.google.gitiles.Linkifier ( TestGitilesUrls.URLS , config ) ; org.junit.Assert.assertEquals ( com.google.common.collect.ImmutableList.of ( com.google.common.collect.ImmutableMap.of ( "text" , "some message text" ) ) , l.linkify ( com.google.gitiles.FakeHttpServletRequest.newRequest ( ) , "some message text" ) ) ; }
Source:
private static java.util.Collection < com.google.gerrit.reviewdb.client.PatchLineComment > addCommentsOnFile ( java.util.Collection < com.google.gerrit.reviewdb.client.PatchLineComment > commentsOnFile , java.util.Collection < com.google.gerrit.reviewdb.client.PatchLineComment > allComments , java.lang.String file ) { for ( com.google.gerrit.reviewdb.client.PatchLineComment c : allComments ) { java.lang.String currentFilename = c.getKey ( ) . getParentKey ( ) . getFileName ( ) ; if ( currentFilename.equals ( file ) ) { commentsOnFile.add ( c ) ; } } return commentsOnFile ; }

Target:
private static java.util.List < com.google.gerrit.reviewdb.client.PatchLineComment > commentsOnFile ( java.util.Collection < com.google.gerrit.reviewdb.client.PatchLineComment > allComments , java.lang.String file ) { java.util.List < com.google.gerrit.reviewdb.client.PatchLineComment > result = new java.util.ArrayList ( allComments.size ( ) ) ; for ( com.google.gerrit.reviewdb.client.PatchLineComment c : allComments ) { java.lang.String currentFilename = c.getKey ( ) . getParentKey ( ) . getFileName ( ) ; if ( currentFilename.equals ( file ) ) { result.add ( c ) ; } } return com.google.gerrit.server.PatchLineCommentsUtil.sort ( result ) ; }
Source:
void setLineLength ( int columns ) { columnMarginA.getStyle ( ) . setMarginLeft ( ( ( columns * ( cmA.defaultCharWidth ( ) ) ) + ( cmA.getGutterElement ( ) . getOffsetWidth ( ) ) ) , Unit.PX ) ; columnMarginB.getStyle ( ) . setMarginLeft ( ( ( columns * ( cmB.defaultCharWidth ( ) ) ) + ( cmB.getGutterElement ( ) . getOffsetWidth ( ) ) ) , Unit.PX ) ; }

Target:
void setLineLength ( int columns ) { double w = columns * ( getCharWidthPx ( ) ) ; columnMarginA.getStyle ( ) . setMarginLeft ( w , Style.Unit.PX ) ; columnMarginB.getStyle ( ) . setMarginLeft ( w , Style.Unit.PX ) ; }
Source:
public void onSuccess ( com.google.gerrit.client.change.RelatedChanges.RelatedInfo result ) { relatedChangesTab.setTitle ( Resources.M.relatedChanges ( result.changes ( ) . length ( ) ) ) ; relatedChangesTab.setChanges ( info.project ( ) , revision , result.changes ( ) ) ; }

Target:
public void onSuccess ( com.google.gerrit.client.change.RelatedChanges.RelatedInfo result ) { if ( ( result.changes ( ) . length ( ) ) > 0 ) { getTab ( ) . setTitle ( Resources.M.relatedChanges ( result.changes ( ) . length ( ) ) ) ; getTab ( ) . setChanges ( info.project ( ) , revision , result.changes ( ) ) ; } }
Source:
protected boolean onKeyPress ( final char keyCode , final int modifiers ) { if ( super . onKeyPress ( keyCode , modifiers ) ) { return true ; } if ( modifiers == 0 ) { switch ( keyCode ) { case 's' : onStarClick ( getCurrentRow ( ) ) ; return true ; } } return false ; }

Target:
protected boolean onKeyPress ( final com.google.gwt.event.dom.client.KeyPressEvent event ) { if ( super . onKeyPress ( event ) ) { return true ; } if ( ! ( event.isAnyModifierKeyDown ( ) ) ) { switch ( event.getCharCode ( ) ) { case 's' : onStarClick ( getCurrentRow ( ) ) ; return true ; } } return false ; }
Source:
public void myDrafts ( final com.google.gerrit.client.reviewdb.Patch.Key key , final com.google.gwt.user.client.rpc.AsyncCallback < java.util.List < com.google.gerrit.client.reviewdb.PatchLineComment > > callback ) { run ( callback , new com.google.gerrit.server.patch.Action < java.util.List < com.google.gerrit.client.reviewdb.PatchLineComment > > ( ) { public java.util.List < com.google.gerrit.client.reviewdb.PatchLineComment > run ( com.google.gerrit.client.reviewdb.ReviewDb db ) throws com.google.gwtorm.client.OrmException { return db.patchComments ( ) . draft ( key , com.google.gerrit.client.rpc.Common.getAccountId ( ) ) . toList ( ) ; } } ) ; }

Target:
public void patchComments ( final com.google.gerrit.client.reviewdb.Patch.Key patchKey , final com.google.gerrit.client.reviewdb.PatchSet.Id psa , final com.google.gerrit.client.reviewdb.PatchSet.Id psb , final com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.patches.CommentDetail > callback ) { if ( psb == null ) { callback.onFailure ( new com.google.gerrit.client.rpc.NoSuchEntityException ( ) ) ; return ; } run ( callback , new com.google.gerrit.server.patch.PatchCommentAction ( patchKey , psa , psb ) ) ; }
Source:
public boolean equals ( java.lang.Object obj ) { if ( obj instanceof com.google.gerrit.common.PluginData ) { com.google.gerrit.common.PluginData o = ( ( com.google.gerrit.common.PluginData ) ( obj ) ) ; return ( ( com.google.common.base.Objects.equal ( name , o.name ) ) && ( com.google.common.base.Objects.equal ( version , o.version ) ) ) && ( com.google.common.base.Objects.equal ( pluginFile , o.pluginFile ) ) ; } return super . equals ( obj ) ; }

Target:
public boolean equals ( java.lang.Object obj ) { if ( obj instanceof com.google.gerrit.common.PluginData ) { com.google.gerrit.common.PluginData o = ( ( com.google.gerrit.common.PluginData ) ( obj ) ) ; return ( ( java.util.Objects.equals ( name , o.name ) ) && ( java.util.Objects.equals ( version , o.version ) ) ) && ( java.util.Objects.equals ( pluginFile , o.pluginFile ) ) ; } return super . equals ( obj ) ; }
Source:
public boolean equals ( java.lang.Object o ) { if ( o instanceof com.google.gitiles.RevisionParser.Result ) { com.google.gitiles.RevisionParser.Result r = ( ( com.google.gitiles.RevisionParser.Result ) ( o ) ) ; return ( ( com.google.common.base.Objects.equal ( revision , r.revision ) ) && ( com.google.common.base.Objects.equal ( oldRevision , r.oldRevision ) ) ) && ( com.google.common.base.Objects.equal ( path , r.path ) ) ; } return false ; }

Target:
public boolean equals ( java.lang.Object o ) { if ( o instanceof com.google.gitiles.RevisionParser.Result ) { com.google.gitiles.RevisionParser.Result r = ( ( com.google.gitiles.RevisionParser.Result ) ( o ) ) ; return ( ( java.util.Objects.equals ( revision , r.revision ) ) && ( java.util.Objects.equals ( oldRevision , r.oldRevision ) ) ) && ( java.util.Objects.equals ( path , r.path ) ) ; } return false ; }
Source:
public void appendTo ( java.lang.StringBuffer buffer ) { buffer.append ( "eqEvent(" ) ; buffer.append ( expected.getClass ( ) . getName ( ) ) ; buffer.append ( " with project \"" ) ; buffer.append ( expected.project ) ; buffer.append ( " and ref \"" ) ; buffer.append ( expected.ref ) ; buffer.append ( " and targetNode \"" ) ; buffer.append ( expected.targetNode ) ; buffer.append ( " and status \"" ) ; buffer.append ( expected.status ) ; buffer.append ( "\")" ) ; }

Target:
public void appendTo ( java.lang.StringBuffer buffer ) { buffer.append ( "eqEvent(" ) ; buffer.append ( expected.getClass ( ) . getName ( ) ) ; buffer.append ( " with project \"" ) ; buffer.append ( expected.project ) ; buffer.append ( "\" and ref \"" ) ; buffer.append ( expected.ref ) ; buffer.append ( "\" and targetNode \"" ) ; buffer.append ( expected.targetNode ) ; buffer.append ( "\" and status \"" ) ; buffer.append ( expected.status ) ; buffer.append ( "\")" ) ; }