auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private java.io.File getPath ( ) { java.nio.file.Path basePath = site.resolve ( flags.cfg.getString ( "gerrit" , null , "basePath" ) ) ; if ( basePath == null ) { throw new java.lang.IllegalStateException ( "gerrit.basePath must be configured" ) ; } return org.eclipse.jgit.lib.RepositoryCache.FileKey.resolve ( basePath.resolve ( allUsers ) . toFile ( ) , FS.DETECTED ) ; }

Target:
private java.io.File getPath ( ) { java.nio.file.Path basePath = site.resolve ( flags.cfg.getString ( "gerrit" , null , "basePath" ) ) ; com.google.common.base.Preconditions.checkArgument ( ( basePath != null ) , "gerrit.basePath must be configured" ) ; return org.eclipse.jgit.lib.RepositoryCache.FileKey.resolve ( basePath.resolve ( allUsers ) . toFile ( ) , FS.DETECTED ) ; }
Source:
public boolean accept ( java.io.File pathname ) { java.lang.String n = pathname.getName ( ) ; return ( ( ( ( com.google.gerrit.server.plugins.PluginLoader.isJarPlugin ( n ) ) || ( com.google.gerrit.server.plugins.PluginLoader.isJsPlugin ( n ) ) ) || ( externalPluginFactory.handles ( pathname ) ) ) && ( ! ( n.startsWith ( ".last_" ) ) ) ) && ( ! ( n.startsWith ( ".next_" ) ) ) ; }

Target:
private com.google.gerrit.server.plugins.ServerPlugin loadExternalPlugin ( java.io.File scriptFile , org.eclipse.jgit.internal.storage.file.FileSnapshot snapshot ) throws com.google.gerrit.server.plugins.InvalidPluginException { java.lang.String name = externalPluginFactory.getPluginName ( scriptFile ) ; return externalPluginFactory.get ( scriptFile , snapshot , new com.google.gerrit.server.plugins.ServerPluginProvider.PluginDescription ( pluginUserFactory.create ( name ) , getPluginCanonicalWebUrl ( name ) , getPluginDataDir ( name ) ) ) ; }
Source:
void scheduleFullSync ( final com.google.gerrit.reviewdb.client.Project.NameKey project , final java.lang.String urlMatch , com.googlesource.gerrit.plugins.replication.ReplicationState state ) { if ( ! ( running ) ) { com.googlesource.gerrit.plugins.replication.ReplicationQueue.wrappedLog.warn ( "Replication plugin did not finish startup before event" , state ) ; return ; } for ( com.googlesource.gerrit.plugins.replication.Destination cfg : config.getDestinations ( ) ) { if ( cfg.wouldPushProject ( project ) ) { for ( org.eclipse.jgit.transport.URIish uri : cfg.getURIs ( project , urlMatch ) ) { cfg.schedule ( project , PushOne.ALL_REFS , uri , state ) ; } } } }

Target:
void scheduleFullSync ( final com.google.gerrit.reviewdb.client.Project.NameKey project , final java.lang.String urlMatch , com.googlesource.gerrit.plugins.replication.ReplicationState state ) { if ( ! ( running ) ) { com.googlesource.gerrit.plugins.replication.ReplicationQueue.stateLog.warn ( "Replication plugin did not finish startup before event" , state ) ; return ; } for ( com.googlesource.gerrit.plugins.replication.Destination cfg : config.getDestinations ( ) ) { if ( cfg.wouldPushProject ( project ) ) { for ( org.eclipse.jgit.transport.URIish uri : cfg.getURIs ( project , urlMatch ) ) { cfg.schedule ( project , PushOne.ALL_REFS , uri , state ) ; } } } }
Source:
protected void assertApproved ( java.lang.String changeId ) throws java.lang.Exception { com.google.gerrit.extensions.common.ChangeInfo c = get ( changeId , com.google.gerrit.extensions.client.ListChangesOption.DETAILED_LABELS ) ; com.google.gerrit.extensions.common.LabelInfo cr = c.labels.get ( "Code-Review" ) ; com.google.common.truth.Truth.assertThat ( cr.all ) . hasSize ( 1 ) ; com.google.common.truth.Truth.assertThat ( cr.all.get ( 0 ) . value ) . isEqualTo ( 2 ) ; com.google.common.truth.Truth.assertThat ( new com.google.gerrit.reviewdb.client.Account.Id ( cr.all.get ( 0 ) . _accountId ) ) . isEqualTo ( admin.getId ( ) ) ; }

Target:
protected void assertApproved ( java.lang.String changeId , com.google.gerrit.acceptance.TestAccount user ) throws java.lang.Exception { com.google.gerrit.extensions.common.ChangeInfo c = get ( changeId , com.google.gerrit.extensions.client.ListChangesOption.DETAILED_LABELS ) ; com.google.gerrit.extensions.common.LabelInfo cr = c.labels.get ( "Code-Review" ) ; com.google.common.truth.Truth.assertThat ( cr.all ) . hasSize ( 1 ) ; com.google.common.truth.Truth.assertThat ( cr.all.get ( 0 ) . value ) . isEqualTo ( 2 ) ; com.google.common.truth.Truth.assertThat ( new com.google.gerrit.reviewdb.client.Account.Id ( cr.all.get ( 0 ) . _accountId ) ) . isEqualTo ( user.getId ( ) ) ; }
Source:
private void testGetAccount ( java.lang.String url , com.google.gerrit.acceptance.TestAccount expectedAccount ) throws java.io.IOException { com.google.gerrit.acceptance.RestResponse r = session.get ( url ) ; org.junit.Assert.assertEquals ( HttpStatus.SC_OK , r.getStatusCode ( ) ) ; com.google.gerrit.acceptance.rest.account.AccountInfo account = new com.google.gson.Gson ( ) . fromJson ( r.getReader ( ) , new com.google.gson.reflect.TypeToken < com.google.gerrit.acceptance.rest.account.AccountInfo > ( ) { } . getType ( ) ) ; com.google.gerrit.acceptance.rest.account.AccountAssert.assertAccountInfo ( expectedAccount , account ) ; }

Target:
private void testGetAccount ( java.lang.String url , com.google.gerrit.acceptance.TestAccount expectedAccount ) throws java.io.IOException { com.google.gerrit.acceptance.RestResponse r = session.get ( url ) ; org.junit.Assert.assertEquals ( HttpStatus.SC_OK , r.getStatusCode ( ) ) ; com.google.gerrit.acceptance.rest.account.AccountAssert.assertAccountInfo ( expectedAccount , newGson ( ) . fromJson ( r.getReader ( ) , com.google.gerrit.server.account.AccountInfo.class ) ) ; }
Source:
public void newCommitIsNotCreatedWhenCommittingGroupRenamingTwice ( ) throws java.lang.Exception { createGroup ( groupUuid , groupName ) ; com.google.gerrit.reviewdb.client.AccountGroup.NameKey anotherName = new com.google.gerrit.reviewdb.client.AccountGroup.NameKey ( "admins" ) ; com.google.gerrit.server.group.db.GroupNameNotes groupNameNotes = com.google.gerrit.server.group.db.GroupNameNotes.loadForRename ( repo , groupUuid , groupName , anotherName ) ; commit ( groupNameNotes ) ; com.google.common.collect.ImmutableList < com.google.gerrit.extensions.common.CommitInfo > commitsAfterFirstCommit = log ( ) ; commit ( groupNameNotes ) ; com.google.common.collect.ImmutableList < com.google.gerrit.extensions.common.CommitInfo > commitsAfterSecondCommit = log ( ) ; com.google.gerrit.server.group.db.GroupNameNotesTest.assertThatCommits ( commitsAfterSecondCommit ) . isEqualTo ( commitsAfterFirstCommit ) ; }

Target:
public void newCommitIsNotCreatedWhenCommittingGroupRenamingTwice ( ) throws java.lang.Exception { createGroup ( groupUuid , groupName ) ; com.google.gerrit.reviewdb.client.AccountGroup.NameKey anotherName = new com.google.gerrit.reviewdb.client.AccountGroup.NameKey ( "admins" ) ; com.google.gerrit.server.group.db.GroupNameNotes groupNameNotes = com.google.gerrit.server.group.db.GroupNameNotes.forRename ( repo , groupUuid , groupName , anotherName ) ; commit ( groupNameNotes ) ; com.google.common.collect.ImmutableList < com.google.gerrit.extensions.common.CommitInfo > commitsAfterFirstCommit = log ( ) ; commit ( groupNameNotes ) ; com.google.common.collect.ImmutableList < com.google.gerrit.extensions.common.CommitInfo > commitsAfterSecondCommit = log ( ) ; com.google.gerrit.server.group.db.GroupNameNotesTest.assertThatCommits ( commitsAfterSecondCommit ) . isEqualTo ( commitsAfterFirstCommit ) ; }
Source:
public java.lang.String toString ( ) { return ( "Stream Events (" + ( currentUser.state ( ) . getUserName ( ) ) ) + ")" ; }

Target:
public java.lang.String toString ( ) { java.lang.StringBuilder b = new java.lang.StringBuilder ( ) ; b.append ( "Stream Events" ) ; if ( currentUser.state ( ) . getUserName ( ) . isPresent ( ) ) { b.append ( ( ( " (" + ( currentUser.state ( ) . getUserName ( ) . get ( ) ) ) + ")" ) ) ; } return b.toString ( ) ; }
Source:
protected java.util.List < java.lang.String > getValues ( com.googlesource.gerrit.plugins.lfs.LfsSshRequestAuthorizer.LfsSshAuthToken token ) { java.util.List < java.lang.String > values = new java.util.ArrayList < > ( 4 ) ; values.add ( token.user ) ; values.add ( token.project ) ; values.add ( token.operation ) ; values.add ( token.expiresAt ) ; return values ; }

Target:
protected java.util.List < java.lang.String > getValues ( com.googlesource.gerrit.plugins.lfs.LfsSshRequestAuthorizer.LfsSshAuthToken token ) { java.util.List < java.lang.String > values = new java.util.ArrayList < > ( 4 ) ; values.add ( token.user ) ; values.add ( token.project ) ; values.add ( token.operation ) ; values.add ( com.googlesource.gerrit.plugins.lfs.LfsDateTime.format ( token.issued ) ) ; values.add ( java.lang.String.valueOf ( token.expiresIn ) ) ; return values ; }
Source:
void onSyntaxHighlighting ( com.google.gwt.event.logical.shared.ValueChangeEvent < java.lang.Boolean > e ) { prefs.syntaxHighlighting ( e.getValue ( ) ) ; mode.setEnabled ( prefs.syntaxHighlighting ( ) ) ; if ( prefs.syntaxHighlighting ( ) ) { setMode ( view.getContentType ( ) ) ; } view.setSyntaxHighlighting ( prefs.syntaxHighlighting ( ) ) ; }

Target:
void onLineNumbers ( com.google.gwt.event.logical.shared.ValueChangeEvent < java.lang.Boolean > e ) { prefs.showLineNumbers ( e.getValue ( ) ) ; if ( ( view ) != null ) { view.setShowLineNumbers ( prefs.showLineNumbers ( ) ) ; } }
Source:
public void byProjectClosedPrev ( final com.google.gerrit.reviewdb.Project.NameKey project , final com.google.gerrit.reviewdb.Change.Status s , final java.lang.String pos , final int pageSize , final com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.common.data.SingleListChangeInfo > callback ) { run ( callback , new com.google.gerrit.httpd.rpc.ChangeListServiceImpl.QueryPrev ( pageSize , pos ) { @ java.lang.Override com.google.gwtorm.client.ResultSet < com.google.gerrit.reviewdb.Change > query ( com.google.gerrit.reviewdb.ReviewDb db , int slim , java.lang.String sortKey ) throws com.google.gwtorm.client.OrmException { return db.changes ( ) . byProjectClosedPrev ( s.getCode ( ) , project , sortKey , slim ) ; } } ) ; }

Target:
public void allQueryPrev ( final java.lang.String query , final java.lang.String pos , final int pageSize , final com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.common.data.SingleListChangeInfo > callback ) { run ( callback , new com.google.gerrit.httpd.rpc.ChangeListServiceImpl.QueryPrev ( pageSize , pos ) { @ java.lang.Override com.google.gwtorm.client.ResultSet < com.google.gerrit.reviewdb.Change > query ( com.google.gerrit.reviewdb.ReviewDb db , int lim , java.lang.String key ) throws com.google.gerrit.common.errors.InvalidQueryException , com.google.gwtorm.client.OrmException { return searchQuery ( db , query , lim , key , com.google.gerrit.httpd.rpc.ChangeListServiceImpl.QUERY_PREV ) ; } } ) ; }
Source:
public com.google.gerrit.server.change.ChangeKind getChangeKind ( com.google.gerrit.server.project.ProjectState project , org.eclipse.jgit.lib.Repository repo , org.eclipse.jgit.lib.ObjectId prior , org.eclipse.jgit.lib.ObjectId next ) { try { return new com.google.gerrit.server.change.ChangeKindCacheImpl.Loader ( ) . load ( new com.google.gerrit.server.change.ChangeKindCacheImpl.Key ( repo , prior , next , useRecursiveMerge ) ) ; } catch ( java.io.IOException e ) { com.google.gerrit.server.change.ChangeKindCacheImpl.log.warn ( ( ( ( "Cannot check trivial rebase of new patch set " + ( next.name ( ) ) ) + " in " ) + ( project.getProject ( ) . getName ( ) ) ) , e ) ; return ChangeKind.REWORK ; } }

Target:
public com.google.gerrit.server.change.ChangeKind getChangeKind ( com.google.gerrit.server.project.ProjectState project , org.eclipse.jgit.lib.Repository repo , org.eclipse.jgit.lib.ObjectId prior , org.eclipse.jgit.lib.ObjectId next ) { try { com.google.gerrit.server.change.ChangeKindCacheImpl.Key key = new com.google.gerrit.server.change.ChangeKindCacheImpl.Key ( prior , next , useRecursiveMerge ) ; return new com.google.gerrit.server.change.ChangeKindCacheImpl.Loader ( key , repo ) . call ( ) ; } catch ( java.io.IOException e ) { com.google.gerrit.server.change.ChangeKindCacheImpl.log.warn ( ( ( ( "Cannot check trivial rebase of new patch set " + ( next.name ( ) ) ) + " in " ) + ( project.getProject ( ) . getName ( ) ) ) , e ) ; return ChangeKind.REWORK ; } }
Source:
public void start ( ) { java.lang.Thread t = new java.lang.Thread ( ) { @ java.lang.Override public void run ( ) { reindex ( ) ; } } ; t.setName ( java.lang.String.format ( "Reindex v%d-v%d" , com.google.gerrit.lucene.OnlineReindexer.version ( indexes.getSearchIndex ( ) ) , version ) ) ; t.start ( ) ; }

Target:
public void start ( ) { if ( running.compareAndSet ( false , true ) ) { java.lang.Thread t = new java.lang.Thread ( ) { @ java.lang.Override public void run ( ) { try { reindex ( ) ; } finally { running.set ( false ) ; } } } ; t.setName ( java.lang.String.format ( "Reindex v%d-v%d" , com.google.gerrit.lucene.OnlineReindexer.version ( indexes.getSearchIndex ( ) ) , version ) ) ; t.start ( ) ; } }
Source:
private void add ( final javax.mail.Message.RecipientType rt , final com.google.gerrit.client.reviewdb.Account.Id to ) throws javax.mail.MessagingException { if ( ! ( rcptTo.add ( to ) ) ) { return ; } final javax.mail.Address addr = toAddress ( to ) ; if ( addr != null ) { msg.addRecipient ( rt , addr ) ; } }

Target:
private void initFrom ( ) throws javax.mail.MessagingException , javax.mail.internet.AddressException { javax.mail.Address addr ; if ( ( fromId ) != null ) { addr = toAddress ( fromId ) ; } else { final org.spearce.jgit.lib.PersonIdent pi = server.newGerritPersonIdent ( ) ; try { addr = new javax.mail.internet.InternetAddress ( pi.getName ( ) , pi.getEmailAddress ( ) ) ; } catch ( java.io.UnsupportedEncodingException e ) { addr = new javax.mail.internet.InternetAddress ( pi.getEmailAddress ( ) ) ; } } msg.setFrom ( addr ) ; }
Source:
public void onLoad ( com.google.gerrit.plugin.client.screen.Screen screen ) { java.lang.String projectName = com.google.gwt.http.client.URL.decode ( screen.getToken ( 1 ) ) ; java.lang.String revision = com.google.gwt.http.client.URL.decode ( screen.getToken ( 2 ) ) ; java.lang.String path = screen.getToken ( 3 ) ; screen.show ( new com.googlesource.gerrit.plugins.xdocs.client.XDocScreen ( projectName , revision , path ) ) ; screen.setWindowTitle ( com.googlesource.gerrit.plugins.xdocs.client.FileInfo.getFileName ( path ) ) ; }

Target:
public void onLoad ( com.google.gerrit.plugin.client.screen.Screen screen ) { java.lang.String projectName = com.google.gwt.http.client.URL.decodeQueryString ( screen.getToken ( 1 ) ) ; java.lang.String revision = com.google.gwt.http.client.URL.decodeQueryString ( screen.getToken ( 2 ) ) ; java.lang.String path = screen.getToken ( 3 ) ; screen.show ( new com.googlesource.gerrit.plugins.xdocs.client.XDocScreen ( projectName , revision , path ) ) ; screen.setWindowTitle ( com.googlesource.gerrit.plugins.xdocs.client.FileInfo.getFileName ( path ) ) ; }
Source:
public static void suggest ( java.lang.String prefix , int limit , com.google.gwtjsonrpc.common.AsyncCallback < com.google.gerrit.client.projects.ProjectMap > cb ) { new com.google.gerrit.client.rpc.RestApi ( ( "/projects/" + ( com.google.gwt.http.client.URL.encode ( prefix ) . replaceAll ( "[?]" , "%3F" ) ) ) ) . addParameterRaw ( "type" , "ALL" ) . addParameter ( "n" , limit ) . addParameterTrue ( "d" ) . send ( com.google.gerrit.client.rpc.NativeMap.copyKeysIntoChildren ( cb ) ) ; }

Target:
public static void suggest ( java.lang.String prefix , int limit , com.google.gwtjsonrpc.common.AsyncCallback < com.google.gerrit.client.projects.ProjectMap > cb ) { new com.google.gerrit.client.rpc.RestApi ( "/projects/" ) . addParameter ( "p" , prefix ) . addParameter ( "n" , limit ) . addParameterRaw ( "type" , "ALL" ) . addParameterTrue ( "d" ) . get ( com.google.gerrit.client.rpc.NativeMap.copyKeysIntoChildren ( cb ) ) ; }
Source:
public void unblockForceWithAllowNoForce_NotPossible ( ) { com.google.gerrit.common.data.PermissionRule r = com.google.gerrit.server.project.Util.block ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/*" ) ; r.setForce ( true ) ; com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = user ( local , com.google.gerrit.server.project.Util.DEVS ) ; assertCannotForceUpdate ( "refs/heads/master" , u ) ; }

Target:
public void unblockMoreSpecificRef_Fails ( ) { com.google.gerrit.server.project.testing.Util.block ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.testing.Util.allow ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.testing.Util.DEVS , "refs/heads/master" ) ; com.google.gerrit.server.project.ProjectControl u = user ( local , com.google.gerrit.server.project.testing.Util.DEVS ) ; assertCannotUpdate ( "refs/heads/master" , u ) ; }
Source:
public com.google.gerrit.extensions.restapi.Response < java.lang.String > apply ( com.google.gerrit.server.change.ChangeResource rsrc , com.google.gerrit.server.change.Unmute.Input input ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.StarredChangesUtil.IllegalLabelException , com.google.gwtorm.server.OrmException { if ( ( rsrc.isUserOwner ( ) ) || ( ! ( isMuted ( rsrc.getChange ( ) ) ) ) ) { return com.google.gerrit.extensions.restapi.Response.ok ( "" ) ; } stars.unmute ( rsrc ) ; return com.google.gerrit.extensions.restapi.Response.ok ( "" ) ; }

Target:
public com.google.gerrit.server.change.Description getDescription ( com.google.gerrit.server.change.ChangeResource rsrc ) { return new com.google.gerrit.extensions.webui.UiAction.Description ( ) . setLabel ( "Unmute" ) . setTitle ( "Unmute the change" ) . setVisible ( ( ( ! ( rsrc.isUserOwner ( ) ) ) && ( isUnMuteable ( rsrc ) ) ) ) ; }
Source:
public static com.google.gerrit.git.WorkQueue.Executor createQueue ( final int poolsize ) { final com.google.gerrit.git.WorkQueue.Executor r = new com.google.gerrit.git.WorkQueue.Executor ( poolsize ) ; r.setContinueExistingPeriodicTasksAfterShutdownPolicy ( false ) ; r.setExecuteExistingDelayedTasksAfterShutdownPolicy ( false ) ; com.google.gerrit.git.WorkQueue.queues.add ( r ) ; return r ; }

Target:
public static com.google.gerrit.git.WorkQueue.Executor createQueue ( final int poolsize , final java.lang.String prefix ) { final com.google.gerrit.git.WorkQueue.Executor r = new com.google.gerrit.git.WorkQueue.Executor ( poolsize , prefix ) ; r.setContinueExistingPeriodicTasksAfterShutdownPolicy ( false ) ; r.setExecuteExistingDelayedTasksAfterShutdownPolicy ( false ) ; com.google.gerrit.git.WorkQueue.queues.add ( r ) ; return r ; }
Source:
public com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.AccessToken loginPhase2 ( javax.servlet.http.HttpServletRequest request , javax.servlet.http.HttpServletResponse response , java.lang.String state ) throws java.io.IOException { java.lang.String requestState = request.getParameter ( "state" ) ; if ( ! ( java.util.Objects.equals ( state , requestState ) ) ) { throw new java.io.IOException ( "Invalid authentication state" ) ; } return getAccessToken ( new com.google.gerrit.extensions.auth.oauth.OAuthVerifier ( request.getParameter ( "code" ) ) ) ; }

Target:
public com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.AccessToken loginPhase2 ( javax.servlet.http.HttpServletRequest request , javax.servlet.http.HttpServletResponse response , java.lang.String state ) throws java.io.IOException { java.lang.String requestState = request.getParameter ( "state" ) ; if ( ! ( java.util.Objects.equals ( state , requestState ) ) ) { throw new java.io.IOException ( ( ( ( ( "Invalid authentication state: expected '" + state ) + "' but was '" ) + requestState ) + "'" ) ) ; } return getAccessToken ( new com.google.gerrit.extensions.auth.oauth.OAuthVerifier ( request.getParameter ( "code" ) ) ) ; }
Source:
public void createTempDirectory ( ) throws java.lang.Exception { sitePath = com.google.gerrit.testutil.TempFileUtil.createTempDirectory ( ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { com.google.gerrit.server.config.SitePaths sitePaths = new com.google.gerrit.server.config.SitePaths ( com.google.gerrit.testutil.TempFileUtil.createTempDirectory ( ) . toPath ( ) ) ; sitePath = sitePaths.site_path.toString ( ) ; gerritConfig = new org.eclipse.jgit.storage.file.FileBasedConfig ( sitePaths.gerrit_config.toFile ( ) , org.eclipse.jgit.util.FS.detect ( ) ) ; }
Source:
private void setuser ( final com.google.gerrit.pgm.init.Section database , java.lang.String username , java.lang.String password ) { if ( ( username != null ) && ( ! ( username.isEmpty ( ) ) ) ) { database.set ( "username" , username ) ; } if ( ( password != null ) && ( ! ( password.isEmpty ( ) ) ) ) { sec.setString ( "database" , null , "password" , password ) ; } }

Target:
private void setuser ( final com.google.gerrit.pgm.init.api.Section database , java.lang.String username , java.lang.String password ) { if ( ( username != null ) && ( ! ( username.isEmpty ( ) ) ) ) { database.set ( "username" , username ) ; } if ( ( password != null ) && ( ! ( password.isEmpty ( ) ) ) ) { sec.setString ( "database" , null , "password" , password ) ; } }
Source:
public void testGetJGroupsMyUrlFromListenUrlWhenMultipleListenUrlsSpecified ( ) throws java.lang.Exception { org.mockito.Mockito.when ( configMock.getEnum ( com.ericsson.gerrit.plugins.highavailability.Configuration.PEER_INFO_SECTION , null , com.ericsson.gerrit.plugins.highavailability.Configuration.STRATEGY_KEY , com.ericsson.gerrit.plugins.highavailability.Configuration.DEFAULT_PEER_INFO_STRATEGY ) ) . thenReturn ( Configuration.PeerInfoStrategy.JGROUPS ) ; initializeConfiguration ( ) ; org.mockito.Mockito.when ( serverConfigMock.getStringList ( "httpd" , null , "listenUrl" ) ) . thenReturn ( new java.lang.String [ ] { "a" , "b" } ) ; exception.expect ( com.ericsson.gerrit.plugins.highavailability.ProvisionException.class ) ; exception.expectMessage ( "exactly 1 value configured; found 2" ) ; getMyUrlProvider ( ) ; }

Target:
public void testGetJGroupsMyUrlFromListenUrlWhenMultipleListenUrlsSpecified ( ) throws java.lang.Exception { org.mockito.Mockito.when ( configMock.getEnum ( com.ericsson.gerrit.plugins.highavailability.Configuration.PEER_INFO_SECTION , null , com.ericsson.gerrit.plugins.highavailability.Configuration.STRATEGY_KEY , com.ericsson.gerrit.plugins.highavailability.Configuration.DEFAULT_PEER_INFO_STRATEGY ) ) . thenReturn ( Configuration.PeerInfoStrategy.JGROUPS ) ; initializeConfiguration ( ) ; org.mockito.Mockito.when ( serverConfigMock.getStringList ( "httpd" , null , "listenUrl" ) ) . thenReturn ( new java.lang.String [ ] { "a" , "b" } ) ; exception.expect ( com.google.inject.ProvisionException.class ) ; exception.expectMessage ( "exactly 1 value configured; found 2" ) ; getMyUrlProvider ( ) ; }
Source:
public void name ( java.lang.String name ) throws com.google.gerrit.extensions.restapi.RestApiException { com.google.gerrit.server.group.PutName.Input in = new com.google.gerrit.server.group.PutName.Input ( ) ; in.name = name ; try { putName.apply ( rsrc , in ) ; } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( "Cannot put group name" , e ) ; } }

Target:
public void name ( java.lang.String name ) throws com.google.gerrit.extensions.restapi.RestApiException { com.google.gerrit.extensions.common.NameInput in = new com.google.gerrit.extensions.common.NameInput ( ) ; in.name = name ; try { putName.apply ( rsrc , in ) ; } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( "Cannot put group name" , e ) ; } }
Source:
public void rebuildEmptySite ( ) throws java.lang.Exception { initSite ( ) ; com.google.common.io.Files.append ( com.google.gerrit.server.notedb.ConfigNotesMigration.allEnabledConfig ( ) . toText ( ) , new java.io.File ( sitePath.toString ( ) , "etc/gerrit.config" ) , java.nio.charset.StandardCharsets.UTF_8 ) ; com.google.gerrit.acceptance.pgm.RebuildNoteDbIT.runGerrit ( "RebuildNoteDb" , "-d" , sitePath.toString ( ) , "--show-stack-trace" ) ; }

Target:
public void rebuildEmptySite ( ) throws java.lang.Exception { initSite ( ) ; com.google.common.io.Files.asCharSink ( new java.io.File ( sitePath.toString ( ) , "etc/gerrit.config" ) , java.nio.charset.StandardCharsets.UTF_8 , com.google.common.io.FileWriteMode.APPEND ) . write ( com.google.gerrit.server.notedb.ConfigNotesMigration.allEnabledConfig ( ) . toText ( ) ) ; com.google.gerrit.acceptance.pgm.RebuildNoteDbIT.runGerrit ( "RebuildNoteDb" , "-d" , sitePath.toString ( ) , "--show-stack-trace" ) ; }
Source:
private void addIssueOccurrence ( java.lang.String issue , java.util.Map < java.lang.String , java.util.Set < java.lang.String > > map , java.lang.String occurrence ) { java.util.Set < java.lang.String > occurrences = map.get ( issue ) ; if ( occurrences == null ) { occurrences = com.google.common.collect.Sets.newLinkedHashSet ( ) ; map.put ( issue , occurrences ) ; } occurrences.add ( occurrence ) ; }

Target:
private void addIssuesOccurrence ( java.lang.String text , java.lang.String occurrence , java.util.Map < java.lang.String , java.util.Set < java.lang.String > > map ) { for ( java.lang.String issue : getIssueIds ( text ) ) { java.util.Set < java.lang.String > occurrences = map.get ( issue ) ; if ( occurrences == null ) { occurrences = com.google.common.collect.Sets.newLinkedHashSet ( ) ; map.put ( issue , occurrences ) ; } occurrences.add ( occurrence ) ; } }
Source:
protected void run ( ) { for ( final java.lang.Integer id : taskIds ) { final com.google.gerrit.server.git.WorkQueue.Task < ? > task = workQueue.getTask ( id ) ; if ( task != null ) { task.cancel ( true ) ; } else { stderr.print ( ( ( "kill: " + ( com.google.gerrit.server.util.IdGenerator.format ( id ) ) ) + ": No such task\n" ) ) ; } } }

Target:
protected void run ( ) { for ( java.lang.String id : taskIds ) { try { com.google.gerrit.server.git.WorkQueue.Task < ? > task = workQueue.getTask ( ( ( int ) ( java.lang.Long.parseLong ( id , 16 ) ) ) ) ; deleteTask.apply ( new com.google.gerrit.server.config.TaskResource ( task ) , null ) ; } catch ( java.lang.NumberFormatException e ) { stderr.print ( ( ( "kill: " + id ) + ": No such task\n" ) ) ; } } }
Source:
private void initChangeRepo ( ) throws java.io.IOException { if ( ( changeRepo ) == null ) { com.google.common.base.Preconditions.checkState ( ( ! ( changeUpdates.isEmpty ( ) ) ) ) ; changeRepo = openRepo ( changeUpdates.values ( ) . iterator ( ) . next ( ) . getProjectName ( ) ) ; } }

Target:
org.eclipse.jgit.revwalk.RevWalk getChangeRevWalk ( ) throws java.io.IOException { initChangeRepo ( ) ; return changeRepo.rw ; }
Source:
public void onKeyPress ( com.google.gwt.event.dom.client.KeyPressEvent e ) { e.stopPropagation ( ) ; if ( ( ( ( e.getCharCode ( ) ) == '\n' ) || ( ( e.getCharCode ( ) ) == ( com.google.gwt.event.dom.client.KeyCodes.KEY_ENTER ) ) ) && ( e.isControlKeyDown ( ) ) ) { e.preventDefault ( ) ; onPost ( null ) ; } }

Target:
public void onKeyPress ( com.google.gwt.event.dom.client.KeyPressEvent e ) { e.stopPropagation ( ) ; if ( ( ( ( e.getCharCode ( ) ) == '\n' ) || ( ( e.getCharCode ( ) ) == ( com.google.gwt.event.dom.client.KeyCodes.KEY_ENTER ) ) ) && ( e.isControlKeyDown ( ) ) ) { e.preventDefault ( ) ; if ( post.isEnabled ( ) ) { onPost ( null ) ; } } }
Source:
private static com.google.gerrit.extensions.restapi.BinaryResult asBinaryResult ( final org.eclipse.jgit.lib.ObjectLoader obj ) { com.google.gerrit.extensions.restapi.BinaryResult result = new com.google.gerrit.extensions.restapi.BinaryResult ( ) { @ java.lang.Override public void writeTo ( java.io.OutputStream os ) throws java.io.IOException { obj.copyTo ( os ) ; } } ; result.setContentLength ( obj.getSize ( ) ) ; return result ; }

Target:
private static com.google.gerrit.extensions.restapi.BinaryResult asBinaryResult ( byte [ ] raw , final org.eclipse.jgit.lib.ObjectLoader obj ) { if ( raw != null ) { return com.google.gerrit.extensions.restapi.BinaryResult.create ( raw ) ; } com.google.gerrit.extensions.restapi.BinaryResult result = new com.google.gerrit.extensions.restapi.BinaryResult ( ) { @ java.lang.Override public void writeTo ( java.io.OutputStream os ) throws java.io.IOException { obj.copyTo ( os ) ; } } ; result.setContentLength ( obj.getSize ( ) ) ; return result ; }
Source:
private void checkCanRunAs ( ) throws com.google.gerrit.sshd.UnloggedFailure { if ( ( caller.get ( ) ) instanceof com.google.gerrit.server.PeerDaemonUser ) { } else if ( ! ( enableRunAs ) ) { throw new com.google.gerrit.sshd.UnloggedFailure ( 1 , "fatal: suexec disabled by auth.enableRunAs = false" ) ; } else if ( ! ( caller.get ( ) . getCapabilities ( ) . canRunAs ( ) ) ) { throw new com.google.gerrit.sshd.UnloggedFailure ( 1 , "fatal: suexec not permitted" ) ; } }

Target:
private void checkCanRunAs ( ) throws com.google.gerrit.sshd.UnloggedFailure { if ( ( caller ) instanceof com.google.gerrit.server.PeerDaemonUser ) { } else if ( ! ( enableRunAs ) ) { throw die ( "suexec disabled by auth.enableRunAs = false" ) ; } else if ( ! ( caller.getCapabilities ( ) . canRunAs ( ) ) ) { throw die ( "suexec not permitted" ) ; } }
Source:
public void inheritRead_AppendWithDenyOfRef ( ) { com.google.gerrit.server.project.Util.allow ( parent , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/*" ) ; com.google.gerrit.server.project.Util.deny ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = user ( local ) ; assertCanAccess ( u ) ; assertCanRead ( "refs/master" , u ) ; assertCanRead ( "refs/tags/foobar" , u ) ; assertCanRead ( "refs/heads/master" , u ) ; }

Target:
public void inheritRead_OverridesAndDeniesOfRef ( ) { com.google.gerrit.server.project.testing.Util.allow ( parent , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/*" ) ; com.google.gerrit.server.project.testing.Util.deny ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/*" ) ; com.google.gerrit.server.project.testing.Util.allow ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = user ( local ) ; assertCanAccess ( u ) ; assertCannotRead ( "refs/foobar" , u ) ; assertCannotRead ( "refs/tags/foobar" , u ) ; assertCanRead ( "refs/heads/foobar" , u ) ; }
Source:
private com.google.gerrit.server.project.ChangeControl controlFor ( com.google.gerrit.server.change.RevisionResource rsrc , com.google.gerrit.reviewdb.client.Change.Id id ) throws com.google.gwtorm.server.OrmException { if ( rsrc.getChange ( ) . getId ( ) . equals ( id ) ) { return rsrc.getControl ( ) ; } com.google.gerrit.server.notedb.ChangeNotes notes = notesFactory.createChecked ( dbProvider.get ( ) , rsrc.getProject ( ) , id ) ; return rsrc.getControl ( ) . getProjectControl ( ) . controlFor ( notes ) ; }

Target:
private com.google.gerrit.server.notedb.ChangeNotes notesFor ( com.google.gerrit.server.change.RevisionResource rsrc , com.google.gerrit.reviewdb.client.Change.Id id ) throws com.google.gwtorm.server.OrmException { if ( rsrc.getChange ( ) . getId ( ) . equals ( id ) ) { return rsrc.getNotes ( ) ; } return notesFactory.createChecked ( dbProvider.get ( ) , rsrc.getProject ( ) , id ) ; }
Source:
private boolean isStaticResource ( javax.servlet.http.HttpServletRequest httpRequest ) { java.lang.String pathExt = org.apache.commons.lang.StringUtils.substringAfterLast ( httpRequest.getRequestURI ( ) , "." ) ; if ( org.apache.commons.lang.StringUtils.isEmpty ( pathExt ) ) { return false ; } return com.googlesource.gerrit.plugins.github.oauth.OAuthFilter.GERRIT_STATIC_RESOURCES_EXTS.contains ( pathExt.toLowerCase ( ) ) ; }

Target:
private static boolean isStaticResource ( javax.servlet.http.HttpServletRequest httpRequest ) { java.lang.String requestURI = httpRequest.getRequestURI ( ) ; java.lang.String pathExt = org.apache.commons.lang.StringUtils.substringAfterLast ( requestURI , "." ) ; if ( org.apache.commons.lang.StringUtils.isEmpty ( pathExt ) ) { return false ; } boolean staticResource = com.googlesource.gerrit.plugins.github.oauth.OAuthFilter.GERRIT_STATIC_RESOURCES_EXTS.contains ( pathExt.toLowerCase ( ) ) ; java.lang.System.out.println ( ( ( ( ( ( "requestUri: " + requestURI ) + " pathExt: " ) + pathExt ) + " static: " ) + staticResource ) ) ; return staticResource ; }
Source:
public java.lang.String getSqlType ( final com.google.gwtorm.schema.ColumnModel column , final com.google.gwtorm.schema.sql.SqlDialect dialect ) { final java.lang.StringBuilder r = new java.lang.StringBuilder ( ) ; r.append ( "CHAR(1)" ) ; r.append ( " DEFAULT ' '" ) ; r.append ( " NOT NULL" ) ; return r.toString ( ) ; }

Target:
public java.lang.String getSqlType ( final com.google.gwtorm.schema.ColumnModel column , final com.google.gwtorm.schema.sql.SqlDialect dialect ) { final java.lang.StringBuilder r = new java.lang.StringBuilder ( ) ; r.append ( "CHAR(1)" ) ; if ( column.isNotNull ( ) ) { r.append ( " DEFAULT ' '" ) ; r.append ( " NOT NULL" ) ; } return r.toString ( ) ; }
Source:
private boolean canRead ( com.google.gerrit.server.notedb.ChangeNotes notes ) throws com.google.gerrit.server.permissions.PermissionBackendException { try { permissionBackend.user ( user ) . change ( notes ) . database ( db ) . check ( ChangePermission.READ ) ; return true ; } catch ( com.google.gerrit.extensions.restapi.AuthException e ) { return false ; } }

Target:
private boolean canRead ( com.google.gerrit.server.notedb.ChangeNotes notes ) throws com.google.gerrit.server.permissions.PermissionBackendException , java.io.IOException { try { permissionBackend.user ( user ) . change ( notes ) . database ( db ) . check ( ChangePermission.READ ) ; } catch ( com.google.gerrit.extensions.restapi.AuthException e ) { return false ; } com.google.gerrit.server.project.ProjectState projectState = projectCache.checkedGet ( notes.getProjectName ( ) ) ; if ( projectState == null ) { return false ; } return projectState.statePermitsRead ( ) ; }
Source:
public com.google.gerrit.extensions.restapi.Response < ? > apply ( com.google.gerrit.server.change.ChangeEditResource rsrc ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException , java.io.IOException { try { return com.google.gerrit.extensions.restapi.Response.ok ( fileContentUtil.getContent ( rsrc.getChangeEdit ( ) . getChange ( ) . getProject ( ) , rsrc.getChangeEdit ( ) . getRevision ( ) . get ( ) , rsrc.getPath ( ) ) ) ; } catch ( com.google.gerrit.extensions.restapi.ResourceNotFoundException rnfe ) { return com.google.gerrit.extensions.restapi.Response.none ( ) ; } }

Target:
public com.google.gerrit.extensions.restapi.Response < ? > apply ( com.google.gerrit.server.change.ChangeEditResource rsrc ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException , java.io.IOException { try { return com.google.gerrit.extensions.restapi.Response.ok ( fileContentUtil.getContent ( rsrc.getControl ( ) . getProjectControl ( ) . getProjectState ( ) , org.eclipse.jgit.lib.ObjectId.fromString ( rsrc.getChangeEdit ( ) . getRevision ( ) . get ( ) ) , rsrc.getPath ( ) ) ) ; } catch ( com.google.gerrit.extensions.restapi.ResourceNotFoundException rnfe ) { return com.google.gerrit.extensions.restapi.Response.none ( ) ; } }
Source:
private org.eclipse.jgit.lib.ObjectId createCommit ( com.google.gerrit.server.IdentifiedUser me , org.eclipse.jgit.lib.ObjectInserter inserter , org.eclipse.jgit.revwalk.RevCommit revision , org.eclipse.jgit.lib.ObjectId tree , java.lang.String msg , java.sql.Timestamp when ) throws java.io.IOException { org.eclipse.jgit.lib.CommitBuilder builder = new org.eclipse.jgit.lib.CommitBuilder ( ) ; builder.setTreeId ( tree ) ; builder.setParentIds ( revision.getParents ( ) ) ; builder.setAuthor ( revision.getAuthorIdent ( ) ) ; builder.setCommitter ( getCommitterIdent ( me , when ) ) ; builder.setMessage ( msg ) ; return inserter.insert ( builder ) ; }

Target:
private void createEditReference ( org.eclipse.jgit.lib.Repository repository , com.google.gerrit.server.project.ChangeControl changeControl , com.google.gerrit.reviewdb.client.PatchSet basePatchSet , org.eclipse.jgit.lib.ObjectId newEditCommit , java.sql.Timestamp timestamp ) throws com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.reviewdb.client.Change change = changeControl.getChange ( ) ; java.lang.String editRefName = getEditRefName ( change , basePatchSet ) ; updateReference ( repository , editRefName , org.eclipse.jgit.lib.ObjectId.zeroId ( ) , newEditCommit , timestamp ) ; indexer.index ( reviewDb.get ( ) , change ) ; }
Source:
public static java.lang.String getFileName ( java.lang.String path ) { java.lang.String fileName = ( Patch.COMMIT_MSG.equals ( path ) ) ? "Commit Message" : path ; int s = fileName.lastIndexOf ( '/' ) ; return s >= 0 ? fileName.substring ( ( s + 1 ) ) : fileName ; }

Target:
public static java.lang.String getFileName ( java.lang.String path ) { java.lang.String fileName ; if ( Patch.COMMIT_MSG.equals ( path ) ) { fileName = "Commit Message" ; } else if ( Patch.MERGE_LIST.equals ( path ) ) { fileName = "Merge List" ; } else { fileName = path ; } int s = fileName.lastIndexOf ( '/' ) ; return s >= 0 ? fileName.substring ( ( s + 1 ) ) : fileName ; }
Source:
private boolean canPerformOnAnyRef ( com.google.gerrit.reviewdb.ApprovalCategory.Id actionId , short requireValue ) { final java.util.Set < com.google.gerrit.reviewdb.AccountGroup.Id > groups = user.getEffectiveGroups ( ) ; for ( final com.google.gerrit.reviewdb.RefRight pr : state.getAllRights ( actionId , true ) ) { if ( ( groups.contains ( pr.getAccountGroupId ( ) ) ) && ( ( pr.getMaxValue ( ) ) >= requireValue ) ) { return true ; } } return false ; }

Target:
private boolean canPerformOnAnyRef ( com.google.gerrit.reviewdb.ApprovalCategory.Id actionId , short requireValue ) { final java.util.Set < com.google.gerrit.reviewdb.AccountGroup.Id > groups = getEffectiveUserGroups ( ) ; for ( final com.google.gerrit.reviewdb.RefRight pr : state.getAllRights ( actionId , true ) ) { if ( ( groups.contains ( pr.getAccountGroupId ( ) ) ) && ( ( pr.getMaxValue ( ) ) >= requireValue ) ) { return true ; } } return false ; }
Source:
private void columnStatus ( com.google.gwtexpui.safehtml.client.SafeHtmlBuilder sb , com.google.gerrit.client.diff.FileInfo info ) { sb.openTd ( ) . setStyleName ( com.google.gerrit.client.change.FileTable.R.css ( ) . status ( ) ) ; if ( ! ( Patch.COMMIT_MSG.equals ( info.path ( ) ) ) ) { sb.append ( info.status ( ) ) ; } sb.closeTd ( ) ; }

Target:
private void columnStatus ( com.google.gwtexpui.safehtml.client.SafeHtmlBuilder sb , com.google.gerrit.client.diff.FileInfo info ) { sb.openTd ( ) . setStyleName ( com.google.gerrit.client.change.FileTable.R.css ( ) . status ( ) ) ; if ( ( ( ! ( Patch.COMMIT_MSG.equals ( info.path ( ) ) ) ) && ( ( info.status ( ) ) != null ) ) && ( ! ( ChangeType.MODIFIED.matches ( info.status ( ) ) ) ) ) { sb.append ( info.status ( ) ) ; } sb.closeTd ( ) ; }
Source:
public void testUsernamePatternWithRegex ( ) { grant ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.project.Util.DEVS , "^refs/sb/${username}/heads/.*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , "d.v" , com.google.gerrit.server.project.Util.DEVS ) ; com.google.gerrit.server.project.ProjectControl d = util.user ( local , "dev" , com.google.gerrit.server.project.Util.DEVS ) ; assertFalse ( "u can't read" , u.controlForRef ( "refs/sb/dev/heads/foobar" ) . isVisible ( ) ) ; assertTrue ( "d can read" , d.controlForRef ( "refs/sb/dev/heads/foobar" ) . isVisible ( ) ) ; }

Target:
public void testUsernamePatternNonRegex ( ) { com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.project.Util.DEVS , "refs/sb/${username}/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , "u" , com.google.gerrit.server.project.Util.DEVS ) ; com.google.gerrit.server.project.ProjectControl d = util.user ( local , "d" , com.google.gerrit.server.project.Util.DEVS ) ; assertFalse ( "u can't read" , u.controlForRef ( "refs/sb/d/heads/foobar" ) . isVisible ( ) ) ; assertTrue ( "d can read" , d.controlForRef ( "refs/sb/d/heads/foobar" ) . isVisible ( ) ) ; }
Source:
public void queryChangesLimit ( ) throws java.lang.Exception { createChange ( ) ; com.google.gerrit.acceptance.PushOneCommit.Result r2 = createChange ( ) ; java.util.List < com.google.gerrit.extensions.common.ChangeInfo > results = gApi.changes ( ) . query ( ) . withLimit ( 1 ) . get ( ) ; org.junit.Assert.assertEquals ( 1 , results.size ( ) ) ; org.junit.Assert.assertEquals ( r2.getChangeId ( ) , com.google.common.collect.Iterables.getOnlyElement ( results ) . changeId ) ; }

Target:
public void queryChangesMultipleTerms ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r1 = createChange ( ) ; createChange ( ) ; java.util.List < com.google.gerrit.extensions.common.ChangeInfo > results = query ( ( "status:open " + ( r1.getChangeId ( ) ) ) ) ; com.google.common.truth.Truth.assertThat ( com.google.common.collect.Iterables.getOnlyElement ( results ) . changeId ) . isEqualTo ( r1.getChangeId ( ) ) ; }
Source:
public final boolean hasField ( com.google.gerrit.server.index.FieldDef < T , ? > field ) { com.google.gerrit.server.index.FieldDef < T , ? > f = fields.get ( field.getName ( ) ) ; if ( f == null ) { return false ; } com.google.gerrit.server.index.Schema.checkSame ( f , field ) ; return true ; }

Target:
public final boolean hasField ( com.google.gerrit.index.FieldDef < T , ? > field ) { com.google.gerrit.index.FieldDef < T , ? > f = fields.get ( field.getName ( ) ) ; if ( f == null ) { return false ; } com.google.gerrit.index.Schema.checkSame ( f , field ) ; return true ; }
Source:
public java.util.Set < com.google.gerrit.common.data.GroupReference > getAllGroups ( ) { final java.util.Set < com.google.gerrit.common.data.GroupReference > all = new java.util.HashSet < com.google.gerrit.common.data.GroupReference > ( ) ; for ( final com.google.gerrit.server.project.SectionMatcher matcher : access ( ) ) { final com.google.gerrit.common.data.AccessSection section = matcher.section ; for ( final com.google.gerrit.common.data.Permission permission : section.getPermissions ( ) ) { for ( final com.google.gerrit.common.data.PermissionRule rule : permission.getRules ( ) ) { all.add ( rule.getGroup ( ) ) ; } } } return all ; }

Target:
private static java.util.Set < com.google.gerrit.common.data.GroupReference > getGroups ( final java.util.List < com.google.gerrit.server.project.SectionMatcher > sectionMatcherList ) { final java.util.Set < com.google.gerrit.common.data.GroupReference > all = new java.util.HashSet < com.google.gerrit.common.data.GroupReference > ( ) ; for ( final com.google.gerrit.server.project.SectionMatcher matcher : sectionMatcherList ) { final com.google.gerrit.common.data.AccessSection section = matcher.section ; for ( final com.google.gerrit.common.data.Permission permission : section.getPermissions ( ) ) { for ( final com.google.gerrit.common.data.PermissionRule rule : permission.getRules ( ) ) { all.add ( rule.getGroup ( ) ) ; } } } return all ; }
Source:
private void toggleEnabledStatus ( boolean on ) { on &= enableSmallFileFeatures ; syntaxHighlighting.setEnabled ( on ) ; showFullFile.setEnabled ( on ) ; final java.lang.String title = ( enableSmallFileFeatures ) ? null : PatchUtil.C.disabledOnLargeFiles ( ) ; syntaxHighlighting.setTitle ( title ) ; showFullFile.setTitle ( title ) ; }

Target:
private void toggleEnabledStatus ( final boolean on ) { intralineDifference.setEnabled ( ( on & ( enableIntralineDifference ) ) ) ; syntaxHighlighting.setEnabled ( ( on & ( enableSmallFileFeatures ) ) ) ; showFullFile.setEnabled ( ( on & ( enableSmallFileFeatures ) ) ) ; final java.lang.String title = ( enableSmallFileFeatures ) ? null : PatchUtil.C.disabledOnLargeFiles ( ) ; syntaxHighlighting.setTitle ( title ) ; showFullFile.setTitle ( title ) ; }
Source:
private void testPushWithInvalidChangeIdFromEgit ( ) throws java.lang.Exception { com.google.gerrit.acceptance.git.AbstractPushForReview.createCommit ( testRepo , ( "Message with invalid Change-Id\n" + ( "\n" + "Change-Id: I0000000000000000000000000000000000000000\n" ) ) ) ; com.google.gerrit.acceptance.git.AbstractPushForReview.pushForReviewRejected ( testRepo , "invalid Change-Id line format in commit message footer" ) ; HEAD ( 1.0 ) ; com.google.gerrit.acceptance.git.afa6 Merge ; into ( ( ( stable ) - 2.14 ) ) ; com.google.gerrit.server.git.ProjectConfig config = projectCache.checkedGet ( project ) . getConfig ( ) ; config.getProject ( ) . setRequireChangeID ( InheritableBoolean.FALSE ) ; saveProjectConfig ( project , config ) ; com.google.gerrit.acceptance.git.AbstractPushForReview.pushForReviewRejected ( testRepo , "invalid Change-Id line format in commit message footer" ) ; }

Target:
private void testPushWithInvalidChangeIdFromEgit ( ) throws java.lang.Exception { com.google.gerrit.acceptance.git.AbstractPushForReview.createCommit ( testRepo , ( "Message with invalid Change-Id\n" + ( "\n" + "Change-Id: I0000000000000000000000000000000000000000\n" ) ) ) ; com.google.gerrit.acceptance.git.AbstractPushForReview.pushForReviewRejected ( testRepo , "invalid Change-Id line format in commit message footer" ) ; setRequireChangeId ( InheritableBoolean.FALSE ) ; com.google.gerrit.acceptance.git.AbstractPushForReview.pushForReviewRejected ( testRepo , "invalid Change-Id line format in commit message footer" ) ; }
Source:
public void parseRefName ( ) { com.google.gerrit.reviewdb.client.AccountTest.assertRef ( 1 , "refs/users/01/1" ) ; com.google.gerrit.reviewdb.client.AccountTest.assertRef ( 1 , "refs/users/01/1-drafts" ) ; com.google.gerrit.reviewdb.client.AccountTest.assertRef ( 1 , "refs/users/01/1-drafts/2" ) ; com.google.gerrit.reviewdb.client.AccountTest.assertNotRef ( null ) ; com.google.gerrit.reviewdb.client.AccountTest.assertNotRef ( "" ) ; com.google.gerrit.reviewdb.client.AccountTest.assertNotRef ( "refs/users/01a/1" ) ; com.google.gerrit.reviewdb.client.AccountTest.assertNotRef ( "refs/users/01/a1" ) ; com.google.gerrit.reviewdb.client.AccountTest.assertNotRef ( "refs/users/01/23" ) ; com.google.gerrit.reviewdb.client.AccountTest.assertNotRef ( "refs/users/1/1" ) ; }

Target:
public void parseRefName ( ) { com.google.gerrit.reviewdb.client.AccountTest.assertRef ( 1 , "refs/users/01/1" ) ; com.google.gerrit.reviewdb.client.AccountTest.assertRef ( 1 , "refs/users/01/1-drafts" ) ; com.google.gerrit.reviewdb.client.AccountTest.assertRef ( 1 , "refs/users/01/1-drafts/2" ) ; com.google.gerrit.reviewdb.client.AccountTest.assertRef ( 1 , "refs/users/01/1/edit/2" ) ; com.google.gerrit.reviewdb.client.AccountTest.assertNotRef ( null ) ; com.google.gerrit.reviewdb.client.AccountTest.assertNotRef ( "" ) ; com.google.gerrit.reviewdb.client.AccountTest.assertNotRef ( "refs/users/01a/1" ) ; com.google.gerrit.reviewdb.client.AccountTest.assertNotRef ( "refs/users/01/a1" ) ; com.google.gerrit.reviewdb.client.AccountTest.assertNotRef ( "refs/users/01/23" ) ; com.google.gerrit.reviewdb.client.AccountTest.assertNotRef ( "refs/users/1/1" ) ; }