auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testUpdateOneException ( ) throws com.google.gwtorm.client.OrmException , java.sql.SQLException { stubExecuteBatchException ( com.google.gwtorm.jdbc.TestJdbcAccess.UPDATE , new java.sql.BatchUpdateException ( ) ) ; try { createClassUnderTest ( ) . update ( com.google.gwtorm.jdbc.TestJdbcAccess.ONE_ROW ) ; org.junit.Assert.fail ( "missingException" ) ; } catch ( com.google.gwtorm.client.OrmException e ) { } }

Target:
public void testUpsertOneNotExisting ( ) throws com.google.gwtorm.server.OrmException , java.sql.SQLException { java.sql.PreparedStatement update = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.TestJdbcAccess.UPDATE ) ; java.sql.PreparedStatement insert = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.TestJdbcAccess.INSERT , 1 ) ; createClassUnderTest ( ) . upsert ( oneRow ) ; com.google.gwtorm.jdbc.TestJdbcAccess.assertUsedBatchingOnly ( update ) ; com.google.gwtorm.jdbc.TestJdbcAccess.assertUsedBatchingOnly ( insert ) ; com.google.gwtorm.jdbc.TestJdbcAccess.assertExpectedIdsUsed ( insert , 1 ) ; }
Source:
private com.google.gerrit.server.git.MergeOp.OpenRepo openRepo ( com.google.gerrit.reviewdb.client.Project.NameKey project ) throws com.google.gerrit.server.project.NoSuchProjectException , java.io.IOException { com.google.gerrit.server.git.MergeOp.OpenRepo repo = openRepos.get ( project ) ; if ( repo == null ) { try { repo = new com.google.gerrit.server.git.MergeOp.OpenRepo ( repoManager.openRepository ( project ) ) ; } catch ( org.eclipse.jgit.errors.RepositoryNotFoundException e ) { throw new com.google.gerrit.server.project.NoSuchProjectException ( project ) ; } openRepos.put ( project , repo ) ; } return repo ; }

Target:
private com.google.gerrit.server.git.MergeOp.OpenRepo openRepo ( com.google.gerrit.reviewdb.client.Project.NameKey project ) throws com.google.gerrit.server.project.NoSuchProjectException , java.io.IOException { com.google.gerrit.server.git.MergeOp.OpenRepo repo = openRepos.get ( project ) ; if ( repo == null ) { com.google.gerrit.server.project.ProjectState projectState = projectCache.get ( project ) ; if ( projectState == null ) { throw new com.google.gerrit.server.project.NoSuchProjectException ( project ) ; } try { repo = new com.google.gerrit.server.git.MergeOp.OpenRepo ( repoManager.openRepository ( project ) , projectState ) ; } catch ( org.eclipse.jgit.errors.RepositoryNotFoundException e ) { throw new com.google.gerrit.server.project.NoSuchProjectException ( project ) ; } openRepos.put ( project , repo ) ; } return repo ; }
Source:
protected static void send ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse res , byte [ ] data ) throws java.io.IOException { if ( ( ( data.length ) > 256 ) && ( com.google.gwt.user.server.rpc.RPCServletUtils.acceptsGzipEncoding ( req ) ) ) { res.setHeader ( "Content-Encoding" , "gzip" ) ; data = com.google.gerrit.httpd.HtmlDomUtil.compress ( data ) ; } res.setContentLength ( data.length ) ; java.io.OutputStream out = res.getOutputStream ( ) ; try { out.write ( data ) ; } finally { out.close ( ) ; } }

Target:
protected static void send ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse res , byte [ ] data ) throws java.io.IOException { if ( ( ( data.length ) > 256 ) && ( com.google.gwtjsonrpc.server.RPCServletUtils.acceptsGzipEncoding ( req ) ) ) { res.setHeader ( "Content-Encoding" , "gzip" ) ; data = com.google.gerrit.httpd.HtmlDomUtil.compress ( data ) ; } res.setContentLength ( data.length ) ; java.io.OutputStream out = res.getOutputStream ( ) ; try { out.write ( data ) ; } finally { out.close ( ) ; } }
Source:
public java.lang.String format ( org.eclipse.jgit.lib.PersonIdent ident ) { java.text.DateFormat df = getDateFormat ( format ) ; java.util.TimeZone tz = ident.getTimeZone ( ) ; if ( tz == null ) { tz = org.eclipse.jgit.util.SystemReader.getInstance ( ) . getTimeZone ( ) ; } df.setTimeZone ( tz ) ; return df.format ( ident.getWhen ( ) ) ; }

Target:
public java.lang.String format ( org.eclipse.jgit.lib.PersonIdent ident ) { java.text.DateFormat df = getDateFormat ( format ) ; if ( ! ( fixedTz.isPresent ( ) ) ) { java.util.TimeZone tz = ident.getTimeZone ( ) ; if ( tz == null ) { tz = org.eclipse.jgit.util.SystemReader.getInstance ( ) . getTimeZone ( ) ; } df.setTimeZone ( tz ) ; } return df.format ( ident.getWhen ( ) ) ; }
Source:
private void sendCreateChange ( com.google.gerrit.server.git.BatchUpdate.Context ctx ) throws com.google.gerrit.common.errors.EmailException { com.google.gerrit.server.mail.CreateChangeSender cm = createChangeSenderFactory.create ( ctx.getProject ( ) , change.getId ( ) ) ; cm.setFrom ( ctx.getAccountId ( ) ) ; cm.setPatchSet ( patchSet , patchSetInfo ) ; cm.addReviewers ( recipients.getReviewers ( ) ) ; cm.addExtraCC ( recipients.getCcOnly ( ) ) ; cm.send ( ) ; }

Target:
private void sendCreateChange ( com.google.gerrit.server.git.BatchUpdate.Context ctx ) throws com.google.gerrit.common.errors.EmailException { com.google.gerrit.server.mail.send.CreateChangeSender cm = createChangeSenderFactory.create ( ctx.getProject ( ) , change.getId ( ) ) ; cm.setFrom ( ctx.getAccountId ( ) ) ; cm.setPatchSet ( patchSet , patchSetInfo ) ; cm.addReviewers ( recipients.getReviewers ( ) ) ; cm.addExtraCC ( recipients.getCcOnly ( ) ) ; cm.send ( ) ; }
Source:
public boolean isVisible ( ) { com.google.gerrit.reviewdb.client.AccountGroup accountGroup = com.google.gerrit.common.data.GroupDescriptions.toAccountGroup ( group ) ; return ( ( ( ( accountGroup != null ) && ( accountGroup.isVisibleToAll ( ) ) ) || ( ( user ) instanceof com.google.gerrit.server.InternalUser ) ) || ( user.getEffectiveGroups ( ) . contains ( group.getGroupUUID ( ) ) ) ) || ( isOwner ( ) ) ; }

Target:
public boolean isVisible ( ) { com.google.gerrit.reviewdb.client.AccountGroup accountGroup = com.google.gerrit.common.data.GroupDescriptions.toAccountGroup ( group ) ; return ( ( ( ( ( accountGroup != null ) && ( accountGroup.isVisibleToAll ( ) ) ) || ( ( user ) instanceof com.google.gerrit.server.InternalUser ) ) || ( user.getEffectiveGroups ( ) . contains ( group.getGroupUUID ( ) ) ) ) || ( isOwner ( ) ) ) || ( user.getCapabilities ( ) . canAdministrateServer ( ) ) ; }
Source:
private void fireEvent ( final com.google.gerrit.reviewdb.client.Change change , final com.google.gerrit.server.events.ChangeEvent event , final com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { dispatcher.fireEvent ( change , event , db ) ; }

Target:
private com.google.common.base.Supplier < com.google.gerrit.server.data.AccountAttribute > accountAttributeSupplier ( final com.google.common.base.Supplier < com.google.gerrit.server.account.AccountState > s ) { return com.google.common.base.Suppliers.memoize ( new com.google.common.base.Supplier < com.google.gerrit.server.data.AccountAttribute > ( ) { @ java.lang.Override public com.google.gerrit.server.data.AccountAttribute get ( ) { return eventFactory.asAccountAttribute ( s.get ( ) . getAccount ( ) ) ; } } ) ; }
Source:
private static void assertCommentInfo ( com.google.gerrit.extensions.api.changes.ReviewInput.CommentInput expected , com.google.gerrit.extensions.common.CommentInfo actual ) { com.google.common.truth.Truth.assertThat ( actual.line ) . isEqualTo ( expected.line ) ; com.google.common.truth.Truth.assertThat ( actual.message ) . isEqualTo ( expected.message ) ; com.google.common.truth.Truth.assertThat ( actual.inReplyTo ) . isEqualTo ( expected.inReplyTo ) ; if ( ( actual.side ) == null ) { com.google.common.truth.Truth.assertThat ( Comment.Side.REVISION ) . isEqualTo ( expected.side ) ; } }

Target:
private static void assertCommentInfo ( com.google.gerrit.extensions.api.changes.ReviewInput.CommentInput expected , com.google.gerrit.extensions.common.CommentInfo actual ) { com.google.common.truth.Truth.assertThat ( actual.line ) . isEqualTo ( expected.line ) ; com.google.common.truth.Truth.assertThat ( actual.message ) . isEqualTo ( expected.message ) ; com.google.common.truth.Truth.assertThat ( actual.inReplyTo ) . isEqualTo ( expected.inReplyTo ) ; if ( ( actual.side ) == null ) { com.google.common.truth.Truth.assertThat ( Side.REVISION ) . isEqualTo ( expected.side ) ; } }
Source:
public static com.google.gerrit.extensions.client.EditPreferencesInfo defaults ( ) { com.google.gerrit.extensions.client.EditPreferencesInfo i = new com.google.gerrit.extensions.client.EditPreferencesInfo ( ) ; i.tabSize = 8 ; i.lineLength = 100 ; i.cursorBlinkRate = 0 ; i.hideTopMenu = false ; i.showTabs = true ; i.showWhitespaceErrors = false ; i.syntaxHighlighting = true ; i.hideLineNumbers = false ; i.matchBrackets = true ; i.autoCloseBrackets = false ; i.theme = Theme.DEFAULT ; i.keyMapType = KeyMapType.DEFAULT ; return i ; }

Target:
public static com.google.gerrit.extensions.client.EditPreferencesInfo defaults ( ) { com.google.gerrit.extensions.client.EditPreferencesInfo i = new com.google.gerrit.extensions.client.EditPreferencesInfo ( ) ; i.tabSize = 8 ; i.lineLength = 100 ; i.cursorBlinkRate = 0 ; i.hideTopMenu = false ; i.showTabs = true ; i.showWhitespaceErrors = false ; i.syntaxHighlighting = true ; i.hideLineNumbers = false ; i.matchBrackets = true ; i.lineWrapping = false ; i.autoCloseBrackets = false ; i.theme = Theme.DEFAULT ; i.keyMapType = KeyMapType.DEFAULT ; return i ; }
Source:
void scheduleFullSync ( final com.google.gerrit.reviewdb.client.Project.NameKey project , final java.lang.String urlMatch , com.googlesource.gerrit.plugins.replication.ReplicationState state ) { if ( ! ( running ) ) { com.googlesource.gerrit.plugins.replication.ReplicationQueue.stateLog.warn ( "Replication plugin did not finish startup before event" , state ) ; return ; } for ( com.googlesource.gerrit.plugins.replication.Destination cfg : config.getDestinations ( ) ) { if ( cfg.wouldPushProject ( project ) ) { for ( org.eclipse.jgit.transport.URIish uri : cfg.getURIs ( project , urlMatch ) ) { cfg.schedule ( project , PushOne.ALL_REFS , uri , state ) ; } } } }

Target:
void scheduleFullSync ( final com.google.gerrit.reviewdb.client.Project.NameKey project , final java.lang.String urlMatch , com.googlesource.gerrit.plugins.replication.ReplicationState state ) { if ( ! ( running ) ) { stateLog.warn ( "Replication plugin did not finish startup before event" , state ) ; return ; } for ( com.googlesource.gerrit.plugins.replication.Destination cfg : config.getDestinations ( FilterType.ALL ) ) { if ( cfg.wouldPushProject ( project ) ) { for ( org.eclipse.jgit.transport.URIish uri : cfg.getURIs ( project , urlMatch ) ) { cfg.schedule ( project , PushOne.ALL_REFS , uri , state ) ; } } } }
Source:
public java.io.File resolve ( final java.lang.String path ) { if ( ( path != null ) && ( ! ( path.isEmpty ( ) ) ) ) { java.io.File loc = new java.io.File ( path ) ; if ( ! ( loc.isAbsolute ( ) ) ) { loc = new java.io.File ( site_path , path ) ; } try { return loc.getCanonicalFile ( ) ; } catch ( java.io.IOException e ) { return loc.getAbsoluteFile ( ) ; } } return null ; }

Target:
public java.nio.file.Path resolve ( java.lang.String path ) { if ( ( path != null ) && ( ! ( path.isEmpty ( ) ) ) ) { java.nio.file.Path loc = site_path.resolve ( path ) . normalize ( ) ; try { return loc.toRealPath ( ) ; } catch ( java.io.IOException e ) { return loc.toAbsolutePath ( ) ; } } return null ; }
Source:
public void newPatchSetOnWipChangeNotifyAllInReviewDb ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isFalse ( ) ; com.google.gerrit.acceptance.server.mail.StagedChange sc = stageWipChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) ; pushTo ( sc , "refs/for/master%wip,notify=ALL" , sc.owner ) ; assertThat ( sender ) . sent ( "newpatchset" , sc ) . notTo ( sc.owner ) . notTo ( sc.reviewerByEmail , sc.ccerByEmail ) . to ( sc.reviewer , sc.ccer ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) ; }

Target:
public void newPatchSetOnWipChangeToReadyInReviewDb ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isFalse ( ) ; com.google.gerrit.acceptance.server.mail.StagedChange sc = stageWipChange ( ) ; pushTo ( sc , "refs/for/master%ready" , sc.owner ) ; assertThat ( sender ) . sent ( "newpatchset" , sc ) . to ( sc.reviewer , sc.ccer ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) . noOneElse ( ) ; }
Source:
protected void onUnload ( ) { super . onUnload ( ) ; com.google.gerrit.client.Gerrit.setHeaderVisible ( true ) ; }

Target:
protected void onUnload ( ) { super . onUnload ( ) ; if ( ( cm ) != null ) { cm.getWrapperElement ( ) . removeFromParent ( ) ; } if ( ( resizeHandler ) != null ) { resizeHandler.removeHandler ( ) ; } com.google.gwt.user.client.Window.enableScrolling ( true ) ; com.google.gerrit.client.Gerrit.setHeaderVisible ( true ) ; com.google.gerrit.client.JumpKeys.enable ( true ) ; }
Source:
public int compare ( com.google.gerrit.server.project.ListBranches.BranchInfo a , com.google.gerrit.server.project.ListBranches.BranchInfo b ) { return a.ref.compareTo ( b.ref ) ; }

Target:
public int compare ( com.google.gerrit.server.project.ListBranches.BranchInfo a , com.google.gerrit.server.project.ListBranches.BranchInfo b ) { return com.google.common.collect.ComparisonChain.start ( ) . compareTrueFirst ( com.google.gerrit.server.project.ListBranches.BranchComparator.isHead ( a ) , com.google.gerrit.server.project.ListBranches.BranchComparator.isHead ( b ) ) . compareTrueFirst ( com.google.gerrit.server.project.ListBranches.BranchComparator.isConfig ( a ) , com.google.gerrit.server.project.ListBranches.BranchComparator.isConfig ( b ) ) . compare ( a.ref , b.ref ) . result ( ) ; }
Source:
private com.google.gerrit.reviewdb.client.Change findChange ( com.google.gerrit.extensions.common.ChangeInfo c ) throws com.google.gwtorm.server.OrmException { java.util.List < com.google.gerrit.reviewdb.client.Change > changes = com.google.gerrit.server.query.change.ChangeData.asChanges ( queryProvider.get ( ) . byBranchKey ( new com.google.gerrit.reviewdb.client.Branch.NameKey ( targetProject , com.googlesource.gerrit.plugins.importer.ReplayChangesStep.fullName ( c.branch ) ) , new com.google.gerrit.reviewdb.client.Change.Key ( c.changeId ) ) ) ; if ( changes.isEmpty ( ) ) { return null ; } return db.changes ( ) . get ( com.google.common.collect.Iterators.getOnlyElement ( changes.iterator ( ) ) . getId ( ) ) ; }

Target:
private com.google.gerrit.reviewdb.client.Change findChange ( com.google.gerrit.extensions.common.ChangeInfo c ) throws com.google.gwtorm.server.OrmException { java.util.List < com.google.gerrit.reviewdb.client.Change > changes = com.google.gerrit.server.query.change.ChangeData.asChanges ( queryProvider.get ( ) . byBranchKey ( new com.google.gerrit.reviewdb.client.Branch.NameKey ( targetProject , com.google.gerrit.reviewdb.client.RefNames.fullName ( c.branch ) ) , new com.google.gerrit.reviewdb.client.Change.Key ( c.changeId ) ) ) ; if ( changes.isEmpty ( ) ) { return null ; } return db.changes ( ) . get ( com.google.common.collect.Iterators.getOnlyElement ( changes.iterator ( ) ) . getId ( ) ) ; }
Source:
public void run ( ) { skipManager.removeAll ( ) ; chunkManager.reset ( ) ; diffTable.overview.clearDiffMarkers ( ) ; setShowIntraline ( prefs.intralineDifference ( ) ) ; render ( diff ) ; skipManager.render ( prefs.context ( ) , diff ) ; }

Target:
public void run ( ) { skipManager.removeAll ( ) ; chunkManager.reset ( ) ; diffTable.overview.clearDiffMarkers ( ) ; setShowIntraline ( prefs.intralineDifference ( ) ) ; render ( diff ) ; chunkManager.adjustPadding ( ) ; skipManager.render ( prefs.context ( ) , diff ) ; }
Source:
public void visit ( org.pegdown.ast.StrongEmphSuperNode node ) { if ( node.isClosed ( ) ) { wrapChildren ( ( node.isStrong ( ) ? "strong" : "em" ) , node ) ; } else { html.appendAndEscape ( node.getChars ( ) ) ; visitChildren ( node ) ; } }

Target:
public void visit ( org.commonmark.node.FencedCodeBlock node ) { codeInPre ( node.getInfo ( ) , node.getLiteral ( ) ) ; }
Source:
public void queryChangesMultipleTerms ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r1 = createChange ( ) ; createChange ( ) ; java.util.List < com.google.gerrit.extensions.common.ChangeInfo > results = query ( ( "status:open " + ( r1.getChangeId ( ) ) ) ) ; com.google.common.truth.Truth.assertThat ( com.google.common.collect.Iterables.getOnlyElement ( results ) . changeId ) . isEqualTo ( r1.getChangeId ( ) ) ; }

Target:
public void queryChangesStart ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r1 = createChange ( ) ; createChange ( ) ; java.util.List < com.google.gerrit.extensions.common.ChangeInfo > results = gApi.changes ( ) . query ( ( ( "project:{" + ( project.get ( ) ) ) + "}" ) ) . withStart ( 1 ) . get ( ) ; com.google.common.truth.Truth.assertThat ( com.google.common.collect.Iterables.getOnlyElement ( results ) . changeId ) . isEqualTo ( r1.getChangeId ( ) ) ; }
Source:
public void inheritRead_SingleBranchDoesNotOverrideInherited ( ) { com.google.gerrit.server.project.Util.allow ( parent , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/*" ) ; com.google.gerrit.server.project.Util.allow ( parent , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/for/refs/*" ) ; com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/foobar" ) ; com.google.gerrit.server.project.ProjectControl u = user ( local ) ; assertCanUpload ( u ) ; assertCreateChange ( "refs/heads/master" , u ) ; assertCreateChange ( "refs/heads/foobar" , u ) ; }

Target:
public void inheritRead_SingleBranchDoesNotOverrideInherited ( ) { com.google.gerrit.server.project.testing.Util.allow ( parent , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/*" ) ; com.google.gerrit.server.project.testing.Util.allow ( parent , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/for/refs/*" ) ; com.google.gerrit.server.project.testing.Util.allow ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/foobar" ) ; com.google.gerrit.server.project.ProjectControl u = user ( local ) ; assertCanUpload ( u ) ; assertCreateChange ( "refs/heads/master" , u ) ; assertCreateChange ( "refs/heads/foobar" , u ) ; }
Source:
public void execute ( ) throws com.google.gwtorm.server.OrmException , java.io.IOException { if ( migration.failChangeWrites ( ) ) { throw new com.google.gwtorm.server.OrmException ( com.google.gerrit.server.notedb.NoteDbUpdateManager.CHANGES_READ_ONLY ) ; } if ( isEmpty ( ) ) { return ; } try ( com.google.gerrit.metrics.Timer1.Context timer = metrics.updateLatency.start ( com.google.gerrit.server.notedb.NoteDbTable.CHANGES ) ) { stage ( ) ; execute ( changeRepo ) ; execute ( allUsersRepo ) ; } finally { close ( ) ; } }

Target:
public org.eclipse.jgit.lib.BatchRefUpdate execute ( ) throws com.google.gwtorm.server.OrmException , java.io.IOException { return execute ( false ) ; }
Source:
final void onResult ( final java.lang.Object result ) { cancel ( ) ; final R obj ; try { obj = serializer.fromJson ( result ) ; } catch ( java.lang.RuntimeException e ) { callback.onFailure ( e ) ; return ; } callback.onSuccess ( obj ) ; }

Target:
final void onResult ( final java.lang.Object result ) { cancel ( ) ; com.google.gwtjsonrpc.client.JsonUtil.invoke ( serializer , callback , result ) ; }
Source:
public boolean indexAccount ( final int accountId ) { return new com.ericsson.gerrit.plugins.highavailability.forwarder.rest.RestForwarder.Request ( ( "index account " + accountId ) ) { @ java.lang.Override com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpResponseHandler.HttpResult send ( ) throws java.io.IOException { return httpSession.post ( com.google.common.base.Joiner.on ( "/" ) . join ( pluginRelativePath , "index/account" , accountId ) ) ; } } . execute ( ) ; }

Target:
public boolean indexAccount ( final int accountId ) { return new com.ericsson.gerrit.plugins.highavailability.forwarder.rest.RestForwarder.Request ( "index account" , accountId ) { @ java.lang.Override com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpResponseHandler.HttpResult send ( ) throws java.io.IOException { return httpSession.post ( com.google.common.base.Joiner.on ( "/" ) . join ( pluginRelativePath , "index/account" , accountId ) ) ; } } . execute ( ) ; }
Source:
private void initIncludedInAction ( com.google.gerrit.client.info.ChangeInfo info ) { if ( ( info.status ( ) ) == ( com.google.gerrit.reviewdb.client.Change.Status.MERGED ) ) { includedInAction = new com.google.gerrit.client.change.IncludedInAction ( info.legacyId ( ) , style , headerLine , includedIn ) ; includedIn.setVisible ( true ) ; } }

Target:
private void initIncludedInAction ( com.google.gerrit.client.info.ChangeInfo info ) { if ( ( info.status ( ) ) == ( com.google.gerrit.reviewdb.client.Change.Status.MERGED ) ) { includedInAction = new com.google.gerrit.client.change.IncludedInAction ( info.projectNameKey ( ) , info.legacyId ( ) , style , headerLine , includedIn ) ; includedIn.setVisible ( true ) ; } }
Source:
private void initCompression ( ) { setCompressionFactories ( java.util.Arrays.< org.apache.sshd.common.NamedFactory < org.apache.sshd.common.Compression > > asList ( new org.apache.sshd.common.compression.CompressionNone.Factory ( ) ) ) ; }

Target:
private void initCompression ( boolean enableCompression ) { java.util.List < org.apache.sshd.common.NamedFactory < org.apache.sshd.common.Compression > > compressionFactories = com.google.common.collect.Lists.newArrayList ( ) ; compressionFactories.add ( new org.apache.sshd.common.compression.CompressionNone.Factory ( ) ) ; if ( enableCompression ) { compressionFactories.add ( new org.apache.sshd.common.compression.CompressionZlib.Factory ( ) ) ; } setCompressionFactories ( compressionFactories ) ; }
Source:
public void topic ( java.lang.String topic ) throws com.google.gerrit.extensions.restapi.RestApiException { com.google.gerrit.server.change.PutTopic.Input in = new com.google.gerrit.server.change.PutTopic.Input ( ) ; in.topic = topic ; try { putTopic.apply ( change , in ) ; } catch ( java.lang.Exception e ) { com.google.gerrit.server.api.changes.ChangeApiImpl.throwRestApiException ( "Cannot set topic" , e ) ; } }

Target:
public void topic ( java.lang.String topic ) throws com.google.gerrit.extensions.restapi.RestApiException { com.google.gerrit.server.change.PutTopic.Input in = new com.google.gerrit.server.change.PutTopic.Input ( ) ; in.topic = topic ; try { putTopic.apply ( change , in ) ; } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( "Cannot set topic" , e ) ; } }
Source:
public void missingOwner ( ) throws java.lang.Exception { com.google.gerrit.acceptance.TestAccount owner = accounts.create ( "missing" ) ; com.google.gerrit.server.project.ChangeControl ctl = insertChange ( owner ) ; db.accounts ( ) . deleteKeys ( java.util.Collections.singleton ( owner.getId ( ) ) ) ; assertProblems ( ctl , null , com.google.gerrit.acceptance.server.change.ConsistencyCheckerIT.problem ( ( "Missing change owner: " + ( owner.getId ( ) ) ) ) ) ; }

Target:
public void missingOwner ( ) throws java.lang.Exception { com.google.gerrit.acceptance.TestAccount owner = accounts.create ( "missing" ) ; com.google.gerrit.server.project.ChangeControl ctl = insertChange ( owner ) ; accountsUpdate.create ( ) . deleteByKey ( db , owner.getId ( ) ) ; assertProblems ( ctl , null , com.google.gerrit.acceptance.server.change.ConsistencyCheckerIT.problem ( ( "Missing change owner: " + ( owner.getId ( ) ) ) ) ) ; }
Source:
private static com.google.gerrit.server.account.AccountState missing ( com.google.gerrit.reviewdb.client.Account.Id accountId ) { com.google.gerrit.reviewdb.client.Account account = new com.google.gerrit.reviewdb.client.Account ( accountId , com.google.gerrit.common.TimeUtil.nowTs ( ) ) ; java.util.Collection < com.google.gerrit.reviewdb.client.AccountExternalId > ids = java.util.Collections.emptySet ( ) ; java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.UUID > anon = com.google.common.collect.ImmutableSet.of ( ) ; return new com.google.gerrit.server.account.AccountState ( account , anon , ids ) ; }

Target:
private static com.google.gerrit.server.account.AccountState missing ( com.google.gerrit.reviewdb.client.Account.Id accountId ) { com.google.gerrit.reviewdb.client.Account account = new com.google.gerrit.reviewdb.client.Account ( accountId , com.google.gerrit.common.TimeUtil.nowTs ( ) ) ; account.setActive ( false ) ; java.util.Collection < com.google.gerrit.reviewdb.client.AccountExternalId > ids = java.util.Collections.emptySet ( ) ; java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.UUID > anon = com.google.common.collect.ImmutableSet.of ( ) ; return new com.google.gerrit.server.account.AccountState ( account , anon , ids ) ; }
Source:
public PerThreadRequestScope.Scoper provideScoper ( final com.google.gerrit.server.git.PerThreadRequestScope.Propagator propagator ) { final com.google.gerrit.server.util.RequestContext requestContext = new com.google.gerrit.server.util.RequestContext ( ) { @ java.lang.Override public com.google.gerrit.server.CurrentUser getCurrentUser ( ) { throw new com.google.inject.OutOfScopeException ( "No user on merge thread" ) ; } } ; return new com.google.gerrit.server.git.PerThreadRequestScope.Scoper ( ) { @ java.lang.Override public < T > java.util.concurrent.Callable < T > scope ( java.util.concurrent.Callable < T > callable ) { return propagator.scope ( requestContext , callable ) ; } } ; }

Target:
public PerThreadRequestScope.Scoper provideScoper ( final com.google.gerrit.server.git.PerThreadRequestScope.Propagator propagator , final com.google.inject.Provider < com.google.gerrit.server.config.RequestScopedReviewDbProvider > dbProvider ) { final com.google.gerrit.server.util.RequestContext requestContext = new com.google.gerrit.server.util.RequestContext ( ) { @ java.lang.Override public com.google.gerrit.server.CurrentUser getCurrentUser ( ) { throw new com.google.inject.OutOfScopeException ( "No user on merge thread" ) ; } @ java.lang.Override public com.google.inject.Provider < com.google.gerrit.reviewdb.server.ReviewDb > getReviewDbProvider ( ) { return dbProvider.get ( ) ; } } ; return new com.google.gerrit.server.git.PerThreadRequestScope.Scoper ( ) { @ java.lang.Override public < T > java.util.concurrent.Callable < T > scope ( java.util.concurrent.Callable < T > callable ) { return propagator.scope ( requestContext , callable ) ; } } ; }
Source:
public void testCopy ( ) { final com.google.gerrit.server.query.OperatorPredicate < java.lang.String > f = f ( "author" , "alice" ) ; org.junit.Assert.assertSame ( f , f.copy ( java.util.Collections.< com.google.gerrit.server.query.Predicate < java.lang.String > > emptyList ( ) ) ) ; org.junit.Assert.assertSame ( f , f.copy ( f.getChildren ( ) ) ) ; exception.expect ( java.lang.IllegalArgumentException.class ) ; exception.expectMessage ( "Expected 0 children" ) ; f.copy ( java.util.Collections.singleton ( f ( "owner" , "bob" ) ) ) ; }

Target:
public void testCopy ( ) { final com.google.gerrit.index.query.OperatorPredicate < java.lang.String > f = f ( "author" , "alice" ) ; org.junit.Assert.assertSame ( f , f.copy ( java.util.Collections.< com.google.gerrit.index.query.Predicate < java.lang.String > > emptyList ( ) ) ) ; org.junit.Assert.assertSame ( f , f.copy ( f.getChildren ( ) ) ) ; exception.expect ( java.lang.IllegalArgumentException.class ) ; exception.expectMessage ( "Expected 0 children" ) ; f.copy ( java.util.Collections.singleton ( f ( "owner" , "bob" ) ) ) ; }
Source:
public void onDoubleClick ( com.google.gwt.event.dom.client.DoubleClickEvent arg0 ) { editArea.setText ( contentPanelMessage.getText ( ) ) ; setEdit ( ( ! ( isEdit ( ) ) ) ) ; runClickCallback ( ) ; }

Target:
public void onSuccess ( com.google.gerrit.client.changes.CommentInfo result ) { updateOriginal ( result ) ; setEdit ( false ) ; setMessageText ( message ) ; setDate ( result.updated ( ) ) ; resizePaddingWidget ( ) ; if ( isNew ) { removeStyleName ( draftStyle.newDraft ( ) ) ; isNew = false ; } }
Source:
private void sendMarkdownAsHtml ( java.lang.String md , int lastModified , javax.servlet.http.HttpServletResponse res ) throws java.io.IOException { byte [ ] html = new com.google.gerrit.server.documentation.MarkdownFormatter ( ) . suppressHtml ( ) . markdownToDocHtml ( replaceMacros ( md ) , java.nio.charset.StandardCharsets.UTF_8.name ( ) ) ; res.setDateHeader ( "Last-Modified" , lastModified ) ; res.setContentType ( "text/html" ) ; res.setCharacterEncoding ( java.nio.charset.StandardCharsets.UTF_8.name ( ) ) ; res.setContentLength ( html.length ) ; res.getOutputStream ( ) . write ( html ) ; }

Target:
private static java.lang.String computeETag ( com.google.gerrit.reviewdb.client.Project.NameKey project , org.eclipse.jgit.lib.ObjectId revId , java.lang.String file ) { return com.google.common.hash.Hashing.md5 ( ) . newHasher ( ) . putUnencodedChars ( project.get ( ) ) . putUnencodedChars ( revId.getName ( ) ) . putUnencodedChars ( file ) . hash ( ) . toString ( ) ; }
Source:
private java.lang.String setTopic ( int sourceId , java.lang.String topic ) throws com.google.gerrit.extensions.restapi.RestApiException { if ( ( topic == null ) || ( topic.isEmpty ( ) ) ) { topic = "am-" + ( java.util.UUID.randomUUID ( ) . toString ( ) ) ; com.googlesource.gerrit.plugins.automerger.DownstreamCreator.log.debug ( "Setting original change topic to {}" , sourceId , topic ) ; gApi.changes ( ) . id ( sourceId ) . topic ( topic ) ; } return topic ; }

Target:
public java.lang.String getOrSetTopic ( int sourceId , java.lang.String topic ) throws com.google.gerrit.extensions.restapi.RestApiException { if ( ( topic == null ) || ( topic.isEmpty ( ) ) ) { topic = "am-" + ( java.util.UUID.randomUUID ( ) . toString ( ) ) ; com.googlesource.gerrit.plugins.automerger.DownstreamCreator.log.debug ( "Setting original change topic to {}" , sourceId , topic ) ; gApi.changes ( ) . id ( sourceId ) . topic ( topic ) ; } return topic ; }
Source:
private static com.google.gerrit.reviewdb.Account oneAccount ( final com.google.gwtorm.client.ResultSet < com.google.gerrit.reviewdb.Account > rs ) { final java.util.List < com.google.gerrit.reviewdb.Account > r = rs.toList ( ) ; return ( r.size ( ) ) == 1 ? r.get ( 0 ) : null ; }

Target:
public com.google.gerrit.reviewdb.Account findByNameOrEmail ( final java.lang.String nameOrEmail ) throws com.google.gwtorm.client.OrmException { java.util.Set < com.google.gerrit.reviewdb.Account.Id > r = findAllByNameOrEmail ( nameOrEmail ) ; return ( r.size ( ) ) == 1 ? byId.get ( r.iterator ( ) . next ( ) ) . getAccount ( ) : null ; }
Source:
public org.apache.lucene.search.Query toQuery ( com.google.gerrit.server.query.Predicate < V > p ) throws com.google.gerrit.index.query.QueryParseException { if ( p instanceof com.google.gerrit.server.query.AndPredicate ) { return and ( p ) ; } else if ( p instanceof com.google.gerrit.server.query.OrPredicate ) { return or ( p ) ; } else if ( p instanceof com.google.gerrit.server.query.NotPredicate ) { return not ( p ) ; } else if ( p instanceof com.google.gerrit.server.index.IndexPredicate ) { return fieldQuery ( ( ( com.google.gerrit.server.index.IndexPredicate < V > ) ( p ) ) ) ; } else { throw new com.google.gerrit.index.query.QueryParseException ( ( "cannot create query for index: " + p ) ) ; } }

Target:
public org.apache.lucene.search.Query toQuery ( com.google.gerrit.index.query.Predicate < V > p ) throws com.google.gerrit.index.query.QueryParseException { if ( p instanceof com.google.gerrit.index.query.AndPredicate ) { return and ( p ) ; } else if ( p instanceof com.google.gerrit.index.query.OrPredicate ) { return or ( p ) ; } else if ( p instanceof com.google.gerrit.index.query.NotPredicate ) { return not ( p ) ; } else if ( p instanceof com.google.gerrit.index.query.IndexPredicate ) { return fieldQuery ( ( ( com.google.gerrit.index.query.IndexPredicate < V > ) ( p ) ) ) ; } else { throw new com.google.gerrit.index.query.QueryParseException ( ( "cannot create query for index: " + p ) ) ; } }
Source:
private boolean markKeyInvalid ( int seq ) { checkLoaded ( ) ; com.google.gerrit.server.account.AccountSshKey key = getKey ( seq ) ; if ( ( key != null ) && ( key.isValid ( ) ) ) { key.setInvalid ( ) ; return true ; } return false ; }

Target:
private boolean markKeyInvalid ( int seq ) { checkLoaded ( ) ; java.util.Optional < com.google.gerrit.server.account.AccountSshKey > key = keys.get ( ( seq - 1 ) ) ; if ( ( key.isPresent ( ) ) && ( key.get ( ) . valid ( ) ) ) { keys.set ( ( seq - 1 ) , java.util.Optional.of ( com.google.gerrit.server.account.AccountSshKey.createInvalid ( key.get ( ) ) ) ) ; return true ; } return false ; }
Source:
private static java.io.File getLauncherLoadedFrom ( ) { try { return com.google.gerrit.launcher.GerritLauncher.getDistributionArchive ( ) ; } catch ( java.io.IOException e ) { if ( ( e instanceof java.io.FileNotFoundException ) && ( GerritLauncher.NOT_ARCHIVED.equals ( e.getMessage ( ) ) ) ) { return null ; } else { com.google.inject.ProvisionException pe = new com.google.inject.ProvisionException ( "Error reading gerrit.war" ) ; pe.initCause ( e ) ; throw pe ; } } }

Target:
private java.nio.file.FileSystem getDistributionArchive ( ) throws java.io.IOException { java.io.File war ; try { war = com.google.gerrit.launcher.GerritLauncher.getDistributionArchive ( ) ; } catch ( java.io.IOException e ) { if ( ( e instanceof java.io.FileNotFoundException ) && ( GerritLauncher.NOT_ARCHIVED.equals ( e.getMessage ( ) ) ) ) { return null ; } else { com.google.inject.ProvisionException pe = new com.google.inject.ProvisionException ( "Error reading gerrit.war" ) ; pe.initCause ( e ) ; throw pe ; } } return com.google.gerrit.launcher.GerritLauncher.getZipFileSystem ( war.toPath ( ) ) ; }
Source:
private void setDefaultRenderer ( javax.servlet.FilterConfig filterConfig ) { if ( ( renderer ) == null ) { renderer = new com.google.gitiles.DefaultRenderer ( ( ( filterConfig.getServletContext ( ) . getContextPath ( ) ) + ( com.google.gitiles.GitilesServlet.STATIC_PREFIX ) ) , com.google.gitiles.Renderer.toFileURL ( config.getString ( "gitiles" , null , "customTemplates" ) ) , com.google.common.base.Objects.firstNonNull ( config.getString ( "gitiles" , null , "siteTitle" ) , "Gitiles" ) ) ; } }

Target:
private void setDefaultRenderer ( javax.servlet.FilterConfig filterConfig ) { if ( ( renderer ) == null ) { renderer = new com.google.gitiles.DefaultRenderer ( ( ( filterConfig.getServletContext ( ) . getContextPath ( ) ) + ( com.google.gitiles.GitilesServlet.STATIC_PREFIX ) ) , com.google.common.collect.FluentIterable.from ( java.util.Arrays.asList ( config.getStringList ( "gitiles" , null , "customTemplates" ) ) ) . transform ( new com.google.gitiles.Renderer.FileUrlMapper ( ) ) , com.google.common.base.Objects.firstNonNull ( config.getString ( "gitiles" , null , "siteTitle" ) , "Gitiles" ) ) ; } }
Source:
private java.util.Map < java.lang.String , com.google.gerrit.reviewdb.client.PatchLineComment > patchSetDrafts ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx ) throws com.google.gwtorm.server.OrmException { java.util.Map < java.lang.String , com.google.gerrit.reviewdb.client.PatchLineComment > drafts = com.google.common.collect.Maps.newHashMap ( ) ; for ( com.google.gerrit.reviewdb.client.PatchLineComment c : plcUtil.draftByPatchSetAuthor ( ctx.getDb ( ) , psId , user.getAccountId ( ) , ctx.getChangeNotes ( ) ) ) { drafts.put ( c.getKey ( ) . get ( ) , c ) ; } return drafts ; }

Target:
private java.util.Map < java.lang.String , com.google.gerrit.reviewdb.client.PatchLineComment > changeDrafts ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx ) throws com.google.gwtorm.server.OrmException { java.util.Map < java.lang.String , com.google.gerrit.reviewdb.client.PatchLineComment > drafts = new java.util.HashMap < > ( ) ; for ( com.google.gerrit.reviewdb.client.PatchLineComment c : plcUtil.draftByChangeAuthor ( ctx.getDb ( ) , ctx.getNotes ( ) , user.getAccountId ( ) ) ) { c.setTag ( in.tag ) ; drafts.put ( c.getKey ( ) . get ( ) , c ) ; } return drafts ; }
Source:
private com.google.gerrit.server.IdentifiedUser createUser ( final com.google.gerrit.sshd.SshSession sd , final com.google.gerrit.server.account.AccountState state ) { return userFactory.create ( AccessPath.SSH , new com.google.inject.Provider < java.net.SocketAddress > ( ) { @ java.lang.Override public java.net.SocketAddress get ( ) { return sd.getRemoteAddress ( ) ; } } , state.getAccount ( ) . getId ( ) ) ; }

Target:
private com.google.gerrit.server.IdentifiedUser createUser ( final com.google.gerrit.sshd.SshSession sd , final com.google.gerrit.server.account.AccountState state ) { return userFactory.create ( AccessPath.SSH_COMMAND , new com.google.inject.Provider < java.net.SocketAddress > ( ) { @ java.lang.Override public java.net.SocketAddress get ( ) { return sd.getRemoteAddress ( ) ; } } , state.getAccount ( ) . getId ( ) ) ; }
Source:
protected void configure ( ) { bind ( java.util.concurrent.Executor.class ) . annotatedWith ( com.googlesource.gerrit.plugins.webhooks.WebHooksExecutor.class ) . toProvider ( com.googlesource.gerrit.plugins.webhooks.ExecutorProvider.class ) ; bind ( com.googlesource.gerrit.plugins.webhooks.Configuration.class ) . in ( Scopes.SINGLETON ) ; bind ( org.apache.http.impl.client.CloseableHttpClient.class ) . toProvider ( com.googlesource.gerrit.plugins.webhooks.HttpClientProvider.class ) . in ( Scopes.SINGLETON ) ; factory ( PostEventTask.Factory.class ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.common.EventListener.class ) . to ( com.googlesource.gerrit.plugins.webhooks.EventHandler.class ) ; }

Target:
protected void configure ( ) { bind ( java.util.concurrent.Executor.class ) . annotatedWith ( com.googlesource.gerrit.plugins.webhooks.WebHooksExecutor.class ) . toProvider ( com.googlesource.gerrit.plugins.webhooks.ExecutorProvider.class ) ; bind ( com.googlesource.gerrit.plugins.webhooks.Configuration.class ) . in ( Scopes.SINGLETON ) ; bind ( org.apache.http.impl.client.CloseableHttpClient.class ) . toProvider ( com.googlesource.gerrit.plugins.webhooks.HttpClientProvider.class ) . in ( Scopes.SINGLETON ) ; factory ( PostTask.Factory.class ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.common.EventListener.class ) . to ( com.googlesource.gerrit.plugins.webhooks.EventHandler.class ) ; }
Source:
public void listTasksWithoutViewQueueCapability ( ) throws java.lang.Exception { com.google.gerrit.acceptance.RestResponse r = userSession.get ( "/config/server/tasks/" ) ; r.assertOK ( ) ; java.util.List < com.google.gerrit.server.config.ListTasks.TaskInfo > result = newGson ( ) . fromJson ( r.getReader ( ) , new com.google.gson.reflect.TypeToken < java.util.List < com.google.gerrit.server.config.ListTasks.TaskInfo > > ( ) { } . getType ( ) ) ; com.google.common.truth.Truth.assertThat ( result ) . isEmpty ( ) ; }

Target:
public void listTasksWithoutViewQueueCapability ( ) throws java.lang.Exception { com.google.gerrit.acceptance.RestResponse r = userRestSession.get ( "/config/server/tasks/" ) ; r.assertOK ( ) ; java.util.List < com.google.gerrit.server.config.ListTasks.TaskInfo > result = newGson ( ) . fromJson ( r.getReader ( ) , new com.google.gson.reflect.TypeToken < java.util.List < com.google.gerrit.server.config.ListTasks.TaskInfo > > ( ) { } . getType ( ) ) ; com.google.common.truth.Truth.assertThat ( result ) . isEmpty ( ) ; }
Source:
protected void configure ( ) { bind ( com.google.gerrit.server.index.ChangeIndexer.class ) . to ( com.google.gerrit.server.index.ChangeIndexerImpl.class ) ; bind ( com.google.gerrit.server.query.change.IndexRewrite.class ) . to ( com.google.gerrit.server.query.change.IndexRewriteImpl.class ) ; bind ( new com.google.inject.TypeLiteral < com.google.gerrit.server.index.Schema < com.google.gerrit.server.query.change.ChangeData > > ( ) { } ) . toInstance ( com.google.gerrit.server.index.ChangeSchemas.getLatestRelease ( ) ) ; com.google.gerrit.extensions.registration.DynamicSet.setOf ( binder ( ) , com.google.gerrit.server.index.ChangeIndex.class ) ; com.google.gerrit.extensions.registration.DynamicItem.itemOf ( binder ( ) , com.google.gerrit.server.index.ChangeIndex.class ) ; }

Target:
protected void configure ( ) { bind ( com.google.gerrit.server.index.ChangeIndexer.class ) . to ( com.google.gerrit.server.index.ChangeIndexerImpl.class ) ; bind ( com.google.gerrit.server.query.change.ChangeQueryRewriter.class ) . to ( com.google.gerrit.server.index.IndexRewriteImpl.class ) ; bind ( IndexRewriteImpl.BasicRewritesImpl.class ) ; bind ( com.google.gerrit.server.index.IndexCollection.class ) ; listener ( ) . to ( com.google.gerrit.server.index.IndexCollection.class ) ; }
Source:
public com.google.gerrit.reviewdb.client.Change reloadChange ( ) throws com.google.gwtorm.server.OrmException { if ( ( project ) == null ) { notes = notesFactory.createFromIdOnlyWhenNotedbDisabled ( db , legacyId ) ; } else { notes = notesFactory.create ( db , project , legacyId ) ; } change = notes.getChange ( ) ; if ( ( change ) == null ) { throw new com.google.gwtorm.server.OrmException ( ( "Unable to load change " + ( legacyId ) ) ) ; } return change ; }

Target:
public com.google.gerrit.reviewdb.client.Change reloadChange ( ) throws com.google.gwtorm.server.OrmException { if ( ( project ) == null ) { notes = notesFactory.createFromIdOnlyWhenNoteDbDisabled ( db , legacyId ) ; } else { notes = notesFactory.create ( db , project , legacyId ) ; } change = notes.getChange ( ) ; if ( ( change ) == null ) { throw new com.google.gwtorm.server.OrmException ( ( "Unable to load change " + ( legacyId ) ) ) ; } return change ; }
Source:
public void addApprovals ( com.google.gerrit.server.events.PatchSetAttribute p , java.util.Collection < com.google.gerrit.reviewdb.PatchSetApproval > list ) { if ( ! ( list.isEmpty ( ) ) ) { p.approvals = new java.util.ArrayList < com.google.gerrit.server.events.ApprovalAttribute > ( list.size ( ) ) ; for ( com.google.gerrit.reviewdb.PatchSetApproval a : list ) { if ( ( a.getValue ( ) ) != 0 ) { p.approvals.add ( asApprovalAttribute ( a ) ) ; } } if ( p.approvals.isEmpty ( ) ) { p.approvals = null ; } } }

Target:
public void addPatchSetComments ( com.google.gerrit.server.events.PatchSetAttribute patchSetAttribute , java.util.Collection < com.google.gerrit.reviewdb.client.PatchLineComment > patchLineComments ) { for ( com.google.gerrit.reviewdb.client.PatchLineComment comment : patchLineComments ) { if ( ( comment.getKey ( ) . getParentKey ( ) . getParentKey ( ) . get ( ) ) == ( java.lang.Integer.parseInt ( patchSetAttribute.number ) ) ) { if ( ( patchSetAttribute.comments ) == null ) { patchSetAttribute.comments = new java.util.ArrayList < com.google.gerrit.server.events.PatchSetCommentAttribute > ( ) ; } patchSetAttribute.comments.add ( asPatchSetLineAttribute ( comment ) ) ; } } }
Source:
public com.google.gerrit.client.rpc.RestApi data ( com.google.gwt.core.client.JavaScriptObject obj ) { return data ( new com.google.gwt.json.client.JSONObject ( obj ) ) ; }

Target:
private < T extends com.google.gwt.core.client.JavaScriptObject > void send ( com.google.gwt.http.client.RequestBuilder.Method method , com.google.gwt.user.client.rpc.AsyncCallback < T > cb ) { com.google.gerrit.client.rpc.RestApi.HttpCallback < T > httpCallback = new com.google.gerrit.client.rpc.RestApi.HttpCallback < T > ( cb ) ; try { RpcStatus.INSTANCE.onRpcStart ( ) ; request ( method ) . sendRequest ( null , httpCallback ) ; } catch ( com.google.gwt.http.client.RequestException e ) { httpCallback.onError ( null , e ) ; } }
Source:
protected void runImpl ( ) throws java.io.IOException { final org.eclipse.jgit.transport.UploadPack up = new org.eclipse.jgit.transport.UploadPack ( repo ) ; up.upload ( in , out , err ) ; }

Target:
protected void runImpl ( ) throws java.io.IOException { final org.eclipse.jgit.transport.UploadPack up = new org.eclipse.jgit.transport.UploadPack ( repo ) ; if ( ! ( projectControl.allRefsAreVisible ( ) ) ) { up.setRefFilter ( new com.google.gerrit.server.git.VisibleRefFilter ( repo , projectControl , db ) ) ; } up.upload ( in , out , err ) ; }
Source:
private void computeInsertedDeleted ( ) { inserted = 0 ; deleted = 0 ; for ( int i = 0 ; i < ( list.length ( ) ) ; i ++ ) { com.google.gerrit.client.diff.FileInfo info = list.get ( i ) ; if ( ( ! ( Patch.COMMIT_MSG.equals ( info.path ( ) ) ) ) && ( ! ( info.binary ( ) ) ) ) { inserted += info.lines_inserted ( ) ; deleted += info.lines_deleted ( ) ; } } }

Target:
private void computeInsertedDeleted ( ) { inserted = 0 ; deleted = 0 ; for ( int i = 0 ; i < ( list.length ( ) ) ; i ++ ) { com.google.gerrit.client.diff.FileInfo info = list.get ( i ) ; if ( ( ! ( Patch.COMMIT_MSG.equals ( info.path ( ) ) ) ) && ( ! ( info.binary ( ) ) ) ) { inserted += info.linesInserted ( ) ; deleted += info.linesDeleted ( ) ; } } }
Source:
private com.google.gerrit.server.IdentifiedUser createNew ( ) { com.google.gerrit.server.IdentifiedUser user = createMock ( com.google.gerrit.server.IdentifiedUser.class ) ; expect ( user.isIdentifiedUser ( ) ) . andReturn ( true ) ; expect ( user.asIdentifiedUser ( ) ) . andReturn ( user ) ; expect ( user.getEffectiveGroups ( ) ) . andReturn ( new com.googlesource.gerrit.plugins.uploadvalidator.FakeGroupMembership ( groupUUID ) ) ; replay ( user ) ; return user ; }

Target:
private com.google.gerrit.server.IdentifiedUser createNew ( ) { com.google.gerrit.server.IdentifiedUser user = org.easymock.EasyMock.createMock ( com.google.gerrit.server.IdentifiedUser.class ) ; org.easymock.EasyMock.expect ( user.isIdentifiedUser ( ) ) . andReturn ( true ) ; org.easymock.EasyMock.expect ( user.asIdentifiedUser ( ) ) . andReturn ( user ) ; org.easymock.EasyMock.expect ( user.getEffectiveGroups ( ) ) . andReturn ( new com.googlesource.gerrit.plugins.uploadvalidator.FakeGroupMembership ( groupUUID ) ) ; org.easymock.EasyMock.replay ( user ) ; return user ; }
Source:
public void testDuplicateCompoundIndexOnlyPredicates ( ) throws java.lang.Exception { com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > in = parse ( "(status:new OR file:a) bar:p file:b" ) ; com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > out = rewrite ( in ) ; org.junit.Assert.assertSame ( com.google.gerrit.server.query.change.AndSource.class , out.getClass ( ) ) ; org.junit.Assert.assertEquals ( com.google.common.collect.ImmutableList.of ( query ( com.google.gerrit.server.query.Predicate.and ( in.getChild ( 0 ) , in.getChild ( 2 ) ) ) , in.getChild ( 1 ) ) , out.getChildren ( ) ) ; }

Target:
public void testDuplicateCompoundIndexOnlyPredicates ( ) throws java.lang.Exception { com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > in = parse ( "(status:new OR file:a) bar:p file:b" ) ; com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > out = rewrite ( in ) ; com.google.common.truth.Truth.assertThat ( out.getClass ( ) ) . isEqualTo ( com.google.gerrit.server.query.change.AndSource.class ) ; com.google.common.truth.Truth.assertThat ( out.getChildren ( ) ) . containsExactly ( query ( com.google.gerrit.server.query.Predicate.and ( in.getChild ( 0 ) , in.getChild ( 2 ) ) ) , in.getChild ( 1 ) ) . inOrder ( ) ; }