auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testLimit ( ) throws java.lang.Exception { com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > in = parse ( "file:a limit:3" ) ; com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > out = rewrite ( in ) ; assertSame ( com.google.gerrit.server.query.change.AndSource.class , out.getClass ( ) ) ; assertEquals ( com.google.common.collect.ImmutableList.of ( query ( in.getChild ( 0 ) , 3 ) , in.getChild ( 1 ) ) , out.getChildren ( ) ) ; }

Target:
public void testLimit ( ) throws java.lang.Exception { com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > in = parse ( "file:a limit:3" ) ; com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > out = rewrite ( in ) ; org.junit.Assert.assertSame ( com.google.gerrit.server.query.change.AndSource.class , out.getClass ( ) ) ; org.junit.Assert.assertEquals ( com.google.common.collect.ImmutableList.of ( query ( in.getChild ( 0 ) , 3 ) , in.getChild ( 1 ) ) , out.getChildren ( ) ) ; }
Source:
public void revisionActionsOneChangePerTopicUnapproved ( ) throws java.lang.Exception { java.lang.String changeId = createChangeWithTopic ( name ( "foo1" ) ) . getChangeId ( ) ; java.util.Map < java.lang.String , com.google.gerrit.extensions.common.ActionInfo > actions = getActions ( changeId ) ; com.google.common.truth.Truth.assertThat ( actions ) . containsKey ( "cherrypick" ) ; com.google.common.truth.Truth.assertThat ( actions ) . containsKey ( "rebase" ) ; com.google.common.truth.Truth.assertThat ( actions ) . hasSize ( 2 ) ; }

Target:
public void revisionActionsOneChangePerTopicUnapproved ( ) throws java.lang.Exception { java.lang.String changeId = createChangeWithTopic ( ) . getChangeId ( ) ; java.util.Map < java.lang.String , com.google.gerrit.extensions.common.ActionInfo > actions = getActions ( changeId ) ; com.google.common.truth.Truth.assertThat ( actions ) . containsKey ( "cherrypick" ) ; com.google.common.truth.Truth.assertThat ( actions ) . containsKey ( "rebase" ) ; com.google.common.truth.Truth.assertThat ( actions ) . hasSize ( 2 ) ; }
Source:
private static java.util.List < com.google.gerrit.server.change.RevisionResource > toResources ( final com.google.gerrit.server.change.ChangeResource change , java.lang.Iterable < com.google.gerrit.reviewdb.client.PatchSet > patchSets ) { return com.google.common.collect.FluentIterable.from ( patchSets ) . transform ( new com.google.common.base.Function < com.google.gerrit.reviewdb.client.PatchSet , com.google.gerrit.server.change.RevisionResource > ( ) { @ java.lang.Override public com.google.gerrit.server.change.RevisionResource apply ( com.google.gerrit.reviewdb.client.PatchSet in ) { return new com.google.gerrit.server.change.RevisionResource ( change , in ) ; } } ) . toList ( ) ; }

Target:
public boolean apply ( com.google.gerrit.reviewdb.client.PatchSet in ) { return changeId.equals ( in.getId ( ) . getParentKey ( ) ) ; }
Source:
private void abandonAllOpenChanges ( com.google.gerrit.reviewdb.client.Project.NameKey destProject ) throws com.google.gerrit.server.project.NoSuchChangeException { try { for ( com.google.gerrit.server.query.change.ChangeData cd : internalChangeQuery.byProjectOpen ( destProject ) ) { abandonOneChange ( cd.change ( ) ) ; } } catch ( java.io.IOException | com.google.gwtorm.server.OrmException e ) { logWarn ( "Cannot abandon changes for deleted project " , e ) ; } }

Target:
private void abandonAllOpenChanges ( com.google.gerrit.reviewdb.client.Project.NameKey destProject ) { try { for ( com.google.gerrit.server.query.change.ChangeData cd : internalChangeQuery.byProjectOpen ( destProject ) ) { abandonOneChange ( cd.change ( ) ) ; } } catch ( com.google.gerrit.server.project.NoSuchChangeException | java.io.IOException | com.google.gwtorm.server.OrmException e ) { logWarn ( ( "Cannot abandon changes for deleted project " + destProject ) , e ) ; } }
Source:
public boolean retryRequest ( org.apache.http.HttpResponse response , int executionCount , org.apache.http.protocol.HttpContext context ) { if ( executionCount > ( cfg.getMaxTries ( ) ) ) { return false ; } if ( ( response.getStatusLine ( ) . getStatusCode ( ) ) >= ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpClientProvider.ERROR_CODES ) ) { logRetry ( response.getStatusLine ( ) . getReasonPhrase ( ) ) ; return true ; } return false ; }

Target:
public boolean retryRequest ( org.apache.http.HttpResponse response , int executionCount , org.apache.http.protocol.HttpContext context ) { if ( executionCount > ( cfg.getMaxTries ( ) ) ) { return false ; } if ( ( response.getStatusLine ( ) . getStatusCode ( ) ) >= ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpClientProvider.ERROR_CODES ) ) { logRetry ( response.getStatusLine ( ) . getReasonPhrase ( ) , context ) ; return true ; } return false ; }
Source:
public void removeOldEvents ( int maxAge ) throws java.sql.SQLException { java.sql.Connection conn = ds.getConnection ( ) ; java.sql.Statement stat = conn.createStatement ( ) ; try { stat.execute ( java.lang.String.format ( "DELETE FROM %s WHERE %s < '%s'" , com.ericsson.gerrit.plugins.eventslog.sql.SQLTable.TABLE_NAME , com.ericsson.gerrit.plugins.eventslog.sql.SQLTable.DATE_ENTRY , new java.sql.Timestamp ( ( ( java.lang.System.currentTimeMillis ( ) ) - ( java.util.concurrent.TimeUnit.MILLISECONDS.convert ( maxAge , java.util.concurrent.TimeUnit.DAYS ) ) ) ) ) ) ; } finally { closeStatement ( stat ) ; closeConnection ( conn ) ; } }

Target:
public void removeOldEvents ( int maxAge ) throws java.sql.SQLException { try ( java.sql.Connection conn = ds.getConnection ( ) ; java.sql.Statement stat = conn.createStatement ( ) ) { stat.execute ( java.lang.String.format ( "DELETE FROM %s WHERE %s < '%s'" , com.ericsson.gerrit.plugins.eventslog.sql.SQLTable.TABLE_NAME , com.ericsson.gerrit.plugins.eventslog.sql.SQLTable.DATE_ENTRY , new java.sql.Timestamp ( ( ( java.lang.System.currentTimeMillis ( ) ) - ( java.util.concurrent.TimeUnit.MILLISECONDS.convert ( maxAge , java.util.concurrent.TimeUnit.DAYS ) ) ) ) ) ) ; } }
Source:
private java.util.List < com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.Scope > parseScopesString ( java.lang.String scopesString ) { java.util.ArrayList < com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.Scope > scopes = new java.util.ArrayList < > ( ) ; if ( ( com.google.common.base.Strings.emptyToNull ( scopesString ) ) != null ) { java.lang.String [ ] scopesStrings = scopesString.split ( "," ) ; for ( java.lang.String scope : scopesStrings ) { scopes.add ( java.lang.Enum.valueOf ( com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.Scope.class , scope.trim ( ) ) ) ; } } return scopes ; }

Target:
private java.util.List < com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.Scope > parseScopesString ( java.lang.String scopesString ) { java.util.ArrayList < com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.Scope > result = new java.util.ArrayList < > ( ) ; if ( ( com.google.common.base.Strings.emptyToNull ( scopesString ) ) != null ) { java.lang.String [ ] scopesStrings = scopesString.split ( "," ) ; for ( java.lang.String scope : scopesStrings ) { result.add ( java.lang.Enum.valueOf ( com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.Scope.class , scope.trim ( ) ) ) ; } } return result ; }
Source:
java.lang.String [ ] getList ( java.lang.String section , java.lang.String subsection , java.lang.String name ) ;

Target:
public final java.lang.String get ( java.lang.String section , java.lang.String subsection , java.lang.String name ) { java.lang.String [ ] values = getList ( section , subsection , name ) ; if ( ( values != null ) && ( ( values.length ) > 0 ) ) { return values [ 0 ] ; } return null ; }
Source:
public com.google.gerrit.reviewdb.client.PatchSet patch ( com.google.gerrit.reviewdb.client.PatchSet.Id psId ) throws com.google.gwtorm.server.OrmException { if ( ( ( currentPatchSet ) != null ) && ( currentPatchSet.getId ( ) . equals ( psId ) ) ) { return currentPatchSet ; } for ( com.google.gerrit.reviewdb.client.PatchSet ps : patches ( ) ) { if ( ps.getId ( ) . equals ( psId ) ) { return ps ; } } return null ; }

Target:
public com.google.gerrit.reviewdb.client.PatchSet patchSet ( com.google.gerrit.reviewdb.client.PatchSet.Id psId ) throws com.google.gwtorm.server.OrmException { if ( ( ( currentPatchSet ) != null ) && ( currentPatchSet.getId ( ) . equals ( psId ) ) ) { return currentPatchSet ; } for ( com.google.gerrit.reviewdb.client.PatchSet ps : patchSets ( ) ) { if ( ps.getId ( ) . equals ( psId ) ) { return ps ; } } return null ; }
Source:
void add ( ) { java.util.List < java.lang.String > values = new java.util.ArrayList < > ( ) ; for ( com.google.gwtexpui.globalkey.client.NpTextBox input : inputs ) { java.lang.String v = input.getValue ( ) . trim ( ) ; if ( ! ( v.isEmpty ( ) ) ) { input.setValue ( "" ) ; values.add ( v ) ; } } t.insert ( values ) ; }

Target:
void add ( ) { java.util.List < java.lang.String > values = new java.util.ArrayList < > ( ) ; for ( com.google.gwtexpui.globalkey.client.NpTextBox input : inputs ) { java.lang.String v = input.getValue ( ) . trim ( ) ; if ( ! ( v.isEmpty ( ) ) ) { input.setValue ( "" ) ; values.add ( v ) ; } } insert ( values ) ; }
Source:
private com.google.gerrit.server.events.Event getEventFromRequest ( javax.servlet.http.HttpServletRequest req ) throws java.io.IOException { if ( com.google.common.net.MediaType.parse ( req.getContentType ( ) ) . is ( com.google.common.net.MediaType.JSON_UTF_8 ) ) { java.lang.String jsonEvent = com.google.common.io.CharStreams.toString ( req.getReader ( ) ) ; com.google.gson.Gson gson = new com.google.gson.GsonBuilder ( ) . registerTypeAdapter ( com.google.gerrit.server.events.Event.class , new com.google.gerrit.server.events.EventDeserializer ( ) ) . registerTypeAdapter ( com.google.common.base.Supplier.class , new com.google.gerrit.server.events.SupplierDeserializer ( ) ) . create ( ) ; return gson.fromJson ( jsonEvent , com.google.gerrit.server.events.Event.class ) ; } return null ; }

Target:
private com.google.gerrit.server.events.Event getEventFromRequest ( javax.servlet.http.HttpServletRequest req ) throws java.io.IOException { java.lang.String jsonEvent = com.google.common.io.CharStreams.toString ( req.getReader ( ) ) ; com.google.gson.Gson gson = new com.google.gson.GsonBuilder ( ) . registerTypeAdapter ( com.google.gerrit.server.events.Event.class , new com.google.gerrit.server.events.EventDeserializer ( ) ) . registerTypeAdapter ( com.google.common.base.Supplier.class , new com.google.gerrit.server.events.SupplierDeserializer ( ) ) . create ( ) ; return gson.fromJson ( jsonEvent , com.google.gerrit.server.events.Event.class ) ; }
Source:
private void generateProxyConstructor ( final com.google.gwt.core.ext.TreeLogger logger , final com.google.gwt.user.rebind.SourceWriter w ) { final com.google.gwt.user.client.rpc.RemoteServiceRelativePath relPath = svcInf.getAnnotation ( com.google.gwt.user.client.rpc.RemoteServiceRelativePath.class ) ; if ( relPath != null ) { w.println ( ) ; w.println ( ( ( "public " + ( getProxySimpleName ( ) ) ) + "() {" ) ) ; w.indent ( ) ; w.println ( ( ( "setServiceEntryPoint(GWT.getModuleBaseURL() + \"" + ( relPath.value ( ) ) ) + "\");" ) ) ; w.outdent ( ) ; w.println ( "}" ) ; } }

Target:
private void generateProxyConstructor ( final com.google.gwt.user.rebind.SourceWriter w ) { final com.google.gwt.user.client.rpc.RemoteServiceRelativePath relPath = svcInf.getAnnotation ( com.google.gwt.user.client.rpc.RemoteServiceRelativePath.class ) ; if ( relPath != null ) { w.println ( ) ; w.println ( ( ( "public " + ( getProxySimpleName ( ) ) ) + "() {" ) ) ; w.indent ( ) ; w.println ( ( ( "setServiceEntryPoint(GWT.getModuleBaseURL() + \"" + ( relPath.value ( ) ) ) + "\");" ) ) ; w.outdent ( ) ; w.println ( "}" ) ; } }
Source:
private void appliedBy ( com.google.gerrit.common.data.SubmitRecord.Label label , com.googlecode.prolog_cafe.lang.Term status ) throws com.google.gerrit.server.project.ChangeControl.UserTermExpected { if ( ( status.isStructure ( ) ) && ( ( status.arity ( ) ) == 1 ) ) { com.googlecode.prolog_cafe.lang.Term who = status.arg ( 0 ) ; if ( com.google.gerrit.server.project.ChangeControl.isUser ( who ) ) { label.appliedBy = new com.google.gerrit.reviewdb.client.Account.Id ( ( ( com.googlecode.prolog_cafe.lang.IntegerTerm ) ( who.arg ( 0 ) ) ) . intValue ( ) ) ; } else { throw new com.google.gerrit.server.project.ChangeControl.UserTermExpected ( label ) ; } } }

Target:
private void appliedBy ( com.google.gerrit.common.data.SubmitRecord.Label label , com.googlecode.prolog_cafe.lang.Term status ) { if ( ( status.isStructure ( ) ) && ( ( status.arity ( ) ) == 1 ) ) { com.googlecode.prolog_cafe.lang.Term who = status.arg ( 0 ) ; if ( com.google.gerrit.server.project.ChangeControl.isUser ( who ) ) { label.appliedBy = new com.google.gerrit.reviewdb.client.Account.Id ( ( ( com.googlecode.prolog_cafe.lang.IntegerTerm ) ( who.arg ( 0 ) ) ) . intValue ( ) ) ; } } }
Source:
void audit ( java.lang.Object result , java.lang.String commandName , java.lang.String [ ] args ) { final com.google.gerrit.sshd.SshScope.Context ctx = context.get ( ) ; final java.lang.String sid = extractSessionId ( ctx ) ; final long created = extractCreated ( ctx ) ; final java.lang.String what = extractWhat ( commandName , args ) ; auditService.dispatch ( new com.google.gerrit.audit.AuditEvent ( sid , extractCurrentUser ( ctx ) , ( "ssh:" + what ) , created , java.util.Arrays.asList ( args ) , result ) ) ; }

Target:
void audit ( com.google.gerrit.sshd.SshScope.Context ctx , java.lang.Object result , java.lang.String commandName , java.lang.String [ ] args ) { final java.lang.String sid = extractSessionId ( ctx ) ; final long created = extractCreated ( ctx ) ; final java.lang.String what = extractWhat ( commandName , args ) ; auditService.dispatch ( new com.google.gerrit.audit.AuditEvent ( sid , extractCurrentUser ( ctx ) , ( "ssh:" + what ) , created , java.util.Arrays.asList ( args ) , result ) ) ; }
Source:
private void loadDraftComments ( com.google.gerrit.reviewdb.client.Account.Id author ) throws com.google.gwtorm.server.OrmException { if ( ( ( draftCommentNotes ) == null ) || ( ! ( author.equals ( draftCommentNotes.getAuthor ( ) ) ) ) ) { draftCommentNotes = new com.google.gerrit.server.notedb.DraftCommentNotes ( args , getChangeId ( ) , author ) ; draftCommentNotes.load ( ) ; } }

Target:
private void loadDraftComments ( com.google.gerrit.reviewdb.client.Account.Id author ) throws com.google.gwtorm.server.OrmException { if ( ( ( draftCommentNotes ) == null ) || ( ! ( author.equals ( draftCommentNotes.getAuthor ( ) ) ) ) ) { draftCommentNotes = new com.google.gerrit.server.notedb.DraftCommentNotes ( args , change , author ) ; draftCommentNotes.load ( ) ; } }
Source:
public static void submit ( int id , java.lang.String commit , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.changes.SubmitInfo > cb ) { com.google.gerrit.client.changes.ChangeApi.SubmitInput in = com.google.gerrit.client.changes.ChangeApi.SubmitInput.create ( ) ; in.wait_for_merge ( true ) ; com.google.gerrit.client.changes.ChangeApi.call ( id , commit , "submit" ) . data ( in ) . post ( cb ) ; }

Target:
public static void submit ( int id , java.lang.String commit , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.changes.SubmitInfo > cb ) { com.google.gerrit.client.changes.ChangeApi.SubmitInput in = com.google.gerrit.client.changes.ChangeApi.SubmitInput.create ( ) ; in.wait_for_merge ( true ) ; com.google.gerrit.client.changes.ChangeApi.call ( id , commit , "submit" ) . post ( in , cb ) ; }
Source:
public org.kohsuke.github.GHRepository getGHRepository ( ) throws java.io.IOException { if ( ghLogin.getMyself ( ) . getLogin ( ) . equals ( organisation ) ) { return ghLogin.getMyself ( ) . getRepository ( repoName ) ; } else { return ghLogin.getHub ( ) . getOrganization ( organisation ) . getRepository ( repoName ) ; } }

Target:
public org.kohsuke.github.GHRepository getGHRepository ( ) throws java.io.IOException { if ( ghLogin.getMyself ( ) . getLogin ( ) . equals ( organisation ) ) { return ghLogin.getMyself ( ) . getRepository ( repoName ) ; } return ghLogin.getHub ( ) . getOrganization ( organisation ) . getRepository ( repoName ) ; }
Source:
public void evaluate ( ) throws java.lang.Throwable { boolean mem = ( description.getAnnotation ( com.google.gerrit.acceptance.UseLocalDisk.class ) ) == null ; boolean enableHttpd = ( ( description.getAnnotation ( com.google.gerrit.acceptance.NoHttpd.class ) ) == null ) && ( ( description.getTestClass ( ) . getAnnotation ( com.google.gerrit.acceptance.NoHttpd.class ) ) == null ) ; beforeTest ( config ( description ) , mem , enableHttpd ) ; base.evaluate ( ) ; afterTest ( ) ; }

Target:
public void evaluate ( ) throws java.lang.Throwable { beforeTest ( description ) ; try { base.evaluate ( ) ; } finally { afterTest ( ) ; } }
Source:
public void setMillisProvider ( ) { clockStepMs = java.util.concurrent.TimeUnit.MILLISECONDS.convert ( 1 , java.util.concurrent.TimeUnit.SECONDS ) ; final java.util.concurrent.atomic.AtomicLong clockMs = new java.util.concurrent.atomic.AtomicLong ( ( ( java.util.concurrent.TimeUnit.MILLISECONDS.convert ( ChangeUtil.SORT_KEY_EPOCH_MINS , java.util.concurrent.TimeUnit.MINUTES ) ) + ( java.util.concurrent.TimeUnit.MILLISECONDS.convert ( 60 , java.util.concurrent.TimeUnit.DAYS ) ) ) ) ; org.joda.time.DateTimeUtils.setCurrentMillisProvider ( new org.joda.time.DateTimeUtils.MillisProvider ( ) { @ java.lang.Override public long getMillis ( ) { return clockMs.getAndAdd ( clockStepMs ) ; } } ) ; }

Target:
private void setMillisProvider ( ) { clockStepMs = java.util.concurrent.TimeUnit.MILLISECONDS.convert ( 1 , java.util.concurrent.TimeUnit.SECONDS ) ; final java.util.concurrent.atomic.AtomicLong clockMs = new java.util.concurrent.atomic.AtomicLong ( ( ( java.util.concurrent.TimeUnit.MILLISECONDS.convert ( ChangeUtil.SORT_KEY_EPOCH_MINS , java.util.concurrent.TimeUnit.MINUTES ) ) + ( java.util.concurrent.TimeUnit.MILLISECONDS.convert ( 60 , java.util.concurrent.TimeUnit.DAYS ) ) ) ) ; org.joda.time.DateTimeUtils.setCurrentMillisProvider ( new org.joda.time.DateTimeUtils.MillisProvider ( ) { @ java.lang.Override public long getMillis ( ) { return clockMs.getAndAdd ( clockStepMs ) ; } } ) ; }
Source:
public void createNewChangeSignedOffByFooter ( ) throws java.lang.Exception { HEAD ( 0 ) ; com.google.gerrit.acceptance.rest.change.af28d Merge ; into ( ( ( stable ) - 2.15 ) ) ; setSignedOffByFooter ( ) ; com.google.gerrit.extensions.common.ChangeInfo info = assertCreateSucceeds ( newChangeInput ( ChangeStatus.NEW ) ) ; java.lang.String message = info.revisions.get ( info.currentRevision ) . commit.message ; com.google.common.truth.Truth.assertThat ( message ) . contains ( java.lang.String.format ( "%sAdministrator <%s>" , org.eclipse.jgit.lib.Constants.SIGNED_OFF_BY_TAG , admin.getIdent ( ) . getEmailAddress ( ) ) ) ; }

Target:
public void createNewChangeSignedOffByFooter ( ) throws java.lang.Exception { setSignedOffByFooter ( true ) ; try { com.google.gerrit.extensions.common.ChangeInfo info = assertCreateSucceeds ( newChangeInput ( ChangeStatus.NEW ) ) ; java.lang.String message = info.revisions.get ( info.currentRevision ) . commit.message ; com.google.common.truth.Truth.assertThat ( message ) . contains ( java.lang.String.format ( "%sAdministrator <%s>" , org.eclipse.jgit.lib.Constants.SIGNED_OFF_BY_TAG , admin.getIdent ( ) . getEmailAddress ( ) ) ) ; } finally { setSignedOffByFooter ( false ) ; } }
Source:
public void createEmptyChange_MissingBranch ( ) throws java.lang.Exception { com.google.gerrit.extensions.common.ChangeInfo ci = new com.google.gerrit.extensions.common.ChangeInfo ( ) ; ci.project = project.get ( ) ; com.google.gerrit.acceptance.RestResponse r = adminSession.post ( "/changes/" , ci ) ; org.junit.Assert.assertEquals ( HttpStatus.SC_BAD_REQUEST , r.getStatusCode ( ) ) ; org.junit.Assert.assertTrue ( r.getEntityContent ( ) . contains ( "branch must be non-empty" ) ) ; }

Target:
public void createEmptyChange_MissingBranch ( ) throws java.lang.Exception { com.google.gerrit.extensions.common.ChangeInfo ci = new com.google.gerrit.extensions.common.ChangeInfo ( ) ; ci.project = project.get ( ) ; com.google.gerrit.acceptance.RestResponse r = adminSession.post ( "/changes/" , ci ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( HttpStatus.SC_BAD_REQUEST ) ; com.google.common.truth.Truth.assertThat ( r.getEntityContent ( ) ) . contains ( "branch must be non-empty" ) ; }
Source:
private void assertSubmitApproval ( com.google.gerrit.reviewdb.client.PatchSet.Id patchSetId ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.Change c = db.changes ( ) . get ( patchSetId.getParentKey ( ) ) ; com.google.gerrit.server.notedb.ChangeNotes notes = changeNotesFactory.create ( c ) . load ( ) ; com.google.gerrit.reviewdb.client.PatchSetApproval a = approvalsUtil.getSubmitter ( db , notes , patchSetId ) ; org.junit.Assert.assertTrue ( a.isSubmit ( ) ) ; org.junit.Assert.assertEquals ( 1 , a.getValue ( ) ) ; org.junit.Assert.assertEquals ( admin.id , a.getAccountId ( ) ) ; }

Target:
private void assertSubmitApproval ( com.google.gerrit.reviewdb.client.PatchSet.Id patchSetId ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.PatchSetApproval a = getSubmitter ( patchSetId ) ; org.junit.Assert.assertTrue ( a.isSubmit ( ) ) ; org.junit.Assert.assertEquals ( 1 , a.getValue ( ) ) ; org.junit.Assert.assertEquals ( admin.id , a.getAccountId ( ) ) ; }
Source:
public com.google.common.collect.Multimap < com.google.gerrit.reviewdb.client.Project.NameKey , com.google.gerrit.server.query.change.ChangeData > changesByProject ( ) throws com.google.gwtorm.server.OrmException { com.google.common.collect.ListMultimap < com.google.gerrit.reviewdb.client.Project.NameKey , com.google.gerrit.server.query.change.ChangeData > ret = com.google.common.collect.ArrayListMultimap.create ( ) ; for ( com.google.gerrit.server.query.change.ChangeData cd : changeData.values ( ) ) { ret.put ( cd.change ( ) . getProject ( ) , cd ) ; } return ret ; }

Target:
public com.google.common.collect.Multimap < com.google.gerrit.reviewdb.client.Project.NameKey , com.google.gerrit.reviewdb.client.Change.Id > changesByProject ( ) throws com.google.gwtorm.server.OrmException { com.google.common.collect.ListMultimap < com.google.gerrit.reviewdb.client.Project.NameKey , com.google.gerrit.reviewdb.client.Change.Id > ret = com.google.common.collect.ArrayListMultimap.create ( ) ; for ( com.google.gerrit.server.query.change.ChangeData cd : changeData.values ( ) ) { ret.put ( cd.change ( ) . getProject ( ) , cd.getId ( ) ) ; } return ret ; }
Source:
public void login ( final com.google.gerrit.server.account.AuthResult res , final boolean rememberMe ) { final com.google.gerrit.reviewdb.Account.Id id = res.getAccountId ( ) ; final com.google.gerrit.reviewdb.AccountExternalId.Key identity = res.getExternalId ( ) ; if ( ( val ) != null ) { manager.destroy ( key ) ; key = null ; val = null ; } key = manager.createKey ( id ) ; val = manager.createVal ( key , id , rememberMe , identity ) ; saveCookie ( ) ; }

Target:
public void login ( final com.google.gerrit.server.account.AuthResult res , final boolean rememberMe ) { final com.google.gerrit.reviewdb.Account.Id id = res.getAccountId ( ) ; final com.google.gerrit.reviewdb.AccountExternalId.Key identity = res.getExternalId ( ) ; if ( ( val ) != null ) { manager.destroy ( key ) ; } key = manager.createKey ( id ) ; val = manager.createVal ( key , id , rememberMe , identity , null ) ; saveCookie ( ) ; }
Source:
public void emptyServletPath ( ) { org.junit.Assert.assertEquals ( "/foo/bar" , com.google.gerrit.util.http.RequestUtil.getEncodedPathInfo ( mockRequest ( "/c/foo/bar" , "/c" , "" ) ) ) ; org.junit.Assert.assertEquals ( "/foo%2Fbar" , com.google.gerrit.util.http.RequestUtil.getEncodedPathInfo ( mockRequest ( "/c/foo%2Fbar" , "/c" , "" ) ) ) ; }

Target:
public void emptyServletPath ( ) { com.google.common.truth.Truth.assertThat ( com.google.gerrit.util.http.RequestUtil.getEncodedPathInfo ( mockRequest ( "/c/foo/bar" , "" , "/c" ) ) ) . isEqualTo ( "/foo/bar" ) ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.util.http.RequestUtil.getEncodedPathInfo ( mockRequest ( "/c/foo%2Fbar" , "" , "/c" ) ) ) . isEqualTo ( "/foo%2Fbar" ) ; }
Source:
public com.google.gitiles.GitilesView.Builder setOldRevision ( com.google.gitiles.Revision revision ) { switch ( type ) { case DIFF : case LOG : break ; case ARCHIVE : case BLAME : case DESCRIBE : case DOC : case HOST_INDEX : case PATH : case REFS : case REPOSITORY_INDEX : case REVISION : case ROOTED_DOC : case SHOW : default : revision = com.google.common.base.MoreObjects.firstNonNull ( revision , Revision.NULL ) ; com.google.common.base.Preconditions.checkState ( ( revision == ( Revision.NULL ) ) , "cannot set old revision on %s view" , type ) ; break ; } this . oldRevision = revision ; return this ; }

Target:
public com.google.gitiles.GitilesView.Builder setOldRevision ( com.google.gitiles.Revision revision ) { switch ( type ) { case DIFF : case LOG : break ; default : revision = com.google.common.base.MoreObjects.firstNonNull ( revision , Revision.NULL ) ; com.google.common.base.Preconditions.checkState ( ( revision == ( Revision.NULL ) ) , "cannot set old revision on %s view" , type ) ; break ; } this . oldRevision = revision ; return this ; }
Source:
private java.util.Set < java.lang.String > parseHashtags ( org.eclipse.jgit.revwalk.RevCommit commit ) { java.util.List < java.lang.String > hashtagsLines = commit.getFooterLines ( com.google.gerrit.server.notedb.ChangeNoteUtil.FOOTER_HASHTAGS ) ; if ( ( hashtagsLines.isEmpty ( ) ) || ( ( hashtagsLines.size ( ) ) > 1 ) ) { return null ; } if ( hashtagsLines.get ( 0 ) . isEmpty ( ) ) { return com.google.common.collect.ImmutableSet.of ( ) ; } else { return com.google.common.collect.Sets.newHashSet ( com.google.common.base.Splitter.on ( ',' ) . split ( hashtagsLines.get ( 0 ) ) ) ; } }

Target:
private java.util.Set < java.lang.String > parseHashtags ( org.eclipse.jgit.revwalk.RevCommit commit ) { java.util.List < java.lang.String > hashtagsLines = commit.getFooterLines ( com.google.gerrit.server.notedb.ChangeNoteUtil.FOOTER_HASHTAGS ) ; if ( ( hashtagsLines.isEmpty ( ) ) || ( ( hashtagsLines.size ( ) ) > 1 ) ) { return null ; } if ( hashtagsLines.get ( 0 ) . isEmpty ( ) ) { return com.google.common.collect.ImmutableSet.of ( ) ; } return com.google.common.collect.Sets.newHashSet ( com.google.common.base.Splitter.on ( ',' ) . split ( hashtagsLines.get ( 0 ) ) ) ; }
Source:
public GroupDescription.Basic get ( com.google.gerrit.reviewdb.client.AccountGroup.UUID uuid ) { com.google.gerrit.server.account.GroupBackend b = backend ( uuid ) ; if ( b == null ) { com.google.gerrit.server.account.UniversalGroupBackend.log.warn ( ( "Unknown GroupBackend for UUID: " + uuid ) ) ; return null ; } return b.get ( uuid ) ; }

Target:
public GroupDescription.Basic get ( com.google.gerrit.reviewdb.client.AccountGroup.UUID uuid ) { if ( uuid == null ) { return null ; } com.google.gerrit.server.account.GroupBackend b = backend ( uuid ) ; if ( b == null ) { com.google.gerrit.server.account.UniversalGroupBackend.log.warn ( ( "Unknown GroupBackend for UUID: " + uuid ) ) ; return null ; } return b.get ( uuid ) ; }
Source:
private boolean isTrusted ( final com.google.gerrit.client.reviewdb.AccountExternalId id ) { if ( id.getExternalId ( ) . startsWith ( "Google Account " ) ) { return isAllowGoogleAccountUpgrade ( ) ; } if ( id.getExternalId ( ) . startsWith ( "mailto:" ) ) { return true ; } for ( final com.google.gerrit.client.reviewdb.TrustedExternalId t : trusted ) { if ( t.matches ( id ) ) { return true ; } } return false ; }

Target:
private boolean isTrusted ( final com.google.gerrit.client.reviewdb.AccountExternalId id ) { if ( id.getExternalId ( ) . startsWith ( "Google Account " ) ) { return isAllowGoogleAccountUpgrade ( ) ; } if ( id.getExternalId ( ) . startsWith ( "mailto:" ) ) { return true ; } for ( final java.lang.String p : trusted ) { if ( matches ( p , id ) ) { return true ; } } return false ; }
Source:
public boolean evict ( final java.lang.String cacheName , final java.lang.Object key ) { return new com.ericsson.gerrit.plugins.highavailability.forwarder.rest.RestForwarder.Request ( ( ( ( ( "invalidate cache " + cacheName ) + "[" ) + ( keyToString ( key ) ) ) + "]" ) ) { @ java.lang.Override com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpResponseHandler.HttpResult send ( ) throws java.io.IOException { java.lang.String json = com.ericsson.gerrit.plugins.highavailability.forwarder.rest.GsonParser.toJson ( cacheName , key ) ; return httpSession.post ( com.google.common.base.Joiner.on ( "/" ) . join ( pluginRelativePath , "cache" , cacheName ) , json ) ; } } . execute ( ) ; }

Target:
public boolean evict ( final java.lang.String cacheName , final java.lang.Object key ) { return new com.ericsson.gerrit.plugins.highavailability.forwarder.rest.RestForwarder.Request ( ( ( ( ( "invalidate cache " + cacheName ) + "[" ) + key ) + "]" ) ) { @ java.lang.Override com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpResponseHandler.HttpResult send ( ) throws java.io.IOException { java.lang.String json = com.ericsson.gerrit.plugins.highavailability.forwarder.rest.GsonParser.toJson ( cacheName , key ) ; return httpSession.post ( com.google.common.base.Joiner.on ( "/" ) . join ( pluginRelativePath , "cache" , cacheName ) , json ) ; } } . execute ( ) ; }
Source:
protected java.io.OutputStream startRenderStreamingHtml ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse res , java.lang.String templateName , java.util.Map < java.lang.String , ? > soyData ) throws java.io.IOException { req.setAttribute ( com.google.gitiles.BaseServlet.STREAMING_ATTRIBUTE , true ) ; return renderer.renderStreaming ( res , templateName , startHtmlResponse ( req , res , soyData ) ) ; }

Target:
protected java.io.OutputStream startRenderStreamingHtml ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse res , java.lang.String templateName , java.util.Map < java.lang.String , ? > soyData ) throws java.io.IOException { req.setAttribute ( com.google.gitiles.BaseServlet.STREAMING_ATTRIBUTE , true ) ; return renderer.renderStreaming ( res , false , templateName , startHtmlResponse ( req , res , soyData ) ) ; }
Source:
private void onSend ( ) { if ( commentEditors.isEmpty ( ) ) { onSend2 ( ) ; } else { final com.google.gerrit.client.rpc.GerritCallback < com.google.gwtjsonrpc.client.VoidResult > afterSaveDraft = new com.google.gerrit.client.rpc.GerritCallback < com.google.gwtjsonrpc.client.VoidResult > ( ) { private int done ; @ java.lang.Override public void onSuccess ( final com.google.gwtjsonrpc.client.VoidResult result ) { if ( ( ++ ( done ) ) == ( commentEditors.size ( ) ) ) { onSend2 ( ) ; } } } ; for ( final com.google.gerrit.client.patches.CommentEditorPanel p : commentEditors ) { p.saveDraft ( afterSaveDraft ) ; } } }

Target:
private void onSend ( final boolean submit ) { if ( commentEditors.isEmpty ( ) ) { onSend2 ( submit ) ; } else { final com.google.gerrit.client.rpc.GerritCallback < com.google.gwtjsonrpc.client.VoidResult > afterSaveDraft = new com.google.gerrit.client.rpc.GerritCallback < com.google.gwtjsonrpc.client.VoidResult > ( ) { private int done ; @ java.lang.Override public void onSuccess ( final com.google.gwtjsonrpc.client.VoidResult result ) { if ( ( ++ ( done ) ) == ( commentEditors.size ( ) ) ) { onSend2 ( submit ) ; } } } ; for ( final com.google.gerrit.client.patches.CommentEditorPanel p : commentEditors ) { p.saveDraft ( afterSaveDraft ) ; } } }
Source:
protected < K , V > com.google.gerrit.server.cache.NamedCacheBinding < K , V > core ( final com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < K , V > > type , final java.lang.String name ) { return core ( com.google.inject.Key.get ( type , com.google.inject.name.Names.named ( name ) ) ) . name ( name ) ; }

Target:
protected < K , V > com.google.gerrit.server.cache.NamedCacheBinding < K , V > core ( final com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < K , V > > type , final java.lang.String name ) { return core ( com.google.inject.Key.get ( type , com.google.inject.name.Names.named ( name ) ) , type ) . name ( name ) ; }
Source:
private void loadMessages ( final com.google.gerrit.client.reviewdb.ReviewDb db ) throws com.google.gwtorm.client.OrmException { detail.setMessages ( db.changeMessages ( ) . byChange ( changeId ) . toList ( ) ) ; for ( final com.google.gerrit.client.reviewdb.ChangeMessage m : detail.getMessages ( ) ) { acc.want ( m.getAuthor ( ) ) ; } }

Target:
private void loadMessages ( ) throws com.google.gwtorm.client.OrmException { detail.setMessages ( db.changeMessages ( ) . byChange ( changeId ) . toList ( ) ) ; for ( final com.google.gerrit.client.reviewdb.ChangeMessage m : detail.getMessages ( ) ) { acc.want ( m.getAuthor ( ) ) ; } }
Source:
public void currentRevisionAndMessages ( ) throws java.lang.Exception { com.google.gerrit.extensions.common.ChangeInfo c = get ( changeId , com.google.gerrit.extensions.client.ListChangesOption.CURRENT_REVISION , com.google.gerrit.extensions.client.ListChangesOption.MESSAGES ) ; com.google.common.truth.Truth.assertThat ( c.revisions ) . hasSize ( 1 ) ; com.google.common.truth.Truth.assertThat ( c.currentRevision ) . isEqualTo ( commitId ( 2 ) ) ; com.google.common.truth.Truth.assertThat ( ( ( java.lang.Iterable < ? > ) ( c.revisions.keySet ( ) ) ) ) . containsAllIn ( com.google.common.collect.ImmutableSet.of ( commitId ( 2 ) ) ) ; com.google.common.truth.Truth.assertThat ( c.revisions.get ( commitId ( 2 ) ) . _number ) . isEqualTo ( 3 ) ; }

Target:
public void currentRevisionAndMessages ( ) throws java.lang.Exception { com.google.gerrit.extensions.common.ChangeInfo c = get ( changeId , com.google.gerrit.extensions.client.ListChangesOption.CURRENT_REVISION , com.google.gerrit.extensions.client.ListChangesOption.MESSAGES ) ; com.google.common.truth.Truth.assertThat ( c.revisions ) . hasSize ( 1 ) ; com.google.common.truth.Truth.assertThat ( c.currentRevision ) . isEqualTo ( commitId ( 2 ) ) ; com.google.common.truth.Truth.assertThat ( c.revisions.keySet ( ) ) . containsAllIn ( com.google.common.collect.ImmutableSet.of ( commitId ( 2 ) ) ) ; com.google.common.truth.Truth.assertThat ( c.revisions.get ( commitId ( 2 ) ) . _number ) . isEqualTo ( 3 ) ; }
Source:
protected com.google.gerrit.client.ui.Screen createScreen ( ) { switch ( status ) { case ABANDONED : return new com.google.gerrit.client.changes.ByProjectAbandonedChangesScreen ( project , "n,z" ) ; case MERGED : return new com.google.gerrit.client.changes.ByProjectMergedChangesScreen ( project , "n,z" ) ; case NEW : case SUBMITTED : default : return new com.google.gerrit.client.changes.ByProjectOpenChangesScreen ( project , "n,z" ) ; } }

Target:
private com.google.gerrit.client.ui.Screen createScreen ( ) { switch ( status ) { case ABANDONED : return new com.google.gerrit.client.changes.ByProjectAbandonedChangesScreen ( project , "n,z" ) ; case MERGED : return new com.google.gerrit.client.changes.ByProjectMergedChangesScreen ( project , "n,z" ) ; case NEW : case SUBMITTED : default : return new com.google.gerrit.client.changes.ByProjectOpenChangesScreen ( project , "n,z" ) ; } }
Source:
private void initWildCardProject ( final com.google.gerrit.client.reviewdb.ReviewDb c ) throws com.google.gwtorm.client.OrmException { final com.google.gerrit.client.reviewdb.Project proj ; proj = new com.google.gerrit.client.reviewdb.Project ( new com.google.gerrit.client.reviewdb.Project.NameKey ( "-- All Projects --" ) , com.google.gerrit.client.reviewdb.ProjectRight.WILD_PROJECT ) ; proj.setDescription ( "Rights inherited by all other projects" ) ; proj.setOwnerGroupId ( sConfig.adminGroupId ) ; proj.setUseContributorAgreements ( false ) ; c.projects ( ) . insert ( java.util.Collections.singleton ( proj ) ) ; }

Target:
private void initWildCardProject ( final com.google.gerrit.client.reviewdb.ReviewDb c ) throws com.google.gwtorm.client.OrmException { final com.google.gerrit.client.reviewdb.Project proj ; proj = new com.google.gerrit.client.reviewdb.Project ( new com.google.gerrit.client.reviewdb.Project.NameKey ( "-- All Projects --" ) , com.google.gerrit.client.reviewdb.ProjectRight.WILD_PROJECT ) ; proj.setDescription ( "Rights inherited by all other projects" ) ; proj.setUseContributorAgreements ( false ) ; c.projects ( ) . insert ( java.util.Collections.singleton ( proj ) ) ; }
Source:
private void openRepos ( java.util.Collection < com.google.gerrit.reviewdb.client.Project.NameKey > projects ) throws com.google.gerrit.server.git.IntegrationException { for ( com.google.gerrit.reviewdb.client.Project.NameKey project : projects ) { try { orm.openRepo ( project , true ) ; } catch ( com.google.gerrit.server.project.NoSuchProjectException noProject ) { logWarn ( ( ( ( "Project " + ( noProject.project ( ) ) ) + " no longer exists, " ) + "abandoning open changes" ) ) ; abandonAllOpenChangeForDeletedProject ( noProject.project ( ) ) ; } catch ( java.io.IOException e ) { throw new com.google.gerrit.server.git.IntegrationException ( ( "Error opening project " + project ) , e ) ; } } }

Target:
private void openRepos ( java.util.Collection < com.google.gerrit.reviewdb.client.Project.NameKey > projects ) throws com.google.gerrit.server.git.IntegrationException { for ( com.google.gerrit.reviewdb.client.Project.NameKey project : projects ) { try { orm.openRepo ( project ) ; } catch ( com.google.gerrit.server.project.NoSuchProjectException noProject ) { logWarn ( ( ( ( "Project " + ( noProject.project ( ) ) ) + " no longer exists, " ) + "abandoning open changes" ) ) ; abandonAllOpenChangeForDeletedProject ( noProject.project ( ) ) ; } catch ( java.io.IOException e ) { throw new com.google.gerrit.server.git.IntegrationException ( ( "Error opening project " + project ) , e ) ; } } }
Source:
private void parseAll ( ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { walk.markStart ( walk.parseCommit ( tip ) ) ; for ( org.eclipse.jgit.revwalk.RevCommit commit : walk ) { walk.parseBody ( commit ) ; parse ( commit ) ; } pruneReviewers ( ) ; for ( java.util.Collection < com.google.gerrit.reviewdb.client.PatchSetApproval > v : approvals.asMap ( ) . values ( ) ) { java.util.Collections.sort ( ( ( java.util.List < com.google.gerrit.reviewdb.client.PatchSetApproval > ) ( v ) ) , com.google.gerrit.server.notedb.ChangeNotes.PSA_BY_TIME ) ; } }

Target:
private void parseAll ( ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { walk.markStart ( walk.parseCommit ( tip ) ) ; for ( org.eclipse.jgit.revwalk.RevCommit commit : walk ) { parse ( commit ) ; } pruneReviewers ( ) ; for ( java.util.Collection < com.google.gerrit.reviewdb.client.PatchSetApproval > v : approvals.asMap ( ) . values ( ) ) { java.util.Collections.sort ( ( ( java.util.List < com.google.gerrit.reviewdb.client.PatchSetApproval > ) ( v ) ) , com.google.gerrit.server.notedb.ChangeNotes.PSA_BY_TIME ) ; } }
Source:
public static com.google.gerrit.common.data.Capable checkMagicBranchRefs ( org.eclipse.jgit.lib.Repository repo , com.google.gerrit.reviewdb.Project project ) { com.google.gerrit.common.data.Capable result = com.google.gerrit.server.util.MagicBranch.checkMagicBranchRef ( com.google.gerrit.server.util.MagicBranch.NEW_CHANGE , repo , project ) ; if ( result != ( com.google.gerrit.common.data.Capable.OK ) ) { return result ; } result = com.google.gerrit.server.util.MagicBranch.checkMagicBranchRef ( com.google.gerrit.server.util.MagicBranch.NEW_DRAFT_CHANGE , repo , project ) ; if ( result != ( com.google.gerrit.common.data.Capable.OK ) ) { return result ; } result = com.google.gerrit.server.util.MagicBranch.checkMagicBranchRef ( com.google.gerrit.server.util.MagicBranch.NEW_PUBLISH_CHANGE , repo , project ) ; if ( result != ( com.google.gerrit.common.data.Capable.OK ) ) { return result ; } return com.google.gerrit.common.data.Capable.OK ; }

Target:
public static com.google.gerrit.common.data.Capable checkMagicBranchRefs ( org.eclipse.jgit.lib.Repository repo , com.google.gerrit.reviewdb.client.Project project ) { com.google.gerrit.common.data.Capable result = com.google.gerrit.server.util.MagicBranch.checkMagicBranchRef ( com.google.gerrit.server.util.MagicBranch.NEW_CHANGE , repo , project ) ; if ( result != ( com.google.gerrit.common.data.Capable.OK ) ) { return result ; } result = com.google.gerrit.server.util.MagicBranch.checkMagicBranchRef ( com.google.gerrit.server.util.MagicBranch.NEW_DRAFT_CHANGE , repo , project ) ; if ( result != ( com.google.gerrit.common.data.Capable.OK ) ) { return result ; } result = com.google.gerrit.server.util.MagicBranch.checkMagicBranchRef ( com.google.gerrit.server.util.MagicBranch.NEW_PUBLISH_CHANGE , repo , project ) ; if ( result != ( com.google.gerrit.common.data.Capable.OK ) ) { return result ; } return com.google.gerrit.common.data.Capable.OK ; }
Source:
protected void configure ( ) { factory ( EditCommitMessageHandler.Factory.class ) ; factory ( RebaseChangeHandler.Factory.class ) ; factory ( ChangeDetailFactory.Factory.class ) ; factory ( IncludedInDetailFactory.Factory.class ) ; factory ( PatchSetDetailFactory.Factory.class ) ; factory ( PatchSetPublishDetailFactory.Factory.class ) ; factory ( PublishAction.Factory.class ) ; factory ( DeleteDraftChange.Factory.class ) ; }

Target:
protected void configure ( ) { factory ( PatchSetDetailFactory.Factory.class ) ; factory ( PatchSetPublishDetailFactory.Factory.class ) ; }
Source:
void loadChangeInfo ( boolean fg , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.changes.ChangeInfo > cb ) { com.google.gerrit.client.rpc.RestApi call = com.google.gerrit.client.changes.ChangeApi.detail ( changeId.get ( ) ) ; com.google.gerrit.client.changes.ChangeList.addOptions ( call , java.util.EnumSet.of ( ListChangesOption.CURRENT_ACTIONS , ListChangesOption.ALL_REVISIONS , ListChangesOption.WEB_LINKS ) ) ; if ( ! fg ) { call.background ( ) ; } call.get ( cb ) ; }

Target:
void loadChangeInfo ( boolean fg , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.changes.ChangeInfo > cb ) { com.google.gerrit.client.rpc.RestApi call = com.google.gerrit.client.changes.ChangeApi.detail ( changeId.get ( ) ) ; com.google.gerrit.client.changes.ChangeList.addOptions ( call , java.util.EnumSet.of ( ListChangesOption.CURRENT_ACTIONS , ListChangesOption.ALL_REVISIONS ) ) ; if ( ! fg ) { call.background ( ) ; } call.get ( cb ) ; }
Source:
private java.util.List < com.google.gerrit.common.data.SubmitRecord > submitRecords ( com.google.gerrit.server.query.change.ChangeData cd ) throws com.google.gwtorm.server.OrmException { if ( ( cd.getSubmitRecords ( ) ) != null ) { return cd.getSubmitRecords ( ) ; } com.google.gerrit.reviewdb.client.PatchSet ps = cd.currentPatchSet ( ) ; if ( ps == null ) { return com.google.common.collect.ImmutableList.of ( ) ; } cd.setSubmitRecords ( new com.google.gerrit.server.project.SubmitRuleEvaluator ( cd ) . setPatchSet ( ps ) . setFastEvalLabels ( true ) . setAllowDraft ( true ) . evaluate ( ) ) ; return cd.getSubmitRecords ( ) ; }

Target:
private java.util.List < com.google.gerrit.common.data.SubmitRecord > submitRecords ( com.google.gerrit.server.query.change.ChangeData cd ) throws com.google.gwtorm.server.OrmException { if ( ( cd.getSubmitRecords ( ) ) != null ) { return cd.getSubmitRecords ( ) ; } cd.setSubmitRecords ( new com.google.gerrit.server.project.SubmitRuleEvaluator ( cd ) . setFastEvalLabels ( true ) . setAllowDraft ( true ) . evaluate ( ) ) ; return cd.getSubmitRecords ( ) ; }
Source:
private java.util.List < com.google.gerrit.client.ui.InlineHyperlink > getUnifiedDiffLink ( ) { com.google.gerrit.client.ui.InlineHyperlink toUnifiedDiffLink = new com.google.gerrit.client.ui.InlineHyperlink ( ) ; toUnifiedDiffLink.setHTML ( new com.google.gwt.user.client.ui.ImageResourceRenderer ( ) . render ( Gerrit.RESOURCES.unifiedDiff ( ) ) ) ; toUnifiedDiffLink.setTargetHistoryToken ( com.google.gerrit.client.Dispatcher.toUnified ( base , revision , path ) ) ; toUnifiedDiffLink.setTitle ( PatchUtil.C.unifiedDiff ( ) ) ; return java.util.Collections.singletonList ( toUnifiedDiffLink ) ; }

Target:
private java.util.List < com.google.gerrit.client.ui.InlineHyperlink > getUnifiedDiffLink ( ) { com.google.gerrit.client.ui.InlineHyperlink toUnifiedDiffLink = new com.google.gerrit.client.ui.InlineHyperlink ( ) ; toUnifiedDiffLink.setHTML ( new com.google.gwt.user.client.ui.ImageResourceRenderer ( ) . render ( Gerrit.RESOURCES.unifiedDiff ( ) ) ) ; toUnifiedDiffLink.setTargetHistoryToken ( com.google.gerrit.client.Dispatcher.toUnified ( getProject ( ) , base , revision , path ) ) ; toUnifiedDiffLink.setTitle ( PatchUtil.C.unifiedDiff ( ) ) ; return java.util.Collections.singletonList ( toUnifiedDiffLink ) ; }
Source:
protected void onRequestSuggestions ( com.google.gerrit.client.ui.Request req , com.google.gerrit.client.ui.Callback cb ) { if ( ( req.getQuery ( ) . length ( ) ) >= ( com.google.gerrit.client.Gerrit.info ( ) . suggest ( ) . from ( ) ) ) { _onRequestSuggestions ( req , cb ) ; } else { java.util.List < com.google.gerrit.client.ui.Suggestion > none = java.util.Collections.emptyList ( ) ; cb.onSuggestionsReady ( req , new com.google.gerrit.client.ui.Response ( none ) ) ; } }

Target:
protected void onRequestSuggestions ( com.google.gerrit.client.ui.Request req , com.google.gerrit.client.ui.Callback cb ) { if ( ( ( req.getQuery ( ) ) != null ) && ( ( req.getQuery ( ) . length ( ) ) >= ( com.google.gerrit.client.Gerrit.info ( ) . suggest ( ) . from ( ) ) ) ) { _onRequestSuggestions ( req , cb ) ; } else { java.util.List < com.google.gerrit.client.ui.Suggestion > none = java.util.Collections.emptyList ( ) ; cb.onSuggestionsReady ( req , new com.google.gerrit.client.ui.Response ( none ) ) ; } }
Source:
public java.lang.Object apply ( com.google.gerrit.server.change.ChangeResource resource ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.BadRequestException , com.google.gerrit.extensions.restapi.ResourceConflictException , com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.extensions.api.changes.SubmittedTogetherInfo info = apply ( resource , options ) ; if ( options.isEmpty ( ) ) { if ( ( info.nonVisibleChanges ) != 0 ) { throw new com.google.gerrit.extensions.restapi.AuthException ( "change would be submitted with a change that you cannot see" ) ; } return info.changes ; } return info ; }

Target:
public java.lang.Object apply ( com.google.gerrit.server.change.ChangeResource resource ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.BadRequestException , com.google.gerrit.extensions.restapi.ResourceConflictException , com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.extensions.api.changes.SubmittedTogetherInfo info = apply ( resource , options ) ; if ( options.isEmpty ( ) ) { return info.changes ; } return info ; }
Source:
public com.googlecode.prolog_cafe.builtin.Operation exec ( com.googlecode.prolog_cafe.builtin.Prolog engine ) { engine.setB0 ( ) ; com.googlecode.prolog_cafe.builtin.Term a1 ; com.googlecode.prolog_cafe.builtin.Predicate code ; a1 = arg1.dereference ( ) ; if ( ! ( a1.isClosure ( ) ) ) return engine.fail ( ) ; code = ( ( com.googlecode.prolog_cafe.builtin.ClosureTerm ) ( a1 ) ) . getCode ( ) ; code.cont = this . cont ; return code ; }

Target:
public com.googlecode.prolog_cafe.builtin.Operation exec ( com.googlecode.prolog_cafe.builtin.Prolog engine ) { engine.setB0 ( ) ; com.googlecode.prolog_cafe.builtin.Term a1 ; com.googlecode.prolog_cafe.builtin.Predicate code ; a1 = arg1.dereference ( ) ; if ( ! ( a1 instanceof com.googlecode.prolog_cafe.builtin.ClosureTerm ) ) return engine.fail ( ) ; code = ( ( com.googlecode.prolog_cafe.builtin.ClosureTerm ) ( a1 ) ) . getCode ( ) ; code.cont = this . cont ; return code ; }