auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static java.lang.String toLongString ( final com.google.gerrit.extensions.client.SubmitType type ) { if ( type == null ) { return "" ; } switch ( type ) { case FAST_FORWARD_ONLY : return com.google.gerrit.client.admin.Util.C.projectSubmitType_FAST_FORWARD_ONLY ( ) ; case MERGE_IF_NECESSARY : return com.google.gerrit.client.admin.Util.C.projectSubmitType_MERGE_IF_NECESSARY ( ) ; case REBASE_IF_NECESSARY : return com.google.gerrit.client.admin.Util.C.projectSubmitType_REBASE_IF_NECESSARY ( ) ; case REBASE_ALWAYS : return com.google.gerrit.client.admin.Util.C.projectSubmitType_REBASE_ALWAYS ( ) ; case MERGE_ALWAYS : return com.google.gerrit.client.admin.Util.C.projectSubmitType_MERGE_ALWAYS ( ) ; case CHERRY_PICK : return com.google.gerrit.client.admin.Util.C.projectSubmitType_CHERRY_PICK ( ) ; default : return type.name ( ) ; } }

Target:
public static java.lang.String toLongString ( final com.google.gerrit.extensions.client.SubmitType type ) { if ( type == null ) { return "" ; } switch ( type ) { case FAST_FORWARD_ONLY : return AdminConstants.I.projectSubmitType_FAST_FORWARD_ONLY ( ) ; case MERGE_IF_NECESSARY : return AdminConstants.I.projectSubmitType_MERGE_IF_NECESSARY ( ) ; case REBASE_IF_NECESSARY : return AdminConstants.I.projectSubmitType_REBASE_IF_NECESSARY ( ) ; case REBASE_ALWAYS : return AdminConstants.I.projectSubmitType_REBASE_ALWAYS ( ) ; case MERGE_ALWAYS : return AdminConstants.I.projectSubmitType_MERGE_ALWAYS ( ) ; case CHERRY_PICK : return AdminConstants.I.projectSubmitType_CHERRY_PICK ( ) ; default : return type.name ( ) ; } }
Source:
protected void bccWatchesNotifyAllComments ( ) { try { for ( final com.google.gerrit.reviewdb.client.AccountProjectWatch w : getWatches ( ) ) { if ( w.isNotify ( NotifyType.ALL_COMMENTS ) ) { add ( RecipientType.BCC , w.getAccountId ( ) ) ; } } } catch ( com.google.gwtorm.server.OrmException err ) { } }

Target:
protected void rcptToAuthors ( final com.google.gerrit.server.mail.RecipientType rt ) { for ( final com.google.gerrit.reviewdb.client.Account.Id id : authors ) { add ( rt , id ) ; } }
Source:
public org.parboiled.Rule typeOfNote ( ) { return firstOf ( sequence ( string ( "note" ) , push ( DivNode.Style.NOTE ) ) , sequence ( string ( "promo" ) , push ( DivNode.Style.PROMO ) ) , sequence ( string ( "aside" ) , push ( DivNode.Style.ASIDE ) ) ) ; }

Target:
public org.parboiled.Rule note ( ) { org.parboiled.support.StringBuilderVar body = new org.parboiled.support.StringBuilderVar ( ) ; return NodeSequence ( string ( "***" ) , Sp ( ) , typeOfNote ( ) , Newline ( ) , oneOrMore ( testNot ( string ( "***" ) , Newline ( ) ) , Line ( body ) ) , string ( "***" ) , Newline ( ) , push ( new com.google.gitiles.doc.DivNode ( popAsString ( ) , parse ( body ) ) ) ) ; }
Source:
public void testPattern ( ) { com.googlesource.gerrit.plugins.hooks.its.ItsConfig itsConfig = createItsConfig ( ) ; org.easymock.EasyMock.expect ( serverConfig.getString ( "commentLink" , "ItsTestName" , "match" ) ) . andReturn ( "TestPattern" ) . atLeastOnce ( ) ; replayMocks ( ) ; assertEquals ( "Expected and generated pattern are not equal" , "TestPattern" , itsConfig.getIssuePattern ( ) . pattern ( ) ) ; }

Target:
public void testItsAssociationPolicySuggested ( ) { com.googlesource.gerrit.plugins.hooks.its.ItsConfig itsConfig = createItsConfig ( ) ; org.easymock.EasyMock.expect ( serverConfig.getEnum ( "commentlink" , "ItsTestName" , "association" , ItsAssociationPolicy.OPTIONAL ) ) . andReturn ( ItsAssociationPolicy.SUGGESTED ) . atLeastOnce ( ) ; replayMocks ( ) ; assertEquals ( "Expected and generated associated policy do not match" , ItsAssociationPolicy.SUGGESTED , itsConfig.getItsAssociationPolicy ( ) ) ; }
Source:
private static com.google.gerrit.client.ui.Screen mine ( ) { if ( com.google.gerrit.client.Gerrit.isSignedIn ( ) ) { return new com.google.gerrit.client.changes.AccountDashboardScreen ( com.google.gerrit.client.Gerrit.getUserAccount ( ) . getId ( ) ) ; } com.google.gerrit.client.ui.Screen r = new com.google.gerrit.client.changes.AccountDashboardScreen ( null ) ; r.setRequiresSignIn ( true ) ; return r ; }

Target:
private static com.google.gerrit.client.ui.Screen mine ( ) { if ( com.google.gerrit.client.Gerrit.isSignedIn ( ) ) { return new com.google.gerrit.client.changes.AccountDashboardScreen ( com.google.gerrit.client.Gerrit.getUserAccount ( ) . _accountId ( ) ) ; } com.google.gerrit.client.ui.Screen r = new com.google.gerrit.client.changes.AccountDashboardScreen ( null ) ; r.setRequiresSignIn ( true ) ; return r ; }
Source:
protected void bccWatchesNotifyAllComments ( ) { try { for ( final com.google.gerrit.reviewdb.AccountProjectWatch w : getWatches ( ) ) { if ( w.isNotifyAllComments ( ) ) { add ( RecipientType.BCC , w.getAccountId ( ) ) ; } } } catch ( com.google.gwtorm.client.OrmException err ) { } }

Target:
protected void bccWatchesNotifyAllComments ( ) { try { for ( final com.google.gerrit.reviewdb.AccountProjectWatch w : getWatches ( ) ) { if ( w.isNotify ( NotifyType.ALL_COMMENTS ) ) { add ( RecipientType.BCC , w.getAccountId ( ) ) ; } } } catch ( com.google.gwtorm.client.OrmException err ) { } }
Source:
public void parseSubject ( ) throws java.lang.Exception { assertParseSucceeds ( ( "Update change\n" + ( ( ( "\n" + "Patch-Set: 1\n" ) + "Branch: refs/heads/master\n" ) + "Subject: Some subject of a change\n" ) ) ) ; assertParseFails ( ( "Update change\n" + ( ( ( "\n" + "Patch-Set: 1\n" ) + "Subject: Some subject of a change\n" ) + "Subject: Some other subject\n" ) ) ) ; }

Target:
public void parseSubject ( ) throws java.lang.Exception { assertParseSucceeds ( ( "Update change\n" + ( ( ( ( "\n" + "Patch-Set: 1\n" ) + "Branch: refs/heads/master\n" ) + "Change-id: I577fb248e474018276351785930358ec0450e9f7\n" ) + "Subject: Some subject of a change\n" ) ) ) ; assertParseFails ( ( "Update change\n" + ( ( ( "\n" + "Patch-Set: 1\n" ) + "Subject: Some subject of a change\n" ) + "Subject: Some other subject\n" ) ) ) ; }
Source:
private Change.Id createNewChange ( com.google.gerrit.server.git.BatchUpdate bu , com.google.gerrit.server.git.CodeReviewCommit cherryPickCommit , java.lang.String refName , java.lang.String topic , com.google.gerrit.reviewdb.client.Branch.NameKey sourceBranch ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.Change.Id changeId = new com.google.gerrit.reviewdb.client.Change.Id ( seq.nextChangeId ( ) ) ; com.google.gerrit.server.change.ChangeInserter ins = changeInserterFactory.create ( changeId , cherryPickCommit , refName ) . setValidatePolicy ( CommitValidators.Policy.GERRIT ) . setTopic ( topic ) ; ins.setMessage ( messageForDestinationChange ( ins.getPatchSetId ( ) , sourceBranch ) ) ; bu.insertChange ( ins ) ; return changeId ; }

Target:
private Change.Id createNewChange ( com.google.gerrit.server.update.BatchUpdate bu , com.google.gerrit.server.git.CodeReviewCommit cherryPickCommit , java.lang.String refName , java.lang.String topic , com.google.gerrit.reviewdb.client.Branch.NameKey sourceBranch ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.Change.Id changeId = new com.google.gerrit.reviewdb.client.Change.Id ( seq.nextChangeId ( ) ) ; com.google.gerrit.server.change.ChangeInserter ins = changeInserterFactory.create ( changeId , cherryPickCommit , refName ) . setValidatePolicy ( CommitValidators.Policy.GERRIT ) . setTopic ( topic ) ; ins.setMessage ( messageForDestinationChange ( ins.getPatchSetId ( ) , sourceBranch ) ) ; bu.insertChange ( ins ) ; return changeId ; }
Source:
java.lang.Runnable openCloseAll ( final net.codemirror.lib.CodeMirror cm ) { return new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { if ( cm.hasActiveLine ( ) ) { com.google.gerrit.client.diff.CommentGroup w = map ( cm.side ( ) ) . get ( ( ( cm.getLineNumber ( cm.getActiveLine ( ) ) ) + 1 ) ) ; if ( w != null ) { w.openCloseAll ( ) ; } } } } ; }

Target:
java.lang.Runnable toggleOpenBox ( final net.codemirror.lib.CodeMirror cm ) { return new java.lang.Runnable ( ) { public void run ( ) { if ( cm.hasActiveLine ( ) ) { com.google.gerrit.client.diff.CommentGroup w = map ( cm.side ( ) ) . get ( ( ( cm.getLineNumber ( cm.getActiveLine ( ) ) ) + 1 ) ) ; if ( w != null ) { w.openCloseLast ( ) ; } } } } ; }
Source:
public void onClick ( com.google.gwt.user.client.ui.Widget sender ) { Util.MANAGE_SVC.patchSetAction ( max.getId ( ) , patchSet.getId ( ) , new com.google.gerrit.client.rpc.GerritCallback < com.google.gwtjsonrpc.client.VoidResult > ( ) { public void onSuccess ( com.google.gwtjsonrpc.client.VoidResult result ) { actionsPanel.remove ( b ) ; } } ) ; }

Target:
public void onClick ( com.google.gwt.user.client.ui.Widget sender ) { b.setEnabled ( false ) ; Util.MANAGE_SVC.patchSetAction ( max.getId ( ) , patchSet.getId ( ) , new com.google.gerrit.client.rpc.GerritCallback < com.google.gwtjsonrpc.client.VoidResult > ( ) { public void onSuccess ( com.google.gwtjsonrpc.client.VoidResult result ) { actionsPanel.remove ( b ) ; fireOnSuggestRefresh ( ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { b.setEnabled ( true ) ; super . onFailure ( caught ) ; } } ) ; }
Source:
public java.util.Set < com.google.gerrit.reviewdb.AccountGroup.Id > groups ( final com.google.gerrit.server.account.AccountState who ) { final java.util.HashSet < com.google.gerrit.reviewdb.AccountGroup.Id > r = new java.util.HashSet < com.google.gerrit.reviewdb.AccountGroup.Id > ( ) ; r.addAll ( membershipCache.get ( com.google.gerrit.server.auth.ldap.LdapRealm.findId ( who.getExternalIds ( ) ) ) ) ; r.addAll ( who.getInternalGroups ( ) ) ; return r ; }

Target:
public java.util.Set < com.google.gerrit.reviewdb.AccountGroup.Id > groups ( final com.google.gerrit.server.account.AccountState who ) { final java.util.HashSet < com.google.gerrit.reviewdb.AccountGroup.Id > r = new java.util.HashSet < com.google.gerrit.reviewdb.AccountGroup.Id > ( ) ; r.addAll ( com.google.gerrit.server.util.FutureUtil.get ( membershipCache.get ( com.google.gerrit.server.auth.ldap.LdapRealm.findId ( who.getExternalIds ( ) ) ) ) ) ; r.addAll ( who.getInternalGroups ( ) ) ; return r ; }
Source:
public com.google.gerrit.server.notedb.ChangeNotes create ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Change change ) { return new com.google.gerrit.server.notedb.ChangeNotes ( db , repoManager , migration , allUsersProvider , change ) ; }

Target:
public com.google.gerrit.server.notedb.ChangeNotes create ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Project.NameKey project , com.google.gerrit.reviewdb.client.Change.Id changeId ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.Change change = db.changes ( ) . get ( changeId ) ; return new com.google.gerrit.server.notedb.ChangeNotes ( repoManager , migration , allUsersProvider , project , change ) . load ( ) ; }
Source:
public void assertCanDelete ( com.google.gerrit.reviewdb.client.Project project ) throws java.lang.Exception { if ( db.submoduleSubscriptions ( ) . bySuperProjectProject ( project.getNameKey ( ) ) . iterator ( ) . hasNext ( ) ) { throw new java.lang.Exception ( "Project has subscribed submodules." ) ; } }

Target:
public void assertCanDelete ( com.google.gerrit.reviewdb.client.Project project ) throws java.lang.Exception { if ( db.submoduleSubscriptions ( ) . bySuperProjectProject ( project.getNameKey ( ) ) . iterator ( ) . hasNext ( ) ) { throw new java.lang.Exception ( "Project has subscribed submodules." ) ; } if ( db.submoduleSubscriptions ( ) . bySubmoduleProject ( project.getNameKey ( ) ) . iterator ( ) . hasNext ( ) ) { throw new java.lang.Exception ( "Project is subscribed by other projects." ) ; } }
Source:
private com.google.inject.Injector createSshInjector ( ) { final java.util.List < com.google.inject.Module > modules = new java.util.ArrayList < com.google.inject.Module > ( ) ; if ( sshd ) { modules.add ( new com.google.gerrit.sshd.SshModule ( ) ) ; if ( slave ) { modules.add ( new com.google.gerrit.sshd.commands.SlaveCommandModule ( ) ) ; } else { modules.add ( new com.google.gerrit.sshd.commands.MasterCommandModule ( ) ) ; } } else { modules.add ( new com.google.gerrit.server.ssh.NoSshModule ( ) ) ; } return sysInjector.createChildInjector ( modules ) ; }

Target:
private com.google.inject.Injector createSshInjector ( ) { final java.util.List < com.google.inject.Module > modules = new java.util.ArrayList < com.google.inject.Module > ( ) ; if ( sshd ) { modules.add ( sysInjector.getInstance ( com.google.gerrit.sshd.SshModule.class ) ) ; if ( slave ) { modules.add ( new com.google.gerrit.sshd.commands.SlaveCommandModule ( ) ) ; } else { modules.add ( new com.google.gerrit.sshd.commands.MasterCommandModule ( ) ) ; } } else { modules.add ( new com.google.gerrit.server.ssh.NoSshModule ( ) ) ; } return sysInjector.createChildInjector ( modules ) ; }
Source:
java.util.Map < java.lang.String , com.google.gerrit.extensions.common.FileInfo > toFileInfoMap ( com.google.gerrit.reviewdb.client.Change change , org.eclipse.jgit.lib.ObjectId objectId , @ com.google.gerrit.common.Nullable com.google.gerrit.reviewdb.client.PatchSet base ) throws com.google.gerrit.server.patch.PatchListNotAvailableException { org.eclipse.jgit.lib.ObjectId a = ( base == null ) ? null : org.eclipse.jgit.lib.ObjectId.fromString ( base.getRevision ( ) . get ( ) ) ; return toFileInfoMap ( change , new com.google.gerrit.server.patch.PatchListKey ( a , objectId , com.google.gerrit.extensions.client.DiffPreferencesInfo.Whitespace.IGNORE_NONE ) ) ; }

Target:
java.util.Map < java.lang.String , com.google.gerrit.extensions.common.FileInfo > toFileInfoMap ( com.google.gerrit.reviewdb.client.Change change , org.eclipse.jgit.lib.ObjectId objectId , @ com.google.gerrit.common.Nullable com.google.gerrit.reviewdb.client.PatchSet base ) throws com.google.gerrit.server.patch.PatchListNotAvailableException { org.eclipse.jgit.lib.ObjectId a = ( base == null ) ? null : org.eclipse.jgit.lib.ObjectId.fromString ( base.getRevision ( ) . get ( ) ) ; return toFileInfoMap ( change , com.google.gerrit.server.patch.PatchListKey.againstCommit ( a , objectId , Whitespace.IGNORE_NONE ) ) ; }
Source:
private static synchronized javax.sql.DataSource newDataSource ( ) throws java.sql.SQLException { final java.util.Properties p = new java.util.Properties ( ) ; p.setProperty ( "driver" , org.h2.Driver.class . getName ( ) ) ; p.setProperty ( "url" , ( ( "jdbc:h2:mem:" + "Test_" ) + ( ++ ( com.google.gerrit.testutil.InMemoryDatabase.dbCnt ) ) ) ) ; return new com.google.gwtorm.jdbc.SimpleDataSource ( p ) ; }

Target:
private static synchronized javax.sql.DataSource newDataSource ( ) throws java.sql.SQLException { final java.util.Properties p = new java.util.Properties ( ) ; p.setProperty ( "driver" , org.h2.Driver.class . getName ( ) ) ; p.setProperty ( "url" , ( "jdbc:h2:mem:Test_" + ( ++ ( com.google.gerrit.testutil.InMemoryDatabase.dbCnt ) ) ) ) ; return new com.google.gwtorm.jdbc.SimpleDataSource ( p ) ; }
Source:
void addPatchSetId ( java.lang.String token ) { try { patchSets.add ( parsePatchSet ( token ) ) ; } catch ( com.googlesource.gerrit.plugins.wip.UnloggedFailure e ) { throw new java.lang.IllegalArgumentException ( e.getMessage ( ) , e ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new java.lang.IllegalArgumentException ( "database error" , e ) ; } }

Target:
void addPatchSetId ( java.lang.String token ) { try { com.google.gerrit.reviewdb.client.PatchSet ps = psParser.parsePatchSet ( token , projectControl , branch ) ; patchSets.add ( ps ) ; } catch ( com.googlesource.gerrit.plugins.wip.UnloggedFailure e ) { throw new java.lang.IllegalArgumentException ( e.getMessage ( ) , e ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new java.lang.IllegalArgumentException ( "database error" , e ) ; } }
Source:
protected void configureServlets ( ) { filter ( "/*" ) . through ( createPathFilter ( ) ) ; filter ( "/*" ) . through ( new com.googlesource.gerrit.plugins.gitiles.LoginFilter ( userProvider , urls ) ) ; serveRegex ( "^(/)$" , "^(/[^+].*)" ) . with ( com.google.gitiles.GitilesServlet.class ) ; }

Target:
protected void configureServlets ( ) { filter ( "/*" ) . through ( createPathFilter ( ) ) ; filter ( "/*" ) . through ( new com.googlesource.gerrit.plugins.gitiles.LoginFilter ( userProvider , urls ) ) ; filterRegex ( "^(/)$" , "^(/[^+].*)" ) . through ( com.googlesource.gerrit.plugins.gitiles.SetContextClassLoader.class ) ; serveRegex ( "^(/)$" , "^(/[^+].*)" ) . with ( com.google.gitiles.GitilesServlet.class ) ; }
Source:
public com.googlecode.prolog_cafe.lang.Operation exec ( com.googlecode.prolog_cafe.lang.Prolog engine ) throws com.googlecode.prolog_cafe.lang.PrologException { engine.setB0 ( ) ; com.googlecode.prolog_cafe.lang.Term a1 = arg1.dereference ( ) ; com.google.gerrit.reviewdb.client.Change change = StoredValues.CHANGE.get ( engine ) ; com.google.gerrit.reviewdb.client.Branch.NameKey name = change.getDest ( ) ; if ( ! ( a1.unify ( com.googlecode.prolog_cafe.lang.SymbolTerm.create ( name.get ( ) ) , engine.trail ) ) ) { return engine.fail ( ) ; } return cont ; }

Target:
public com.googlecode.prolog_cafe.lang.Operation exec ( com.googlecode.prolog_cafe.lang.Prolog engine ) throws com.googlecode.prolog_cafe.lang.PrologException { engine.setB0 ( ) ; com.googlecode.prolog_cafe.lang.Term a1 = arg1.dereference ( ) ; com.google.gerrit.reviewdb.client.Change change = StoredValues.CHANGE_DATA.get ( engine ) . getChange ( ) ; com.google.gerrit.reviewdb.client.Branch.NameKey name = change.getDest ( ) ; if ( ! ( a1.unify ( com.googlecode.prolog_cafe.lang.SymbolTerm.create ( name.get ( ) ) , engine.trail ) ) ) { return engine.fail ( ) ; } return cont ; }
Source:
private static boolean isCrNl ( java.lang.String s , int n ) { return ( ( ( s.charAt ( n ) ) == '\r' ) && ( n != ( ( s.length ( ) ) - 1 ) ) ) && ( ( s.charAt ( ( n + 1 ) ) ) == '\n' ) ; }

Target:
private static int nextLineBreak ( java.lang.String s , int start , int end ) { int n = s.indexOf ( '\n' , start ) ; return n < end ? n : - 1 ; }
Source:
public void noExternalIds ( ) throws java.lang.Exception { com.google.gerrit.server.account.ExternalIdsUpdate externalIdsUpdate = externalIdsUpdateFactory.create ( ) ; externalIdsUpdate.deleteAll ( db , user.getAccountId ( ) ) ; reloadUser ( ) ; com.google.gerrit.gpg.testutil.TestKey key = com.google.gerrit.gpg.testutil.TestKeys.validKeyWithSecondUserId ( ) ; com.google.gerrit.gpg.PublicKeyChecker checker = checkerFactory.create ( user , store ) . disableTrust ( ) ; assertProblems ( checker.check ( key.getPublicKey ( ) ) , Status.BAD , "No identities found for user; check http://test/#/settings/web-identities" ) ; checker = checkerFactory.create ( ) . setStore ( store ) . disableTrust ( ) ; assertProblems ( checker.check ( key.getPublicKey ( ) ) , Status.BAD , "Key is not associated with any users" ) ; externalIdsUpdate.insert ( db , com.google.gerrit.server.account.ExternalId.create ( com.google.gerrit.gpg.GerritPublicKeyChecker.toExtIdKey ( key.getPublicKey ( ) ) , user.getAccountId ( ) ) ) ; reloadUser ( ) ; assertProblems ( checker.check ( key.getPublicKey ( ) ) , Status.BAD , "No identities found for user" ) ; }

Target:
public void noExternalIds ( ) throws java.lang.Exception { com.google.gerrit.server.account.externalids.ExternalIdsUpdate externalIdsUpdate = externalIdsUpdateFactory.create ( ) ; externalIdsUpdate.deleteAll ( db , user.getAccountId ( ) ) ; reloadUser ( ) ; com.google.gerrit.gpg.testutil.TestKey key = com.google.gerrit.gpg.testutil.TestKeys.validKeyWithSecondUserId ( ) ; com.google.gerrit.gpg.PublicKeyChecker checker = checkerFactory.create ( user , store ) . disableTrust ( ) ; assertProblems ( checker.check ( key.getPublicKey ( ) ) , Status.BAD , "No identities found for user; check http://test/#/settings/web-identities" ) ; checker = checkerFactory.create ( ) . setStore ( store ) . disableTrust ( ) ; assertProblems ( checker.check ( key.getPublicKey ( ) ) , Status.BAD , "Key is not associated with any users" ) ; externalIdsUpdate.insert ( db , com.google.gerrit.server.account.externalids.ExternalId.create ( com.google.gerrit.gpg.GerritPublicKeyChecker.toExtIdKey ( key.getPublicKey ( ) ) , user.getAccountId ( ) ) ) ; reloadUser ( ) ; assertProblems ( checker.check ( key.getPublicKey ( ) ) , Status.BAD , "No identities found for user" ) ; }
Source:
private boolean isTrusted ( final com.google.gerrit.client.reviewdb.AccountExternalId id ) { if ( id.getExternalId ( ) . startsWith ( "Google Account " ) ) { return isAllowGoogleAccountUpgrade ( ) ; } if ( id.getExternalId ( ) . startsWith ( "mailto:" ) ) { return true ; } for ( final java.lang.String p : trusted ) { if ( matches ( p , id ) ) { return true ; } } return false ; }

Target:
private boolean isTrusted ( final com.google.gerrit.client.reviewdb.AccountExternalId id ) { if ( id.isScheme ( AccountExternalId.LEGACY_GAE ) ) { return isAllowGoogleAccountUpgrade ( ) ; } if ( id.isScheme ( AccountExternalId.SCHEME_MAILTO ) ) { return true ; } for ( final java.lang.String p : trusted ) { if ( matches ( p , id ) ) { return true ; } } return false ; }
Source:
private java.util.List < com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.Scope > parseScopesString ( java.lang.String scopesString ) { java.util.ArrayList < com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.Scope > scopes = new java.util.ArrayList < com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.Scope > ( ) ; if ( ( com.google.common.base.Strings.emptyToNull ( scopesString ) ) != null ) { java.lang.String [ ] scopesStrings = scopesString.split ( "," ) ; for ( java.lang.String scope : scopesStrings ) { scopes.add ( java.lang.Enum.valueOf ( com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.Scope.class , scope ) ) ; } } return scopes ; }

Target:
private java.util.List < com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.Scope > parseScopesString ( java.lang.String scopesString ) { java.util.ArrayList < com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.Scope > scopes = new java.util.ArrayList < com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.Scope > ( ) ; if ( ( com.google.common.base.Strings.emptyToNull ( scopesString ) ) != null ) { java.lang.String [ ] scopesStrings = scopesString.split ( "," ) ; for ( java.lang.String scope : scopesStrings ) { scopes.add ( java.lang.Enum.valueOf ( com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.Scope.class , scope.trim ( ) ) ) ; } } return scopes ; }
Source:
public boolean areDraftsUpToDate ( org.eclipse.jgit.lib.Repository draftsRepo , com.google.gerrit.reviewdb.client.Account.Id accountId ) throws java.io.IOException { org.eclipse.jgit.lib.Ref ref = draftsRepo.exactRef ( com.google.gerrit.reviewdb.client.RefNames.refsDraftComments ( changeId , accountId ) ) ; if ( ref == null ) { return ! ( draftIds.containsKey ( accountId ) ) ; } return ref.getObjectId ( ) . equals ( draftIds.get ( accountId ) ) ; }

Target:
public boolean areDraftsUpToDate ( com.google.gerrit.server.git.RefCache draftsRepoRefs , com.google.gerrit.reviewdb.client.Account.Id accountId ) throws java.io.IOException { com.google.common.base.Optional < org.eclipse.jgit.lib.ObjectId > id = draftsRepoRefs.get ( com.google.gerrit.reviewdb.client.RefNames.refsDraftComments ( changeId , accountId ) ) ; if ( ! ( id.isPresent ( ) ) ) { return ! ( draftIds.containsKey ( accountId ) ) ; } return id.get ( ) . equals ( draftIds.get ( accountId ) ) ; }
Source:
private com.google.gerrit.common.data.ChangeInfo newChangeInfo ( final com.google.gerrit.reviewdb.Change ac ) { aic.want ( ac.getOwner ( ) ) ; com.google.gerrit.common.data.ChangeInfo ci = new com.google.gerrit.common.data.ChangeInfo ( ac ) ; ci.setStarred ( isStarred ( ac ) ) ; return ci ; }

Target:
private com.google.gerrit.common.data.ChangeInfo newChangeInfo ( final com.google.gerrit.reviewdb.Change ac , java.util.Map < com.google.gerrit.reviewdb.Change.Id , com.google.gerrit.reviewdb.PatchSet.Id > ancestorPatchIds ) { aic.want ( ac.getOwner ( ) ) ; com.google.gerrit.common.data.ChangeInfo ci ; if ( ancestorPatchIds == null ) { ci = new com.google.gerrit.common.data.ChangeInfo ( ac ) ; } else { ci = new com.google.gerrit.common.data.ChangeInfo ( ac , ancestorPatchIds.get ( ac.getId ( ) ) ) ; } ci.setStarred ( isStarred ( ac ) ) ; return ci ; }
Source:
private com.google.gerrit.httpd.resources.Resource getMarkdownAsHtmlResource ( com.googlesource.gerrit.plugins.xdocs.XDocGlobalConfig cfg , com.google.gerrit.reviewdb.client.Project.NameKey project , java.lang.String md , int lastModified ) throws java.io.IOException { com.google.gerrit.server.documentation.MarkdownFormatter f = new com.google.gerrit.server.documentation.MarkdownFormatter ( ) ; if ( ! ( cfg.isHtmlAllowed ( Formatter.MARKDOWN ) ) ) { f.suppressHtml ( ) ; } byte [ ] html = f.markdownToDocHtml ( replaceMacros ( project , md ) , java.nio.charset.StandardCharsets.UTF_8.name ( ) ) ; return new com.google.gerrit.httpd.resources.SmallResource ( html ) . setContentType ( "text/html" ) . setCharacterEncoding ( java.nio.charset.StandardCharsets.UTF_8.name ( ) ) . setLastModified ( lastModified ) ; }

Target:
private com.google.gerrit.httpd.resources.Resource getAsHtmlResource ( byte [ ] html , int lastModified ) { return new com.google.gerrit.httpd.resources.SmallResource ( html ) . setContentType ( "text/html" ) . setCharacterEncoding ( java.nio.charset.StandardCharsets.UTF_8.name ( ) ) . setLastModified ( lastModified ) ; }
Source:
private void initVerifiedCategory ( com.google.gerrit.server.git.ProjectConfig c ) { com.google.gerrit.common.data.LabelType type = new com.google.gerrit.common.data.LabelType ( "Verified" , com.google.common.collect.ImmutableList.of ( new com.google.gerrit.common.data.LabelValue ( ( ( short ) ( 1 ) ) , "Verified" ) , new com.google.gerrit.common.data.LabelValue ( ( ( short ) ( 0 ) ) , "No score" ) , new com.google.gerrit.common.data.LabelValue ( ( ( short ) ( - 1 ) ) , "Fails" ) ) ) ; c.getLabelSections ( ) . put ( type.getName ( ) , type ) ; }

Target:
public static void initVerifiedLabel ( com.google.gerrit.server.git.ProjectConfig c ) { com.google.gerrit.common.data.LabelType type = new com.google.gerrit.common.data.LabelType ( "Verified" , com.google.common.collect.ImmutableList.of ( new com.google.gerrit.common.data.LabelValue ( ( ( short ) ( 1 ) ) , "Verified" ) , new com.google.gerrit.common.data.LabelValue ( ( ( short ) ( 0 ) ) , "No score" ) , new com.google.gerrit.common.data.LabelValue ( ( ( short ) ( - 1 ) ) , "Fails" ) ) ) ; c.getLabelSections ( ) . put ( type.getName ( ) , type ) ; }
Source:
private int transitions ( java.lang.String pattern ) { if ( com.google.gerrit.server.project.RefControl.isRE ( pattern ) ) { return com.google.gerrit.server.project.RefControl.toRegExp ( pattern ) . toAutomaton ( ) . getNumberOfTransitions ( ) ; } else if ( pattern.endsWith ( "/*" ) ) { return pattern.length ( ) ; } else { return pattern.length ( ) ; } }

Target:
private int transitions ( java.lang.String pattern ) { if ( com.google.gerrit.server.project.RefPattern.isRE ( pattern ) ) { return com.google.gerrit.server.project.RefPattern.toRegExp ( pattern ) . toAutomaton ( ) . getNumberOfTransitions ( ) ; } else if ( pattern.endsWith ( "/*" ) ) { return pattern.length ( ) ; } else { return pattern.length ( ) ; } }
Source:
public void changeProjectAccess ( com.google.gerrit.reviewdb.client.Project.NameKey projectName , java.lang.String baseRevision , java.lang.String msg , java.util.List < com.google.gerrit.common.data.AccessSection > sections , com.google.gwtjsonrpc.common.AsyncCallback < com.google.gerrit.common.data.ProjectAccess > cb ) { org.eclipse.jgit.lib.ObjectId base ; if ( ( baseRevision != null ) && ( ! ( baseRevision.isEmpty ( ) ) ) ) { base = org.eclipse.jgit.lib.ObjectId.fromString ( baseRevision ) ; } else { base = null ; } changeProjectAccessFactory.create ( projectName , base , sections , msg ) . to ( cb ) ; }

Target:
public void changeProjectAccess ( com.google.gerrit.reviewdb.client.Project.NameKey projectName , java.lang.String baseRevision , java.lang.String msg , java.util.List < com.google.gerrit.common.data.AccessSection > sections , com.google.gwtjsonrpc.common.AsyncCallback < com.google.gerrit.common.data.ProjectAccess > cb ) { changeProjectAccessFactory.create ( projectName , com.google.gerrit.httpd.rpc.project.ProjectAdminServiceImpl.getBase ( baseRevision ) , sections , msg ) . to ( cb ) ; }
Source:
private java.lang.String getToken ( final javax.servlet.http.HttpServletRequest req ) { java.lang.String token = req.getPathInfo ( ) ; if ( ( token == null ) || ( token.isEmpty ( ) ) ) { token = com.google.gerrit.common.PageLinks.MINE ; } return token ; }

Target:
private java.lang.String getToken ( final javax.servlet.http.HttpServletRequest req ) { java.lang.String token = req.getPathInfo ( ) ; if ( ( token == null ) || ( token.isEmpty ( ) ) ) { token = com.google.gerrit.common.PageLinks.MINE ; } else if ( ! ( token.startsWith ( "/" ) ) ) { token = "/" + token ; } return token ; }
Source:
public static java.lang.String lineToHTML ( final java.lang.String src ) { java.lang.String html = com.google.gerrit.client.ui.DomUtil.escape ( src ) ; html = com.google.gerrit.client.patches.PatchUtil.expandTabs ( html ) ; return html ; }

Target:
public static java.lang.String lineToHTML ( final java.lang.String src , final int lineLength ) { final boolean hasTab = ( src.indexOf ( '\t' ) ) >= 0 ; java.lang.String brokenSrc = com.google.gerrit.client.patches.PatchUtil.wrapLines ( src , hasTab , lineLength ) ; java.lang.String html = com.google.gerrit.client.ui.DomUtil.escape ( brokenSrc ) ; if ( brokenSrc != src ) { html = com.google.gerrit.client.patches.PatchUtil.expandLFs ( html ) ; } if ( hasTab ) { html = com.google.gerrit.client.patches.PatchUtil.expandTabs ( html ) ; } return html ; }
Source:
public boolean isOwner ( ) { com.google.gerrit.reviewdb.client.AccountGroup accountGroup = com.google.gerrit.common.data.GroupDescriptions.toAccountGroup ( group ) ; if ( accountGroup == null ) { isOwner = false ; } else if ( ( isOwner ) == null ) { com.google.gerrit.reviewdb.client.AccountGroup.UUID ownerUUID = accountGroup.getOwnerGroupUUID ( ) ; isOwner = ( getUser ( ) . getEffectiveGroups ( ) . contains ( ownerUUID ) ) || ( canAdministrateServer ( ) ) ; } return isOwner ; }

Target:
public boolean isOwner ( ) { if ( ( isOwner ) != null ) { return isOwner ; } if ( ( group ) instanceof com.google.gerrit.common.data.GroupDescription.Internal ) { com.google.gerrit.reviewdb.client.AccountGroup.UUID ownerUUID = ( ( com.google.gerrit.common.data.GroupDescription.Internal ) ( group ) ) . getOwnerGroupUUID ( ) ; isOwner = ( getUser ( ) . getEffectiveGroups ( ) . contains ( ownerUUID ) ) || ( canAdministrateServer ( ) ) ; } else { isOwner = false ; } return isOwner ; }
Source:
public static synchronized void setClockStep ( long clockStep , java.util.concurrent.TimeUnit clockStepUnit ) { com.google.common.base.Preconditions.checkState ( ( ( com.google.gerrit.testutil.TestTimeUtil.clockMs ) != null ) , "call resetWithClockStep first" ) ; com.google.gerrit.testutil.TestTimeUtil.clockStepMs = java.util.concurrent.TimeUnit.MILLISECONDS.convert ( clockStep , clockStepUnit ) ; HEAD ( ( 6899000.0 - 2.14 ) ) ; org.joda.time.DateTimeUtils.setCurrentMillisProvider ( new org.joda.time.DateTimeUtils.MillisProvider ( ) { @ java.lang.Override public long getMillis ( ) { return com.google.gerrit.testutil.TestTimeUtil.clockMs.getAndAdd ( com.google.gerrit.testutil.TestTimeUtil.clockStepMs ) ; } } ) ; }

Target:
public long getCurrentTime ( ) { return com.google.gerrit.testutil.TestTimeUtil.clockMs.getAndAdd ( com.google.gerrit.testutil.TestTimeUtil.clockStepMs ) ; }
Source:
public static com.google.gerrit.server.patch.DiffSummaryKey fromPatchListKey ( com.google.gerrit.server.patch.PatchListKey plk ) { com.google.common.base.Preconditions.checkArgument ( ( ( plk.getAlgorithm ( ) ) == ( PatchListKey.Algorithm.OPTIMIZED_DIFF ) ) ) ; return new com.google.gerrit.server.patch.DiffSummaryKey ( plk.getOldId ( ) , plk.getParentNum ( ) , plk.getNewId ( ) , plk.getWhitespace ( ) ) ; }

Target:
public static com.google.gerrit.server.diff.DiffSummaryKey fromPatchListKey ( com.google.gerrit.server.diff.PatchListKey plk ) { com.google.common.base.Preconditions.checkArgument ( ( ( plk.getAlgorithm ( ) ) == ( PatchListKey.Algorithm.OPTIMIZED_DIFF ) ) ) ; return new com.google.gerrit.server.diff.DiffSummaryKey ( plk.getOldId ( ) , plk.getParentNum ( ) , plk.getNewId ( ) , plk.getWhitespace ( ) ) ; }
Source:
private void setUp ( ) { try { getEventsDb ( ) . createDBIfNotCreated ( ) ; } catch ( java.sql.SQLException e ) { com.ericsson.gerrit.plugins.eventslog.sql.SQLStore.log.warn ( ( "Cannot start the database. Events will be stored locally " + "until database connection can be established" ) , e ) ; setOnline ( false ) ; } if ( online ) { restoreEventsFromLocal ( ) ; } getEventsDb ( ) . removeOldEvents ( maxAge ) ; }

Target:
private void setUp ( ) { try { getEventsDb ( ) . createDBIfNotCreated ( ) ; } catch ( java.sql.SQLException e ) { com.ericsson.gerrit.plugins.eventslog.sql.SQLStore.log.warn ( ( "Cannot start the database. Events will be stored locally" + " until database connection can be established" ) , e ) ; setOnline ( false ) ; } if ( online ) { restoreEventsFromLocal ( ) ; } getEventsDb ( ) . removeOldEvents ( maxAge ) ; }
Source:
public java.util.Collection < com.google.gerrit.reviewdb.client.PatchLineComment > publishedComments ( ) throws com.google.gwtorm.server.OrmException { if ( ( publishedComments ) == null ) { publishedComments = plcUtil.publishedByChange ( db , notes ( ) ) ; } return publishedComments ; }

Target:
public java.util.Collection < com.google.gerrit.reviewdb.client.PatchLineComment > publishedComments ( ) throws com.google.gwtorm.server.OrmException { if ( ( publishedComments ) == null ) { if ( ! ( lazyLoad ) ) { return java.util.Collections.emptyList ( ) ; } publishedComments = plcUtil.publishedByChange ( db , notes ( ) ) ; } return publishedComments ; }
Source:
public void changeSshUserName ( final java.lang.String newName , final com.google.gwt.user.client.rpc.AsyncCallback < com.google.gwtjsonrpc.client.VoidResult > callback ) { if ( realm.allowsEdit ( Account.FieldName.USER_NAME ) ) { com.google.gerrit.httpd.rpc.Handler.wrap ( changeUserNameFactory.create ( newName ) ) . to ( callback ) ; } else { callback.onFailure ( new com.google.gerrit.common.errors.NameAlreadyUsedException ( ) ) ; } }

Target:
public void changeUserName ( final java.lang.String newName , final com.google.gwt.user.client.rpc.AsyncCallback < com.google.gwtjsonrpc.client.VoidResult > callback ) { if ( realm.allowsEdit ( Account.FieldName.USER_NAME ) ) { com.google.gerrit.httpd.rpc.Handler.wrap ( changeUserNameFactory.create ( newName ) ) . to ( callback ) ; } else { callback.onFailure ( new com.google.gerrit.common.errors.NameAlreadyUsedException ( ) ) ; } }
Source:
public boolean login ( javax.servlet.http.HttpServletRequest request , javax.servlet.http.HttpServletResponse response ) throws java.io.IOException { if ( oauth.isOAuthFinal ( request ) ) { init ( oauth.loginPhase2 ( request , response ) ) ; return isLoggedIn ( ) ; } else { oauth.loginPhase1 ( request , response ) ; return false ; } }

Target:
public boolean login ( javax.servlet.http.HttpServletRequest request , javax.servlet.http.HttpServletResponse response ) throws java.io.IOException { if ( oauth.isOAuthFinal ( request ) ) { init ( oauth.loginPhase2 ( request , response ) ) ; if ( isLoggedIn ( ) ) { response.sendRedirect ( redirectUrl ) ; return true ; } else { return false ; } } else { redirectUrl = request.getRequestURL ( ) . toString ( ) ; oauth.loginPhase1 ( request , response ) ; return false ; } }
Source:
public void onValueChange ( final com.google.gwt.event.logical.shared.ValueChangeEvent < java.lang.String > event ) { final java.lang.String token = event.getValue ( ) ; try { com.google.gerrit.client.HistoryHandler.select ( token ) ; } catch ( java.lang.RuntimeException err ) { com.google.gwt.core.client.GWT.log ( ( "Error parsing history token: " + token ) , err ) ; com.google.gerrit.client.Gerrit.display ( new com.google.gerrit.client.NotFoundScreen ( ) ) ; } }

Target:
void display ( final java.lang.String token ) { assert token != null ; try { com.google.gerrit.client.Dispatcher.select ( token ) ; } catch ( java.lang.RuntimeException err ) { com.google.gwt.core.client.GWT.log ( ( "Error parsing history token: " + token ) , err ) ; com.google.gerrit.client.Gerrit.display ( token , new com.google.gerrit.client.NotFoundScreen ( ) ) ; } }
Source:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { for ( com.google.gerrit.reviewdb.Patch p : detail.getPatches ( ) ) { com.google.gwt.user.client.Window.open ( ( ( ( Window.Location.getPath ( ) ) + "#" ) + ( com.google.gerrit.client.Dispatcher.toPatchSideBySide ( p.getKey ( ) ) ) ) , "_blank" , null ) ; } }

Target:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { for ( com.google.gerrit.reviewdb.client.Patch p : detail.getPatches ( ) ) { openWindow ( com.google.gerrit.client.Dispatcher.toPatchSideBySide ( diffBaseId , p.getKey ( ) ) ) ; } }
Source:
public static PatchSet.Id nextPatchSetId ( org.eclipse.jgit.lib.Repository git , com.google.gerrit.reviewdb.client.PatchSet.Id id ) throws java.io.IOException { return com.google.gerrit.server.ChangeUtil.nextPatchSetId ( git.getRefDatabase ( ) . getRefs ( RefDatabase.ALL ) , id ) ; }

Target:
public static PatchSet.Id nextPatchSetId ( org.eclipse.jgit.lib.Repository git , com.google.gerrit.reviewdb.client.PatchSet.Id id ) throws java.io.IOException { return com.google.gerrit.server.ChangeUtil.nextPatchSetIdFromChangeRefsMap ( com.google.common.collect.Maps.transformValues ( git.getRefDatabase ( ) . getRefs ( id.getParentKey ( ) . toRefPrefix ( ) ) , Ref :: getObjectId ) , id ) ; }
Source:
public void testAsText ( ) throws java.lang.Exception { java.lang.String text = ( ( com.google.gerrit.server.git.DestinationListTest.HEADER_PROPER ) + "#\n" ) + ( com.google.gerrit.server.git.DestinationListTest.F_PROPER ) ; com.google.gerrit.server.git.DestinationList dl = new com.google.gerrit.server.git.DestinationList ( ) ; dl.parseLabel ( com.google.gerrit.server.git.DestinationListTest.LABEL , com.google.gerrit.server.git.DestinationListTest.F_SIMPLE , null ) ; java.lang.String asText = dl.asText ( com.google.gerrit.server.git.DestinationListTest.LABEL ) ; com.google.common.truth.Truth.assertThat ( text ) . isEqualTo ( asText ) ; dl.parseLabel ( com.google.gerrit.server.git.DestinationListTest.LABEL2 , asText , null ) ; com.google.common.truth.Truth.assertThat ( text ) . isEqualTo ( dl.asText ( com.google.gerrit.server.git.DestinationListTest.LABEL2 ) ) ; }

Target:
public void testAsText ( ) throws java.lang.Exception { java.lang.String text = ( ( com.google.gerrit.server.account.DestinationListTest.HEADER_PROPER ) + "#\n" ) + ( com.google.gerrit.server.account.DestinationListTest.F_PROPER ) ; com.google.gerrit.server.account.DestinationList dl = new com.google.gerrit.server.account.DestinationList ( ) ; dl.parseLabel ( com.google.gerrit.server.account.DestinationListTest.LABEL , com.google.gerrit.server.account.DestinationListTest.F_SIMPLE , null ) ; java.lang.String asText = dl.asText ( com.google.gerrit.server.account.DestinationListTest.LABEL ) ; com.google.common.truth.Truth.assertThat ( text ) . isEqualTo ( asText ) ; dl.parseLabel ( com.google.gerrit.server.account.DestinationListTest.LABEL2 , asText , null ) ; com.google.common.truth.Truth.assertThat ( text ) . isEqualTo ( dl.asText ( com.google.gerrit.server.account.DestinationListTest.LABEL2 ) ) ; }
Source:
public void delete ( com.google.gerrit.server.query.change.ChangeData cd ) throws java.io.IOException { org.apache.lucene.index.Term id = idTerm ( cd ) ; if ( cd.getChange ( ) . getStatus ( ) . isOpen ( ) ) { openIndex.delete ( id ) ; } else { closedIndex.delete ( id ) ; } }

Target:
public com.google.common.util.concurrent.ListenableFuture < java.lang.Void > delete ( com.google.gerrit.server.query.change.ChangeData cd ) throws java.io.IOException { org.apache.lucene.index.Term id = idTerm ( cd ) ; if ( readOnly ) { return com.google.common.util.concurrent.Futures.immediateFuture ( null ) ; } return com.google.gerrit.lucene.LuceneChangeIndex.allOf ( openIndex.delete ( id ) , closedIndex.delete ( id ) ) ; }
Source:
public static java.nio.file.Path mkdirsOrDie ( java.nio.file.Path p , java.lang.String errMsg ) { try { java.nio.file.Files.createDirectories ( p ) ; return p ; } catch ( java.io.IOException e ) { throw new com.google.gerrit.common.Die ( ( ( errMsg + ": " ) + p ) , e ) ; } }

Target:
public static java.nio.file.Path mkdirsOrDie ( java.nio.file.Path p , java.lang.String errMsg ) { try { if ( ! ( java.nio.file.Files.isDirectory ( p ) ) ) { java.nio.file.Files.createDirectories ( p ) ; } return p ; } catch ( java.io.IOException e ) { throw new com.google.gerrit.common.Die ( ( ( errMsg + ": " ) + p ) , e ) ; } }
Source:
private void insertNoneRow ( final int row ) { insertRow ( row ) ; table.setText ( row , 0 , Util.C.changeTableNone ( ) ) ; final com.google.gwt.user.client.ui.FlexTable.FlexCellFormatter fmt = table.getFlexCellFormatter ( ) ; fmt.setColSpan ( row , 0 , columns ) ; fmt.setStyleName ( row , 0 , com.google.gerrit.client.changes.ChangeTable.S_EMPTY_SECTION ) ; }

Target:
private void insertNoneRow ( final int row ) { insertRow ( row ) ; table.setText ( row , 0 , Util.C.changeTableNone ( ) ) ; final com.google.gwt.user.client.ui.FlexTable.FlexCellFormatter fmt = table.getFlexCellFormatter ( ) ; fmt.setColSpan ( row , 0 , columns ) ; fmt.setStyleName ( row , 0 , Gerrit.RESOURCES.css ( ) . emptySection ( ) ) ; }
Source:
public static void loadSiteLib ( java.nio.file.Path libdir ) { try { com.google.gerrit.common.IoUtil.loadJARs ( com.google.gerrit.common.SiteLibraryLoaderUtil.listJars ( libdir ) ) ; } catch ( java.io.IOException e ) { com.google.gerrit.common.SiteLibraryLoaderUtil.log.error ( ( "Error scanning lib directory " + libdir ) , e ) ; } }

Target:
public static void loadSiteLib ( java.nio.file.Path libdir ) { try { java.util.List < java.nio.file.Path > jars = com.google.gerrit.common.SiteLibraryLoaderUtil.listJars ( libdir ) ; com.google.gerrit.common.IoUtil.loadJARs ( jars ) ; com.google.gerrit.common.SiteLibraryLoaderUtil.log.debug ( "Loaded site libraries: {}" , com.google.gerrit.common.SiteLibraryLoaderUtil.jarList ( jars ) ) ; } catch ( java.io.IOException e ) { com.google.gerrit.common.SiteLibraryLoaderUtil.log.error ( ( "Error scanning lib directory " + libdir ) , e ) ; } }
Source:
public void onSuccess ( final com.google.gwtjsonrpc.client.VoidResult result ) { for ( int row = 1 ; row < ( table.getRowCount ( ) ) ; ) { final com.google.gerrit.common.data.AccountProjectWatchInfo k = getRowItem ( row ) ; if ( ( k != null ) && ( ids.contains ( k.getWatch ( ) . getKey ( ) ) ) ) { table.removeRow ( row ) ; } else { row ++ ; } } }

Target:
protected void onUnload ( ) { super . onUnload ( ) ; closePopup ( ) ; }
Source:
private void fail ( com.google.gerrit.reviewdb.client.Change change , java.lang.Throwable t ) { ok.set ( false ) ; failed.update ( 1 ) ; }

Target:
public void run ( ) { try { future.get ( ) ; } catch ( java.lang.InterruptedException e ) { fail ( project , e ) ; } catch ( java.util.concurrent.ExecutionException e ) { ok.set ( false ) ; } catch ( java.lang.RuntimeException e ) { failAndThrow ( project , e ) ; } catch ( java.lang.Error e ) { failAndThrow ( project , e ) ; } finally { projTask.update ( 1 ) ; } }
Source:
private static void addDocLink ( final com.google.gerrit.client.ui.LinkMenuBar m , final java.lang.String text , final java.lang.String href ) { final com.google.gwt.user.client.ui.Anchor atag = com.google.gerrit.client.Gerrit.anchor ( text , ( "Documentation/" + href ) ) ; atag.setTarget ( "_blank" ) ; m.add ( atag ) ; }

Target:
private static void addDocLink ( final com.google.gerrit.client.ui.LinkMenuBar m , final java.lang.String text , final java.lang.String href ) { final com.google.gwt.user.client.ui.Anchor atag = com.google.gerrit.client.Gerrit.anchor ( text , com.google.gerrit.client.Gerrit.selfRedirect ( ( "/Documentation/" + href ) ) ) ; atag.setTarget ( "_blank" ) ; m.add ( atag ) ; }
Source:
public java.lang.Void call ( ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.git.UpdateException , com.google.gwtorm.server.OrmException { if ( caller == ( java.lang.Thread.currentThread ( ) ) ) { insertChange ( this . db ) ; } else { try ( com.google.gerrit.reviewdb.server.ReviewDb threadLocalDb = schemaFactory.open ( ) ) { insertChange ( threadLocalDb ) ; } } synchronized ( newProgress ) { newProgress.update ( 1 ) ; } return null ; }

Target:
public java.lang.Void call ( ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.git.UpdateException , com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.errors.RepositoryNotFoundException { try ( com.google.gerrit.server.git.ReceiveCommits.RequestState state = requestState ( caller ) ) { insertChange ( state ) ; } com.google.gerrit.server.git.ReceiveCommits.synchronizedIncrement ( newProgress ) ; return null ; }
Source:
private org.apache.lucene.search.Query intQuery ( com.google.gerrit.server.index.IndexPredicate < com.google.gerrit.server.query.change.ChangeData > p ) throws com.google.gerrit.server.query.QueryParseException { int value ; try { value = java.lang.Integer.valueOf ( p.getValue ( ) ) ; } catch ( java.lang.IllegalArgumentException e ) { throw new com.google.gerrit.server.query.QueryParseException ( ( "not an integer: " + ( p.getValue ( ) ) ) ) ; } return new org.apache.lucene.search.TermQuery ( intTerm ( p.getOperator ( ) , value ) ) ; }

Target:
private org.apache.lucene.search.Query intQuery ( com.google.gerrit.server.index.IndexPredicate < com.google.gerrit.server.query.change.ChangeData > p ) throws com.google.gerrit.server.query.QueryParseException { int value ; try { value = java.lang.Integer.valueOf ( p.getValue ( ) ) ; } catch ( java.lang.IllegalArgumentException e ) { throw new com.google.gerrit.server.query.QueryParseException ( ( "not an integer: " + ( p.getValue ( ) ) ) ) ; } return new org.apache.lucene.search.TermQuery ( intTerm ( p.getField ( ) . getName ( ) , value ) ) ; }
Source:
public com.google.gerrit.server.notedb.ChangeNotes create ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Project.NameKey project , com.google.gerrit.reviewdb.client.Change.Id changeId ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.Change change = db.changes ( ) . get ( changeId ) ; return new com.google.gerrit.server.notedb.ChangeNotes ( repoManager , migration , allUsersProvider , project , change ) . load ( ) ; }

Target:
public com.google.gerrit.server.notedb.ChangeNotes create ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Project.NameKey project , com.google.gerrit.reviewdb.client.Change.Id changeId ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.Change change = db.changes ( ) . get ( changeId ) ; com.google.common.base.Preconditions.checkArgument ( change.getProject ( ) . equals ( project ) , ( "passed project %s when creating ChangeNotes for %s, but actual" + " project is %s" ) , project , changeId , change.getProject ( ) ) ; return new com.google.gerrit.server.notedb.ChangeNotes ( repoManager , migration , allUsersProvider , project , change ) . load ( ) ; }
Source:
public static java.io.File createTempDirectory ( ) throws java.io.IOException { java.io.File tmp = java.io.File.createTempFile ( "gerrit_test_" , "" ) ; if ( ( ! ( tmp.delete ( ) ) ) || ( ! ( tmp.mkdir ( ) ) ) ) { throw new java.io.IOException ( ( "Cannot create " + ( tmp.getPath ( ) ) ) ) ; } return tmp ; }

Target:
public static synchronized java.io.File createTempDirectory ( ) throws java.io.IOException { java.io.File tmp = java.io.File.createTempFile ( "gerrit_test_" , "" ) ; if ( ( ! ( tmp.delete ( ) ) ) || ( ! ( tmp.mkdir ( ) ) ) ) { throw new java.io.IOException ( ( "Cannot create " + ( tmp.getPath ( ) ) ) ) ; } com.google.gerrit.acceptance.TempFileUtil.allDirsCreated.add ( tmp ) ; return tmp ; }