auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private int limit ( com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > s ) { int n = ( com.google.gerrit.server.query.change.ChangeQueryBuilder.hasLimit ( s ) ) ? com.google.gerrit.server.query.change.ChangeQueryBuilder.getLimit ( s ) : maxLimit ; return ( limit ) > 0 ? ( java.lang.Math.min ( n , limit ) ) + 1 : n + 1 ; }

Target:
private int limit ( com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > s ) { int n = com.google.common.base.Objects.firstNonNull ( com.google.gerrit.server.query.change.ChangeQueryBuilder.getLimit ( s ) , maxLimit ) ; return ( limit ) > 0 ? ( java.lang.Math.min ( n , limit ) ) + 1 : n + 1 ; }
Source:
private boolean canEditDescription ( ) { if ( getChange ( ) . getStatus ( ) . isOpen ( ) ) { return ( ( ( isOwner ( ) ) || ( getRefControl ( ) . isOwner ( ) ) ) || ( getProjectControl ( ) . isOwner ( ) ) ) || ( getUser ( ) . getCapabilities ( ) . isAdmin_DoNotUse ( ) ) ; } return false ; }

Target:
private boolean canEditDescription ( ) { if ( getChange ( ) . getStatus ( ) . isOpen ( ) ) { return ( ( ( isOwner ( ) ) || ( getRefControl ( ) . isOwner ( ) ) ) || ( getProjectControl ( ) . isOwner ( ) ) ) || ( getProjectControl ( ) . isAdmin ( ) ) ; } return false ; }
Source:
public java.util.List < com.google.gerrit.server.query.change.QueryResult > queryChanges ( java.util.List < com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > > queries ) throws com.google.gerrit.server.query.QueryParseException , com.google.gwtorm.server.OrmException { return queryChanges ( null , queries ) ; }

Target:
public java.util.List < com.google.gerrit.server.query.change.QueryResult > queryChanges ( java.util.List < com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > > queries ) throws com.google.gerrit.server.query.QueryParseException , com.google.gwtorm.server.OrmException { try { return queryChanges ( null , queries ) ; } catch ( com.google.gwtorm.server.OrmException e ) { com.google.common.base.Throwables.propagateIfInstanceOf ( e.getCause ( ) , com.google.gerrit.server.query.QueryParseException.class ) ; throw e ; } }
Source:
public void customConflictMessageWitTopicTest ( ) throws java.lang.Exception { com.googlesource.gerrit.plugins.automerger.FailedMergeException fme = new com.googlesource.gerrit.plugins.automerger.FailedMergeException ( failedMergeBranches , currentRevision , hostName , "i am ${topic}" , topic ) ; java.lang.String conflictMessage = "i am testtopic" ; com.google.common.truth.Truth.assertThat ( fme.getDisplayString ( ) . split ( "\\n" ) ) . asList ( ) . containsExactly ( "i am testtopic" , "i am testtopic" , "i am testtopic" ) ; }

Target:
public void customConflictMessageWithHostNameTest ( ) throws java.lang.Exception { com.googlesource.gerrit.plugins.automerger.FailedMergeException fme = new com.googlesource.gerrit.plugins.automerger.FailedMergeException ( failedMergeBranches , currentRevision , hostName , projectName , changeNumber , patchsetNumber , "${hostname}: ${conflict}" , topic ) ; java.lang.String branch1String = ( hostName ) + ": branch1 merge conflict" ; java.lang.String branch2String = ( hostName ) + ": branch2 merge conflict" ; java.lang.String branch3String = ( hostName ) + ": branch3 merge conflict" ; com.google.common.truth.Truth.assertThat ( fme.getDisplayString ( ) . split ( "\\n" ) ) . asList ( ) . containsExactly ( branch1String , branch2String , branch3String ) ; }
Source:
public void parseSubject ( ) throws java.lang.Exception { assertParseSucceeds ( ( "Update change\n" + ( ( ( ( "\n" + "Patch-Set: 1\n" ) + "Branch: refs/heads/master\n" ) + "Change-id: I577fb248e474018276351785930358ec0450e9f7\n" ) + "Subject: Some subject of a change\n" ) ) ) ; assertParseFails ( ( "Update change\n" + ( ( ( "\n" + "Patch-Set: 1\n" ) + "Subject: Some subject of a change\n" ) + "Subject: Some other subject\n" ) ) ) ; }

Target:
public void parseSubject ( ) throws java.lang.Exception { assertParseSucceeds ( ( "Update change\n" + ( ( ( ( "\n" + "Patch-set: 1\n" ) + "Branch: refs/heads/master\n" ) + "Change-id: I577fb248e474018276351785930358ec0450e9f7\n" ) + "Subject: Some subject of a change\n" ) ) ) ; assertParseFails ( ( "Update change\n" + ( ( ( "\n" + "Patch-set: 1\n" ) + "Subject: Some subject of a change\n" ) + "Subject: Some other subject\n" ) ) ) ; }
Source:
private void deleteProject ( org.eclipse.jgit.transport.URIish replicateURI ) { if ( ! ( replicateURI.isRemote ( ) ) ) { com.googlesource.gerrit.plugins.replication.ReplicationQueue.deleteLocally ( replicateURI ) ; com.googlesource.gerrit.plugins.replication.ReplicationQueue.repLog.info ( "Deleted local repository: {}" , replicateURI ) ; } else if ( com.googlesource.gerrit.plugins.replication.ReplicationQueue.isSSH ( replicateURI ) ) { deleteRemoteSsh ( replicateURI ) ; com.googlesource.gerrit.plugins.replication.ReplicationQueue.repLog.info ( "Deleted remote repository: {}" , replicateURI ) ; } else { com.googlesource.gerrit.plugins.replication.ReplicationQueue.repLog.warn ( ( "Cannot delete project on remote site {}. " + ( "Only local paths and SSH URLs are supported" + " for remote repository deletion" ) ) , replicateURI ) ; } }

Target:
private void deleteRemoteSsh ( org.eclipse.jgit.transport.URIish uri ) { java.lang.String quotedPath = QuotedString.BOURNE.quote ( uri.getPath ( ) ) ; java.lang.String cmd = "rm -rf " + quotedPath ; java.io.OutputStream errStream = com.googlesource.gerrit.plugins.replication.ReplicationQueue.newErrorBufferStream ( ) ; try { executeRemoteSsh ( uri , cmd , errStream ) ; com.googlesource.gerrit.plugins.replication.ReplicationQueue.repLog.info ( "Deleted remote repository: {}" , uri ) ; } catch ( java.io.IOException e ) { com.googlesource.gerrit.plugins.replication.ReplicationQueue.repLog.error ( ( "Error deleting remote repository at {}:\n" + ( ( " Exception: {}\n" + " Command: {}\n" ) + " Output: {}" ) ) , uri , e , cmd , errStream , e ) ; } }
Source:
public com.google.gerrit.acceptance.RestResponse get ( java.lang.String endPoint ) throws java.io.IOException { org.apache.http.client.methods.HttpGet get = new org.apache.http.client.methods.HttpGet ( ( ( ( url ) + "/a" ) + endPoint ) ) ; return new com.google.gerrit.acceptance.RestResponse ( getClient ( ) . execute ( get ) ) ; }

Target:
private com.google.gerrit.acceptance.RestResponse getWithHeader ( java.lang.String endPoint , org.apache.http.Header header ) throws java.io.IOException { org.apache.http.client.methods.HttpGet get = new org.apache.http.client.methods.HttpGet ( ( ( ( url ) + "/a" ) + endPoint ) ) ; if ( header != null ) { get.addHeader ( header ) ; } return new com.google.gerrit.acceptance.RestResponse ( getClient ( ) . execute ( get ) ) ; }
Source:
public java.util.Collection < com.google.gerrit.reviewdb.AccountGroup > createEntry ( final com.google.gerrit.reviewdb.AccountGroup.ExternalNameKey key ) throws java.lang.Exception { final com.google.gerrit.reviewdb.ReviewDb db = schema.open ( ) ; try { return db.accountGroups ( ) . byExternalName ( key ) . toList ( ) ; } finally { db.close ( ) ; } }

Target:
public com.google.gerrit.server.account.AccountGroupCollection createEntry ( final com.google.gerrit.reviewdb.AccountGroup.ExternalNameKey key ) throws java.lang.Exception { final com.google.gerrit.reviewdb.ReviewDb db = schema.open ( ) ; try { return new com.google.gerrit.server.account.AccountGroupCollection ( db.accountGroups ( ) . byExternalName ( key ) . toList ( ) ) ; } finally { db.close ( ) ; } }
Source:
private java.util.Set < com.google.gerrit.reviewdb.AccountGroup.UUID > getEffectiveUserGroups ( ) { final java.util.Set < com.google.gerrit.reviewdb.AccountGroup.UUID > userGroups = user.getEffectiveGroups ( ) ; if ( isOwner ( ) ) { final java.util.Set < com.google.gerrit.reviewdb.AccountGroup.UUID > userGroupsOnProject = new java.util.HashSet < com.google.gerrit.reviewdb.AccountGroup.UUID > ( ( ( userGroups.size ( ) ) + 1 ) ) ; userGroupsOnProject.addAll ( userGroups ) ; userGroupsOnProject.add ( AccountGroup.PROJECT_OWNERS ) ; return java.util.Collections.unmodifiableSet ( userGroupsOnProject ) ; } else { return userGroups ; } }

Target:
private boolean isDeclaredOwner ( ) { if ( ( declaredOwner ) == null ) { declaredOwner = state.isOwner ( user.getEffectiveGroups ( ) ) ; } return declaredOwner ; }
Source:
private java.lang.Iterable < java.lang.String > getDraftRefs ( final com.google.gerrit.reviewdb.client.Change.Id changeId ) throws com.google.gwtorm.server.OrmException { java.util.Set < java.lang.String > refNames = getRefNamesAllUsers ( RefNames.REFS_DRAFT_COMMENTS ) ; final java.lang.String suffix = "/" + ( changeId.get ( ) ) ; return com.google.common.collect.Iterables.filter ( refNames , new com.google.common.base.Predicate < java.lang.String > ( ) { @ java.lang.Override public boolean apply ( java.lang.String input ) { return input.endsWith ( suffix ) ; } } ) ; }

Target:
private java.util.Map < java.lang.String , org.eclipse.jgit.lib.Ref > getDraftRefs ( org.eclipse.jgit.lib.Repository repo , final com.google.gerrit.reviewdb.client.Change.Id changeId ) throws java.io.IOException { final java.lang.String suffix = "/" + ( changeId.get ( ) ) ; return com.google.common.collect.Maps.filterKeys ( repo.getRefDatabase ( ) . getRefs ( RefNames.REFS_DRAFT_COMMENTS ) , new com.google.common.base.Predicate < java.lang.String > ( ) { @ java.lang.Override public boolean apply ( java.lang.String input ) { return input.endsWith ( suffix ) ; } } ) ; }
Source:
protected void configure ( ) { factory ( AgreementInfoFactory.Factory.class ) ; factory ( CreateGroup.Factory.class ) ; factory ( DeleteExternalIds.Factory.class ) ; factory ( ExternalIdDetailFactory.Factory.class ) ; factory ( GroupDetailHandler.Factory.class ) ; factory ( MyGroupsFactory.Factory.class ) ; factory ( RenameGroup.Factory.class ) ; factory ( VisibleGroups.Factory.class ) ; }

Target:
protected void configure ( ) { factory ( AgreementInfoFactory.Factory.class ) ; factory ( CreateGroup.Factory.class ) ; factory ( DeleteExternalIds.Factory.class ) ; factory ( ExternalIdDetailFactory.Factory.class ) ; factory ( GroupDetailHandler.Factory.class ) ; factory ( MyGroupsFactory.Factory.class ) ; factory ( RenameGroup.Factory.class ) ; factory ( VisibleGroupsHandler.Factory.class ) ; }
Source:
public com.google.gerrit.server.index.IndexConfig build ( ) { com.google.gerrit.server.index.IndexConfig cfg = autoBuild ( ) ; com.google.gerrit.server.index.IndexConfig.checkLimit ( cfg.maxLimit ( ) , "maxLimit" ) ; com.google.gerrit.server.index.IndexConfig.checkLimit ( cfg.maxPages ( ) , "maxPages" ) ; com.google.gerrit.server.index.IndexConfig.checkLimit ( cfg.maxTerms ( ) , "maxTerms" ) ; return cfg ; }

Target:
public com.google.gerrit.index.IndexConfig build ( ) { com.google.gerrit.index.IndexConfig cfg = autoBuild ( ) ; com.google.gerrit.index.IndexConfig.checkLimit ( cfg.maxLimit ( ) , "maxLimit" ) ; com.google.gerrit.index.IndexConfig.checkLimit ( cfg.maxPages ( ) , "maxPages" ) ; com.google.gerrit.index.IndexConfig.checkLimit ( cfg.maxTerms ( ) , "maxTerms" ) ; return cfg ; }
Source:
public static void assertBranchInfo ( com.google.gerrit.server.project.ListBranches.BranchInfo expected , com.google.gerrit.server.project.ListBranches.BranchInfo actual ) { com.google.common.truth.Truth.assertThat ( actual.ref ) . isEqualTo ( expected.ref ) ; if ( ( expected.revision ) != null ) { com.google.common.truth.Truth.assertThat ( actual.revision ) . isEqualTo ( expected.revision ) ; } com.google.common.truth.Truth.assertThat ( com.google.gerrit.acceptance.rest.project.BranchAssert.toBoolean ( actual.canDelete ) ) . isEqualTo ( expected.canDelete ) ; }

Target:
public static void assertBranchInfo ( com.google.gerrit.extensions.api.projects.BranchInfo expected , com.google.gerrit.extensions.api.projects.BranchInfo actual ) { com.google.common.truth.Truth.assertThat ( actual.ref ) . isEqualTo ( expected.ref ) ; if ( ( expected.revision ) != null ) { com.google.common.truth.Truth.assertThat ( actual.revision ) . named ( ( "revision of " + ( actual.ref ) ) ) . isEqualTo ( expected.revision ) ; } com.google.common.truth.Truth.assertThat ( com.google.gerrit.acceptance.rest.project.BranchAssert.toBoolean ( actual.canDelete ) ) . named ( ( "can delete " + ( actual.ref ) ) ) . isEqualTo ( com.google.gerrit.acceptance.rest.project.BranchAssert.toBoolean ( expected.canDelete ) ) ; }
Source:
private void mergeImpl ( ) throws com.google.gerrit.server.git.MergeException { openRepository ( ) ; openBranch ( ) ; listPendingSubmits ( ) ; validateChangeList ( ) ; mergeTip = branchTip ; switch ( destProject.getSubmitType ( ) ) { case CHERRY_PICK : cherryPickChanges ( ) ; break ; case FAST_FORWARD_ONLY : case MERGE_ALWAYS : case MERGE_IF_NECESSARY : default : reduceToMinimalMerge ( ) ; mergeTopics ( ) ; markCleanMerges ( ) ; break ; } updateBranch ( ) ; updateChangeStatus ( ) ; }

Target:
private void preMerge ( ) throws com.google.gerrit.server.git.MergeException , com.google.gwtorm.client.OrmException { openBranch ( ) ; validateChangeList ( ) ; mergeTip = branchTip ; switch ( destProject.getSubmitType ( ) ) { case CHERRY_PICK : cherryPickChanges ( ) ; break ; case FAST_FORWARD_ONLY : case MERGE_ALWAYS : case MERGE_IF_NECESSARY : default : reduceToMinimalMerge ( ) ; mergeTopics ( ) ; markCleanMerges ( ) ; break ; } }
Source:
public void index ( com.google.gerrit.reviewdb.client.Project.NameKey nameKey ) throws java.io.IOException { com.google.gerrit.server.project.ProjectState projectState = projectCache.get ( nameKey ) ; if ( projectState != null ) { com.google.gerrit.server.project.ProjectData projectData = projectState.toProjectData ( ) ; for ( com.google.gerrit.server.index.project.ProjectIndex i : getWriteIndexes ( ) ) { i.replace ( projectData ) ; } fireProjectIndexedEvent ( nameKey.get ( ) ) ; } else { for ( com.google.gerrit.server.index.project.ProjectIndex i : getWriteIndexes ( ) ) { i.delete ( nameKey ) ; } } }

Target:
public void index ( com.google.gerrit.reviewdb.client.Project.NameKey nameKey ) throws java.io.IOException { com.google.gerrit.server.project.ProjectState projectState = projectCache.get ( nameKey ) ; if ( projectState != null ) { com.google.gerrit.index.project.ProjectData projectData = projectState.toProjectData ( ) ; for ( com.google.gerrit.index.project.ProjectIndex i : getWriteIndexes ( ) ) { i.replace ( projectData ) ; } fireProjectIndexedEvent ( nameKey.get ( ) ) ; } else { for ( com.google.gerrit.index.project.ProjectIndex i : getWriteIndexes ( ) ) { i.delete ( nameKey ) ; } } }
Source:
private com.google.gerrit.server.permissions.ProjectControl user ( com.google.gerrit.server.git.ProjectConfig local , java.lang.String name , com.google.gerrit.reviewdb.client.AccountGroup ... memberOf ) { return new com.google.gerrit.server.permissions.ProjectControl ( java.util.Collections.< com.google.gerrit.reviewdb.client.AccountGroup.UUID > emptySet ( ) , java.util.Collections.< com.google.gerrit.reviewdb.client.AccountGroup.UUID > emptySet ( ) , sectionSorter , changeControlFactory , permissionBackend , new com.google.gerrit.server.permissions.RefControlTest.MockUser ( name , memberOf ) , newProjectState ( local ) ) ; }

Target:
private com.google.gerrit.server.permissions.ProjectControl user ( com.google.gerrit.server.git.ProjectConfig local , java.lang.String name , com.google.gerrit.reviewdb.client.AccountGroup ... memberOf ) { return new com.google.gerrit.server.permissions.ProjectControl ( java.util.Collections.< com.google.gerrit.reviewdb.client.AccountGroup.UUID > emptySet ( ) , java.util.Collections.< com.google.gerrit.reviewdb.client.AccountGroup.UUID > emptySet ( ) , sectionSorter , changeControlFactory , permissionBackend , refFilterFactory , new com.google.gerrit.server.permissions.RefControlTest.MockUser ( name , memberOf ) , newProjectState ( local ) ) ; }
Source:
public boolean canUpload ( ) { return canPerform ( com.google.gerrit.reviewdb.ApprovalCategory.READ , ( ( short ) ( 2 ) ) ) ; }

Target:
public boolean isOwner ( ) { if ( ( owner ) == null ) { if ( canPerform ( Permission.OWNER ) ) { owner = true ; } else if ( getRefName ( ) . equals ( AccessSection.ALL.substring ( 0 , ( ( AccessSection.ALL.length ( ) ) - 1 ) ) ) ) { owner = getCurrentUser ( ) . isAdministrator ( ) ; } else { owner = getProjectControl ( ) . isOwner ( ) ; } } return owner ; }
Source:
public void onSuccess ( final com.google.gerrit.client.VoidResult result ) { for ( int row = 1 ; row < ( table.getRowCount ( ) ) ; ) { final com.google.gerrit.client.groups.GroupInfo i = getRowItem ( row ) ; if ( ( i != null ) && ( ids.contains ( i.getGroupUUID ( ) ) ) ) { table.removeRow ( row ) ; } else { row ++ ; } } }

Target:
public void onSuccess ( final com.google.gerrit.client.VoidResult result ) { for ( int row = 1 ; row < ( table.getRowCount ( ) ) ; ) { final com.google.gerrit.client.info.GroupInfo i = getRowItem ( row ) ; if ( ( i != null ) && ( ids.contains ( i.getGroupUUID ( ) ) ) ) { table.removeRow ( row ) ; } else { row ++ ; } } }
Source:
public void isoWithOtherTimeZone ( ) 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.of ( java.util.TimeZone.getTimeZone ( "GMT-0400" ) ) , Format.ISO ) ; com.google.common.truth.Truth.assertThat ( df.format ( ident ) ) . isEqualTo ( "2006-01-02 18:04:05" ) ; }

Target:
public void isoWithOtherTimeZone ( ) 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 ( java.util.Optional.of ( java.util.TimeZone.getTimeZone ( "GMT-0400" ) ) , Format.ISO ) ; com.google.common.truth.Truth.assertThat ( df.format ( ident ) ) . isEqualTo ( "2006-01-02 18:04:05" ) ; }
Source:
public boolean match ( final T object ) throws com.google.gwtorm.server.OrmException { for ( final com.google.gerrit.server.query.Predicate < T > c : children ) { if ( c.match ( object ) ) { return true ; } } return false ; }

Target:
public boolean match ( final T object ) throws com.google.gwtorm.server.OrmException { for ( final com.google.gerrit.server.query.Predicate < T > c : children ) { com.google.common.base.Preconditions.checkState ( c.isMatchable ( ) , ( "match invoked, but child predicate %s " + "doesn't implement %s" ) , c , com.google.gerrit.server.query.Matchable.class . getName ( ) ) ; if ( c.asMatchable ( ) . match ( object ) ) { return true ; } } return false ; }
Source:
public void testPostResponseOK ( ) throws java.lang.Exception { com.ericsson.gerrit.plugins.syncindex.HttpSessionTest.wireMockRule.givenThat ( com.github.tomakehurst.wiremock.client.WireMock.post ( com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo ( com.ericsson.gerrit.plugins.syncindex.HttpSessionTest.ENDPOINT ) ) . willReturn ( com.github.tomakehurst.wiremock.client.WireMock.aResponse ( ) . withStatus ( com.ericsson.gerrit.plugins.syncindex.HttpSessionTest.OK ) ) ) ; com.google.common.truth.Truth.assertThat ( httpSession.post ( com.ericsson.gerrit.plugins.syncindex.HttpSessionTest.ENDPOINT ) . isSuccessful ( ) ) . isTrue ( ) ; }

Target:
public void testPostResponseOK ( ) throws java.lang.Exception { com.ericsson.gerrit.plugins.highavailability.HttpSessionTest.wireMockRule.givenThat ( com.github.tomakehurst.wiremock.client.WireMock.post ( com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo ( com.ericsson.gerrit.plugins.highavailability.HttpSessionTest.ENDPOINT ) ) . willReturn ( com.github.tomakehurst.wiremock.client.WireMock.aResponse ( ) . withStatus ( com.ericsson.gerrit.plugins.highavailability.HttpSessionTest.OK ) ) ) ; com.google.common.truth.Truth.assertThat ( httpSession.post ( com.ericsson.gerrit.plugins.highavailability.HttpSessionTest.ENDPOINT ) . isSuccessful ( ) ) . isTrue ( ) ; }
Source:
public com.google.gerrit.reviewdb.client.PatchSetInfo createValue ( com.googlecode.prolog_cafe.lang.Prolog engine ) { com.google.gerrit.reviewdb.client.Change change = com.google.gerrit.rules.StoredValues.CHANGE_DATA.get ( engine ) . getChange ( ) ; com.google.gerrit.reviewdb.client.PatchSet ps = com.google.gerrit.rules.StoredValues.PATCH_SET.get ( engine ) ; com.google.gerrit.rules.PrologEnvironment env = ( ( com.google.gerrit.rules.PrologEnvironment ) ( engine.control ) ) ; com.google.gerrit.server.patch.PatchSetInfoFactory patchInfoFactory = env.getArgs ( ) . getPatchSetInfoFactory ( ) ; try { return patchInfoFactory.get ( change , ps ) ; } catch ( com.google.gerrit.server.patch.PatchSetInfoNotAvailableException e ) { throw new com.googlecode.prolog_cafe.lang.SystemException ( e.getMessage ( ) ) ; } }

Target:
public static com.google.gerrit.reviewdb.client.Change getChange ( com.googlecode.prolog_cafe.lang.Prolog engine ) throws com.googlecode.prolog_cafe.lang.SystemException { com.google.gerrit.server.query.change.ChangeData cd = com.google.gerrit.rules.StoredValues.CHANGE_DATA.get ( engine ) ; try { return cd.change ( ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new com.googlecode.prolog_cafe.lang.SystemException ( ( "Cannot load change " + ( cd.getId ( ) ) ) ) ; } }
Source:
public < T > com.google.gerrit.client.rpc.HttpCallback < T > add ( com.google.gerrit.client.rpc.HttpCallback < T > cb ) { checkFinalAdded ( ) ; if ( failed ) { cb.onFailure ( failedThrowable ) ; return new com.google.gerrit.client.rpc.HttpCallback < T > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.rpc.HttpResponse < T > result ) { } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { } } ; } com.google.gerrit.client.rpc.CallbackGroup.HttpCallbackImpl < T > w = new com.google.gerrit.client.rpc.CallbackGroup.HttpCallbackImpl ( cb ) ; callbacks.add ( w ) ; remaining.add ( w ) ; return w ; }

Target:
public < T > com.google.gerrit.client.rpc.HttpCallback < T > add ( com.google.gerrit.client.rpc.HttpCallback < T > cb ) { checkFinalAdded ( ) ; return handleAdd ( cb ) ; }
Source:
protected void onInitUI ( ) { super . onInitUI ( ) ; setTitleText ( Util.C.projectListTitle ( ) ) ; projects = new com.google.gerrit.client.admin.ProjectListScreen.ProjectTable ( ) ; projects.setSavePointerId ( Link.ADMIN_PROJECTS ) ; add ( projects ) ; final com.google.gwt.user.client.ui.VerticalPanel fp = new com.google.gwt.user.client.ui.VerticalPanel ( ) ; fp.setStyleName ( "gerrit-AddSshKeyPanel" ) ; fp.add ( new com.google.gerrit.client.ui.SmallHeading ( Util.C.headingCreateGroup ( ) ) ) ; }

Target:
protected void onInitUI ( ) { super . onInitUI ( ) ; setPageTitle ( Util.C.projectListTitle ( ) ) ; projects = new com.google.gerrit.client.admin.ProjectListScreen.ProjectTable ( ) ; projects.setSavePointerId ( Link.ADMIN_PROJECTS ) ; add ( projects ) ; final com.google.gwt.user.client.ui.VerticalPanel fp = new com.google.gwt.user.client.ui.VerticalPanel ( ) ; fp.setStyleName ( "gerrit-AddSshKeyPanel" ) ; fp.add ( new com.google.gerrit.client.ui.SmallHeading ( Util.C.headingCreateGroup ( ) ) ) ; }
Source:
private < T extends com.google.gwt.core.client.JavaScriptObject > void sendRaw ( com.google.gwt.http.client.RequestBuilder.Method method , java.lang.String body , com.google.gwt.user.client.rpc.AsyncCallback < T > cb ) { com.google.gerrit.client.rpc.RestApi.HttpCallback < T > httpCallback = new com.google.gerrit.client.rpc.RestApi.HttpCallback ( background , cb ) ; try { if ( ! ( background ) ) { RpcStatus.INSTANCE.onRpcStart ( ) ; } com.google.gwt.http.client.RequestBuilder req = request ( method ) ; req.setHeader ( "Content-Type" , com.google.gerrit.client.rpc.RestApi.TEXT_TYPE ) ; req.sendRequest ( body , httpCallback ) ; } catch ( com.google.gwt.http.client.RequestException e ) { httpCallback.onError ( null , e ) ; } }

Target:
private < T extends com.google.gwt.core.client.JavaScriptObject > void sendRaw ( com.google.gwt.http.client.RequestBuilder.Method method , java.lang.String body , com.google.gerrit.client.rpc.HttpCallback < T > cb ) { com.google.gerrit.client.rpc.RestApi.HttpImpl < T > httpCallback = new com.google.gerrit.client.rpc.RestApi.HttpImpl ( background , cb ) ; try { if ( ! ( background ) ) { RpcStatus.INSTANCE.onRpcStart ( ) ; } com.google.gwt.http.client.RequestBuilder req = request ( method ) ; req.setHeader ( "Content-Type" , com.google.gerrit.client.rpc.RestApi.TEXT_TYPE ) ; req.sendRequest ( body , httpCallback ) ; } catch ( com.google.gwt.http.client.RequestException e ) { httpCallback.onError ( null , e ) ; } }
Source:
public < P extends com.google.gerrit.server.query.Predicate < T > > P find ( com.google.gerrit.server.query.Predicate < T > p , java.lang.Class < P > clazz ) { if ( clazz.isAssignableFrom ( p.getClass ( ) ) ) { return ( ( P ) ( p ) ) ; } for ( com.google.gerrit.server.query.Predicate < T > c : p.getChildren ( ) ) { P r = find ( c , clazz ) ; if ( r != null ) { return r ; } } return null ; }

Target:
public static < T , P extends com.google.gerrit.server.query.Predicate < T > > P find ( com.google.gerrit.server.query.Predicate < T > p , java.lang.Class < P > clazz ) { if ( clazz.isAssignableFrom ( p.getClass ( ) ) ) { return ( ( P ) ( p ) ) ; } for ( com.google.gerrit.server.query.Predicate < T > c : p.getChildren ( ) ) { P r = com.google.gerrit.server.query.QueryBuilder.find ( c , clazz ) ; if ( r != null ) { return r ; } } return null ; }
Source:
public void setExisting_Conflict ( ) throws java.lang.Exception { com.google.gerrit.server.account.PutUsername.Input in = new com.google.gerrit.server.account.PutUsername.Input ( ) ; in.username = admin.username ; adminRestSession.put ( ( ( "/accounts/" + ( accounts.create ( ) . id.get ( ) ) ) + "/username" ) , in ) . assertConflict ( ) ; }

Target:
public void setExisting_Conflict ( ) throws java.lang.Exception { com.google.gerrit.server.account.PutUsername.Input in = new com.google.gerrit.server.account.PutUsername.Input ( ) ; in.username = admin.username ; adminRestSession.put ( ( ( "/accounts/" + ( accountCreator.create ( ) . id.get ( ) ) ) + "/username" ) , in ) . assertConflict ( ) ; }
Source:
protected void onOpenRow ( final int row ) { com.google.gwt.user.client.History.newItem ( link ( getRowItem ( row ) ) ) ; }

Target:
protected void populate ( final int row , final com.google.gerrit.client.projects.ProjectInfo k ) { table.setWidget ( row , 1 , new com.google.gerrit.client.ui.Hyperlink ( k.name ( ) , link ( k ) ) ) ; table.setText ( row , 2 , k.description ( ) ) ; setRowItem ( row , k ) ; }
Source:
public void testQueryParamsNotCopied ( ) throws java.lang.Exception { com.google.gitiles.GitilesView view = com.google.gitiles.GitilesView.hostIndex ( ) . copyFrom ( com.google.gitiles.GitilesViewTest.HOST ) . putParam ( "foo" , "foovalue" ) . putParam ( "bar" , "barvalue" ) . build ( ) ; com.google.gitiles.GitilesView copy = com.google.gitiles.GitilesView.hostIndex ( ) . copyFrom ( view ) . build ( ) ; assertFalse ( view.getParameters ( ) . isEmpty ( ) ) ; assertTrue ( copy.getParameters ( ) . isEmpty ( ) ) ; }

Target:
public void queryParamsNotCopied ( ) throws java.lang.Exception { com.google.gitiles.GitilesView view = com.google.gitiles.GitilesView.hostIndex ( ) . copyFrom ( com.google.gitiles.GitilesViewTest.HOST ) . putParam ( "foo" , "foovalue" ) . putParam ( "bar" , "barvalue" ) . build ( ) ; com.google.gitiles.GitilesView copy = com.google.gitiles.GitilesView.hostIndex ( ) . copyFrom ( view ) . build ( ) ; org.junit.Assert.assertFalse ( view.getParameters ( ) . isEmpty ( ) ) ; org.junit.Assert.assertTrue ( copy.getParameters ( ) . isEmpty ( ) ) ; }
Source:
private < T > T execute ( com.google.gerrit.server.update.RetryHelper.ChangeAction < T > changeAction , com.github.rholder.retry.Retryer < T > retryer ) throws java.lang.Throwable { try { return retryer.call ( ( ) -> changeAction.call ( updateFactory ) ) ; } catch ( java.util.concurrent.ExecutionException | com.github.rholder.retry.RetryException e ) { if ( e instanceof com.github.rholder.retry.RetryException ) { metrics.timeoutCount.increment ( ) ; } if ( ( e.getCause ( ) ) != null ) { throw e.getCause ( ) ; } throw e ; } }

Target:
private < T > T execute ( com.google.gerrit.server.update.RetryHelper.ActionType actionType , com.google.gerrit.server.update.RetryHelper.Action < T > action , com.github.rholder.retry.Retryer < T > retryer ) throws java.lang.Throwable { try { return retryer.call ( ( ) -> action.call ( ) ) ; } catch ( java.util.concurrent.ExecutionException | com.github.rholder.retry.RetryException e ) { if ( e instanceof com.github.rholder.retry.RetryException ) { metrics.timeoutCount.increment ( actionType ) ; } if ( ( e.getCause ( ) ) != null ) { throw e.getCause ( ) ; } throw e ; } }
Source:
boolean isReviewed ( ) { return reviewed.getValue ( ) ; }

Target:
private void postAutoReviewed ( ) { reviewed ( ) . background ( ) . put ( new com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.changes.ReviewInfo > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.changes.ReviewInfo result ) { reviewed.setValue ( true , false ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { } } ) ; }
Source:
public void testGetPeopleAccess ( ) throws java.lang.Exception { final com.google.gwtorm.data.PhoneBookDb schema = open ( ) ; assertNotNull ( schema.people ( ) ) ; assertEquals ( "people" , schema.people ( ) . getRelationName ( ) ) ; }

Target:
public void testGetPeopleAccess ( ) throws java.lang.Exception { final com.google.gwtorm.data.PhoneBookDb schema = open ( ) ; assertNotNull ( schema.people ( ) ) ; assertEquals ( "people" , schema.people ( ) . getRelationName ( ) ) ; assertEquals ( 1 , schema.people ( ) . getRelationID ( ) ) ; }
Source:
private static com.google.gitiles.CommitJsonData.Ident toJsonData ( org.eclipse.jgit.lib.PersonIdent ident , com.google.gitiles.DateFormatterBuilder.DateFormatter df ) { com.google.gitiles.CommitJsonData.Ident result = new com.google.gitiles.CommitJsonData.Ident ( ) ; result.name = ident.getName ( ) ; result.email = ident.getEmailAddress ( ) ; result.time = df.format ( ident ) ; return result ; }

Target:
private static com.google.gitiles.CommitJsonData.Ident toJsonData ( org.eclipse.jgit.lib.PersonIdent ident , com.google.gitiles.DateFormatter df ) { com.google.gitiles.CommitJsonData.Ident result = new com.google.gitiles.CommitJsonData.Ident ( ) ; result.name = ident.getName ( ) ; result.email = ident.getEmailAddress ( ) ; result.time = df.format ( ident ) ; return result ; }
Source:
void onDiscard ( com.google.gwt.event.dom.client.ClickEvent e ) { e.stopPropagation ( ) ; if ( ( comment.id ( ) ) == null ) { removeUI ( ) ; } else { setEdit ( false ) ; com.google.gerrit.client.changes.CommentApi.deleteDraft ( psId , comment.id ( ) , new com.google.gerrit.client.rpc.GerritCallback < com.google.gwt.core.client.JavaScriptObject > ( ) { @ java.lang.Override public void onSuccess ( com.google.gwt.core.client.JavaScriptObject result ) { removeUI ( ) ; } } ) ; } }

Target:
void onDiscard ( com.google.gwt.event.dom.client.ClickEvent e ) { e.stopPropagation ( ) ; if ( isNew ( ) ) { removeUI ( ) ; } else { setEdit ( false ) ; com.google.gerrit.client.changes.CommentApi.deleteDraft ( psId , comment.id ( ) , new com.google.gerrit.client.rpc.GerritCallback < com.google.gwt.core.client.JavaScriptObject > ( ) { @ java.lang.Override public void onSuccess ( com.google.gwt.core.client.JavaScriptObject result ) { removeUI ( ) ; } } ) ; } }
Source:
private com.google.gerrit.server.change.ReviewerJson.PostResult putAccount ( com.google.gerrit.server.change.ReviewerResource rsrc ) throws com.google.gerrit.common.errors.EmailException , com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.reviewdb.client.Account.Id id = rsrc.getUser ( ) . getAccountId ( ) ; com.google.gerrit.server.project.ChangeControl control = rsrc.getControl ( ) . forUser ( identifiedUserFactory.create ( id ) ) ; com.google.gerrit.server.change.ReviewerJson.PostResult result = new com.google.gerrit.server.change.ReviewerJson.PostResult ( ) ; addReviewers ( rsrc , result , com.google.common.collect.ImmutableMap.of ( id , control ) ) ; return result ; }

Target:
private com.google.gerrit.server.change.ReviewerJson.PostResult putAccount ( com.google.gerrit.server.change.ReviewerResource rsrc ) throws com.google.gerrit.common.errors.EmailException , com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.reviewdb.client.Account member = rsrc.getUser ( ) . getAccount ( ) ; com.google.gerrit.server.project.ChangeControl control = rsrc.getControl ( ) ; com.google.gerrit.server.change.ReviewerJson.PostResult result = new com.google.gerrit.server.change.ReviewerJson.PostResult ( ) ; if ( isValidReviewer ( member , control ) ) { addReviewers ( rsrc , result , com.google.common.collect.ImmutableMap.of ( member.getId ( ) , control ) ) ; } return result ; }
Source:
public java.lang.Iterable < com.google.gerrit.server.plugins.Plugin > getPlugins ( ) { return running.values ( ) ; }

Target:
public java.lang.Iterable < com.google.gerrit.server.plugins.Plugin > getPlugins ( boolean all ) { if ( ! all ) { return running.values ( ) ; } else { java.util.ArrayList < com.google.gerrit.server.plugins.Plugin > plugins = new java.util.ArrayList < com.google.gerrit.server.plugins.Plugin > ( running.values ( ) ) ; plugins.addAll ( disabled.values ( ) ) ; return plugins ; } }
Source:
private void initApprovals ( final com.google.gerrit.common.data.PatchSetPublishDetail r , final com.google.gwt.user.client.ui.Panel body ) { for ( final com.google.gerrit.common.data.ApprovalType ct : com.google.gerrit.client.Gerrit.getConfig ( ) . getApprovalTypes ( ) . getApprovalTypes ( ) ) { if ( r.isAllowed ( ct.getCategory ( ) . getId ( ) ) ) { initApprovalType ( r , body , ct ) ; } } }

Target:
private void initApprovals ( final com.google.gerrit.common.data.PatchSetPublishDetail r , final com.google.gwt.user.client.ui.Panel body ) { com.google.gerrit.common.data.ApprovalTypes types = com.google.gerrit.client.Gerrit.getConfig ( ) . getApprovalTypes ( ) ; for ( com.google.gerrit.common.data.PermissionRange range : r.getLabels ( ) ) { com.google.gerrit.common.data.ApprovalType type = types.byLabel ( range.getLabel ( ) ) ; if ( type != null ) { initApprovalType ( r , body , type , range ) ; } else { } } }
Source:
private void fPercent ( final java.lang.String name , final long value , final long total ) { final long pcent = ( 0 < total ) ? ( 100 * value ) / total : 0 ; p.println ( java.lang.String.format ( " %1$-12s: %2$3d%%" , name , ( ( int ) ( pcent ) ) ) ) ; }

Target:
private java.lang.String path ( java.io.File file ) { try { return file.getCanonicalPath ( ) ; } catch ( java.io.IOException err ) { return file.getAbsolutePath ( ) ; } }
Source:
protected void configure ( ) { factory ( AgreementInfoFactory.Factory.class ) ; factory ( CreateGroup.Factory.class ) ; factory ( DeleteExternalIds.Factory.class ) ; factory ( ExternalIdDetailFactory.Factory.class ) ; factory ( GroupDetailHandler.Factory.class ) ; factory ( MyGroupsFactory.Factory.class ) ; factory ( RenameGroup.Factory.class ) ; factory ( VisibleGroupsHandler.Factory.class ) ; }

Target:
protected void configure ( ) { factory ( AgreementInfoFactory.Factory.class ) ; factory ( CreateGroup.Factory.class ) ; factory ( DeleteExternalIds.Factory.class ) ; factory ( ExternalIdDetailFactory.Factory.class ) ; factory ( GroupDetailHandler.Factory.class ) ; factory ( MyGroupsFactory.Factory.class ) ; factory ( RegisterNewEmailSender.Factory.class ) ; factory ( RenameGroup.Factory.class ) ; factory ( VisibleGroupsHandler.Factory.class ) ; }
Source:
public static com.google.gerrit.extensions.client.EditPreferencesInfo defaults ( ) { com.google.gerrit.extensions.client.EditPreferencesInfo i = new com.google.gerrit.extensions.client.EditPreferencesInfo ( ) ; i.tabSize = 8 ; i.lineLength = 100 ; i.cursorBlinkRate = 0 ; i.hideTopMenu = false ; i.showTabs = true ; i.showWhitespaceErrors = false ; i.syntaxHighlighting = true ; i.hideLineNumbers = false ; i.matchBrackets = false ; i.theme = com.google.gerrit.extensions.client.Theme.DEFAULT ; i.keyMapType = KeyMapType.DEFAULT ; return i ; }

Target:
public static com.google.gerrit.extensions.client.EditPreferencesInfo defaults ( ) { com.google.gerrit.extensions.client.EditPreferencesInfo i = new com.google.gerrit.extensions.client.EditPreferencesInfo ( ) ; i.tabSize = 8 ; i.lineLength = 100 ; i.cursorBlinkRate = 0 ; i.hideTopMenu = false ; i.showTabs = true ; i.showWhitespaceErrors = false ; i.syntaxHighlighting = true ; i.hideLineNumbers = false ; i.matchBrackets = true ; i.autoCloseBrackets = false ; i.theme = Theme.DEFAULT ; i.keyMapType = KeyMapType.DEFAULT ; return i ; }
Source:
public void patchScript ( final com.google.gerrit.reviewdb.client.Patch.Key patchKey , final com.google.gerrit.reviewdb.client.PatchSet.Id psa , final com.google.gerrit.reviewdb.client.PatchSet.Id psb , final com.google.gerrit.reviewdb.client.AccountDiffPreference dp , final com.google.gwtjsonrpc.common.AsyncCallback < com.google.gerrit.common.data.PatchScript > callback ) { if ( psb == null ) { callback.onFailure ( new com.google.gerrit.common.errors.NoSuchEntityException ( ) ) ; return ; } patchScriptFactoryFactory.create ( patchKey , psa , psb , dp ) . to ( callback ) ; }

Target:
public void patchScript ( final com.google.gerrit.reviewdb.client.Patch.Key patchKey , final com.google.gerrit.reviewdb.client.PatchSet.Id psa , final com.google.gerrit.reviewdb.client.PatchSet.Id psb , final com.google.gerrit.reviewdb.client.AccountDiffPreference dp , final com.google.gwtjsonrpc.common.AsyncCallback < com.google.gerrit.common.data.PatchScript > callback ) { if ( psb == null ) { callback.onFailure ( new com.google.gerrit.common.errors.NoSuchEntityException ( ) ) ; return ; } com.google.gerrit.httpd.rpc.Handler.wrap ( patchScriptFactoryFactory.create ( patchKey , psa , psb , dp ) ) . to ( callback ) ; }
Source:
public com.google.gerrit.server.IdentifiedUser parseOnBehalfOf ( @ com.google.gerrit.common.Nullable com.google.gerrit.server.CurrentUser caller , java.lang.String id ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.UnprocessableEntityException , com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { com.google.gerrit.server.IdentifiedUser user = parseIdOnBehalfOf ( caller , id ) ; if ( user == null ) { throw new com.google.gerrit.extensions.restapi.UnprocessableEntityException ( java.lang.String.format ( "Account Not Found: %s" , id ) ) ; } else if ( ! ( accountControlFactory.get ( ) . canSee ( user.getAccount ( ) ) ) ) { throw new com.google.gerrit.extensions.restapi.UnprocessableEntityException ( java.lang.String.format ( "Account Not Found: %s" , id ) ) ; } return user ; }

Target:
public com.google.gerrit.server.IdentifiedUser parseOnBehalfOf ( @ com.google.gerrit.common.Nullable com.google.gerrit.server.CurrentUser caller , java.lang.String id ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.UnprocessableEntityException , com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { com.google.gerrit.server.IdentifiedUser user = parseIdOnBehalfOf ( caller , id ) ; if ( ( user == null ) || ( ! ( accountControlFactory.get ( ) . canSee ( user.getAccount ( ) ) ) ) ) { throw new com.google.gerrit.extensions.restapi.UnprocessableEntityException ( java.lang.String.format ( "Account '%s' is not found or ambiguous" , id ) ) ; } return user ; }
Source:
public void configure ( ) { listener ( ) . to ( com.google.gerrit.lucene.LuceneIndexModule.SingleVersionListener.class ) ; bind ( new com.google.inject.TypeLiteral < java.util.Map < java.lang.String , java.lang.Integer > > ( ) { } ) . annotatedWith ( com.google.inject.name.Names.named ( com.google.gerrit.lucene.LuceneIndexModule.SINGLE_VERSIONS ) ) . toInstance ( this . singleVersions ) ; }

Target:
protected void configure ( ) { install ( new com.google.inject.assistedinject.FactoryModuleBuilder ( ) . implement ( com.google.gerrit.server.index.change.ChangeIndex.class , com.google.gerrit.lucene.LuceneChangeIndex.class ) . build ( ChangeIndex.Factory.class ) ) ; install ( new com.google.inject.assistedinject.FactoryModuleBuilder ( ) . implement ( com.google.gerrit.server.index.account.AccountIndex.class , com.google.gerrit.lucene.LuceneAccountIndex.class ) . build ( AccountIndex.Factory.class ) ) ; install ( new com.google.gerrit.server.index.IndexModule ( threads ) ) ; if ( ( singleVersions ) == null ) { install ( new com.google.gerrit.lucene.LuceneIndexModule.MultiVersionModule ( ) ) ; } else { install ( new com.google.gerrit.lucene.LuceneIndexModule.SingleVersionModule ( singleVersions ) ) ; } }
Source:
public void onSuccess ( com.google.gerrit.client.account.AgreementInfo result ) { if ( isAttached ( ) ) { mySigned = new java.util.HashSet < com.google.gerrit.client.reviewdb.ContributorAgreement.Id > ( ) ; for ( com.google.gerrit.client.reviewdb.AccountAgreement a : result.accepted ) { mySigned.add ( a.getAgreementId ( ) ) ; } postRPC ( ) ; } }

Target:
public void onSuccess ( com.google.gerrit.client.account.AgreementInfo result ) { if ( isAttached ( ) ) { mySigned = new java.util.HashSet < com.google.gerrit.client.reviewdb.ContributorAgreement.Id > ( ) ; for ( com.google.gerrit.client.reviewdb.AccountAgreement a : result.userAccepted ) { mySigned.add ( a.getAgreementId ( ) ) ; } for ( com.google.gerrit.client.reviewdb.AccountGroupAgreement a : result.groupAccepted ) { mySigned.add ( a.getAgreementId ( ) ) ; } postRPC ( ) ; } }
Source:
public void newAdapterRoundTrip ( ) { java.lang.String json = gson.toJson ( com.google.gerrit.server.notedb.CommentTimestampAdapterTest.NON_DST_TS ) ; com.google.common.truth.Truth.assertThat ( json ) . isEqualTo ( ( ( '"' + ( com.google.gerrit.server.notedb.CommentTimestampAdapterTest.NON_DST_STR ) ) + '"' ) ) ; com.google.common.truth.Truth.assertThat ( gson.fromJson ( json , java.sql.Timestamp.class ) ) . isEqualTo ( com.google.gerrit.server.notedb.CommentTimestampAdapterTest.NON_DST_TS ) ; }

Target:
public void newAdapterRoundTrip ( ) { java.lang.String json = gson.toJson ( com.google.gerrit.server.notedb.CommentTimestampAdapterTest.NON_DST_TS ) ; com.google.common.truth.Truth.assertThat ( json ) . isEqualTo ( ( ( '"' + ( com.google.gerrit.server.notedb.CommentTimestampAdapterTest.NON_DST_STR_TRUNC ) ) + '"' ) ) ; com.google.common.truth.Truth.assertThat ( gson.fromJson ( json , java.sql.Timestamp.class ) ) . isEqualTo ( com.google.gerrit.server.notedb.CommentTimestampAdapterTest.NON_DST_TS_TRUNC ) ; }
Source:
void deleteChecked ( ) { deleteButton.setEnabled ( false ) ; for ( int row = 2 ; row < ( table.getRowCount ( ) ) ; row ++ ) { if ( ( ( com.google.gwt.user.client.ui.CheckBox ) ( table.getWidget ( row , 0 ) ) ) . getValue ( ) ) { table.removeRow ( ( row -- ) ) ; } } }

Target:
void deleteChecked ( ) { deleteButton.setEnabled ( false ) ; for ( int row = 2 ; row < ( table.getRowCount ( ) ) ; row ++ ) { if ( ( ( com.google.gwt.user.client.ui.CheckBox ) ( table.getWidget ( row , 0 ) ) ) . getValue ( ) ) { table.removeRow ( ( row -- ) ) ; } } updateNavigationLinks ( ) ; }
Source:
public com.googlecode.prolog_cafe.lang.NumberTerm mod ( com.googlecode.prolog_cafe.lang.NumberTerm t ) { if ( t.isDouble ( ) ) throw new com.googlecode.prolog_cafe.lang.IllegalTypeException ( "integer" , t ) ; if ( ( t.intValue ( ) ) == 0 ) throw new com.googlecode.prolog_cafe.lang.EvaluationException ( "zero_divisor" ) ; return new com.googlecode.prolog_cafe.lang.IntegerTerm ( ( ( this . val ) % ( t.intValue ( ) ) ) ) ; }

Target:
public com.googlecode.prolog_cafe.lang.NumberTerm mod ( com.googlecode.prolog_cafe.lang.NumberTerm t ) { if ( t.isDouble ( ) ) throw new com.googlecode.prolog_cafe.exceptions.IllegalTypeException ( "integer" , t ) ; if ( ( t.intValue ( ) ) == 0 ) throw new com.googlecode.prolog_cafe.exceptions.EvaluationException ( "zero_divisor" ) ; return new com.googlecode.prolog_cafe.lang.IntegerTerm ( ( ( this . val ) % ( t.intValue ( ) ) ) ) ; }
Source:
void addPatchSetId ( final java.lang.String token ) { try { patchSets.add ( parsePatchSet ( token ) ) ; } catch ( com.google.gerrit.sshd.commands.UnloggedFailure e ) { throw new java.lang.IllegalArgumentException ( e.getMessage ( ) , e ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new java.lang.IllegalArgumentException ( "database error" , e ) ; } }

Target:
void addPatchSetId ( final java.lang.String token ) { try { com.google.gerrit.reviewdb.client.PatchSet ps = com.google.gerrit.sshd.commands.CommandUtils.parsePatchSet ( token , db , projectControl , branch ) ; patchSets.add ( ps ) ; } catch ( com.google.gerrit.sshd.commands.UnloggedFailure e ) { throw new java.lang.IllegalArgumentException ( e.getMessage ( ) , e ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new java.lang.IllegalArgumentException ( "database error" , e ) ; } }
Source:
private static int nextLineBreak ( java.lang.String s , int start , int end ) { for ( int i = start ; i < end ; i ++ ) { if ( ( ( s.charAt ( i ) ) == '\n' ) || ( ( s.charAt ( i ) ) == '\r' ) ) { return i ; } } return - 1 ; }

Target:
private static int nextLineBreak ( java.lang.String s , int start , int end ) { int n = s.indexOf ( '\n' , start ) ; return n < end ? n : - 1 ; }
Source:
private void assertChildNotFound ( com.google.gerrit.reviewdb.client.Project.NameKey parent , java.lang.String child ) throws java.lang.Exception { try { gApi.projects ( ) . name ( parent.get ( ) ) . child ( child ) ; } catch ( com.google.gerrit.extensions.restapi.ResourceNotFoundException e ) { com.google.common.truth.Truth.assertThat ( e.getMessage ( ) ) . contains ( child ) ; } }

Target:
private void assertChildNotFound ( com.google.gerrit.reviewdb.client.Project.NameKey parent , java.lang.String child ) throws java.lang.Exception { exception.expect ( com.google.gerrit.extensions.restapi.ResourceNotFoundException.class ) ; exception.expectMessage ( child ) ; gApi.projects ( ) . name ( parent.get ( ) ) . child ( child ) . get ( ) ; }
Source:
public void setAssigneeOnReviewableChangeByAdmin ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; assign ( sc , admin , assignee ) ; assertThat ( sender ) . sent ( "setassignee" , sc ) . notTo ( sc.owner , sc.reviewer , sc.ccer , sc.starrer , admin ) . to ( sc.reviewerByEmail ) . cc ( sc.ccerByEmail ) . to ( assignee ) ; }

Target:
public void setAssigneeOnReviewableChangeByAdmin ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; assign ( sc , admin , sc.assignee ) ; assertThat ( sender ) . sent ( "setassignee" , sc ) . notTo ( sc.owner , sc.reviewer , sc.ccer , sc.starrer , admin ) . to ( sc.reviewerByEmail ) . cc ( sc.ccerByEmail ) . to ( sc.assignee ) ; }
Source:
private void fByteCount ( final java.lang.String name , double value ) { java.lang.String suffix = "bytes" ; if ( value > 1024 ) { value /= 1024 ; suffix = "kb" ; } if ( value > 1024 ) { value /= 1024 ; suffix = "mb" ; } if ( value > 1024 ) { value /= 1024 ; suffix = "gb" ; } p.println ( java.lang.String.format ( " %1$-12s: %2$6.2f %3$s" , name , value , suffix ) ) ; }

Target:
private java.lang.String bytes ( double value ) { value /= 1024 ; java.lang.String suffix = "k" ; if ( value > 1024 ) { value /= 1024 ; suffix = "m" ; } if ( value > 1024 ) { value /= 1024 ; suffix = "g" ; } return java.lang.String.format ( "%1$6.2f%2$s" , value , suffix ) ; }