auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void renderJson ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse res , java.lang.Object src , java.lang.reflect.Type typeOfSrc ) throws java.io.IOException { setApiHeaders ( res , com.google.gitiles.FormatType.JSON ) ; res.setStatus ( javax.servlet.http.HttpServletResponse.SC_OK ) ; java.io.Writer writer = newWriter ( res ) ; newGsonBuilder ( req ) . create ( ) . toJson ( src , typeOfSrc , writer ) ; writer.write ( '\n' ) ; writer.close ( ) ; }

Target:
protected void renderJson ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse res , java.lang.Object src , java.lang.reflect.Type typeOfSrc ) throws java.io.IOException { setApiHeaders ( res , com.google.gitiles.FormatType.JSON ) ; res.setStatus ( javax.servlet.http.HttpServletResponse.SC_OK ) ; try ( java.io.Writer writer = com.google.gitiles.BaseServlet.newWriter ( req , res ) ) { newGsonBuilder ( req ) . create ( ) . toJson ( src , typeOfSrc , writer ) ; writer.write ( '\n' ) ; } }
Source:
public boolean apply ( com.google.gerrit.reviewdb.client.PatchSet input ) { try { return changeControl ( ) . isPatchVisible ( input , db ) ; } catch ( com.google.gwtorm.server.OrmException e ) { return false ; } }

Target:
public java.util.Collection < com.google.gerrit.reviewdb.client.PatchSet > visiblePatchSets ( ) throws com.google.gwtorm.server.OrmException { com.google.common.base.Predicate < com.google.gerrit.reviewdb.client.PatchSet > predicate = ( ps ) -> { try { return changeControl ( ) . isPatchVisible ( ps , db ) ; } catch ( com.google.gwtorm.server.OrmException e ) { return false ; } } ; return com.google.common.collect.FluentIterable.from ( patchSets ( ) ) . filter ( predicate ) . toList ( ) ; }
Source:
private static java.util.Set < java.lang.String > scanSectionNames ( com.google.gerrit.server.git.ProjectConfig config ) { java.util.Set < java.lang.String > names = new java.util.HashSet < java.lang.String > ( ) ; for ( com.google.gerrit.common.data.AccessSection section : config.getAccessSections ( ) ) { names.add ( section.getName ( ) ) ; } return names ; }

Target:
protected com.google.gerrit.common.data.ProjectAccess updateProjectConfig ( com.google.gerrit.server.git.ProjectConfig config , com.google.gerrit.server.git.MetaDataUpdate md ) throws com.google.gerrit.server.project.NoSuchProjectException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { config.commit ( md ) ; projectCache.evict ( config.getProject ( ) ) ; return projectAccessFactory.create ( projectName ) . call ( ) ; }
Source:
protected void onLoad ( ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { com.google.gerrit.server.git.ValidationError.Sink errors = new com.google.gerrit.server.git.ValidationError.Sink ( ) { @ java.lang.Override public void error ( com.google.gerrit.server.git.ValidationError error ) { com.google.gerrit.server.account.VersionedAccountQueries.log.error ( ( ( ( "Error parsing file " + ( com.google.gerrit.server.git.QueryList.FILE_NAME ) ) + ": " ) + ( error.getMessage ( ) ) ) ) ; } } ; queryList = com.google.gerrit.server.git.QueryList.parse ( readUTF8 ( QueryList.FILE_NAME ) , errors ) ; }

Target:
protected void onLoad ( ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { queryList = com.google.gerrit.server.git.QueryList.parse ( readUTF8 ( QueryList.FILE_NAME ) , com.google.gerrit.server.git.QueryList.createLoggerSink ( QueryList.FILE_NAME , com.google.gerrit.server.account.VersionedAccountQueries.log ) ) ; }
Source:
protected void setUp ( ) throws java.lang.Exception { repo = new org.eclipse.jgit.junit.TestRepository < org.eclipse.jgit.storage.dfs.DfsRepository > ( new org.eclipse.jgit.storage.dfs.InMemoryRepository ( new org.eclipse.jgit.storage.dfs.DfsRepositoryDescription ( "test" ) ) ) ; walk = new org.eclipse.jgit.revwalk.RevWalk ( repo.getRepository ( ) ) ; cache = new com.google.gitiles.TimeCache ( ) ; start = ( repo.getClock ( ) . getTime ( ) ) / 1000 ; }

Target:
protected void setUp ( ) throws java.lang.Exception { repo = new org.eclipse.jgit.junit.TestRepository < org.eclipse.jgit.internal.storage.dfs.DfsRepository > ( new org.eclipse.jgit.internal.storage.dfs.InMemoryRepository ( new org.eclipse.jgit.internal.storage.dfs.DfsRepositoryDescription ( "test" ) ) ) ; walk = new org.eclipse.jgit.revwalk.RevWalk ( repo.getRepository ( ) ) ; cache = new com.google.gitiles.TimeCache ( ) ; start = ( repo.getClock ( ) . getTime ( ) ) / 1000 ; }
Source:
java.lang.Runnable maybePrevVimSearch ( final net.codemirror.lib.CodeMirror cm ) { return new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { if ( cm.vim ( ) . hasSearchHighlight ( ) ) { cm.vim ( ) . handleKey ( "n" ) ; } else { getCommentManager ( ) . commentNav ( cm , Direction.NEXT ) . run ( ) ; } } } ; }

Target:
java.lang.Runnable maybePrevVimSearch ( final net.codemirror.lib.CodeMirror cm ) { return new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { if ( cm.vim ( ) . hasSearchHighlight ( ) ) { cm.vim ( ) . handleKey ( "N" ) ; } else { getCommentManager ( ) . commentNav ( cm , Direction.NEXT ) . run ( ) ; } } } ; }
Source:
private java.util.List < com.google.gerrit.extensions.common.WebLinkInfo > getFileWebLinks ( com.google.gerrit.reviewdb.client.Project project , java.lang.String rev , java.lang.String file ) { java.util.List < com.google.gerrit.extensions.common.WebLinkInfo > fileWebLinks = new java.util.ArrayList < > ( ) ; for ( com.google.gerrit.extensions.common.WebLinkInfo link : webLinks.getFileLinks ( project.getName ( ) , rev , file ) ) { if ( ( ! ( com.google.common.base.Strings.isNullOrEmpty ( link.name ) ) ) && ( ! ( com.google.common.base.Strings.isNullOrEmpty ( link.url ) ) ) ) { fileWebLinks.add ( link ) ; } } return fileWebLinks ; }

Target:
private java.util.List < com.google.gerrit.extensions.common.WebLinkInfo > getFileWebLinks ( com.google.gerrit.reviewdb.client.Project project , java.lang.String rev , java.lang.String file ) { java.util.List < com.google.gerrit.extensions.common.WebLinkInfo > links = webLinks.getFileLinks ( project.getName ( ) , rev , file ) ; return ! ( links.isEmpty ( ) ) ? links : null ; }
Source:
private void outline ( org.pegdown.ast.Node node ) { if ( node instanceof org.pegdown.ast.HeaderNode ) { outline ( ( ( org.pegdown.ast.HeaderNode ) ( node ) ) ) ; } else { for ( org.pegdown.ast.Node child : node.getChildren ( ) ) { outline ( child ) ; } } }

Target:
private void scan ( org.pegdown.ast.Node node , com.google.common.collect.Multimap < java.lang.String , com.google.gitiles.doc.TocFormatter.TocEntry > entries , java.util.Deque < org.pegdown.ast.HeaderNode > stack ) { if ( node instanceof org.pegdown.ast.HeaderNode ) { scan ( ( ( org.pegdown.ast.HeaderNode ) ( node ) ) , entries , stack ) ; } else { for ( org.pegdown.ast.Node child : node.getChildren ( ) ) { scan ( child , entries , stack ) ; } } }
Source:
void addClickHandler ( final java.lang.Runnable callback ) { headerClick = header.addDomHandler ( new com.google.gwt.event.dom.client.ClickHandler ( ) { @ java.lang.Override public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { setOpen ( ( ! ( isOpen ( ) ) ) ) ; callback.run ( ) ; } } , com.google.gwt.event.dom.client.ClickEvent.getType ( ) ) ; }

Target:
protected void onLoad ( ) { super . onLoad ( ) ; headerClick = header.addDomHandler ( new com.google.gwt.event.dom.client.ClickHandler ( ) { @ java.lang.Override public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { setOpen ( ( ! ( isOpen ( ) ) ) ) ; if ( ( clickCallback ) != null ) { clickCallback.run ( ) ; } } } , com.google.gwt.event.dom.client.ClickEvent.getType ( ) ) ; }
Source:
public WorkQueue.Executor get ( ) { final com.google.gerrit.server.git.WorkQueue.Executor executor ; executor = queues.createQueue ( poolSize , "SSH-Stream-Worker" ) ; final java.util.concurrent.ThreadFactory parent = executor.getThreadFactory ( ) ; executor.setThreadFactory ( new java.util.concurrent.ThreadFactory ( ) { @ java.lang.Override public java.lang.Thread newThread ( final java.lang.Runnable task ) { final java.lang.Thread t = parent.newThread ( task ) ; t.setPriority ( java.lang.Thread.MIN_PRIORITY ) ; return t ; } } ) ; return executor ; }

Target:
public java.util.concurrent.ScheduledThreadPoolExecutor get ( ) { return queues.createQueue ( poolSize , "SSH-Stream-Worker" , java.lang.Thread.MIN_PRIORITY ) ; }
Source:
public void generatesExpectedMessageForLongComment ( ) throws java.lang.Exception { mockEvent.change = com.google.common.base.Suppliers.ofInstance ( mockChange ) ; mockEvent.author = com.google.common.base.Suppliers.ofInstance ( mockAccount ) ; mockEvent.comment = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. " + ( ( "Integer tristique ligula nec dapibus lobortis. Nulla venenatis, lacus quis vulputate volutpat, " + "sem neque ornare eros, vel sodales magna risus et diam. Maecenas ultricies justo dictum orci " ) + "scelerisque consequat a vel purus." ) ; mockChange.project = "testproject" ; mockChange.branch = "master" ; mockChange.url = "https://change/" ; mockAccount.name = "Unit Tester" ; com.cisco.gerrit.plugins.slack.message.MessageGenerator messageGenerator ; messageGenerator = com.cisco.gerrit.plugins.slack.message.MessageGeneratorFactory.newInstance ( mockEvent , config ) ; java.lang.String expectedResult ; expectedResult = ( ( ( "{\"text\": \"Unit Tester commented\\n>>>" + "testproject (master): " ) + ( mockEvent.comment.substring ( 0 , 197 ) ) ) + "... (https://change/)\"," ) + "\"channel\": \"#testchannel\",\"username\": \"testuser\"}\n" ; java.lang.String actualResult ; actualResult = messageGenerator.generate ( ) ; org.junit.Assert.assertThat ( actualResult , org.hamcrest.core.Is.is ( org.hamcrest.CoreMatchers.equalTo ( expectedResult ) ) ) ; }

Target:
public void generatesExpectedMessageForLongComment ( ) throws java.lang.Exception { mockEvent.change = com.google.common.base.Suppliers.ofInstance ( mockChange ) ; mockEvent.author = com.google.common.base.Suppliers.ofInstance ( mockAccount ) ; mockEvent.comment = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. " + ( ( "Integer tristique ligula nec dapibus lobortis. Nulla venenatis, lacus quis vulputate volutpat, " + "sem neque ornare eros, vel sodales magna risus et diam. Maecenas ultricies justo dictum orci " ) + "scelerisque consequat a vel purus." ) ; mockChange.project = "testproject" ; mockChange.branch = "master" ; mockChange.url = "https://change/" ; mockChange.owner = mockOwner ; mockOwner.name = "Owner" ; mockAccount.name = "Unit Tester" ; com.cisco.gerrit.plugins.slack.message.MessageGenerator messageGenerator ; messageGenerator = com.cisco.gerrit.plugins.slack.message.MessageGeneratorFactory.newInstance ( mockEvent , config ) ; java.lang.String expectedResult ; expectedResult = ( ( ( "{\"text\": \"Unit Tester commented to Owner\\n>>>" + "testproject (master): " ) + ( mockEvent.comment.substring ( 0 , 197 ) ) ) + "... (https://change/)\"," ) + "\"channel\": \"#testchannel\",\"username\": \"testuser\"}\n" ; java.lang.String actualResult ; actualResult = messageGenerator.generate ( ) ; org.junit.Assert.assertThat ( actualResult , org.hamcrest.core.Is.is ( org.hamcrest.CoreMatchers.equalTo ( expectedResult ) ) ) ; }
Source:
public void changeAssigneeToSelfOnReviewableChangeInReviewDb ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isFalse ( ) ; com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; assign ( sc , sc.owner , assignee ) ; sender.clear ( ) ; assign ( sc , sc.owner , sc.owner ) ; assertThat ( sender ) . notSent ( ) ; }

Target:
public void changeAssigneeToSelfOnReviewableChangeInReviewDb ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isFalse ( ) ; com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; assign ( sc , sc.owner , sc.assignee ) ; sender.clear ( ) ; assign ( sc , sc.owner , sc.owner ) ; assertThat ( sender ) . notSent ( ) ; }
Source:
public void run ( ) { com.google.gerrit.client.Gerrit.doSignIn ( getToken ( ) ) ; }

Target:
public void run ( ) { net.codemirror.lib.CodeMirror.LineHandle handle = cm.getActiveLine ( ) ; int line = cm.getLineNumber ( handle ) ; com.google.gerrit.client.diff.CommentBox box = lineActiveBoxMap.get ( handle ) ; if ( box == null ) { lineActiveBoxMap.put ( handle , addNewDraft ( cm , line ) ) ; } else if ( box instanceof com.google.gerrit.client.diff.DraftBox ) { ( ( com.google.gerrit.client.diff.DraftBox ) ( box ) ) . setEdit ( true ) ; } else { ( ( com.google.gerrit.client.diff.PublishedBox ) ( box ) ) . doReply ( ) ; } }
Source:
public int run ( ) throws java.lang.Exception { final com.google.inject.Injector injector = com.google.inject.Guice.createInjector ( new com.google.gerrit.server.config.GerritServerModule ( ) , new com.google.gerrit.server.ssh.SshDaemonModule ( ) ) ; com.google.gerrit.client.rpc.Common.setGerritConfig ( injector.getInstance ( com.google.gerrit.client.data.GerritConfig.class ) ) ; injector.getInstance ( com.google.gerrit.server.ssh.GerritSshDaemon.class ) . start ( ) ; return never ( ) ; }

Target:
public int run ( ) throws java.lang.Exception { final com.google.inject.Injector injector = com.google.inject.Guice.createInjector ( com.google.inject.Stage.PRODUCTION , new com.google.gerrit.server.config.GerritServerModule ( ) , new com.google.gerrit.server.ssh.SshDaemonModule ( ) ) ; com.google.gerrit.client.rpc.Common.setGerritConfig ( injector.getInstance ( com.google.gerrit.client.data.GerritConfig.class ) ) ; injector.getInstance ( com.google.gerrit.server.ssh.GerritSshDaemon.class ) . start ( ) ; return never ( ) ; }
Source:
public void writeCommit ( com.google.gerrit.server.notedb.BatchMetaDataUpdate batch ) throws com.google.gwtorm.server.OrmException , java.io.IOException { org.eclipse.jgit.lib.CommitBuilder builder = new org.eclipse.jgit.lib.CommitBuilder ( ) ; if ( migration.writeChanges ( ) ) { org.eclipse.jgit.lib.ObjectId treeId = storeRevisionNotes ( ) ; if ( treeId != null ) { builder.setTreeId ( treeId ) ; } } batch.write ( this , builder ) ; if ( ( draftUpdate ) != null ) { draftUpdate.commit ( ) ; } }

Target:
public org.eclipse.jgit.lib.ObjectId commit ( ) throws com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.server.notedb.NoteDbUpdateManager updateManager = updateManagerFactory.create ( getProjectName ( ) ) ; updateManager.add ( this ) ; updateManager.execute ( ) ; return getResult ( ) ; }
Source:
public boolean growFrom ( org.eclipse.jgit.blame.BlameResult blame , int i ) { if ( ( com.google.common.base.Objects.equal ( blame.getSourcePath ( i ) , sourcePath ) ) && ( com.google.common.base.Objects.equal ( blame.getSourceCommit ( i ) , sourceCommit ) ) ) { ( count ) ++ ; return true ; } else { return false ; } }

Target:
public int compareTo ( com.google.gitiles.blame.Region o ) { return ( start ) - ( o.start ) ; }
Source:
public java.lang.String toString ( ) { return "send-email merged" ; }

Target:
private void logError ( java.lang.String msg , java.lang.Throwable t ) { if ( com.google.gerrit.server.git.ReceiveCommits.log.isErrorEnabled ( ) ) { if ( t != null ) { com.google.gerrit.server.git.ReceiveCommits.log.error ( ( ( receiveId ) + msg ) , t ) ; } else { com.google.gerrit.server.git.ReceiveCommits.log.error ( ( ( receiveId ) + msg ) ) ; } } }
Source:
public com.google.gerrit.server.cache.Cache < K , V > get ( ) { if ( ( cache ) == null ) { throw new com.google.inject.ProvisionException ( ( ( "Cache \"" + ( cacheName ) ) + "\" not available" ) ) ; } if ( ( entryCreator ) != null ) { return new com.google.gerrit.server.cache.PopulatingCache < K , V > ( cache , entryCreator.get ( ) ) ; } return new com.google.gerrit.server.cache.SimpleCache < K , V > ( cache ) ; }

Target:
public void bind ( com.google.gerrit.server.cache.Cache < K , V > impl ) { if ( ( cache ) == null ) { throw new com.google.inject.ProvisionException ( "Cache was never registered" ) ; } cache.bind ( impl ) ; }
Source:
public void onSuccess ( com.google.gerrit.client.changes.ChangeInfo.MergeableInfo result ) { if ( canSubmit ) { actions.setSubmitEnabled ( result.mergeable ( ) ) ; statusText.setInnerText ( ( result.mergeable ( ) ? Util.C.readyToSubmit ( ) : Util.C.mergeConflict ( ) ) ) ; } setVisible ( notMergeable , ( ! ( result.mergeable ( ) ) ) ) ; renderSubmitType ( result.submit_type ( ) ) ; }

Target:
public void onSuccess ( com.google.gerrit.client.changes.ChangeInfo.MergeableInfo result ) { if ( canSubmit ) { actions.setSubmitEnabled ( result.mergeable ( ) ) ; if ( status == ( Change.Status.NEW ) ) { statusText.setInnerText ( ( result.mergeable ( ) ? Util.C.readyToSubmit ( ) : Util.C.mergeConflict ( ) ) ) ; } } setVisible ( notMergeable , ( ! ( result.mergeable ( ) ) ) ) ; renderSubmitType ( result.submit_type ( ) ) ; }
Source:
public com.google.gerrit.server.account.GroupControl controlFor ( final com.google.gerrit.reviewdb.client.AccountGroup.UUID groupId ) throws com.google.gerrit.common.errors.NoSuchGroupException { final com.google.gerrit.reviewdb.client.AccountGroup group = groupCache.get ( groupId ) ; if ( group == null ) { throw new com.google.gerrit.common.errors.NoSuchGroupException ( groupId ) ; } return new com.google.gerrit.server.account.GroupControl ( groupCache , user.get ( ) , group ) ; }

Target:
public com.google.gerrit.server.account.GroupControl controlFor ( final com.google.gerrit.reviewdb.client.AccountGroup.UUID groupId ) throws com.google.gerrit.common.errors.NoSuchGroupException { final com.google.gerrit.common.data.GroupDescription.Basic group = groupBackend.get ( groupId ) ; if ( group == null ) { throw new com.google.gerrit.common.errors.NoSuchGroupException ( groupId ) ; } return new com.google.gerrit.server.account.GroupControl ( user.get ( ) , group ) ; }
Source:
public void fill ( ) throws com.google.gwtorm.server.OrmException { try { directory.fillAccountInfo ( com.google.common.collect.Iterables.concat ( created.values ( ) , provided ) , options ) ; } catch ( com.google.gerrit.server.account.AccountDirectory.DirectoryException e ) { com.google.common.base.Throwables.propagateIfPossible ( e.getCause ( ) , com.google.gwtorm.server.OrmException.class ) ; throw new com.google.gwtorm.server.OrmException ( e ) ; } }

Target:
public void fill ( ) throws com.google.gwtorm.server.OrmException { try { directory.fillAccountInfo ( com.google.common.collect.Iterables.concat ( created.values ( ) , provided ) , options ) ; } catch ( com.google.gerrit.server.account.AccountDirectory.DirectoryException e ) { com.google.common.base.Throwables.throwIfInstanceOf ( e.getCause ( ) , com.google.gwtorm.server.OrmException.class ) ; throw new com.google.gwtorm.server.OrmException ( e ) ; } }
Source:
public com.google.gerrit.extensions.common.ChangeInfo apply ( com.google.gerrit.server.change.ChangeResource req , com.google.gerrit.extensions.api.changes.AbandonInput input ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.git.UpdateException , com.google.gwtorm.server.OrmException { com.google.gerrit.server.project.ChangeControl control = req.getControl ( ) ; if ( ! ( control.canAbandon ( dbProvider.get ( ) ) ) ) { throw new com.google.gerrit.extensions.restapi.AuthException ( "abandon not permitted" ) ; } com.google.gerrit.reviewdb.client.Change change = abandon ( control , input.message , input.notify , notifyUtil.resolveAccounts ( input.notifyDetails ) ) ; return json.create ( ChangeJson.NO_OPTIONS ) . format ( change ) ; }

Target:
public com.google.gerrit.extensions.common.ChangeInfo apply ( com.google.gerrit.server.change.ChangeResource req , com.google.gerrit.extensions.api.changes.AbandonInput input ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.permissions.PermissionBackendException , com.google.gerrit.server.update.UpdateException , com.google.gwtorm.server.OrmException { req.permissions ( ) . database ( dbProvider ) . check ( ChangePermission.ABANDON ) ; com.google.gerrit.reviewdb.client.Change change = abandon ( req.getControl ( ) , input.message , input.notify , notifyUtil.resolveAccounts ( input.notifyDetails ) ) ; return json.noOptions ( ) . format ( change ) ; }
Source:
private static com.google.gerrit.extensions.common.InheritableBoolean getBool ( com.google.gwt.user.client.ui.ListBox box ) { int i = box.getSelectedIndex ( ) ; if ( i >= 0 ) { final java.lang.String selectedValue = box.getValue ( i ) ; if ( selectedValue.startsWith ( InheritableBoolean.INHERIT.name ( ) ) ) { return com.google.gerrit.extensions.common.InheritableBoolean.INHERIT ; } return com.google.gerrit.extensions.common.InheritableBoolean.valueOf ( selectedValue ) ; } return com.google.gerrit.extensions.common.InheritableBoolean.INHERIT ; }

Target:
private static com.google.gerrit.extensions.client.InheritableBoolean getBool ( com.google.gwt.user.client.ui.ListBox box ) { int i = box.getSelectedIndex ( ) ; if ( i >= 0 ) { final java.lang.String selectedValue = box.getValue ( i ) ; if ( selectedValue.startsWith ( InheritableBoolean.INHERIT.name ( ) ) ) { return com.google.gerrit.extensions.client.InheritableBoolean.INHERIT ; } return com.google.gerrit.extensions.client.InheritableBoolean.valueOf ( selectedValue ) ; } return com.google.gerrit.extensions.client.InheritableBoolean.INHERIT ; }
Source:
public void manualCertificationDoesNotExternalId ( ) throws java.lang.Exception { addExternalId ( "foo" , "otherId" , null ) ; assertProblems ( com.google.gerrit.gpg.testutil.TestKey.key5 ( ) , ( "Key must contain a valid certification for one of the following " + ( ( ( "identities:\n" + " foo:otherId\n" ) + " gerrit:user\n" ) + " username:user" ) ) ) ; }

Target:
public void manualCertificationDoesNotMatchExternalId ( ) throws java.lang.Exception { addExternalId ( "foo" , "otherId" , null ) ; com.google.gerrit.gpg.GerritPublicKeyChecker checker = checkerFactory.create ( user ) ; assertProblems ( checker.check ( com.google.gerrit.gpg.testutil.TestKeys.key5 ( ) . getPublicKey ( ) ) , Status.BAD , ( "Key must contain a valid certification for one of the following " + ( ( ( "identities:\n" + " foo:otherId\n" ) + " gerrit:user\n" ) + " username:user" ) ) ) ; }
Source:
void loadChangeInfo ( boolean fg , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.changes.ChangeInfo > cb ) { com.google.gerrit.client.rpc.RestApi call = com.google.gerrit.client.changes.ChangeApi.detail ( changeId.get ( ) ) ; com.google.gerrit.client.changes.ChangeList.addOptions ( call , java.util.EnumSet.of ( ListChangesOption.ALL_REVISIONS , ListChangesOption.CURRENT_ACTIONS ) ) ; if ( ! fg ) { call.background ( ) ; } call.get ( cb ) ; }

Target:
void loadChangeInfo ( boolean fg , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.changes.ChangeInfo > cb ) { com.google.gerrit.client.rpc.RestApi call = com.google.gerrit.client.changes.ChangeApi.detail ( changeId.get ( ) ) ; com.google.gerrit.client.changes.ChangeList.addOptions ( call , java.util.EnumSet.of ( ListChangesOption.CURRENT_ACTIONS , ( fg && ( ( revision ) != null ) ? com.google.gerrit.common.changes.ListChangesOption.ALL_REVISIONS : com.google.gerrit.common.changes.ListChangesOption.CURRENT_REVISION ) ) ) ; if ( ! fg ) { call.background ( ) ; } call.get ( cb ) ; }
Source:
public void testCreateGroup ( ) throws java.lang.Exception { java.lang.String newGroupName = name ( "newGroup" ) ; com.google.gerrit.acceptance.RestResponse r = adminSession.put ( ( "/groups/" + newGroupName ) ) ; com.google.gerrit.server.group.GroupJson.GroupInfo g = newGson ( ) . fromJson ( r.getReader ( ) , com.google.gerrit.server.group.GroupJson.GroupInfo.class ) ; com.google.common.truth.Truth.assertThat ( g.name ) . isEqualTo ( newGroupName ) ; com.google.gerrit.reviewdb.client.AccountGroup group = groupCache.get ( new com.google.gerrit.reviewdb.client.AccountGroup.NameKey ( newGroupName ) ) ; com.google.common.truth.Truth.assertThat ( group ) . isNotNull ( ) ; com.google.gerrit.acceptance.rest.group.GroupAssert.assertGroupInfo ( group , g ) ; }

Target:
public void testCreateGroup ( ) throws java.lang.Exception { java.lang.String newGroupName = name ( "newGroup" ) ; com.google.gerrit.acceptance.RestResponse r = adminSession.put ( ( "/groups/" + newGroupName ) ) ; com.google.gerrit.extensions.common.GroupInfo g = newGson ( ) . fromJson ( r.getReader ( ) , com.google.gerrit.extensions.common.GroupInfo.class ) ; com.google.common.truth.Truth.assertThat ( g.name ) . isEqualTo ( newGroupName ) ; com.google.gerrit.reviewdb.client.AccountGroup group = groupCache.get ( new com.google.gerrit.reviewdb.client.AccountGroup.NameKey ( newGroupName ) ) ; com.google.common.truth.Truth.assertThat ( group ) . isNotNull ( ) ; com.google.gerrit.acceptance.rest.group.GroupAssert.assertGroupInfo ( group , g ) ; }
Source:
private static boolean isVisible ( com.google.gerrit.server.restapi.change.RelatedChangesSorter.PatchSetData psd , com.google.gerrit.server.permissions.PermissionBackend.WithUser perm ) throws com.google.gerrit.server.permissions.PermissionBackendException { try { perm.change ( psd.data ( ) ) . check ( ChangePermission.READ ) ; return true ; } catch ( com.google.gerrit.extensions.restapi.AuthException e ) { return false ; } }

Target:
private boolean isVisible ( com.google.gerrit.server.restapi.change.RelatedChangesSorter.PatchSetData psd ) throws com.google.gerrit.server.permissions.PermissionBackendException , java.io.IOException { com.google.gerrit.server.permissions.PermissionBackend.WithUser perm = permissionBackend.user ( currentUserProvider ) . database ( dbProvider ) ; try { perm.change ( psd.data ( ) ) . check ( ChangePermission.READ ) ; } catch ( com.google.gerrit.extensions.restapi.AuthException e ) { return false ; } com.google.gerrit.server.project.ProjectState state = projectCache.checkedGet ( psd.data ( ) . project ( ) ) ; return ( state != null ) && ( state.statePermitsRead ( ) ) ; }
Source:
public void deleteBranchByProjectOwnerForcePushBlocked_Forbidden ( ) throws java.lang.Exception { grantOwner ( ) ; blockForcePush ( ) ; com.google.gerrit.acceptance.RestResponse r = userSession.delete ( ( ( ( "/projects/" + ( project.get ( ) ) ) + "/branches/" ) + ( branch.getShortName ( ) ) ) ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( HttpStatus.SC_FORBIDDEN ) ; r.consume ( ) ; }

Target:
private void assertDeleteForbidden ( ) throws java.lang.Exception { try { branch ( ) . delete ( ) ; org.junit.Assert.fail ( "Expected AuthException" ) ; } catch ( com.google.gerrit.extensions.restapi.AuthException expected ) { } branch ( ) . get ( ) ; }
Source:
public static synchronized void stopSshd ( ) { if ( ( com.google.gerrit.server.ssh.GerritSshDaemon.sshd ) != null ) { try { com.google.gerrit.server.ssh.GerritSshDaemon.sshd.stop ( ) ; com.google.gerrit.server.ssh.GerritSshDaemon.log.info ( "Stopped Gerrit SSHD" ) ; } finally { com.google.gerrit.server.ssh.GerritSshDaemon.sshd = null ; com.google.gerrit.server.ssh.GerritSshDaemon.preferredAddress = null ; com.google.gerrit.server.ssh.GerritSshDaemon.hostKeys = java.util.Collections.emptyList ( ) ; } } }

Target:
public synchronized void stop ( ) { if ( ( acceptor ) != null ) { try { acceptor.dispose ( ) ; com.google.gerrit.server.ssh.GerritSshDaemon.log.info ( "Stopped Gerrit SSHD" ) ; } finally { acceptor = null ; } } }
Source:
public void rollback ( ) throws com.google.gwtorm.server.OrmException { try { if ( ! ( conn.getAutoCommit ( ) ) ) { conn.rollback ( ) ; } } catch ( java.sql.SQLException err ) { throw new com.google.gwtorm.server.OrmException ( "Cannot rollback transaction" , err ) ; } finally { try { conn.setAutoCommit ( true ) ; } catch ( java.sql.SQLException err ) { throw new com.google.gwtorm.server.OrmException ( "Cannot set auto commit mode" , err ) ; } } }

Target:
public void rollback ( ) throws com.google.gwtorm.server.OrmException { try { if ( ! ( conn.getAutoCommit ( ) ) ) { transactionException = null ; conn.rollback ( ) ; } } catch ( java.sql.SQLException err ) { throw new com.google.gwtorm.server.OrmException ( "Cannot rollback transaction" , err ) ; } finally { try { conn.setAutoCommit ( true ) ; } catch ( java.sql.SQLException err ) { throw new com.google.gwtorm.server.OrmException ( "Cannot set auto commit mode" , err ) ; } } }
Source:
private static boolean sameUpdate ( com.google.gerrit.server.notedb.ChangeRebuilder.Event event , com.google.gerrit.server.notedb.AbstractChangeUpdate update ) { return ( ( ( ( update != null ) && ( ( com.google.gerrit.server.notedb.ChangeRebuilder.round ( event.when ) ) == ( com.google.gerrit.server.notedb.ChangeRebuilder.round ( update.getWhen ( ) ) ) ) ) && ( event.who.equals ( update.getUser ( ) . getAccountId ( ) ) ) ) && ( event.psId.equals ( update.getPatchSetId ( ) ) ) ) && ( ! ( event instanceof com.google.gerrit.server.notedb.ChangeRebuilder.FinalUpdatesEvent ) ) ; }

Target:
private long getLastTime ( ) { return getLast ( ) . when.getTime ( ) ; }
Source:
protected void onLoad ( ) { super . onLoad ( ) ; Util.GROUP_SVC.visibleGroups ( new com.google.gerrit.client.rpc.ScreenLoadCallback < com.google.gerrit.common.data.GroupList > ( this ) { @ java.lang.Override protected void preDisplay ( com.google.gerrit.common.data.GroupList result ) { addPanel.setVisible ( result.isCanCreateGroup ( ) ) ; groups.display ( result.getGroups ( ) ) ; groups.finishDisplay ( ) ; } } ) ; }

Target:
protected void onLoad ( ) { super . onLoad ( ) ; addPanel.setVisible ( false ) ; com.google.gerrit.client.account.AccountCapabilities.all ( new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.account.AccountCapabilities > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.account.AccountCapabilities ac ) { addPanel.setVisible ( ac.canPerform ( com.google.gerrit.common.data.GlobalCapability.CREATE_GROUP ) ) ; } } , com.google.gerrit.common.data.GlobalCapability.CREATE_GROUP ) ; Util.GROUP_SVC.visibleGroups ( new com.google.gerrit.client.rpc.ScreenLoadCallback < com.google.gerrit.common.data.GroupList > ( this ) { @ java.lang.Override protected void preDisplay ( com.google.gerrit.common.data.GroupList result ) { groups.display ( result.getGroups ( ) ) ; groups.finishDisplay ( ) ; } } ) ; }
Source:
public boolean equals ( java.lang.Object o ) { if ( o instanceof com.google.gerrit.reviewdb.client.PatchSetApproval ) { com.google.gerrit.reviewdb.client.PatchSetApproval p = ( ( com.google.gerrit.reviewdb.client.PatchSetApproval ) ( o ) ) ; return ( ( java.util.Objects.equals ( key , p.key ) ) && ( java.util.Objects.equals ( value , p.value ) ) ) && ( java.util.Objects.equals ( granted , p.granted ) ) ; } return false ; }

Target:
public boolean equals ( java.lang.Object o ) { if ( o instanceof com.google.gerrit.reviewdb.client.PatchSetApproval ) { com.google.gerrit.reviewdb.client.PatchSetApproval p = ( ( com.google.gerrit.reviewdb.client.PatchSetApproval ) ( o ) ) ; return ( ( ( java.util.Objects.equals ( key , p.key ) ) && ( java.util.Objects.equals ( value , p.value ) ) ) && ( java.util.Objects.equals ( granted , p.granted ) ) ) && ( java.util.Objects.equals ( tag , p.tag ) ) ; } return false ; }
Source:
public void fire ( com.google.gerrit.reviewdb.client.Account account , java.lang.String agreementName ) { if ( ! ( listeners.iterator ( ) . hasNext ( ) ) ) { return ; } com.google.gerrit.server.extensions.events.AgreementSignup.Event e = new com.google.gerrit.server.extensions.events.AgreementSignup.Event ( util.accountInfo ( account ) , agreementName ) ; for ( com.google.gerrit.extensions.events.AgreementSignupListener l : listeners ) { l.onAgreementSignup ( e ) ; } }

Target:
public void fire ( com.google.gerrit.reviewdb.client.Account account , java.lang.String agreementName ) { if ( ! ( listeners.iterator ( ) . hasNext ( ) ) ) { return ; } com.google.gerrit.server.extensions.events.AgreementSignup.Event event = new com.google.gerrit.server.extensions.events.AgreementSignup.Event ( util.accountInfo ( account ) , agreementName ) ; for ( com.google.gerrit.extensions.events.AgreementSignupListener l : listeners ) { try { l.onAgreementSignup ( event ) ; } catch ( java.lang.Exception e ) { com.google.gerrit.server.extensions.events.AgreementSignup.log.warn ( "Error in event listener" , e ) ; } } }
Source:
public boolean shouldPublish ( ) { boolean result ; result = true ; try { java.util.regex.Pattern pattern ; pattern = java.util.regex.Pattern.compile ( config.getIgnore ( ) , java.util.regex.Pattern.DOTALL ) ; java.util.regex.Matcher matcher ; matcher = pattern.matcher ( event.change.commitMessage ) ; result = ! ( matcher.matches ( ) ) ; } catch ( java.lang.Exception e ) { com.cisco.gerrit.plugins.slack.message.PatchSetCreatedMessageGenerator.LOGGER.warn ( "The specified ignore pattern was invalid" , e ) ; } return result ; }

Target:
public boolean shouldPublish ( ) { if ( ! ( config.isEnabled ( ) ) ) return false ; boolean result ; result = true ; try { java.util.regex.Pattern pattern ; pattern = java.util.regex.Pattern.compile ( config.getIgnore ( ) , java.util.regex.Pattern.DOTALL ) ; java.util.regex.Matcher matcher ; matcher = pattern.matcher ( event.change.commitMessage ) ; result = ! ( matcher.matches ( ) ) ; } catch ( java.lang.Exception e ) { com.cisco.gerrit.plugins.slack.message.PatchSetCreatedMessageGenerator.LOGGER.warn ( "The specified ignore pattern was invalid" , e ) ; } return result ; }
Source:
public boolean canDelete ( ) { if ( ( ! ( canWrite ( ) ) ) || ( GitRepositoryManager.REF_CONFIG.equals ( refName ) ) ) { return false ; } switch ( getCurrentUser ( ) . getAccessPath ( ) ) { case REST_API : case JSON_RPC : return ( isOwner ( ) ) || ( canPushWithForce ( ) ) ; case GIT : return canPushWithForce ( ) ; default : return false ; } }

Target:
public boolean canDelete ( ) { if ( ( ! ( canWrite ( ) ) ) || ( GitRepositoryManager.REF_CONFIG.equals ( refName ) ) ) { return false ; } switch ( getCurrentUser ( ) . getAccessPath ( ) ) { case REST_API : case JSON_RPC : case SSH_COMMAND : return ( isOwner ( ) ) || ( canPushWithForce ( ) ) ; case GIT : return canPushWithForce ( ) ; default : return false ; } }
Source:
public void testSubscriptionToExistingRepo ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < ? > superRepo = createProjectWithPush ( "super-project" ) ; org.eclipse.jgit.junit.TestRepository < ? > subRepo = createProjectWithPush ( "subscribed-to-project" ) ; pushChangeTo ( subRepo , "master" ) ; createSubscription ( superRepo , "master" , "subscribed-to-project" , "master" ) ; org.eclipse.jgit.lib.ObjectId subHEAD = pushChangeTo ( subRepo , "master" ) ; expectToHaveSubmoduleState ( superRepo , "master" , "subscribed-to-project" , subHEAD ) ; }

Target:
public void testSubscriptionToExistingRepo ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < ? > superRepo = createProjectWithPush ( "super-project" ) ; org.eclipse.jgit.junit.TestRepository < ? > subRepo = createProjectWithPush ( "subscribed-to-project" ) ; pushChangeTo ( subRepo , "master" ) ; createSubmoduleSubscription ( superRepo , "master" , "subscribed-to-project" , "master" ) ; org.eclipse.jgit.lib.ObjectId subHEAD = pushChangeTo ( subRepo , "master" ) ; expectToHaveSubmoduleState ( superRepo , "master" , "subscribed-to-project" , subHEAD ) ; }
Source:
private void setThreadFactory ( com.google.gerrit.server.git.WorkQueue.Executor executor ) { final java.util.concurrent.ThreadFactory parent = executor.getThreadFactory ( ) ; executor.setThreadFactory ( new java.util.concurrent.ThreadFactory ( ) { @ java.lang.Override public java.lang.Thread newThread ( final java.lang.Runnable task ) { final java.lang.Thread t = parent.newThread ( task ) ; t.setPriority ( java.lang.Thread.MIN_PRIORITY ) ; return t ; } } ) ; }

Target:
private void setThreadFactory ( java.util.concurrent.ScheduledThreadPoolExecutor executor ) { final java.util.concurrent.ThreadFactory parent = executor.getThreadFactory ( ) ; executor.setThreadFactory ( new java.util.concurrent.ThreadFactory ( ) { @ java.lang.Override public java.lang.Thread newThread ( java.lang.Runnable task ) { final java.lang.Thread t = parent.newThread ( task ) ; t.setPriority ( java.lang.Thread.MIN_PRIORITY ) ; return t ; } } ) ; }
Source:
public java.lang.String toString ( ) { return new java.lang.StringBuilder ( ) . append ( '[' ) . append ( key ) . append ( ": " ) . append ( value ) . append ( ']' ) . toString ( ) ; }

Target:
public java.lang.String toString ( ) { return new java.lang.StringBuilder ( ) . append ( '[' ) . append ( key ) . append ( ": " ) . append ( value ) . append ( ",tag:" ) . append ( tag ) . append ( ']' ) . toString ( ) ; }
Source:
private com.google.gerrit.server.git.Account getAccount ( com.google.gerrit.server.git.CodeReviewCommit codeReviewCommit ) { com.google.gerrit.server.git.Account account = null ; com.google.gerrit.server.git.PatchSetApproval submitter = approvalsUtil.getSubmitter ( db , codeReviewCommit.notes ( ) , codeReviewCommit.getPatchsetId ( ) ) ; if ( submitter != null ) { account = accountCache.get ( submitter.getAccountId ( ) ) . getAccount ( ) ; } return account ; }

Target:
private void updateSubmoduleSubscriptions ( com.google.gerrit.server.git.MergeOp.OpenBranch ob , com.google.gerrit.server.git.SubmoduleOp subOp ) { com.google.gerrit.server.git.CodeReviewCommit branchTip = ob.oldTip ; com.google.gerrit.server.git.MergeTip mergeTip = ob.mergeTip ; if ( ( mergeTip != null ) && ( ( branchTip == null ) || ( branchTip != ( mergeTip.getCurrentTip ( ) ) ) ) ) { logDebug ( "Updating submodule subscriptions for branch {}" , ob.name ) ; try { subOp.updateSubmoduleSubscriptions ( db , ob.name ) ; } catch ( com.google.gerrit.server.git.SubmoduleException e ) { logError ( ( "The submodule subscriptions were not updated according" + "to the .gitmodules files" ) , e ) ; } } }
Source:
public void testAppend_StringBuilder ( ) { final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder b = new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) ; org.junit.Assert.assertSame ( b , b.append ( ( ( java.lang.StringBuilder ) ( null ) ) ) ) ; org.junit.Assert.assertEquals ( "" , b.asString ( ) ) ; org.junit.Assert.assertSame ( b , b.append ( new java.lang.StringBuilder ( "foo" ) ) ) ; org.junit.Assert.assertSame ( b , b.append ( new java.lang.StringBuilder ( "bar" ) ) ) ; org.junit.Assert.assertEquals ( "foobar" , b.asString ( ) ) ; }

Target:
public void testAppend_String ( ) { final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder b = new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) ; com.google.common.truth.Truth.assertThat ( b ) . isSameAs ( b.append ( ( ( java.lang.String ) ( null ) ) ) ) ; com.google.common.truth.Truth.assertThat ( b.asString ( ) ) . isEmpty ( ) ; com.google.common.truth.Truth.assertThat ( b ) . isSameAs ( b.append ( "foo" ) ) ; com.google.common.truth.Truth.assertThat ( b ) . isSameAs ( b.append ( "bar" ) ) ; com.google.common.truth.Truth.assertThat ( b.asString ( ) ) . isEqualTo ( "foobar" ) ; }
Source:
com.google.gerrit.server.project.RefControl forUser ( com.google.gerrit.server.CurrentUser who ) { com.google.gerrit.server.project.ProjectControl newCtl = projectControl.forUser ( who ) ; if ( relevant.isUserSpecific ( ) ) { return newCtl.controlForRef ( getRefName ( ) ) ; } return new com.google.gerrit.server.project.RefControl ( newCtl , getRefName ( ) , relevant ) ; }

Target:
com.google.gerrit.server.project.RefControl forUser ( com.google.gerrit.server.CurrentUser who ) { com.google.gerrit.server.project.ProjectControl newCtl = projectControl.forUser ( who ) ; if ( relevant.isUserSpecific ( ) ) { return newCtl.controlForRef ( refName ) ; } return new com.google.gerrit.server.project.RefControl ( newCtl , refName , relevant ) ; }
Source:
public void delete ( com.google.gerrit.reviewdb.client.Change.Id id ) throws java.io.IOException { org.apache.lucene.index.Term idTerm = com.google.gerrit.lucene.QueryBuilder.idTerm ( id ) ; try { com.google.common.util.concurrent.Futures.allAsList ( openIndex.delete ( idTerm ) , closedIndex.delete ( idTerm ) ) . get ( ) ; } catch ( java.util.concurrent.ExecutionException | java.lang.InterruptedException e ) { throw new java.io.IOException ( e ) ; } }

Target:
public void delete ( com.google.gerrit.reviewdb.client.Change.Id id ) throws java.io.IOException { org.apache.lucene.index.Term idTerm = com.google.gerrit.lucene.LuceneChangeIndex.idTerm ( id ) ; try { com.google.common.util.concurrent.Futures.allAsList ( openIndex.delete ( idTerm ) , closedIndex.delete ( idTerm ) ) . get ( ) ; } catch ( java.util.concurrent.ExecutionException | java.lang.InterruptedException e ) { throw new java.io.IOException ( e ) ; } }
Source:
public void testIsEnabledRefNoParentMatchingBranchDisabled ( ) { java.lang.String [ ] branches = new java.lang.String [ ] { "^refs/heads/test.*" } ; setupIsEnabled ( "false" , null , branches ) ; com.googlesource.gerrit.plugins.its.base.its.ItsConfig itsConfig = createItsConfig ( ) ; replayMocks ( ) ; assertFalse ( itsConfig.isEnabled ( "testProject" , "refs/heads/testBranch" ) ) ; }

Target:
public void testIsEnabledRefNoParentMatchingBranchEnforced ( ) { java.lang.String [ ] branches = new java.lang.String [ ] { "^refs/heads/test.*" } ; setupIsEnabled ( "enforced" , null , branches ) ; com.googlesource.gerrit.plugins.its.base.its.ItsConfig itsConfig = createItsConfig ( ) ; replayMocks ( ) ; com.google.gerrit.reviewdb.client.Project.NameKey projectNK = new com.google.gerrit.reviewdb.client.Project.NameKey ( "testProject" ) ; assertTrue ( itsConfig.isEnabled ( projectNK , "refs/heads/testBranch" ) ) ; }
Source:
public void onFocus ( com.google.gwt.event.dom.client.FocusEvent event ) { groups.setRegisterKeys ( false ) ; }

Target:
protected void onInitUI ( ) { super . onInitUI ( ) ; setPageTitle ( Util.C.groupListTitle ( ) ) ; createGroupLinkPanel = new com.google.gwt.user.client.ui.VerticalPanel ( ) ; createGroupLinkPanel.setStyleName ( Gerrit.RESOURCES.css ( ) . createGroupLink ( ) ) ; createGroupLinkPanel.add ( new com.google.gerrit.client.ui.Hyperlink ( Util.C.headingCreateGroup ( ) , com.google.gerrit.common.PageLinks.ADMIN_CREATE_GROUP ) ) ; add ( createGroupLinkPanel ) ; groups = new com.google.gerrit.client.admin.GroupTable ( true , com.google.gerrit.common.PageLinks.ADMIN_GROUPS ) ; add ( groups ) ; }
Source:
public void testUnblockInParentBlockInLocal ( ) { com.google.gerrit.server.project.Util.block ( parent , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.Util.allow ( parent , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) ; com.google.gerrit.server.project.Util.block ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl d = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; org.junit.Assert.assertFalse ( "u can't push" , d.controlForRef ( "refs/heads/master" ) . canUpdate ( ) ) ; }

Target:
public void testUnblockInParentBlockInLocal ( ) { com.google.gerrit.server.project.Util.block ( parent , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.Util.allow ( parent , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) ; com.google.gerrit.server.project.Util.block ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl d = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; assertCannotUpdate ( "refs/heads/master" , d ) ; }
Source:
public void cleanUp ( ) { for ( java.nio.file.Path path : listFiles ( ) ) { com.google.gerrit.httpd.WebSessionManager.Val val = readFile ( path ) ; if ( val != null ) { org.joda.time.DateTime expires = new org.joda.time.DateTime ( val.getExpiresAt ( ) ) ; if ( expires.isBefore ( new org.joda.time.DateTime ( ) ) ) { deleteFile ( path ) ; } } } }

Target:
public void cleanUp ( ) { for ( java.nio.file.Path path : listFiles ( ) ) { com.google.gerrit.httpd.WebSessionManager.Val val = readFile ( path ) ; if ( val != null ) { java.time.Instant expires = java.time.Instant.ofEpochMilli ( val.getExpiresAt ( ) ) ; if ( expires.isBefore ( com.ericsson.gerrit.plugins.highavailability.websession.file.FileBasedWebsessionCache.TimeMachine.now ( ) ) ) { deleteFile ( path ) ; } } } }
Source:
protected void bccStarredBy ( ) { try { for ( com.google.gerrit.reviewdb.StarredChange w : args.db.get ( ) . starredChanges ( ) . byChange ( change.getId ( ) ) ) { add ( RecipientType.BCC , w.getAccountId ( ) ) ; } } catch ( com.google.gwtorm.client.OrmException err ) { } }

Target:
protected void includeWatchers ( com.google.gerrit.reviewdb.client.AccountProjectWatch.NotifyType type ) { try { com.google.gerrit.server.mail.ChangeEmail.Watchers matching = getWatches ( type ) ; add ( RecipientType.TO , matching.to ) ; add ( RecipientType.CC , matching.cc ) ; add ( RecipientType.BCC , matching.bcc ) ; } catch ( com.google.gwtorm.server.OrmException err ) { com.google.gerrit.server.mail.ChangeEmail.log.warn ( ( "Cannot BCC watchers for " + type ) , err ) ; } }
Source:
public void setUp ( ) throws java.lang.Exception { com.google.gerrit.server.git.ProjectConfig cfg = projectCache.checkedGet ( allProjects ) . getConfig ( ) ; codeReview = com.google.common.base.Preconditions.checkNotNull ( cfg.getLabelSections ( ) . get ( "Code-Review" ) ) ; codeReview.setCopyMinScore ( false ) ; codeReview.setCopyMaxScore ( false ) ; codeReview.setCopyAllScoresOnTrivialRebase ( false ) ; codeReview.setCopyAllScoresIfNoCodeChange ( false ) ; codeReview.setDefaultValue ( ( ( short ) ( - 1 ) ) ) ; saveProjectConfig ( cfg ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { com.google.gerrit.server.git.ProjectConfig cfg = projectCache.checkedGet ( allProjects ) . getConfig ( ) ; codeReview = com.google.common.base.Preconditions.checkNotNull ( cfg.getLabelSections ( ) . get ( "Code-Review" ) ) ; codeReview.setCopyMinScore ( false ) ; codeReview.setCopyMaxScore ( false ) ; codeReview.setCopyAllScoresOnTrivialRebase ( false ) ; codeReview.setCopyAllScoresIfNoCodeChange ( false ) ; codeReview.setCopyAllScoresIfNoChange ( false ) ; codeReview.setDefaultValue ( ( ( short ) ( - 1 ) ) ) ; saveProjectConfig ( cfg ) ; }
Source:
public com.google.gerrit.extensions.common.RevisionInfo revisionInfo ( com.google.gerrit.reviewdb.client.Project.NameKey project , com.google.gerrit.reviewdb.client.PatchSet ps ) throws com.google.gerrit.server.GpgException , com.google.gerrit.server.patch.PatchListNotAvailableException , com.google.gerrit.server.permissions.PermissionBackendException , com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.server.query.change.ChangeData cd = changeDataFactory.create ( db.get ( ) , project , ps.getId ( ) . getParentKey ( ) ) ; HEAD ( 8.0 ) ; com.google.gerrit.server.extensions.events.ec0d Merge ; }

Target:
public com.google.gerrit.extensions.common.RevisionInfo revisionInfo ( com.google.gerrit.reviewdb.client.Project.NameKey project , com.google.gerrit.reviewdb.client.PatchSet ps ) throws com.google.gerrit.server.GpgException , com.google.gerrit.server.patch.PatchListNotAvailableException , com.google.gerrit.server.permissions.PermissionBackendException , com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.server.query.change.ChangeData cd = changeDataFactory.create ( db.get ( ) , project , ps.getId ( ) . getParentKey ( ) ) ; return changeJsonFactory.create ( com.google.gerrit.server.extensions.events.EventUtil.CHANGE_OPTIONS ) . getRevisionInfo ( cd , ps ) ; }