auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void setDefault ( ) throws com.google.gerrit.extensions.restapi.RestApiException { com.google.gerrit.extensions.common.SetDashboardInput input = new com.google.gerrit.extensions.common.SetDashboardInput ( ) ; input.id = id ; try { set.apply ( com.google.gerrit.server.project.DashboardResource.projectDefault ( project.getControl ( ) ) , input ) ; } catch ( java.lang.Exception e ) { java.lang.String msg = java.lang.String.format ( "Cannot %s default dashboard" , ( ( id ) != null ? "set" : "remove" ) ) ; throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( msg , e ) ; } }

Target:
public void setDefault ( ) throws com.google.gerrit.extensions.restapi.RestApiException { com.google.gerrit.extensions.common.SetDashboardInput input = new com.google.gerrit.extensions.common.SetDashboardInput ( ) ; input.id = id ; try { set.apply ( com.google.gerrit.server.project.DashboardResource.projectDefault ( project.getProjectState ( ) , project.getUser ( ) ) , input ) ; } catch ( java.lang.Exception e ) { java.lang.String msg = java.lang.String.format ( "Cannot %s default dashboard" , ( ( id ) != null ? "set" : "remove" ) ) ; throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( msg , e ) ; } }
Source:
private org.eclipse.jgit.revwalk.RevCommit parse ( final org.eclipse.jgit.lib.Repository git , com.google.gerrit.reviewdb.PatchSet ps ) throws java.io.IOException , org.eclipse.jgit.errors.IncorrectObjectTypeException , org.eclipse.jgit.errors.MissingObjectException { return new org.eclipse.jgit.revwalk.RevWalk ( git ) . parseCommit ( org.eclipse.jgit.lib.ObjectId.fromString ( ps.getRevision ( ) . get ( ) ) ) ; }

Target:
private org.eclipse.jgit.revwalk.RevCommit parse ( final org.eclipse.jgit.lib.Repository git , com.google.gerrit.reviewdb.PatchSet ps ) throws java.io.IOException , org.eclipse.jgit.errors.IncorrectObjectTypeException , org.eclipse.jgit.errors.MissingObjectException { org.eclipse.jgit.revwalk.RevWalk rw = new org.eclipse.jgit.revwalk.RevWalk ( git ) ; try { return rw.parseCommit ( org.eclipse.jgit.lib.ObjectId.fromString ( ps.getRevision ( ) . get ( ) ) ) ; } finally { rw.release ( ) ; } }
Source:
private void setListBox ( final com.google.gwt.user.client.ui.ListBox f , final short defaultValue , final short currentValue ) { final int n = f.getItemCount ( ) ; for ( int i = 0 ; i < n ; i ++ ) { if ( ( java.lang.Short.parseShort ( f.getValue ( i ) ) ) == currentValue ) { f.setSelectedIndex ( i ) ; return ; } } if ( currentValue != defaultValue ) { setListBox ( f , defaultValue , defaultValue ) ; } }

Target:
private void enable ( final boolean on ) { showSiteHeader.setEnabled ( on ) ; useFlashClipboard.setEnabled ( on ) ; copySelfOnEmails.setEnabled ( on ) ; maximumPageSize.setEnabled ( on ) ; dateFormat.setEnabled ( on ) ; timeFormat.setEnabled ( on ) ; }
Source:
protected PushOneCommit.Result amendChange ( java.lang.String changeId , java.lang.String ref ) throws java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { java.util.Collections.shuffle ( com.google.gerrit.acceptance.AbstractDaemonTest.RANDOM ) ; com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , admin.getIdent ( ) , PushOneCommit.SUBJECT , PushOneCommit.FILE_NAME , new java.lang.String ( com.google.common.primitives.Chars.toArray ( com.google.gerrit.acceptance.AbstractDaemonTest.RANDOM ) ) , changeId ) ; return push.to ( git , ref ) ; }

Target:
protected PushOneCommit.Result amendChange ( java.lang.String changeId ) throws java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { java.util.Collections.shuffle ( com.google.gerrit.acceptance.AbstractDaemonTest.RANDOM ) ; com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , admin.getIdent ( ) , PushOneCommit.SUBJECT , PushOneCommit.FILE_NAME , new java.lang.String ( com.google.common.primitives.Chars.toArray ( com.google.gerrit.acceptance.AbstractDaemonTest.RANDOM ) ) , changeId ) ; return push.to ( git , "refs/for/master" ) ; }
Source:
public com.googlecode.prolog_cafe.builtin.Operation exec ( com.googlecode.prolog_cafe.builtin.Prolog engine ) { engine.setB0 ( ) ; com.googlecode.prolog_cafe.builtin.Term a1 ; a1 = arg1 ; a1 = a1.dereference ( ) ; if ( a1.isVariable ( ) ) throw new com.googlecode.prolog_cafe.exceptions.PInstantiationException ( this , 1 ) ; if ( ! ( a1.isInteger ( ) ) ) throw new com.googlecode.prolog_cafe.exceptions.IllegalTypeException ( this , 1 , "integer" , a1 ) ; engine.halt = 1 + ( ( ( com.googlecode.prolog_cafe.builtin.IntegerTerm ) ( a1 ) ) . intValue ( ) ) ; return cont ; }

Target:
public com.googlecode.prolog_cafe.builtin.Operation exec ( com.googlecode.prolog_cafe.builtin.Prolog engine ) { engine.setB0 ( ) ; com.googlecode.prolog_cafe.builtin.Term a1 ; a1 = arg1 ; a1 = a1.dereference ( ) ; if ( a1 instanceof com.googlecode.prolog_cafe.builtin.VariableTerm ) throw new com.googlecode.prolog_cafe.exceptions.PInstantiationException ( this , 1 ) ; if ( ! ( a1 instanceof com.googlecode.prolog_cafe.builtin.IntegerTerm ) ) throw new com.googlecode.prolog_cafe.exceptions.IllegalTypeException ( this , 1 , "integer" , a1 ) ; engine.halt = 1 + ( ( ( com.googlecode.prolog_cafe.builtin.IntegerTerm ) ( a1 ) ) . intValue ( ) ) ; return cont ; }
Source:
private com.google.gerrit.acceptance.RestResponse GET ( java.lang.String endpoint ) throws java.io.IOException { return adminSession.get ( endpoint ) ; }

Target:
private void assertChildNotFound ( com.google.gerrit.reviewdb.client.Project.NameKey parent , java.lang.String child ) throws java.lang.Exception { try { gApi.projects ( ) . name ( parent.get ( ) ) . child ( child ) ; } catch ( com.google.gerrit.extensions.restapi.ResourceNotFoundException e ) { e.printStackTrace ( ) ; com.google.common.truth.Truth.assertThat ( e.getMessage ( ) ) . contains ( child ) ; } }
Source:
public void onShowView ( ) { super . onShowView ( ) ; int rest = ( com.google.gerrit.client.Gerrit.getHeaderFooterHeight ( ) ) + 30 ; cm.setHeight ( ( ( com.google.gwt.user.client.Window.getClientHeight ( ) ) - rest ) ) ; cm.refresh ( ) ; cm.focus ( ) ; }

Target:
public void onResize ( com.google.gwt.event.logical.shared.ResizeEvent event ) { cm.adjustHeight ( header.getOffsetHeight ( ) ) ; }
Source:
protected void onLoad ( ) { super . onLoad ( ) ; Util.LIST_SVC.forAccount ( ownerId , new com.google.gerrit.client.rpc.ScreenLoadCallback < com.google.gerrit.common.data.AccountDashboardInfo > ( this ) { @ java.lang.Override protected void preDisplay ( final com.google.gerrit.common.data.AccountDashboardInfo r ) { display ( r ) ; } } ) ; }

Target:
protected void onLoad ( ) { super . onLoad ( ) ; java.lang.String who = ( mine ) ? "self" : ownerId.toString ( ) ; com.google.gerrit.client.changes.ChangeList.query ( new com.google.gerrit.client.rpc.ScreenLoadCallback < com.google.gerrit.client.rpc.NativeList < com.google.gerrit.client.changes.ChangeList > > ( this ) { @ java.lang.Override protected void preDisplay ( com.google.gerrit.client.rpc.NativeList < com.google.gerrit.client.changes.ChangeList > result ) { display ( result ) ; } } , ( "is:open owner:" + who ) , ( ( ( "is:open reviewer:" + who ) + " -owner:" ) + who ) , ( ( "is:closed owner:" + who ) + " -age:1w limit:10" ) ) ; }
Source:
public void testHasValidScheme ( ) { org.junit.Assert.assertTrue ( com.google.gwtexpui.safehtml.client.LinkFindReplace.hasValidScheme ( "/absolute/path" ) ) ; org.junit.Assert.assertTrue ( com.google.gwtexpui.safehtml.client.LinkFindReplace.hasValidScheme ( "relative/path" ) ) ; org.junit.Assert.assertTrue ( com.google.gwtexpui.safehtml.client.LinkFindReplace.hasValidScheme ( "http://url/" ) ) ; org.junit.Assert.assertTrue ( com.google.gwtexpui.safehtml.client.LinkFindReplace.hasValidScheme ( "HTTP://url/" ) ) ; org.junit.Assert.assertTrue ( com.google.gwtexpui.safehtml.client.LinkFindReplace.hasValidScheme ( "https://url/" ) ) ; org.junit.Assert.assertTrue ( com.google.gwtexpui.safehtml.client.LinkFindReplace.hasValidScheme ( "mailto://url/" ) ) ; org.junit.Assert.assertFalse ( com.google.gwtexpui.safehtml.client.LinkFindReplace.hasValidScheme ( "ftp://url/" ) ) ; org.junit.Assert.assertFalse ( com.google.gwtexpui.safehtml.client.LinkFindReplace.hasValidScheme ( "data:evil" ) ) ; org.junit.Assert.assertFalse ( com.google.gwtexpui.safehtml.client.LinkFindReplace.hasValidScheme ( "javascript:alert(1)" ) ) ; }

Target:
public void testHasValidScheme ( ) { com.google.common.truth.Truth.assertThat ( com.google.gwtexpui.safehtml.client.LinkFindReplace.hasValidScheme ( "/absolute/path" ) ) . isTrue ( ) ; com.google.common.truth.Truth.assertThat ( com.google.gwtexpui.safehtml.client.LinkFindReplace.hasValidScheme ( "relative/path" ) ) . isTrue ( ) ; com.google.common.truth.Truth.assertThat ( com.google.gwtexpui.safehtml.client.LinkFindReplace.hasValidScheme ( "http://url/" ) ) . isTrue ( ) ; com.google.common.truth.Truth.assertThat ( com.google.gwtexpui.safehtml.client.LinkFindReplace.hasValidScheme ( "HTTP://url/" ) ) . isTrue ( ) ; com.google.common.truth.Truth.assertThat ( com.google.gwtexpui.safehtml.client.LinkFindReplace.hasValidScheme ( "https://url/" ) ) . isTrue ( ) ; com.google.common.truth.Truth.assertThat ( com.google.gwtexpui.safehtml.client.LinkFindReplace.hasValidScheme ( "mailto://url/" ) ) . isTrue ( ) ; com.google.common.truth.Truth.assertThat ( com.google.gwtexpui.safehtml.client.LinkFindReplace.hasValidScheme ( "ftp://url/" ) ) . isFalse ( ) ; com.google.common.truth.Truth.assertThat ( com.google.gwtexpui.safehtml.client.LinkFindReplace.hasValidScheme ( "data:evil" ) ) . isFalse ( ) ; com.google.common.truth.Truth.assertThat ( com.google.gwtexpui.safehtml.client.LinkFindReplace.hasValidScheme ( "javascript:alert(1)" ) ) . isFalse ( ) ; }
Source:
public void testStringFF ( ) { com.google.gwtorm.nosql.IndexKeyBuilder ib = new com.google.gwtorm.nosql.IndexKeyBuilder ( ) ; ib.add ( new byte [ ] { ( ( byte ) ( 255 ) ) } ) ; com.google.gwtorm.nosql.IndexKeyBuilderTest.assertEquals ( new byte [ ] { ( ( byte ) ( 255 ) ) , 0 } , ib ) ; }

Target:
public void testStringFF ( ) { com.google.gwtorm.nosql.IndexKeyBuilder ib = new com.google.gwtorm.nosql.IndexKeyBuilder ( ) ; ib.add ( new byte [ ] { ( ( byte ) ( 255 ) ) } ) ; com.google.gwtorm.nosql.IndexKeyBuilderTest.assertEqualToBuilderResult ( new byte [ ] { ( ( byte ) ( 255 ) ) , 0 } , ib ) ; }
Source:
public boolean retryRequest ( java.io.IOException exception , int executionCount , org.apache.http.protocol.HttpContext context ) { if ( ( executionCount > ( cfg.getMaxTries ( ) ) ) || ( exception instanceof javax.net.ssl.SSLException ) ) { return false ; } logRetry ( exception.getMessage ( ) , context ) ; try { java.lang.Thread.sleep ( cfg.getRetryInterval ( ) ) ; } catch ( java.lang.InterruptedException e ) { java.lang.Thread.currentThread ( ) . interrupt ( ) ; return false ; } return true ; }

Target:
public boolean retryRequest ( org.apache.http.HttpResponse response , int executionCount , org.apache.http.protocol.HttpContext context ) { if ( executionCount > ( cfg.getMaxTries ( ) ) ) { return false ; } if ( ( response.getStatusLine ( ) . getStatusCode ( ) ) >= ( com.googlesource.gerrit.plugins.webhooks.HttpClientProvider.ERROR_CODES ) ) { logRetry ( response.getStatusLine ( ) . getReasonPhrase ( ) , context ) ; return true ; } return false ; }
Source:
public void testSubscriptionFailOnWrongBranchACL ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < ? > superRepo = createProjectWithPush ( "super-project" ) ; org.eclipse.jgit.junit.TestRepository < ? > subRepo = createProjectWithPush ( "subscribed-to-project" ) ; allowSubmoduleSubscription ( "subscribed-to-project" , "refs/heads/master" , "super-project" , "refs/heads/wrong-branch" ) ; pushChangeTo ( subRepo , "master" ) ; createSubmoduleSubscription ( superRepo , "master" , "subscribed-to-project" , "master" ) ; pushChangeTo ( subRepo , "master" ) ; com.google.common.truth.Truth.assertThat ( hasSubmodule ( superRepo , "master" , "subscribed-to-project" ) ) . isFalse ( ) ; }

Target:
public void testSubscriptionFailOnWrongProjectACL ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < ? > superRepo = createProjectWithPush ( "super-project" ) ; org.eclipse.jgit.junit.TestRepository < ? > subRepo = createProjectWithPush ( "subscribed-to-project" ) ; allowMatchingSubmoduleSubscription ( "subscribed-to-project" , "refs/heads/master" , "wrong-super-project" , "refs/heads/master" ) ; pushChangeTo ( subRepo , "master" ) ; createSubmoduleSubscription ( superRepo , "master" , "subscribed-to-project" , "master" ) ; pushChangeTo ( subRepo , "master" ) ; com.google.common.truth.Truth.assertThat ( hasSubmodule ( superRepo , "master" , "subscribed-to-project" ) ) . isFalse ( ) ; }
Source:
public void testIsEnabledChangeRestoredEvent ( ) { java.lang.String [ ] branches = new java.lang.String [ ] { } ; setupIsEnabled ( "true" , null , branches ) ; com.google.gerrit.server.events.ChangeRestoredEvent event = new com.google.gerrit.server.events.ChangeRestoredEvent ( ) ; com.google.gerrit.server.data.ChangeAttribute changeAttribute = new com.google.gerrit.server.data.ChangeAttribute ( ) ; changeAttribute.project = "testProject" ; changeAttribute.branch = "testBranch" ; event.change = com.google.common.base.Suppliers.ofInstance ( changeAttribute ) ; com.googlesource.gerrit.plugins.its.base.its.ItsConfig itsConfig = createItsConfig ( ) ; replayMocks ( ) ; assertTrue ( itsConfig.isEnabled ( event ) ) ; }

Target:
public void testIsEnabledChangeRestoredEvent ( ) { java.lang.String [ ] branches = new java.lang.String [ ] { } ; setupIsEnabled ( "true" , null , branches ) ; com.google.gerrit.server.events.ChangeRestoredEvent event = new com.google.gerrit.server.events.ChangeRestoredEvent ( testChange ( "testProject" , "testBranch" ) ) ; com.googlesource.gerrit.plugins.its.base.its.ItsConfig itsConfig = createItsConfig ( ) ; replayMocks ( ) ; assertTrue ( itsConfig.isEnabled ( event ) ) ; }
Source:
public void onFailure ( java.lang.Throwable e ) { enableEdit ( true ) ; pendingGroup = null ; super . onFailure ( e ) ; }

Target:
public void onFailure ( java.lang.Throwable e ) { enableEdit ( true ) ; pendingGroup = null ; if ( com.google.gerrit.client.rpc.RestApi.isNotSignedIn ( e ) ) { com.google.gerrit.client.changes.CommentInfo saved = com.google.gerrit.client.changes.CommentInfo.copy ( comment ) ; saved.message ( editArea.getValue ( ) . trim ( ) ) ; lc.setInlineComment ( saved ) ; } super . onFailure ( e ) ; }
Source:
public void duplicatePatchSetRevisions ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = insertChange ( ) ; com.google.gerrit.reviewdb.client.PatchSet ps1 = insertPatchSet ( c ) ; java.lang.String rev = ps1.getRevision ( ) . get ( ) ; incrementPatchSet ( c ) ; com.google.gerrit.reviewdb.client.PatchSet ps2 = insertMissingPatchSet ( c , rev ) ; updatePatchSetRef ( ps2 ) ; assertProblems ( c , ( ( "Multiple patch sets pointing to " + rev ) + ": [1, 2]" ) ) ; }

Target:
public void duplicatePatchSetRevisions ( ) throws java.lang.Exception { com.google.gerrit.server.project.ChangeControl ctl = insertChange ( ) ; com.google.gerrit.reviewdb.client.PatchSet ps1 = psUtil.current ( db , ctl.getNotes ( ) ) ; java.lang.String rev = ps1.getRevision ( ) . get ( ) ; ctl = incrementPatchSet ( ctl , testRepo.getRevWalk ( ) . parseCommit ( org.eclipse.jgit.lib.ObjectId.fromString ( rev ) ) ) ; assertProblems ( ctl , null , com.google.gerrit.acceptance.server.change.ConsistencyCheckerIT.problem ( ( ( "Multiple patch sets pointing to " + rev ) + ": [1, 2]" ) ) ) ; }
Source:
private com.google.gerrit.server.permissions.ProjectControl user ( com.google.gerrit.server.git.ProjectConfig local , java.lang.String name , com.google.gerrit.reviewdb.client.AccountGroup ... memberOf ) { return new com.google.gerrit.server.permissions.ProjectControl ( java.util.Collections.< com.google.gerrit.reviewdb.client.AccountGroup.UUID > emptySet ( ) , java.util.Collections.< com.google.gerrit.reviewdb.client.AccountGroup.UUID > emptySet ( ) , sectionSorter , changeControlFactory , permissionBackend , refFilterFactory , new com.google.gerrit.server.permissions.RefControlTest.MockUser ( name , memberOf ) , newProjectState ( local ) ) ; }

Target:
private com.google.gerrit.server.permissions.ProjectControl user ( com.google.gerrit.server.project.ProjectConfig local , java.lang.String name , com.google.gerrit.reviewdb.client.AccountGroup ... memberOf ) { return new com.google.gerrit.server.permissions.ProjectControl ( java.util.Collections.< com.google.gerrit.reviewdb.client.AccountGroup.UUID > emptySet ( ) , java.util.Collections.< com.google.gerrit.reviewdb.client.AccountGroup.UUID > emptySet ( ) , sectionSorter , changeControlFactory , permissionBackend , refFilterFactory , new com.google.gerrit.server.permissions.RefControlTest.MockUser ( name , memberOf ) , newProjectState ( local ) ) ; }
Source:
private com.google.gerrit.common.data.SubmitTypeRecord typeError ( java.lang.String err , java.lang.Exception e ) { if ( logErrors ) { com.google.gerrit.server.project.SubmitRuleEvaluator.log.error ( err , e ) ; return com.google.gerrit.server.project.SubmitRuleEvaluator.defaultTypeError ( ) ; } else { return com.google.gerrit.server.project.SubmitRuleEvaluator.createTypeError ( err ) ; } }

Target:
private java.util.List < com.google.gerrit.common.data.SubmitRecord > ruleError ( java.lang.String err , java.lang.Exception e ) { if ( logErrors ) { if ( e == null ) { com.google.gerrit.server.project.SubmitRuleEvaluator.log.error ( err ) ; } else { com.google.gerrit.server.project.SubmitRuleEvaluator.log.error ( err , e ) ; } return com.google.gerrit.server.project.SubmitRuleEvaluator.defaultRuleError ( ) ; } else { return com.google.gerrit.server.project.SubmitRuleEvaluator.createRuleError ( err ) ; } }
Source:
public void fire ( com.google.gerrit.extensions.common.ChangeInfo change , com.google.gerrit.extensions.common.AccountInfo editor , java.lang.String oldTopic , java.sql.Timestamp when ) { if ( ! ( listeners.iterator ( ) . hasNext ( ) ) ) { return ; } com.google.gerrit.server.extensions.events.TopicEdited.Event event = new com.google.gerrit.server.extensions.events.TopicEdited.Event ( change , editor , oldTopic , when ) ; for ( com.google.gerrit.extensions.events.TopicEditedListener l : listeners ) { try { l.onTopicEdited ( event ) ; } catch ( java.lang.Exception e ) { com.google.gerrit.server.extensions.events.TopicEdited.log.warn ( "Error in event listener" , e ) ; } } }

Target:
public void fire ( com.google.gerrit.extensions.common.ChangeInfo change , com.google.gerrit.extensions.common.AccountInfo editor , java.lang.String oldTopic , java.sql.Timestamp when ) { if ( ! ( listeners.iterator ( ) . hasNext ( ) ) ) { return ; } com.google.gerrit.server.extensions.events.TopicEdited.Event event = new com.google.gerrit.server.extensions.events.TopicEdited.Event ( change , editor , oldTopic , when ) ; for ( com.google.gerrit.extensions.events.TopicEditedListener l : listeners ) { try { l.onTopicEdited ( event ) ; } catch ( java.lang.Exception e ) { util.logEventListenerError ( com.google.gerrit.server.extensions.events.TopicEdited.log , e ) ; } } }
Source:
public java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.UUID > load ( java.lang.String key ) throws java.lang.Exception { try ( com.google.gerrit.reviewdb.server.ReviewDb db = schema.open ( ) ) { java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.UUID > ids = com.google.common.collect.Sets.newHashSet ( ) ; for ( com.google.gerrit.reviewdb.client.AccountGroupById agi : db.accountGroupById ( ) . all ( ) ) { if ( ! ( com.google.gerrit.reviewdb.client.AccountGroup.isInternalGroup ( agi.getIncludeUUID ( ) ) ) ) { ids.add ( agi.getIncludeUUID ( ) ) ; } } return com.google.common.collect.ImmutableSet.copyOf ( ids ) ; } }

Target:
public java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.UUID > load ( java.lang.String key ) throws java.lang.Exception { try ( com.google.gerrit.reviewdb.server.ReviewDb db = schema.open ( ) ) { java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.UUID > ids = new java.util.HashSet < > ( ) ; for ( com.google.gerrit.reviewdb.client.AccountGroupById agi : db.accountGroupById ( ) . all ( ) ) { if ( ! ( com.google.gerrit.reviewdb.client.AccountGroup.isInternalGroup ( agi.getIncludeUUID ( ) ) ) ) { ids.add ( agi.getIncludeUUID ( ) ) ; } } return com.google.common.collect.ImmutableSet.copyOf ( ids ) ; } }
Source:
public void httpLink ( ) { com.google.gitiles.doc.MarkdownToHtml md = new com.google.gitiles.doc.MarkdownToHtml ( view , config , "index.md" ) ; java.lang.String url ; url = "http://example.com/foo.html" ; com.google.common.truth.Truth.assertThat ( md.href ( url ) ) . isEqualTo ( url ) ; url = "https://example.com/foo.html" ; com.google.common.truth.Truth.assertThat ( md.href ( url ) ) . isEqualTo ( url ) ; url = "//example.com/foo.html" ; com.google.common.truth.Truth.assertThat ( md.href ( url ) ) . isEqualTo ( url ) ; }

Target:
public void httpLink ( ) { com.google.gitiles.doc.MarkdownToHtml md = com.google.gitiles.doc.MarkdownToHtml.builder ( ) . setGitilesView ( view ) . setConfig ( new com.google.gitiles.doc.MarkdownConfig ( config ) ) . setFilePath ( "index.md" ) . build ( ) ; java.lang.String url ; url = "http://example.com/foo.html" ; com.google.common.truth.Truth.assertThat ( md.href ( url ) ) . isEqualTo ( url ) ; url = "https://example.com/foo.html" ; com.google.common.truth.Truth.assertThat ( md.href ( url ) ) . isEqualTo ( url ) ; url = "//example.com/foo.html" ; com.google.common.truth.Truth.assertThat ( md.href ( url ) ) . isEqualTo ( url ) ; }
Source:
private int finish ( final java.util.Iterator < com.google.gerrit.reviewdb.client.PatchLineComment > i , int row , final int col , boolean expandComment ) { while ( i.hasNext ( ) ) { final com.google.gerrit.reviewdb.client.PatchLineComment c = i.next ( ) ; insertRow ( row ) ; bindComment ( row , col , c , ( ! ( i.hasNext ( ) ) ) , expandComment ) ; row ++ ; } return row ; }

Target:
private int finish ( final java.util.Iterator < com.google.gerrit.reviewdb.client.PatchLineComment > i , int row , final int col , boolean expandComment ) { while ( i.hasNext ( ) ) { final com.google.gerrit.reviewdb.client.PatchLineComment c = i.next ( ) ; if ( ( c.getLine ( ) ) == ( R_HEAD ) ) { insertFileCommentRow ( row ) ; } else { insertRow ( row ) ; } bindComment ( row , col , c , ( ! ( i.hasNext ( ) ) ) , expandComment ) ; row ++ ; } return row ; }
Source:
private HostPageData.Theme getTheme ( java.lang.String name ) { com.google.gerrit.common.data.HostPageData.Theme theme = new com.google.gerrit.common.data.HostPageData.Theme ( ) ; theme.backgroundColor = color ( name , "backgroundColor" , "#FFFFFF" ) ; theme.textColor = color ( name , "textColor" , "#000000" ) ; theme.trimColor = color ( name , "trimColor" , "#D4E9A9" ) ; theme.selectionColor = color ( name , "selectionColor" , "#FFFFCC" ) ; theme.topMenuColor = color ( name , "topMenuColor" , theme.trimColor ) ; return theme ; }

Target:
private HostPageData.Theme getTheme ( java.lang.String name ) { com.google.gerrit.common.data.HostPageData.Theme theme = new com.google.gerrit.common.data.HostPageData.Theme ( ) ; theme.backgroundColor = color ( name , "backgroundColor" , "#FCFEEF" ) ; theme.textColor = color ( name , "textColor" , "#000000" ) ; theme.trimColor = color ( name , "trimColor" , "#D4E9A9" ) ; theme.selectionColor = color ( name , "selectionColor" , "#FFFFCC" ) ; theme.topMenuColor = color ( name , "topMenuColor" , theme.trimColor ) ; return theme ; }
Source:
public com.google.gerrit.server.notedb.ChangeNotes call ( ) throws java.lang.Exception { com.google.common.base.Preconditions.checkArgument ( change.getProject ( ) . equals ( project ) , ( "passed project %s when creating ChangeNotes for %s," + " but actual project is %s" ) , project , changeId , change.getProject ( ) ) ; return new com.google.gerrit.server.notedb.ChangeNotes ( repoManager , migration , allUsers , project , change ) . load ( ) ; }

Target:
public com.google.gerrit.server.notedb.ChangeNotes call ( ) throws java.lang.Exception { com.google.common.base.Preconditions.checkArgument ( change.getProject ( ) . equals ( project ) , ( "passed project %s when creating ChangeNotes for %s," + " but actual project is %s" ) , project , changeId , change.getProject ( ) ) ; return new com.google.gerrit.server.notedb.ChangeNotes ( repoManager , migration , allUsers , changeNoteUtil , commentsUtil , project , change ) . load ( ) ; }
Source:
private java.lang.String getScopesKey ( javax.servlet.http.HttpServletRequest request , javax.servlet.http.HttpServletResponse response ) { java.lang.String scopeRequested = request.getParameter ( "scope" ) ; if ( scopeRequested == null ) { scopeRequested = getScopesKeyFromCookie ( request ) ; } if ( scopeRequested != null ) { javax.servlet.http.Cookie scopeCookie = new javax.servlet.http.Cookie ( "scope" , scopeRequested ) ; scopeCookie.setPath ( "/" ) ; scopeCookie.setMaxAge ( ( ( int ) ( com.googlesource.gerrit.plugins.github.oauth.GitHubLogin.SCOPE_COOKIE_NEVER_EXPIRES ) ) ) ; response.addCookie ( scopeCookie ) ; } return com.google.common.base.Objects.firstNonNull ( scopeRequested , "scopes" ) ; }

Target:
private java.lang.String getScopesKey ( javax.servlet.http.HttpServletRequest request , javax.servlet.http.HttpServletResponse response ) { java.lang.String scopeRequested = request.getParameter ( "scope" ) ; if ( scopeRequested == null ) { scopeRequested = getScopesKeyFromCookie ( request ) ; } if ( scopeRequested != null ) { javax.servlet.http.Cookie scopeCookie = new javax.servlet.http.Cookie ( "scope" , scopeRequested ) ; scopeCookie.setPath ( "/" ) ; scopeCookie.setMaxAge ( ( ( int ) ( com.googlesource.gerrit.plugins.github.oauth.GitHubLogin.SCOPE_COOKIE_NEVER_EXPIRES ) ) ) ; response.addCookie ( scopeCookie ) ; } return com.google.common.base.MoreObjects.firstNonNull ( scopeRequested , "scopes" ) ; }
Source:
public boolean updateChange ( com.google.gerrit.server.update.ChangeContext ctx ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gwtorm.server.OrmException { change = ctx.getChange ( ) ; com.google.gerrit.server.notedb.ChangeUpdate update = ctx.getUpdate ( change.currentPatchSetId ( ) ) ; com.google.gerrit.reviewdb.client.Account.Id currentAssigneeId = change.getAssignee ( ) ; if ( currentAssigneeId == null ) { return false ; } com.google.gerrit.server.IdentifiedUser deletedAssigneeUser = userFactory.create ( currentAssigneeId ) ; deletedAssignee = deletedAssigneeUser.getAccount ( ) ; update.removeAssignee ( ) ; change.setAssignee ( null ) ; addMessage ( ctx , update , deletedAssigneeUser ) ; return true ; }

Target:
public boolean updateChange ( com.google.gerrit.server.update.ChangeContext ctx ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gwtorm.server.OrmException { change = ctx.getChange ( ) ; com.google.gerrit.server.notedb.ChangeUpdate update = ctx.getUpdate ( change.currentPatchSetId ( ) ) ; com.google.gerrit.reviewdb.client.Account.Id currentAssigneeId = change.getAssignee ( ) ; if ( currentAssigneeId == null ) { return false ; } com.google.gerrit.server.IdentifiedUser deletedAssigneeUser = userFactory.create ( currentAssigneeId ) ; deletedAssignee = deletedAssigneeUser.state ( ) ; update.removeAssignee ( ) ; change.setAssignee ( null ) ; addMessage ( ctx , update , deletedAssigneeUser ) ; return true ; }
Source:
com.google.gerrit.metrics.dropwizard.DropWizardMetricMaker.HistogramImpl forceCreate ( java.lang.Object key ) { com.google.gerrit.metrics.dropwizard.DropWizardMetricMaker.HistogramImpl c = cells.get ( key ) ; if ( c != null ) { return c ; } synchronized ( cells ) { c = cells.get ( key ) ; if ( c == null ) { c = metrics.newHistogramImpl ( submetric ( key ) ) ; cells.put ( key , c ) ; } return c ; } }

Target:
com.google.gerrit.metrics.dropwizard.DropWizardMetricMaker.HistogramImpl forceCreate ( java.lang.Object key ) { com.google.gerrit.metrics.dropwizard.DropWizardMetricMaker.HistogramImpl c = cells.get ( key ) ; if ( c != null ) { return c ; } synchronized ( lock ) { c = cells.get ( key ) ; if ( c == null ) { c = metrics.newHistogramImpl ( submetric ( key ) ) ; cells.put ( key , c ) ; } return c ; } }
Source:
public com.google.common.collect.ImmutableList < com.google.gerrit.reviewdb.client.AccountGroup > all ( ) { try ( com.google.gerrit.reviewdb.server.ReviewDb db = schema.open ( ) ) { return groups.getAll ( db ) ; } catch ( com.google.gwtorm.server.OrmException e ) { com.google.gerrit.server.account.GroupCacheImpl.log.warn ( "Cannot list internal groups" , e ) ; return com.google.common.collect.ImmutableList.of ( ) ; } }

Target:
public com.google.common.collect.ImmutableList < com.google.gerrit.reviewdb.client.AccountGroup > all ( ) { try ( com.google.gerrit.reviewdb.server.ReviewDb db = schema.open ( ) ) { return groups.getAll ( db ) . collect ( com.google.common.collect.ImmutableList.toImmutableList ( ) ) ; } catch ( com.google.gwtorm.server.OrmException e ) { com.google.gerrit.server.account.GroupCacheImpl.log.warn ( "Cannot list internal groups" , e ) ; return com.google.common.collect.ImmutableList.of ( ) ; } }
Source:
public void testItsAssociationPolicyMandatory ( ) { com.googlesource.gerrit.plugins.hooks.its.ItsConfig itsConfig = createItsConfig ( ) ; org.easymock.EasyMock.expect ( serverConfig.getString ( "ItsTestName" , null , "commentlink" ) ) . andReturn ( null ) . atLeastOnce ( ) ; org.easymock.EasyMock.expect ( serverConfig.getEnum ( "commentlink" , "ItsTestName" , "association" , ItsAssociationPolicy.OPTIONAL ) ) . andReturn ( ItsAssociationPolicy.MANDATORY ) . atLeastOnce ( ) ; replayMocks ( ) ; assertEquals ( "Expected and generated associated policy do not match" , ItsAssociationPolicy.MANDATORY , itsConfig.getItsAssociationPolicy ( ) ) ; }

Target:
public void testGetItsAssociationPolicyMandatory ( ) { com.googlesource.gerrit.plugins.hooks.its.ItsConfig itsConfig = createItsConfig ( ) ; org.easymock.EasyMock.expect ( serverConfig.getString ( "ItsTestName" , null , "commentlink" ) ) . andReturn ( null ) . atLeastOnce ( ) ; org.easymock.EasyMock.expect ( serverConfig.getEnum ( "commentlink" , "ItsTestName" , "association" , ItsAssociationPolicy.OPTIONAL ) ) . andReturn ( ItsAssociationPolicy.MANDATORY ) . atLeastOnce ( ) ; replayMocks ( ) ; assertEquals ( "Expected and generated associated policy do not match" , ItsAssociationPolicy.MANDATORY , itsConfig.getItsAssociationPolicy ( ) ) ; }
Source:
public void writeToConfig ( org.eclipse.jgit.lib.Config c ) { java.lang.String externalIdKey = key ( ) . get ( ) ; c.setInt ( com.google.gerrit.server.account.externalids.ExternalId.EXTERNAL_ID_SECTION , externalIdKey , com.google.gerrit.server.account.externalids.ExternalId.ACCOUNT_ID_KEY , accountId ( ) . get ( ) ) ; if ( ( email ( ) ) != null ) { c.setString ( com.google.gerrit.server.account.externalids.ExternalId.EXTERNAL_ID_SECTION , externalIdKey , com.google.gerrit.server.account.externalids.ExternalId.EMAIL_KEY , email ( ) ) ; } if ( ( password ( ) ) != null ) { c.setString ( com.google.gerrit.server.account.externalids.ExternalId.EXTERNAL_ID_SECTION , externalIdKey , com.google.gerrit.server.account.externalids.ExternalId.PASSWORD_KEY , password ( ) ) ; } }

Target:
public void writeToConfig ( org.eclipse.jgit.lib.Config c ) { java.lang.String externalIdKey = key ( ) . get ( ) ; c.setString ( com.google.gerrit.server.account.externalids.ExternalId.EXTERNAL_ID_SECTION , externalIdKey , com.google.gerrit.server.account.externalids.ExternalId.ACCOUNT_ID_KEY , java.lang.Integer.toString ( accountId ( ) . get ( ) ) ) ; if ( ( email ( ) ) != null ) { c.setString ( com.google.gerrit.server.account.externalids.ExternalId.EXTERNAL_ID_SECTION , externalIdKey , com.google.gerrit.server.account.externalids.ExternalId.EMAIL_KEY , email ( ) ) ; } if ( ( password ( ) ) != null ) { c.setString ( com.google.gerrit.server.account.externalids.ExternalId.EXTERNAL_ID_SECTION , externalIdKey , com.google.gerrit.server.account.externalids.ExternalId.PASSWORD_KEY , password ( ) ) ; } }
Source:
private void registerCmEvents ( final net.codemirror.lib.CodeMirror cm ) { cm.on ( "beforeSelectionChange" , onSelectionChange ( cm ) ) ; cm.on ( "cursorActivity" , updateActiveLine ( cm ) ) ; cm.on ( "gutterClick" , onGutterClick ( cm ) ) ; cm.on ( "focus" , updateActiveLine ( cm ) ) ; }

Target:
public void run ( ) { cm.execCommand ( "selectAll" ) ; }
Source:
public com.google.gitiles.GitilesView.Builder setPathPart ( java.lang.String path ) { switch ( type ) { case PATH : case DIFF : this . path = com.google.gitiles.GitilesView.maybeTrimLeadingAndTrailingSlash ( com.google.common.base.Preconditions.checkNotNull ( path ) ) ; break ; case DESCRIBE : case REFS : case LOG : this . path = ( path != null ) ? com.google.gitiles.GitilesView.maybeTrimLeadingAndTrailingSlash ( path ) : null ; break ; default : com.google.common.base.Preconditions.checkState ( ( path == null ) , "cannot set path on %s view" , type ) ; this . path = path ; break ; } return this ; }

Target:
public com.google.gitiles.GitilesView.Builder setPathPart ( java.lang.String path ) { switch ( type ) { case PATH : case DIFF : com.google.common.base.Preconditions.checkState ( ( path != null ) , "cannot set null path on %s view" , type ) ; break ; case DESCRIBE : case REFS : case LOG : break ; default : com.google.common.base.Preconditions.checkState ( ( path == null ) , "cannot set path on %s view" , type ) ; break ; } this . path = ( path != null ) ? com.google.gitiles.GitilesView.maybeTrimLeadingAndTrailingSlash ( path ) : null ; return this ; }
Source:
protected void insert ( final int row , final com.google.gerrit.client.dashboards.DashboardInfo k ) { table.insertRow ( row ) ; applyDataRowStyle ( row ) ; final com.google.gwt.user.client.ui.FlexTable.FlexCellFormatter fmt = table.getFlexCellFormatter ( ) ; fmt.addStyleName ( row , 1 , Gerrit.RESOURCES.css ( ) . dataCell ( ) ) ; fmt.addStyleName ( row , 2 , Gerrit.RESOURCES.css ( ) . dataCell ( ) ) ; populate ( row , k ) ; }

Target:
protected void insert ( final int row , final com.google.gerrit.client.dashboards.DashboardInfo k ) { table.insertRow ( row ) ; applyDataRowStyle ( row ) ; final com.google.gwt.user.client.ui.FlexTable.FlexCellFormatter fmt = table.getFlexCellFormatter ( ) ; fmt.addStyleName ( row , 1 , Gerrit.RESOURCES.css ( ) . dataCell ( ) ) ; fmt.addStyleName ( row , 2 , Gerrit.RESOURCES.css ( ) . dataCell ( ) ) ; fmt.addStyleName ( row , 3 , Gerrit.RESOURCES.css ( ) . dataCell ( ) ) ; populate ( row , k ) ; }
Source:
public void revokedKeyDueToCompromise ( ) throws java.lang.Exception { com.google.gerrit.gpg.testutil.TestKey k = add ( com.google.gerrit.gpg.testutil.TestKeys.revokedCompromisedKey ( ) ) ; add ( com.google.gerrit.gpg.testutil.TestKeys.validKeyWithoutExpiration ( ) ) ; save ( ) ; assertProblems ( k , ( "Key is revoked (key material has been compromised):" + " test6 compromised" ) ) ; org.bouncycastle.openpgp.PGPPublicKeyRing kr = removeRevokers ( k.getPublicKeyRing ( ) ) ; store.add ( kr ) ; save ( ) ; assertNoProblems ( kr.getPublicKey ( ) ) ; }

Target:
public void revokedKeyDueToCompromise ( ) throws java.lang.Exception { com.google.gerrit.gpg.testutil.TestKey k = add ( com.google.gerrit.gpg.testutil.TestKeys.revokedCompromisedKey ( ) ) ; add ( com.google.gerrit.gpg.testutil.TestKeys.validKeyWithoutExpiration ( ) ) ; save ( ) ; assertProblems ( k , "Key is revoked (key material has been compromised): test6 compromised" ) ; org.bouncycastle.openpgp.PGPPublicKeyRing kr = removeRevokers ( k.getPublicKeyRing ( ) ) ; store.add ( kr ) ; save ( ) ; assertNoProblems ( kr.getPublicKey ( ) ) ; }
Source:
private static org.eclipse.jgit.util.TemporaryBuffer.Heap compress ( com.google.gerrit.extensions.restapi.BinaryResult bin ) throws java.io.IOException { org.eclipse.jgit.util.TemporaryBuffer.Heap buf = com.google.gerrit.httpd.restapi.RestApiServlet.heap ( ( 20 << 20 ) ) ; java.util.zip.GZIPOutputStream gz = new java.util.zip.GZIPOutputStream ( buf ) ; bin.writeTo ( gz ) ; gz.finish ( ) ; gz.flush ( ) ; return buf ; }

Target:
private static com.google.gerrit.extensions.restapi.BinaryResult compress ( com.google.gerrit.extensions.restapi.BinaryResult bin ) throws java.io.IOException { org.eclipse.jgit.util.TemporaryBuffer.Heap buf = com.google.gerrit.httpd.restapi.RestApiServlet.heap ( ( 20 << 20 ) ) ; java.util.zip.GZIPOutputStream gz = new java.util.zip.GZIPOutputStream ( buf ) ; bin.writeTo ( gz ) ; gz.close ( ) ; return com.google.gerrit.httpd.restapi.RestApiServlet.asBinaryResult ( buf ) . setContentType ( bin.getContentType ( ) ) ; }
Source:
public boolean canSubmit ( ) { return getRefControl ( ) . canSubmit ( isOwner ( ) ) ; }

Target:
public boolean isPrivateVisible ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.query.change.ChangeData cd ) throws com.google.gwtorm.server.OrmException { return ( ( ( isOwner ( ) ) || ( isReviewer ( db , cd ) ) ) || ( getRefControl ( ) . canViewPrivateChanges ( ) ) ) || ( getUser ( ) . isInternalUser ( ) ) ; }
Source:
private static void updateHeadLocally ( org.eclipse.jgit.transport.URIish uri , java.lang.String newHead ) { try { org.eclipse.jgit.lib.Repository repo = new org.eclipse.jgit.internal.storage.file.FileRepository ( uri.getPath ( ) ) ; try { if ( newHead != null ) { org.eclipse.jgit.lib.RefUpdate u = repo.updateRef ( Constants.HEAD ) ; u.link ( newHead ) ; } } finally { repo.close ( ) ; } } catch ( java.io.IOException e ) { com.googlesource.gerrit.plugins.replication.ReplicationQueue.log.error ( java.lang.String.format ( "Failed to update HEAD of repository %s to %s" , uri.getPath ( ) , newHead ) , e ) ; } }

Target:
private static void updateHeadLocally ( org.eclipse.jgit.transport.URIish uri , java.lang.String newHead ) { try { org.eclipse.jgit.lib.Repository repo = new org.eclipse.jgit.internal.storage.file.FileRepository ( uri.getPath ( ) ) ; try { if ( newHead != null ) { org.eclipse.jgit.lib.RefUpdate u = repo.updateRef ( Constants.HEAD ) ; u.link ( newHead ) ; } } finally { repo.close ( ) ; } } catch ( java.io.IOException e ) { com.googlesource.gerrit.plugins.replication.ReplicationQueue.repLog.error ( java.lang.String.format ( "Failed to update HEAD of repository %s to %s" , uri.getPath ( ) , newHead ) , e ) ; } }
Source:
public void onFailure ( final java.lang.Throwable caught ) { text.setReadOnly ( false ) ; save.setEnabled ( true ) ; cancel.setEnabled ( true ) ; discard.setEnabled ( true ) ; super . onFailure ( caught ) ; }

Target:
public void onFailure ( final java.lang.Throwable caught ) { text.setReadOnly ( false ) ; text.setFocus ( true ) ; save.setEnabled ( true ) ; cancel.setEnabled ( true ) ; discard.setEnabled ( true ) ; super . onFailure ( caught ) ; }
Source:
public void tearDown ( ) { if ( ( repo ) != null ) { repo.getRepository ( ) . close ( ) ; } if ( ( lifecycle ) != null ) { lifecycle.stop ( ) ; } if ( ( db ) != null ) { db.close ( ) ; } com.google.gerrit.testutil.InMemoryDatabase.drop ( schemaFactory ) ; }

Target:
public void tearDown ( ) { if ( ( repo ) != null ) { repo.getRepository ( ) . close ( ) ; } if ( ( lifecycle ) != null ) { lifecycle.stop ( ) ; } requestContext.setContext ( null ) ; if ( ( db ) != null ) { db.close ( ) ; } com.google.gerrit.testutil.InMemoryDatabase.drop ( schemaFactory ) ; }
Source:
boolean filterMatch ( java.lang.String filter , com.google.gerrit.server.query.change.ChangeData changeData ) throws com.google.gerrit.server.query.QueryParseException , com.google.gwtorm.server.OrmException { com.google.common.base.Preconditions.checkNotNull ( filter ) ; com.google.gerrit.server.query.change.ChangeQueryBuilder qb = queryBuilder.asUser ( user.get ( ) ) ; com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > filterPredicate = qb.parse ( filter ) ; return filterPredicate.asMatchable ( ) . match ( changeData ) ; }

Target:
boolean filterMatch ( java.lang.String filter , com.google.gerrit.server.query.change.ChangeData changeData ) throws com.google.gerrit.index.query.QueryParseException , com.google.gwtorm.server.OrmException { com.google.common.base.Preconditions.checkNotNull ( filter ) ; com.google.gerrit.server.query.change.ChangeQueryBuilder qb = queryBuilder.asUser ( user.get ( ) ) ; com.google.gerrit.index.query.Predicate < com.google.gerrit.server.query.change.ChangeData > filterPredicate = qb.parse ( filter ) ; return filterPredicate.asMatchable ( ) . match ( changeData ) ; }
Source:
private PushOneCommit.Result createChange ( org.eclipse.jgit.api.Git git , boolean conflicting ) throws java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { com.google.gerrit.acceptance.GitUtil.checkout ( git , "origin/master" ) ; java.lang.String file = ( conflicting ) ? "test.txt" : ( "test-" + ( count ) ) + ".txt" ; com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , admin.getIdent ( ) , git , ( "Change " + ( count ) ) , file , ( "content " + ( count ) ) ) ; ( count ) ++ ; return push.to ( "refs/for/master" ) ; }

Target:
private PushOneCommit.Result createChange ( boolean conflicting ) throws java.lang.Exception { testRepo.reset ( "origin/master" ) ; java.lang.String file = ( conflicting ) ? "test.txt" : ( "test-" + ( count ) ) + ".txt" ; com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , admin.getIdent ( ) , testRepo , ( "Change " + ( count ) ) , file , ( "content " + ( count ) ) ) ; ( count ) ++ ; return push.to ( "refs/for/master" ) ; }
Source:
public void setUp ( ) { java.lang.String tz = "US/Eastern" ; systemTimeZoneProperty = java.lang.System.setProperty ( "user.timezone" , tz ) ; systemTimeZone = java.util.TimeZone.getDefault ( ) ; java.util.TimeZone.setDefault ( java.util.TimeZone.getTimeZone ( tz ) ) ; com.google.gerrit.testutil.TestTimeUtil.resetWithClockStep ( 1 , java.util.concurrent.TimeUnit.SECONDS ) ; project = new com.google.gerrit.reviewdb.client.Project.NameKey ( "project" ) ; accountId = new com.google.gerrit.reviewdb.client.Account.Id ( 100 ) ; }

Target:
private void subWindowResolution ( ) { com.google.gerrit.testutil.TestTimeUtil.setClockStep ( 1 , java.util.concurrent.TimeUnit.SECONDS ) ; com.google.gerrit.common.TimeUtil.nowTs ( ) ; }
Source:
public void onSuccess ( final com.google.gerrit.reviewdb.Account result ) { if ( com.google.gerrit.client.Gerrit.isSignedIn ( ) ) { com.google.gerrit.client.Gerrit.getUserAccount ( ) . setSshUserName ( result.getSshUserName ( ) ) ; } userNameTxt.setText ( result.getSshUserName ( ) ) ; userNameTxt.setEnabled ( true ) ; }

Target:
public void onSuccess ( final java.util.List < com.google.gerrit.reviewdb.AccountExternalId > result ) { java.lang.String userName = null ; for ( com.google.gerrit.reviewdb.AccountExternalId i : result ) { if ( i.isScheme ( com.google.gerrit.reviewdb.AccountExternalId.SCHEME_USERNAME ) ) { userName = i.getSchemeRest ( ) ; break ; } } com.google.gerrit.client.Gerrit.getUserAccount ( ) . setUserName ( userName ) ; userNameTxt.setText ( userName ) ; userNameTxt.setEnabled ( true ) ; }
Source:
private java.util.List < com.google.gerrit.reviewdb.client.Project > getChildren ( final com.google.gerrit.reviewdb.client.Project.NameKey parentName ) { final java.util.List < com.google.gerrit.reviewdb.client.Project > childProjects = new java.util.ArrayList < com.google.gerrit.reviewdb.client.Project > ( ) ; for ( final com.google.gerrit.reviewdb.client.Project.NameKey projectName : projectCache.all ( ) ) { final com.google.gerrit.server.project.ProjectState e = projectCache.get ( projectName ) ; if ( e == null ) { continue ; } if ( parentName.equals ( e.getProject ( ) . getParent ( projectName ) ) ) { childProjects.add ( e.getProject ( ) ) ; } } return childProjects ; }

Target:
private java.util.List < com.google.gerrit.reviewdb.client.Project > getChildren ( final com.google.gerrit.reviewdb.client.Project.NameKey parentName ) { final java.util.List < com.google.gerrit.reviewdb.client.Project > childProjects = new java.util.ArrayList < com.google.gerrit.reviewdb.client.Project > ( ) ; for ( final com.google.gerrit.reviewdb.client.Project.NameKey projectName : projectCache.all ( ) ) { final com.google.gerrit.server.project.ProjectState e = projectCache.get ( projectName ) ; if ( e == null ) { continue ; } if ( parentName.equals ( e.getProject ( ) . getParent ( allProjectsName ) ) ) { childProjects.add ( e.getProject ( ) ) ; } } return childProjects ; }
Source:
public void description ( java.lang.String description ) throws com.google.gerrit.extensions.restapi.RestApiException { com.google.gerrit.server.change.PutDescription.Input in = new com.google.gerrit.server.change.PutDescription.Input ( ) ; in.description = description ; try { putDescription.apply ( revision , in ) ; } catch ( com.google.gerrit.server.git.UpdateException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot set description" , e ) ; } }

Target:
public void description ( java.lang.String description ) throws com.google.gerrit.extensions.restapi.RestApiException { com.google.gerrit.server.change.PutDescription.Input in = new com.google.gerrit.server.change.PutDescription.Input ( ) ; in.description = description ; try { putDescription.apply ( revision , in ) ; } catch ( com.google.gerrit.server.update.UpdateException | com.google.gerrit.server.permissions.PermissionBackendException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot set description" , e ) ; } }
Source:
public void onResize ( com.google.gwt.event.logical.shared.ResizeEvent event ) { if ( ( cmA ) != null ) { cmA.setHeight ( ( ( event.getHeight ( ) ) - ( com.google.gerrit.client.diff.SideBySide2.HEADER_FOOTER ) ) ) ; cmA.refresh ( ) ; } if ( ( cmB ) != null ) { cmB.setHeight ( ( ( event.getHeight ( ) ) - ( com.google.gerrit.client.diff.SideBySide2.HEADER_FOOTER ) ) ) ; cmB.refresh ( ) ; } }

Target:
public void onResize ( com.google.gwt.event.logical.shared.ResizeEvent event ) { if ( ( cmA ) != null ) { cmA.setHeight ( ( ( event.getHeight ( ) ) - ( com.google.gerrit.client.diff.SideBySide2.HEADER_FOOTER ) ) ) ; cmA.refresh ( ) ; } if ( ( cmB ) != null ) { cmB.setHeight ( ( ( event.getHeight ( ) ) - ( com.google.gerrit.client.diff.SideBySide2.HEADER_FOOTER ) ) ) ; cmB.refresh ( ) ; } resizeBoxPaddings ( ) ; }
Source:
protected void configure ( ) { com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.extensions.events.GitReferenceUpdatedListener.class ) . to ( com.googlesource.gerrit.plugins.repositoryuse.RefUpdateHandler.class ) ; requestStaticInjection ( com.googlesource.gerrit.plugins.repositoryuse.Config.class ) ; requestStaticInjection ( Ref.Table.class ) ; requestStaticInjection ( Usage.Table.class ) ; }

Target:
protected void configure ( ) { com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.extensions.events.GitReferenceUpdatedListener.class ) . to ( com.googlesource.gerrit.plugins.repositoryuse.EventHandler.class ) ; requestStaticInjection ( com.googlesource.gerrit.plugins.repositoryuse.Config.class ) ; requestStaticInjection ( Ref.Table.class ) ; requestStaticInjection ( Usage.Table.class ) ; install ( new com.google.inject.assistedinject.FactoryModuleBuilder ( ) . implement ( com.googlesource.gerrit.plugins.repositoryuse.RefUpdateHandler.class , com.googlesource.gerrit.plugins.repositoryuse.RefUpdateHandlerImpl.class ) . build ( com.googlesource.gerrit.plugins.repositoryuse.RefUpdateHandlerFactory.class ) ) ; bind ( com.google.gerrit.extensions.events.LifecycleListener.class ) . annotatedWith ( com.google.inject.internal.UniqueAnnotations.create ( ) ) . to ( com.googlesource.gerrit.plugins.repositoryuse.SQLDriver.class ) ; }