auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void setNavigationOnClickListener ( @ android.support.annotation.IdRes int id , final com.google.reviewit.app.Change change , final java.lang.String path , final java.util.Map < java.lang.String , com.google.gerrit.extensions.common.FileInfo > files ) { v ( id ) . setOnClickListener ( new android.view.View.OnClickListener ( ) { @ java.lang.Override public void onClick ( android.view.View v ) { removeDiffView ( ) ; createDiffView ( ) ; init ( path , change , files ) ; displayFile ( change , path , files.get ( path ) ) ; } } ) ; }

Target:
private void setNavigationOnClickListener ( @ android.support.annotation.IdRes int id , final com.google.reviewit.app.Change change , final java.lang.String path , final int fileNumber , final java.util.Map < java.lang.String , com.google.gerrit.extensions.common.FileInfo > files ) { v ( id ) . setOnClickListener ( new android.view.View.OnClickListener ( ) { @ java.lang.Override public void onClick ( android.view.View v ) { removeDiffView ( ) ; createDiffView ( ) ; init ( path , change , files ) ; displayFile ( change , path , files.get ( path ) , fileNumber , files.size ( ) ) ; } } ) ; }
Source:
static com.google.gson.JsonArray newJsonArrayFromStrings ( java.util.Collection < java.lang.String > names ) { com.google.gson.JsonArray result = new com.google.gson.JsonArray ( ) ; java.util.List < java.lang.String > list = new java.util.ArrayList < java.lang.String > ( names ) ; java.util.Collections.sort ( list ) ; for ( java.lang.String name : list ) { result.add ( name ) ; } return result ; }

Target:
static java.util.SortedMap < java.lang.String , java.lang.String > makeSortedMap ( java.util.Map < java.lang.String , java.util.Set < java.lang.String > > map ) { java.util.SortedMap < java.lang.String , java.lang.String > result = new java.util.TreeMap < > ( ) ; for ( java.lang.String key : com.google.common.collect.Ordering.natural ( ) . sortedCopy ( map.keySet ( ) ) ) { result.put ( key , java.lang.String.join ( " " , com.google.common.collect.Ordering.natural ( ) . sortedCopy ( map.get ( key ) ) ) ) ; } return result ; }
Source:
public void setUp ( ) throws java.lang.Exception { testRepo = new org.eclipse.jgit.junit.TestRepository ( ( ( org.eclipse.jgit.internal.storage.dfs.InMemoryRepository ) ( repoManager.openRepository ( project ) ) ) ) ; tip = testRepo.getRevWalk ( ) . parseCommit ( testRepo.getRepository ( ) . getRef ( "HEAD" ) . getObjectId ( ) ) ; adminId = admin.getId ( ) ; checker = checkerProvider.get ( ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { testRepo = new org.eclipse.jgit.junit.TestRepository ( ( ( org.eclipse.jgit.internal.storage.dfs.InMemoryRepository ) ( repoManager.openRepository ( project ) ) ) ) ; tip = testRepo.getRevWalk ( ) . parseCommit ( testRepo.getRepository ( ) . exactRef ( "HEAD" ) . getObjectId ( ) ) ; adminId = admin.getId ( ) ; checker = checkerProvider.get ( ) ; }
Source:
public void testGc ( ) throws java.lang.Exception { java.lang.String response = adminSshSession.exec ( ( ( ( ( "gerrit gc \"" + ( project.get ( ) ) ) + "\" \"" ) + ( project2.get ( ) ) ) + "\"" ) ) ; com.google.common.truth.Truth.assert_ ( ) . withMessage ( adminSshSession.getError ( ) ) . that ( adminSshSession.hasError ( ) ) . isFalse ( ) ; assertNoError ( response ) ; gcAssert.assertHasPackFile ( project , project2 ) ; gcAssert.assertHasNoPackFile ( allProjects , project3 ) ; }

Target:
public void testGc ( ) throws java.lang.Exception { java.lang.String response = adminSshSession.exec ( ( ( ( ( "gerrit gc \"" + ( project.get ( ) ) ) + "\" \"" ) + ( project2.get ( ) ) ) + "\"" ) ) ; com.google.common.truth.Truth.assertWithMessage ( adminSshSession.getError ( ) ) . that ( adminSshSession.hasError ( ) ) . isFalse ( ) ; assertNoError ( response ) ; gcAssert.assertHasPackFile ( project , project2 ) ; gcAssert.assertHasNoPackFile ( allProjects , project3 ) ; }
Source:
public static java.util.Set < java.lang.String > getEmails ( java.util.Collection < com.google.gerrit.reviewdb.client.AccountExternalId > ids ) { java.util.Set < java.lang.String > emails = new java.util.HashSet < > ( ) ; for ( com.google.gerrit.reviewdb.client.AccountExternalId id : ids ) { if ( id.isScheme ( com.google.gerrit.reviewdb.client.AccountExternalId.SCHEME_MAILTO ) ) { emails.add ( id.getSchemeRest ( ) ) ; } } return emails ; }

Target:
public static java.util.Set < java.lang.String > getEmails ( java.util.Collection < com.google.gerrit.server.account.ExternalId > ids ) { java.util.Set < java.lang.String > emails = new java.util.HashSet < > ( ) ; for ( com.google.gerrit.server.account.ExternalId extId : ids ) { if ( extId.isScheme ( com.google.gerrit.server.account.ExternalId.SCHEME_MAILTO ) ) { emails.add ( extId.key ( ) . id ( ) ) ; } } return emails ; }
Source:
private void updateGerritConfig ( com.google.gerrit.server.config.SitePaths sitePaths , java.lang.String newSecureStore ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { com.google.gerrit.pgm.SwitchSecureStore.log.info ( "Set gerrit.secureStoreClass property of gerrit.config to {}" , newSecureStore ) ; org.eclipse.jgit.storage.file.FileBasedConfig config = new org.eclipse.jgit.storage.file.FileBasedConfig ( sitePaths.gerrit_config , org.eclipse.jgit.util.FS.DETECTED ) ; config.load ( ) ; config.setString ( "gerrit" , null , "secureStoreClass" , newSecureStore ) ; config.save ( ) ; }

Target:
private void updateGerritConfig ( com.google.gerrit.server.config.SitePaths sitePaths , java.lang.String newSecureStore ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { com.google.gerrit.pgm.SwitchSecureStore.log.info ( "Set gerrit.secureStoreClass property of gerrit.config to {}" , newSecureStore ) ; org.eclipse.jgit.storage.file.FileBasedConfig config = new org.eclipse.jgit.storage.file.FileBasedConfig ( sitePaths.gerrit_config.toFile ( ) , org.eclipse.jgit.util.FS.DETECTED ) ; config.load ( ) ; config.setString ( "gerrit" , null , "secureStoreClass" , newSecureStore ) ; config.save ( ) ; }
Source:
protected java.util.List < com.google.gerrit.reviewdb.client.RobotComment > parse ( byte [ ] raw , int offset ) throws java.io.IOException { try ( java.io.InputStream is = new java.io.ByteArrayInputStream ( raw , offset , ( ( raw.length ) - offset ) ) ; java.io.Reader r = new java.io.InputStreamReader ( is ) ) { return noteUtil.getGson ( ) . fromJson ( r , com.google.gerrit.server.notedb.RobotCommentsRevisionNoteData.class ) . comments ; } }

Target:
protected java.util.List < com.google.gerrit.reviewdb.client.RobotComment > parse ( byte [ ] raw , int offset ) throws java.io.IOException { try ( java.io.InputStream is = new java.io.ByteArrayInputStream ( raw , offset , ( ( raw.length ) - offset ) ) ; java.io.Reader r = new java.io.InputStreamReader ( is , java.nio.charset.StandardCharsets.UTF_8 ) ) { return noteUtil.getGson ( ) . fromJson ( r , com.google.gerrit.server.notedb.RobotCommentsRevisionNoteData.class ) . comments ; } }
Source:
public void fire ( com.google.gerrit.reviewdb.client.Project.NameKey project , org.eclipse.jgit.lib.BatchRefUpdate batchRefUpdate ) { for ( org.eclipse.jgit.transport.ReceiveCommand cmd : batchRefUpdate.getCommands ( ) ) { if ( ( cmd.getResult ( ) ) == ( ReceiveCommand.Result.OK ) ) { fire ( project , cmd ) ; } } }

Target:
public void fire ( com.google.gerrit.reviewdb.client.Project.NameKey project , org.eclipse.jgit.lib.BatchRefUpdate batchRefUpdate , com.google.gerrit.reviewdb.client.Account.Id updater ) { for ( org.eclipse.jgit.transport.ReceiveCommand cmd : batchRefUpdate.getCommands ( ) ) { if ( ( cmd.getResult ( ) ) == ( ReceiveCommand.Result.OK ) ) { fire ( project , cmd , util.accountInfo ( updater ) ) ; } } }
Source:
public static void prev ( java.lang.String query , int limit , java.lang.String sortkey , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.changes.ChangeList > callback ) { com.google.gerrit.client.rpc.RestApi call = com.google.gerrit.client.changes.ChangeList.newQuery ( query ) ; if ( limit > 0 ) { call.addParameter ( "n" , limit ) ; } com.google.gerrit.client.changes.ChangeList.addOptions ( call , java.util.EnumSet.of ( ListChangesOption.LABELS ) ) ; if ( ! ( PagedSingleListScreen.MIN_SORTKEY.equals ( sortkey ) ) ) { call.addParameter ( "P" , sortkey ) ; } call.get ( callback ) ; }

Target:
public static void next ( java.lang.String query , int start , int limit , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.changes.ChangeList > callback ) { com.google.gerrit.client.rpc.RestApi call = com.google.gerrit.client.changes.ChangeList.newQuery ( query ) ; if ( limit > 0 ) { call.addParameter ( "n" , limit ) ; } com.google.gerrit.client.changes.ChangeList.addOptions ( call , java.util.EnumSet.of ( ListChangesOption.LABELS ) ) ; if ( start != 0 ) { call.addParameter ( "S" , start ) ; } call.get ( callback ) ; }
Source:
protected void configure ( ) { bind ( com.codahale.metrics.MetricRegistry.class ) . in ( Scopes.SINGLETON ) ; bind ( com.google.gerrit.metrics.dropwizard.DropWizardMetricMaker.class ) . in ( Scopes.SINGLETON ) ; bind ( com.google.gerrit.metrics.MetricMaker.class ) . to ( com.google.gerrit.metrics.dropwizard.DropWizardMetricMaker.class ) ; com.google.gerrit.extensions.registration.DynamicMap.mapOf ( binder ( ) , com.google.gerrit.metrics.dropwizard.MetricResource.METRIC_KIND ) ; child ( com.google.gerrit.server.config.ConfigResource.CONFIG_KIND , "metrics" ) . to ( com.google.gerrit.metrics.dropwizard.MetricsCollection.class ) ; get ( com.google.gerrit.metrics.dropwizard.MetricResource.METRIC_KIND ) . to ( com.google.gerrit.metrics.dropwizard.GetMetric.class ) ; }

Target:
protected void configure ( ) { bind ( com.codahale.metrics.MetricRegistry.class ) . in ( Scopes.SINGLETON ) ; bind ( com.google.gerrit.metrics.dropwizard.DropWizardMetricMaker.class ) . in ( Scopes.SINGLETON ) ; bind ( com.google.gerrit.metrics.MetricMaker.class ) . to ( com.google.gerrit.metrics.dropwizard.DropWizardMetricMaker.class ) ; install ( new com.google.gerrit.metrics.proc.ProcMetricModule ( ) ) ; install ( new com.google.gerrit.metrics.proc.JGitMetricModule ( ) ) ; com.google.gerrit.extensions.registration.DynamicMap.mapOf ( binder ( ) , com.google.gerrit.metrics.dropwizard.MetricResource.METRIC_KIND ) ; child ( com.google.gerrit.server.config.ConfigResource.CONFIG_KIND , "metrics" ) . to ( com.google.gerrit.metrics.dropwizard.MetricsCollection.class ) ; get ( com.google.gerrit.metrics.dropwizard.MetricResource.METRIC_KIND ) . to ( com.google.gerrit.metrics.dropwizard.GetMetric.class ) ; }
Source:
public boolean isLoggedIn ( ) { boolean loggedIn = ( ( token ) != null ) && ( ( hub ) != null ) ; if ( loggedIn && ( ( myself ) == null ) ) { try { myself = hub.getMyself ( ) ; } catch ( java.lang.Throwable e ) { com.googlesource.gerrit.plugins.github.oauth.GitHubLogin.log.error ( "Connection to GitHub broken: logging out" , e ) ; logout ( ) ; loggedIn = false ; } } return loggedIn ; }

Target:
public boolean isLoggedIn ( ) { boolean loggedIn = ( ( token ) != null ) && ( ( hub ) != null ) ; if ( loggedIn && ( ( myself ) == null ) ) { try { myself = hub.getMyself ( ) ; } catch ( java.lang.Throwable e ) { com.googlesource.gerrit.plugins.github.oauth.GitHubLogin.LOG.error ( "Connection to GitHub broken: logging out" , e ) ; logout ( ) ; loggedIn = false ; } } return loggedIn ; }
Source:
void onCancel ( com.google.gwt.event.dom.client.ClickEvent e ) { setEdit ( false ) ; getCm ( ) . focus ( ) ; }

Target:
void onCancel ( com.google.gwt.event.dom.client.ClickEvent e ) { e.stopPropagation ( ) ; if ( ( ( comment.id ( ) ) == null ) && ( ( editArea.getValue ( ) . length ( ) ) == 0 ) ) { removeUI ( ) ; } else { setEdit ( false ) ; cm.focus ( ) ; } }
Source:
private void setListIdHeader ( ) { final java.lang.StringBuilder listid = new java.lang.StringBuilder ( ) ; listid.append ( "gerrit-" ) ; listid.append ( projectName.replace ( '/' , '-' ) ) ; listid.append ( "@" ) ; listid.append ( getGerritHost ( ) ) ; final java.lang.String listidStr = listid.toString ( ) ; setHeader ( "Mailing-List" , ( "list " + listidStr ) ) ; setHeader ( "List-Id" , ( ( "<" + ( listidStr.replace ( '@' , '.' ) ) ) + ">" ) ) ; if ( ( getSettingsUrl ( ) ) != null ) { setHeader ( "List-Unsubscribe" , ( ( "<" + ( getSettingsUrl ( ) ) ) + ">" ) ) ; } }

Target:
public java.lang.String getChangeMessageThreadId ( ) throws com.google.gerrit.server.mail.EmailException { return velocify ( ( "<gerrit.${change.createdOn.time}.$change.key.get()" + "@$email.gerritHost>" ) ) ; }
Source:
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 ) { } }

Target:
protected void includeWatchers ( com.google.gerrit.reviewdb.client.AccountProjectWatch.NotifyType type ) { try { com.google.gerrit.server.mail.ChangeEmail.Watchers matching = getWatches ( type ) ; add ( RecipientType.TO , matching.to ) ; add ( RecipientType.CC , matching.cc ) ; add ( RecipientType.BCC , matching.bcc ) ; } catch ( com.google.gwtorm.server.OrmException err ) { com.google.gerrit.server.mail.ChangeEmail.log.warn ( ( "Cannot BCC watchers for " + type ) , err ) ; } }
Source:
private void pushTagDeletion ( com.google.gerrit.acceptance.rest.project.PushTagIT.TagType tagType , java.lang.String tagRef , org.eclipse.jgit.transport.RemoteRefUpdate.Status expectedStatus ) throws java.lang.Exception { org.eclipse.jgit.transport.PushResult r = com.google.gerrit.acceptance.GitUtil.deleteRef ( testRepo , tagRef ) ; org.eclipse.jgit.transport.RemoteRefUpdate refUpdate = r.getRemoteUpdate ( tagRef ) ; com.google.common.truth.Truth.assertThat ( refUpdate.getStatus ( ) ) . named ( tagType.name ( ) ) . isEqualTo ( expectedStatus ) ; }

Target:
private void fastForwardTagToNewCommit ( com.google.gerrit.acceptance.rest.project.PushTagIT.TagType tagType , java.lang.String tagName , org.eclipse.jgit.transport.RemoteRefUpdate.Status expectedStatus ) throws java.lang.Exception { pushTag ( tagType , tagName , true , expectedStatus ) ; }
Source:
public com.google.gerrit.solr.SolrChangeIndex getChangeIndex ( @ com.google.gerrit.server.config.GerritServerConfig org.eclipse.jgit.lib.Config cfg , com.google.gerrit.server.config.SitePaths sitePaths , com.google.gerrit.server.index.IndexCollection indexes , com.google.gerrit.server.index.FieldDef.FillArgs fillArgs ) throws java.io.IOException { return new com.google.gerrit.solr.SolrChangeIndex ( cfg , fillArgs , sitePaths , indexes , com.google.gerrit.server.index.ChangeSchemas.getLatest ( ) , base ) ; }

Target:
public com.google.gerrit.solr.SolrChangeIndex getChangeIndex ( @ com.google.gerrit.server.config.GerritServerConfig org.eclipse.jgit.lib.Config cfg , com.google.inject.Provider < com.google.gerrit.reviewdb.server.ReviewDb > db , com.google.gerrit.server.query.change.ChangeData.Factory changeDataFactory , com.google.gerrit.server.config.SitePaths sitePaths , com.google.gerrit.server.index.IndexCollection indexes , com.google.gerrit.server.index.FieldDef.FillArgs fillArgs ) throws java.io.IOException { return new com.google.gerrit.solr.SolrChangeIndex ( cfg , db , changeDataFactory , fillArgs , sitePaths , indexes , com.google.gerrit.server.index.ChangeSchemas.getLatest ( ) , base ) ; }
Source:
public com.google.common.util.concurrent.ListenableFuture < java.lang.Void > apply ( java.util.List < ? > input ) throws java.lang.Exception { com.google.gerrit.server.git.MultiProgressMonitor.Task t = mpm.beginSubTask ( "update refs" , MultiProgressMonitor.UNKNOWN ) ; org.eclipse.jgit.revwalk.RevWalk walk = new org.eclipse.jgit.revwalk.RevWalk ( repo ) ; try { bru.execute ( walk , t ) ; mpm.end ( ) ; return com.google.common.util.concurrent.Futures.immediateFuture ( null ) ; } finally { walk.release ( ) ; } }

Target:
private static void execute ( org.eclipse.jgit.lib.BatchRefUpdate bru , org.eclipse.jgit.lib.Repository repo ) throws java.io.IOException { org.eclipse.jgit.revwalk.RevWalk rw = new org.eclipse.jgit.revwalk.RevWalk ( repo ) ; try { bru.execute ( rw , NullProgressMonitor.INSTANCE ) ; } finally { rw.release ( ) ; } }
Source:
private void replace ( com.google.gerrit.server.git.ProjectConfig config , java.util.Set < java.lang.String > toDelete , com.google.gerrit.common.data.AccessSection section ) throws com.google.gerrit.common.errors.NoSuchGroupException { for ( com.google.gerrit.common.data.Permission permission : section.getPermissions ( ) ) { for ( com.google.gerrit.common.data.PermissionRule rule : permission.getRules ( ) ) { lookupGroup ( rule ) ; } } config.replace ( section ) ; toDelete.remove ( section.getName ( ) ) ; }

Target:
private void replace ( com.google.gerrit.server.project.ProjectConfig config , java.util.Set < java.lang.String > toDelete , com.google.gerrit.common.data.AccessSection section ) throws com.google.gerrit.common.errors.NoSuchGroupException { for ( com.google.gerrit.common.data.Permission permission : section.getPermissions ( ) ) { for ( com.google.gerrit.common.data.PermissionRule rule : permission.getRules ( ) ) { lookupGroup ( rule ) ; } } config.replace ( section ) ; toDelete.remove ( section.getName ( ) ) ; }
Source:
public com.google.gerrit.server.change.ConsistencyChecker.Result check ( com.google.gerrit.reviewdb.client.Change c ) { return check ( c , null ) ; }

Target:
private void checkOwner ( ) { try { if ( ( db.get ( ) . accounts ( ) . get ( change ( ) . getOwner ( ) ) ) == null ) { problem ( ( "Missing change owner: " + ( change ( ) . getOwner ( ) ) ) ) ; } } catch ( com.google.gwtorm.server.OrmException e ) { error ( "Failed to look up owner" , e ) ; } }
Source:
private com.google.gerrit.server.git.BatchUpdate.ChangeContext newChangeContext ( com.google.gerrit.reviewdb.client.Change.Id id ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = newChanges.get ( id ) ; if ( c == null ) { c = com.google.gerrit.server.git.BatchUpdate.unwrap ( db ) . changes ( ) . get ( id ) ; } com.google.gerrit.server.notedb.ChangeNotes notes = changeNotesFactory.createForNew ( c ) ; com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx = new com.google.gerrit.server.git.BatchUpdate.ChangeContext ( changeControlFactory.controlFor ( notes , user ) , new com.google.gerrit.server.git.BatchUpdateReviewDb ( db ) ) ; return ctx ; }

Target:
private com.google.gerrit.server.git.BatchUpdate.ChangeContext newChangeContext ( com.google.gerrit.reviewdb.server.ReviewDb db , org.eclipse.jgit.lib.Repository repo , org.eclipse.jgit.revwalk.RevWalk rw , com.google.gerrit.reviewdb.client.Change.Id id ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = newChanges.get ( id ) ; if ( c == null ) { c = com.google.gerrit.server.git.BatchUpdate.unwrap ( db ) . changes ( ) . get ( id ) ; } com.google.gerrit.server.notedb.ChangeNotes notes = changeNotesFactory.createForNew ( c ) ; com.google.gerrit.server.project.ChangeControl ctl = changeControlFactory.controlFor ( notes , user ) ; return new com.google.gerrit.server.git.BatchUpdate.ChangeContext ( ctl , new com.google.gerrit.server.git.BatchUpdateReviewDb ( db ) , repo , rw ) ; }
Source:
public boolean allRefsAreVisible ( ) { return allRefsAreVisible ( java.util.Collections.< java.lang.String > emptySet ( ) ) ; }

Target:
private boolean can ( com.google.gerrit.server.permissions.ProjectPermission perm ) throws com.google.gerrit.server.permissions.PermissionBackendException { switch ( perm ) { case ACCESS : return ( ( ! ( isHidden ( ) ) ) && ( ( user.isInternalUser ( ) ) || ( canPerformOnAnyRef ( Permission.READ ) ) ) ) || ( isOwner ( ) ) ; case READ : return ( ( ! ( isHidden ( ) ) ) && ( allRefsAreVisible ( java.util.Collections.emptySet ( ) ) ) ) || ( isOwner ( ) ) ; } throw new com.google.gerrit.server.permissions.PermissionBackendException ( ( perm + " unsupported" ) ) ; }
Source:
public synchronized void init ( javax.servlet.ServletConfig config ) throws javax.servlet.ServletException { super . init ( config ) ; java.lang.String path = config.getServletContext ( ) . getContextPath ( ) ; base = ( com.google.common.base.Strings.nullToEmpty ( path ) ) + "/plugins/" ; for ( com.google.gerrit.server.plugins.Plugin plugin : pending ) { install ( plugin ) ; } pending = null ; }

Target:
public synchronized void init ( javax.servlet.ServletConfig config ) throws javax.servlet.ServletException { super . init ( config ) ; java.lang.String path = config.getServletContext ( ) . getContextPath ( ) ; base = ( com.google.common.base.Strings.nullToEmpty ( path ) ) + ( com.google.gerrit.httpd.plugins.HttpPluginServlet.PLUGINS_PREFIX ) ; authorizedBase = ( com.google.common.base.Strings.nullToEmpty ( path ) ) + ( com.google.gerrit.httpd.plugins.HttpPluginServlet.AUTHORIZED_PREFIX ) ; for ( com.google.gerrit.server.plugins.Plugin plugin : pending ) { install ( plugin ) ; } pending = null ; }
Source:
public com.googlecode.prolog_cafe.lang.NumberTerm divide ( com.googlecode.prolog_cafe.lang.NumberTerm t ) { if ( ( t.doubleValue ( ) ) == 0 ) throw new com.googlecode.prolog_cafe.lang.EvaluationException ( "zero_divisor" ) ; return new com.googlecode.prolog_cafe.lang.DoubleTerm ( ( ( this . doubleValue ( ) ) / ( t.doubleValue ( ) ) ) ) ; }

Target:
public com.googlecode.prolog_cafe.lang.NumberTerm divide ( com.googlecode.prolog_cafe.lang.NumberTerm t ) { if ( ( t.doubleValue ( ) ) == 0 ) throw new com.googlecode.prolog_cafe.exceptions.EvaluationException ( "zero_divisor" ) ; return new com.googlecode.prolog_cafe.lang.DoubleTerm ( ( ( this . doubleValue ( ) ) / ( t.doubleValue ( ) ) ) ) ; }
Source:
public boolean isEnabled ( com.google.gerrit.server.change.RevisionResource resource ) { return ( ( resource.getChange ( ) . getStatus ( ) . isOpen ( ) ) && ( resource.getControl ( ) . canRebase ( ) ) ) && ( rebaseChange.get ( ) . canRebase ( resource ) ) ; }

Target:
public UiAction.Description getDescription ( com.google.gerrit.server.change.RevisionResource resource ) { return new com.google.gerrit.extensions.webui.UiAction.Description ( ) . setLabel ( "Rebase" ) . setTitle ( "Rebase onto tip of branch or parent change" ) . setVisible ( ( ( ( resource.getChange ( ) . getStatus ( ) . isOpen ( ) ) && ( resource.getControl ( ) . canRebase ( ) ) ) && ( rebaseChange.get ( ) . canRebase ( resource ) ) ) ) ; }
Source:
protected void configure ( ) { if ( com.google.gerrit.server.util.BouncyCastleUtil.havePGP ( ) ) { com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.server.git.ReceivePackInitializer.class ) . to ( com.google.gerrit.server.git.gpg.SignedPushModule.Initializer.class ) ; } else { com.google.gerrit.server.git.gpg.SignedPushModule.log.info ( ( "BouncyCastle PGP not installed; signed push verification is" + " disabled" ) ) ; } }

Target:
protected void configure ( ) { if ( ! ( com.google.gerrit.server.util.BouncyCastleUtil.havePGP ( ) ) ) { com.google.gerrit.server.git.gpg.SignedPushModule.log.info ( ( "BouncyCastle PGP not installed; signed push verification is" + " disabled" ) ) ; return ; } bind ( com.google.gerrit.server.git.gpg.PublicKeyChecker.class ) . to ( com.google.gerrit.server.git.gpg.GerritPublicKeyChecker.class ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.server.git.ReceivePackInitializer.class ) . to ( com.google.gerrit.server.git.gpg.SignedPushModule.Initializer.class ) ; }
Source:
public static boolean isNoteDbTestEnabled ( ) { final java.lang.String [ ] RUN_FLAGS = new java.lang.String [ ] { "yes" , "y" , "true" } ; java.lang.String value = java.lang.System.getenv ( "GERRIT_ENABLE_NOTEDB" ) ; return ( value != null ) && ( java.util.Arrays.asList ( RUN_FLAGS ) . contains ( value.toLowerCase ( ) ) ) ; }

Target:
public static boolean isNoteDbTestEnabled ( ) { java.util.List < java.lang.String > runValues = com.google.common.collect.ImmutableList.of ( "yes" , "y" , "true" , "1" ) ; java.lang.String value = java.lang.System.getenv ( "GERRIT_ENABLE_NOTEDB" ) ; return ( value != null ) && ( runValues.contains ( value.toLowerCase ( ) ) ) ; }
Source:
public com.google.common.util.concurrent.CheckedFuture < java.lang.Boolean , java.io.IOException > reindexIfStale ( com.google.gerrit.reviewdb.client.AccountGroup.UUID uuid ) { java.util.concurrent.Callable < java.lang.Boolean > task = ( ) -> { if ( stalenessChecker.isStale ( uuid ) ) { index ( uuid ) ; return true ; } return false ; } ; return com.google.common.util.concurrent.Futures.makeChecked ( com.google.common.util.concurrent.Futures.nonCancellationPropagating ( batchExecutor.submit ( task ) ) , IndexUtils.MAPPER ) ; }

Target:
private com.google.common.util.concurrent.CheckedFuture < java.lang.Boolean , java.io.IOException > reindexIfStaleAsync ( com.google.gerrit.reviewdb.client.AccountGroup.UUID uuid ) { return com.google.common.util.concurrent.Futures.makeChecked ( com.google.common.util.concurrent.Futures.nonCancellationPropagating ( batchExecutor.submit ( ( ) -> reindexIfStale ( uuid ) ) ) , IndexUtils.MAPPER ) ; }
Source:
public final boolean hasField ( com.google.gerrit.server.index.FieldDef < T , ? > field ) { return ( fields.get ( field.getName ( ) ) ) == field ; }

Target:
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 ; }
Source:
private java.util.concurrent.Callable < com.google.gerrit.httpd.raw.ResourceServlet.Resource > newLoader ( final java.lang.String name , final java.nio.file.Path p ) { return new java.util.concurrent.Callable < com.google.gerrit.httpd.raw.ResourceServlet.Resource > ( ) { @ java.lang.Override public com.google.gerrit.httpd.raw.ResourceServlet.Resource call ( ) throws java.io.IOException { return new com.google.gerrit.httpd.raw.ResourceServlet.Resource ( java.nio.file.Files.getLastModifiedTime ( p ) , com.google.gerrit.httpd.raw.ResourceServlet.contentType ( name ) , java.nio.file.Files.readAllBytes ( p ) ) ; } } ; }

Target:
private java.util.concurrent.Callable < com.google.gerrit.httpd.raw.ResourceServlet.Resource > newLoader ( final java.nio.file.Path p ) { return new java.util.concurrent.Callable < com.google.gerrit.httpd.raw.ResourceServlet.Resource > ( ) { @ java.lang.Override public com.google.gerrit.httpd.raw.ResourceServlet.Resource call ( ) throws java.io.IOException { try { return new com.google.gerrit.httpd.raw.ResourceServlet.Resource ( java.nio.file.Files.getLastModifiedTime ( p ) , com.google.gerrit.httpd.raw.ResourceServlet.contentType ( p.toString ( ) ) , java.nio.file.Files.readAllBytes ( p ) ) ; } catch ( java.nio.file.NoSuchFileException e ) { return com.google.gerrit.httpd.raw.ResourceServlet.Resource.NOT_FOUND ; } } } ; }
Source:
public void missingRepo ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = com.google.gerrit.testutil.TestChanges.newChange ( new com.google.gerrit.reviewdb.client.Project.NameKey ( "otherproject" ) , userId ) ; db.changes ( ) . insert ( java.util.Collections.singleton ( c ) ) ; com.google.gerrit.reviewdb.client.PatchSet ps = com.google.gerrit.testutil.TestChanges.newPatchSet ( c.currentPatchSetId ( ) , org.eclipse.jgit.lib.ObjectId.fromString ( "deadbeefdeadbeefdeadbeefdeadbeefdeadbeef" ) , userId ) ; db.patchSets ( ) . insert ( java.util.Collections.singleton ( ps ) ) ; assertProblems ( c , "Destination repository not found: otherproject" ) ; }

Target:
public void missingRepo ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = com.google.gerrit.testutil.TestChanges.newChange ( new com.google.gerrit.reviewdb.client.Project.NameKey ( "otherproject" ) , userId ) ; db.changes ( ) . insert ( java.util.Collections.singleton ( c ) ) ; insertMissingPatchSet ( c , "deadbeefdeadbeefdeadbeefdeadbeefdeadbeef" ) ; assertProblems ( c , "Destination repository not found: otherproject" ) ; }
Source:
private void group ( java.lang.String name ) throws java.io.IOException { adminSession.put ( ( "/groups/" + name ) , new java.lang.Object ( ) ) . consume ( ) ; }

Target:
private com.google.gerrit.reviewdb.client.AccountGroup group ( java.lang.String name ) throws java.lang.Exception { com.google.gerrit.server.account.CreateGroupArgs args = new com.google.gerrit.server.account.CreateGroupArgs ( ) ; args.setGroupName ( name ) ; args.initialMembers = java.util.Collections.singleton ( admin.getId ( ) ) ; return createGroupFactory.create ( args ) . createGroup ( ) ; }
Source:
java.lang.Iterable < com.google.gerrit.reviewdb.client.PatchSetApproval > getForPatchSet ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.project.ChangeControl ctl , com.google.gerrit.reviewdb.client.PatchSet.Id psId ) throws com.google.gwtorm.server.OrmException { return getForPatchSet ( db , ctl , db.patchSets ( ) . get ( psId ) ) ; }

Target:
java.lang.Iterable < com.google.gerrit.reviewdb.client.PatchSetApproval > getForPatchSet ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.project.ChangeControl ctl , com.google.gerrit.reviewdb.client.PatchSet.Id psId ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.PatchSet ps = db.patchSets ( ) . get ( psId ) ; if ( ps == null ) { return java.util.Collections.emptyList ( ) ; } return getForPatchSet ( db , ctl , ps ) ; }
Source:
private void checkMergeResult ( com.google.gerrit.extensions.common.ChangeInfo change ) throws java.lang.Exception { com.google.gerrit.extensions.api.projects.BranchInfo branch = gApi.projects ( ) . name ( change.project ) . branch ( change.branch ) . get ( ) ; com.google.gerrit.server.events.ChangeMergedEvent event = eventRecorder.getOneChangeMerged ( change.project , change.branch , java.lang.Integer.toString ( change._number ) ) ; com.google.common.truth.Truth.assertThat ( event.newRev ) . isNotNull ( ) ; com.google.common.truth.Truth.assertThat ( branch.revision ) . isEqualTo ( event.newRev ) ; }

Target:
protected void assertChangeMergedEvents ( java.lang.String ... expected ) throws java.lang.Exception { eventRecorder.assertChangeMergedEvents ( project.get ( ) , "refs/heads/master" , expected ) ; }
Source:
public static java.lang.String toChange ( com.google.gerrit.reviewdb.client.Change.Id c , java.lang.String b , java.lang.String p ) { java.lang.String u = ( "/c/" + c ) + "/" ; if ( b != null ) { u += b + ".." ; } u += p ; return u ; }

Target:
public static java.lang.String toChange ( @ com.google.gerrit.common.Nullable com.google.gerrit.reviewdb.client.Project.NameKey project , com.google.gerrit.reviewdb.client.Change.Id c , java.lang.String b , java.lang.String p ) { java.lang.String u = com.google.gerrit.common.PageLinks.toChange ( project , c ) ; if ( b != null ) { u += b + ".." ; } u += p ; return u ; }
Source:
private boolean visibleEdit ( java.lang.String name ) { if ( ( ( userEditPrefix ) != null ) && ( name.startsWith ( userEditPrefix ) ) ) { com.google.gerrit.reviewdb.client.Change.Id id = Change.Id.fromEditRefPart ( name ) ; if ( id != null ) { return visible ( id ) ; } } return false ; }

Target:
private boolean visibleEdit ( java.lang.String name ) { com.google.gerrit.reviewdb.client.Change.Id id = Change.Id.fromEditRefPart ( name ) ; if ( ( visibleChanges ) == null ) { visible ( id ) ; } if ( id != null ) { return ( ( ( ( userEditPrefix ) != null ) && ( name.startsWith ( userEditPrefix ) ) ) && ( visible ( id ) ) ) || ( projectCtl.controlForRef ( visibleChanges.get ( id ) ) . isEditVisible ( ) ) ; } return false ; }
Source:
private com.google.inject.Injector createSshInjector ( ) { final java.util.List < com.google.inject.Module > modules = new java.util.ArrayList < com.google.inject.Module > ( ) ; modules.add ( new com.google.gerrit.sshd.SshModule ( ) ) ; modules.add ( new com.google.gerrit.sshd.commands.MasterCommandModule ( ) ) ; modules.add ( cfgInjector.getInstance ( com.google.gerrit.sshd.commands.MasterPluginsModule.class ) ) ; 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 > ( ) ; modules.add ( sysInjector.getInstance ( com.google.gerrit.sshd.SshModule.class ) ) ; modules.add ( new com.google.gerrit.sshd.commands.MasterCommandModule ( ) ) ; return sysInjector.createChildInjector ( modules ) ; }
Source:
protected void onLoad ( ) { super . onLoad ( ) ; com.google.gerrit.client.rpc.CallbackGroup cbs = new com.google.gerrit.client.rpc.CallbackGroup ( ) ; Util.DETAIL_SVC.patchSetPublishDetail ( patchSetId , cbs.addGwtjsonrpc ( new com.google.gerrit.client.rpc.ScreenLoadCallback < com.google.gerrit.common.data.PatchSetPublishDetail > ( this ) { @ java.lang.Override protected void preDisplay ( final com.google.gerrit.common.data.PatchSetPublishDetail result ) { send.setEnabled ( true ) ; display ( result ) ; } @ java.lang.Override protected void postDisplay ( ) { message.setFocus ( true ) ; } } ) ) ; }

Target:
public void onFailure ( java.lang.Throwable caught ) { }
Source:
public void fire ( com.google.gerrit.extensions.common.ChangeInfo change , com.google.gerrit.extensions.common.RevisionInfo revision , com.google.gerrit.extensions.common.AccountInfo reviewer , com.google.gerrit.extensions.common.AccountInfo adder , java.sql.Timestamp when ) { if ( ! ( listeners.iterator ( ) . hasNext ( ) ) ) { return ; } com.google.gerrit.server.extensions.events.ReviewerAdded.Event event = new com.google.gerrit.server.extensions.events.ReviewerAdded.Event ( change , revision , reviewer , adder , when ) ; for ( com.google.gerrit.extensions.events.ReviewerAddedListener l : listeners ) { try { l.onReviewerAdded ( event ) ; } catch ( java.lang.Exception e ) { com.google.gerrit.server.extensions.events.ReviewerAdded.log.warn ( "Error in event listener, e" ) ; } } }

Target:
public void fire ( com.google.gerrit.extensions.common.ChangeInfo change , com.google.gerrit.extensions.common.RevisionInfo revision , java.util.List < com.google.gerrit.extensions.common.AccountInfo > reviewers , com.google.gerrit.extensions.common.AccountInfo adder , java.sql.Timestamp when ) { if ( ! ( listeners.iterator ( ) . hasNext ( ) ) ) { return ; } com.google.gerrit.server.extensions.events.ReviewerAdded.Event event = new com.google.gerrit.server.extensions.events.ReviewerAdded.Event ( change , revision , reviewers , adder , when ) ; for ( com.google.gerrit.extensions.events.ReviewerAddedListener l : listeners ) { try { l.onReviewersAdded ( event ) ; } catch ( java.lang.Exception e ) { com.google.gerrit.server.extensions.events.ReviewerAdded.log.warn ( "Error in event listener, e" ) ; } } }
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 ) ; 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 int getTimezone ( long when ) { return defaultReader.getTimezone ( when ) ; }
Source:
public final java.sql.Timestamp updated ( ) { java.lang.String updatedRaw = updatedRaw ( ) ; return updatedRaw == null ? null : com.google.gwtjsonrpc.client.impl.ser.JavaSqlTimestamp_JsonSerializer.parseTimestamp ( updatedRaw ( ) ) ; }

Target:
public final java.sql.Timestamp updated ( ) { java.sql.Timestamp r = updatedTimestamp ( ) ; if ( r == null ) { java.lang.String s = updatedRaw ( ) ; if ( s != null ) { r = com.google.gwtjsonrpc.client.impl.ser.JavaSqlTimestamp_JsonSerializer.parseTimestamp ( s ) ; updatedTimestamp ( r ) ; } } return r ; }
Source:
public int run ( ) throws java.lang.Exception { final com.google.inject.Injector injector = com.google.inject.Guice.createInjector ( com.google.inject.Stage.PRODUCTION , new com.google.gerrit.server.config.GerritServerModule ( ) , new com.google.gerrit.server.ssh.SshDaemonModule ( ) ) ; com.google.gerrit.client.rpc.Common.setGerritConfig ( injector.getInstance ( com.google.gerrit.client.data.GerritConfig.class ) ) ; injector.getInstance ( com.google.gerrit.server.ssh.GerritSshDaemon.class ) . start ( ) ; return never ( ) ; }

Target:
protected void configure ( ) { bind ( com.google.gerrit.client.data.GerritConfig.class ) . toProvider ( com.google.gerrit.server.config.GerritConfigProvider.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; }
Source:
public void testOwnerProject ( ) { com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.OWNER , com.google.gerrit.server.project.Util.ADMIN , "refs/*" ) ; com.google.gerrit.server.project.ProjectControl uBlah = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; com.google.gerrit.server.project.ProjectControl uAdmin = util.user ( local , com.google.gerrit.server.project.Util.DEVS , com.google.gerrit.server.project.Util.ADMIN ) ; org.junit.Assert.assertFalse ( "not owner" , uBlah.isOwner ( ) ) ; org.junit.Assert.assertTrue ( "is owner" , uAdmin.isOwner ( ) ) ; }

Target:
public void testOwnerProject ( ) { com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.OWNER , com.google.gerrit.server.project.Util.ADMIN , "refs/*" ) ; assertAdminsAreOwnersAndDevsAreNot ( ) ; }
Source:
protected void configure ( ) { bind ( com.google.gerrit.server.index.account.AccountIndexRewriter.class ) ; bind ( com.google.gerrit.server.index.account.AccountIndexCollection.class ) ; listener ( ) . to ( com.google.gerrit.server.index.account.AccountIndexCollection.class ) ; factory ( AccountIndexerImpl.Factory.class ) ; bind ( com.google.gerrit.server.index.change.ChangeIndexRewriter.class ) ; bind ( com.google.gerrit.server.index.change.ChangeIndexCollection.class ) ; listener ( ) . to ( com.google.gerrit.server.index.change.ChangeIndexCollection.class ) ; factory ( ChangeIndexer.Factory.class ) ; }

Target:
protected void configure ( ) { bind ( com.google.gerrit.server.index.account.AccountIndexRewriter.class ) ; bind ( com.google.gerrit.server.index.account.AccountIndexCollection.class ) ; listener ( ) . to ( com.google.gerrit.server.index.account.AccountIndexCollection.class ) ; factory ( AccountIndexerImpl.Factory.class ) ; bind ( com.google.gerrit.server.index.change.ChangeIndexRewriter.class ) ; bind ( com.google.gerrit.server.index.change.ChangeIndexCollection.class ) ; listener ( ) . to ( com.google.gerrit.server.index.change.ChangeIndexCollection.class ) ; factory ( ChangeIndexer.Factory.class ) ; bind ( com.google.gerrit.server.index.group.GroupIndexCollection.class ) ; listener ( ) . to ( com.google.gerrit.server.index.group.GroupIndexCollection.class ) ; factory ( GroupIndexerImpl.Factory.class ) ; }
Source:
void flush ( ) throws java.io.IOException { flushToFinalInserter ( ) ; finalIns.flush ( ) ; tempIns.clear ( ) ; }

Target:
void flushToFinalInserter ( ) throws java.io.IOException { com.google.common.base.Preconditions.checkState ( ( ( finalIns ) != null ) ) ; for ( com.google.gerrit.server.git.InsertedObject obj : tempIns.getInsertedObjects ( ) ) { finalIns.insert ( obj.type ( ) , obj.data ( ) . toByteArray ( ) ) ; } tempIns.clear ( ) ; }
Source:
public java.lang.String get ( long num ) throws java.io.IOException { if ( ( ( getTail ( ) ) <= num ) && ( num <= ( getHead ( ) ) ) ) { try { return com.googlesource.gerrit.plugins.events.fsstore.Fs.readFile ( paths.event ( num ) ) ; } catch ( java.nio.file.NoSuchFileException e ) { } } return null ; }

Target:
public java.lang.String get ( long num ) throws java.io.IOException { if ( ( ( getTail ( ) ) <= num ) && ( num <= ( getHead ( ) ) ) ) { try { return com.googlesource.gerrit.plugins.events.fsstore.Fs.readFile ( paths.events.path ( num ) ) ; } catch ( java.nio.file.NoSuchFileException e ) { } } return null ; }
Source:
private com.google.gerrit.client.diff.DraftBox addDraftBox ( com.google.gerrit.client.changes.CommentInfo info , boolean doSave ) { net.codemirror.lib.CodeMirror cm = getCmFromSide ( info.side ( ) ) ; com.google.gerrit.client.diff.DraftBox box = new com.google.gerrit.client.diff.DraftBox ( this , cm , revision , info , commentLinkProcessor , true , doSave ) ; addCommentBox ( info , box ) ; if ( ! doSave ) { box.setEdit ( true ) ; } net.codemirror.lib.CodeMirror.LineHandle handle = cm.getLineHandle ( ( ( info.line ( ) ) - 1 ) ) ; lineActiveBoxMap.put ( handle , box ) ; return box ; }

Target:
public void execute ( ) { box.setOpen ( true ) ; box.setEdit ( true ) ; }
Source:
public com.google.gerrit.reviewdb.Change update ( com.google.gerrit.reviewdb.Change change ) { if ( ( ( change.getStatus ( ) ) == ( Change.Status.DRAFT ) ) && ( change.currentPatchSetId ( ) . equals ( patchSetId ) ) ) { change.setStatus ( Change.Status.NEW ) ; com.google.gerrit.server.ChangeUtil.updated ( change ) ; return change ; } else { return null ; } }

Target:
public com.google.gerrit.reviewdb.client.Change update ( com.google.gerrit.reviewdb.client.Change change ) { if ( change.getStatus ( ) . isOpen ( ) ) { change.nextPatchSetId ( ) ; return change ; } else { return null ; } }
Source:
void display ( final java.util.Map < com.google.gerrit.reviewdb.AccountGroup.Id , com.google.gerrit.reviewdb.AccountGroup > groups , final java.util.List < com.google.gerrit.common.data.InheritedRefRight > refRights ) { while ( 1 < ( table.getRowCount ( ) ) ) table.removeRow ( ( ( table.getRowCount ( ) ) - 1 ) ) ; for ( final com.google.gerrit.common.data.InheritedRefRight r : refRights ) { final int row = table.getRowCount ( ) ; table.insertRow ( row ) ; applyDataRowStyle ( row ) ; populate ( row , groups , r ) ; } }

Target:
void display ( final java.util.Map < com.google.gerrit.reviewdb.AccountGroup.Id , com.google.gerrit.reviewdb.AccountGroup > groups , final java.util.List < com.google.gerrit.common.data.InheritedRefRight > refRights ) { canDelete = false ; while ( 1 < ( table.getRowCount ( ) ) ) table.removeRow ( ( ( table.getRowCount ( ) ) - 1 ) ) ; for ( final com.google.gerrit.common.data.InheritedRefRight r : refRights ) { final int row = table.getRowCount ( ) ; table.insertRow ( row ) ; applyDataRowStyle ( row ) ; populate ( row , groups , r ) ; } }
Source:
public static java.lang.String sortKey ( long lastUpdated , int id ) { final long lastUpdatedOn = ( lastUpdated / 1000L ) - ( com.google.gerrit.server.ChangeUtil.SORT_KEY_EPOCH ) ; final java.lang.StringBuilder r = new java.lang.StringBuilder ( 16 ) ; r.setLength ( 16 ) ; com.google.gerrit.server.ChangeUtil.formatHexInt ( r , 0 , ( ( int ) ( lastUpdatedOn / 60 ) ) ) ; com.google.gerrit.server.ChangeUtil.formatHexInt ( r , 8 , id ) ; return r.toString ( ) ; }

Target:
public static java.lang.String sortKey ( long lastUpdatedMs , int id ) { long lastUpdatedMins = java.util.concurrent.TimeUnit.MINUTES.convert ( lastUpdatedMs , java.util.concurrent.TimeUnit.MILLISECONDS ) ; long minsSinceEpoch = lastUpdatedMins - ( com.google.gerrit.server.ChangeUtil.SORT_KEY_EPOCH_MINS ) ; java.lang.StringBuilder r = new java.lang.StringBuilder ( 16 ) ; r.setLength ( 16 ) ; com.google.gerrit.server.ChangeUtil.formatHexInt ( r , 0 , com.google.common.primitives.Ints.checkedCast ( minsSinceEpoch ) ) ; com.google.gerrit.server.ChangeUtil.formatHexInt ( r , 8 , id ) ; return r.toString ( ) ; }
Source:
static java.util.List < java.util.Map < java.lang.String , java.lang.Object > > getTags ( javax.servlet.http.HttpServletRequest req , com.google.gitiles.TimeCache timeCache , org.eclipse.jgit.revwalk.RevWalk walk , int limit ) throws java.io.IOException { return com.google.gitiles.RefServlet.getRefs ( org.eclipse.jgit.http.server.ServletUtils.getRepository ( req ) . getRefDatabase ( ) , com.google.gitiles.ViewFilter.getView ( req ) , Constants.R_TAGS , com.google.gitiles.RefServlet.tagComparator ( timeCache , walk ) , null , limit ) ; }

Target:
static java.util.List < java.util.Map < java.lang.String , java.lang.Object > > getTagsSoyData ( javax.servlet.http.HttpServletRequest req , com.google.gitiles.TimeCache timeCache , org.eclipse.jgit.revwalk.RevWalk walk , int limit ) throws java.io.IOException { return com.google.gitiles.RefServlet.getRefsSoyData ( org.eclipse.jgit.http.server.ServletUtils.getRepository ( req ) . getRefDatabase ( ) , com.google.gitiles.ViewFilter.getView ( req ) , Constants.R_TAGS , com.google.gitiles.RefServlet.tagComparator ( timeCache , walk ) , null , limit ) ; }
Source:
public boolean equals ( java.lang.Object other ) { if ( other instanceof com.google.gerrit.httpd.plugins.ResourceKey ) { com.google.gerrit.httpd.plugins.ResourceKey rk = ( ( com.google.gerrit.httpd.plugins.ResourceKey ) ( other ) ) ; return ( ( plugin ) == ( rk.plugin ) ) && ( resource.equals ( rk.resource ) ) ; } return false ; }

Target:
public boolean equals ( java.lang.Object other ) { if ( other instanceof com.google.gerrit.httpd.plugins.PluginResourceKey ) { com.google.gerrit.httpd.plugins.PluginResourceKey rk = ( ( com.google.gerrit.httpd.plugins.PluginResourceKey ) ( other ) ) ; return ( ( plugin ) == ( rk.plugin ) ) && ( resource.equals ( rk.resource ) ) ; } return false ; }
Source:
protected void configure ( ) { install ( new com.google.inject.assistedinject.FactoryModuleBuilder ( ) . implement ( com.google.gerrit.server.index.change.ChangeIndex.class , com.google.gerrit.elasticsearch.ElasticChangeIndex.class ) . build ( ChangeIndex.Factory.class ) ) ; install ( new com.google.inject.assistedinject.FactoryModuleBuilder ( ) . implement ( com.google.gerrit.server.index.account.AccountIndex.class , com.google.gerrit.lucene.LuceneAccountIndex.class ) . build ( AccountIndex.Factory.class ) ) ; install ( new com.google.gerrit.server.index.IndexModule ( threads ) ) ; install ( new com.google.gerrit.index.SingleVersionModule ( singleVersions ) ) ; }

Target:
protected void configure ( ) { install ( new com.google.inject.assistedinject.FactoryModuleBuilder ( ) . implement ( com.google.gerrit.server.index.change.ChangeIndex.class , com.google.gerrit.elasticsearch.ElasticChangeIndex.class ) . build ( ChangeIndex.Factory.class ) ) ; install ( new com.google.inject.assistedinject.FactoryModuleBuilder ( ) . implement ( com.google.gerrit.server.index.account.AccountIndex.class , com.google.gerrit.lucene.LuceneAccountIndex.class ) . build ( AccountIndex.Factory.class ) ) ; install ( new com.google.gerrit.server.index.IndexModule ( threads ) ) ; install ( new com.google.gerrit.server.index.SingleVersionModule ( singleVersions ) ) ; }
Source:
public com.google.gerrit.extensions.restapi.RestView < com.google.gerrit.extensions.restapi.TopLevelResource > list ( ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.ResourceNotFoundException { final com.google.gerrit.server.CurrentUser user = self.get ( ) ; if ( user instanceof com.google.gerrit.server.AnonymousUser ) { throw new com.google.gerrit.extensions.restapi.AuthException ( "Authentication required" ) ; } else if ( ! ( user instanceof com.google.gerrit.server.IdentifiedUser ) ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( ) ; } return list.get ( ) ; }

Target:
public com.google.gerrit.extensions.restapi.RestView < com.google.gerrit.extensions.restapi.TopLevelResource > list ( ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.ResourceNotFoundException { final com.google.gerrit.server.CurrentUser user = self.get ( ) ; if ( user instanceof com.google.gerrit.server.AnonymousUser ) { throw new com.google.gerrit.extensions.restapi.AuthException ( "Authentication required" ) ; } else if ( ! ( user.isIdentifiedUser ( ) ) ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( ) ; } return list.get ( ) ; }