auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
java.util.Set < java.lang.String > getTeamsForUser ( java.lang.String organizationName , java.lang.String username ) { try { return new com.google.common.collect.ImmutableSet.Builder < java.lang.String > ( ) . addAll ( orgTeamsByUsername.get ( username ) . get ( organizationName ) ) . build ( ) ; } catch ( java.util.concurrent.ExecutionException e ) { com.googlesource.gerrit.plugins.github.group.GitHubGroupsCache.log.warn ( ( ( ( ( "Cannot get Teams membership for organisation '" + organizationName ) + "' and user '" ) + username ) + "'" ) , e ) ; return java.util.Collections.emptySet ( ) ; } }

Target:
java.util.Set < java.lang.String > getOrganizationsForUser ( java.lang.String username ) { try { return orgTeamsByUsername.get ( username ) . keySet ( ) ; } catch ( java.util.concurrent.ExecutionException e ) { com.googlesource.gerrit.plugins.github.group.GitHubGroupsCache.log.warn ( ( ( "Cannot get GitHub organisations for user '" + username ) + "'" ) , e ) ; return java.util.Collections.emptySet ( ) ; } }
Source:
private com.google.gerrit.reviewdb.client.Change loadChangeFromDb ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Project.NameKey project , com.google.gerrit.reviewdb.client.Change.Id changeId ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.Change change = com.google.gerrit.reviewdb.server.ReviewDbUtil.unwrapDb ( db ) . changes ( ) . get ( changeId ) ; com.google.common.base.Preconditions.checkArgument ( ( project != null ) , "project is required" ) ; com.google.common.base.Preconditions.checkNotNull ( change , "change %s not found in ReviewDb" , changeId ) ; com.google.common.base.Preconditions.checkArgument ( change.getProject ( ) . equals ( project ) , ( "passed project %s when creating ChangeNotes for %s, but actual" + " project is %s" ) , project , changeId , change.getProject ( ) ) ; return change ; }

Target:
private com.google.gerrit.reviewdb.client.Change loadChangeFromDb ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Project.NameKey project , com.google.gerrit.reviewdb.client.Change.Id changeId ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.Change change = com.google.gerrit.server.notedb.ChangeNotes.readOneReviewDbChange ( db , changeId ) ; com.google.common.base.Preconditions.checkArgument ( ( project != null ) , "project is required" ) ; com.google.common.base.Preconditions.checkNotNull ( change , "change %s not found in ReviewDb" , changeId ) ; com.google.common.base.Preconditions.checkArgument ( change.getProject ( ) . equals ( project ) , ( "passed project %s when creating ChangeNotes for %s, but actual" + " project is %s" ) , project , changeId , change.getProject ( ) ) ; return change ; }
Source:
protected void configure ( ) { bind ( com.google.gerrit.httpd.GerritOptions.class ) . toInstance ( new com.google.gerrit.httpd.GerritOptions ( config , headless , slave , polyGerritDev ) ) ; if ( test ) { bind ( java.lang.String.class ) . annotatedWith ( com.google.gerrit.server.securestore.SecureStoreClassName.class ) . toInstance ( com.google.gerrit.server.securestore.DefaultSecureStore.class . getName ( ) ) ; bind ( com.google.gerrit.server.securestore.SecureStore.class ) . toProvider ( com.google.gerrit.server.securestore.SecureStoreProvider.class ) ; } }

Target:
protected void configure ( ) { bind ( com.google.gerrit.server.config.GerritOptions.class ) . toInstance ( new com.google.gerrit.server.config.GerritOptions ( config , headless , slave , polyGerritDev ) ) ; if ( test ) { bind ( java.lang.String.class ) . annotatedWith ( com.google.gerrit.server.securestore.SecureStoreClassName.class ) . toInstance ( com.google.gerrit.server.securestore.DefaultSecureStore.class . getName ( ) ) ; bind ( com.google.gerrit.server.securestore.SecureStore.class ) . toProvider ( com.google.gerrit.server.securestore.SecureStoreProvider.class ) ; } }
Source:
private java.util.List < com.google.gerrit.server.change.SuggestReviewers.SuggestedReviewerInfo > suggestReviewers ( com.google.gerrit.acceptance.RestSession session , java.lang.String changeId , java.lang.String query , int n ) throws java.io.IOException { return newGson ( ) . fromJson ( session.get ( ( ( ( ( ( "/changes/" + changeId ) + "/suggest_reviewers?q=" ) + query ) + "&n=" ) + n ) ) . getReader ( ) , new com.google.gson.reflect.TypeToken < java.util.List < com.google.gerrit.server.change.SuggestReviewers.SuggestedReviewerInfo > > ( ) { } . getType ( ) ) ; }

Target:
public void suggestReviewersWithoutLimitOptionSpecified ( ) throws java.lang.Exception { java.lang.String changeId = createChange ( ) . getChangeId ( ) ; java.lang.String query = "users3" ; java.util.List < com.google.gerrit.server.change.SuggestReviewers.SuggestedReviewerInfo > suggestedReviewerInfos = newGson ( ) . fromJson ( adminSession.get ( ( ( ( "/changes/" + changeId ) + "/suggest_reviewers?q=" ) + query ) ) . getReader ( ) , new com.google.gson.reflect.TypeToken < java.util.List < com.google.gerrit.server.change.SuggestReviewers.SuggestedReviewerInfo > > ( ) { } . getType ( ) ) ; org.junit.Assert.assertEquals ( 1 , suggestedReviewerInfos.size ( ) ) ; }
Source:
private static com.google.gerrit.server.IdentifiedUser checkUser ( com.google.gerrit.server.project.ChangeControl ctl ) { com.google.common.base.Preconditions.checkArgument ( ctl.getCurrentUser ( ) . isIdentifiedUser ( ) , "only IdentifiedUser may create patch set on change %s" , ctl.getChange ( ) . getId ( ) ) ; return ( ( com.google.gerrit.server.IdentifiedUser ) ( ctl.getCurrentUser ( ) ) ) ; }

Target:
private static com.google.gerrit.server.IdentifiedUser checkUser ( com.google.gerrit.server.project.ChangeControl ctl ) { com.google.common.base.Preconditions.checkArgument ( ctl.getUser ( ) . isIdentifiedUser ( ) , "only IdentifiedUser may create patch set on change %s" , ctl.getChange ( ) . getId ( ) ) ; return ( ( com.google.gerrit.server.IdentifiedUser ) ( ctl.getUser ( ) ) ) ; }
Source:
public void onClick ( final com.google.gwt.user.client.ui.Widget sender ) { if ( ( send ) == sender ) { onSend ( ) ; } else if ( ( cancel ) == sender ) { com.google.gerrit.client.Gerrit.uncache ( this ) ; goChange ( ) ; } }

Target:
public void onClick ( final com.google.gwt.user.client.ui.Widget sender ) { if ( ( send ) == sender ) { com.google.gerrit.client.changes.PublishCommentScreen.lastState = null ; onSend ( ) ; } else if ( ( cancel ) == sender ) { com.google.gerrit.client.changes.PublishCommentScreen.lastState = null ; saveStateOnUnload = false ; goChange ( ) ; } }
Source:
public void testFindAfterDeleteGap ( ) { com.google.gerrit.client.diff.LineMapper mapper = new com.google.gerrit.client.diff.LineMapper ( ) ; mapper.appendDelete ( 10 ) ; org.junit.Assert.assertEquals ( 0 , mapper.lineOnOther ( Side.PARENT , 10 ) ) ; }

Target:
public void testFindAfterDeleteGap ( ) { com.google.gerrit.client.diff.LineMapper mapper = new com.google.gerrit.client.diff.LineMapper ( ) ; mapper.appendDelete ( 10 ) ; org.junit.Assert.assertEquals ( new com.google.gerrit.client.diff.LineMapper.LineOnOtherInfo ( 0 , true ) , mapper.lineOnOther ( Side.PARENT , 10 ) ) ; org.junit.Assert.assertEquals ( new com.google.gerrit.client.diff.LineMapper.LineOnOtherInfo ( 10 , true ) , mapper.lineOnOther ( Side.REVISION , 0 ) ) ; }
Source:
public void load ( final com.google.gerrit.client.reviewdb.Change c , final com.google.gerrit.client.reviewdb.ReviewDb db ) throws com.google.gwtorm.client.OrmException { change = c ; final com.google.gerrit.client.reviewdb.PatchSet.Id ps = change.currentPatchSetId ( ) ; if ( ps != null ) { currentPatchSet = db.patchSets ( ) . get ( ps ) ; currentPatchSetInfo = db.patchSetInfo ( ) . get ( ps ) ; } }

Target:
public int compare ( final com.google.gerrit.client.data.ApprovalDetail o1 , final com.google.gerrit.client.data.ApprovalDetail o2 ) { return o2.sortOrder.compareTo ( o1.sortOrder ) ; }
Source:
public void onSuccess ( com.google.gerrit.client.diff.DiffInfo diffInfo ) { if ( ( id == ( reloadVersionId ) ) && ( isAttached ( ) ) ) { diff = diffInfo ; operation ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { skipManager.removeAll ( ) ; chunkManager.reset ( ) ; diffTable.overview.clearDiffGutters ( ) ; setShowIntraline ( prefs.intralineDifference ( ) ) ; render ( diff ) ; skipManager.render ( prefs.context ( ) , diff ) ; } } ) ; } }

Target:
public void onSuccess ( com.google.gerrit.client.diff.DiffInfo diffInfo ) { if ( ( id == ( reloadVersionId ) ) && ( isAttached ( ) ) ) { diff = diffInfo ; operation ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { skipManager.removeAll ( ) ; chunkManager.reset ( ) ; diffTable.overview.clearDiffMarkers ( ) ; setShowIntraline ( prefs.intralineDifference ( ) ) ; render ( diff ) ; skipManager.render ( prefs.context ( ) , diff ) ; } } ) ; } }
Source:
void onSave ( @ java.lang.SuppressWarnings ( value = "unused" ) com.google.gwt.event.dom.client.ClickEvent e ) { com.google.gerrit.client.changes.ChangeFileApi.putContentOrMessage ( revision , path , cm.getValue ( ) , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.VoidResult > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.VoidResult result ) { com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChangeInEditMode ( revision.getParentKey ( ) ) ) ; } } ) ; }

Target:
public void onSuccess ( com.google.gerrit.client.rpc.HttpResponse < com.google.gerrit.client.rpc.NativeString > fc ) { content = fc ; if ( prefs.syntaxHighlighting ( ) ) { injectMode ( fc.getContentType ( ) , modeCallback ) ; } else { modeCallback.onSuccess ( null ) ; } }
Source:
public com.google.gerrit.acceptance.RestResponse post ( java.lang.String endPoint , java.lang.Object content ) throws java.io.IOException { org.apache.http.client.methods.HttpPost post = new org.apache.http.client.methods.HttpPost ( ( "http://localhost:8080/a" + endPoint ) ) ; if ( content != null ) { post.addHeader ( new org.apache.http.message.BasicHeader ( "Content-Type" , "application/json" ) ) ; post.setEntity ( new org.apache.http.entity.StringEntity ( new com.google.gson.Gson ( ) . toJson ( content ) , com.google.common.base.Charsets.UTF_8.name ( ) ) ) ; } return new com.google.gerrit.acceptance.RestResponse ( getClient ( ) . execute ( post ) ) ; }

Target:
public com.google.gerrit.acceptance.RestResponse post ( java.lang.String endPoint , java.lang.Object content ) throws java.io.IOException { org.apache.http.client.methods.HttpPost post = new org.apache.http.client.methods.HttpPost ( ( ( ( url ) + "/a" ) + endPoint ) ) ; if ( content != null ) { post.addHeader ( new org.apache.http.message.BasicHeader ( "Content-Type" , "application/json" ) ) ; post.setEntity ( new org.apache.http.entity.StringEntity ( new com.google.gson.Gson ( ) . toJson ( content ) , com.google.common.base.Charsets.UTF_8.name ( ) ) ) ; } return new com.google.gerrit.acceptance.RestResponse ( getClient ( ) . execute ( post ) ) ; }
Source:
public void pushPrivatesWithDisablePrivateChangesFalse ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result result = pushFactory.create ( db , admin.getIdent ( ) , testRepo ) . to ( "refs/for/master%private" ) ; com.google.common.truth.Truth.assertThat ( result.getChange ( ) . change ( ) . isPrivate ( ) ) . isEqualTo ( true ) ; }

Target:
public void pushPrivatesWithDisablePrivateChangesFalse ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result result = pushFactory.create ( db , admin.getIdent ( ) , testRepo ) . to ( "refs/for/master%private" ) ; com.google.common.truth.Truth.assertThat ( result.getChange ( ) . change ( ) . isPrivate ( ) ) . isTrue ( ) ; }
Source:
private void allowSubmitOnBehalfOf ( ) throws java.lang.Exception { com.google.gerrit.server.git.ProjectConfig cfg = projectCache.checkedGet ( project ) . getConfig ( ) ; com.google.gerrit.server.project.Util.allow ( cfg , Permission.SUBMIT_AS , com.google.gerrit.server.group.SystemGroupBackend.getGroup ( com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS ) . getUUID ( ) , "refs/heads/*" ) ; saveProjectConfig ( project , cfg ) ; }

Target:
private void allowCodeReviewOnBehalfOf ( ) throws java.lang.Exception { com.google.gerrit.server.git.ProjectConfig cfg = projectCache.checkedGet ( project ) . getConfig ( ) ; com.google.gerrit.common.data.LabelType codeReviewType = com.google.gerrit.server.project.Util.codeReview ( ) ; java.lang.String forCodeReviewAs = com.google.gerrit.common.data.Permission.forLabelAs ( codeReviewType.getName ( ) ) ; java.lang.String heads = "refs/heads/*" ; com.google.gerrit.reviewdb.client.AccountGroup.UUID uuid = com.google.gerrit.server.group.SystemGroupBackend.getGroup ( com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS ) . getUUID ( ) ; com.google.gerrit.server.project.Util.allow ( cfg , forCodeReviewAs , ( - 1 ) , 1 , uuid , heads ) ; saveProjectConfig ( project , cfg ) ; }
Source:
public boolean canRestore ( ) { return ( canAbandon ( ) ) && ( getRefControl ( ) . canUpload ( ) ) ; }

Target:
public boolean canAbandon ( com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { return ( ( ( ( ( isOwner ( ) ) || ( getRefControl ( ) . isOwner ( ) ) ) || ( getProjectControl ( ) . isOwner ( ) ) ) || ( getUser ( ) . getCapabilities ( ) . canAdministrateServer ( ) ) ) || ( getRefControl ( ) . canAbandon ( ) ) ) && ( ! ( isPatchSetLocked ( db ) ) ) ; }
Source:
void setReviewed ( boolean r ) { reviewed.setValue ( r , true ) ; }

Target:
void onValueChange ( com.google.gwt.event.logical.shared.ValueChangeEvent < java.lang.Boolean > event ) { if ( event.getValue ( ) ) { reviewed ( ) . put ( com.google.gerrit.client.rpc.CallbackGroup.< com.google.gerrit.client.changes.ReviewInfo > emptyCallback ( ) ) ; } else { reviewed ( ) . delete ( com.google.gerrit.client.rpc.CallbackGroup.< com.google.gerrit.client.changes.ReviewInfo > emptyCallback ( ) ) ; } }
Source:
public void copyMaxScoreOnRework ( ) throws java.lang.Exception { codeReview.setCopyMaxScore ( true ) ; saveLabelConfig ( ) ; com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; revision ( r ) . review ( com.google.gerrit.extensions.api.changes.ReviewInput.approve ( ) ) ; assertApproval ( r , 2 ) ; r = ammendChange ( r.getChangeId ( ) ) ; assertApproval ( r , 2 ) ; }

Target:
public void copyMaxScoreOnRework ( ) throws java.lang.Exception { codeReview.setCopyMaxScore ( true ) ; saveLabelConfig ( ) ; com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; revision ( r ) . review ( com.google.gerrit.extensions.api.changes.ReviewInput.approve ( ) ) ; assertApproval ( r , 2 ) ; r = amendChange ( r.getChangeId ( ) ) ; assertApproval ( r , 2 ) ; }
Source:
public void validatePreMerge ( com.google.gerrit.server.git.CodeReviewCommit commit , com.google.gerrit.server.project.ProjectState destProject , com.google.gerrit.reviewdb.client.Branch.NameKey destBranch ) throws com.google.gerrit.server.git.validators.MergeValidationException { java.util.List < com.google.gerrit.server.git.validators.MergeValidationListener > validators = com.google.common.collect.Lists.newLinkedList ( ) ; validators.add ( new com.google.gerrit.server.git.validators.MergeValidators.PluginMergeValidationListener ( mergeValidationListeners ) ) ; for ( com.google.gerrit.server.git.validators.MergeValidationListener validator : validators ) { validator.onPreMerge ( commit , destProject , destBranch ) ; } }

Target:
public void validatePreMerge ( org.eclipse.jgit.lib.Repository repo , com.google.gerrit.server.git.CodeReviewCommit commit , com.google.gerrit.server.project.ProjectState destProject , com.google.gerrit.reviewdb.client.Branch.NameKey destBranch , com.google.gerrit.reviewdb.client.PatchSet.Id patchSetId ) throws com.google.gerrit.server.git.validators.MergeValidationException { java.util.List < com.google.gerrit.server.git.validators.MergeValidationListener > validators = com.google.common.collect.Lists.newLinkedList ( ) ; validators.add ( new com.google.gerrit.server.git.validators.MergeValidators.PluginMergeValidationListener ( mergeValidationListeners ) ) ; validators.add ( projectConfigValidatorFactory.create ( ) ) ; for ( com.google.gerrit.server.git.validators.MergeValidationListener validator : validators ) { validator.onPreMerge ( repo , commit , destProject , destBranch , patchSetId ) ; } }
Source:
public java.util.Set < com.google.gerrit.reviewdb.AccountGroup.Id > getEffectiveGroups ( ) { if ( ( effectiveGroups ) == null ) { if ( authConfig.isIdentityTrustable ( state ( ) . getExternalIds ( ) ) ) { effectiveGroups = realm.groups ( state ( ) ) ; } else { effectiveGroups = authConfig.getRegisteredGroups ( ) ; } } return effectiveGroups ; }

Target:
public java.util.Set < com.google.gerrit.reviewdb.AccountGroup.UUID > getEffectiveGroups ( ) { if ( ( effectiveGroups ) == null ) { java.util.Set < com.google.gerrit.reviewdb.AccountGroup.UUID > seedGroups ; if ( authConfig.isIdentityTrustable ( state ( ) . getExternalIds ( ) ) ) { seedGroups = realm.groups ( state ( ) ) ; } else { seedGroups = com.google.gerrit.server.IdentifiedUser.registeredGroups ; } effectiveGroups = getIncludedGroups ( seedGroups ) ; } return effectiveGroups ; }
Source:
public void mute ( boolean mute ) throws com.google.gerrit.extensions.restapi.RestApiException { try { if ( mute ) { this . mute.apply ( change , new com.google.gerrit.server.change.Mute.Input ( ) ) ; } else { unmute.apply ( change , new com.google.gerrit.server.change.Unmute.Input ( ) ) ; } } catch ( com.google.gwtorm.server.OrmException e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( "Cannot mute change" , e ) ; } }

Target:
public void mute ( boolean mute ) throws com.google.gerrit.extensions.restapi.RestApiException { try { if ( mute ) { this . mute.apply ( change , new com.google.gerrit.server.change.Mute.Input ( ) ) ; } else { unmute.apply ( change , new com.google.gerrit.server.change.Unmute.Input ( ) ) ; } } catch ( com.google.gwtorm.server.OrmException | com.google.gerrit.server.StarredChangesUtil.IllegalLabelException e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( "Cannot mute change" , e ) ; } }
Source:
public com.google.gerrit.extensions.client.GeneralPreferencesInfo apply ( com.google.gerrit.server.account.AccountResource rsrc ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.server.permissions.PermissionBackendException { if ( ( self.get ( ) ) != ( rsrc.getUser ( ) ) ) { permissionBackend.user ( self ) . check ( GlobalPermission.MODIFY_ACCOUNT ) ; } com.google.gerrit.reviewdb.client.Account.Id id = rsrc.getUser ( ) . getAccountId ( ) ; return accountCache.get ( id ) . getAccount ( ) . getGeneralPreferencesInfo ( ) ; }

Target:
public com.google.gerrit.extensions.client.GeneralPreferencesInfo apply ( com.google.gerrit.server.account.AccountResource rsrc ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.server.permissions.PermissionBackendException { if ( ( self.get ( ) ) != ( rsrc.getUser ( ) ) ) { permissionBackend.user ( self ) . check ( GlobalPermission.MODIFY_ACCOUNT ) ; } com.google.gerrit.reviewdb.client.Account.Id id = rsrc.getUser ( ) . getAccountId ( ) ; return accountCache.get ( id ) . getGeneralPreferences ( ) ; }
Source:
private org.apache.lucene.search.Query intQuery ( com.google.gerrit.server.index.IndexPredicate < com.google.gerrit.server.query.change.ChangeData > p ) throws com.google.gerrit.server.query.QueryParseException { int value ; try { value = java.lang.Integer.valueOf ( p.getValue ( ) ) ; } catch ( java.lang.IllegalArgumentException e ) { throw new com.google.gerrit.server.query.QueryParseException ( ( "not an integer: " + ( p.getValue ( ) ) ) ) ; } return new org.apache.lucene.search.TermQuery ( com.google.gerrit.lucene.QueryBuilder.intTerm ( p.getField ( ) . getName ( ) , value ) ) ; }

Target:
private org.apache.lucene.search.Query intQuery ( com.google.gerrit.server.index.IndexPredicate < com.google.gerrit.server.query.change.ChangeData > p ) throws com.google.gerrit.server.query.QueryParseException { int value ; try { value = java.lang.Integer.parseInt ( p.getValue ( ) ) ; } catch ( java.lang.NumberFormatException e ) { throw new com.google.gerrit.server.query.QueryParseException ( ( "not an integer: " + ( p.getValue ( ) ) ) ) ; } return new org.apache.lucene.search.TermQuery ( com.google.gerrit.lucene.QueryBuilder.intTerm ( p.getField ( ) . getName ( ) , value ) ) ; }
Source:
private void readObject ( java.io.ObjectInputStream in ) throws java.io.IOException { commit = org.eclipse.jgit.lib.ObjectIdSerialization.readNotNull ( in ) ; into = org.eclipse.jgit.lib.ObjectIdSerialization.readNotNull ( in ) ; char t = in.readChar ( ) ; submitType = com.google.gerrit.server.change.MergeabilityCacheImpl.SUBMIT_TYPES.inverse ( ) . get ( t ) ; if ( ( submitType ) == null ) { throw new java.io.IOException ( ( "Invalid submit type code: " + t ) ) ; } mergeStrategy = com.google.gerrit.server.ioutil.BasicSerialization.readString ( in ) ; }

Target:
private void readObject ( java.io.ObjectInputStream in ) throws java.io.IOException { commit = org.eclipse.jgit.lib.ObjectIdSerializer.read ( in ) ; into = org.eclipse.jgit.lib.ObjectIdSerializer.read ( in ) ; char t = in.readChar ( ) ; submitType = com.google.gerrit.server.change.MergeabilityCacheImpl.SUBMIT_TYPES.inverse ( ) . get ( t ) ; if ( ( submitType ) == null ) { throw new java.io.IOException ( ( "Invalid submit type code: " + t ) ) ; } mergeStrategy = com.google.gerrit.server.ioutil.BasicSerialization.readString ( in ) ; }
Source:
public void testUpsertTwoBothExistsing ( ) throws com.google.gwtorm.client.OrmException , java.sql.SQLException { stubExecuteBatchOK ( com.google.gwtorm.jdbc.TestJdbcAccess.UPDATE , 1 , 1 ) ; createClassUnderTest ( ) . upsert ( com.google.gwtorm.jdbc.TestJdbcAccess.TWO_ROWS ) ; }

Target:
public void testUpdateOneConcurrentlyModifiedException ( ) throws com.google.gwtorm.server.OrmException , java.sql.SQLException { java.sql.PreparedStatement update = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.TestJdbcAccess.UPDATE , 0 ) ; com.google.gwtorm.jdbc.JdbcAccess < com.google.gwtorm.jdbc.TestJdbcAccess.Data , com.google.gwtorm.jdbc.TestJdbcAccess.Data.DataKey > classUnderTest = createClassUnderTest ( ) ; try { classUnderTest.update ( oneRow ) ; org.junit.Assert.fail ( "missing OrmConcurrencyException" ) ; } catch ( com.google.gwtorm.server.OrmConcurrencyException e ) { } com.google.gwtorm.jdbc.TestJdbcAccess.assertUsedBatchingOnly ( update ) ; }
Source:
private com.google.gerrit.server.project.SubmitRuleEvaluator makeEvaluator ( ) { com.google.gerrit.server.query.change.ChangeData cd = com.google.gerrit.server.query.change.ChangeData.createForTest ( project , new com.google.gerrit.reviewdb.client.Change.Id ( 1 ) , 1 ) ; cd.setChange ( com.google.gerrit.testing.TestChanges.newChange ( project , admin.id ) ) ; return evaluatorFactory.create ( cd ) ; }

Target:
private com.google.gerrit.server.project.SubmitRuleEvaluator makeEvaluator ( ) { return evaluatorFactory.create ( com.google.gerrit.server.project.SubmitRuleOptions.defaults ( ) ) ; }
Source:
private static com.google.gerrit.common.data.PermissionRule grant ( com.google.gerrit.server.git.ProjectConfig project , java.lang.String permissionName , com.google.gerrit.common.data.PermissionRule rule , java.lang.String ref , boolean exclusive ) { com.google.gerrit.common.data.Permission permission = project.getAccessSection ( ref , true ) . getPermission ( permissionName , true ) ; if ( exclusive ) { permission.setExclusiveGroup ( exclusive ) ; } permission.add ( rule ) ; return rule ; }

Target:
private static com.google.gerrit.common.data.PermissionRule grant ( com.google.gerrit.server.project.ProjectConfig project , java.lang.String permissionName , com.google.gerrit.common.data.PermissionRule rule , java.lang.String ref , boolean exclusive ) { com.google.gerrit.common.data.Permission permission = project.getAccessSection ( ref , true ) . getPermission ( permissionName , true ) ; if ( exclusive ) { permission.setExclusiveGroup ( exclusive ) ; } permission.add ( rule ) ; return rule ; }
Source:
public com.google.gerrit.server.update.BatchUpdate create ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Project.NameKey project , com.google.gerrit.server.CurrentUser user , java.sql.Timestamp when ) { return reviewDbBatchUpdateFactory.create ( db , project , user , when ) ; }

Target:
public com.google.gerrit.server.update.BatchUpdate create ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Project.NameKey project , com.google.gerrit.server.CurrentUser user , java.sql.Timestamp when ) { if ( migration.disableChangeReviewDb ( ) ) { return noteDbBatchUpdateFactory.create ( db , project , user , when ) ; } return reviewDbBatchUpdateFactory.create ( db , project , user , when ) ; }
Source:
public boolean isActive ( java.lang.String username ) throws com.google.gerrit.server.account.AccountException , javax.naming.NamingException , javax.security.auth.login.LoginException { try { javax.naming.directory.DirContext ctx = helper.open ( ) ; com.google.gerrit.server.auth.ldap.Helper.LdapSchema schema = helper.getSchema ( ctx ) ; helper.findAccount ( schema , ctx , username , false ) ; } catch ( com.google.gerrit.server.auth.NoSuchUserException e ) { return false ; } return true ; }

Target:
public boolean isActive ( java.lang.String username ) throws com.google.gerrit.server.account.AccountException , javax.naming.NamingException , javax.security.auth.login.LoginException { final javax.naming.directory.DirContext ctx = helper.open ( ) ; try { com.google.gerrit.server.auth.ldap.Helper.LdapSchema schema = helper.getSchema ( ctx ) ; helper.findAccount ( schema , ctx , username , false ) ; return true ; } catch ( com.google.gerrit.server.auth.NoSuchUserException e ) { return false ; } finally { try { ctx.close ( ) ; } catch ( javax.naming.NamingException e ) { com.google.gerrit.server.auth.ldap.LdapRealm.log.warn ( "Cannot close LDAP query handle" , e ) ; } } }
Source:
void setSkipBars ( java.util.Set < com.google.gerrit.client.diff.SkipBar > bars ) { skipBars = bars ; }

Target:
private com.google.gerrit.client.diff.SkipBar newSkipBar ( net.codemirror.lib.CodeMirror cm , com.google.gerrit.client.diff.DisplaySide side , com.google.gerrit.client.patches.SkippedLine skip ) { int start = host.getCmLine ( ( side == ( DisplaySide.A ) ? skip.getStartA ( ) : skip.getStartB ( ) ) , side ) ; int end = ( start + ( skip.getSize ( ) ) ) - 1 ; com.google.gerrit.client.diff.SkipBar bar = new com.google.gerrit.client.diff.SkipBar ( this , cm ) ; host.getDiffTable ( ) . add ( bar ) ; bar.collapse ( start , end , true ) ; return bar ; }
Source:
public static java.util.Map < java.lang.String , java.lang.String > toSoyData ( org.eclipse.jgit.lib.PersonIdent ident , org.eclipse.jgit.util.GitDateFormatter df ) { return com.google.common.collect.ImmutableMap.of ( "name" , ident.getName ( ) , "email" , ident.getEmailAddress ( ) , "time" , df.formatDate ( ident ) , "relativeTime" , org.eclipse.jgit.util.RelativeDateFormatter.format ( ident.getWhen ( ) ) ) ; }

Target:
public static java.util.Map < java.lang.String , java.lang.String > toSoyData ( org.eclipse.jgit.lib.PersonIdent ident , com.google.gitiles.DateFormatterBuilder.DateFormatter df ) { return com.google.common.collect.ImmutableMap.of ( "name" , ident.getName ( ) , "email" , ident.getEmailAddress ( ) , "time" , df.format ( ident ) , "relativeTime" , org.eclipse.jgit.util.RelativeDateFormatter.format ( ident.getWhen ( ) ) ) ; }
Source:
private void initContext ( com.google.gwt.user.client.ui.ListBox context ) { for ( final short v : com.google.gerrit.reviewdb.client.AccountDiffPreference.CONTEXT_CHOICES ) { final java.lang.String label ; if ( v == ( com.google.gerrit.reviewdb.client.AccountDiffPreference.WHOLE_FILE_CONTEXT ) ) { label = Util.C.contextWholeFile ( ) ; } else { label = Util.M.lines ( v ) ; } context.addItem ( label , java.lang.String.valueOf ( v ) ) ; } }

Target:
private void initContext ( com.google.gwt.user.client.ui.ListBox context ) { for ( final short v : com.google.gerrit.extensions.client.DiffPreferencesInfo.CONTEXT_CHOICES ) { final java.lang.String label ; if ( v == ( com.google.gerrit.extensions.client.DiffPreferencesInfo.WHOLE_FILE_CONTEXT ) ) { label = Util.C.contextWholeFile ( ) ; } else { label = Util.M.lines ( v ) ; } context.addItem ( label , java.lang.String.valueOf ( v ) ) ; } }
Source:
public void currentRevision ( ) throws java.lang.Exception { com.google.gerrit.server.change.ChangeJson.ChangeInfo c = getChange ( changeId , com.google.gerrit.common.changes.ListChangesOption.CURRENT_REVISION ) ; org.junit.Assert.assertEquals ( commitId ( 2 ) , c.current_revision ) ; org.junit.Assert.assertEquals ( com.google.common.collect.ImmutableSet.of ( commitId ( 2 ) ) , c.revisions.keySet ( ) ) ; org.junit.Assert.assertEquals ( 3 , c.revisions.get ( commitId ( 2 ) ) . _number ) ; }

Target:
public void currentRevision ( ) throws java.lang.Exception { com.google.gerrit.server.change.ChangeJson.ChangeInfo c = getChange ( changeId , com.google.gerrit.extensions.common.ListChangesOption.CURRENT_REVISION ) ; org.junit.Assert.assertEquals ( commitId ( 2 ) , c.current_revision ) ; org.junit.Assert.assertEquals ( com.google.common.collect.ImmutableSet.of ( commitId ( 2 ) ) , c.revisions.keySet ( ) ) ; org.junit.Assert.assertEquals ( 3 , c.revisions.get ( commitId ( 2 ) ) . _number ) ; }
Source:
public java.util.SortedSet < com.google.gerrit.reviewdb.client.Project.NameKey > list ( ) { java.util.SortedSet < com.google.gerrit.reviewdb.client.Project.NameKey > names = new java.util.TreeSet < com.google.gerrit.reviewdb.client.Project.NameKey > ( ) ; scanProjects ( basePath , "" , names ) ; return java.util.Collections.unmodifiableSortedSet ( names ) ; }

Target:
private void onCreateProject ( final com.google.gerrit.reviewdb.client.Project.NameKey newProjectName ) { namesUpdateLock.lock ( ) ; try { java.util.SortedSet < com.google.gerrit.reviewdb.client.Project.NameKey > n = new java.util.TreeSet < com.google.gerrit.reviewdb.client.Project.NameKey > ( names ) ; n.add ( newProjectName ) ; names = java.util.Collections.unmodifiableSortedSet ( n ) ; } finally { namesUpdateLock.unlock ( ) ; } }
Source:
public void newPatchSetByOtherOnReviewableChangeOwnerSelfCcNotifyOwnerInNoteDb ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isTrue ( ) ; com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) ; pushTo ( sc , "refs/for/master%notify=OWNER" , other , EmailStrategy.CC_ON_OWN_COMMENTS ) ; assertThat ( sender ) . sent ( "newpatchset" , sc ) . to ( sc.owner ) . to ( sc.reviewer ) . cc ( sc.ccer ) . notTo ( sc.starrer , other ) . notTo ( sc.reviewerByEmail , sc.ccerByEmail ) . notTo ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) ; }

Target:
public void newPatchSetByOtherOnReviewableChangeOwnerSelfCcNotifyOwner ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) ; pushTo ( sc , "refs/for/master%notify=OWNER" , other , EmailStrategy.CC_ON_OWN_COMMENTS ) ; assertThat ( sender ) . notSent ( ) ; }
Source:
public void setParent_Forbidden ( ) throws com.jcraft.jsch.JSchException , java.io.IOException { java.lang.String parent = "parent" ; com.google.gerrit.acceptance.GitUtil.createProject ( sshSession , parent , null , true ) ; com.google.gerrit.acceptance.RestResponse r = userSession.put ( ( ( "/projects/" + ( project ) ) + "/parent" ) , new com.google.gerrit.acceptance.rest.project.SetParentIT.ParentInput ( parent ) ) ; org.junit.Assert.assertEquals ( HttpStatus.SC_FORBIDDEN , r.getStatusCode ( ) ) ; r.consume ( ) ; }

Target:
public void setParent_Forbidden ( ) throws com.jcraft.jsch.JSchException , java.io.IOException { java.lang.String parent = "parent" ; com.google.gerrit.acceptance.GitUtil.createProject ( sshSession , parent , null , true ) ; com.google.gerrit.acceptance.RestResponse r = userSession.put ( ( ( "/projects/" + ( project ) ) + "/parent" ) , newParentInput ( parent ) ) ; org.junit.Assert.assertEquals ( HttpStatus.SC_FORBIDDEN , r.getStatusCode ( ) ) ; r.consume ( ) ; }
Source:
public void delete ( com.google.gerrit.server.query.change.ChangeData cd ) throws java.io.IOException { org.apache.lucene.index.Term id = idTerm ( cd ) ; if ( readOnly ) { return ; } if ( cd.getChange ( ) . getStatus ( ) . isOpen ( ) ) { openIndex.delete ( id ) ; } else { closedIndex.delete ( id ) ; } }

Target:
public com.google.common.util.concurrent.ListenableFuture < java.lang.Void > delete ( com.google.gerrit.server.query.change.ChangeData cd ) throws java.io.IOException { org.apache.lucene.index.Term id = com.google.gerrit.lucene.QueryBuilder.idTerm ( cd ) ; if ( readOnly ) { return com.google.common.util.concurrent.Futures.immediateFuture ( null ) ; } return com.google.gerrit.lucene.LuceneChangeIndex.allOf ( openIndex.delete ( id ) , closedIndex.delete ( id ) ) ; }
Source:
private < T > org.elasticsearch.index.query.BoolQueryBuilder and ( com.google.gerrit.server.query.Predicate < T > p ) throws com.google.gerrit.index.query.QueryParseException { try { org.elasticsearch.index.query.BoolQueryBuilder b = org.elasticsearch.index.query.QueryBuilders.boolQuery ( ) ; for ( com.google.gerrit.server.query.Predicate < T > c : p.getChildren ( ) ) { b.must ( toQueryBuilder ( c ) ) ; } return b ; } catch ( org.apache.lucene.search.BooleanQuery e ) { throw new com.google.gerrit.index.query.QueryParseException ( ( "cannot create query for index: " + p ) , e ) ; } }

Target:
private < T > org.elasticsearch.index.query.BoolQueryBuilder and ( com.google.gerrit.index.query.Predicate < T > p ) throws com.google.gerrit.index.query.QueryParseException { try { org.elasticsearch.index.query.BoolQueryBuilder b = org.elasticsearch.index.query.QueryBuilders.boolQuery ( ) ; for ( com.google.gerrit.index.query.Predicate < T > c : p.getChildren ( ) ) { b.must ( toQueryBuilder ( c ) ) ; } return b ; } catch ( org.apache.lucene.search.BooleanQuery e ) { throw new com.google.gerrit.index.query.QueryParseException ( ( "cannot create query for index: " + p ) , e ) ; } }
Source:
protected void configureServlets ( ) { java.lang.Class < ? extends javax.servlet.Filter > authFilter ; if ( authConfig.isTrustContainerAuth ( ) ) { authFilter = com.google.gerrit.httpd.ContainerAuthFilter.class ; } else if ( authConfig.isGitBasichAuth ( ) ) { authFilter = com.google.gerrit.httpd.ProjectBasicAuthFilter.class ; } else { authFilter = com.google.gerrit.httpd.ProjectDigestFilter.class ; } java.lang.String git = GitOverHttpServlet.URL_REGEX ; filterRegex ( git ) . through ( authFilter ) ; serveRegex ( git ) . with ( com.google.gerrit.httpd.GitOverHttpServlet.class ) ; filter ( "/a/*" ) . through ( authFilter ) ; }

Target:
protected void configureServlets ( ) { java.lang.Class < ? extends javax.servlet.Filter > authFilter ; if ( authConfig.isTrustContainerAuth ( ) ) { authFilter = com.google.gerrit.httpd.ContainerAuthFilter.class ; } else if ( authConfig.isGitBasicAuth ( ) ) { authFilter = com.google.gerrit.httpd.ProjectBasicAuthFilter.class ; } else { authFilter = com.google.gerrit.httpd.ProjectDigestFilter.class ; } java.lang.String git = GitOverHttpServlet.URL_REGEX ; filterRegex ( git ) . through ( authFilter ) ; serveRegex ( git ) . with ( com.google.gerrit.httpd.GitOverHttpServlet.class ) ; filter ( "/a/*" ) . through ( authFilter ) ; }
Source:
public void listProjects ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Project.NameKey someProject = new com.google.gerrit.reviewdb.client.Project.NameKey ( "some-project" ) ; com.google.gerrit.acceptance.GitUtil.createProject ( sshSession , someProject.get ( ) ) ; com.google.gerrit.acceptance.RestResponse r = GET ( "/projects/" ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( HttpStatus.SC_OK ) ; java.util.Map < java.lang.String , com.google.gerrit.extensions.common.ProjectInfo > result = com.google.gerrit.acceptance.rest.project.ListProjectsIT.toProjectInfoMap ( r ) ; com.google.gerrit.acceptance.rest.project.ProjectAssert.assertProjects ( java.util.Arrays.asList ( allUsers , someProject , project ) , result.values ( ) ) ; }

Target:
public void listProjects ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Project.NameKey someProject = new com.google.gerrit.reviewdb.client.Project.NameKey ( "some-project" ) ; createProject ( someProject.get ( ) ) ; com.google.gerrit.acceptance.rest.project.ProjectAssert.assertThatNameList ( gApi.projects ( ) . list ( ) . get ( ) ) . containsExactly ( allProjects , allUsers , project , someProject ) . inOrder ( ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { site = new com.google.gerrit.server.config.SitePaths ( com.google.gerrit.testutil.TempFileUtil.createTempDirectory ( ) . toPath ( ) ) ; site.resolve ( "git" ) . toFile ( ) . mkdir ( ) ; cfg = new org.eclipse.jgit.lib.Config ( ) ; cfg.setString ( "gerrit" , null , "basePath" , "git" ) ; repoManager = new com.google.gerrit.server.git.LocalDiskRepositoryManager ( site , cfg ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { site = new com.google.gerrit.server.config.SitePaths ( com.google.gerrit.testing.TempFileUtil.createTempDirectory ( ) . toPath ( ) ) ; site.resolve ( "git" ) . toFile ( ) . mkdir ( ) ; cfg = new org.eclipse.jgit.lib.Config ( ) ; cfg.setString ( "gerrit" , null , "basePath" , "git" ) ; repoManager = new com.google.gerrit.server.git.LocalDiskRepositoryManager ( site , cfg ) ; }
Source:
protected void onLoad ( ) { super . onLoad ( ) ; addPanel.setVisible ( false ) ; com.google.gerrit.client.account.AccountApi.canCreateRefs ( "self" , getProjectKey ( ) , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.VoidResult > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.VoidResult result ) { addPanel.setVisible ( true ) ; } } ) ; refreshBranches ( ) ; savedPanel = BRANCH ; }

Target:
protected void onLoad ( ) { super . onLoad ( ) ; addPanel.setVisible ( false ) ; com.google.gerrit.client.access.AccessMap.get ( getProjectKey ( ) , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.access.ProjectAccessInfo > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.access.ProjectAccessInfo result ) { addPanel.setVisible ( result.canAddRefs ( ) ) ; } } ) ; refreshBranches ( ) ; savedPanel = BRANCH ; }
Source:
public void onPluginLoad ( ) { com.google.gerrit.plugin.client.Plugin.get ( ) . screen ( "" , new com.googlesource.gerrit.plugins.cookbook.client.IndexScreen.Factory ( ) ) ; com.google.gerrit.plugin.client.Plugin.get ( ) . panel ( GerritUiExtensionPoint.PROFILE_SCREEN_BOTTOM , new com.googlesource.gerrit.plugins.cookbook.client.CookBookProfileExtension.Factory ( ) ) ; com.google.gerrit.plugin.client.Plugin.get ( ) . panel ( GerritUiExtensionPoint.CHANGE_SCREEN_BELOW_CHANGE_INFO_BLOCK , new com.googlesource.gerrit.plugins.cookbook.client.CookBookChangeScreenExtension.Factory ( ) ) ; }

Target:
public void onPluginLoad ( ) { com.google.gerrit.plugin.client.Plugin.get ( ) . screen ( "" , new com.googlesource.gerrit.plugins.cookbook.client.IndexScreen.Factory ( ) ) ; com.google.gerrit.plugin.client.Plugin.get ( ) . panel ( GerritUiExtensionPoint.PROFILE_SCREEN_BOTTOM , new com.googlesource.gerrit.plugins.cookbook.client.CookBookProfileExtension.Factory ( ) ) ; com.google.gerrit.plugin.client.Plugin.get ( ) . panel ( GerritUiExtensionPoint.CHANGE_SCREEN_BELOW_CHANGE_INFO_BLOCK , new com.googlesource.gerrit.plugins.cookbook.client.CookBookChangeScreenExtension.Factory ( ) ) ; com.google.gerrit.plugin.client.Plugin.get ( ) . panel ( GerritUiExtensionPoint.CHANGE_SCREEN_HEADER , new com.googlesource.gerrit.plugins.cookbook.client.ChangeScreenStatusExtension.Factory ( ) ) ; }
Source:
public void getChildProject ( ) throws java.lang.Exception { com.google.gerrit.acceptance.SshSession sshSession = new com.google.gerrit.acceptance.SshSession ( server , admin ) ; com.google.gerrit.reviewdb.client.Project.NameKey child = new com.google.gerrit.reviewdb.client.Project.NameKey ( "p1" ) ; createProject ( child.get ( ) ) ; sshSession.close ( ) ; com.google.gerrit.extensions.common.ProjectInfo childInfo = gApi.projects ( ) . name ( allProjects.get ( ) ) . child ( child.get ( ) ) . get ( ) ; com.google.gerrit.acceptance.rest.project.ProjectAssert.assertProjectInfo ( projectCache.get ( child ) . getProject ( ) , childInfo ) ; }

Target:
public void getGrandChildProject_NotFound ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Project.NameKey child = createProject ( "p1" ) ; com.google.gerrit.reviewdb.client.Project.NameKey grandChild = createProject ( "p1.1" , child ) ; assertChildNotFound ( allProjects , grandChild.get ( ) ) ; }
Source:
private static synchronized void scheduleImp ( final com.google.gerrit.client.reviewdb.Project.NameKey project , final java.lang.String ref , final com.google.gerrit.git.PushQueue.ReplicationConfig config , final org.spearce.jgit.transport.URIish uri ) { com.google.gerrit.git.PushOp e = com.google.gerrit.git.PushQueue.pending.get ( uri ) ; if ( e == null ) { e = new com.google.gerrit.git.PushOp ( project.get ( ) , config.remote , uri ) ; com.google.gerrit.git.WorkQueue.schedule ( e , config.delay , java.util.concurrent.TimeUnit.SECONDS ) ; com.google.gerrit.git.PushQueue.pending.put ( uri , e ) ; } e.addRef ( ref ) ; }

Target:
void schedule ( final com.google.gerrit.client.reviewdb.Project.NameKey project , final java.lang.String ref , final org.spearce.jgit.transport.URIish uri ) { synchronized ( pending ) { com.google.gerrit.git.PushOp e = pending.get ( uri ) ; if ( e == null ) { e = new com.google.gerrit.git.PushOp ( this , project.get ( ) , remote , uri ) ; pool.schedule ( e , delay , java.util.concurrent.TimeUnit.SECONDS ) ; pending.put ( uri , e ) ; } e.addRef ( ref ) ; } }
Source:
private void assertNoIncludes ( java.lang.String group ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.AccountGroup g = groupCache.get ( new com.google.gerrit.reviewdb.client.AccountGroup.NameKey ( group ) ) ; java.util.Iterator < com.google.gerrit.reviewdb.client.AccountGroupById > it = db.accountGroupById ( ) . byGroup ( g.getId ( ) ) . iterator ( ) ; com.google.common.truth.Truth.assertThat ( it.hasNext ( ) ) . isFalse ( ) ; }

Target:
private void assertMembers ( java.lang.String group , com.google.gerrit.acceptance.TestAccount ... members ) throws java.lang.Exception { com.google.gerrit.acceptance.rest.account.AccountAssert.assertAccountInfos ( java.util.Arrays.asList ( members ) , gApi.groups ( ) . id ( group ) . members ( ) ) ; }
Source:
void onSave ( @ java.lang.SuppressWarnings ( value = "unused" ) com.google.gwt.event.dom.client.ClickEvent e ) { com.google.gerrit.client.changes.ChangeFileApi.putContentOrMessage ( revision , path , cm.getValue ( ) , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.VoidResult > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.VoidResult result ) { com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChangeInEditMode ( revision.getParentKey ( ) ) ) ; } } ) ; }

Target:
void onSave ( @ java.lang.SuppressWarnings ( value = "unused" ) com.google.gwt.event.dom.client.ClickEvent e ) { save ( ) . run ( ) ; }
Source:
public void onSuccess ( com.google.gerrit.common.data.com.google.gerrit.client.changes.ChangeInfo result ) { changeInfo = result ; display ( event.getValue ( ) ) ; }

Target:
public void onSuccess ( com.google.gerrit.common.data.com.google.gerrit.client.changes.ChangeInfo result ) { changeInfo = result ; cbs2.addFinal ( new com.google.gwt.user.client.rpc.AsyncCallback < java.lang.Void > ( ) { @ java.lang.Override public void onSuccess ( java.lang.Void result ) { display ( event.getValue ( ) ) ; } public void onFailure ( java.lang.Throwable caught ) { } } ) . onSuccess ( null ) ; }
Source:
private < K , V > com.google.gerrit.server.cache.UnnamedCacheBinding < K , V > disk ( final com.google.inject.Key < com.google.gerrit.server.cache.Cache < K , V > > key ) { final boolean disk = true ; final com.google.gerrit.server.cache.CacheProvider < K , V > b = new com.google.gerrit.server.cache.CacheProvider < K , V > ( disk , this ) ; bind ( key ) . toProvider ( b ) . in ( Scopes.SINGLETON ) ; return b ; }

Target:
private < K , V > com.google.gerrit.server.cache.UnnamedCacheBinding < K , V > disk ( final com.google.inject.Key < com.google.gerrit.server.cache.Cache < K , V > > key , final com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < K , V > > type ) { final boolean disk = true ; final com.google.gerrit.server.cache.CacheProvider < K , V > b = new com.google.gerrit.server.cache.CacheProvider < K , V > ( disk , this , type ) ; bind ( key ) . toProvider ( b ) . in ( Scopes.SINGLETON ) ; return b ; }
Source:
public void onSuccess ( com.googlesource.gerrit.plugins.imagare.client.ConfigInfo info ) { com.googlesource.gerrit.plugins.imagare.client.ImageUploadScreen.projectBox.setValue ( info.getDefaultProject ( ) ) ; }

Target:
public void onSuccess ( com.googlesource.gerrit.plugins.imagare.client.ConfigInfo info ) { com.googlesource.gerrit.plugins.imagare.client.ImageUploader.setStage ( info.stage ( ) ) ; java.lang.String project = com.googlesource.gerrit.plugins.imagare.client.ImageUploadScreen.getParameter ( "project" ) ; if ( project != null ) { com.googlesource.gerrit.plugins.imagare.client.ImageUploadScreen.projectBox.setValue ( project ) ; } else { com.googlesource.gerrit.plugins.imagare.client.ImageUploadScreen.projectBox.setValue ( info.getDefaultProject ( ) ) ; } }
Source:
public void byPathRegex ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < com.google.gerrit.testutil.InMemoryRepositoryManager.Repo > repo = createProject ( "repo" ) ; org.eclipse.jgit.revwalk.RevCommit commit = repo.parseBody ( repo.commit ( ) . message ( "one" ) . add ( "dir/file1" , "contents1" ) . add ( "dir/file2" , "contents2" ) . create ( ) ) ; com.google.gerrit.reviewdb.client.Change change = insert ( newChange ( repo , commit , null , null , null ) ) ; assertQuery ( "path:.*file.*" ) ; assertQuery ( "path:^dir.file.*" , change ) ; }

Target:
public void byPathRegex ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < com.google.gerrit.testutil.InMemoryRepositoryManager.Repo > repo = createProject ( "repo" ) ; org.eclipse.jgit.revwalk.RevCommit commit = repo.parseBody ( repo.commit ( ) . message ( "one" ) . add ( "dir/file1" , "contents1" ) . add ( "dir/file2" , "contents2" ) . create ( ) ) ; com.google.gerrit.reviewdb.client.Change change = insert ( newChangeForCommit ( repo , commit ) ) ; assertQuery ( "path:.*file.*" ) ; assertQuery ( "path:^dir.file.*" , change ) ; }