auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void blockRead ( com.google.gerrit.extensions.common.GroupInfo group ) throws java.lang.Exception { com.google.gerrit.server.git.ProjectConfig cfg = projectCache.checkedGet ( project ) . getConfig ( ) ; com.google.gerrit.server.project.testing.Util.block ( cfg , Permission.READ , new com.google.gerrit.reviewdb.client.AccountGroup.UUID ( group.id ) , "refs/heads/master" ) ; saveProjectConfig ( project , cfg ) ; }

Target:
private void blockRead ( com.google.gerrit.extensions.common.GroupInfo group ) throws java.lang.Exception { com.google.gerrit.server.project.ProjectConfig cfg = projectCache.checkedGet ( project ) . getConfig ( ) ; com.google.gerrit.server.project.testing.Util.block ( cfg , Permission.READ , new com.google.gerrit.reviewdb.client.AccountGroup.UUID ( group.id ) , "refs/heads/master" ) ; saveProjectConfig ( project , cfg ) ; }
Source:
public void onChange ( final com.google.gwt.event.dom.client.ChangeEvent event ) { saveProject.setEnabled ( true ) ; }

Target:
private void initDescription ( ) { final com.google.gwt.user.client.ui.VerticalPanel vp = new com.google.gwt.user.client.ui.VerticalPanel ( ) ; vp.add ( new com.google.gerrit.client.ui.SmallHeading ( Util.C.headingDescription ( ) ) ) ; descTxt = new com.google.gwtexpui.globalkey.client.NpTextArea ( ) ; descTxt.setVisibleLines ( 6 ) ; descTxt.setCharacterWidth ( 60 ) ; vp.add ( descTxt ) ; add ( vp ) ; saveEnabler = new com.google.gerrit.client.ui.OnEditEnabler ( saveProject ) ; saveEnabler.listenTo ( descTxt ) ; }
Source:
void onDiscard ( com.google.gwt.event.dom.client.ClickEvent e ) { e.stopPropagation ( ) ; if ( isNew ( ) ) { removeUI ( ) ; restoreSelection ( ) ; } else { setEdit ( false ) ; com.google.gerrit.client.changes.CommentApi.deleteDraft ( psId , comment.id ( ) , new com.google.gerrit.client.rpc.GerritCallback < com.google.gwt.core.client.JavaScriptObject > ( ) { @ java.lang.Override public void onSuccess ( com.google.gwt.core.client.JavaScriptObject result ) { removeUI ( ) ; } } ) ; } }

Target:
void onDiscard ( com.google.gwt.event.dom.client.ClickEvent e ) { e.stopPropagation ( ) ; if ( isNew ( ) ) { removeUI ( ) ; restoreSelection ( ) ; } else { setEdit ( false ) ; pendingGroup = new com.google.gerrit.client.rpc.CallbackGroup ( ) ; com.google.gerrit.client.changes.CommentApi.deleteDraft ( psId , comment.id ( ) , pendingGroup.addFinal ( new com.google.gerrit.client.rpc.GerritCallback < com.google.gwt.core.client.JavaScriptObject > ( ) { @ java.lang.Override public void onSuccess ( com.google.gwt.core.client.JavaScriptObject result ) { pendingGroup = null ; removeUI ( ) ; } } ) ) ; } }
Source:
public void addMultipleMembers ( ) throws java.lang.Exception { java.lang.String g = group ( "users" ) ; com.google.gerrit.acceptance.TestAccount u1 = accounts.create ( "u1" , "u1@example.com" , "Full Name 1" ) ; com.google.gerrit.acceptance.TestAccount u2 = accounts.create ( "u2" , "u2@example.com" , "Full Name 2" ) ; gApi.groups ( ) . id ( g ) . addMembers ( u1.username , u2.username ) ; assertMembers ( g , admin , u1 , u2 ) ; }

Target:
public void addMultipleMembers ( ) throws java.lang.Exception { java.lang.String g = createGroup ( "users" ) ; com.google.gerrit.acceptance.TestAccount u1 = accounts.create ( "u1" , "u1@example.com" , "Full Name 1" ) ; com.google.gerrit.acceptance.TestAccount u2 = accounts.create ( "u2" , "u2@example.com" , "Full Name 2" ) ; gApi.groups ( ) . id ( g ) . addMembers ( u1.username , u2.username ) ; assertMembers ( g , u1 , u2 ) ; }
Source:
public java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.UUID > intersection ( java.lang.Iterable < com.google.gerrit.reviewdb.client.AccountGroup.UUID > groupIds ) { com.google.common.collect.ImmutableSet.Builder < com.google.gerrit.reviewdb.client.AccountGroup.UUID > groups = new com.google.common.collect.ImmutableSet.Builder < > ( ) ; for ( com.google.gerrit.reviewdb.client.AccountGroup.UUID uuid : groupIds ) { if ( contains ( uuid ) ) { groups.add ( uuid ) ; } } return groups.build ( ) ; }

Target:
public java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.UUID > intersection ( java.lang.Iterable < com.google.gerrit.reviewdb.client.AccountGroup.UUID > groupIds ) { com.google.common.collect.ImmutableSet.Builder < com.google.gerrit.reviewdb.client.AccountGroup.UUID > groupBuilder = new com.google.common.collect.ImmutableSet.Builder < > ( ) ; for ( com.google.gerrit.reviewdb.client.AccountGroup.UUID uuid : groupIds ) { if ( contains ( uuid ) ) { groupBuilder.add ( uuid ) ; } } return groupBuilder.build ( ) ; }
Source:
net.sf.ehcache.Element get ( final java.lang.String token ) { if ( ( token != null ) && ( ! ( "" . equals ( token ) ) ) ) { try { return self.get ( new com.google.gerrit.server.http.WebSessionManager.Key ( token ) ) ; } catch ( java.lang.IllegalStateException e ) { return null ; } catch ( net.sf.ehcache.CacheException e ) { return null ; } } else { return null ; } }

Target:
void updateRefreshCookieAt ( final com.google.gerrit.server.http.WebSessionManager.Val val ) { final long now = java.lang.System.currentTimeMillis ( ) ; val.refreshCookieAt = now + ( ( self.getTimeToIdle ( java.util.concurrent.TimeUnit.MILLISECONDS ) ) / 2 ) ; }
Source:
public void onFailure ( java.lang.Throwable err ) { if ( com.google.gerrit.client.change.SubmitFailureDialog.isConflict ( err ) ) { new com.google.gerrit.client.change.SubmitFailureDialog ( err.getMessage ( ) ) . center ( ) ; com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( id ) ) ; } else { super . onFailure ( err ) ; } }

Target:
public void onFailure ( java.lang.Throwable err ) { com.google.gerrit.client.change.EditActions.setEnabled ( true , editButtons ) ; if ( com.google.gerrit.client.change.SubmitFailureDialog.isConflict ( err ) ) { new com.google.gerrit.client.change.SubmitFailureDialog ( err.getMessage ( ) ) . center ( ) ; com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( id ) ) ; } else { super . onFailure ( err ) ; } }
Source:
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 ( ) ; }

Target:
public java.util.Collection < com.google.gerrit.reviewdb.client.PatchSet > visiblePatchSets ( ) throws com.google.gwtorm.server.OrmException { java.util.function.Predicate < ? super com.google.gerrit.reviewdb.client.PatchSet > predicate = ( ps ) -> { try { return changeControl ( ) . isPatchVisible ( ps , db ) ; } catch ( com.google.gwtorm.server.OrmException e ) { return false ; } } ; return patchSets ( ) . stream ( ) . filter ( predicate ) . collect ( java.util.stream.Collectors.toList ( ) ) ; }
Source:
public void simpleReadmeDoc ( ) throws java.lang.Exception { java.lang.String title = "DocServletTest simpleDoc" ; java.lang.String url = "http://daringfireball.net/projects/markdown/syntax" ; java.lang.String markdown = ( ( ( ( ( ( "# " + title ) + "\n" ) + "\n" ) + "Tests the rendering of " ) + "[Markdown](" ) + url ) + ")." ; repo.branch ( "master" ) . commit ( ) . add ( "README.md" , markdown ) . create ( ) ; java.lang.String html = buildHtml ( "/repo/+doc/master/README.md" ) ; org.junit.Assert.assertTrue ( html.contains ( ( ( "<title>" + title ) + "</title>" ) ) ) ; org.junit.Assert.assertTrue ( html.contains ( ( ( "<h1>" + title ) + "</h1>" ) ) ) ; org.junit.Assert.assertTrue ( html.contains ( ( ( "<a href=\"" + url ) + "\">Markdown</a>" ) ) ) ; }

Target:
public void simpleReadmeDoc ( ) throws java.lang.Exception { java.lang.String title = "DocServletTest simpleDoc" ; java.lang.String url = "http://daringfireball.net/projects/markdown/syntax" ; java.lang.String markdown = ( ( ( ( ( ( "# " + title ) + "\n" ) + "\n" ) + "Tests the rendering of " ) + "[Markdown](" ) + url ) + ")." ; repo.branch ( "master" ) . commit ( ) . add ( "README.md" , markdown ) . create ( ) ; java.lang.String html = buildHtml ( "/repo/+doc/master/README.md" ) ; org.junit.Assert.assertTrue ( html.contains ( ( ( "<title>" + title ) + "</title>" ) ) ) ; org.junit.Assert.assertTrue ( html.contains ( ( title + "</h1>" ) ) ) ; org.junit.Assert.assertTrue ( html.contains ( ( ( "<a href=\"" + url ) + "\">Markdown</a>" ) ) ) ; }
Source:
protected void run ( java.lang.String [ ] args ) throws com.google.gerrit.server.ssh.Failure { final com.google.gerrit.client.data.GroupCache gc = com.google.gerrit.client.rpc.Common.getGroupCache ( ) ; if ( gc.isAdministrator ( getAccountId ( ) ) ) { gc.flush ( ) ; com.google.gerrit.client.rpc.Common.getProjectCache ( ) . flush ( ) ; com.google.gerrit.client.rpc.Common.getAccountCache ( ) . flush ( ) ; } else { throw new com.google.gerrit.server.ssh.Failure ( 1 , "fatal: Not a Gerrit administrator" ) ; } }

Target:
protected void run ( java.lang.String [ ] args ) throws com.google.gerrit.server.ssh.Failure { final com.google.gerrit.client.data.GroupCache gc = com.google.gerrit.client.rpc.Common.getGroupCache ( ) ; if ( gc.isAdministrator ( getAccountId ( ) ) ) { gc.flush ( ) ; com.google.gerrit.client.rpc.Common.getProjectCache ( ) . flush ( ) ; com.google.gerrit.client.rpc.Common.getAccountCache ( ) . flush ( ) ; com.google.gerrit.server.ssh.SshUtil.flush ( ) ; } else { throw new com.google.gerrit.server.ssh.Failure ( 1 , "fatal: Not a Gerrit administrator" ) ; } }
Source:
public void loginPhase1 ( javax.servlet.http.HttpServletRequest request , javax.servlet.http.HttpServletResponse response , java.util.Set < com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.Scope > scopes ) throws java.io.IOException { java.lang.String scopesString = getScope ( scopes ) ; com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.LOG.debug ( ( ( ( "Initiating GitHub Login for ClientId=" + ( config.gitHubClientId ) ) + " Scopes=" ) + scopesString ) ) ; response.sendRedirect ( java.lang.String.format ( "%s?client_id=%s%s&redirect_uri=%s&state=%s%s" , config.gitHubOAuthUrl , config.gitHubClientId , scopesString , com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.getURLEncoded ( config.oAuthFinalRedirectUrl ) , me ( ) , com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.getURLEncoded ( request.getRequestURI ( ) . toString ( ) ) ) ) ; }

Target:
public java.lang.String getAuthorizationUrl ( java.lang.String scopesString , java.lang.String state ) { return ( ( ( ( ( config.gitHubOAuthUrl ) + "?client_id=" ) + ( config.gitHubClientId ) ) + ( com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.getURLEncodedParameter ( "&scope=" , scopesString ) ) ) + ( com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.getURLEncodedParameter ( "&redirect_uri=" , config.oAuthFinalRedirectUrl ) ) ) + ( com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.getURLEncodedParameter ( "&state=" , state ) ) ; }
Source:
private void deleteDraft ( java.lang.String changeId , java.lang.String revId , java.lang.String uuid ) throws java.io.IOException { com.google.gerrit.acceptance.RestResponse r = userSession.delete ( ( ( ( ( ( "/changes/" + changeId ) + "/revisions/" ) + revId ) + "/drafts/" ) + uuid ) ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( HttpStatus.SC_NO_CONTENT ) ; }

Target:
private void deleteDraft ( java.lang.String changeId , java.lang.String revId , java.lang.String uuid ) throws java.lang.Exception { gApi.changes ( ) . id ( changeId ) . revision ( revId ) . draft ( uuid ) . delete ( ) ; }
Source:
public com.google.gerrit.extensions.common.ChangeInfo apply ( com.google.gerrit.server.change.ChangeResource req , final 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 ( ) ; com.google.gerrit.server.IdentifiedUser caller = control.getUser ( ) . asIdentifiedUser ( ) ; if ( ! ( control.canAbandon ( ) ) ) { throw new com.google.gerrit.extensions.restapi.AuthException ( "abandon not permitted" ) ; } com.google.gerrit.reviewdb.client.Change change = abandon ( control , input.message , caller.getAccount ( ) ) ; 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.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 ) ; return json.create ( ChangeJson.NO_OPTIONS ) . format ( change ) ; }
Source:
public void filterOutAllResults ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < org.eclipse.jgit.internal.storage.dfs.InMemoryRepository > repo = createProject ( "repo" ) ; int user2 = accountManager.authenticate ( com.google.gerrit.server.account.AuthRequest.forUser ( "anotheruser" ) ) . getAccountId ( ) . get ( ) ; for ( int i = 0 ; i < 5 ; i ++ ) { newChange ( repo , null , null , user2 , null ) . insert ( ) ; } com.google.common.truth.Truth.assertThat ( query ( "status:new ownerin:Administrators" ) ) . isEmpty ( ) ; com.google.common.truth.Truth.assertThat ( query ( "status:new ownerin:Administrators limit:2" ) ) . isEmpty ( ) ; }

Target:
public void filterOutAllResults ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < org.eclipse.jgit.internal.storage.dfs.InMemoryRepository > repo = createProject ( "repo" ) ; int user2 = accountManager.authenticate ( com.google.gerrit.server.account.AuthRequest.forUser ( "anotheruser" ) ) . getAccountId ( ) . get ( ) ; for ( int i = 0 ; i < 5 ; i ++ ) { newChange ( repo , null , null , user2 , null ) . insert ( ) ; } assertQuery ( "status:new ownerin:Administrators" ) ; assertQuery ( "status:new ownerin:Administrators limit:2" ) ; }
Source:
public void visit ( org.pegdown.ast.RefLinkNode node ) { org.pegdown.ast.ReferenceNode ref = references.get ( node.referenceKey , com.google.gitiles.doc.MarkdownUtil.getInnerText ( node ) ) ; if ( ref != null ) { html.open ( "a" ) . attribute ( "href" , href ( ref.getUrl ( ) ) ) . attribute ( "title" , ref.getTitle ( ) ) ; visitChildren ( node ) ; html.close ( "a" ) ; } else { visitChildren ( node ) ; } }

Target:
public void visit ( org.pegdown.ast.RefLinkNode node ) { org.pegdown.ast.ReferenceNode ref = references.get ( node.referenceKey , com.google.gitiles.doc.MarkdownUtil.getInnerText ( node ) ) ; if ( ref != null ) { html.open ( "a" ) . attribute ( "href" , href ( ref.getUrl ( ) ) ) . attribute ( "title" , ref.getTitle ( ) ) ; visitChildren ( node ) ; html.close ( "a" ) ; } else { html.appendAndEscape ( "[" ) ; visitChildren ( node ) ; html.appendAndEscape ( "]" ) ; } }
Source:
public com.google.gwtjsonrpc.common.VoidResult call ( ) throws com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException , java.io.IOException { final com.google.gerrit.reviewdb.client.Change.Id changeId = patchSetId.getParentKey ( ) ; final com.google.gerrit.server.project.ChangeControl control = changeControlFactory.validateFor ( changeId ) ; if ( ! ( control.canDeleteDraft ( db ) ) ) { throw new com.google.gerrit.server.project.NoSuchChangeException ( changeId ) ; } com.google.gerrit.server.ChangeUtil.deleteDraftChange ( patchSetId , gitManager , gitRefUpdated , db ) ; return com.google.gwtjsonrpc.common.VoidResult.INSTANCE ; }

Target:
public com.google.gwtjsonrpc.common.VoidResult call ( ) throws com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException , java.io.IOException { final com.google.gerrit.reviewdb.client.Change.Id changeId = patchSetId.getParentKey ( ) ; final com.google.gerrit.server.project.ChangeControl control = changeControlFactory.validateFor ( changeId ) ; if ( ! ( control.canDeleteDraft ( db ) ) ) { throw new com.google.gerrit.server.project.NoSuchChangeException ( changeId ) ; } com.google.gerrit.server.ChangeUtil.deleteDraftChange ( patchSetId , gitManager , gitRefUpdated , db , indexer ) ; return com.google.gwtjsonrpc.common.VoidResult.INSTANCE ; }
Source:
public void populateDownloadCommandLinks ( ) { if ( ! ( urls.isEmpty ( ) ) ) { commands.add ( cmdLinkfactory.new com.google.gerrit.client.admin.CloneCommandLink ( ) ) ; if ( ( ( com.google.gerrit.client.Gerrit.getConfig ( ) . getSshdAddress ( ) ) != null ) && ( com.google.gerrit.client.admin.ProjectInfoScreen.hasUserName ( ) ) ) { commands.add ( cmdLinkfactory.new com.google.gerrit.client.admin.CloneWithCommitMsgHookCommandLink ( getProjectKey ( ) ) ) ; } } }

Target:
protected java.util.Set < com.google.gerrit.client.config.DownloadInfo.DownloadCommandInfo > getCommands ( com.google.gerrit.client.config.DownloadInfo.DownloadSchemeInfo schemeInfo ) { return schemeInfo.cloneCommands ( project ) ; }
Source:
private java.util.List < com.google.gerrit.reviewdb.RefRight > filterMatching ( java.util.Collection < com.google.gerrit.reviewdb.RefRight > rights ) { java.util.List < com.google.gerrit.reviewdb.RefRight > result = new java.util.ArrayList < com.google.gerrit.reviewdb.RefRight > ( ) ; for ( com.google.gerrit.reviewdb.RefRight right : rights ) { if ( com.google.gerrit.server.project.RefControl.matches ( change.getDest ( ) . get ( ) , right.getRefPattern ( ) ) ) { result.add ( right ) ; } } return result ; }

Target:
private java.util.List < com.google.gerrit.reviewdb.RefRight > filterMatching ( java.util.Collection < com.google.gerrit.reviewdb.RefRight > rights , com.google.gerrit.reviewdb.ApprovalCategory.Id category ) { java.util.List < com.google.gerrit.reviewdb.RefRight > result = new java.util.ArrayList < com.google.gerrit.reviewdb.RefRight > ( ) ; for ( com.google.gerrit.reviewdb.RefRight right : rights ) { if ( ( com.google.gerrit.server.project.RefControl.matches ( change.getDest ( ) . get ( ) , right.getRefPattern ( ) ) ) && ( category.equals ( right.getApprovalCategoryId ( ) ) ) ) { result.add ( right ) ; } } return result ; }
Source:
private com.google.gerrit.gpg.PushCertificateChecker newChecker ( boolean checkNonce ) { return new com.google.gerrit.gpg.PushCertificateChecker ( new com.google.gerrit.gpg.PublicKeyChecker ( ) , checkNonce ) { @ java.lang.Override protected org.eclipse.jgit.lib.Repository getRepository ( ) { return tr.getRepository ( ) ; } @ java.lang.Override protected boolean shouldClose ( org.eclipse.jgit.lib.Repository repo ) { return false ; } } ; }

Target:
private com.google.gerrit.gpg.PushCertificateChecker newChecker ( boolean checkNonce ) { return new com.google.gerrit.gpg.PushCertificateChecker ( new com.google.gerrit.gpg.PublicKeyChecker ( ) ) { @ java.lang.Override protected org.eclipse.jgit.lib.Repository getRepository ( ) { return tr.getRepository ( ) ; } @ java.lang.Override protected boolean shouldClose ( org.eclipse.jgit.lib.Repository repo ) { return false ; } } . setCheckNonce ( checkNonce ) ; }
Source:
protected void configure ( ) { bind ( com.google.gerrit.extensions.api.changes.Changes.class ) . to ( com.google.gerrit.server.api.changes.ChangesImpl.class ) ; factory ( ChangeApiImpl.Factory.class ) ; factory ( CommentApiImpl.Factory.class ) ; factory ( RobotCommentApiImpl.Factory.class ) ; factory ( DraftApiImpl.Factory.class ) ; factory ( RevisionApiImpl.Factory.class ) ; factory ( FileApiImpl.Factory.class ) ; factory ( ReviewerApiImpl.Factory.class ) ; }

Target:
protected void configure ( ) { bind ( com.google.gerrit.extensions.api.changes.Changes.class ) . to ( com.google.gerrit.server.api.changes.ChangesImpl.class ) ; factory ( ChangeApiImpl.Factory.class ) ; factory ( CommentApiImpl.Factory.class ) ; factory ( RobotCommentApiImpl.Factory.class ) ; factory ( DraftApiImpl.Factory.class ) ; factory ( RevisionApiImpl.Factory.class ) ; factory ( FileApiImpl.Factory.class ) ; factory ( ReviewerApiImpl.Factory.class ) ; factory ( RevisionReviewerApiImpl.Factory.class ) ; }
Source:
public void invalidRevision ( ) throws java.lang.Exception { assumeNoteDbDisabled ( ) ; com.google.gerrit.server.project.ChangeControl ctl = insertChange ( ) ; com.google.gerrit.reviewdb.client.PatchSet ps = com.google.gerrit.testutil.TestChanges.newPatchSet ( ctl.getChange ( ) . currentPatchSetId ( ) , "fooooooooooooooooooooooooooooooooooooooo" , adminId ) ; db.patchSets ( ) . update ( java.util.Collections.singleton ( ps ) ) ; assertProblems ( ctl , null , com.google.gerrit.acceptance.server.change.ConsistencyCheckerIT.problem ( "Invalid revision on patch set 1: fooooooooooooooooooooooooooooooooooooooo" ) ) ; }

Target:
public void invalidRevision ( ) throws java.lang.Exception { assumeNoteDbDisabled ( ) ; com.google.gerrit.server.notedb.ChangeNotes notes = insertChange ( ) ; com.google.gerrit.reviewdb.client.PatchSet ps = com.google.gerrit.testutil.TestChanges.newPatchSet ( notes.getChange ( ) . currentPatchSetId ( ) , "fooooooooooooooooooooooooooooooooooooooo" , adminId ) ; db.patchSets ( ) . update ( java.util.Collections.singleton ( ps ) ) ; assertProblems ( notes , null , com.google.gerrit.acceptance.server.change.ConsistencyCheckerIT.problem ( "Invalid revision on patch set 1: fooooooooooooooooooooooooooooooooooooooo" ) ) ; }
Source:
public void removeNote ( org.eclipse.jgit.notes.NoteMap noteMap , com.google.gerrit.reviewdb.client.RevId commitId ) throws java.io.IOException { noteMap.remove ( org.eclipse.jgit.lib.ObjectId.fromString ( commitId.get ( ) ) ) ; }

Target:
static void addCommentToMap ( java.util.Map < com.google.gerrit.reviewdb.client.RevId , java.util.List < com.google.gerrit.reviewdb.client.PatchLineComment > > map , com.google.gerrit.reviewdb.client.PatchLineComment c ) { java.util.List < com.google.gerrit.reviewdb.client.PatchLineComment > list = map.get ( c.getRevId ( ) ) ; if ( list == null ) { list = new java.util.ArrayList < > ( ) ; map.put ( c.getRevId ( ) , list ) ; } list.add ( c ) ; }
Source:
public int compare ( com.google.gerrit.client.account.AccountInfo a , com.google.gerrit.client.account.AccountInfo b ) { int cmp = nullToEmpty ( a.name ( ) ) . compareTo ( nullToEmpty ( b.name ( ) ) ) ; if ( cmp != 0 ) { return cmp ; } cmp = nullToEmpty ( a.email ( ) ) . compareTo ( nullToEmpty ( b.email ( ) ) ) ; if ( cmp != 0 ) { return cmp ; } return ( a._account_id ( ) ) - ( b._account_id ( ) ) ; }

Target:
public int compare ( com.google.gerrit.client.account.AccountInfo a , com.google.gerrit.client.account.AccountInfo b ) { int cmp = nullToEmpty ( a.name ( ) ) . compareTo ( nullToEmpty ( b.name ( ) ) ) ; if ( cmp != 0 ) { return cmp ; } cmp = nullToEmpty ( a.email ( ) ) . compareTo ( nullToEmpty ( b.email ( ) ) ) ; if ( cmp != 0 ) { return cmp ; } return ( a._accountId ( ) ) - ( b._accountId ( ) ) ; }
Source:
public void testMIXED_NoPreferredEmailUser ( ) { setFrom ( "MIXED" ) ; final java.lang.String name = "A U. Thor" ; final com.google.gerrit.reviewdb.client.Account.Id user = user ( name , null ) ; org.easymock.EasyMock.replay ( accountCache ) ; final com.google.gerrit.server.mail.Address r = create ( ) . from ( user ) ; org.junit.Assert.assertNotNull ( r ) ; org.junit.Assert.assertEquals ( ( name + " (Code Review)" ) , r.name ) ; org.junit.Assert.assertEquals ( ident.getEmailAddress ( ) , r.email ) ; org.easymock.EasyMock.verify ( accountCache ) ; }

Target:
public void testCUSTOM_NullUser ( ) { setFrom ( "A ${user} B <my.server@email.address>" ) ; org.easymock.EasyMock.replay ( accountCache ) ; final com.google.gerrit.server.mail.Address r = create ( ) . from ( null ) ; com.google.common.truth.Truth.assertThat ( r ) . isNotNull ( ) ; com.google.common.truth.Truth.assertThat ( r.name ) . isEqualTo ( ident.getName ( ) ) ; com.google.common.truth.Truth.assertThat ( r.email ) . isEqualTo ( "my.server@email.address" ) ; org.easymock.EasyMock.verify ( accountCache ) ; }
Source:
void display ( final com.google.gerrit.common.data.ProjectDetail result ) { project = result.project ; descTxt.setText ( project.getDescription ( ) ) ; setBool ( contributorAgreements , result.useContributorAgreements ) ; setBool ( signedOffBy , result.useSignedOffBy ) ; setBool ( contentMerge , result.useContentMerge ) ; setBool ( requireChangeID , result.requireChangeID ) ; setSubmitType ( project.getSubmitType ( ) ) ; setState ( project.getState ( ) ) ; saveProject.setEnabled ( false ) ; }

Target:
void display ( final com.google.gerrit.common.data.ProjectDetail result ) { project = result.project ; descTxt.setText ( project.getDescription ( ) ) ; setBool ( contributorAgreements , result.useContributorAgreements ) ; setBool ( signedOffBy , result.useSignedOffBy ) ; setBool ( contentMerge , result.useContentMerge ) ; setBool ( requireChangeID , result.requireChangeID ) ; setSubmitType ( project.getSubmitType ( ) ) ; setState ( project.getState ( ) ) ; maxObjectSizeLimit.setText ( project.getMaxObjectSizeLimit ( ) ) ; saveProject.setEnabled ( false ) ; }
Source:
public void onClick ( final com.google.gwt.event.dom.client.ClickEvent event ) { final java.lang.String newName = groupNameTxt.getText ( ) . trim ( ) ; Util.GROUP_SVC.renameGroup ( getGroupId ( ) , newName , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.common.data.GroupDetail > ( ) { public void onSuccess ( final com.google.gerrit.common.data.GroupDetail groupDetail ) { saveName.setEnabled ( false ) ; setPageTitle ( Util.M.group ( groupDetail.group.getName ( ) ) ) ; display ( groupDetail ) ; } } ) ; }

Target:
public void onClick ( final com.google.gwt.event.dom.client.ClickEvent event ) { final java.lang.String newName = groupNameTxt.getText ( ) . trim ( ) ; com.google.gerrit.client.groups.GroupApi.renameGroup ( getGroupUUID ( ) , newName , new com.google.gerrit.client.rpc.GerritCallback < com.google.gwtjsonrpc.common.com.google.gerrit.client.VoidResult > ( ) { public void onSuccess ( final com.google.gwtjsonrpc.common.com.google.gerrit.client.VoidResult result ) { saveName.setEnabled ( false ) ; setPageTitle ( Util.M.group ( newName ) ) ; groupNameTxt.setText ( newName ) ; } } ) ; }
Source:
public static void display ( final java.lang.String historyToken , final boolean go ) { com.google.gwt.user.client.History.newItem ( historyToken , go ) ; if ( ( ! go ) && ( ( com.google.gerrit.client.Gerrit.historyHooks ) != null ) ) { com.google.gerrit.client.Gerrit.dispatchHistoryHooks ( historyToken ) ; } }

Target:
protected void onShowView ( com.google.gerrit.client.ui.Screen view ) { final java.lang.String token = view.getToken ( ) ; if ( ! ( token.equals ( com.google.gwt.user.client.History.getToken ( ) ) ) ) { com.google.gwt.user.client.History.newItem ( token , false ) ; if ( ( com.google.gerrit.client.Gerrit.historyHooks ) != null ) { com.google.gerrit.client.Gerrit.dispatchHistoryHooks ( token ) ; } } super . onShowView ( view ) ; view.onShowView ( ) ; }
Source:
public void go ( ) { if ( ( com.google.gerrit.client.Gerrit.patchScreen ) != null ) { com.google.gerrit.client.Gerrit.patchScreen.setTopView ( PatchScreen.TopView.MAIN ) ; if ( type == ( com.google.gerrit.client.Gerrit.patchScreen.getPatchScreenType ( ) ) ) { com.google.gwt.dom.client.AnchorElement.as ( getElement ( ) ) . blur ( ) ; } else { new com.google.gerrit.client.ui.PatchLink ( "" , type , com.google.gerrit.client.Gerrit.patchScreen ) . go ( ) ; } } }

Target:
protected void onScreenLoad ( com.google.gerrit.reviewdb.client.Project.NameKey project ) { java.lang.String p = panel.replace ( "${projectName}" , project.get ( ) ) ; if ( panel.startsWith ( "/x/" ) ) { setTargetHistoryToken ( p ) ; } else if ( com.google.gerrit.client.Gerrit.isAbsolute ( panel ) ) { getElement ( ) . setPropertyString ( "href" , p ) ; } else { getElement ( ) . setPropertyString ( "href" , com.google.gerrit.client.Gerrit.selfRedirect ( p ) ) ; } }
Source:
public void onSuccess ( final com.google.gerrit.client.com.google.gerrit.client.VoidResult result ) { saveName.setEnabled ( false ) ; setPageTitle ( Util.M.group ( newName ) ) ; groupNameTxt.setText ( newName ) ; if ( getGroupUUID ( ) . equals ( getOwnerGroupUUID ( ) ) ) { ownerTxt.setText ( newName ) ; } }

Target:
public void onSuccess ( final com.google.gerrit.client.com.google.gerrit.client.VoidResult result ) { saveName.setEnabled ( false ) ; setPageTitle ( AdminMessages.I.group ( newName ) ) ; groupNameTxt.setText ( newName ) ; if ( getGroupUUID ( ) . equals ( getOwnerGroupUUID ( ) ) ) { ownerTxt.setText ( newName ) ; } }
Source:
protected void configure ( ) { final com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < java.lang.String , java.util.List > > type = new com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < java.lang.String , java.util.List > > ( ) { } ; core ( type , "openid" ) . timeToIdle ( 5 , java.util.concurrent.TimeUnit.MINUTES ) . timeToLive ( 5 , java.util.concurrent.TimeUnit.MINUTES ) ; }

Target:
protected void configure ( ) { final com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < java.lang.String , java.util.List > > type = new com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < java.lang.String , java.util.List > > ( ) { } ; core ( type , "openid" ) . timeToIdle ( 5 , java.util.concurrent.TimeUnit.MINUTES ) . timeToLive ( 5 , java.util.concurrent.TimeUnit.MINUTES ) . memoryLimit ( 64 ) ; }
Source:
public void noRescheduleOnNonRecoverableException ( ) throws java.io.IOException { org.mockito.Mockito.when ( session.post ( com.googlesource.gerrit.plugins.webhooks.PostTaskTest.WEBHOOK_URL , com.googlesource.gerrit.plugins.webhooks.PostTaskTest.HEADERS , remote , com.googlesource.gerrit.plugins.webhooks.PostTaskTest.BODY ) ) . thenThrow ( javax.net.ssl.SSLException.class ) ; task.run ( ) ; org.mockito.Mockito.verifyZeroInteractions ( executor ) ; }

Target:
public void rescheduleOnError ( ) throws java.io.IOException { org.mockito.Mockito.when ( session.post ( org.mockito.ArgumentMatchers.eq ( remote ) , org.mockito.ArgumentMatchers.eq ( content ) ) ) . thenReturn ( com.googlesource.gerrit.plugins.webhooks.PostTaskTest.ERR_RESULT ) ; task.run ( ) ; org.mockito.Mockito.verify ( executor , org.mockito.Mockito.times ( 1 ) ) . schedule ( task , com.googlesource.gerrit.plugins.webhooks.PostTaskTest.RETRY_INTERVAL , java.util.concurrent.TimeUnit.MILLISECONDS ) ; }
Source:
protected com.google.gerrit.reviewdb.client.PatchLineComment newPublishedComment ( com.google.gerrit.reviewdb.client.PatchSet.Id psId , java.lang.String filename , java.lang.String UUID , com.google.gerrit.reviewdb.client.CommentRange range , int line , com.google.gerrit.server.IdentifiedUser commenter , java.lang.String parentUUID , java.sql.Timestamp t , java.lang.String message , short side , java.lang.String commitSHA1 ) { return newComment ( psId , filename , UUID , range , line , commenter , parentUUID , t , message , side , commitSHA1 , PatchLineComment.Status.PUBLISHED ) ; }

Target:
protected com.google.gerrit.reviewdb.client.Comment newComment ( com.google.gerrit.reviewdb.client.PatchSet.Id psId , java.lang.String filename , java.lang.String UUID , com.google.gerrit.reviewdb.client.CommentRange range , int line , com.google.gerrit.server.IdentifiedUser commenter , java.lang.String parentUUID , java.sql.Timestamp t , java.lang.String message , short side , java.lang.String commitSHA1 ) { com.google.gerrit.reviewdb.client.Comment c = new com.google.gerrit.reviewdb.client.Comment ( new com.google.gerrit.reviewdb.client.Comment.Key ( UUID , filename , psId.get ( ) ) , commenter.getAccountId ( ) , t , side , message , serverId ) ; c.lineNbr = line ; c.parentUuid = parentUUID ; c.revId = commitSHA1 ; c.setRange ( range ) ; return c ; }
Source:
private com.google.gerrit.reviewdb.client.Change newChange ( ) { com.google.gerrit.reviewdb.client.Change.Id changeId = new com.google.gerrit.reviewdb.client.Change.Id ( 1 ) ; com.google.gerrit.reviewdb.client.Change c = new com.google.gerrit.reviewdb.client.Change ( new com.google.gerrit.reviewdb.client.Change.Key ( "Iabcd1234abcd1234abcd1234abcd1234abcd1234" ) , changeId , com.google.gerrit.server.notedb.ChangeNotesTest.CHANGE_OWNER.getId ( ) , new com.google.gerrit.reviewdb.client.Branch.NameKey ( project , "master" ) , com.google.gerrit.server.util.TimeUtil.nowTs ( ) ) ; com.google.gerrit.server.notedb.ChangeNotesTest.incrementPatchSet ( c ) ; return c ; }

Target:
private com.google.gerrit.reviewdb.client.Change newChange ( ) { com.google.gerrit.reviewdb.client.Change.Id changeId = new com.google.gerrit.reviewdb.client.Change.Id ( 1 ) ; com.google.gerrit.reviewdb.client.Change c = new com.google.gerrit.reviewdb.client.Change ( new com.google.gerrit.reviewdb.client.Change.Key ( "Iabcd1234abcd1234abcd1234abcd1234abcd1234" ) , changeId , changeOwner.getAccount ( ) . getId ( ) , new com.google.gerrit.reviewdb.client.Branch.NameKey ( project , "master" ) , com.google.gerrit.server.util.TimeUtil.nowTs ( ) ) ; com.google.gerrit.server.notedb.ChangeNotesTest.incrementPatchSet ( c ) ; return c ; }
Source:
protected void populate ( final int row , final com.google.gerrit.client.projects.ProjectInfo k ) { final com.google.gwt.user.client.ui.Anchor projectLink = new com.google.gwt.user.client.ui.Anchor ( k.name ( ) ) ; projectLink.addClickHandler ( new com.google.gwt.event.dom.client.ClickHandler ( ) { @ java.lang.Override public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { suggestParent.setText ( getRowItem ( row ) . name ( ) ) ; } } ) ; table.setWidget ( row , 1 , projectLink ) ; table.setText ( row , 2 , k.description ( ) ) ; setRowItem ( row , k ) ; }

Target:
protected void populate ( final int row , final com.google.gerrit.client.projects.ProjectInfo k ) { final com.google.gwt.user.client.ui.Anchor projectLink = new com.google.gwt.user.client.ui.Anchor ( k.name ( ) ) ; projectLink.addClickHandler ( new com.google.gwt.event.dom.client.ClickHandler ( ) { @ java.lang.Override public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { suggestParent.setText ( getRowItem ( row ) . name ( ) ) ; } } ) ; table.setWidget ( row , 2 , projectLink ) ; table.setText ( row , 3 , k.description ( ) ) ; setRowItem ( row , k ) ; }
Source:
public void onSuccess ( java.lang.Void result ) { java.lang.String b = ( ( base ) != null ) ? base.getId ( ) : null ; java.lang.String rev = revision.getId ( ) ; com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( changeId , b , rev ) , new com.google.gerrit.client.change.ChangeScreen2 ( changeId , b , rev , openReplyBox ) ) ; }

Target:
public void onSuccess ( java.lang.Void result ) { java.lang.String b = ( ( base ) != null ) ? base.getId ( ) : null ; java.lang.String rev = revision.getId ( ) ; com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( changeId , b , rev ) , new com.google.gerrit.client.change.ChangeScreen2 ( changeId , b , rev , openReplyBox , FileTable.Mode.REVIEW ) ) ; }
Source:
void set ( com.google.gerrit.client.info.ChangeInfo info ) { this . changeId = info.legacyId ( ) ; assigneeLink.setText ( ( ( info.assignee ( ) ) != null ? info.assignee ( ) . name ( ) : "" ) ) ; assigneeSuggestOracle.setChange ( changeId ) ; editAssigneeIcon.setVisible ( com.google.gerrit.client.Gerrit.isSignedIn ( ) ) ; }

Target:
private java.lang.String getName ( com.google.gerrit.client.info.AccountInfo info ) { if ( ( info.name ( ) ) != null ) { return info.name ( ) ; } if ( ( info.email ( ) ) != null ) { return info.email ( ) ; } return com.google.gerrit.client.Gerrit.info ( ) . user ( ) . anonymousCowardName ( ) ; }
Source:
public void insertedWhitespaceIsRecognized ( ) throws java.lang.Exception { java.lang.String a = " int *foobar\n" ; java.lang.String b = " int * foobar\n" ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.server.patch.IntraLineLoaderTest.intraline ( a , b ) ) . isEqualTo ( com.google.gerrit.server.patch.IntraLineLoaderTest.wordEdit ( 6 , 6 , 6 , 7 ) ) ; }

Target:
public void insertedWhitespaceIsRecognized ( ) throws java.lang.Exception { java.lang.String a = " int *foobar\n" ; java.lang.String b = " int * foobar\n" ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.server.patch.IntraLineLoaderTest.intraline ( a , b ) ) . isEqualTo ( com.google.gerrit.server.patch.IntraLineLoaderTest.ref ( ) . common ( " int *" ) . insert ( " " ) . common ( "foobar\n" ) . edits ) ; }
Source:
private void assertGetComment ( com.google.gerrit.server.change.RevisionResource res , com.google.gerrit.reviewdb.client.PatchLineComment expected , java.lang.String uuid ) throws java.lang.Exception { try { com.google.gerrit.server.change.CommentResource commentRes = comments.parse ( res , com.google.gerrit.extensions.restapi.IdString.fromUrl ( uuid ) ) ; if ( expected == null ) { org.junit.Assert.fail ( "Expected no comment" ) ; } com.google.gerrit.extensions.common.CommentInfo actual = getComment.apply ( commentRes ) ; com.google.gerrit.server.change.CommentsTest.assertComment ( expected , actual , true ) ; } catch ( com.google.gerrit.extensions.restapi.ResourceNotFoundException e ) { if ( expected != null ) { org.junit.Assert.fail ( "Expected to find comment" ) ; } } }

Target:
public void testGetCommentNotExisting ( ) throws java.lang.Exception { exception.expect ( com.google.gerrit.extensions.restapi.ResourceNotFoundException.class ) ; comments.parse ( revRes1 , com.google.gerrit.extensions.restapi.IdString.fromUrl ( "BadComment" ) ) ; }
Source:
public void operationComplete ( org.apache.mina.core.future.IoFuture future ) { final com.google.gerrit.sshd.SshScope.Context ctx = new com.google.gerrit.sshd.SshScope.Context ( sd , null ) ; final com.google.gerrit.sshd.SshScope.Context old = com.google.gerrit.sshd.SshScope.set ( ctx ) ; try { sshLog.onLogout ( ) ; } finally { com.google.gerrit.sshd.SshScope.set ( old ) ; } }

Target:
public void operationComplete ( org.apache.mina.core.future.IoFuture future ) { final com.google.gerrit.sshd.SshScope.Context ctx = new com.google.gerrit.sshd.SshScope.Context ( sd , null ) ; final com.google.gerrit.sshd.SshScope.Context old = sshScope.set ( ctx ) ; try { sshLog.onLogout ( ) ; } finally { sshScope.set ( old ) ; } }
Source:
void restore ( com.googlecode.prolog_cafe.lang.Prolog engine ) { engine.cont = this . cont ; engine.areg1 = this . areg1 ; engine.areg2 = this . areg2 ; engine.areg3 = this . areg3 ; }

Target:
void restore ( com.googlecode.prolog_cafe.lang.Prolog engine ) { engine.cont = this . cont ; engine.r1 = this . r1 ; engine.r2 = this . r2 ; engine.r3 = this . r3 ; engine.r4 = this . r4 ; engine.r5 = this . r5 ; engine.r6 = this . r6 ; engine.r7 = this . r7 ; engine.r8 = this . r8 ; engine.r9 = this . r9 ; }
Source:
private void deleteGitRepository ( final com.google.gerrit.reviewdb.client.Project.NameKey project , final java.io.File repoParentFile ) throws java.io.IOException { java.nio.file.Path trash = moveToTrash ( repoParentFile.toPath ( ) , project ) ; try { recursiveDelete ( trash ) ; } catch ( java.io.IOException e ) { com.googlesource.gerrit.plugins.deleteproject.fs.FilesystemDeleteHandler.log.warn ( ( "Error trying to delete " + trash ) , e ) ; } }

Target:
public java.lang.String getProjectName ( ) { return project.get ( ) ; }
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" ) ) ) ; parser = new com.google.gitiles.RevisionParser ( repo.getRepository ( ) , new com.google.gitiles.TestGitilesAccess ( repo.getRepository ( ) ) . forRequest ( null ) , new com.google.gitiles.VisibilityCache ( false , com.google.common.cache.CacheBuilder.newBuilder ( ) . maximumSize ( 0 ) ) ) ; }

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" ) ) ) ; parser = new com.google.gitiles.RevisionParser ( repo.getRepository ( ) , new com.google.gitiles.TestGitilesAccess ( repo.getRepository ( ) ) . forRequest ( null ) , new com.google.gitiles.VisibilityCache ( false , com.google.common.cache.CacheBuilder.newBuilder ( ) . maximumSize ( 0 ) ) ) ; }
Source:
private java.lang.String indent ( int spaces ) { if ( spaces == 0 ) { return "" ; } else { return java.lang.String.format ( ( ( "%" + spaces ) + "s" ) , " " ) ; } }

Target:
private int getEffectiveLimit ( com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > p ) { java.util.List < java.lang.Integer > possibleLimits = new java.util.ArrayList < > ( 3 ) ; possibleLimits.add ( permittedLimit ) ; if ( ( limitFromCaller ) > 0 ) { possibleLimits.add ( limitFromCaller ) ; } java.lang.Integer limitFromPredicate = com.google.gerrit.server.query.change.LimitPredicate.getLimit ( p ) ; if ( limitFromPredicate != null ) { possibleLimits.add ( limitFromPredicate ) ; } return com.google.common.collect.Ordering.natural ( ) . min ( possibleLimits ) ; }
Source:
public static com.google.gerrit.extensions.client.EditPreferencesInfo defaults ( ) { com.google.gerrit.extensions.client.EditPreferencesInfo i = new com.google.gerrit.extensions.client.EditPreferencesInfo ( ) ; i.tabSize = 8 ; i.lineLength = 100 ; i.cursorBlinkRate = 0 ; i.hideTopMenu = false ; i.showTabs = true ; i.showWhitespaceErrors = false ; i.syntaxHighlighting = true ; i.hideLineNumbers = false ; i.matchBrackets = true ; i.autoCloseBrackets = false ; i.theme = Theme.DEFAULT ; i.keyMapType = KeyMapType.DEFAULT ; return i ; }

Target:
public static com.google.gerrit.extensions.client.EditPreferencesInfo defaults ( ) { com.google.gerrit.extensions.client.EditPreferencesInfo i = new com.google.gerrit.extensions.client.EditPreferencesInfo ( ) ; i.tabSize = 8 ; i.lineLength = 100 ; i.indentUnit = 2 ; i.cursorBlinkRate = 0 ; i.hideTopMenu = false ; i.showTabs = true ; i.showWhitespaceErrors = false ; i.syntaxHighlighting = true ; i.hideLineNumbers = false ; i.matchBrackets = true ; i.autoCloseBrackets = false ; i.theme = Theme.DEFAULT ; i.keyMapType = KeyMapType.DEFAULT ; return i ; }
Source:
private boolean isAnyCommitOfPullRequestToBeImported ( com.google.gerrit.reviewdb.server.ReviewDb db , org.eclipse.jgit.lib.Repository gitRepo , org.kohsuke.github.GHPullRequest ghPullRequest ) throws java.io.IOException , org.eclipse.jgit.errors.IncorrectObjectTypeException { boolean pullRequestToImport = false ; try { for ( org.kohsuke.github.GHPullRequestCommitDetail pullRequestCommit : ghPullRequest.listCommits ( ) ) { pullRequestToImport |= qp.queryChanges ( changeQuery.commit ( pullRequestCommit.getSha ( ) ) ) . changes ( ) . isEmpty ( ) ; } return pullRequestToImport ; } catch ( com.google.gwtorm.server.OrmException | com.google.gerrit.server.query.QueryParseException e ) { com.googlesource.gerrit.plugins.github.wizard.PullRequestListController.LOG.error ( ( "Unable to query Gerrit changes for pull-request " + ( ghPullRequest.getNumber ( ) ) ) , e ) ; return false ; } }

Target:
private boolean isAnyCommitOfPullRequestToBeImported ( com.google.gerrit.reviewdb.server.ReviewDb db , org.eclipse.jgit.lib.Repository gitRepo , org.kohsuke.github.GHPullRequest ghPullRequest ) throws java.io.IOException , org.eclipse.jgit.errors.IncorrectObjectTypeException { boolean pullRequestToImport = false ; try { for ( org.kohsuke.github.GHPullRequestCommitDetail pullRequestCommit : ghPullRequest.listCommits ( ) ) { pullRequestToImport |= qp.query ( changeQuery.commit ( pullRequestCommit.getSha ( ) ) ) . entities ( ) . isEmpty ( ) ; } return pullRequestToImport ; } catch ( com.google.gwtorm.server.OrmException | com.google.gerrit.server.query.QueryParseException e ) { com.googlesource.gerrit.plugins.github.wizard.PullRequestListController.LOG.error ( ( "Unable to query Gerrit changes for pull-request " + ( ghPullRequest.getNumber ( ) ) ) , e ) ; return false ; } }
Source:
private java.lang.String name ( com.google.gerrit.client.account.AccountInfo a ) { if ( ( a.name ( ) ) != null ) { return a.name ( ) ; } else if ( ( a.email ( ) ) != null ) { return a.email ( ) ; } return "" ; }

Target:
private java.lang.String name ( com.google.gerrit.client.info.AccountInfo a ) { if ( ( a.name ( ) ) != null ) { return a.name ( ) ; } else if ( ( a.email ( ) ) != null ) { return a.email ( ) ; } return "" ; }
Source:
private void load ( ) throws java.io.IOException { reset ( ) ; reader = repo.newObjectReader ( ) ; org.eclipse.jgit.lib.Ref ref = repo.getRefDatabase ( ) . exactRef ( RefNames.REFS_GPG_KEYS ) ; if ( ref == null ) { return ; } try ( org.eclipse.jgit.revwalk.RevWalk rw = new org.eclipse.jgit.revwalk.RevWalk ( reader ) ) { tip = rw.parseCommit ( ref.getObjectId ( ) ) ; notes = org.eclipse.jgit.notes.NoteMap.read ( reader , tip ) ; } }

Target:
private void load ( ) throws java.io.IOException { reset ( ) ; reader = repo.newObjectReader ( ) ; org.eclipse.jgit.lib.Ref ref = repo.getRefDatabase ( ) . exactRef ( com.google.gerrit.gpg.PublicKeyStore.REFS_GPG_KEYS ) ; if ( ref == null ) { return ; } try ( org.eclipse.jgit.revwalk.RevWalk rw = new org.eclipse.jgit.revwalk.RevWalk ( reader ) ) { tip = rw.parseCommit ( ref.getObjectId ( ) ) ; notes = org.eclipse.jgit.notes.NoteMap.read ( reader , tip ) ; } }
Source:
private void configureAuth ( ) { github.string ( "ClientId" , "clientId" , null ) ; github.string ( "ClientSecret" , "clientSecret" , null ) ; auth.string ( "HTTP Authentication Header" , "httpHeader" , "GITHUB_USER" ) ; auth.set ( "type" , "HTTP" ) ; httpd.set ( "filterClass" , "com.googlesource.gerrit.plugins.github.oauth.OAuthFilter" ) ; }

Target:
private void configureAuth ( ) { github.string ( "GitHub Client ID" , "clientId" , null ) ; github.passwordForKey ( "GitHub Client Secret" , "clientSecret" ) ; com.googlesource.gerrit.plugins.github.InitGitHub.OAuthType authType = auth.select ( "Gerrit OAuth implementation" , "type" , com.googlesource.gerrit.plugins.github.InitGitHub.OAuthType.HTTP ) ; if ( authType.equals ( com.googlesource.gerrit.plugins.github.InitGitHub.OAuthType.HTTP ) ) { auth.string ( "HTTP Authentication Header" , "httpHeader" , "GITHUB_USER" ) ; httpd.set ( "filterClass" , "com.googlesource.gerrit.plugins.github.oauth.OAuthFilter" ) ; } else { httpd.unset ( "filterClass" ) ; httpd.unset ( "httpHeader" ) ; } }
Source:
BRANCH ( com.google.gerrit.httpd.raw.f5eb71 Merge ) { }

Target:
javax.servlet.http.HttpServlet getGwtUiServlet ( @ com.google.inject.name.Named ( value = com.google.gerrit.httpd.raw.StaticModule.CACHE ) com.google.common.cache.Cache < java.nio.file.Path , com.google.gerrit.httpd.raw.ResourceServlet.Resource > cache ) throws java.io.IOException { com.google.gerrit.httpd.raw.StaticModule.Paths p = getPaths ( ) ; if ( ( p.warFs ) != null ) { return new com.google.gerrit.httpd.raw.WarGwtUiServlet ( cache , p.warFs ) ; } else { return new com.google.gerrit.httpd.raw.DeveloperGwtUiServlet ( cache , p.unpackedWar ) ; } }
Source:
public void save ( ) throws java.lang.Exception { com.google.gerrit.gpg.testutil.TestKey key1 = com.google.gerrit.gpg.testutil.TestKeys.validKeyWithoutExpiration ( ) ; com.google.gerrit.gpg.testutil.TestKey key2 = com.google.gerrit.gpg.testutil.TestKeys.validKeyWithExpiration ( ) ; store.add ( key1.getPublicKeyRing ( ) ) ; store.add ( key2.getPublicKeyRing ( ) ) ; org.junit.Assert.assertEquals ( RefUpdate.Result.NEW , store.save ( newCommitBuilder ( ) ) ) ; assertKeys ( key1.getKeyId ( ) , key1 ) ; assertKeys ( key2.getKeyId ( ) , key2 ) ; }

Target:
public void save ( ) throws java.lang.Exception { com.google.gerrit.gpg.testing.TestKey key1 = com.google.gerrit.gpg.testing.TestKeys.validKeyWithoutExpiration ( ) ; com.google.gerrit.gpg.testing.TestKey key2 = com.google.gerrit.gpg.testing.TestKeys.validKeyWithExpiration ( ) ; store.add ( key1.getPublicKeyRing ( ) ) ; store.add ( key2.getPublicKeyRing ( ) ) ; org.junit.Assert.assertEquals ( RefUpdate.Result.NEW , store.save ( newCommitBuilder ( ) ) ) ; assertKeys ( key1.getKeyId ( ) , key1 ) ; assertKeys ( key2.getKeyId ( ) , key2 ) ; }