auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void onDraftPublished ( com.google.gerrit.extensions.events.DraftPublishedListener.Event ev ) { try { hooks.doDraftPublishedHook ( getChange ( ev.getChange ( ) ) , getPatchSet ( ev.getRevision ( ) ) , db.get ( ) ) ; } catch ( com.google.gwtorm.server.OrmException e ) { com.google.gerrit.common.ChangeHookApiListener.log.error ( ( "DraftPublished hook failed to run " + ( ev.getChange ( ) . _number ) ) , e ) ; } }

Target:
public void onDraftPublished ( com.google.gerrit.extensions.events.DraftPublishedListener.Event ev ) { try { com.google.gerrit.server.notedb.ChangeNotes notes = getNotes ( ev.getChange ( ) ) ; hooks.doDraftPublishedHook ( notes.getChange ( ) , getPatchSet ( notes , ev.getRevision ( ) ) , db.get ( ) ) ; } catch ( com.google.gwtorm.server.OrmException e ) { com.google.gerrit.common.ChangeHookApiListener.log.error ( ( "DraftPublished hook failed to run " + ( ev.getChange ( ) . _number ) ) , e ) ; } }
Source:
public void queryChangesStart ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r1 = createChange ( ) ; createChange ( ) ; java.util.List < com.google.gerrit.extensions.common.ChangeInfo > results = gApi.changes ( ) . query ( ) . withStart ( 1 ) . get ( ) ; com.google.common.truth.Truth.assertThat ( com.google.common.collect.Iterables.getOnlyElement ( results ) . changeId ) . isEqualTo ( r1.getChangeId ( ) ) ; }

Target:
public void queryChanges ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r1 = createChange ( ) ; createChange ( ) ; java.util.List < com.google.gerrit.extensions.common.ChangeInfo > results = query ( ( ( ( "project:{" + ( project.get ( ) ) ) + "} " ) + ( r1.getChangeId ( ) ) ) ) ; com.google.common.truth.Truth.assertThat ( com.google.common.collect.Iterables.getOnlyElement ( results ) . changeId ) . isEqualTo ( r1.getChangeId ( ) ) ; }
Source:
private void addCommands ( ) throws com.google.gwtorm.server.OrmException , java.io.IOException { if ( isEmpty ( ) ) { return ; } com.google.common.base.Preconditions.checkState ( ( ( changeRepo ) != null ) , "must set change repo" ) ; if ( ! ( draftUpdates.isEmpty ( ) ) ) { com.google.common.base.Preconditions.checkState ( ( ( allUsersRepo ) != null ) , "must set all users repo" ) ; } com.google.gerrit.server.notedb.NoteDbUpdateManager.addUpdates ( changeUpdates , changeRepo ) ; if ( ! ( draftUpdates.isEmpty ( ) ) ) { com.google.gerrit.server.notedb.NoteDbUpdateManager.addUpdates ( draftUpdates , allUsersRepo ) ; } }

Target:
private void addCommands ( ) throws com.google.gwtorm.server.OrmException , java.io.IOException { if ( isEmpty ( ) ) { return ; } com.google.common.base.Preconditions.checkState ( ( ( changeRepo ) != null ) , "must set change repo" ) ; if ( ! ( draftUpdates.isEmpty ( ) ) ) { com.google.common.base.Preconditions.checkState ( ( ( allUsersRepo ) != null ) , "must set all users repo" ) ; } com.google.gerrit.server.notedb.NoteDbUpdateManager.addUpdates ( changeUpdates , changeRepo ) ; if ( ! ( draftUpdates.isEmpty ( ) ) ) { com.google.gerrit.server.notedb.NoteDbUpdateManager.addUpdates ( draftUpdates , allUsersRepo ) ; } checkExpectedState ( ) ; }
Source:
private java.lang.String extractWhat ( com.google.gerrit.sshd.DispatchCommand dcmd ) { if ( dcmd == null ) { return "Command was already destroyed" ; } java.lang.StringBuilder commandName = new java.lang.StringBuilder ( dcmd.getCommandName ( ) ) ; java.lang.String [ ] args = dcmd.getArguments ( ) ; for ( int i = 1 ; i < ( args.length ) ; i ++ ) { commandName.append ( "." ) . append ( args [ i ] ) ; } return commandName.toString ( ) ; }

Target:
private java.lang.String extractWhat ( com.google.gerrit.sshd.DispatchCommand dcmd ) { if ( dcmd == null ) { return "Command was already destroyed" ; } java.lang.StringBuilder commandName = new java.lang.StringBuilder ( dcmd.getCommandName ( ) ) ; java.lang.String [ ] trimmedArgs = dcmd.getTrimmedArguments ( ) ; if ( trimmedArgs != null ) { commandName.append ( com.google.common.base.Joiner.on ( "." ) . join ( trimmedArgs ) ) ; } return commandName.toString ( ) ; }
Source:
public synchronized void add ( java.lang.String event ) throws java.io.IOException { long next = ( getHead ( ) ) + 1 ; java.nio.file.Path epath = paths.event ( next ) ; com.googlesource.gerrit.plugins.events.fsstore.Fs.createDirectories ( epath.getParent ( ) ) ; java.nio.file.Files.write ( epath , ( event + "\n" ) . getBytes ( ) ) ; stores.head.increment ( ) ; }

Target:
public synchronized void add ( java.lang.String event ) throws java.io.IOException { long next = ( getHead ( ) ) + 1 ; java.nio.file.Path epath = paths.event ( next ) ; com.googlesource.gerrit.plugins.events.fsstore.Fs.createDirectories ( epath.getParent ( ) ) ; java.nio.file.Files.write ( epath , ( event + "\n" ) . getBytes ( ) ) ; stores.head.spinIncrement ( com.googlesource.gerrit.plugins.events.fsstore.FsStore.MAX_INCREMENT_SPINS ) ; }
Source:
public void sideBySidePatchDetail ( final com.google.gerrit.client.reviewdb.Patch.Key key , final java.util.List < com.google.gerrit.client.reviewdb.PatchSet.Id > versions , final com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.data.SideBySidePatchDetail > callback ) { final com.google.gerrit.git.RepositoryCache rc = server.getRepositoryCache ( ) ; if ( rc == null ) { callback.onFailure ( new java.lang.Exception ( "No Repository Cache configured" ) ) ; return ; } run ( callback , new com.google.gerrit.server.patch.SideBySidePatchDetailAction ( rc , key , versions ) ) ; }

Target:
public void patchComments ( final com.google.gerrit.client.reviewdb.Patch.Key patchKey , final com.google.gerrit.client.reviewdb.PatchSet.Id psa , final com.google.gerrit.client.reviewdb.PatchSet.Id psb , final com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.patches.CommentDetail > callback ) { if ( psb == null ) { callback.onFailure ( new com.google.gerrit.client.rpc.NoSuchEntityException ( ) ) ; return ; } run ( callback , new com.google.gerrit.server.patch.PatchCommentAction ( patchKey , psa , psb ) ) ; }
Source:
public java.lang.Iterable < com.google.gerrit.server.query.change.ChangeData > byCommitsOnBranchNotMerged ( com.google.gerrit.reviewdb.client.Branch.NameKey branch , java.util.List < java.lang.String > hashes ) throws com.google.gwtorm.server.OrmException { return byCommitsOnBranchNotMerged ( branch , hashes , indexConfig.maxPrefixTerms ( ) ) ; }

Target:
public java.lang.Iterable < com.google.gerrit.server.query.change.ChangeData > byCommitsOnBranchNotMerged ( com.google.gerrit.reviewdb.client.Branch.NameKey branch , java.util.List < java.lang.String > hashes ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.server.index.Schema < com.google.gerrit.server.query.change.ChangeData > schema = com.google.gerrit.server.query.change.InternalChangeQuery.schema ( indexes ) ; if ( schema.hasField ( ChangeField.EXACT_COMMIT ) ) { return query ( com.google.gerrit.server.query.change.InternalChangeQuery.commitsOnBranchNotMerged ( branch , com.google.gerrit.server.query.change.InternalChangeQuery.commits ( schema , hashes ) ) ) ; } else { return byCommitsOnBranchNotMerged ( schema , branch , hashes , indexConfig.maxPrefixTerms ( ) ) ; } }
Source:
private java.util.List < com.google.gerrit.client.ui.InlineHyperlink > getLinks ( ) { com.google.gerrit.client.ui.InlineHyperlink toUnifiedDiffLink = new com.google.gerrit.client.ui.InlineHyperlink ( ) ; toUnifiedDiffLink.setHTML ( new com.google.gwt.user.client.ui.ImageResourceRenderer ( ) . render ( Gerrit.RESOURCES.unifiedDiff ( ) ) ) ; toUnifiedDiffLink.setTargetHistoryToken ( getUnifiedDiffUrl ( ) ) ; toUnifiedDiffLink.setTitle ( PatchUtil.C.unifiedDiff ( ) ) ; return java.util.Collections.singletonList ( toUnifiedDiffLink ) ; }

Target:
private java.util.List < com.google.gerrit.client.ui.InlineHyperlink > getLinks ( ) { com.google.gerrit.client.ui.InlineHyperlink toUnifiedDiffLink = new com.google.gerrit.client.ui.InlineHyperlink ( ) ; toUnifiedDiffLink.setHTML ( new com.google.gwt.user.client.ui.ImageResourceRenderer ( ) . render ( Gerrit.RESOURCES.unifiedDiff ( ) ) ) ; toUnifiedDiffLink.setTargetHistoryToken ( com.google.gerrit.client.Dispatcher.toUnified ( base , revision , path ) ) ; toUnifiedDiffLink.setTitle ( PatchUtil.C.unifiedDiff ( ) ) ; return java.util.Collections.singletonList ( toUnifiedDiffLink ) ; }
Source:
public void testCUSTOM_NoFullNameUser ( ) { setFrom ( "A ${user} B <my.server@email.address>" ) ; final java.lang.String email = "a.u.thor@test.example.com" ; final com.google.gerrit.reviewdb.client.Account.Id user = user ( null , email ) ; org.easymock.EasyMock.replay ( accountCache ) ; final com.google.gerrit.server.mail.Address r = create ( ) . from ( user ) ; org.junit.Assert.assertNotNull ( r ) ; org.junit.Assert.assertEquals ( "A Anonymous Coward B" , r.name ) ; org.junit.Assert.assertEquals ( "my.server@email.address" , r.email ) ; org.easymock.EasyMock.verify ( accountCache ) ; }

Target:
public void testCUSTOM_NoFullNameUser ( ) { setFrom ( "A ${user} B <my.server@email.address>" ) ; final java.lang.String email = "a.u.thor@test.example.com" ; final com.google.gerrit.reviewdb.client.Account.Id user = user ( null , email ) ; org.easymock.EasyMock.replay ( accountCache ) ; final com.google.gerrit.server.mail.Address r = create ( ) . from ( user ) ; com.google.common.truth.Truth.assertThat ( r ) . isNotNull ( ) ; com.google.common.truth.Truth.assertThat ( r.name ) . isEqualTo ( "A Anonymous Coward B" ) ; com.google.common.truth.Truth.assertThat ( r.email ) . isEqualTo ( "my.server@email.address" ) ; org.easymock.EasyMock.verify ( accountCache ) ; }
Source:
private java.util.List < com.google.gerrit.extensions.api.projects.TagInfo > listTags ( com.google.gerrit.server.api.projects.ListRefsRequest < com.google.gerrit.extensions.api.projects.TagInfo > request ) throws com.google.gerrit.extensions.restapi.RestApiException { listTags.setLimit ( request.getLimit ( ) ) ; listTags.setStart ( request.getStart ( ) ) ; listTags.setMatchSubstring ( request.getSubstring ( ) ) ; listTags.setMatchRegex ( request.getRegex ( ) ) ; try { return listTags.apply ( checkExists ( ) ) ; } catch ( java.io.IOException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot list tags" , e ) ; } }

Target:
private java.util.List < com.google.gerrit.extensions.api.projects.TagInfo > listTags ( com.google.gerrit.server.api.projects.ListRefsRequest < com.google.gerrit.extensions.api.projects.TagInfo > request ) throws com.google.gerrit.extensions.restapi.RestApiException { listTags.setLimit ( request.getLimit ( ) ) ; listTags.setStart ( request.getStart ( ) ) ; listTags.setMatchSubstring ( request.getSubstring ( ) ) ; listTags.setMatchRegex ( request.getRegex ( ) ) ; try { return listTags.apply ( checkExists ( ) ) ; } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( "Cannot list tags" , e ) ; } }
Source:
private com.google.gerrit.extensions.client.EditPreferencesInfo parseEditPreferences ( @ com.google.gerrit.common.Nullable com.google.gerrit.extensions.client.EditPreferencesInfo input ) { try { return com.google.gerrit.server.account.PreferencesConfig.parseEditPreferences ( cfg , defaultCfg , input ) ; } catch ( org.eclipse.jgit.errors.ConfigInvalidException e ) { validationErrorSink.error ( new com.google.gerrit.server.git.ValidationError ( com.google.gerrit.server.account.PreferencesConfig.PREFERENCES_CONFIG , java.lang.String.format ( "Invalid edit preferences for account %d: %s" , accountId.get ( ) , e.getMessage ( ) ) ) ) ; return new com.google.gerrit.extensions.client.EditPreferencesInfo ( ) ; } }

Target:
private com.google.gerrit.extensions.client.EditPreferencesInfo parseEditPreferences ( @ com.google.gerrit.common.Nullable com.google.gerrit.extensions.client.EditPreferencesInfo input ) { try { return com.google.gerrit.server.account.Preferences.parseEditPreferences ( cfg , defaultCfg , input ) ; } catch ( org.eclipse.jgit.errors.ConfigInvalidException e ) { validationErrorSink.error ( new com.google.gerrit.server.git.ValidationError ( com.google.gerrit.server.account.Preferences.PREFERENCES_CONFIG , java.lang.String.format ( "Invalid edit preferences for account %d: %s" , accountId.get ( ) , e.getMessage ( ) ) ) ) ; return new com.google.gerrit.extensions.client.EditPreferencesInfo ( ) ; } }
Source:
public void listNonEmptyGroupMembers ( ) throws java.lang.Exception { assertMembers ( GET ( "/groups/Administrators/members/" ) , admin.fullName ) ; accounts.create ( "admin2" , "Administrators" ) ; assertMembers ( GET ( "/groups/Administrators/members/" ) , admin.fullName , "admin2" ) ; }

Target:
public void listNonEmptyGroupMembers ( ) throws java.lang.Exception { java.lang.String group = createGroup ( "group" ) ; java.lang.String user1 = createAccount ( "user1" , group ) ; java.lang.String user2 = createAccount ( "user2" , group ) ; assertMembers ( GET ( ( ( "/groups/" + group ) + "/members/" ) ) , user1 , user2 ) ; }
Source:
private com.google.gerrit.server.IdentifiedUser createUser ( final com.google.gerrit.sshd.SshSession sd , final com.google.gerrit.sshd.SshKeyCacheEntry key ) { return userFactory.create ( AccessPath.SSH , new com.google.inject.Provider < java.net.SocketAddress > ( ) { @ java.lang.Override public java.net.SocketAddress get ( ) { return sd.getRemoteAddress ( ) ; } } , key.getAccount ( ) ) ; }

Target:
private com.google.gerrit.server.IdentifiedUser createUser ( final com.google.gerrit.sshd.SshSession sd , final com.google.gerrit.sshd.SshKeyCacheEntry key ) { return userFactory.create ( AccessPath.SSH_COMMAND , new com.google.inject.Provider < java.net.SocketAddress > ( ) { @ java.lang.Override public java.net.SocketAddress get ( ) { return sd.getRemoteAddress ( ) ; } } , key.getAccount ( ) ) ; }
Source:
public org.eclipse.jgit.lib.ObjectId loadRevision ( ) throws com.google.gwtorm.server.OrmException { if ( loaded ) { return getRevision ( ) ; } else if ( ! ( args.migration.enabled ( ) ) ) { return null ; } try ( org.eclipse.jgit.lib.Repository repo = args.repoManager.openMetadataRepository ( getProjectName ( ) ) ) { org.eclipse.jgit.lib.Ref ref = repo.getRefDatabase ( ) . exactRef ( getRefName ( ) ) ; return ref != null ? ref.getObjectId ( ) : null ; } catch ( java.io.IOException e ) { throw new com.google.gwtorm.server.OrmException ( e ) ; } }

Target:
public org.eclipse.jgit.lib.ObjectId loadRevision ( ) throws com.google.gwtorm.server.OrmException { if ( loaded ) { return getRevision ( ) ; } else if ( ! ( args.migration.enabled ( ) ) ) { return null ; } try ( org.eclipse.jgit.lib.Repository repo = args.repoManager.openRepository ( getProjectName ( ) ) ) { org.eclipse.jgit.lib.Ref ref = repo.getRefDatabase ( ) . exactRef ( getRefName ( ) ) ; return ref != null ? ref.getObjectId ( ) : null ; } catch ( java.io.IOException e ) { throw new com.google.gwtorm.server.OrmException ( e ) ; } }
Source:
public static void setDefaults ( org.eclipse.jgit.lib.Config cfg ) { cfg.setEnum ( "auth" , null , "type" , AuthType.DEVELOPMENT_BECOME_ANY_ACCOUNT ) ; cfg.setString ( "gerrit" , null , "basePath" , "git" ) ; cfg.setString ( "gerrit" , null , "allProjects" , "Test-Projects" ) ; cfg.setString ( "user" , null , "name" , "Gerrit Code Review" ) ; cfg.setString ( "user" , null , "email" , "gerrit@localhost" ) ; cfg.setBoolean ( "sendemail" , null , "enable" , false ) ; cfg.setString ( "cache" , null , "directory" , null ) ; cfg.setString ( "index" , null , "type" , "lucene" ) ; cfg.setBoolean ( "index" , "lucene" , "testInmemory" , true ) ; cfg.setInt ( "index" , "lucene" , "testVersion" , com.google.gerrit.server.index.ChangeSchemas.getLatest ( ) . getVersion ( ) ) ; }

Target:
public static void setDefaults ( org.eclipse.jgit.lib.Config cfg ) { cfg.setEnum ( "auth" , null , "type" , AuthType.DEVELOPMENT_BECOME_ANY_ACCOUNT ) ; cfg.setString ( "gerrit" , null , "basePath" , "git" ) ; cfg.setString ( "gerrit" , null , "allProjects" , "Test-Projects" ) ; cfg.setString ( "user" , null , "name" , "Gerrit Code Review" ) ; cfg.setString ( "user" , null , "email" , "gerrit@localhost" ) ; cfg.setString ( "cache" , null , "directory" , null ) ; cfg.setString ( "index" , null , "type" , "lucene" ) ; cfg.setBoolean ( "index" , "lucene" , "testInmemory" , true ) ; cfg.setInt ( "index" , "lucene" , "testVersion" , com.google.gerrit.server.index.ChangeSchemas.getLatest ( ) . getVersion ( ) ) ; }
Source:
public void testIsEnabledChangeMergedEvent ( ) { testIsEnabledEvent ( com.google.gerrit.server.events.ChangeMergedEvent.class ) ; }

Target:
public void testIsEnabledChangeMergedEvent ( ) { java.lang.String [ ] branches = new java.lang.String [ ] { } ; setupIsEnabled ( "true" , null , branches ) ; com.google.gerrit.server.events.ChangeMergedEvent event = new com.google.gerrit.server.events.ChangeMergedEvent ( ) ; event.change = new com.google.gerrit.server.data.ChangeAttribute ( ) ; event.change.project = "testProject" ; event.change.branch = "testBranch" ; com.googlesource.gerrit.plugins.its.base.its.ItsConfig itsConfig = createItsConfig ( ) ; replayMocks ( ) ; assertTrue ( itsConfig.isEnabled ( event ) ) ; }
Source:
public com.google.gerrit.server.patch.PatchList get ( com.google.gerrit.server.patch.PatchListKey key ) throws com.google.gerrit.server.patch.PatchListNotAvailableException { try { return fileCache.get ( key ) ; } catch ( java.util.concurrent.ExecutionException | org.eclipse.jgit.errors.LargeObjectException e ) { PatchListLoader.log.warn ( ( "Error computing " + key ) , e ) ; throw new com.google.gerrit.server.patch.PatchListNotAvailableException ( e.getCause ( ) ) ; } }

Target:
public com.google.gerrit.server.patch.PatchList get ( com.google.gerrit.server.patch.PatchListKey key , com.google.gerrit.reviewdb.client.Project.NameKey project ) throws com.google.gerrit.server.patch.PatchListNotAvailableException { try { return fileCache.get ( key , fileLoaderFactory.create ( key , project ) ) ; } catch ( java.util.concurrent.ExecutionException | org.eclipse.jgit.errors.LargeObjectException e ) { PatchListLoader.log.warn ( ( "Error computing " + key ) , e ) ; throw new com.google.gerrit.server.patch.PatchListNotAvailableException ( e.getCause ( ) ) ; } }
Source:
private void deleteRemoteSsh ( org.eclipse.jgit.transport.URIish uri ) { java.lang.String quotedPath = QuotedString.BOURNE.quote ( uri.getPath ( ) ) ; java.lang.String cmd = "rm -rf " + quotedPath ; java.io.OutputStream errStream = com.googlesource.gerrit.plugins.replication.ReplicationQueue.newErrorBufferStream ( ) ; try { executeRemoteSsh ( uri , cmd , errStream ) ; } catch ( java.io.IOException e ) { com.googlesource.gerrit.plugins.replication.ReplicationQueue.repLog.error ( ( "Error deleting remote repository at {}:\n" + ( ( " Exception: {}\n" + " Command: {}\n" ) + " Output: {}" ) ) , uri , e , cmd , errStream , e ) ; } }

Target:
private void deleteRemoteSsh ( org.eclipse.jgit.transport.URIish uri ) { java.lang.String quotedPath = QuotedString.BOURNE.quote ( uri.getPath ( ) ) ; java.lang.String cmd = "rm -rf " + quotedPath ; java.io.OutputStream errStream = com.googlesource.gerrit.plugins.replication.ReplicationQueue.newErrorBufferStream ( ) ; try { executeRemoteSsh ( uri , cmd , errStream ) ; com.googlesource.gerrit.plugins.replication.ReplicationQueue.repLog.info ( "Deleted remote repository: {}" , uri ) ; } catch ( java.io.IOException e ) { com.googlesource.gerrit.plugins.replication.ReplicationQueue.repLog.error ( ( "Error deleting remote repository at {}:\n" + ( ( " Exception: {}\n" + " Command: {}\n" ) + " Output: {}" ) ) , uri , e , cmd , errStream , e ) ; } }
Source:
public void onSuccess ( com.google.gerrit.client.changes.ChangeInfo.IncludedInInfo r ) { branches.setInnerSafeHtml ( formatList ( r.branches ( ) ) ) ; tags.setInnerSafeHtml ( formatList ( r.tags ( ) ) ) ; for ( java.lang.String n : r.externalNames ( ) ) { com.google.gwt.core.client.JsArrayString external = r.external ( n ) ; if ( ( external.length ( ) ) > 0 ) { appendRow ( n , external ) ; } } loaded = true ; }

Target:
public void onSuccess ( com.google.gerrit.client.info.ChangeInfo.IncludedInInfo r ) { branches.setInnerSafeHtml ( formatList ( r.branches ( ) ) ) ; tags.setInnerSafeHtml ( formatList ( r.tags ( ) ) ) ; for ( java.lang.String n : r.externalNames ( ) ) { com.google.gwt.core.client.JsArrayString external = r.external ( n ) ; if ( ( external.length ( ) ) > 0 ) { appendRow ( n , external ) ; } } loaded = true ; }
Source:
private void assertProblems ( com.google.gerrit.gpg.testutil.TestKey tk , java.lang.String ... expected ) throws java.lang.Exception { if ( ( expected.length ) == 0 ) { throw new java.lang.IllegalArgumentException ( "Use assertNoProblems" ) ; } assertProblems ( tk.getPublicKey ( ) , expected ) ; }

Target:
private void assertProblems ( org.bouncycastle.openpgp.PGPPublicKey k , java.lang.String first , java.lang.String ... rest ) { com.google.gerrit.gpg.CheckResult result = new com.google.gerrit.gpg.PublicKeyChecker ( ) . setStore ( store ) . check ( k ) ; org.junit.Assert.assertEquals ( com.google.gerrit.gpg.PublicKeyCheckerTest.list ( first , rest ) , result.getProblems ( ) ) ; }
Source:
protected void onLoad ( ) { super . onLoad ( ) ; Util.PROJECT_SVC.projectDetail ( getProjectKey ( ) , new com.google.gerrit.client.rpc.ScreenLoadCallback < com.google.gerrit.common.data.ProjectDetail > ( this ) { public void preDisplay ( final com.google.gerrit.common.data.ProjectDetail result ) { enableForm ( result.canModifyAgreements , result.canModifyDescription , result.canModifyMergeType , result.canModifyState , result.canModifyMaxObjectSizeLimit ) ; saveProject.setVisible ( ( ( ( ( result.canModifyAgreements ) || ( result.canModifyDescription ) ) || ( result.canModifyMergeType ) ) || ( result.canModifyState ) ) ) ; display ( result ) ; } } ) ; savedPanel = INFO ; }

Target:
public void onSuccess ( com.google.gerrit.client.access.ProjectAccessInfo result ) { isOwner = result.isOwner ( ) ; enableForm ( ) ; saveProject.setVisible ( isOwner ) ; }
Source:
private void padLineNumber ( final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder m , boolean isForTableHeader , boolean isForSideA ) { m.openTd ( ) ; m.setStyleName ( Gerrit.RESOURCES.css ( ) . lineNumber ( ) ) ; if ( isForTableHeader ) { m.addStyleName ( Gerrit.RESOURCES.css ( ) . fileColumnHeader ( ) ) ; } if ( isForSideA ) { m.addStyleName ( Gerrit.RESOURCES.css ( ) . rightBorder ( ) ) ; } m.closeTd ( ) ; }

Target:
private void padLineNumberOnTableHeaderForSideA ( final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder m ) { m.openTd ( ) ; m.setStyleName ( Gerrit.RESOURCES.css ( ) . lineNumber ( ) ) ; m.addStyleName ( Gerrit.RESOURCES.css ( ) . fileColumnHeader ( ) ) ; m.addStyleName ( Gerrit.RESOURCES.css ( ) . rightBorder ( ) ) ; m.closeTd ( ) ; }
Source:
public java.lang.String toString ( ) { return new java.lang.StringBuilder ( ) . append ( '[' ) . append ( key ) . append ( ": " ) . append ( value ) . append ( ",tag:" ) . append ( tag ) . append ( ']' ) . toString ( ) ; }

Target:
public java.lang.String toString ( ) { return ( ( ( ( ( ( ( "[" + ( key ) ) + ": " ) + ( value ) ) + ",tag:" ) + ( tag ) ) + ",realAccountId:" ) + ( realAccountId ) ) + ']' ; }
Source:
public static com.google.gerrit.common.data.GroupReference findBestSuggestion ( com.google.gerrit.server.account.GroupBackend groupBackend , java.lang.String name , @ com.google.gerrit.common.Nullable com.google.gerrit.server.project.ProjectControl project ) { java.util.Collection < com.google.gerrit.common.data.GroupReference > refs = groupBackend.suggest ( name , project ) ; if ( ( refs.size ( ) ) == 1 ) { return com.google.common.collect.Iterables.getOnlyElement ( refs ) ; } for ( com.google.gerrit.common.data.GroupReference ref : refs ) { if ( com.google.gerrit.server.account.GroupBackends.isExactSuggestion ( ref , name ) ) { return ref ; } } return null ; }

Target:
public static com.google.gerrit.common.data.GroupReference findBestSuggestion ( com.google.gerrit.server.account.GroupBackend groupBackend , java.lang.String name , @ com.google.gerrit.common.Nullable com.google.gerrit.server.project.ProjectState project ) { java.util.Collection < com.google.gerrit.common.data.GroupReference > refs = groupBackend.suggest ( name , project ) ; if ( ( refs.size ( ) ) == 1 ) { return com.google.common.collect.Iterables.getOnlyElement ( refs ) ; } for ( com.google.gerrit.common.data.GroupReference ref : refs ) { if ( com.google.gerrit.server.account.GroupBackends.isExactSuggestion ( ref , name ) ) { return ref ; } } return null ; }
Source:
public void onSuccess ( final com.google.gerrit.client.diff.DiffInfo diff ) { new net.codemirror.lib.ModeInjector ( ) . add ( com.google.gerrit.client.diff.CodeMirrorDemo.getContentType ( diff.meta_a ( ) ) ) . add ( com.google.gerrit.client.diff.CodeMirrorDemo.getContentType ( diff.meta_b ( ) ) ) . inject ( new com.google.gerrit.client.rpc.ScreenLoadCallback < java.lang.Void > ( this ) { @ java.lang.Override protected void preDisplay ( java.lang.Void result ) { display ( diff ) ; } } ) ; }

Target:
public void onSuccess ( com.google.gerrit.client.diff.DiffInfo diffInfo ) { diff = diffInfo ; new net.codemirror.lib.ModeInjector ( ) . add ( com.google.gerrit.client.diff.CodeMirrorDemo.getContentType ( diff.meta_a ( ) ) ) . add ( com.google.gerrit.client.diff.CodeMirrorDemo.getContentType ( diff.meta_b ( ) ) ) . inject ( modeInjectorCb ) ; }
Source:
void doReply ( ) { if ( ! ( com.google.gerrit.client.Gerrit.isSignedIn ( ) ) ) { com.google.gerrit.client.Gerrit.doSignIn ( getCommentManager ( ) . getDiffScreen ( ) . getToken ( ) ) ; } else if ( ( replyBox ) == null ) { addReplyBox ( false ) ; } else { openReplyBox ( ) ; } }

Target:
void doReply ( ) { if ( ! ( com.google.gerrit.client.Gerrit.isSignedIn ( ) ) ) { com.google.gerrit.client.Gerrit.doSignIn ( getCommentManager ( ) . host.getToken ( ) ) ; } else if ( ( replyBox ) == null ) { addReplyBox ( false ) ; } else { openReplyBox ( ) ; } }
Source:
private com.google.gerrit.gpg.PublicKeyChecker newChecker ( int maxTrustDepth , com.google.gerrit.gpg.testutil.TestKey ... trusted ) { java.util.List < com.google.gerrit.gpg.Fingerprint > fps = new java.util.ArrayList ( trusted.length ) ; for ( com.google.gerrit.gpg.testutil.TestKey k : trusted ) { fps.add ( new com.google.gerrit.gpg.Fingerprint ( k.getPublicKey ( ) . getFingerprint ( ) ) ) ; } return new com.google.gerrit.gpg.PublicKeyChecker ( maxTrustDepth , fps ) ; }

Target:
private com.google.gerrit.gpg.PublicKeyChecker newChecker ( int maxTrustDepth , com.google.gerrit.gpg.testutil.TestKey ... trusted ) { java.util.Map < java.lang.Long , com.google.gerrit.gpg.Fingerprint > fps = new java.util.HashMap < > ( ) ; for ( com.google.gerrit.gpg.testutil.TestKey k : trusted ) { com.google.gerrit.gpg.Fingerprint fp = new com.google.gerrit.gpg.Fingerprint ( k.getPublicKey ( ) . getFingerprint ( ) ) ; fps.put ( fp.getId ( ) , fp ) ; } return new com.google.gerrit.gpg.PublicKeyChecker ( ) . enableTrust ( maxTrustDepth , fps ) . setStore ( store ) ; }
Source:
private void emptycell ( final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder m , final int colspan ) { m.openTd ( ) ; m.addStyleName ( Gerrit.RESOURCES.css ( ) . dataCell ( ) ) ; m.addStyleName ( Gerrit.RESOURCES.css ( ) . diffLinkCell ( ) ) ; m.setAttribute ( "colspan" , colspan ) ; m.nbsp ( ) ; m.closeTd ( ) ; }

Target:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { for ( com.google.gerrit.reviewdb.client.Patch p : detail.getPatches ( ) ) { openWindow ( com.google.gerrit.client.Dispatcher.toPatchSideBySide ( base , p.getKey ( ) ) ) ; } }
Source:
public final com.google.gerrit.gpg.CheckResult check ( org.bouncycastle.openpgp.PGPPublicKey key , com.google.gerrit.gpg.PublicKeyStore store ) { if ( ( trusted ) == null ) { return check ( key ) ; } else if ( store == null ) { throw new java.lang.IllegalArgumentException ( "PublicKeyStore required for web of trust checks" ) ; } return check ( key , store , 0 , true , new java.util.HashSet < com.google.gerrit.gpg.Fingerprint > ( ) ) ; }

Target:
public com.google.gerrit.gpg.PublicKeyChecker setStore ( com.google.gerrit.gpg.PublicKeyStore store ) { if ( store == null ) { throw new java.lang.IllegalArgumentException ( "PublicKeyStore is required" ) ; } this . store = store ; return this ; }
Source:
public com.google.gerrit.server.events.PatchSetAttribute asPatchSetAttribute ( final com.google.gerrit.reviewdb.PatchSet patchSet ) { com.google.gerrit.server.events.PatchSetAttribute p = new com.google.gerrit.server.events.PatchSetAttribute ( ) ; p.revision = patchSet.getRevision ( ) . get ( ) ; p.number = java.lang.Integer.toString ( patchSet.getPatchSetId ( ) ) ; p.ref = patchSet.getRefName ( ) ; final com.google.gerrit.server.account.AccountState uploader = accountCache.get ( patchSet.getUploader ( ) ) ; p.uploader = asAccountAttribute ( uploader.getAccount ( ) ) ; return p ; }

Target:
public com.google.gerrit.server.events.AccountAttribute asAccountAttribute ( com.google.gerrit.reviewdb.Account.Id id ) { return asAccountAttribute ( accountCache.get ( id ) . getAccount ( ) ) ; }
Source:
public void emptyPermissionRangeOmitsResult ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.PatchSetApproval cr = psa ( userId , "Code-Review" , 1 ) ; com.google.gerrit.reviewdb.client.PatchSetApproval v = psa ( userId , "Verified" , 1 ) ; org.junit.Assert.assertEquals ( new com.google.gerrit.server.git.LabelNormalizer.Result ( com.google.gerrit.server.git.LabelNormalizerTest.list ( ) , com.google.gerrit.server.git.LabelNormalizerTest.list ( ) , com.google.gerrit.server.git.LabelNormalizerTest.list ( cr , v ) ) , norm.normalize ( change , com.google.gerrit.server.git.LabelNormalizerTest.list ( cr , v ) ) ) ; }

Target:
public void emptyPermissionRangeOmitsResult ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.PatchSetApproval cr = psa ( userId , "Code-Review" , 1 ) ; com.google.gerrit.reviewdb.client.PatchSetApproval v = psa ( userId , "Verified" , 1 ) ; org.junit.Assert.assertEquals ( com.google.gerrit.server.git.LabelNormalizer.Result.create ( com.google.gerrit.server.git.LabelNormalizerTest.list ( ) , com.google.gerrit.server.git.LabelNormalizerTest.list ( ) , com.google.gerrit.server.git.LabelNormalizerTest.list ( cr , v ) ) , norm.normalize ( change , com.google.gerrit.server.git.LabelNormalizerTest.list ( cr , v ) ) ) ; }
Source:
public void delete ( com.google.gerrit.reviewdb.client.Project project , boolean preserveGitRepository ) throws java.io.IOException , org.eclipse.jgit.errors.RepositoryNotFoundException { org.eclipse.jgit.lib.Repository repository = repoManager.openRepository ( project.getNameKey ( ) ) ; java.io.File repoParentFile = repository.getDirectory ( ) . getParentFile ( ) ; cleanCache ( repository ) ; if ( ! preserveGitRepository ) { deleteGitRepository ( project.getNameKey ( ) , repoParentFile ) ; } }

Target:
public void delete ( com.google.gerrit.reviewdb.client.Project project , boolean preserveGitRepository ) throws java.io.IOException , org.eclipse.jgit.errors.RepositoryNotFoundException { org.eclipse.jgit.lib.Repository repository = repoManager.openRepository ( project.getNameKey ( ) ) ; java.io.File repoFile = repository.getDirectory ( ) ; cleanCache ( repository ) ; if ( ! preserveGitRepository ) { deleteGitRepository ( project.getNameKey ( ) , repoFile ) ; } }
Source:
public java.util.Optional < java.lang.String > permissionName ( ) { return java.util.Optional.of ( com.google.gerrit.common.data.Permission.forLabel ( label ( ) ) ) ; }

Target:
public java.util.Optional < java.lang.String > permissionName ( ) { switch ( forUser ) { case SELF : return java.util.Optional.of ( com.google.gerrit.common.data.Permission.forLabel ( label ( ) ) ) ; case ON_BEHALF_OF : return java.util.Optional.of ( com.google.gerrit.common.data.Permission.forLabelAs ( label ( ) ) ) ; } return java.util.Optional.empty ( ) ; }
Source:
private void warning ( final java.lang.String msg ) { println ( ( "WARNING: " + msg ) ) ; }

Target:
private void warning ( final java.lang.String msg ) { switch ( outputFormat ) { case JSON : { final com.google.gson.JsonObject obj = new com.google.gson.JsonObject ( ) ; obj.addProperty ( "type" , "warning" ) ; obj.addProperty ( "message" , msg ) ; println ( obj.toString ( ) ) ; break ; } case PRETTY : default : println ( ( "WARNING: " + msg ) ) ; break ; } }
Source:
private void initReplyButton ( ) { reply.setTitle ( com.google.gerrit.client.Gerrit.getConfig ( ) . getReplyTitle ( ) ) ; reply.setHTML ( new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) . openDiv ( ) . append ( com.google.gerrit.client.Gerrit.getConfig ( ) . getReplyLabel ( ) ) . closeDiv ( ) ) ; if ( changeInfo.revision ( revision ) . is_edit ( ) ) { reply.setVisible ( false ) ; quickApprove.setVisible ( false ) ; } }

Target:
private void initChangeAction ( com.google.gerrit.client.changes.ChangeInfo info ) { if ( ( info.status ( ) ) == ( com.google.gerrit.reviewdb.client.Change.Status.DRAFT ) ) { com.google.gerrit.client.rpc.NativeMap < com.google.gerrit.client.actions.ActionInfo > actions = ( info.has_actions ( ) ) ? info.actions ( ) : com.google.gerrit.client.rpc.NativeMap.< com.google.gerrit.client.actions.ActionInfo > create ( ) ; actions.copyKeysIntoChildren ( "id" ) ; if ( actions.containsKey ( "/" ) ) { deleteChange.setVisible ( true ) ; deleteChange.setTitle ( actions.get ( "/" ) . title ( ) ) ; } } }
Source:
private static com.google.gerrit.client.change.RelatedChanges.MyTable getMyTable ( com.google.gwt.dom.client.NativeEvent event ) { com.google.gwt.dom.client.Element e = event.getEventTarget ( ) . cast ( ) ; for ( e = com.google.gwt.user.client.DOM.getParent ( e ) ; e != null ; e = com.google.gwt.user.client.DOM.getParent ( e ) ) { com.google.gwt.user.client.EventListener l = com.google.gwt.user.client.DOM.getEventListener ( e ) ; if ( l instanceof com.google.gerrit.client.change.RelatedChanges.MyTable ) { return ( ( com.google.gerrit.client.change.RelatedChanges.MyTable ) ( l ) ) ; } } return null ; }

Target:
public void onSelection ( com.google.gwt.event.logical.shared.SelectionEvent < java.lang.Integer > event ) { if ( ( selectedTab ) >= 0 ) { tabs.get ( selectedTab ) . registerKeys ( false ) ; } selectedTab = event.getSelectedItem ( ) ; tabs.get ( selectedTab ) . registerKeys ( true ) ; }
Source:
public void submitWithErrorMessage ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = newChange ( ) ; com.google.gerrit.server.notedb.ChangeUpdate update = newUpdate ( c , changeOwner ) ; update.setSubject ( "Submit patch set 1" ) ; update.submit ( com.google.common.collect.ImmutableList.of ( submitRecord ( "RULE_ERROR" , "Problem with patch set:\n1" ) ) ) ; update.commit ( ) ; assertBodyEquals ( ( "Submit patch set 1\n" + ( ( ( "\n" + "Patch-set: 1\n" ) + "Status: submitted\n" ) + "Submitted-with: RULE_ERROR Problem with patch set: 1\n" ) ) , update.getRevision ( ) ) ; }

Target:
public void submitWithErrorMessage ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = newChange ( ) ; com.google.gerrit.server.notedb.ChangeUpdate update = newUpdate ( c , changeOwner ) ; update.setSubject ( "Submit patch set 1" ) ; update.merge ( com.google.common.collect.ImmutableList.of ( submitRecord ( "RULE_ERROR" , "Problem with patch set:\n1" ) ) ) ; update.commit ( ) ; assertBodyEquals ( ( "Submit patch set 1\n" + ( ( ( "\n" + "Patch-set: 1\n" ) + "Status: merged\n" ) + "Submitted-with: RULE_ERROR Problem with patch set: 1\n" ) ) , update.getRevision ( ) ) ; }
Source:
public com.google.gerrit.server.query.change.ChangeDataSource getSource ( com.google.gerrit.server.index.IndexPredicate < com.google.gerrit.server.query.change.ChangeData > p ) throws com.google.gerrit.server.query.QueryParseException { if ( ( p.getType ( ) ) == ( com.google.gerrit.server.index.FieldType.INTEGER ) ) { return intQuery ( p ) ; } else if ( ( p.getType ( ) ) == ( com.google.gerrit.server.index.FieldType.EXACT ) ) { return exactQuery ( p ) ; } else { throw com.google.gerrit.lucene.LuceneChangeIndex.badFieldType ( p.getType ( ) ) ; } }

Target:
private org.apache.lucene.search.Query fieldQuery ( com.google.gerrit.server.index.IndexPredicate < com.google.gerrit.server.query.change.ChangeData > p ) throws com.google.gerrit.server.query.QueryParseException { if ( ( p.getType ( ) ) == ( com.google.gerrit.server.index.FieldType.INTEGER ) ) { return intQuery ( p ) ; } else if ( ( p.getType ( ) ) == ( com.google.gerrit.server.index.FieldType.EXACT ) ) { return exactQuery ( p ) ; } else { throw com.google.gerrit.lucene.LuceneChangeIndex.badFieldType ( p.getType ( ) ) ; } }
Source:
public void onAddGroupsToGroup ( com.google.gerrit.reviewdb.client.Account.Id me , java.util.Collection < com.google.gerrit.reviewdb.client.AccountGroupById > added ) { java.util.List < com.google.gerrit.reviewdb.client.AccountGroupByIdAud > includesAudit = new java.util.ArrayList < > ( ) ; for ( com.google.gerrit.reviewdb.client.AccountGroupById groupInclude : added ) { com.google.gerrit.reviewdb.client.AccountGroupByIdAud audit = new com.google.gerrit.reviewdb.client.AccountGroupByIdAud ( groupInclude , me , com.google.gerrit.server.util.TimeUtil.nowTs ( ) ) ; includesAudit.add ( audit ) ; } try { db.get ( ) . accountGroupByIdAud ( ) . insert ( includesAudit ) ; } catch ( com.google.gwtorm.server.OrmException e ) { logOrmExceptionForGroups ( "Cannot log add groups to group event performed by user" , me , added , e ) ; } }

Target:
public void onAddGroupsToGroup ( com.google.gerrit.reviewdb.client.Account.Id me , java.util.Collection < com.google.gerrit.reviewdb.client.AccountGroupById > added ) { java.util.List < com.google.gerrit.reviewdb.client.AccountGroupByIdAud > includesAudit = new java.util.ArrayList < > ( ) ; for ( com.google.gerrit.reviewdb.client.AccountGroupById groupInclude : added ) { com.google.gerrit.reviewdb.client.AccountGroupByIdAud audit = new com.google.gerrit.reviewdb.client.AccountGroupByIdAud ( groupInclude , me , com.google.gerrit.common.TimeUtil.nowTs ( ) ) ; includesAudit.add ( audit ) ; } try { db.get ( ) . accountGroupByIdAud ( ) . insert ( includesAudit ) ; } catch ( com.google.gwtorm.server.OrmException e ) { logOrmExceptionForGroups ( "Cannot log add groups to group event performed by user" , me , added , e ) ; } }
Source:
public void suggestReviewersNoResult3 ( ) throws java.lang.Exception { java.lang.String changeId = createChange ( ) . getChangeId ( ) ; java.util.List < com.google.gerrit.extensions.common.SuggestedReviewerInfo > reviewers = suggestReviewers ( changeId , "u" , 6 ) ; com.google.common.truth.Truth.assertThat ( reviewers ) . isEmpty ( ) ; }

Target:
public void suggestReviewersNoResult3 ( ) throws java.lang.Exception { java.lang.String changeId = createChange ( ) . getChangeId ( ) ; java.util.List < com.google.gerrit.extensions.common.SuggestedReviewerInfo > reviewers = suggestReviewers ( changeId , name ( "" ) . substring ( 0 , 1 ) , 6 ) ; com.google.common.truth.Truth.assertThat ( reviewers ) . isEmpty ( ) ; }
Source:
private void setSubmitType ( final com.google.gerrit.reviewdb.Project.SubmitType newSubmitType ) { if ( ( submitType ) != null ) { for ( int i = 0 ; i < ( submitType.getItemCount ( ) ) ; i ++ ) { if ( newSubmitType.name ( ) . equals ( submitType.getValue ( i ) ) ) { submitType.setSelectedIndex ( i ) ; return ; } } submitType.setSelectedIndex ( ( - 1 ) ) ; } }

Target:
private void setSubmitType ( final com.google.gerrit.reviewdb.Project.SubmitType newSubmitType ) { int index = - 1 ; if ( ( submitType ) != null ) { for ( int i = 0 ; i < ( submitType.getItemCount ( ) ) ; i ++ ) { if ( newSubmitType.name ( ) . equals ( submitType.getValue ( i ) ) ) { index = i ; break ; } } submitType.setSelectedIndex ( index ) ; setEnabledForUseContentMerge ( ) ; } }
Source:
protected void assertApproved ( java.lang.String changeId ) throws java.io.IOException { com.google.gerrit.server.change.ChangeJson.ChangeInfo c = getChange ( changeId , com.google.gerrit.common.changes.ListChangesOption.DETAILED_LABELS ) ; com.google.gerrit.server.change.ChangeJson.LabelInfo cr = c.labels.get ( "Code-Review" ) ; org.junit.Assert.assertEquals ( 1 , cr.all.size ( ) ) ; org.junit.Assert.assertEquals ( 2 , cr.all.get ( 0 ) . value.intValue ( ) ) ; org.junit.Assert.assertEquals ( "Administrator" , cr.all.get ( 0 ) . name ) ; }

Target:
protected void assertApproved ( java.lang.String changeId ) throws java.io.IOException { com.google.gerrit.server.change.ChangeJson.ChangeInfo c = getChange ( changeId , com.google.gerrit.extensions.common.ListChangesOption.DETAILED_LABELS ) ; com.google.gerrit.server.change.ChangeJson.LabelInfo cr = c.labels.get ( "Code-Review" ) ; org.junit.Assert.assertEquals ( 1 , cr.all.size ( ) ) ; org.junit.Assert.assertEquals ( 2 , cr.all.get ( 0 ) . value.intValue ( ) ) ; org.junit.Assert.assertEquals ( "Administrator" , cr.all.get ( 0 ) . name ) ; }
Source:
public static java.lang.String toLongString ( final com.google.gerrit.extensions.client.ProjectState type ) { if ( type == null ) { return "" ; } switch ( type ) { case ACTIVE : return com.google.gerrit.client.admin.Util.C.projectState_ACTIVE ( ) ; case READ_ONLY : return com.google.gerrit.client.admin.Util.C.projectState_READ_ONLY ( ) ; case HIDDEN : return com.google.gerrit.client.admin.Util.C.projectState_HIDDEN ( ) ; default : return type.name ( ) ; } }

Target:
public static java.lang.String toLongString ( final com.google.gerrit.extensions.client.ProjectState type ) { if ( type == null ) { return "" ; } switch ( type ) { case ACTIVE : return AdminConstants.I.projectState_ACTIVE ( ) ; case READ_ONLY : return AdminConstants.I.projectState_READ_ONLY ( ) ; case HIDDEN : return AdminConstants.I.projectState_HIDDEN ( ) ; default : return type.name ( ) ; } }
Source:
void display ( final java.util.Map < com.google.gerrit.reviewdb.AccountGroup.Id , com.google.gerrit.reviewdb.AccountGroup > groups , final java.util.List < com.google.gerrit.reviewdb.RefRight > refRights ) { while ( 1 < ( table.getRowCount ( ) ) ) table.removeRow ( ( ( table.getRowCount ( ) ) - 1 ) ) ; for ( final com.google.gerrit.reviewdb.RefRight r : refRights ) { final int row = table.getRowCount ( ) ; table.insertRow ( row ) ; applyDataRowStyle ( row ) ; populate ( row , groups , r ) ; } }

Target:
void display ( final java.util.Map < com.google.gerrit.reviewdb.AccountGroup.Id , com.google.gerrit.reviewdb.AccountGroup > groups , final java.util.List < com.google.gerrit.common.data.InheritedRefRight > refRights ) { canDelete = false ; while ( 1 < ( table.getRowCount ( ) ) ) table.removeRow ( ( ( table.getRowCount ( ) ) - 1 ) ) ; for ( final com.google.gerrit.common.data.InheritedRefRight r : refRights ) { final int row = table.getRowCount ( ) ; table.insertRow ( row ) ; applyDataRowStyle ( row ) ; populate ( row , groups , r ) ; } }
Source:
public void testUnblockInLocal_Fails ( ) { com.google.gerrit.server.project.Util.grant ( util.getParentConfig ( ) , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/*" ) . setBlock ( ) ; com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.PUSH , fixers , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl f = util.user ( local , fixers ) ; org.junit.Assert.assertFalse ( "u can't push" , f.controlForRef ( "refs/heads/master" ) . canUpdate ( ) ) ; }

Target:
public void testUnblockInLocal_Fails ( ) { com.google.gerrit.server.project.Util.block ( util.getParentConfig ( ) , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.PUSH , fixers , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl f = util.user ( local , fixers ) ; org.junit.Assert.assertFalse ( "u can't push" , f.controlForRef ( "refs/heads/master" ) . canUpdate ( ) ) ; }
Source:
private void assertResult ( com.google.gerrit.acceptance.RestResponse r , java.util.List < java.lang.String > expected ) throws java.io.IOException { org.junit.Assert.assertEquals ( HttpStatus.SC_OK , r.getStatusCode ( ) ) ; java.util.List < java.lang.String > result = com.google.gerrit.acceptance.rest.change.HashtagsIT.toHashtagList ( r ) ; org.junit.Assert.assertEquals ( expected , result ) ; }

Target:
private void assertResult ( com.google.gerrit.acceptance.RestResponse r , java.util.List < java.lang.String > expected ) throws java.io.IOException { com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( HttpStatus.SC_OK ) ; java.util.List < java.lang.String > result = com.google.gerrit.acceptance.rest.change.HashtagsIT.toHashtagList ( r ) ; com.google.common.truth.Truth.assertThat ( result ) . containsExactlyElementsIn ( expected ) ; }
Source:
public static void assertProjectOwners ( java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.UUID > expectedOwners , com.google.gerrit.server.project.ProjectState state ) { for ( com.google.gerrit.reviewdb.client.AccountGroup.UUID g : state.getOwners ( ) ) { org.junit.Assert.assertTrue ( ( "unexpected owner group " + g ) , expectedOwners.remove ( g ) ) ; } org.junit.Assert.assertTrue ( ( "missing owner groups: " + expectedOwners ) , expectedOwners.isEmpty ( ) ) ; }

Target:
public static void assertProjectOwners ( java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.UUID > expectedOwners , com.google.gerrit.server.project.ProjectState state ) { for ( com.google.gerrit.reviewdb.client.AccountGroup.UUID g : state.getOwners ( ) ) { com.google.common.truth.Truth.assertThat ( expectedOwners.remove ( g ) ) . isTrue ( ) ; } com.google.common.truth.Truth.assertThat ( expectedOwners ) . isEmpty ( ) ; }
Source:
public java.util.List < com.google.gerrit.server.query.change.ChangeData > byProjectCommit ( com.google.gerrit.reviewdb.client.Project.NameKey project , java.lang.String hash ) throws com.google.gwtorm.server.OrmException { return query ( com.google.gerrit.server.query.Predicate.and ( com.google.gerrit.server.query.change.InternalChangeQuery.project ( project ) , com.google.gerrit.server.query.change.InternalChangeQuery.commit ( com.google.gerrit.server.query.change.InternalChangeQuery.schema ( indexes ) , hash ) ) ) ; }

Target:
public java.util.List < com.google.gerrit.server.query.change.ChangeData > byProjectCommits ( com.google.gerrit.reviewdb.client.Project.NameKey project , java.util.List < java.lang.String > hashes ) throws com.google.gwtorm.server.OrmException { int n = ( indexConfig.maxTerms ( ) ) - 1 ; com.google.common.base.Preconditions.checkArgument ( ( ( hashes.size ( ) ) <= n ) , "cannot exceed %s commits" , n ) ; return query ( com.google.gerrit.server.query.Predicate.and ( com.google.gerrit.server.query.change.InternalChangeQuery.project ( project ) , com.google.gerrit.server.query.Predicate.or ( com.google.gerrit.server.query.change.InternalChangeQuery.commits ( hashes ) ) ) ) ; }
Source:
private org.eclipse.jgit.lib.ObjectId createCommit ( com.google.gerrit.server.IdentifiedUser me , org.eclipse.jgit.lib.ObjectInserter inserter , org.eclipse.jgit.revwalk.RevCommit prevEdit , org.eclipse.jgit.revwalk.RevCommit base , org.eclipse.jgit.lib.ObjectId tree , java.lang.String msg ) throws java.io.IOException { org.eclipse.jgit.lib.CommitBuilder builder = new org.eclipse.jgit.lib.CommitBuilder ( ) ; builder.setTreeId ( tree ) ; builder.setParentIds ( base ) ; builder.setAuthor ( prevEdit.getAuthorIdent ( ) ) ; builder.setCommitter ( getCommitterIdent ( me ) ) ; builder.setMessage ( msg ) ; return inserter.insert ( builder ) ; }

Target:
private org.eclipse.jgit.lib.ObjectId createCommit ( com.google.gerrit.server.IdentifiedUser me , org.eclipse.jgit.lib.ObjectInserter inserter , org.eclipse.jgit.revwalk.RevCommit revision , org.eclipse.jgit.lib.ObjectId tree , java.lang.String msg ) throws java.io.IOException { org.eclipse.jgit.lib.CommitBuilder builder = new org.eclipse.jgit.lib.CommitBuilder ( ) ; builder.setTreeId ( tree ) ; builder.setParentIds ( revision.getParents ( ) ) ; builder.setAuthor ( revision.getAuthorIdent ( ) ) ; builder.setCommitter ( getCommitterIdent ( me ) ) ; builder.setMessage ( msg ) ; return inserter.insert ( builder ) ; }