auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public com.google.gerrit.server.project.ChangeControl controlFor ( com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.server.CurrentUser user ) throws com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException { final com.google.gerrit.reviewdb.client.Project.NameKey projectKey = change.getProject ( ) ; try { return projectControl.controlFor ( projectKey , user ) . controlFor ( change ) ; } catch ( com.google.gerrit.server.project.NoSuchProjectException e ) { throw new com.google.gerrit.server.project.NoSuchChangeException ( change.getId ( ) , e ) ; } catch ( java.io.IOException e ) { throw new com.google.gerrit.server.project.NoSuchChangeException ( change.getId ( ) , e ) ; } }

Target:
public com.google.gerrit.server.project.ChangeControl controlFor ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.server.CurrentUser user ) throws com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException { final com.google.gerrit.reviewdb.client.Project.NameKey projectKey = change.getProject ( ) ; try { return projectControl.controlFor ( projectKey , user ) . controlFor ( db , change ) ; } catch ( com.google.gerrit.server.project.NoSuchProjectException e ) { throw new com.google.gerrit.server.project.NoSuchChangeException ( change.getId ( ) , e ) ; } catch ( java.io.IOException e ) { throw new com.google.gerrit.server.project.NoSuchChangeException ( change.getId ( ) , e ) ; } }
Source:
public org.apache.http.impl.client.CloseableHttpClient get ( ) { return org.apache.http.impl.client.HttpClients.custom ( ) . setSSLSocketFactory ( sslSocketFactory ) . setConnectionManager ( customConnectionManager ( ) ) . setDefaultCredentialsProvider ( buildCredentials ( ) ) . setDefaultRequestConfig ( customRequestConfig ( ) ) . setRetryHandler ( customRetryHandler ( ) ) . setServiceUnavailableRetryStrategy ( customServiceUnavailRetryStrategy ( ) ) . build ( ) ; }

Target:
public org.apache.http.impl.client.CloseableHttpClient get ( ) { return org.apache.http.impl.client.HttpClients.custom ( ) . setSSLSocketFactory ( sslSocketFactory ) . setConnectionManager ( customConnectionManager ( ) ) . setDefaultCredentialsProvider ( buildCredentials ( ) ) . setDefaultRequestConfig ( customRequestConfig ( ) ) . build ( ) ; }
Source:
protected java.lang.Void impl ( com.google.gerrit.server.util.RequestContext ctx ) throws com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.reviewdb.server.ReviewDb db = ctx.getReviewDbProvider ( ) . get ( ) ; com.google.gerrit.reviewdb.client.Change c = db.changes ( ) . get ( id ) ; indexerFactory.create ( executor , indexes ) . index ( db , c ) ; return null ; }

Target:
protected java.lang.Void impl ( com.google.gerrit.server.util.RequestContext ctx ) throws com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.reviewdb.server.ReviewDb db = ctx.getReviewDbProvider ( ) . get ( ) ; com.google.gerrit.reviewdb.client.Change c = db.changes ( ) . get ( id ) ; if ( c != null ) { indexerFactory.create ( executor , indexes ) . index ( db , c ) ; } return null ; }
Source:
private com.google.gerrit.common.data.SubmitTypeRecord typeError ( java.lang.String err , java.lang.Exception e ) { if ( logErrors ) { com.google.gerrit.server.project.SubmitRuleEvaluator.log.error ( err , e ) ; return com.google.gerrit.server.project.SubmitRuleEvaluator.defaultTypeError ( ) ; } else { return com.google.gerrit.server.project.SubmitRuleEvaluator.createTypeError ( err ) ; } }

Target:
private com.google.gerrit.common.data.SubmitTypeRecord typeError ( java.lang.String err , java.lang.Exception e ) { if ( logErrors ) { if ( e == null ) { com.google.gerrit.server.project.SubmitRuleEvaluator.log.error ( err ) ; } else { com.google.gerrit.server.project.SubmitRuleEvaluator.log.error ( err , e ) ; } return com.google.gerrit.server.project.SubmitRuleEvaluator.defaultTypeError ( ) ; } else { return com.google.gerrit.server.project.SubmitRuleEvaluator.createTypeError ( err ) ; } }
Source:
public com.google.gerrit.server.notedb.ChangeNotes createChecked ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Change c ) throws com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException { com.google.gerrit.server.notedb.ChangeNotes notes = create ( db , c.getProject ( ) , c.getId ( ) ) ; if ( ( notes.getChange ( ) ) == null ) { throw new com.google.gerrit.server.project.NoSuchChangeException ( c.getId ( ) ) ; } return notes ; }

Target:
public com.google.gerrit.server.notedb.ChangeNotes createChecked ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Change c ) throws com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException { return createChecked ( db , c.getProject ( ) , c.getId ( ) ) ; }
Source:
java.lang.Runnable navigate ( com.google.gerrit.client.diff.Direction dir ) { switch ( dir ) { case PREV : return new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { ( hasPrev ? prev : up ) . go ( ) ; } } ; case NEXT : return new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { ( hasNext ? next : up ) . go ( ) ; } } ; default : return new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { } } ; } }

Target:
java.lang.Runnable navigate ( com.google.gerrit.client.diff.Direction dir ) { switch ( dir ) { case PREV : return ( ) -> { ( hasPrev ? prev : up ) . go ( ) ; } ; case NEXT : return ( ) -> { ( hasNext ? next : up ) . go ( ) ; } ; default : return ( ) -> { } ; } }
Source:
public void onSuccess ( com.google.gerrit.client.rpc.NativeString msg ) { b.setEnabled ( true ) ; if ( msg != null ) { com.google.gwt.user.client.Window.alert ( msg.asString ( ) ) ; } }

Target:
public void onSuccess ( com.google.gerrit.client.rpc.NativeString msg ) { b.setEnabled ( true ) ; if ( ( msg != null ) && ( ! ( msg.asString ( ) . isEmpty ( ) ) ) ) { com.google.gwt.user.client.Window.alert ( msg.asString ( ) ) ; } }
Source:
private void parsePostRequest ( final CallType call ) throws java.io.IOException , java.io.UnsupportedEncodingException { try { final com.google.gson.GsonBuilder gb = createGsonBuilder ( ) ; gb.registerTypeAdapter ( com.google.gwtjsonrpc.server.ActiveCall.class , new com.google.gwtjsonrpc.server.CallDeserializer < CallType > ( call , this ) ) ; gb.create ( ) . fromJson ( readBody ( call ) , com.google.gwtjsonrpc.server.ActiveCall.class ) ; } catch ( com.google.gson.JsonParseException err ) { call.method = null ; call.params = null ; throw err ; } }

Target:
private void parsePostRequest ( final CallType call ) throws java.io.IOException , java.io.UnsupportedEncodingException { try { final com.google.gson.GsonBuilder gb = createGsonBuilder ( ) ; gb.registerTypeAdapter ( com.google.gwtjsonrpc.server.ActiveCall.class , new com.google.gwtjsonrpc.server.CallDeserializer ( call , this ) ) ; gb.create ( ) . fromJson ( readBody ( call ) , com.google.gwtjsonrpc.server.ActiveCall.class ) ; } catch ( com.google.gson.JsonParseException err ) { call.method = null ; call.params = null ; throw err ; } }
Source:
private void loadDiff ( final com.google.gerrit.client.changes.ChangeInfo.RevisionInfo rev , com.google.gerrit.client.rpc.CallbackGroup group ) { com.google.gerrit.client.diff.DiffApi.list ( changeId.get ( ) , rev.name ( ) , group.add ( new com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.rpc.NativeMap < com.google.gerrit.client.diff.FileInfo > > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.rpc.NativeMap < com.google.gerrit.client.diff.FileInfo > m ) { files.setRevisions ( null , new com.google.gerrit.reviewdb.client.PatchSet.Id ( changeId , rev._number ( ) ) ) ; files.setValue ( m ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { } } ) ) ; }

Target:
public void onFailure ( java.lang.Throwable caught ) { }
Source:
public java.util.List < com.googlesource.gerrit.plugins.its.jira.restapi.JiraTransition.Item > getTransitions ( java.lang.String issueKey ) throws java.io.IOException { com.googlesource.gerrit.plugins.its.jira.restapi.JiraRestApi < com.googlesource.gerrit.plugins.its.jira.restapi.JiraTransition > api = apiBuilder.get ( com.googlesource.gerrit.plugins.its.jira.restapi.JiraTransition.class , "/issue" ) ; return java.util.Arrays.asList ( api.doGet ( ( ( "/" + issueKey ) + "/transitions" ) , java.net.HttpURLConnection.HTTP_OK ) . getTransitions ( ) ) ; }

Target:
public java.util.List < com.googlesource.gerrit.plugins.its.jira.restapi.JiraTransition.Item > getTransitions ( java.lang.String issueKey ) throws java.io.IOException { com.googlesource.gerrit.plugins.its.jira.restapi.JiraRestApi < com.googlesource.gerrit.plugins.its.jira.restapi.JiraTransition > api = apiBuilder.get ( com.googlesource.gerrit.plugins.its.jira.restapi.JiraTransition.class , "/issue" ) ; return java.util.Arrays.asList ( api.doGet ( ( issueKey + "/transitions" ) , java.net.HttpURLConnection.HTTP_OK ) . getTransitions ( ) ) ; }
Source:
private static void validateProjectConfigEntryIsEditable ( com.google.gerrit.server.config.ProjectConfigEntry projectConfigEntry , com.google.gerrit.server.project.ProjectState projectState , java.lang.String parameterName , java.lang.String pluginName ) throws com.google.gerrit.extensions.restapi.BadRequestException { if ( ! ( projectConfigEntry.isEditable ( projectState ) ) ) { throw new com.google.gerrit.extensions.restapi.BadRequestException ( java.lang.String.format ( "Not allowed to set parameter '%s' of plugin '%s' on project '%s'." , parameterName , pluginName , projectState.getProject ( ) . getName ( ) ) ) ; } }

Target:
private static void validateProjectConfigEntryIsEditable ( com.google.gerrit.server.config.ProjectConfigEntry projectConfigEntry , com.google.gerrit.server.project.ProjectState projectState , java.lang.String parameterName , java.lang.String pluginName ) throws com.google.gerrit.extensions.restapi.BadRequestException { if ( ! ( projectConfigEntry.isEditable ( projectState ) ) ) { throw new com.google.gerrit.extensions.restapi.BadRequestException ( java.lang.String.format ( "Not allowed to set parameter '%s' of plugin '%s' on project '%s'." , parameterName , pluginName , projectState.getName ( ) ) ) ; } }
Source:
public java.util.Set < com.googlesource.gerrit.plugins.its.base.workflow.Property > extractFrom ( com.google.gerrit.server.data.RefUpdateAttribute refUpdateAttribute ) { java.util.Set < com.googlesource.gerrit.plugins.its.base.workflow.Property > properties = com.google.common.collect.Sets.newHashSet ( ) ; properties.add ( propertyFactory.create ( "revision" , refUpdateAttribute.newRev ) ) ; properties.add ( propertyFactory.create ( "revision-old" , refUpdateAttribute.oldRev ) ) ; properties.add ( propertyFactory.create ( "revisionOld" , refUpdateAttribute.oldRev ) ) ; properties.add ( propertyFactory.create ( "project" , refUpdateAttribute.project ) ) ; properties.add ( propertyFactory.create ( "ref" , refUpdateAttribute.refName ) ) ; return properties ; }

Target:
public java.util.Set < com.googlesource.gerrit.plugins.its.base.workflow.Property > extractFrom ( com.google.gerrit.server.data.RefUpdateAttribute refUpdateAttribute ) { java.util.Set < com.googlesource.gerrit.plugins.its.base.workflow.Property > properties = com.google.common.collect.Sets.newHashSet ( ) ; properties.add ( propertyFactory.create ( "revision" , refUpdateAttribute.newRev ) ) ; properties.add ( propertyFactory.create ( "revision-old" , refUpdateAttribute.oldRev ) ) ; properties.add ( propertyFactory.create ( "revisionOld" , refUpdateAttribute.oldRev ) ) ; properties.add ( propertyFactory.create ( "ref" , refUpdateAttribute.refName ) ) ; return properties ; }
Source:
void onFix ( com.google.gwt.event.dom.client.ClickEvent e ) { e.stopPropagation ( ) ; java.lang.String t = com.google.gerrit.client.Dispatcher.toEditScreen ( psId , comment.path ( ) , comment.line ( ) ) ; if ( ! ( com.google.gerrit.client.Gerrit.isSignedIn ( ) ) ) { com.google.gerrit.client.Gerrit.doSignIn ( t ) ; } else { com.google.gerrit.client.Gerrit.display ( t ) ; } }

Target:
void onFix ( com.google.gwt.event.dom.client.ClickEvent e ) { e.stopPropagation ( ) ; java.lang.String t = com.google.gerrit.client.Dispatcher.toEditScreen ( project , psId , comment.path ( ) , comment.line ( ) ) ; if ( ! ( com.google.gerrit.client.Gerrit.isSignedIn ( ) ) ) { com.google.gerrit.client.Gerrit.doSignIn ( t ) ; } else { com.google.gerrit.client.Gerrit.display ( t ) ; } }
Source:
private void assertHead ( java.lang.String projectName , java.lang.String expectedRef ) throws java.io.IOException , org.eclipse.jgit.errors.RepositoryNotFoundException { org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( new com.google.gerrit.reviewdb.client.Project.NameKey ( projectName ) ) ; try { org.junit.Assert.assertEquals ( expectedRef , repo.getRef ( Constants.HEAD ) . getTarget ( ) . getName ( ) ) ; } finally { repo.close ( ) ; } }

Target:
private void assertHead ( java.lang.String projectName , java.lang.String expectedRef ) throws java.io.IOException , org.eclipse.jgit.errors.RepositoryNotFoundException { org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( new com.google.gerrit.reviewdb.client.Project.NameKey ( projectName ) ) ; try { com.google.common.truth.Truth.assertThat ( repo.getRef ( Constants.HEAD ) . getTarget ( ) . getName ( ) ) . isEqualTo ( expectedRef ) ; } finally { repo.close ( ) ; } }
Source:
public java.util.List < java.lang.Integer > getValuesAsList ( ) { if ( ( intList ) == null ) { intList = new java.util.ArrayList < java.lang.Integer > ( values.size ( ) ) ; for ( com.google.gerrit.common.data.LabelValue v : values ) { intList.add ( java.lang.Integer.valueOf ( v.getValue ( ) ) ) ; } java.util.Collections.sort ( intList ) ; java.util.Collections.reverse ( intList ) ; } return intList ; }

Target:
public java.util.List < java.lang.Integer > getValuesAsList ( ) { if ( ( intList ) == null ) { intList = new java.util.ArrayList ( values.size ( ) ) ; for ( com.google.gerrit.common.data.LabelValue v : values ) { intList.add ( java.lang.Integer.valueOf ( v.getValue ( ) ) ) ; } java.util.Collections.sort ( intList ) ; java.util.Collections.reverse ( intList ) ; } return intList ; }
Source:
private static void var ( final java.lang.StringBuffer r , final java.lang.String n , final java.lang.String v ) { if ( ( r.length ( ) ) > 0 ) { r.append ( ";" ) ; } r.append ( n ) ; r.append ( "=" ) ; r.append ( com.google.gwt.http.client.URL.encodeComponent ( v ) ) ; }

Target:
private static void var ( final java.lang.StringBuilder r , final java.lang.String n , final java.lang.String v ) { if ( ( r.length ( ) ) > 0 ) { r.append ( ";" ) ; } r.append ( n ) ; r.append ( "=" ) ; r.append ( com.google.gwt.http.client.URL.encodeComponent ( v ) ) ; }
Source:
private java.lang.Iterable < com.google.gerrit.reviewdb.client.PatchSetApproval > approvals ( com.google.gerrit.reviewdb.server.ReviewDb db , final com.google.gerrit.server.change.ReviewerResource rsrc ) throws com.google.gwtorm.server.OrmException { return com.google.common.collect.Iterables.filter ( db.patchSetApprovals ( ) . byChange ( rsrc.getChange ( ) . getId ( ) ) , new com.google.common.base.Predicate < com.google.gerrit.reviewdb.client.PatchSetApproval > ( ) { @ java.lang.Override public boolean apply ( com.google.gerrit.reviewdb.client.PatchSetApproval input ) { return input.getAccountId ( ) . equals ( rsrc.getUser ( ) . getAccountId ( ) ) ; } } ) ; }

Target:
private java.lang.Iterable < com.google.gerrit.reviewdb.client.PatchSetApproval > approvals ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.change.ReviewerResource rsrc ) throws com.google.gwtorm.server.OrmException { final com.google.gerrit.reviewdb.client.Account.Id user = rsrc.getUser ( ) . getAccountId ( ) ; return com.google.common.collect.Iterables.filter ( db.patchSetApprovals ( ) . byChange ( rsrc.getChange ( ) . getId ( ) ) , new com.google.common.base.Predicate < com.google.gerrit.reviewdb.client.PatchSetApproval > ( ) { @ java.lang.Override public boolean apply ( com.google.gerrit.reviewdb.client.PatchSetApproval input ) { return user.equals ( input.getAccountId ( ) ) ; } } ) ; }
Source:
protected void configure ( ) { bind ( com.google.gerrit.server.plugins.ServerInformationImpl.class ) ; bind ( com.google.gerrit.extensions.systemstatus.ServerInformation.class ) . to ( com.google.gerrit.server.plugins.ServerInformationImpl.class ) ; bind ( com.google.gerrit.server.plugins.PluginCleanerTask.class ) ; bind ( com.google.gerrit.server.plugins.PluginGuiceEnvironment.class ) ; bind ( com.google.gerrit.server.plugins.PluginLoader.class ) ; bind ( com.google.gerrit.server.plugins.CopyConfigModule.class ) ; install ( new com.google.gerrit.lifecycle.LifecycleModule ( ) { @ java.lang.Override protected void configure ( ) { listener ( ) . to ( com.google.gerrit.server.plugins.PluginLoader.class ) ; } } ) ; }

Target:
protected void configure ( ) { bind ( com.google.gerrit.server.plugins.ServerInformationImpl.class ) ; bind ( com.google.gerrit.extensions.systemstatus.ServerInformation.class ) . to ( com.google.gerrit.server.plugins.ServerInformationImpl.class ) ; bind ( com.google.gerrit.server.plugins.PluginCleanerTask.class ) ; bind ( com.google.gerrit.server.plugins.PluginGuiceEnvironment.class ) ; bind ( com.google.gerrit.server.plugins.PluginLoader.class ) ; bind ( com.google.gerrit.server.plugins.CopyConfigModule.class ) ; listener ( ) . to ( com.google.gerrit.server.plugins.PluginLoader.class ) ; }
Source:
public void start ( ) { org.eclipse.jgit.transport.SshSessionFactory.setInstance ( new org.eclipse.jgit.transport.JschConfigSessionFactory ( ) { @ java.lang.Override protected void configure ( org.eclipse.jgit.transport.OpenSshConfig.Host hc , com.jcraft.jsch.Session session ) { } } ) ; final org.eclipse.jgit.storage.file.WindowCacheConfig c = new org.eclipse.jgit.storage.file.WindowCacheConfig ( ) ; c.fromConfig ( cfg ) ; org.eclipse.jgit.storage.file.WindowCache.reconfigure ( c ) ; }

Target:
public void start ( ) { org.eclipse.jgit.transport.SshSessionFactory.setInstance ( new org.eclipse.jgit.transport.JschConfigSessionFactory ( ) { @ java.lang.Override protected void configure ( org.eclipse.jgit.transport.OpenSshConfig.Host hc , com.jcraft.jsch.Session session ) { } } ) ; new org.eclipse.jgit.storage.file.WindowCacheConfig ( ) . fromConfig ( cfg ) . install ( ) ; }
Source:
private < T extends java.lang.Enum < ? > > void setListBox ( final com.google.gwt.user.client.ui.ListBox f , final T defaultValue , final T currentValue ) { setListBox ( f , defaultValue.name ( ) , ( currentValue != null ? currentValue.name ( ) : "" ) ) ; }

Target:
private < T extends java.lang.Enum < ? > > void setListBox ( final com.google.gwt.user.client.ui.ListBox f , final T defaultValue , final T currentValue ) { setListBox ( f , ( defaultValue != null ? defaultValue.name ( ) : "" ) , ( currentValue != null ? currentValue.name ( ) : "" ) ) ; }
Source:
public com.google.common.base.Optional < com.googlesource.gerrit.plugins.manager.gson.SmartJson > getOptional ( java.lang.String fieldName ) { if ( ( ( jsonElem ) != null ) && ( ( jsonElem.getAsJsonObject ( ) . get ( fieldName ) ) != null ) ) { return com.google.common.base.Optional.of ( com.googlesource.gerrit.plugins.manager.gson.SmartJson.of ( jsonElem.getAsJsonObject ( ) . get ( fieldName ) ) ) ; } else { return com.google.common.base.Optional.absent ( ) ; } }

Target:
public com.google.common.base.Optional < com.googlesource.gerrit.plugins.manager.gson.SmartJson > getOptional ( java.lang.String fieldName ) { if ( ( ( jsonElem ) != null ) && ( ( jsonElem.getAsJsonObject ( ) . get ( fieldName ) ) != null ) ) { return com.google.common.base.Optional.of ( com.googlesource.gerrit.plugins.manager.gson.SmartJson.of ( jsonElem.getAsJsonObject ( ) . get ( fieldName ) ) ) ; } return com.google.common.base.Optional.absent ( ) ; }
Source:
public com.google.gerrit.extensions.api.changes.ReviewerInfo format ( com.google.gerrit.extensions.api.changes.ReviewerInfo out , com.google.gerrit.server.permissions.PermissionBackend.ForChange perm , com.google.gerrit.server.query.change.ChangeData cd ) throws com.google.gerrit.server.permissions.PermissionBackendException , com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.PatchSet.Id psId = cd.change ( ) . currentPatchSetId ( ) ; com.google.gerrit.server.project.ChangeControl ctl = cd.changeControl ( ) . forUser ( perm.user ( ) ) ; return format ( out , perm , cd , approvalsUtil.byPatchSetUser ( db.get ( ) , ctl , psId , new com.google.gerrit.reviewdb.client.Account.Id ( out._accountId ) ) ) ; }

Target:
public com.google.gerrit.extensions.api.changes.ReviewerInfo format ( com.google.gerrit.extensions.api.changes.ReviewerInfo out , com.google.gerrit.server.permissions.PermissionBackend.ForChange perm , com.google.gerrit.server.query.change.ChangeData cd ) throws com.google.gerrit.server.permissions.PermissionBackendException , com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.PatchSet.Id psId = cd.change ( ) . currentPatchSetId ( ) ; com.google.gerrit.server.project.ChangeControl ctl = cd.changeControl ( ) . forUser ( perm.user ( ) ) ; return format ( out , perm , cd , approvalsUtil.byPatchSetUser ( db.get ( ) , ctl , psId , new com.google.gerrit.reviewdb.client.Account.Id ( out._accountId ) , null , null ) ) ; }
Source:
public boolean match ( final com.google.gerrit.server.query.change.ChangeData object ) throws com.google.gwtorm.server.OrmException { for ( com.google.gerrit.reviewdb.client.PatchSetApproval p : object.approvals ( ) ) { if ( id.equals ( p.getAccountId ( ) ) ) { return true ; } } return false ; }

Target:
public boolean match ( final com.google.gerrit.server.query.change.ChangeData object ) throws com.google.gwtorm.server.OrmException { for ( com.google.gerrit.reviewdb.client.PatchSetApproval p : object.approvals ( ) . values ( ) ) { if ( id.equals ( p.getAccountId ( ) ) ) { return true ; } } return false ; }
Source:
public void cleanUp ( ) { for ( java.nio.file.Path path : listFiles ( ) ) { com.google.gerrit.httpd.WebSessionManager.Val val = readFile ( path ) ; org.joda.time.DateTime expires = new org.joda.time.DateTime ( val.getExpiresAt ( ) ) ; if ( expires.isBefore ( new org.joda.time.DateTime ( ) ) ) { deleteFile ( path ) ; } } }

Target:
public void cleanUp ( ) { for ( java.nio.file.Path path : listFiles ( ) ) { com.google.gerrit.httpd.WebSessionManager.Val val = readFile ( path ) ; if ( val != null ) { org.joda.time.DateTime expires = new org.joda.time.DateTime ( val.getExpiresAt ( ) ) ; if ( expires.isBefore ( new org.joda.time.DateTime ( ) ) ) { deleteFile ( path ) ; } } } }
Source:
public com.google.gerrit.extensions.restapi.Response < java.lang.String > apply ( com.google.gerrit.server.change.ChangeResource rsrc , com.google.gerrit.server.change.Unmute.Input input ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.StarredChangesUtil.IllegalLabelException , com.google.gwtorm.server.OrmException { if ( ( rsrc.isUserOwner ( ) ) || ( ! ( isMuted ( rsrc ) ) ) ) { return com.google.gerrit.extensions.restapi.Response.ok ( "" ) ; } stars.unmute ( rsrc ) ; return com.google.gerrit.extensions.restapi.Response.ok ( "" ) ; }

Target:
public com.google.gerrit.extensions.restapi.Response < java.lang.String > apply ( com.google.gerrit.server.change.ChangeResource rsrc , com.google.gerrit.server.change.Unmute.Input input ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.StarredChangesUtil.IllegalLabelException , com.google.gwtorm.server.OrmException { if ( isMuted ( rsrc ) ) { stars.unmute ( rsrc ) ; } return com.google.gerrit.extensions.restapi.Response.ok ( "" ) ; }
Source:
public void performAction ( final java.lang.String issueKey , final java.lang.String actionName ) throws java.io.IOException { execute ( new java.util.concurrent.Callable < java.lang.String > ( ) { @ java.lang.Override public java.lang.String call ( ) throws java.lang.Exception { log.debug ( "Performing action on issue {}" , actionName , issueKey ) ; doPerformAction ( issueKey , actionName ) ; return issueKey ; } } ) ; }

Target:
public void performAction ( final java.lang.String issueKey , final java.lang.String actionName ) throws java.io.IOException { execute ( ( ) -> { log.debug ( "Performing action on issue {}" , actionName , issueKey ) ; doPerformAction ( issueKey , actionName ) ; return issueKey ; } ) ; }
Source:
public void setUp ( ) { listenerMock = org.mockito.Mockito.mock ( com.google.gerrit.common.EventListener.class ) ; com.google.gerrit.extensions.registration.DynamicSet < com.google.gerrit.common.EventListener > listeners = com.google.gerrit.extensions.registration.DynamicSet.emptySet ( ) ; listeners.add ( listenerMock ) ; broker = new com.ericsson.gerrit.plugins.highavailability.event.ForwardedAwareEventBroker ( null , listeners , null , null , null ) ; }

Target:
public void setUp ( ) { listenerMock = org.mockito.Mockito.mock ( com.google.gerrit.common.EventListener.class ) ; com.google.gerrit.extensions.registration.DynamicSet < com.google.gerrit.common.EventListener > listeners = com.google.gerrit.extensions.registration.DynamicSet.emptySet ( ) ; listeners.add ( listenerMock ) ; broker = new com.ericsson.gerrit.plugins.highavailability.event.ForwardedAwareEventBroker ( null , listeners , null , null , null , null ) ; }
Source:
public void isoIncludingTimeZone ( ) throws java.lang.Exception { org.eclipse.jgit.lib.PersonIdent ident = newIdent ( "Mon Jan 2 15:04:05 2006" , "-0700" ) ; com.google.gitiles.DateFormatter df = new com.google.gitiles.DateFormatter ( com.google.common.base.Optional.< java.util.TimeZone > absent ( ) , Format.ISO ) ; org.junit.Assert.assertEquals ( "2006-01-02 15:04:05 -0700" , df.format ( ident ) ) ; }

Target:
public void isoIncludingTimeZone ( ) throws java.lang.Exception { org.eclipse.jgit.lib.PersonIdent ident = newIdent ( "Mon Jan 2 15:04:05 2006" , "-0700" ) ; com.google.gitiles.DateFormatter df = new com.google.gitiles.DateFormatter ( com.google.common.base.Optional.< java.util.TimeZone > absent ( ) , Format.ISO ) ; com.google.common.truth.Truth.assertThat ( df.format ( ident ) ) . isEqualTo ( "2006-01-02 15:04:05 -0700" ) ; }
Source:
public void onEvent ( com.google.gerrit.server.events.Event event ) { if ( event instanceof com.google.gerrit.server.events.ChangeMergedEvent ) { com.google.gerrit.server.events.ChangeMergedEvent changeMergedEvent = ( ( com.google.gerrit.server.events.ChangeMergedEvent ) ( event ) ) ; mergeResults.put ( changeMergedEvent.change.number , changeMergedEvent.newRev ) ; } else if ( event instanceof com.google.gerrit.server.events.RefUpdatedEvent ) { com.google.gerrit.server.events.RefUpdatedEvent e = ( ( com.google.gerrit.server.events.RefUpdatedEvent ) ( event ) ) ; com.google.gerrit.server.data.RefUpdateAttribute r = e.refUpdate ; refUpdatedEvents.put ( ( ( ( r.project ) + "-" ) + ( r.refName ) ) , r.newRev ) ; } }

Target:
public void onEvent ( com.google.gerrit.server.events.Event event ) { if ( event instanceof com.google.gerrit.server.events.ChangeMergedEvent ) { com.google.gerrit.server.events.ChangeMergedEvent changeMergedEvent = ( ( com.google.gerrit.server.events.ChangeMergedEvent ) ( event ) ) ; mergeResults.put ( changeMergedEvent.change.number , changeMergedEvent.newRev ) ; } else if ( event instanceof com.google.gerrit.server.events.RefUpdatedEvent ) { com.google.gerrit.server.events.RefUpdatedEvent e = ( ( com.google.gerrit.server.events.RefUpdatedEvent ) ( event ) ) ; com.google.gerrit.server.data.RefUpdateAttribute r = e.refUpdate ; refUpdatedEvents.put ( ( ( ( r.project ) + "-" ) + ( r.refName ) ) , r ) ; } }
Source:
public static < T > void itemOf ( com.google.inject.Binder binder , com.google.inject.TypeLiteral < T > member ) { @ java.lang.SuppressWarnings ( value = "unchecked" ) com.google.inject.Key < com.google.gerrit.extensions.registration.DynamicItem < T > > key = ( ( com.google.inject.Key < com.google.gerrit.extensions.registration.DynamicItem < T > > ) ( com.google.inject.Key.get ( com.google.inject.util.Types.newParameterizedType ( com.google.gerrit.extensions.registration.DynamicItem.class , member.getType ( ) ) ) ) ) ; binder.bind ( key ) . toProvider ( new com.google.gerrit.extensions.registration.DynamicItemProvider < T > ( member , key ) ) . in ( Scopes.SINGLETON ) ; }

Target:
public static < T > void itemOf ( com.google.inject.Binder binder , com.google.inject.TypeLiteral < T > member ) { @ java.lang.SuppressWarnings ( value = "unchecked" ) com.google.inject.Key < com.google.gerrit.extensions.registration.DynamicItem < T > > key = ( ( com.google.inject.Key < com.google.gerrit.extensions.registration.DynamicItem < T > > ) ( com.google.inject.Key.get ( com.google.inject.util.Types.newParameterizedType ( com.google.gerrit.extensions.registration.DynamicItem.class , member.getType ( ) ) ) ) ) ; binder.bind ( key ) . toProvider ( new com.google.gerrit.extensions.registration.DynamicItemProvider ( member , key ) ) . in ( Scopes.SINGLETON ) ; }
Source:
public void populateDownloadCommandLinks ( ) { if ( ! ( urls.isEmpty ( ) ) ) { if ( ( allowedCommands.contains ( DownloadCommand.CHECKOUT ) ) || ( allowedCommands.contains ( DownloadCommand.DEFAULT_DOWNLOADS ) ) ) { commands.add ( cmdLinkfactory.new com.google.gerrit.client.admin.CloneCommandLink ( ) ) ; if ( ( ( com.google.gerrit.client.Gerrit.getConfig ( ) . getSshdAddress ( ) ) != null ) && ( com.google.gerrit.client.admin.ProjectInfoScreen.hasUserName ( ) ) ) { commands.add ( cmdLinkfactory.new com.google.gerrit.client.admin.CloneWithCommitMsgHookCommandLink ( getProjectKey ( ) ) ) ; } } } }

Target:
public void populateDownloadCommandLinks ( ) { if ( ! ( urls.isEmpty ( ) ) ) { commands.add ( cmdLinkfactory.new com.google.gerrit.client.admin.CloneCommandLink ( ) ) ; if ( ( ( com.google.gerrit.client.Gerrit.getConfig ( ) . getSshdAddress ( ) ) != null ) && ( com.google.gerrit.client.admin.ProjectInfoScreen.hasUserName ( ) ) ) { commands.add ( cmdLinkfactory.new com.google.gerrit.client.admin.CloneWithCommitMsgHookCommandLink ( getProjectKey ( ) ) ) ; } } }
Source:
public java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.UUID > guessRelevantGroupUUIDs ( ) { java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.UUID > groups = com.google.common.collect.Sets.newHashSet ( ) ; for ( com.google.gerrit.reviewdb.client.Project.NameKey n : all ( ) ) { com.google.gerrit.server.project.ProjectState p = byName.getIfPresent ( n ) ; if ( p != null ) { groups.addAll ( p.getConfig ( ) . getAllGroupUUIDs ( ) ) ; } } return groups ; }

Target:
public java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.UUID > guessRelevantGroupUUIDs ( ) { java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.UUID > groups = com.google.common.collect.Sets.newHashSet ( ) ; for ( com.google.gerrit.reviewdb.client.Project.NameKey n : all ( ) ) { com.google.gerrit.server.project.ProjectState p = byName.getIfPresent ( n.get ( ) ) ; if ( p != null ) { groups.addAll ( p.getConfig ( ) . getAllGroupUUIDs ( ) ) ; } } return groups ; }
Source:
public void deleteBranchesNotFound ( ) throws java.lang.Exception { com.google.gerrit.extensions.api.projects.DeleteBranchesInput input = new com.google.gerrit.extensions.api.projects.DeleteBranchesInput ( ) ; java.util.List < java.lang.String > branches = com.google.common.collect.Lists.newArrayList ( com.google.gerrit.acceptance.rest.project.DeleteBranchesIT.BRANCHES ) ; branches.add ( "refs/heads/does-not-exist" ) ; input.branches = branches ; try { project ( ) . deleteBranches ( input ) ; org.junit.Assert.fail ( "Expected ResourceConflictException" ) ; } catch ( com.google.gerrit.extensions.restapi.ResourceConflictException e ) { com.google.common.truth.Truth.assertThat ( e ) . hasMessageThat ( ) . isEqualTo ( errorMessageForBranches ( com.google.common.collect.ImmutableList.of ( "refs/heads/does-not-exist" ) ) ) ; } assertBranchesDeleted ( ) ; }

Target:
public void deleteBranchesNotFound ( ) throws java.lang.Exception { com.google.gerrit.extensions.api.projects.DeleteBranchesInput input = new com.google.gerrit.extensions.api.projects.DeleteBranchesInput ( ) ; java.util.List < java.lang.String > branches = com.google.common.collect.Lists.newArrayList ( com.google.gerrit.acceptance.rest.project.DeleteBranchesIT.BRANCHES ) ; branches.add ( "refs/heads/does-not-exist" ) ; input.branches = branches ; try { project ( ) . deleteBranches ( input ) ; org.junit.Assert.fail ( "Expected ResourceConflictException" ) ; } catch ( com.google.gerrit.extensions.restapi.ResourceConflictException e ) { com.google.common.truth.Truth.assertThat ( e ) . hasMessageThat ( ) . isEqualTo ( errorMessageForBranches ( com.google.common.collect.ImmutableList.of ( "refs/heads/does-not-exist" ) ) ) ; } assertBranchesDeleted ( com.google.gerrit.acceptance.rest.project.DeleteBranchesIT.BRANCHES ) ; }
Source:
void display ( final com.google.gerrit.client.reviewdb.Account account ) { info.setText ( 0 , fieldIdx , account.getFullName ( ) ) ; info.setText ( 1 , fieldIdx , account.getPreferredEmail ( ) ) ; info.setText ( 2 , fieldIdx , account.getSshUserName ( ) ) ; info.setText ( 3 , fieldIdx , com.google.gerrit.client.FormatUtil.mediumFormat ( account.getRegisteredOn ( ) ) ) ; info.setText ( 4 , fieldIdx , account.getId ( ) . toString ( ) ) ; }

Target:
void display ( final com.google.gerrit.client.reviewdb.Account account ) { info.setText ( 0 , fieldIdx , account.getFullName ( ) ) ; info.setText ( 1 , fieldIdx , account.getPreferredEmail ( ) ) ; info.setText ( 2 , fieldIdx , com.google.gerrit.client.FormatUtil.mediumFormat ( account.getRegisteredOn ( ) ) ) ; info.setText ( 3 , fieldIdx , account.getId ( ) . toString ( ) ) ; }
Source:
public com.google.gerrit.extensions.api.access.ProjectAccessInfo apply ( com.google.gerrit.reviewdb.client.Project.NameKey nameKey ) throws com.google.gerrit.extensions.restapi.ResourceConflictException , com.google.gerrit.extensions.restapi.ResourceNotFoundException , java.io.IOException { try { return this . apply ( new com.google.gerrit.server.project.ProjectResource ( projectControlFactory.controlFor ( nameKey , self.get ( ) ) ) ) ; } catch ( com.google.gerrit.server.project.NoSuchProjectException e ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( nameKey.get ( ) ) ; } }

Target:
public com.google.gerrit.extensions.api.access.ProjectAccessInfo apply ( com.google.gerrit.reviewdb.client.Project.NameKey nameKey ) throws com.google.gerrit.extensions.restapi.ResourceConflictException , com.google.gerrit.extensions.restapi.ResourceNotFoundException , java.io.IOException { try { return apply ( new com.google.gerrit.server.project.ProjectResource ( projectControlFactory.controlFor ( nameKey , self.get ( ) ) ) ) ; } catch ( com.google.gerrit.server.project.NoSuchProjectException e ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( nameKey.get ( ) ) ; } }
Source:
public void testSingleLineMessagesWithSignedOffBy ( ) throws java.lang.Exception { assertEquals ( ( ( "a\n" + ( "\n" + "Change-Id: I7fc3876fee63c766a2063df97fbe04a2dddd8d7c\n" ) ) + ( SOB1 ) ) , call ( ( ( "a\n" + "\n" ) + ( SOB1 ) ) ) ) ; assertEquals ( ( ( ( "a\n" + ( "\n" + "Change-Id: I7fc3876fee63c766a2063df97fbe04a2dddd8d7c\n" ) ) + ( SOB1 ) ) + ( SOB2 ) ) , call ( ( ( ( "a\n" + "\n" ) + ( SOB1 ) ) + ( SOB2 ) ) ) ) ; }

Target:
public void testSingleLineMessagesWithSignedOffBy ( ) throws java.lang.Exception { org.junit.Assert.assertEquals ( ( ( "a\n" + ( "\n" + "Change-Id: I7fc3876fee63c766a2063df97fbe04a2dddd8d7c\n" ) ) + ( SOB1 ) ) , call ( ( ( "a\n" + "\n" ) + ( SOB1 ) ) ) ) ; org.junit.Assert.assertEquals ( ( ( ( "a\n" + ( "\n" + "Change-Id: I7fc3876fee63c766a2063df97fbe04a2dddd8d7c\n" ) ) + ( SOB1 ) ) + ( SOB2 ) ) , call ( ( ( ( "a\n" + "\n" ) + ( SOB1 ) ) + ( SOB2 ) ) ) ) ; }
Source:
private com.google.gerrit.server.account.AuthResult byUserName ( final javax.servlet.http.HttpServletResponse rsp , final java.lang.String userName ) { try { final com.google.gerrit.reviewdb.server.ReviewDb db = schema.open ( ) ; try { com.google.gerrit.reviewdb.client.AccountExternalId.Key key = new com.google.gerrit.reviewdb.client.AccountExternalId.Key ( com.google.gerrit.reviewdb.client.AccountExternalId.SCHEME_USERNAME , userName ) ; return auth ( db.accountExternalIds ( ) . get ( key ) ) ; } finally { db.close ( ) ; } } catch ( com.google.gwtorm.server.OrmException e ) { getServletContext ( ) . log ( "cannot query database" , e ) ; return null ; } }

Target:
private com.google.gerrit.server.account.AuthResult byUserName ( final java.lang.String userName ) { try { final com.google.gerrit.reviewdb.server.ReviewDb db = schema.open ( ) ; try { com.google.gerrit.reviewdb.client.AccountExternalId.Key key = new com.google.gerrit.reviewdb.client.AccountExternalId.Key ( com.google.gerrit.reviewdb.client.AccountExternalId.SCHEME_USERNAME , userName ) ; return auth ( db.accountExternalIds ( ) . get ( key ) ) ; } finally { db.close ( ) ; } } catch ( com.google.gwtorm.server.OrmException e ) { getServletContext ( ) . log ( "cannot query database" , e ) ; return null ; } }
Source:
private com.google.gerrit.server.notedb.ChangeNotes getNotes ( com.google.gerrit.reviewdb.client.Change.Id changeId ) throws com.google.gerrit.sshd.BaseCommand.UnloggedFailure , com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.Change c = db.get ( ) . changes ( ) . get ( changeId ) ; if ( c == null ) { throw com.google.gerrit.sshd.commands.PatchSetParser.error ( ( ( "\"" + changeId ) + "\" no such change" ) ) ; } return notesFactory.create ( c ) ; }

Target:
private com.google.gerrit.server.notedb.ChangeNotes getNotes ( com.google.gerrit.reviewdb.client.Change.Id changeId ) throws com.google.gerrit.sshd.BaseCommand.UnloggedFailure , com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.Change c = db.get ( ) . changes ( ) . get ( changeId ) ; if ( c == null ) { throw com.google.gerrit.sshd.commands.PatchSetParser.error ( ( ( "\"" + changeId ) + "\" no such change" ) ) ; } return notesFactory.create ( db.get ( ) , c ) ; }
Source:
private void enable ( boolean enabled ) { commitMessage.setEnabled ( enabled ) ; commit.setEnabled ( ( enabled ? ! ( access.getOwnerOf ( ) . isEmpty ( ) ) : false ) ) ; review.setEnabled ( ( enabled ? access.canUpload ( ) : false ) ) ; cancel1.setEnabled ( enabled ) ; cancel2.setEnabled ( enabled ) ; }

Target:
private void enable ( boolean enabled ) { commitMessage.setEnabled ( enabled ) ; commit.setEnabled ( ( enabled && ( ! ( access.getOwnerOf ( ) . isEmpty ( ) ) ) ) ) ; review.setEnabled ( ( enabled ? access.canUpload ( ) : false ) ) ; cancel1.setEnabled ( enabled ) ; cancel2.setEnabled ( enabled ) ; }
Source:
public static void getContent ( boolean editExists , com.google.gerrit.reviewdb.client.PatchSet.Id id , java.lang.String filename , com.google.gwt.user.client.rpc.AsyncCallback < java.lang.String > cb ) { com.google.gerrit.client.changes.ChangeFileApi.contentEditOrPs ( editExists , id , filename ) . get ( new com.google.gerrit.client.changes.ChangeFileApi.CallbackWrapper < com.google.gerrit.client.rpc.NativeString , java.lang.String > ( cb ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.rpc.NativeString b64 ) { wrapped.onSuccess ( com.google.gerrit.client.changes.ChangeFileApi.b64decode ( b64.asString ( ) ) ) ; } } ) ; }

Target:
public static void getContent ( com.google.gerrit.reviewdb.client.PatchSet.Id id , java.lang.String filename , com.google.gwt.user.client.rpc.AsyncCallback < java.lang.String > cb ) { com.google.gerrit.client.changes.ChangeFileApi.contentEditOrPs ( id , filename ) . get ( new com.google.gerrit.client.changes.ChangeFileApi.CallbackWrapper < com.google.gerrit.client.rpc.NativeString , java.lang.String > ( cb ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.rpc.NativeString b64 ) { if ( b64 != null ) { wrapped.onSuccess ( com.google.gerrit.client.changes.ChangeFileApi.b64decode ( b64.asString ( ) ) ) ; } } } ) ; }
Source:
public com.google.gerrit.extensions.restapi.Response < com.google.gerrit.server.project.DashboardsCollection.DashboardInfo > apply ( com.google.gerrit.server.project.DashboardResource resource , com.google.gerrit.server.project.DeleteDashboard.Input input ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.BadRequestException , com.google.gerrit.extensions.restapi.MethodNotAllowedException , com.google.gerrit.extensions.restapi.ResourceConflictException , com.google.gerrit.extensions.restapi.ResourceNotFoundException , java.io.IOException { if ( resource.isProjectDefault ( ) ) { com.google.gerrit.server.project.SetDashboard.Input in = new com.google.gerrit.server.project.SetDashboard.Input ( ) ; in.commitMessage = ( input != null ) ? input.commitMessage : null ; return defaultSetter.get ( ) . apply ( resource , in ) ; } throw new com.google.gerrit.extensions.restapi.MethodNotAllowedException ( ) ; }

Target:
public com.google.gerrit.extensions.restapi.Response < com.google.gerrit.server.project.DashboardsCollection.DashboardInfo > apply ( com.google.gerrit.server.project.DashboardResource resource , com.google.gerrit.server.project.SetDashboard.Input input ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.BadRequestException , com.google.gerrit.extensions.restapi.MethodNotAllowedException , com.google.gerrit.extensions.restapi.ResourceConflictException , com.google.gerrit.extensions.restapi.ResourceNotFoundException , java.io.IOException { if ( resource.isProjectDefault ( ) ) { com.google.gerrit.server.project.SetDashboard.Input in = new com.google.gerrit.server.project.SetDashboard.Input ( ) ; in.commitMessage = ( input != null ) ? input.commitMessage : null ; return defaultSetter.get ( ) . apply ( resource , in ) ; } throw new com.google.gerrit.extensions.restapi.MethodNotAllowedException ( ) ; }
Source:
private PatchSet.Id parsePatchSetId ( org.eclipse.jgit.revwalk.RevCommit commit ) throws org.eclipse.jgit.errors.ConfigInvalidException { java.lang.String psIdLine = parseExactlyOneFooter ( commit , com.google.gerrit.server.notedb.ChangeNoteUtil.FOOTER_PATCH_SET ) ; int s = psIdLine.indexOf ( ' ' ) ; java.lang.String psIdStr = ( s < 0 ) ? psIdLine : psIdLine.substring ( 0 , s ) ; java.lang.Integer psId = com.google.common.primitives.Ints.tryParse ( psIdStr ) ; if ( psId == null ) { throw invalidFooter ( com.google.gerrit.server.notedb.ChangeNoteUtil.FOOTER_PATCH_SET , psIdStr ) ; } return new com.google.gerrit.reviewdb.client.PatchSet.Id ( changeId , psId ) ; }

Target:
private PatchSet.Id parsePatchSetId ( org.eclipse.jgit.revwalk.RevCommit commit ) throws org.eclipse.jgit.errors.ConfigInvalidException { java.lang.String psIdLine = parseExactlyOneFooter ( commit , com.google.gerrit.server.notedb.ChangeNoteUtil.FOOTER_PATCH_SET ) ; int s = psIdLine.indexOf ( ' ' ) ; java.lang.String psIdStr = ( s < 0 ) ? psIdLine : psIdLine.substring ( 0 , s ) ; java.lang.Integer psId = com.google.common.primitives.Ints.tryParse ( psIdStr ) ; if ( psId == null ) { throw invalidFooter ( com.google.gerrit.server.notedb.ChangeNoteUtil.FOOTER_PATCH_SET , psIdStr ) ; } return new com.google.gerrit.reviewdb.client.PatchSet.Id ( id , psId ) ; }
Source:
public boolean match ( final com.google.gerrit.server.query.change.ChangeData object ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.Change c = object.change ( ) ; if ( c == null ) { return false ; } com.google.gerrit.reviewdb.client.PatchSet.Id current = c.currentPatchSetId ( ) ; for ( com.google.gerrit.reviewdb.client.PatchSetApproval p : object.approvals ( ) . values ( ) ) { if ( ( p.getPatchSetId ( ) . equals ( current ) ) && ( ( p.getValue ( ) ) != 0 ) ) { return true ; } } return false ; }

Target:
public boolean match ( final com.google.gerrit.server.query.change.ChangeData object ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.Change c = object.change ( ) ; if ( c == null ) { return false ; } com.google.gerrit.reviewdb.client.PatchSet.Id current = c.currentPatchSetId ( ) ; for ( com.google.gerrit.reviewdb.client.PatchSetApproval p : object.approvals ( ) . get ( current ) ) { if ( ( p.getValue ( ) ) != 0 ) { return true ; } } return false ; }
Source:
private static com.google.gwtorm.schema.java.JavaColumnModel [ ] scanFields ( java.lang.Class < ? > in ) throws com.google.gwtorm.client.OrmException { final java.util.Collection < com.google.gwtorm.schema.java.JavaColumnModel > col = new java.util.ArrayList < com.google.gwtorm.schema.java.JavaColumnModel > ( ) ; while ( in != null ) { for ( final java.lang.reflect.Field f : in.getDeclaredFields ( ) ) { if ( ( f.getAnnotation ( com.google.gwtorm.client.Column.class ) ) != null ) { col.add ( new com.google.gwtorm.schema.java.JavaColumnModel ( f ) ) ; } } in = in.getSuperclass ( ) ; } if ( col.isEmpty ( ) ) { throw new com.google.gwtorm.client.OrmException ( "Cannot create new encoder, no @Column fields found" ) ; } return com.google.gwtorm.protobuf.CodecGen.sort ( col ) ; }

Target:
private static com.google.gwtorm.schema.java.JavaColumnModel [ ] scanFields ( java.lang.Class < ? > in ) throws com.google.gwtorm.server.OrmException { final java.util.Collection < com.google.gwtorm.schema.java.JavaColumnModel > col = new java.util.ArrayList < com.google.gwtorm.schema.java.JavaColumnModel > ( ) ; while ( in != null ) { for ( final java.lang.reflect.Field f : in.getDeclaredFields ( ) ) { if ( ( f.getAnnotation ( com.google.gwtorm.client.Column.class ) ) != null ) { col.add ( new com.google.gwtorm.schema.java.JavaColumnModel ( f ) ) ; } } in = in.getSuperclass ( ) ; } if ( col.isEmpty ( ) ) { throw new com.google.gwtorm.server.OrmException ( "Cannot create new encoder, no @Column fields found" ) ; } return com.google.gwtorm.protobuf.CodecGen.sort ( col ) ; }
Source:
public void byCommit ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < com.google.gerrit.testutil.InMemoryRepositoryManager.Repo > repo = createProject ( "repo" ) ; com.google.gerrit.server.change.ChangeInserter ins = newChange ( repo ) ; insert ( ins ) ; java.lang.String sha = ins.getPatchSet ( ) . getRevision ( ) . get ( ) ; assertQuery ( "0000000000000000000000000000000000000000" ) ; for ( int i = 0 ; i <= 36 ; i ++ ) { java.lang.String q = sha.substring ( 0 , ( 40 - i ) ) ; assertQuery ( q , ins.getChange ( ) ) ; } }

Target:
public void byCommit ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < com.google.gerrit.testutil.InMemoryRepositoryManager.Repo > repo = createProject ( "repo" ) ; com.google.gerrit.server.change.ChangeInserter ins = newChange ( repo ) ; insert ( repo , ins ) ; java.lang.String sha = ins.getPatchSet ( ) . getRevision ( ) . get ( ) ; assertQuery ( "0000000000000000000000000000000000000000" ) ; for ( int i = 0 ; i <= 36 ; i ++ ) { java.lang.String q = sha.substring ( 0 , ( 40 - i ) ) ; assertQuery ( q , ins.getChange ( ) ) ; } }
Source:
public void shouldDeleteFromIndexInRemoteOnChangeDeletedEvent ( ) throws java.lang.Exception { org.easymock.EasyMock.reset ( cd ) ; org.easymock.EasyMock.expect ( restClientMock.deleteFromIndex ( com.ericsson.gerrit.plugins.syncindex.IndexEventHandlerTest.CHANGE_ID ) ) . andReturn ( true ) ; replayAll ( ) ; indexEventHandler.onChangeDeleted ( id ) ; verifyAll ( ) ; }

Target:
public void shouldDeleteFromIndexInRemoteOnChangeDeletedEvent ( ) throws java.lang.Exception { org.easymock.EasyMock.reset ( cd ) ; org.easymock.EasyMock.expect ( restClientMock.deleteFromIndex ( com.ericsson.gerrit.plugins.syncindex.IndexEventHandlerTest.CHANGE_ID ) ) . andReturn ( true ) ; replayAll ( ) ; indexEventHandler.onChangeDeleted ( id.get ( ) ) ; verifyAll ( ) ; }