auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void byId ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < com.google.gerrit.testutil.InMemoryRepositoryManager.Repo > repo = createProject ( "repo" ) ; com.google.gerrit.reviewdb.client.Change change1 = insert ( newChange ( repo , null , null , null , null ) ) ; com.google.gerrit.reviewdb.client.Change change2 = insert ( newChange ( repo , null , null , null , null ) ) ; assertQuery ( "12345" ) ; assertQuery ( change1.getId ( ) . get ( ) , change1 ) ; assertQuery ( change2.getId ( ) . get ( ) , change2 ) ; }

Target:
public void byId ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < com.google.gerrit.testutil.InMemoryRepositoryManager.Repo > repo = createProject ( "repo" ) ; com.google.gerrit.reviewdb.client.Change change1 = insert ( newChange ( repo ) ) ; com.google.gerrit.reviewdb.client.Change change2 = insert ( newChange ( repo ) ) ; assertQuery ( "12345" ) ; assertQuery ( change1.getId ( ) . get ( ) , change1 ) ; assertQuery ( change2.getId ( ) . get ( ) , change2 ) ; }
Source:
protected PushOneCommit.Result amendChange ( java.lang.String changeId ) throws java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { java.util.Collections.shuffle ( com.google.gerrit.acceptance.AbstractDaemonTest.RANDOM ) ; com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , admin.getIdent ( ) , PushOneCommit.SUBJECT , PushOneCommit.FILE_NAME , new java.lang.String ( com.google.common.primitives.Chars.toArray ( com.google.gerrit.acceptance.AbstractDaemonTest.RANDOM ) ) , changeId ) ; return push.to ( git , "refs/for/master" ) ; }

Target:
protected PushOneCommit.Result amendChange ( java.lang.String changeId , java.lang.String ref ) throws java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { java.util.Collections.shuffle ( com.google.gerrit.acceptance.AbstractDaemonTest.RANDOM ) ; com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , admin.getIdent ( ) , PushOneCommit.SUBJECT , PushOneCommit.FILE_NAME , new java.lang.String ( com.google.common.primitives.Chars.toArray ( com.google.gerrit.acceptance.AbstractDaemonTest.RANDOM ) ) , changeId ) ; return push.to ( git , ref ) ; }
Source:
public void commentOnReviewableChangeByOwnerCcingSelf ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; setApiUser ( sc.owner ) ; review ( sc.changeId , com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy.CC_ON_OWN_COMMENTS ) ; assertThat ( sender ) . sent ( "comment" , sc ) . to ( sc.owner ) . to ( sc.reviewerByEmail ) . cc ( sc.reviewer , sc.ccer ) . cc ( sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; }

Target:
public void commentOnReviewableChangeByOwnerCcingSelf ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; review ( sc.owner , sc.changeId , com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy.CC_ON_OWN_COMMENTS ) ; assertThat ( sender ) . sent ( "comment" , sc ) . to ( sc.owner ) . to ( sc.reviewerByEmail ) . cc ( sc.reviewer , sc.ccer ) . cc ( sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; }
Source:
public void testPatchLineCommentsUtilByCommentStatus ( ) throws com.google.gwtorm.server.OrmException { com.google.common.truth.Truth.assertThat ( plcUtil.publishedByChange ( db , revRes2.getNotes ( ) ) ) . containsExactly ( plc1 , plc2 , plc3 ) . inOrder ( ) ; com.google.common.truth.Truth.assertThat ( plcUtil.draftByChange ( db , revRes2.getNotes ( ) ) ) . containsExactly ( plc4 , plc5 ) . inOrder ( ) ; }

Target:
public void testPatchLineCommentsUtilByCommentStatus ( ) throws com.google.gwtorm.server.OrmException { com.google.common.truth.Truth.assertThat ( plcUtil.publishedByChange ( db , revRes2.getNotes ( ) ) ) . containsExactly ( plc3 , plc1 , plc2 ) . inOrder ( ) ; com.google.common.truth.Truth.assertThat ( plcUtil.draftByChange ( db , revRes2.getNotes ( ) ) ) . containsExactly ( plc4 , plc5 ) . inOrder ( ) ; }
Source:
public void onSuccess ( java.lang.Void result ) { if ( prefs.syntaxHighlighting ( ) ) { cmA.setOption ( "mode" , getContentType ( diff.meta_a ( ) ) ) ; cmB.setOption ( "mode" , getContentType ( diff.meta_b ( ) ) ) ; } }

Target:
java.lang.String getContentType ( ) { return getContentType ( diff.meta_b ( ) ) ; }
Source:
public void close ( ) { newTree = null ; if ( ( inserter ) != null ) { inserter.release ( ) ; inserter = null ; } if ( ( reader ) != null ) { reader.release ( ) ; reader = null ; } }

Target:
public void close ( ) { newTree = null ; if ( ( inserter ) != null ) { inserter.close ( ) ; inserter = null ; } if ( ( reader ) != null ) { reader.close ( ) ; reader = null ; } }
Source:
public void submit ( ) throws com.google.gerrit.extensions.restapi.RestApiException , java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { com.google.gerrit.acceptance.git.PushOneCommit.Result r = createChange ( ) ; com.google.gerrit.extensions.api.changes.RevisionApi rApi = gApi.changes ( ) . id ( ( "p~master~" + ( r.getChangeId ( ) ) ) ) . current ( ) ; rApi.review ( com.google.gerrit.acceptance.api.revision.RevisionIT.approve ( ) ) ; rApi.submit ( ) ; }

Target:
public void submit ( ) throws com.google.gerrit.extensions.restapi.RestApiException , java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { com.google.gerrit.acceptance.git.PushOneCommit.Result r = createChange ( ) ; gApi.changes ( ) . id ( ( "p~master~" + ( r.getChangeId ( ) ) ) ) . current ( ) . review ( com.google.gerrit.acceptance.api.revision.RevisionIT.approve ( ) ) ; gApi.changes ( ) . id ( ( "p~master~" + ( r.getChangeId ( ) ) ) ) . current ( ) . submit ( ) ; }
Source:
public void listBranchesSomeHidden ( ) throws com.google.gwtorm.server.OrmException , com.jcraft.jsch.JSchException , java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException , org.eclipse.jgit.errors.ConfigInvalidException { blockRead ( project , "refs/heads/dev" ) ; com.google.gerrit.acceptance.RestSession session = new com.google.gerrit.acceptance.RestSession ( accounts.create ( "user" , "user@example.com" , "User" ) ) ; pushTo ( "refs/heads/master" ) ; java.lang.String masterCommit = git.getRepository ( ) . getRef ( "master" ) . getTarget ( ) . getObjectId ( ) . getName ( ) ; pushTo ( "refs/heads/dev" ) ; com.google.gerrit.acceptance.RestResponse r = session.get ( ( ( "/projects/" + ( project.get ( ) ) ) + "/branches" ) ) ; java.util.List < com.google.gerrit.acceptance.rest.project.BranchInfo > result = new com.google.gson.Gson ( ) . fromJson ( r.getReader ( ) , new com.google.gson.reflect.TypeToken < java.util.List < com.google.gerrit.acceptance.rest.project.BranchInfo > > ( ) { } . getType ( ) ) ; java.util.List < com.google.gerrit.acceptance.rest.project.BranchInfo > expected = com.google.common.collect.Lists.asList ( new com.google.gerrit.acceptance.rest.project.BranchInfo ( "HEAD" , "master" , false ) , new com.google.gerrit.acceptance.rest.project.BranchInfo [ ] { new com.google.gerrit.acceptance.rest.project.BranchInfo ( "refs/heads/master" , masterCommit , false ) } ) ; com.google.gerrit.acceptance.rest.project.BranchAssert.assertBranches ( expected , result ) ; }

Target:
public void listBranchesSomeHidden ( ) throws com.google.gwtorm.server.OrmException , com.jcraft.jsch.JSchException , java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException , org.eclipse.jgit.errors.ConfigInvalidException { blockRead ( project , "refs/heads/dev" ) ; com.google.gerrit.acceptance.RestSession session = new com.google.gerrit.acceptance.RestSession ( server , accounts.create ( "user" , "user@example.com" , "User" ) ) ; pushTo ( "refs/heads/master" ) ; java.lang.String masterCommit = git.getRepository ( ) . getRef ( "master" ) . getTarget ( ) . getObjectId ( ) . getName ( ) ; pushTo ( "refs/heads/dev" ) ; com.google.gerrit.acceptance.RestResponse r = session.get ( ( ( "/projects/" + ( project.get ( ) ) ) + "/branches" ) ) ; java.util.List < com.google.gerrit.acceptance.rest.project.BranchInfo > result = new com.google.gson.Gson ( ) . fromJson ( r.getReader ( ) , new com.google.gson.reflect.TypeToken < java.util.List < com.google.gerrit.acceptance.rest.project.BranchInfo > > ( ) { } . getType ( ) ) ; java.util.List < com.google.gerrit.acceptance.rest.project.BranchInfo > expected = com.google.common.collect.Lists.asList ( new com.google.gerrit.acceptance.rest.project.BranchInfo ( "HEAD" , "master" , false ) , new com.google.gerrit.acceptance.rest.project.BranchInfo [ ] { new com.google.gerrit.acceptance.rest.project.BranchInfo ( "refs/heads/master" , masterCommit , false ) } ) ; com.google.gerrit.acceptance.rest.project.BranchAssert.assertBranches ( expected , result ) ; }
Source:
public static void next ( java.lang.String query , int start , int limit , java.util.Set < com.google.gerrit.extensions.client.ListChangesOption > options , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.changes.ChangeList > callback ) { com.google.gerrit.client.rpc.RestApi call = com.google.gerrit.client.changes.ChangeList.newQuery ( query ) ; if ( limit > 0 ) { call.addParameter ( "n" , limit ) ; } com.google.gerrit.client.changes.ChangeList.addOptions ( call , options ) ; if ( start != 0 ) { call.addParameter ( "S" , start ) ; } call.get ( callback ) ; }

Target:
public static void query ( java.lang.String query , java.util.Set < com.google.gerrit.extensions.client.ListChangesOption > options , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.changes.ChangeList > callback , int start , int limit ) { com.google.gerrit.client.rpc.RestApi call = com.google.gerrit.client.changes.ChangeList.newQuery ( query ) ; if ( limit > 0 ) { call.addParameter ( "n" , limit ) ; } com.google.gerrit.client.changes.ChangeList.addOptions ( call , options ) ; if ( start != 0 ) { call.addParameter ( "S" , start ) ; } call.get ( callback ) ; }
Source:
public void noChangeMessage ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = newChange ( ) ; com.google.gerrit.server.notedb.ChangeUpdate update = newUpdate ( c , changeOwner ) ; update.putReviewer ( changeOwner.getAccount ( ) . getId ( ) , com.google.gerrit.server.notedb.ReviewerStateInternal.REVIEWER ) ; update.commit ( ) ; assertBodyEquals ( ( "Update patch set 1\n" + ( ( "\n" + "Patch-set: 1\n" ) + "Reviewer: Change Owner <1@gerrit>\n" ) ) , update.getResult ( ) ) ; }

Target:
public void noChangeMessage ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = newChange ( ) ; com.google.gerrit.server.notedb.ChangeUpdate update = newUpdate ( c , changeOwner ) ; update.putReviewer ( changeOwner.getAccount ( ) . getId ( ) , com.google.gerrit.server.notedb.ReviewerStateInternal.REVIEWER ) ; update.commit ( ) ; assertBodyEquals ( "Update patch set 1\n\nPatch-set: 1\nReviewer: Change Owner <1@gerrit>\n" , update.getResult ( ) ) ; }
Source:
public com.google.gerrit.server.project.ChildProjectResource parse ( com.google.gerrit.server.project.ProjectResource parent , com.google.gerrit.extensions.restapi.IdString id ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException , java.io.IOException { com.google.gerrit.server.project.ProjectResource p = projectsCollection.get ( ) . parse ( TopLevelResource.INSTANCE , id ) ; for ( com.google.gerrit.server.project.ProjectState pp : p.getControl ( ) . getProjectState ( ) . parents ( ) ) { if ( parent.getNameKey ( ) . equals ( pp.getProject ( ) . getNameKey ( ) ) ) { return new com.google.gerrit.server.project.ChildProjectResource ( parent , p.getControl ( ) ) ; } } throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( id ) ; }

Target:
public com.google.gerrit.server.project.ChildProjectResource parse ( com.google.gerrit.server.project.ProjectResource parent , com.google.gerrit.extensions.restapi.IdString id ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException , java.io.IOException { com.google.gerrit.server.project.ProjectResource p = projectsCollection.parse ( TopLevelResource.INSTANCE , id ) ; for ( com.google.gerrit.server.project.ProjectState pp : p.getControl ( ) . getProjectState ( ) . parents ( ) ) { if ( parent.getNameKey ( ) . equals ( pp.getProject ( ) . getNameKey ( ) ) ) { return new com.google.gerrit.server.project.ChildProjectResource ( parent , p.getControl ( ) ) ; } } throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( id ) ; }
Source:
private void insertDummyApproval ( final com.google.gerrit.sshd.commands.Receive.ReplaceResult result , final com.google.gerrit.reviewdb.Account.Id forAccount , final com.google.gerrit.reviewdb.ApprovalCategory.Id catId , final com.google.gerrit.reviewdb.ReviewDb db , final com.google.gwtorm.client.Transaction txn ) throws com.google.gwtorm.client.OrmException { insertDummyApproval ( result.change , result.patchSet.getId ( ) , forAccount , catId , db , txn ) ; }

Target:
private void insertDummyApproval ( final com.google.gerrit.sshd.commands.Receive.ReplaceResult result , final com.google.gerrit.reviewdb.Account.Id forAccount , final com.google.gerrit.reviewdb.ApprovalCategory.Id catId , final com.google.gerrit.reviewdb.ReviewDb db ) throws com.google.gwtorm.client.OrmException { insertDummyApproval ( result.change , result.patchSet.getId ( ) , forAccount , catId , db ) ; }
Source:
private java.lang.String setTopic ( java.lang.String sourceId , java.lang.String topic ) throws com.google.gerrit.extensions.restapi.RestApiException { if ( ( topic == null ) || ( topic.isEmpty ( ) ) ) { topic = "am-" + ( java.util.UUID.randomUUID ( ) . toString ( ) ) ; com.googlesource.gerrit.plugins.automerger.DownstreamCreator.log.debug ( "Setting original change topic to {}" , sourceId , topic ) ; gApi.changes ( ) . id ( sourceId ) . topic ( topic ) ; } return topic ; }

Target:
private java.lang.String setTopic ( int sourceId , java.lang.String topic ) throws com.google.gerrit.extensions.restapi.RestApiException { if ( ( topic == null ) || ( topic.isEmpty ( ) ) ) { topic = "am-" + ( java.util.UUID.randomUUID ( ) . toString ( ) ) ; com.googlesource.gerrit.plugins.automerger.DownstreamCreator.log.debug ( "Setting original change topic to {}" , sourceId , topic ) ; gApi.changes ( ) . id ( sourceId ) . topic ( topic ) ; } return topic ; }
Source:
public void wrongKeyId ( ) throws java.lang.Exception { com.google.gerrit.server.git.gpg.TestKey k = com.google.gerrit.server.git.gpg.TestKey.key1 ( ) ; long badId = ( k.getKeyId ( ) ) + 1 ; com.google.gerrit.server.git.gpg.CheckResult result = checker.check ( k.getPublicKey ( ) , badId , k.getFirstUserId ( ) ) ; org.junit.Assert.assertEquals ( java.util.Arrays.asList ( "Public key does not match ID 46328A8D" ) , result.getProblems ( ) ) ; }

Target:
public void wrongKeyId ( ) throws java.lang.Exception { com.google.gerrit.server.git.gpg.TestKey k = com.google.gerrit.server.git.gpg.TestKey.key1 ( ) ; long badId = ( k.getKeyId ( ) ) + 1 ; com.google.gerrit.server.git.gpg.CheckResult result = checker.check ( k.getPublicKey ( ) , badId ) ; org.junit.Assert.assertEquals ( java.util.Arrays.asList ( "Public key does not match ID 46328A8D" ) , result.getProblems ( ) ) ; }
Source:
private static java.util.Collection < com.google.gerrit.server.account.WatchConfig.ProjectWatchKey > getWatches ( com.google.gerrit.server.query.change.ChangeQueryBuilder.Arguments args ) throws com.google.gerrit.server.query.QueryParseException { com.google.gerrit.server.CurrentUser user = args.getUser ( ) ; if ( user.isIdentifiedUser ( ) ) { return args.accountCache.get ( args.getUser ( ) . getAccountId ( ) ) . getProjectWatches ( ) . keySet ( ) ; } return java.util.Collections.< com.google.gerrit.server.account.WatchConfig.ProjectWatchKey > emptySet ( ) ; }

Target:
protected static java.util.Collection < com.google.gerrit.server.account.WatchConfig.ProjectWatchKey > getWatches ( com.google.gerrit.server.query.change.ChangeQueryBuilder.Arguments args ) throws com.google.gerrit.server.query.QueryParseException { com.google.gerrit.server.CurrentUser user = args.getUser ( ) ; if ( user.isIdentifiedUser ( ) ) { return args.accountCache.get ( args.getUser ( ) . getAccountId ( ) ) . getProjectWatches ( ) . keySet ( ) ; } return java.util.Collections.< com.google.gerrit.server.account.WatchConfig.ProjectWatchKey > emptySet ( ) ; }
Source:
private void createRepository ( java.nio.file.Path directory , java.lang.String projectName ) throws java.io.IOException { java.lang.String n = projectName + ( org.eclipse.jgit.lib.Constants.DOT_GIT_EXT ) ; org.eclipse.jgit.lib.RepositoryCache.FileKey loc = org.eclipse.jgit.lib.RepositoryCache.FileKey.exact ( directory.resolve ( n ) . toFile ( ) , FS.DETECTED ) ; org.eclipse.jgit.lib.Repository db = org.eclipse.jgit.lib.RepositoryCache.open ( loc , false ) ; try { db.create ( true ) ; } finally { db.close ( ) ; } }

Target:
private void createRepository ( java.nio.file.Path directory , java.lang.String projectName ) throws java.io.IOException { java.lang.String n = projectName + ( org.eclipse.jgit.lib.Constants.DOT_GIT_EXT ) ; org.eclipse.jgit.lib.RepositoryCache.FileKey loc = org.eclipse.jgit.lib.RepositoryCache.FileKey.exact ( directory.resolve ( n ) . toFile ( ) , FS.DETECTED ) ; try ( org.eclipse.jgit.lib.Repository db = org.eclipse.jgit.lib.RepositoryCache.open ( loc , false ) ) { db.create ( true ) ; } }
Source:
private com.google.inject.AbstractModule createIndexModule ( ) { if ( slave ) { return new com.google.gerrit.server.index.DummyIndexModule ( ) ; } com.google.gerrit.server.index.IndexModule.IndexType indexType = com.google.gerrit.server.index.IndexModule.getIndexType ( cfgInjector ) ; switch ( indexType ) { case LUCENE : return ( luceneModule ) != null ? luceneModule : new com.google.gerrit.lucene.LuceneIndexModule ( ) ; default : throw new java.lang.IllegalStateException ( ( "unsupported index.type = " + indexType ) ) ; } }

Target:
private com.google.inject.AbstractModule createIndexModule ( ) { if ( slave ) { return new com.google.gerrit.server.index.DummyIndexModule ( ) ; } switch ( indexType ) { case LUCENE : return ( luceneModule ) != null ? luceneModule : new com.google.gerrit.lucene.LuceneIndexModule ( ) ; default : throw new java.lang.IllegalStateException ( ( "unsupported index.type = " + ( indexType ) ) ) ; } }
Source:
public void fire ( com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.reviewdb.client.Account.Id accountId , com.google.common.collect.ImmutableSortedSet < java.lang.String > hashtags , java.util.Set < java.lang.String > added , java.util.Set < java.lang.String > removed , java.sql.Timestamp when ) { if ( ! ( listeners.iterator ( ) . hasNext ( ) ) ) { return ; } try { fire ( util.changeInfo ( change ) , util.accountInfo ( accountId ) , hashtags , added , removed , when ) ; } catch ( com.google.gwtorm.server.OrmException e ) { com.google.gerrit.server.extensions.events.HashtagsEdited.log.error ( "Couldn't fire event" , e ) ; } }

Target:
public void fire ( com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.reviewdb.client.Account account , com.google.common.collect.ImmutableSortedSet < java.lang.String > hashtags , java.util.Set < java.lang.String > added , java.util.Set < java.lang.String > removed , java.sql.Timestamp when ) { if ( ! ( listeners.iterator ( ) . hasNext ( ) ) ) { return ; } try { fire ( util.changeInfo ( change ) , util.accountInfo ( account ) , hashtags , added , removed , when ) ; } catch ( com.google.gwtorm.server.OrmException e ) { com.google.gerrit.server.extensions.events.HashtagsEdited.log.error ( "Couldn't fire event" , e ) ; } }
Source:
public static com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > open ( com.google.inject.Provider < com.google.gerrit.reviewdb.server.ReviewDb > dbProvider ) { java.util.List < com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > > r = new java.util.ArrayList < com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > > ( 4 ) ; for ( final com.google.gerrit.reviewdb.client.Change.Status e : Change.Status.values ( ) ) { if ( e.isOpen ( ) ) { r.add ( new com.google.gerrit.server.query.change.ChangeStatusPredicate ( dbProvider , e ) ) ; } } return ( r.size ( ) ) == 1 ? r.get ( 0 ) : or ( r ) ; }

Target:
public static com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > open ( com.google.inject.Provider < com.google.gerrit.reviewdb.server.ReviewDb > dbProvider ) { java.util.List < com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > > r = new java.util.ArrayList < com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > > ( 4 ) ; for ( final com.google.gerrit.reviewdb.client.Change.Status e : Change.Status.values ( ) ) { if ( e.isOpen ( ) ) { r.add ( new com.google.gerrit.server.query.change.ChangeStatusPredicate ( e ) ) ; } } return ( r.size ( ) ) == 1 ? r.get ( 0 ) : or ( r ) ; }
Source:
public java.lang.String getSqlType ( final com.google.gwtorm.schema.ColumnModel col , final com.google.gwtorm.schema.sql.SqlDialect dialect ) { final java.lang.StringBuilder r = new java.lang.StringBuilder ( ) ; r.append ( dialect.getSqlTypeName ( getSqlTypeConstant ( ) ) ) ; if ( col.isNotNull ( ) ) { r.append ( " DEFAULT " ) ; r.append ( getSqlDefault ( ) ) ; r.append ( " NOT NULL" ) ; } return r.toString ( ) ; }

Target:
public java.lang.String getSqlType ( final com.google.gwtorm.schema.ColumnModel col , final com.google.gwtorm.schema.sql.SqlDialect dialect ) { final java.lang.StringBuilder r = new java.lang.StringBuilder ( ) ; r.append ( dialect.getSqlTypeName ( getSqlTypeConstant ( ) ) ) ; if ( col.isNotNull ( ) ) { r.append ( " NOT NULL" ) ; } return r.toString ( ) ; }
Source:
public com.google.gerrit.server.notedb.ChangeNotes create ( 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.unwrap ( db ) . changes ( ) . get ( changeId ) ; 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 new com.google.gerrit.server.notedb.ChangeNotes ( args , project , change ) . load ( ) ; }

Target:
public com.google.gerrit.server.notedb.ChangeNotes create ( 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.unwrap ( db ) . changes ( ) . get ( changeId ) ; 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 new com.google.gerrit.server.notedb.ChangeNotes ( args , change ) . load ( ) ; }
Source:
private org.eclipse.jgit.internal.storage.file.LockFile lockForDelete ( com.google.gerrit.reviewdb.client.Project.NameKey project ) throws com.google.gerrit.extensions.restapi.ResourceConflictException { java.io.File importStatus = projects.FS_LAYOUT.getImportStatusFile ( project.get ( ) ) ; org.eclipse.jgit.internal.storage.file.LockFile lockFile = new org.eclipse.jgit.internal.storage.file.LockFile ( importStatus , org.eclipse.jgit.util.FS.DETECTED ) ; try { if ( lockFile.lock ( ) ) { return lockFile ; } else { throw new com.google.gerrit.extensions.restapi.ResourceConflictException ( "project is being imported from another session" ) ; } } catch ( java.io.IOException e ) { throw new com.google.gerrit.extensions.restapi.ResourceConflictException ( "failed to lock project for delete" ) ; } }

Target:
private org.eclipse.jgit.internal.storage.file.LockFile lockForDelete ( com.google.gerrit.reviewdb.client.Project.NameKey project ) throws com.google.gerrit.extensions.restapi.ResourceConflictException { java.io.File importStatus = projects.FS_LAYOUT.getImportStatusFile ( project.get ( ) ) ; org.eclipse.jgit.internal.storage.file.LockFile lockFile = new org.eclipse.jgit.internal.storage.file.LockFile ( importStatus ) ; try { if ( lockFile.lock ( ) ) { return lockFile ; } else { throw new com.google.gerrit.extensions.restapi.ResourceConflictException ( "project is being imported from another session" ) ; } } catch ( java.io.IOException e ) { throw new com.google.gerrit.extensions.restapi.ResourceConflictException ( "failed to lock project for delete" ) ; } }
Source:
public boolean matches ( com.google.gerrit.reviewdb.client.Project.NameKey name ) { if ( projectPatterns.isEmpty ( ) ) { return true ; } else { java.lang.String projectName = name.get ( ) ; for ( java.lang.String pattern : projectPatterns ) { if ( matchesPattern ( projectName , pattern ) ) { return true ; } } } return false ; }

Target:
public boolean matches ( com.google.gerrit.reviewdb.client.Project.NameKey name ) { if ( projectPatterns.isEmpty ( ) ) { return true ; } java.lang.String projectName = name.get ( ) ; for ( java.lang.String pattern : projectPatterns ) { if ( matchesPattern ( projectName , pattern ) ) { return true ; } } return false ; }
Source:
protected java.lang.String getTaskDescription ( ) { java.lang.StringBuilder m = new java.lang.StringBuilder ( commandName ) ; java.lang.String [ ] ta = getTrimmedArguments ( ) ; if ( ta != null ) { m.append ( com.google.common.base.Joiner.on ( " " ) . join ( ta ) ) ; } return m.toString ( ) ; }

Target:
protected java.lang.String getTaskDescription ( ) { java.lang.String [ ] ta = getTrimmedArguments ( ) ; if ( ta != null ) { return ( ( commandName ) + " " ) + ( com.google.common.base.Joiner.on ( " " ) . join ( ta ) ) ; } return commandName ; }
Source:
private static java.lang.String LHEX ( byte [ ] bin ) { java.lang.StringBuilder r = new java.lang.StringBuilder ( ( ( bin.length ) * 2 ) ) ; for ( int i = 0 ; i < ( bin.length ) ; i ++ ) { byte b = bin [ i ] ; r.append ( com.google.gerrit.httpd.ProjectDigestFilter.LHEX [ ( ( b > > > 4 ) & 15 ) ] ) ; r.append ( com.google.gerrit.httpd.ProjectDigestFilter.LHEX [ ( b & 15 ) ] ) ; } return r.toString ( ) ; }

Target:
private static java.lang.String LHEX ( byte [ ] bin ) { java.lang.StringBuilder r = new java.lang.StringBuilder ( ( ( bin.length ) * 2 ) ) ; for ( byte b : bin ) { r.append ( com.google.gerrit.httpd.ProjectDigestFilter.LHEX [ ( ( b > > > 4 ) & 15 ) ] ) ; r.append ( com.google.gerrit.httpd.ProjectDigestFilter.LHEX [ ( b & 15 ) ] ) ; } return r.toString ( ) ; }
Source:
private java.util.List < com.google.gerrit.server.git.CodeReviewCommit > sort ( java.util.Collection < com.google.gerrit.server.git.CodeReviewCommit > toSort ) throws com.google.gerrit.server.git.IntegrationException { try { java.util.List < com.google.gerrit.server.git.CodeReviewCommit > result = new com.google.gerrit.server.git.RebaseSorter ( args.rw , args.alreadyAccepted , args.canMergeFlag ) . sort ( toSort ) ; java.util.Collections.sort ( result , CodeReviewCommit.ORDER ) ; return result ; } catch ( java.io.IOException e ) { throw new com.google.gerrit.server.git.IntegrationException ( "Commit sorting failed" , e ) ; } }

Target:
private java.util.List < com.google.gerrit.server.git.CodeReviewCommit > sort ( java.util.Collection < com.google.gerrit.server.git.CodeReviewCommit > toSort ) throws com.google.gerrit.server.git.IntegrationException { try { return new com.google.gerrit.server.git.RebaseSorter ( args.rw , args.alreadyAccepted , args.canMergeFlag ) . sort ( toSort ) ; } catch ( java.io.IOException e ) { throw new com.google.gerrit.server.git.IntegrationException ( "Commit sorting failed" , e ) ; } }
Source:
private static java.lang.StringBuilder buildRefsPrefix ( java.lang.String prefix , com.google.gerrit.reviewdb.client.Account.Id accountId ) { java.lang.StringBuilder r = new java.lang.StringBuilder ( ) ; r.append ( prefix ) ; int n = ( accountId.get ( ) ) % 100 ; if ( n < 10 ) { r.append ( '0' ) ; } r.append ( n ) ; r.append ( '/' ) ; r.append ( accountId.get ( ) ) ; r.append ( '/' ) ; return r ; }

Target:
private static java.lang.StringBuilder buildRefsPrefix ( java.lang.String prefix , int id ) { java.lang.StringBuilder r = new java.lang.StringBuilder ( ) ; r.append ( prefix ) ; int n = id % 100 ; if ( n < 10 ) { r.append ( '0' ) ; } r.append ( n ) ; r.append ( '/' ) ; r.append ( id ) ; r.append ( '/' ) ; return r ; }
Source:
public void testChildren ( ) { final com.google.gerrit.server.query.OrPredicateTest.TestPredicate a = com.google.gerrit.server.query.OrPredicateTest.f ( "author" , "alice" ) ; final com.google.gerrit.server.query.OrPredicateTest.TestPredicate b = com.google.gerrit.server.query.OrPredicateTest.f ( "author" , "bob" ) ; final com.google.gerrit.server.query.Predicate n = com.google.gerrit.server.query.Predicate.or ( a , b ) ; assertEquals ( 2 , n.getChildCount ( ) ) ; assertSame ( a , n.getChild ( 0 ) ) ; assertSame ( b , n.getChild ( 1 ) ) ; }

Target:
public void testChildren ( ) { final com.google.gerrit.server.query.OrPredicateTest.TestPredicate a = com.google.gerrit.server.query.OrPredicateTest.f ( "author" , "alice" ) ; final com.google.gerrit.server.query.OrPredicateTest.TestPredicate b = com.google.gerrit.server.query.OrPredicateTest.f ( "author" , "bob" ) ; final com.google.gerrit.server.query.Predicate < java.lang.String > n = com.google.gerrit.server.query.Predicate.or ( a , b ) ; assertEquals ( 2 , n.getChildCount ( ) ) ; assertSame ( a , n.getChild ( 0 ) ) ; assertSame ( b , n.getChild ( 1 ) ) ; }
Source:
protected java.lang.String getChangeMessageThreadId ( ) { final java.lang.StringBuilder r = new java.lang.StringBuilder ( ) ; r.append ( '<' ) ; r.append ( "gerrit" ) ; r.append ( '.' ) ; r.append ( change.getCreatedOn ( ) . getTime ( ) ) ; r.append ( '.' ) ; r.append ( change.getChangeId ( ) ) ; r.append ( '@' ) ; r.append ( getGerritHost ( ) ) ; r.append ( '>' ) ; return r.toString ( ) ; }

Target:
protected java.lang.String getChangeMessageThreadId ( ) { final java.lang.StringBuilder r = new java.lang.StringBuilder ( ) ; r.append ( '<' ) ; r.append ( "gerrit" ) ; r.append ( '.' ) ; r.append ( change.getCreatedOn ( ) . getTime ( ) ) ; r.append ( '.' ) ; r.append ( change.getKey ( ) . get ( ) ) ; r.append ( '@' ) ; r.append ( getGerritHost ( ) ) ; r.append ( '>' ) ; return r.toString ( ) ; }
Source:
public void nullAccountId ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; com.google.gerrit.reviewdb.client.PatchSet.Id psId = r.getPatchSetId ( ) ; com.google.gerrit.reviewdb.client.Change.Id id = psId.getParentKey ( ) ; com.google.gerrit.reviewdb.client.ChangeMessage msg1 = insertMessage ( psId , user.getId ( ) , com.google.gerrit.common.TimeUtil.nowTs ( ) , "message 1" ) ; insertMessage ( psId , null , msg1.getWrittenOn ( ) , "message 2" ) ; checker.rebuildAndCheckChanges ( id ) ; }

Target:
public void nullAccountId ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; com.google.gerrit.reviewdb.client.PatchSet.Id psId = r.getPatchSetId ( ) ; com.google.gerrit.reviewdb.client.Change.Id id = psId.getParentKey ( ) ; com.google.gerrit.reviewdb.client.ChangeMessage msg1 = insertMessage ( id , psId , user.getId ( ) , com.google.gerrit.common.TimeUtil.nowTs ( ) , "message 1" ) ; insertMessage ( id , psId , null , msg1.getWrittenOn ( ) , "message 2" ) ; checker.rebuildAndCheckChanges ( id ) ; }
Source:
private java.util.Set < java.lang.String > getRefNamesAllUsers ( java.lang.String prefix ) throws com.google.gwtorm.server.OrmException { java.util.Map < java.lang.String , org.eclipse.jgit.lib.Ref > matchingRefs ; try { org.eclipse.jgit.lib.RefDatabase refDb = repoManager.openRepository ( allUsers ) . getRefDatabase ( ) ; matchingRefs = refDb.getRefs ( prefix ) ; } catch ( java.io.IOException e ) { throw new com.google.gwtorm.server.OrmException ( e ) ; } return matchingRefs.keySet ( ) ; }

Target:
private java.util.Set < java.lang.String > getRefNamesAllUsers ( java.lang.String prefix ) throws com.google.gwtorm.server.OrmException { org.eclipse.jgit.lib.Repository repo ; try { repo = repoManager.openRepository ( allUsers ) ; } catch ( java.io.IOException e ) { throw new com.google.gwtorm.server.OrmException ( e ) ; } try { org.eclipse.jgit.lib.RefDatabase refDb = repo.getRefDatabase ( ) ; return refDb.getRefs ( prefix ) . keySet ( ) ; } catch ( java.io.IOException e ) { throw new com.google.gwtorm.server.OrmException ( e ) ; } finally { repo.close ( ) ; } }
Source:
protected java.util.Set < com.google.gerrit.client.reviewdb.AccountGroup.Id > getProjectOwners ( ) { final com.google.gerrit.server.project.ProjectState r ; r = projectCache.get ( change.getDest ( ) . getParentKey ( ) ) ; return r != null ? r.getOwners ( ) : java.util.Collections.< com.google.gerrit.client.reviewdb.AccountGroup.Id > emptySet ( ) ; }

Target:
protected java.util.Set < com.google.gerrit.client.reviewdb.AccountGroup.Id > getProjectOwners ( ) { final com.google.gerrit.server.project.ProjectState r ; r = projectCache.get ( change.getProject ( ) ) ; return r != null ? r.getOwners ( ) : java.util.Collections.< com.google.gerrit.client.reviewdb.AccountGroup.Id > emptySet ( ) ; }
Source:
private void assertAmProjectOwner ( final com.google.gerrit.client.reviewdb.ReviewDb db , final com.google.gerrit.client.reviewdb.Project.Id projectId ) throws com.google.gerrit.server.rpc.project.Failure { try { if ( ! ( projectControlFactory.controlFor ( projectId ) . isOwner ( ) ) ) { throw new com.google.gerrit.server.rpc.project.Failure ( new com.google.gerrit.client.rpc.NoSuchEntityException ( ) ) ; } } catch ( com.google.gerrit.server.project.NoSuchProjectException e ) { throw new com.google.gerrit.server.rpc.project.Failure ( new com.google.gerrit.client.rpc.NoSuchEntityException ( ) ) ; } }

Target:
private void assertAmProjectOwner ( final com.google.gerrit.client.reviewdb.ReviewDb db , final com.google.gerrit.client.reviewdb.Project.NameKey projectName ) throws com.google.gerrit.server.rpc.project.Failure { try { if ( ! ( projectControlFactory.controlFor ( projectName ) . isOwner ( ) ) ) { throw new com.google.gerrit.server.rpc.project.Failure ( new com.google.gerrit.client.rpc.NoSuchEntityException ( ) ) ; } } catch ( com.google.gerrit.server.project.NoSuchProjectException e ) { throw new com.google.gerrit.server.rpc.project.Failure ( new com.google.gerrit.client.rpc.NoSuchEntityException ( ) ) ; } }
Source:
public void testPreformat3 ( ) { final com.google.gwtexpui.safehtml.client.SafeHtml o = com.google.gwtexpui.safehtml.client.SafeHtml_WikifyPreformatTest.html ( "A\n\n Q\n <R>\n S\n\nB" ) ; final com.google.gwtexpui.safehtml.client.SafeHtml n = o.wikify ( ) ; assertNotSame ( o , n ) ; assertEquals ( ( ( ( ( ( ( "<p>A</p>" + "<p>" ) + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyPreformatTest.pre ( " Q" ) ) ) + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyPreformatTest.pre ( " &lt;R&gt;" ) ) ) + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyPreformatTest.pre ( " S" ) ) ) + "</p>" ) + "<p>B</p>" ) , n.asString ( ) ) ; }

Target:
public void testPreformat3 ( ) { final com.google.gwtexpui.safehtml.client.SafeHtml o = com.google.gwtexpui.safehtml.client.SafeHtml_WikifyPreformatTest.html ( "A\n\n Q\n <R>\n S\n\nB" ) ; final com.google.gwtexpui.safehtml.client.SafeHtml n = o.wikify ( ) ; org.junit.Assert.assertNotSame ( o , n ) ; org.junit.Assert.assertEquals ( ( ( ( ( ( ( "<p>A</p>" + "<p>" ) + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyPreformatTest.pre ( " Q" ) ) ) + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyPreformatTest.pre ( " &lt;R&gt;" ) ) ) + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyPreformatTest.pre ( " S" ) ) ) + "</p>" ) + "<p>B</p>" ) , n.asString ( ) ) ; }
Source:
public com.google.gerrit.server.project.ChangeControl controlFor ( com.google.gerrit.reviewdb.Change change , com.google.gerrit.server.CurrentUser user ) throws com.google.gerrit.server.project.NoSuchChangeException { final com.google.gerrit.reviewdb.Project.NameKey projectKey = change.getProject ( ) ; try { return projectControl.controlFor ( projectKey , user ) . controlFor ( change ) ; } catch ( com.google.gerrit.server.project.NoSuchProjectException e ) { throw new com.google.gerrit.server.project.NoSuchChangeException ( change.getId ( ) , e ) ; } }

Target:
public com.google.gerrit.server.project.ChangeControl controlFor ( com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.server.CurrentUser user ) throws com.google.gerrit.server.project.NoSuchChangeException { final com.google.gerrit.reviewdb.client.Project.NameKey projectKey = change.getProject ( ) ; try { return projectControl.controlFor ( projectKey , user ) . controlFor ( change ) ; } catch ( com.google.gerrit.server.project.NoSuchProjectException e ) { throw new com.google.gerrit.server.project.NoSuchChangeException ( change.getId ( ) , e ) ; } }
Source:
public void testParentString ( ) { final java.lang.String pv = "foo,bar/ at %here" ; final com.google.gwtorm.client.StringKeyTestCase.Parent p1 = new com.google.gwtorm.client.StringKeyTestCase.Parent ( pv ) ; assertEquals ( "foo%2Cbar/+at+%25here" , p1.toString ( ) ) ; final com.google.gwtorm.client.StringKeyTestCase.Parent p2 = new com.google.gwtorm.client.StringKeyTestCase.Parent ( "" ) ; p2.fromString ( p1.toString ( ) ) ; assertEquals ( p1 , p2 ) ; }

Target:
public void testParentString ( ) { final java.lang.String pv = "foo,bar/ at %here" ; final com.google.gwtorm.client.StringKeyTestCase.Parent p1 = new com.google.gwtorm.client.StringKeyTestCase.Parent ( pv ) ; org.junit.Assert.assertEquals ( "foo%2Cbar/+at+%25here" , p1.toString ( ) ) ; final com.google.gwtorm.client.StringKeyTestCase.Parent p2 = new com.google.gwtorm.client.StringKeyTestCase.Parent ( "" ) ; p2.fromString ( p1.toString ( ) ) ; org.junit.Assert.assertEquals ( p1 , p2 ) ; }
Source:
public void testCarriageReturn ( ) throws java.lang.Exception { org.eclipse.jgit.revwalk.RevCommit c = makeCommit ( ) ; com.googlesource.gerrit.plugins.uploadvalidator.InvalidLineEndingValidator validator = new com.googlesource.gerrit.plugins.uploadvalidator.InvalidLineEndingValidator ( null , new com.googlesource.gerrit.plugins.uploadvalidator.ContentTypeUtil ( com.googlesource.gerrit.plugins.uploadvalidator.TestUtils.PATTERN_CACHE ) , null , null ) ; java.util.List < com.google.gerrit.server.git.validators.CommitValidationMessage > m = validator.performValidation ( repo , c , com.googlesource.gerrit.plugins.uploadvalidator.TestUtils.EMPTY_PLUGIN_CONFIG ) ; com.google.common.truth.Truth.assertThat ( com.googlesource.gerrit.plugins.uploadvalidator.TestUtils.transformMessages ( m ) ) . containsExactlyElementsIn ( com.google.common.collect.ImmutableSet.of ( "ERROR: found carriage return (CR) character in file: foo.txt" ) ) ; }

Target:
public void testCarriageReturn ( ) throws java.lang.Exception { org.eclipse.jgit.revwalk.RevCommit c = makeCommit ( ) ; com.googlesource.gerrit.plugins.uploadvalidator.InvalidLineEndingValidator validator = new com.googlesource.gerrit.plugins.uploadvalidator.InvalidLineEndingValidator ( null , new com.googlesource.gerrit.plugins.uploadvalidator.ContentTypeUtil ( com.googlesource.gerrit.plugins.uploadvalidator.TestUtils.PATTERN_CACHE ) , null , null , null ) ; java.util.List < com.google.gerrit.server.git.validators.CommitValidationMessage > m = validator.performValidation ( repo , c , com.googlesource.gerrit.plugins.uploadvalidator.TestUtils.EMPTY_PLUGIN_CONFIG ) ; com.google.common.truth.Truth.assertThat ( com.googlesource.gerrit.plugins.uploadvalidator.TestUtils.transformMessages ( m ) ) . containsExactlyElementsIn ( com.google.common.collect.ImmutableSet.of ( "ERROR: found carriage return (CR) character in file: foo.txt" ) ) ; }
Source:
public void commentOnReviewableChangeByOwnerNotifyOwnerReviewers ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; review ( sc.changeId , com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy.ENABLED , com.google.gerrit.extensions.api.changes.NotifyHandling.OWNER_REVIEWERS ) ; assertThat ( sender ) . sent ( "comment" , sc ) . to ( sc.reviewerByEmail ) . cc ( sc.reviewer , sc.ccer ) . cc ( sc.ccerByEmail ) . notTo ( sc.owner , sc.starrer ) . notTo ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; }

Target:
public void commentOnReviewableChangeByOwnerNotifyOwnerReviewers ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; review ( sc.owner , sc.changeId , com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy.ENABLED , com.google.gerrit.extensions.api.changes.NotifyHandling.OWNER_REVIEWERS ) ; assertThat ( sender ) . sent ( "comment" , sc ) . to ( sc.reviewerByEmail ) . cc ( sc.reviewer , sc.ccer ) . cc ( sc.ccerByEmail ) . notTo ( sc.owner , sc.starrer ) . notTo ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; }
Source:
private void approve ( java.lang.String changeId ) throws java.io.IOException { com.google.gerrit.acceptance.RestResponse r = adminSession.post ( ( ( "/changes/" + changeId ) + "/revisions/current/review" ) , new com.google.gerrit.extensions.api.changes.ReviewInput ( ) . label ( "Code-Review" , 2 ) ) ; org.junit.Assert.assertEquals ( HttpStatus.SC_OK , r.getStatusCode ( ) ) ; r.consume ( ) ; }

Target:
private void approve ( java.lang.String changeId ) throws java.io.IOException { com.google.gerrit.acceptance.RestResponse r = adminSession.post ( ( ( "/changes/" + changeId ) + "/revisions/current/review" ) , new com.google.gerrit.extensions.api.changes.ReviewInput ( ) . label ( "Code-Review" , 2 ) ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( HttpStatus.SC_OK ) ; r.consume ( ) ; }
Source:
public com.google.gerrit.server.change.ChangeKind getChangeKind ( com.google.gerrit.server.project.ProjectState project , org.eclipse.jgit.lib.Repository repo , org.eclipse.jgit.lib.ObjectId prior , org.eclipse.jgit.lib.ObjectId next ) { try { return new com.google.gerrit.server.change.ChangeKindCacheImpl.Loader ( ) . load ( new com.google.gerrit.server.change.ChangeKindCacheImpl.Key ( project , repo , prior , next , useRecursiveMerge ) ) ; } catch ( java.io.IOException e ) { com.google.gerrit.server.change.ChangeKindCacheImpl.log.warn ( ( ( ( "Cannot check trivial rebase of new patch set " + ( next.name ( ) ) ) + " in " ) + ( project.getProject ( ) . getName ( ) ) ) , e ) ; return ChangeKind.REWORK ; } }

Target:
public com.google.gerrit.server.change.ChangeKind getChangeKind ( com.google.gerrit.server.project.ProjectState project , org.eclipse.jgit.lib.Repository repo , org.eclipse.jgit.lib.ObjectId prior , org.eclipse.jgit.lib.ObjectId next ) { try { return new com.google.gerrit.server.change.ChangeKindCacheImpl.Loader ( ) . load ( new com.google.gerrit.server.change.ChangeKindCacheImpl.Key ( repo , prior , next , useRecursiveMerge ) ) ; } catch ( java.io.IOException e ) { com.google.gerrit.server.change.ChangeKindCacheImpl.log.warn ( ( ( ( "Cannot check trivial rebase of new patch set " + ( next.name ( ) ) ) + " in " ) + ( project.getProject ( ) . getName ( ) ) ) , e ) ; return ChangeKind.REWORK ; } }
Source:
public com.google.gerrit.server.project.ChangeControl validateFor ( com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.server.CurrentUser user ) throws com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException { com.google.gerrit.server.project.ChangeControl c = controlFor ( change , user ) ; if ( ! ( c.isVisible ( db.get ( ) ) ) ) { throw new com.google.gerrit.server.project.NoSuchChangeException ( c.getChange ( ) . getId ( ) ) ; } return c ; }

Target:
public com.google.gerrit.server.project.ChangeControl controlFor ( com.google.gerrit.reviewdb.client.Change.Id changeId , com.google.gerrit.server.CurrentUser user ) throws com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.Change change = db.get ( ) . changes ( ) . get ( changeId ) ; if ( change == null ) { throw new com.google.gerrit.server.project.NoSuchChangeException ( changeId ) ; } return controlFor ( change , user ) ; }
Source:
void onRestore ( int idx ) { java.lang.String path = list.get ( idx ) . path ( ) ; com.google.gerrit.client.changes.ChangeEditApi.restore ( curr.getParentKey ( ) . get ( ) , path , new com.google.gwt.user.client.rpc.AsyncCallback < 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 ( curr.getParentKey ( ) ) ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { } } ) ; }

Target:
void onRestore ( int idx ) { java.lang.String path = list.get ( idx ) . path ( ) ; com.google.gerrit.client.changes.ChangeEditApi.restore ( project.get ( ) , curr.getParentKey ( ) . get ( ) , path , new com.google.gwt.user.client.rpc.AsyncCallback < 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 ( project , curr.getParentKey ( ) ) ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { } } ) ; }
Source:
void addLabel ( final java.lang.String token ) throws org.kohsuke.args4j.CmdLineException { com.google.gerrit.server.util.LabelVote v = com.google.gerrit.server.util.LabelVote.parse ( token ) ; try { com.google.gerrit.common.data.LabelType.checkName ( v.getLabel ( ) ) ; com.google.gerrit.server.ApprovalsUtil.checkLabel ( labelTypes , v.getLabel ( ) , v.getValue ( ) ) ; } catch ( java.lang.IllegalArgumentException e ) { throw clp.reject ( e.getMessage ( ) ) ; } labels.put ( v.getLabel ( ) , v.getValue ( ) ) ; }

Target:
void addLabel ( final java.lang.String token ) throws org.kohsuke.args4j.CmdLineException { com.google.gerrit.server.util.LabelVote v = com.google.gerrit.server.util.LabelVote.parse ( token ) ; try { com.google.gerrit.common.data.LabelType.checkName ( v.label ( ) ) ; com.google.gerrit.server.ApprovalsUtil.checkLabel ( labelTypes , v.label ( ) , v.value ( ) ) ; } catch ( java.lang.IllegalArgumentException e ) { throw clp.reject ( e.getMessage ( ) ) ; } labels.put ( v.label ( ) , v.value ( ) ) ; }
Source:
public AccountGroup.Id call ( ) throws com.google.gerrit.common.errors.NameAlreadyUsedException , com.google.gwtorm.client.OrmException { final com.google.gerrit.server.account.PerformCreateGroup performCreateGroup = performCreateGroupFactory.create ( ) ; final com.google.gerrit.reviewdb.Account.Id me = user.getAccountId ( ) ; return performCreateGroup.createGroup ( groupName , null , null , me ) ; }

Target:
public AccountGroup.Id call ( ) throws com.google.gerrit.common.errors.NameAlreadyUsedException , com.google.gwtorm.client.OrmException { final com.google.gerrit.server.account.PerformCreateGroup performCreateGroup = performCreateGroupFactory.create ( ) ; final com.google.gerrit.reviewdb.Account.Id me = user.getAccountId ( ) ; return performCreateGroup.createGroup ( groupName , null , false , null , java.util.Collections.singleton ( me ) , null ) ; }