auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
void init ( com.google.gerrit.client.diff.PreferencesAction pa , java.util.List < com.google.gerrit.client.ui.InlineHyperlink > links , java.util.List < com.google.gerrit.client.WebLinkInfo > webLinks ) { prefsAction = pa ; prefsAction.setPartner ( preferences ) ; for ( com.google.gerrit.client.ui.InlineHyperlink link : links ) { linkPanel.add ( link ) ; } for ( com.google.gerrit.client.WebLinkInfo webLink : webLinks ) { linkPanel.add ( webLink.toAnchor ( ) ) ; } }

Target:
void init ( com.google.gerrit.client.diff.PreferencesAction pa , java.util.List < com.google.gerrit.client.ui.InlineHyperlink > links , java.util.List < com.google.gerrit.client.info.WebLinkInfo > webLinks ) { prefsAction = pa ; prefsAction.setPartner ( preferences ) ; for ( com.google.gerrit.client.ui.InlineHyperlink link : links ) { linkPanel.add ( link ) ; } for ( com.google.gerrit.client.info.WebLinkInfo webLink : webLinks ) { linkPanel.add ( webLink.toAnchor ( ) ) ; } }
Source:
public com.google.gwtorm.server.ResultSet < T > read ( ) throws com.google.gwtorm.server.OrmException { try { return readImpl ( ) ; } catch ( com.google.gwtorm.server.OrmRuntimeException err ) { com.google.common.base.Throwables.propagateIfInstanceOf ( err.getCause ( ) , com.google.gwtorm.server.OrmException.class ) ; throw new com.google.gwtorm.server.OrmException ( err ) ; } }

Target:
public com.google.gwtorm.server.ResultSet < T > read ( ) throws com.google.gwtorm.server.OrmException { try { return readImpl ( ) ; } catch ( com.google.gwtorm.server.OrmRuntimeException err ) { if ( ( err.getCause ( ) ) != null ) { com.google.common.base.Throwables.throwIfInstanceOf ( err.getCause ( ) , com.google.gwtorm.server.OrmException.class ) ; } throw new com.google.gwtorm.server.OrmException ( err ) ; } }
Source:
protected void includeWatchers ( com.google.gerrit.server.account.WatchConfig.NotifyType type , boolean includeWatchersFromNotifyConfig ) { try { com.google.gerrit.server.mail.send.ProjectWatch.Watchers matching = getWatchers ( type , includeWatchersFromNotifyConfig ) ; 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.send.NotificationEmail.log.warn ( ( "Cannot BCC watchers for " + type ) , err ) ; } }

Target:
protected void includeWatchers ( com.google.gerrit.server.account.ProjectWatches.NotifyType type , boolean includeWatchersFromNotifyConfig ) { try { com.google.gerrit.server.mail.send.ProjectWatch.Watchers matching = getWatchers ( type , includeWatchersFromNotifyConfig ) ; 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.send.NotificationEmail.log.warn ( ( "Cannot BCC watchers for " + type ) , err ) ; } }
Source:
public void onSuccess ( com.google.gerrit.client.rpc.NativeMap < com.google.gwt.core.client.JsArray < com.google.gerrit.client.changes.CommentInfo > > result ) { publishedRevisionAll = result ; publishedRevision = sort ( result.get ( path ) ) ; }

Target:
public void onSuccess ( com.google.gerrit.client.rpc.NativeMap < com.google.gwt.core.client.JsArray < com.google.gerrit.client.changes.CommentInfo > > result ) { for ( java.lang.String k : result.keySet ( ) ) { result.put ( k , filterForParent ( result.get ( k ) ) ) ; } publishedRevisionAll = result ; publishedRevision = sort ( result.get ( path ) ) ; }
Source:
public int hashCode ( ) { int h = 0 ; h = ( h * 31 ) + ( aId.hashCode ( ) ) ; h = ( h * 31 ) + ( bId.hashCode ( ) ) ; return h ; }

Target:
public int hashCode ( ) { int h = 0 ; h = ( h * 31 ) + ( aId.hashCode ( ) ) ; h = ( h * 31 ) + ( bId.hashCode ( ) ) ; h = ( h * 31 ) + ( ignoreWhitespace ? 1 : 0 ) ; return h ; }
Source:
public void deleteVoteFromWipChange ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageWipChange ( ) ; deleteVote ( sc , voter ) ; assertThat ( sender ) . sent ( "deleteVote" , sc ) . notTo ( voter ) . to ( sc.owner ) . cc ( sc.reviewer , sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; }

Target:
protected com.google.gerrit.acceptance.server.mail.StagedChange stageReviewableChange ( ) throws java.lang.Exception { return stageChange ( ( ) -> super . stageReviewableChange ( ) ) ; }
Source:
public void setSearchIndex ( com.google.gerrit.server.index.ChangeIndex index ) { com.google.gerrit.server.index.ChangeIndex old = searchIndex.getAndSet ( index ) ; if ( ( old != null ) && ( old != index ) ) { old.close ( ) ; } }

Target:
public void setSearchIndex ( com.google.gerrit.server.index.ChangeIndex index ) { com.google.gerrit.server.index.ChangeIndex old = searchIndex.getAndSet ( index ) ; if ( ( ( old != null ) && ( old != index ) ) && ( ! ( writeIndexes.contains ( old ) ) ) ) { old.close ( ) ; } }
Source:
private void initRights ( ) { final com.google.gwt.user.client.ui.Label rightsHdr = new com.google.gwt.user.client.ui.Label ( Util.C.headingAccessRights ( ) ) ; rightsHdr.setStyleName ( "gerrit-SmallHeading" ) ; rights = new com.google.gerrit.client.admin.ProjectAdminScreen.RightsTable ( ) ; delRight = new com.google.gwt.user.client.ui.Button ( Util.C.buttonDeleteGroupMembers ( ) ) ; delRight.addClickListener ( new com.google.gwt.user.client.ui.ClickListener ( ) { public void onClick ( final com.google.gwt.user.client.ui.Widget sender ) { rights.deleteChecked ( ) ; } } ) ; add ( rightsHdr ) ; add ( rights ) ; add ( delRight ) ; }

Target:
public void onChange ( com.google.gwt.user.client.ui.Widget sender ) { populateRangeBoxes ( ) ; }
Source:
protected void configure ( ) { factory ( ReviewerResource.Factory.class ) ; factory ( AccountInfo.Loader.Factory.class ) ; factory ( EmailReviewComments.Factory.class ) ; factory ( ChangeInserter.Factory.class ) ; factory ( PatchSetInserter.Factory.class ) ; factory ( ChangeEdits.Create.Factory.class ) ; factory ( ChangeEdits.DeleteFile.Factory.class ) ; }

Target:
protected void configure ( ) { factory ( ReviewerResource.Factory.class ) ; factory ( AccountLoader.Factory.class ) ; factory ( EmailReviewComments.Factory.class ) ; factory ( ChangeInserter.Factory.class ) ; factory ( PatchSetInserter.Factory.class ) ; factory ( ChangeEdits.Create.Factory.class ) ; factory ( ChangeEdits.DeleteFile.Factory.class ) ; }
Source:
private void verifyCommandLine ( ) throws com.google.gerrit.sshd.commands.UnloggedFailure { if ( ( ! ( all ) ) && ( projects.isEmpty ( ) ) ) { throw new com.google.gerrit.sshd.commands.UnloggedFailure ( 1 , "needs projects as command arguments or --all option" ) ; } if ( ( all ) && ( ! ( projects.isEmpty ( ) ) ) ) { throw new com.google.gerrit.sshd.commands.UnloggedFailure ( 1 , "either specify projects as command arguments or use --all option" ) ; } }

Target:
private void verifyCommandLine ( ) throws com.google.gerrit.sshd.commands.UnloggedFailure { if ( ( ! ( all ) ) && ( projects.isEmpty ( ) ) ) { throw die ( "needs projects as command arguments or --all option" ) ; } if ( ( all ) && ( ! ( projects.isEmpty ( ) ) ) ) { throw die ( "either specify projects as command arguments or use --all option" ) ; } }
Source:
public void stop ( ) { if ( ( scanner ) != null ) { scanner.end ( ) ; } srvInfoImpl.state = ServerInformation.State.SHUTDOWN ; synchronized ( this ) { boolean clean = ! ( running.isEmpty ( ) ) ; for ( com.google.gerrit.server.plugins.Plugin p : running.values ( ) ) { p.stop ( ) ; } running.clear ( ) ; broken.clear ( ) ; if ( clean ) { java.lang.System.gc ( ) ; processPendingCleanups ( ) ; } } }

Target:
public void stop ( ) { if ( ( scanner ) != null ) { scanner.end ( ) ; } srvInfoImpl.state = ServerInformation.State.SHUTDOWN ; synchronized ( this ) { for ( com.google.gerrit.server.plugins.Plugin p : running.values ( ) ) { p.stop ( ) ; } running.clear ( ) ; broken.clear ( ) ; if ( ( cleanupHandles.size ( ) ) > ( running.size ( ) ) ) { java.lang.System.gc ( ) ; processPendingCleanups ( ) ; } } }
Source:
public void visit ( org.pegdown.ast.ExpImageNode node ) { html.open ( "img" ) . attribute ( "src" , resolveImageUrl ( node.url ) ) . attribute ( "title" , node.title ) . attribute ( "alt" , com.google.gitiles.doc.MarkdownUtil.getInnerText ( node ) ) ; }

Target:
private void visit ( org.commonmark.ext.gfm.tables.TableCell cell ) { java.lang.String tag = ( cell.isHeader ( ) ) ? "th" : "td" ; html.open ( tag ) ; org.commonmark.ext.gfm.tables.TableCell.Alignment alignment = cell.getAlignment ( ) ; if ( alignment != null ) { html.attribute ( "align" , com.google.gitiles.doc.MarkdownToHtml.toHtml ( alignment ) ) ; } visitChildren ( cell ) ; html.close ( tag ) ; }
Source:
public void checkTrustChainWithExpiredKey ( ) throws java.lang.Exception { com.google.gerrit.gpg.testutil.TestKey keyA = add ( com.google.gerrit.gpg.testutil.TestTrustKeys.keyA ( ) , user ) ; com.google.gerrit.gpg.testutil.TestKey keyB = add ( com.google.gerrit.gpg.testutil.TestTrustKeys.keyB ( ) , addUser ( "userB" ) ) ; com.google.gerrit.gpg.GerritPublicKeyChecker checker = checkerFactory.create ( user ) ; assertProblems ( checker.check ( keyA.getPublicKey ( ) , store ) , Status.OK , "No path to a trusted key" , ( ( "Certification by " + ( com.google.gerrit.gpg.PublicKeyStore.keyToString ( keyB.getPublicKey ( ) ) ) ) + " is valid, but key is not trusted" ) , "Key D24FE467 used for certification is not in store" ) ; }

Target:
public void checkTrustChainWithExpiredKey ( ) throws java.lang.Exception { com.google.gerrit.gpg.testutil.TestKey keyA = add ( com.google.gerrit.gpg.testutil.TestTrustKeys.keyA ( ) , user ) ; com.google.gerrit.gpg.testutil.TestKey keyB = add ( com.google.gerrit.gpg.testutil.TestTrustKeys.keyB ( ) , addUser ( "userB" ) ) ; com.google.gerrit.gpg.PublicKeyChecker checker = checkerFactory.create ( ) . setExpectedUser ( user ) . setStore ( store ) ; assertProblems ( checker.check ( keyA.getPublicKey ( ) ) , Status.OK , "No path to a trusted key" , ( ( "Certification by " + ( com.google.gerrit.gpg.PublicKeyStore.keyToString ( keyB.getPublicKey ( ) ) ) ) + " is valid, but key is not trusted" ) , "Key D24FE467 used for certification is not in store" ) ; }
Source:
protected boolean xsrfValidate ( final com.google.gwtjsonrpc.server.ActiveCall call ) throws com.google.gwtjsonrpc.server.XsrfException { final javax.servlet.http.HttpServletRequest req = call.httpRequest ; final java.lang.String user = xsrfUser ( call ) ; final java.lang.String path = req.getServletPath ( ) ; final java.lang.String userpath = ( ( ":" + user ) + ":" ) + path ; call.httpResponse.addHeader ( com.google.gwtjsonrpc.client.Shared.XSRF_HEADER , xsrf.newToken ( userpath ) ) ; return xsrf.checkToken ( req.getHeader ( com.google.gwtjsonrpc.client.Shared.XSRF_HEADER ) , userpath ) ; }

Target:
protected boolean xsrfValidate ( final com.google.gwtjsonrpc.server.ActiveCall call ) throws com.google.gwtjsonrpc.server.XsrfException { final javax.servlet.http.HttpServletRequest req = call.httpRequest ; final java.lang.String user = xsrfUser ( call ) ; final java.lang.String path = req.getServletPath ( ) ; final java.lang.String userpath = ( ( ":" + user ) + ":" ) + path ; call.httpResponse.addHeader ( com.google.gwtjsonrpc.client.JsonUtil.XSRF_HEADER , xsrf.newToken ( userpath ) ) ; return xsrf.checkToken ( req.getHeader ( com.google.gwtjsonrpc.client.JsonUtil.XSRF_HEADER ) , userpath ) ; }
Source:
public void noScheduleOnEmptyBody ( ) throws java.lang.Exception { org.mockito.Mockito.when ( processor.process ( org.mockito.ArgumentMatchers.eq ( projectCreated ) , org.mockito.ArgumentMatchers.eq ( remote ) ) ) . thenReturn ( null ) ; task.run ( ) ; org.mockito.Mockito.verifyZeroInteractions ( session ) ; org.mockito.Mockito.verifyZeroInteractions ( executor ) ; }

Target:
public void noScheduleOnEmptyBody ( ) throws java.lang.Exception { org.mockito.Mockito.when ( processor.process ( org.mockito.ArgumentMatchers.eq ( projectCreated ) , org.mockito.ArgumentMatchers.eq ( remote ) ) ) . thenReturn ( com.google.common.base.Optional.< com.googlesource.gerrit.plugins.webhooks.EventProcessor.Request > absent ( ) ) ; task.run ( ) ; org.mockito.Mockito.verifyZeroInteractions ( session ) ; org.mockito.Mockito.verifyZeroInteractions ( executor ) ; }
Source:
private com.google.gerrit.extensions.common.CommentInfo getDraftComment ( java.lang.String changeId , java.lang.String revId , java.lang.String uuid ) throws java.io.IOException { com.google.gerrit.acceptance.RestResponse r = userSession.get ( ( ( ( ( ( "/changes/" + changeId ) + "/revisions/" ) + revId ) + "/drafts/" ) + uuid ) ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( HttpStatus.SC_OK ) ; return newGson ( ) . fromJson ( r.getReader ( ) , com.google.gerrit.extensions.common.CommentInfo.class ) ; }

Target:
private com.google.gerrit.extensions.common.CommentInfo getDraftComment ( java.lang.String changeId , java.lang.String revId , java.lang.String uuid ) throws java.lang.Exception { return gApi.changes ( ) . id ( changeId ) . revision ( revId ) . draft ( uuid ) . get ( ) ; }
Source:
protected void onLoad ( ) { super . onLoad ( ) ; Util.GROUP_SVC.ownedGroups ( new com.google.gerrit.client.rpc.ScreenLoadCallback < java.util.List < com.google.gerrit.reviewdb.AccountGroup > > ( this ) { @ java.lang.Override protected void preDisplay ( final java.util.List < com.google.gerrit.reviewdb.AccountGroup > result ) { groups.display ( result ) ; groups.finishDisplay ( ) ; } } ) ; }

Target:
protected void onLoad ( ) { super . onLoad ( ) ; Util.GROUP_SVC.visibleGroups ( new com.google.gerrit.client.rpc.ScreenLoadCallback < java.util.List < com.google.gerrit.reviewdb.AccountGroup > > ( this ) { @ java.lang.Override protected void preDisplay ( final java.util.List < com.google.gerrit.reviewdb.AccountGroup > result ) { groups.display ( result ) ; groups.finishDisplay ( ) ; } } ) ; }
Source:
private static com.google.gerrit.client.reviewdb.Account findAccount ( final com.google.gerrit.client.reviewdb.ReviewDb db , final java.lang.String nameOrEmail ) throws com.google.gerrit.server.Failure , com.google.gwtorm.client.OrmException { final com.google.gerrit.client.reviewdb.Account r = com.google.gerrit.client.reviewdb.Account.find ( db , nameOrEmail ) ; if ( r == null ) { throw new com.google.gerrit.server.Failure ( new com.google.gerrit.client.rpc.NoSuchEntityException ( ) ) ; } return r ; }

Target:
private static com.google.gerrit.client.reviewdb.Account findAccount ( final com.google.gerrit.client.reviewdb.ReviewDb db , final java.lang.String nameOrEmail ) throws com.google.gerrit.server.Failure , com.google.gwtorm.client.OrmException { final com.google.gerrit.client.reviewdb.Account r = com.google.gerrit.client.reviewdb.Account.find ( db , nameOrEmail ) ; if ( r == null ) { throw new com.google.gerrit.server.Failure ( new com.google.gerrit.client.rpc.NoSuchAccountException ( nameOrEmail ) ) ; } return r ; }
Source:
protected void configure ( ) { bindScope ( com.google.inject.servlet.RequestScoped.class , PerThreadRequestScope.REQUEST ) ; bind ( com.google.gerrit.server.project.PerRequestProjectControlCache.class ) . in ( com.google.inject.servlet.RequestScoped.class ) ; bind ( com.google.gerrit.server.CurrentUser.class ) . toInstance ( remoteUser ) ; }

Target:
protected void configure ( ) { bindScope ( com.google.inject.servlet.RequestScoped.class , PerThreadRequestScope.REQUEST ) ; bind ( PerThreadRequestScope.Propagator.class ) ; bind ( com.google.gerrit.server.project.PerRequestProjectControlCache.class ) . in ( com.google.inject.servlet.RequestScoped.class ) ; bind ( com.googlesource.gerrit.plugins.replication.Destination.class ) . toInstance ( this ) ; bind ( org.eclipse.jgit.transport.RemoteConfig.class ) . toInstance ( remote ) ; install ( new com.google.inject.assistedinject.FactoryModuleBuilder ( ) . build ( PushOne.Factory.class ) ) ; }
Source:
public static java.lang.String toPatch ( final com.google.gerrit.client.patches.PatchScreen.Type type , final com.google.gerrit.reviewdb.client.Patch.Key id ) { if ( type == ( PatchScreen.Type.SIDE_BY_SIDE ) ) { return com.google.gerrit.client.Dispatcher.toPatchSideBySide ( id ) ; } else { return com.google.gerrit.client.Dispatcher.toPatchUnified ( id ) ; } }

Target:
private static void sbs2 ( final java.lang.String token , final com.google.gerrit.reviewdb.client.PatchSet.Id baseId , final com.google.gerrit.reviewdb.client.Patch.Key id , final com.google.gerrit.client.diff.DisplaySide side , final int line , final boolean edit ) { com.google.gwt.core.client.GWT.runAsync ( new com.google.gerrit.client.Dispatcher.AsyncSplit ( token ) { @ java.lang.Override public void onSuccess ( ) { com.google.gerrit.client.Gerrit.display ( token , ( edit ? new com.google.gerrit.client.editor.EditScreen ( id ) : new com.google.gerrit.client.diff.SideBySide2 ( baseId , id.getParentKey ( ) , id.get ( ) , side , line ) ) ) ; } } ) ; }
Source:
private static java.net.InetAddress getLocalHost ( ) throws java.net.UnknownHostException { try { return java.net.InetAddress.getLocalHost ( ) ; } catch ( java.net.UnknownHostException e1 ) { try { return java.net.InetAddress.getByName ( "localhost" ) ; } catch ( java.net.UnknownHostException e2 ) { return java.net.InetAddress.getByName ( "127.0.0.1" ) ; } } }

Target:
private static java.net.InetAddress getLocalHost ( ) throws java.net.UnknownHostException { return java.net.InetAddress.getLoopbackAddress ( ) ; }
Source:
private static void deleteLocally ( org.eclipse.jgit.transport.URIish uri ) { try { com.googlesource.gerrit.plugins.replication.ReplicationQueue.recursivelyDelete ( new java.io.File ( uri.getPath ( ) ) ) ; } catch ( java.io.IOException e ) { com.googlesource.gerrit.plugins.replication.ReplicationQueue.log.error ( java.lang.String.format ( "Failed to delete repository %s" , uri.getPath ( ) ) , e ) ; } }

Target:
private static void deleteLocally ( org.eclipse.jgit.transport.URIish uri ) { try { com.googlesource.gerrit.plugins.replication.ReplicationQueue.recursivelyDelete ( new java.io.File ( uri.getPath ( ) ) ) ; } catch ( java.io.IOException e ) { com.googlesource.gerrit.plugins.replication.ReplicationQueue.log.error ( java.lang.String.format ( "Error deleting local repository %s:\n" , uri.getPath ( ) ) , e ) ; } }
Source:
public void newPatchSetByOtherOnReviewableChangeOwnerSelfCcNotifyOwnerReviewersInReviewDb ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isFalse ( ) ; com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) ; pushTo ( sc , "refs/for/master%notify=OWNER_REVIEWERS" , other , EmailStrategy.CC_ON_OWN_COMMENTS ) ; assertThat ( sender ) . sent ( "newpatchset" , sc ) . notTo ( sc.starrer , other ) . notTo ( sc.reviewerByEmail , sc.ccerByEmail ) . to ( sc.owner , sc.reviewer , sc.ccer ) . notTo ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) ; }

Target:
public void newPatchSetByOtherOnReviewableChangeOwnerSelfCcNotifyOwner ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; pushTo ( sc , "refs/for/master%notify=OWNER" , other , EmailStrategy.CC_ON_OWN_COMMENTS ) ; assertThat ( sender ) . notSent ( ) ; }
Source:
private void renderHistory ( com.google.gerrit.client.changes.ChangeInfo info ) { com.google.gwt.core.client.JsArray < com.google.gerrit.client.changes.ChangeInfo.MessageInfo > messages = info.messages ( ) ; if ( messages != null ) { for ( int i = 0 ; i < ( messages.length ( ) ) ; i ++ ) { history.add ( new com.google.gerrit.client.change.Message ( commentLinkProcessor , messages.get ( i ) ) ) ; } } }

Target:
private static java.lang.String normalize ( java.lang.String r ) { return ( r != null ) && ( ! ( r.isEmpty ( ) ) ) ? r : null ; }
Source:
public void testUpsertTwoBothExistsing ( ) throws com.google.gwtorm.client.OrmException , java.sql.SQLException { stubExecuteBatchOK ( com.google.gwtorm.jdbc.TestJdbcAccess.UPDATE , 1 , 1 ) ; createClassUnderTest ( ) . upsert ( com.google.gwtorm.jdbc.TestJdbcAccess.TWO_ROWS ) ; }

Target:
public void testUpsertTwoBothExisting ( ) throws com.google.gwtorm.server.OrmException , java.sql.SQLException { java.sql.PreparedStatement update = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.TestJdbcAccess.UPDATE , 1 , 1 ) ; java.sql.PreparedStatement insert = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.TestJdbcAccess.INSERT ) ; createClassUnderTest ( ) . upsert ( twoRows ) ; com.google.gwtorm.jdbc.TestJdbcAccess.assertUsedBatchingOnly ( update ) ; com.google.gwtorm.jdbc.TestJdbcAccess.assertNotUsed ( insert ) ; }
Source:
public java.lang.Iterable < com.google.gerrit.reviewdb.client.Account.Id > byChangeFromIndex ( com.google.gerrit.reviewdb.client.Change.Id changeId ) throws com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException { java.util.Set < java.lang.String > fields = com.google.common.collect.ImmutableSet.of ( ChangeField.ID.getName ( ) , ChangeField.STARREDBY.getName ( ) ) ; java.util.List < com.google.gerrit.server.query.change.ChangeData > changeData = queryProvider.get ( ) . setRequestedFields ( fields ) . byLegacyChangeId ( changeId ) ; if ( ( changeData.size ( ) ) != 1 ) { throw new com.google.gerrit.server.project.NoSuchChangeException ( changeId ) ; } return changeData.get ( 0 ) . starredBy ( ) ; }

Target:
public com.google.common.collect.ImmutableMultimap < com.google.gerrit.reviewdb.client.Account.Id , java.lang.String > byChangeFromIndex ( com.google.gerrit.reviewdb.client.Change.Id changeId ) throws com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException { java.util.Set < java.lang.String > fields = com.google.common.collect.ImmutableSet.of ( ChangeField.ID.getName ( ) , ChangeField.STAR.getName ( ) ) ; java.util.List < com.google.gerrit.server.query.change.ChangeData > changeData = queryProvider.get ( ) . setRequestedFields ( fields ) . byLegacyChangeId ( changeId ) ; if ( ( changeData.size ( ) ) != 1 ) { throw new com.google.gerrit.server.project.NoSuchChangeException ( changeId ) ; } return changeData.get ( 0 ) . stars ( ) ; }
Source:
public com.google.gerrit.server.change.ReviewerResource parse ( com.google.gerrit.server.change.ChangeResource changeResource , java.lang.String id ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException , com.google.gwtorm.server.OrmException { if ( ! ( id.matches ( "^[0-9]+$" ) ) ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( id ) ; } com.google.gerrit.reviewdb.client.Account.Id accountId = Account.Id.parse ( id ) ; if ( fetchAccountIds ( changeResource ) . contains ( accountId ) ) { com.google.gerrit.reviewdb.client.Account account = accountCache.get ( accountId ) . getAccount ( ) ; return new com.google.gerrit.server.change.ReviewerResource ( changeResource , account ) ; } throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( id ) ; }

Target:
public com.google.gerrit.extensions.restapi.RestView < com.google.gerrit.server.change.ChangeResource > list ( ) { return list.get ( ) ; }
Source:
private void configurePeerInfoSection ( ) { ui.header ( "PeerInfo section" ) ; com.ericsson.gerrit.plugins.highavailability.Configuration.PeerInfoStrategy strategy = ui.readEnum ( PeerInfoStrategy.JGROUPS , "Peer info strategy" ) ; config.setEnum ( com.ericsson.gerrit.plugins.highavailability.PEER_INFO_SECTION , null , com.ericsson.gerrit.plugins.highavailability.STRATEGY_KEY , strategy ) ; if ( strategy == ( com.ericsson.gerrit.plugins.highavailability.Configuration.PeerInfoStrategy.STATIC ) ) { promptAndSetString ( "Peer URL" , com.ericsson.gerrit.plugins.highavailability.PEER_INFO_SECTION , com.ericsson.gerrit.plugins.highavailability.STATIC_SUBSECTION , com.ericsson.gerrit.plugins.highavailability.URL_KEY , null ) ; } else { promptAndSetString ( "JGroups cluster name" , com.ericsson.gerrit.plugins.highavailability.PEER_INFO_SECTION , com.ericsson.gerrit.plugins.highavailability.JGROUPS_SUBSECTION , com.ericsson.gerrit.plugins.highavailability.CLUSTER_NAME_KEY , com.ericsson.gerrit.plugins.highavailability.DEFAULT_CLUSTER_NAME ) ; } }

Target:
private void configurePeerInfoSection ( ) { ui.header ( "PeerInfo section" ) ; com.ericsson.gerrit.plugins.highavailability.Configuration.PeerInfoStrategy strategy = ui.readEnum ( PeerInfoStrategy.JGROUPS , java.util.EnumSet.allOf ( com.ericsson.gerrit.plugins.highavailability.Configuration.PeerInfoStrategy.class ) , "Peer info strategy" ) ; config.setEnum ( com.ericsson.gerrit.plugins.highavailability.PEER_INFO_SECTION , null , com.ericsson.gerrit.plugins.highavailability.STRATEGY_KEY , strategy ) ; if ( strategy == ( com.ericsson.gerrit.plugins.highavailability.Configuration.PeerInfoStrategy.STATIC ) ) { promptAndSetString ( "Peer URL" , com.ericsson.gerrit.plugins.highavailability.PEER_INFO_SECTION , com.ericsson.gerrit.plugins.highavailability.STATIC_SUBSECTION , com.ericsson.gerrit.plugins.highavailability.URL_KEY , null ) ; } else { promptAndSetString ( "JGroups cluster name" , com.ericsson.gerrit.plugins.highavailability.PEER_INFO_SECTION , com.ericsson.gerrit.plugins.highavailability.JGROUPS_SUBSECTION , com.ericsson.gerrit.plugins.highavailability.CLUSTER_NAME_KEY , com.ericsson.gerrit.plugins.highavailability.DEFAULT_CLUSTER_NAME ) ; } }
Source:
protected void setUpEnvironment ( com.google.gerrit.rules.PrologEnvironment env ) { com.google.gerrit.reviewdb.client.Change change = new com.google.gerrit.reviewdb.client.Change ( new com.google.gerrit.reviewdb.client.Change.Key ( "Ibeef" ) , new com.google.gerrit.reviewdb.client.Change.Id ( 1 ) , new com.google.gerrit.reviewdb.client.Account.Id ( 2 ) , new com.google.gerrit.reviewdb.client.Branch.NameKey ( localKey , "refs/heads/master" ) , com.google.gerrit.common.TimeUtil.nowTs ( ) ) ; env.set ( StoredValues.CHANGE_CONTROL , util.user ( local ) . controlFor ( change ) ) ; }

Target:
protected void setUpEnvironment ( com.google.gerrit.rules.PrologEnvironment env ) { com.google.gerrit.common.data.LabelTypes labelTypes = new com.google.gerrit.common.data.LabelTypes ( java.util.Arrays.asList ( com.google.gerrit.server.project.Util.codeReview ( ) , com.google.gerrit.server.project.Util.verified ( ) ) ) ; com.google.gerrit.server.project.ChangeControl ctl = org.easymock.EasyMock.createMock ( com.google.gerrit.server.project.ChangeControl.class ) ; org.easymock.EasyMock.expect ( ctl.getLabelTypes ( ) ) . andStubReturn ( labelTypes ) ; org.easymock.EasyMock.replay ( ctl ) ; env.set ( StoredValues.CHANGE_CONTROL , ctl ) ; }
Source:
private android.widget.ImageView createIcon ( int drawableId , android.view.View.OnClickListener onClickListener ) { android.widget.ImageView icon = new android.widget.ImageView ( getContext ( ) ) ; android.widget.TableRow.LayoutParams layoutParams = new android.widget.TableRow.LayoutParams ( widgetUtil.dpToPx ( 20 ) , widgetUtil.dpToPx ( 20 ) ) ; layoutParams.setMargins ( 0 , 0 , widgetUtil.dpToPx ( 5 ) , 0 ) ; icon.setLayoutParams ( layoutParams ) ; icon.setBackgroundDrawable ( widgetUtil.getDrawable ( drawableId ) ) ; icon.setOnClickListener ( onClickListener ) ; return icon ; }

Target:
private android.widget.ImageView createIcon ( int drawableId , android.view.View.OnClickListener onClickListener ) { android.widget.ImageView icon = new android.widget.ImageView ( getContext ( ) ) ; android.widget.TableRow.LayoutParams layoutParams = new android.widget.TableRow.LayoutParams ( widgetUtil.dpToPx ( 20 ) , widgetUtil.dpToPx ( 20 ) ) ; layoutParams.setMargins ( 0 , 0 , widgetUtil.dpToPx ( 5 ) , 0 ) ; icon.setLayoutParams ( layoutParams ) ; icon.setBackground ( widgetUtil.getDrawable ( drawableId ) ) ; icon.setOnClickListener ( onClickListener ) ; return icon ; }
Source:
private void markInvalid ( final com.google.gerrit.client.reviewdb.AccountSshKey k ) { try { final com.google.gerrit.client.reviewdb.ReviewDb db = schema.open ( ) ; try { k.setInvalid ( ) ; db.accountSshKeys ( ) . update ( java.util.Collections.singleton ( k ) ) ; } finally { db.close ( ) ; } } catch ( com.google.gwtorm.client.OrmException e ) { } }

Target:
private void markInvalid ( final java.lang.String username , final com.google.gerrit.client.reviewdb.AccountSshKey k ) { try { final com.google.gerrit.client.reviewdb.ReviewDb db = schema.open ( ) ; try { k.setInvalid ( ) ; db.accountSshKeys ( ) . update ( java.util.Collections.singleton ( k ) ) ; } finally { db.close ( ) ; } } catch ( com.google.gwtorm.client.OrmException e ) { } finally { com.google.gerrit.server.ssh.SshUtil.invalidate ( username ) ; } }
Source:
private boolean isLive ( java.nio.file.Path entry ) { java.lang.String name = entry.getFileName ( ) . toString ( ) ; return ( ( ( name.endsWith ( "_log" ) ) || ( name.endsWith ( ".log" ) ) ) || ( name.endsWith ( ".run" ) ) ) || ( name.endsWith ( ".pid" ) ) ; }

Target:
private boolean isLive ( java.nio.file.Path entry ) { java.lang.String name = entry.getFileName ( ) . toString ( ) ; return ( ( ( ( name.endsWith ( "_log" ) ) || ( name.endsWith ( ".log" ) ) ) || ( name.endsWith ( ".run" ) ) ) || ( name.endsWith ( ".pid" ) ) ) || ( name.endsWith ( ".json" ) ) ; }
Source:
public com.google.gerrit.reviewdb.client.Change abandon ( com.google.gerrit.server.project.ChangeControl control , final java.lang.String msgTxt , final com.google.gerrit.reviewdb.client.Account account ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.git.UpdateException { com.google.gerrit.server.change.Abandon.Op op = new com.google.gerrit.server.change.Abandon.Op ( msgTxt , account ) ; try ( com.google.gerrit.server.git.BatchUpdate u = batchUpdateFactory.create ( dbProvider.get ( ) , control.getChange ( ) . getProject ( ) , com.google.gerrit.common.TimeUtil.nowTs ( ) ) ) { u.addOp ( control , op ) . execute ( ) ; } return op.change ; }

Target:
public com.google.gerrit.reviewdb.client.Change abandon ( com.google.gerrit.server.project.ChangeControl control , final java.lang.String msgTxt , final com.google.gerrit.reviewdb.client.Account account ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.git.UpdateException { com.google.gerrit.server.change.Abandon.Op op = new com.google.gerrit.server.change.Abandon.Op ( msgTxt , account ) ; com.google.gerrit.reviewdb.client.Change c = control.getChange ( ) ; try ( com.google.gerrit.server.git.BatchUpdate u = batchUpdateFactory.create ( dbProvider.get ( ) , c.getProject ( ) , control.getCurrentUser ( ) , com.google.gerrit.common.TimeUtil.nowTs ( ) ) ) { u.addOp ( c.getId ( ) , op ) . execute ( ) ; } return op.change ; }
Source:
private java.lang.Runnable upToChange ( final boolean openReplyBox ) { return new java.lang.Runnable ( ) { public void run ( ) { java.lang.String b = ( ( base ) != null ) ? java.lang.String.valueOf ( base.get ( ) ) : null ; java.lang.String rev = java.lang.String.valueOf ( revision.get ( ) ) ; com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( changeId , rev ) , new com.google.gerrit.client.change.ChangeScreen2 ( changeId , b , rev , openReplyBox ) ) ; } } ; }

Target:
public void run ( ) { if ( unsaved.isEmpty ( ) ) { goUpToChange ( openReplyBox ) ; } else { com.google.gerrit.client.rpc.CallbackGroup group = new com.google.gerrit.client.rpc.CallbackGroup ( ) ; saveAllDrafts ( group ) ; group.addFinal ( new com.google.gerrit.client.rpc.GerritCallback < java.lang.Void > ( ) { @ java.lang.Override public void onSuccess ( java.lang.Void result ) { goUpToChange ( openReplyBox ) ; } } ) . onSuccess ( null ) ; } }
Source:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( ! ( obj instanceof com.googlesource.gerrit.plugins.cfoauth.AccessToken ) ) { return false ; } return java.util.Objects.equals ( value , ( ( com.googlesource.gerrit.plugins.cfoauth.AccessToken ) ( obj ) ) . value ) ; }

Target:
public int hashCode ( ) { return java.util.Objects.hash ( value , expiresAt , userInfo ) ; }
Source:
private static java.util.Map < java.lang.String , com.google.gerrit.extensions.common.RevisionInfo > toRevisionInfoMap ( com.google.gerrit.acceptance.RestResponse r ) throws java.io.IOException { java.util.Map < java.lang.String , com.google.gerrit.extensions.common.RevisionInfo > result = newGson ( ) . fromJson ( r.getReader ( ) , new com.google.gson.reflect.TypeToken < java.util.Map < java.lang.String , com.google.gerrit.extensions.common.RevisionInfo > > ( ) { } . getType ( ) ) ; return result ; }

Target:
private static byte [ ] toBytes ( com.google.gerrit.extensions.restapi.BinaryResult content ) throws java.lang.Exception { java.io.ByteArrayOutputStream os = new java.io.ByteArrayOutputStream ( ) ; content.writeTo ( os ) ; return os.toByteArray ( ) ; }
Source:
public java.util.List < com.google.gerrit.extensions.client.ProjectWatchInfo > setWatchedProjects ( java.util.List < com.google.gerrit.extensions.client.ProjectWatchInfo > in ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return postWatchedProjects.apply ( account , in ) ; } catch ( com.google.gwtorm.server.OrmException | java.io.IOException | org.eclipse.jgit.errors.ConfigInvalidException | com.google.gerrit.server.permissions.PermissionBackendException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot update watched projects" , e ) ; } }

Target:
public java.util.List < com.google.gerrit.extensions.client.ProjectWatchInfo > setWatchedProjects ( java.util.List < com.google.gerrit.extensions.client.ProjectWatchInfo > in ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return postWatchedProjects.apply ( account , in ) ; } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( "Cannot update watched projects" , e ) ; } }
Source:
private synchronized void runHook ( java.io.File hook , java.util.List < java.lang.String > args ) { if ( hook.exists ( ) ) { hookQueue.execute ( new com.google.gerrit.common.ChangeHookRunner.HookTask ( null , hook , args ) ) ; } }

Target:
private synchronized void runHook ( com.google.gerrit.reviewdb.Project.NameKey project , java.io.File hook , java.util.List < java.lang.String > args ) { if ( ( project != null ) && ( hook.exists ( ) ) ) { hookQueue.execute ( new com.google.gerrit.common.ChangeHookRunner.HookTask ( project , hook , args ) ) ; } }
Source:
public org.apache.sshd.server.CommandFactory get ( ) { return new org.apache.sshd.server.CommandFactory ( ) { public com.google.gerrit.server.ssh.Command createCommand ( final java.lang.String requestCommand ) { final com.google.gerrit.server.ssh.DispatchCommand c = dispatcher.get ( ) ; c.setCommandLine ( requestCommand ) ; return c ; } } ; }

Target:
public void start ( ) throws java.io.IOException { final com.google.gerrit.server.ssh.SshScopes.Context old = SshScopes.current.get ( ) ; try { SshScopes.current.set ( new com.google.gerrit.server.ssh.SshScopes.Context ( session ) ) ; final com.google.gerrit.server.ssh.DispatchCommand c = dispatcher.get ( ) ; c.setCommandLine ( commandLine ) ; c.setInputStream ( in ) ; c.setOutputStream ( out ) ; c.setErrorStream ( err ) ; c.setExitCallback ( exit ) ; c.start ( ) ; } finally { SshScopes.current.set ( old ) ; } }
Source:
public void onDraftPublished ( com.google.gerrit.extensions.events.DraftPublishedListener.Event event ) { com.google.gerrit.extensions.common.ChangeInfo c = event.getChange ( ) ; onEvent ( new com.google.gerrit.reviewdb.client.Project.NameKey ( c.project ) , c._number , event.getWho ( ) . email ) ; }

Target:
public void onRevisionCreated ( com.google.gerrit.extensions.events.RevisionCreatedListener.Event event ) { com.google.gerrit.extensions.common.ChangeInfo c = event.getChange ( ) ; if ( ( ignoreDrafts ) && ( ( c.status ) == ( com.google.gerrit.extensions.client.ChangeStatus.DRAFT ) ) ) { com.googlesource.gerrit.plugins.reviewers.ChangeEventListener.log.debug ( "Ignoring draft change" ) ; return ; } onEvent ( new com.google.gerrit.reviewdb.client.Project.NameKey ( c.project ) , c._number , event.getWho ( ) . email ) ; }
Source:
private static java.lang.String queryTextOf ( java.lang.String queryName , com.google.gwtorm.client.Query q ) throws com.google.gwtorm.client.OrmException { if ( q == null ) { throw new com.google.gwtorm.client.OrmException ( ( ( ( ( "Query " + queryName ) + " is missing " ) + ( com.google.gwtorm.client.Query.class . getName ( ) ) ) + " annotation" ) ) ; } return q.value ( ) ; }

Target:
private static java.lang.String queryTextOf ( java.lang.String queryName , com.google.gwtorm.server.Query q ) throws com.google.gwtorm.server.OrmException { if ( q == null ) { throw new com.google.gwtorm.server.OrmException ( ( ( ( ( "Query " + queryName ) + " is missing " ) + ( com.google.gwtorm.server.Query.class . getName ( ) ) ) + " annotation" ) ) ; } return q.value ( ) ; }
Source:
public void destroySite ( ) throws java.lang.Exception { if ( ( sitePath ) != null ) { com.google.gerrit.testutil.TempFileUtil.cleanup ( ) ; } }

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:
protected void configure ( ) { factory ( AgreementInfoFactory.Factory.class ) ; factory ( DeleteExternalIds.Factory.class ) ; factory ( ExternalIdDetailFactory.Factory.class ) ; factory ( GroupDetailFactory.Factory.class ) ; factory ( MyGroupsFactory.Factory.class ) ; }

Target:
protected void configure ( ) { factory ( AgreementInfoFactory.Factory.class ) ; factory ( CreateGroup.Factory.class ) ; factory ( DeleteExternalIds.Factory.class ) ; factory ( ExternalIdDetailFactory.Factory.class ) ; factory ( GroupDetailFactory.Factory.class ) ; factory ( MyGroupsFactory.Factory.class ) ; factory ( RenameGroup.Factory.class ) ; }
Source:
static void deleteSessionCookie ( ) { com.google.gerrit.client.Gerrit.myAccount = com.google.gerrit.client.info.AccountInfo.create ( 0 , null , null , null ) ; com.google.gerrit.client.Gerrit.myAccountDiffPref = null ; com.google.gerrit.client.Gerrit.editPrefs = null ; com.google.gerrit.client.Gerrit.myPrefs = com.google.gerrit.client.info.AccountPreferencesInfo.createDefault ( ) ; com.google.gerrit.client.Gerrit.urlAliasMatcher.clearUserAliases ( ) ; com.google.gerrit.client.Gerrit.xGerritAuth = null ; com.google.gerrit.client.Gerrit.refreshMenuBar ( ) ; com.google.gwt.user.client.Cookies.removeCookie ( "GerritAccount" ) ; }

Target:
static void deleteSessionCookie ( ) { com.google.gerrit.client.Gerrit.myAccount = com.google.gerrit.client.info.AccountInfo.create ( 0 , null , null , null ) ; com.google.gerrit.client.Gerrit.myAccountDiffPref = null ; com.google.gerrit.client.Gerrit.editPrefs = null ; com.google.gerrit.client.Gerrit.myPrefs = com.google.gerrit.client.info.GeneralPreferences.createDefault ( ) ; com.google.gerrit.client.Gerrit.urlAliasMatcher.clearUserAliases ( ) ; com.google.gerrit.client.Gerrit.xGerritAuth = null ; com.google.gerrit.client.Gerrit.refreshMenuBar ( ) ; com.google.gwt.user.client.Cookies.removeCookie ( "GerritAccount" ) ; }
Source:
public void handle ( final net.codemirror.lib.CodeMirror instance , final net.codemirror.lib.CodeMirror.LineHandle handle , com.google.gwt.dom.client.Element element ) { if ( lineActiveBoxMap.containsKey ( handle ) ) { lineActiveBoxMap.get ( handle ) . resizePaddingWidget ( ) ; } if ( linePaddingOnOtherSideMap.containsKey ( handle ) ) { defer ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { resizePaddingOnOtherSide ( side , instance.getLineNumber ( handle ) ) ; } } ) ; } }

Target:
public void execute ( ) { deferred = null ; operation ( new java.lang.Runnable ( ) { public void run ( ) { for ( java.lang.Runnable thunk : list ) { thunk.run ( ) ; } } } ) ; }
Source:
public void onKeyPress ( final com.google.gwt.event.dom.client.KeyPressEvent event ) { panel.hide ( ) ; }

Target:
public static void dialog ( final com.google.gwt.user.client.ui.PopupPanel panel ) { com.google.gwtexpui.globalkey.client.GlobalKey.initEvents ( ) ; com.google.gwtexpui.globalkey.client.GlobalKey.initDialog ( ) ; assert panel.isShowing ( ) ; assert ( com.google.gwtexpui.globalkey.client.GlobalKey.active ) == ( com.google.gwtexpui.globalkey.client.GlobalKey.global ) ; com.google.gwtexpui.globalkey.client.GlobalKey.active = new com.google.gwtexpui.globalkey.client.GlobalKey.State ( panel ) ; com.google.gwtexpui.globalkey.client.GlobalKey.active.add ( new com.google.gwtexpui.globalkey.client.HidePopupPanelCommand ( 0 , com.google.gwt.event.dom.client.KeyCodes.KEY_ESCAPE , panel ) ) ; panel.addCloseHandler ( com.google.gwtexpui.globalkey.client.GlobalKey.restoreGlobal ) ; }
Source:
public void testParseFooComment ( ) throws java.lang.Exception { com.google.gerrit.server.git.DestinationList dl = new com.google.gerrit.server.git.DestinationList ( ) ; dl.parseLabel ( com.google.gerrit.server.git.DestinationListTest.LABEL , ( ( "#" + ( com.google.gerrit.server.git.DestinationListTest.L_FOO ) ) + ( com.google.gerrit.server.git.DestinationListTest.L_BAR ) ) , null ) ; java.util.Set < com.google.gerrit.reviewdb.client.Branch.NameKey > branches = dl.getDestinations ( com.google.gerrit.server.git.DestinationListTest.LABEL ) ; com.google.common.truth.Truth.assertThat ( branches ) . doesNotContain ( com.google.gerrit.server.git.DestinationListTest.B_FOO ) ; com.google.common.truth.Truth.assertThat ( branches ) . contains ( com.google.gerrit.server.git.DestinationListTest.B_BAR ) ; }

Target:
public void testParseFooComment ( ) throws java.lang.Exception { com.google.gerrit.server.account.DestinationList dl = new com.google.gerrit.server.account.DestinationList ( ) ; dl.parseLabel ( com.google.gerrit.server.account.DestinationListTest.LABEL , ( ( "#" + ( com.google.gerrit.server.account.DestinationListTest.L_FOO ) ) + ( com.google.gerrit.server.account.DestinationListTest.L_BAR ) ) , null ) ; java.util.Set < com.google.gerrit.reviewdb.client.Branch.NameKey > branches = dl.getDestinations ( com.google.gerrit.server.account.DestinationListTest.LABEL ) ; com.google.common.truth.Truth.assertThat ( branches ) . doesNotContain ( com.google.gerrit.server.account.DestinationListTest.B_FOO ) ; com.google.common.truth.Truth.assertThat ( branches ) . contains ( com.google.gerrit.server.account.DestinationListTest.B_BAR ) ; }
Source:
void scheduleFullSync ( final com.google.gerrit.reviewdb.client.Project.NameKey project , final java.lang.String urlMatch ) { if ( ! ( running ) ) { com.googlesource.gerrit.plugins.replication.ReplicationQueue.log.warn ( "Replication plugin did not finish startup before event" ) ; return ; } for ( com.googlesource.gerrit.plugins.replication.Destination cfg : configs ) { for ( org.eclipse.jgit.transport.URIish uri : cfg.getURIs ( project , urlMatch ) ) { cfg.schedule ( project , PushOne.ALL_REFS , uri ) ; } } }

Target:
void scheduleFullSync ( final com.google.gerrit.reviewdb.client.Project.NameKey project , final java.lang.String urlMatch ) { if ( ! ( running ) ) { com.googlesource.gerrit.plugins.replication.ReplicationQueue.log.warn ( "Replication plugin did not finish startup before event" ) ; return ; } for ( com.googlesource.gerrit.plugins.replication.Destination cfg : configs ) { if ( cfg.wouldPushProject ( project ) ) { for ( org.eclipse.jgit.transport.URIish uri : cfg.getURIs ( project , urlMatch ) ) { cfg.schedule ( project , PushOne.ALL_REFS , uri ) ; } } } }
Source:
public void onSuccess ( com.googlesource.gerrit.plugins.serviceuser.client.MessagesInfo info ) { onSuccessMessage = info.getOnSuccessMessage ( ) ; java.lang.String infoMessage = info.getInfoMessage ( ) ; if ( ( infoMessage != null ) && ( ! ( "" . equals ( infoMessage ) ) ) ) { insert ( new com.google.gwt.user.client.ui.HTML ( infoMessage ) , 0 ) ; } }

Target:
public void onBrowserEvent ( com.google.gwt.user.client.Event event ) { super . onBrowserEvent ( event ) ; if ( ( event.getTypeInt ( ) ) == ( com.google.gwt.user.client.Event.ONPASTE ) ) { com.google.gwt.core.client.Scheduler.get ( ) . scheduleDeferred ( new com.google.gwt.core.client.Scheduler.ScheduledCommand ( ) { @ java.lang.Override public void execute ( ) { if ( ( getValue ( ) . trim ( ) . length ( ) ) != 0 ) { setEnabled ( true ) ; } } } ) ; } }
Source:
public void testReplaceTwoLinks ( ) { final com.google.gwtexpui.safehtml.client.RegexFindReplace [ ] repl = new com.google.gwtexpui.safehtml.client.RegexFindReplace [ ] { new com.google.gwtexpui.safehtml.client.RegexFindReplace ( "(issue\\s(\\d+))" , "<a href=\"?$2\">$1</a>" ) } ; final com.google.gwtexpui.safehtml.client.SafeHtml o = com.google.gwtexpui.safehtml.client.SafeHtml_ReplaceTest.html ( "A\nissue 42\nissue 9918\nB" ) ; final com.google.gwtexpui.safehtml.client.SafeHtml n = o.replaceAll ( java.util.Arrays.asList ( repl ) ) ; assertNotSame ( o , n ) ; assertEquals ( ( "A\n" + ( ( "<a href=\"?42\">issue 42</a>\n" + "<a href=\"?9918\">issue 9918</a>\n" ) + "B" ) ) , n.asString ( ) ) ; }

Target:
public void testReplaceOneLink ( ) { com.google.gwtexpui.safehtml.client.SafeHtml o = com.google.gwtexpui.safehtml.client.SafeHtml_ReplaceTest.html ( "A\nissue 42\nB" ) ; com.google.gwtexpui.safehtml.client.SafeHtml n = o.replaceAll ( com.google.gwtexpui.safehtml.client.SafeHtml_ReplaceTest.repls ( new com.google.gwtexpui.safehtml.client.RawFindReplace ( "(issue\\s(\\d+))" , "<a href=\"?$2\">$1</a>" ) ) ) ; assertNotSame ( o , n ) ; assertEquals ( "A\n<a href=\"?42\">issue 42</a>\nB" , n.asString ( ) ) ; }
Source:
private boolean isParent ( java.io.File parent , java.io.File child ) throws java.io.IOException { java.io.File p = parent.getCanonicalFile ( ) ; java.io.File c = child.getCanonicalFile ( ) ; for ( ; ; ) { c = c.getParentFile ( ) ; if ( c == null ) { return false ; } if ( c.equals ( p ) ) { return true ; } } }

Target:
private boolean isValidPath ( javax.servlet.http.HttpServletRequest req ) throws java.io.IOException { java.nio.file.Path p = resolvePath ( req ) ; if ( ! ( java.nio.file.Files.isRegularFile ( p ) ) ) { return false ; } return ( isParent ( sitePaths.etc_dir , p ) ) || ( isParent ( sitePaths.static_dir , p ) ) ; }
Source:
public void setPrivate ( boolean value ) throws com.google.gerrit.extensions.restapi.RestApiException { try { if ( value ) { putPrivate.apply ( change , null ) ; } else { deletePrivate.apply ( change , null ) ; } } catch ( com.google.gerrit.server.update.UpdateException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot change private status" , e ) ; } }

Target:
public void setPrivate ( boolean value ) throws com.google.gerrit.extensions.restapi.RestApiException { try { if ( value ) { putPrivate.apply ( change , null ) ; } else { deletePrivate.apply ( change , null ) ; } } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( "Cannot change private status" , e ) ; } }
Source:
public void onSuccess ( final com.google.gwtjsonrpc.client.VoidResult result ) { }

Target:
protected void onStarClick ( final int row ) { final com.google.gerrit.common.data.ChangeInfo c = getRowItem ( row ) ; if ( ( c != null ) && ( com.google.gerrit.client.Gerrit.isSignedIn ( ) ) ) { com.google.gerrit.client.changes.ChangeCache.get ( c.getId ( ) ) . getStarCache ( ) . toggleStar ( ) ; } }