auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void index ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Change change ) throws com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.server.query.change.ChangeData cd ; if ( notesMigration.readChanges ( ) ) { cd = changeDataFactory.create ( db , change ) ; } else if ( notesMigration.writeChanges ( ) ) { com.google.gerrit.server.notedb.ChangeNotes notes = changeNotesFactory.createWithAutoRebuildingDisabled ( change , null ) ; cd = changeDataFactory.create ( db , notes ) ; } else { cd = changeDataFactory.create ( db , change ) ; } index ( cd ) ; }

Target:
private com.google.gerrit.server.query.change.ChangeData newChangeData ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Change change ) throws com.google.gwtorm.server.OrmException { if ( ! ( notesMigration.readChanges ( ) ) ) { com.google.gerrit.server.notedb.ChangeNotes notes = changeNotesFactory.createWithAutoRebuildingDisabled ( change , null ) ; return changeDataFactory.create ( db , notes ) ; } return changeDataFactory.create ( db , change ) ; }
Source:
public void postUpdate ( com.google.gerrit.server.git.BatchUpdate.Context ctx ) throws com.google.gwtorm.server.OrmException { if ( ( updated ( ) ) && ( fireEvent ) ) { hashtagsEdited.fire ( change , ctx.getUser ( ) . getAccountId ( ) , updatedHashtags , toAdd , toRemove ) ; } }

Target:
public void postUpdate ( com.google.gerrit.server.git.BatchUpdate.Context ctx ) throws com.google.gwtorm.server.OrmException { if ( ( updated ( ) ) && ( fireEvent ) ) { hashtagsEdited.fire ( change , ctx.getUser ( ) . getAccountId ( ) , updatedHashtags , toAdd , toRemove , ctx.getWhen ( ) ) ; } }
Source:
public static synchronized void setClockStep ( long clockStep , java.util.concurrent.TimeUnit clockStepUnit ) { com.google.common.base.Preconditions.checkState ( ( ( com.google.gerrit.testutil.TestTimeUtil.clockMs ) != null ) , "call resetWithClockStep first" ) ; com.google.gerrit.testutil.TestTimeUtil.clockStepMs = java.util.concurrent.TimeUnit.MILLISECONDS.convert ( clockStep , clockStepUnit ) ; HEAD ( ( 6899000.0 - 2.14 ) ) ; org.joda.time.DateTimeUtils.setCurrentMillisProvider ( new org.joda.time.DateTimeUtils.MillisProvider ( ) { @ java.lang.Override public long getMillis ( ) { return com.google.gerrit.testutil.TestTimeUtil.clockMs.getAndAdd ( com.google.gerrit.testutil.TestTimeUtil.clockStepMs ) ; } } ) ; }

Target:
public org.eclipse.jgit.storage.file.FileBasedConfig openSystemConfig ( org.eclipse.jgit.lib.Config parent , org.eclipse.jgit.util.FS fs ) { return defaultReader.openSystemConfig ( parent , fs ) ; }
Source:
private java.nio.file.Path webappSourcePath ( java.lang.String name ) { return getPaths ( ) . buckOut.resolveSibling ( "gerrit-war" ) . resolve ( "src" ) . resolve ( "main" ) . resolve ( "webapp" ) . resolve ( name ) ; }

Target:
private java.nio.file.Path webappSourcePath ( java.lang.String name ) { com.google.gerrit.httpd.raw.StaticModule.Paths p = getPaths ( ) ; if ( ( p.unpackedWar ) != null ) { return p.unpackedWar.resolve ( name ) ; } return p.buckOut.resolveSibling ( "gerrit-war" ) . resolve ( "src" ) . resolve ( "main" ) . resolve ( "webapp" ) . resolve ( name ) ; }
Source:
private GitilesView.Builder parseNoCommand ( javax.servlet.http.HttpServletRequest req , java.lang.String repoName ) { if ( ( req.getAttribute ( org.eclipse.jgit.http.server.ServletUtils.ATTRIBUTE_REPOSITORY ) ) == null ) { return com.google.gitiles.GitilesView.hostIndex ( ) . setRepositoryPrefix ( repoName ) ; } return com.google.gitiles.GitilesView.repositoryIndex ( ) . setRepositoryName ( repoName ) ; }

Target:
private GitilesView.Builder parseNoCommand ( javax.servlet.http.HttpServletRequest req , java.lang.String repoName ) { if ( ! ( com.google.gitiles.ViewFilter.hasRepository ( req ) ) ) { return com.google.gitiles.GitilesView.hostIndex ( ) . setRepositoryPrefix ( repoName ) ; } return com.google.gitiles.GitilesView.repositoryIndex ( ) . setRepositoryName ( repoName ) ; }
Source:
public void testUpsertTwoSecondExistsing ( ) throws com.google.gwtorm.client.OrmException , java.sql.SQLException { stubExecuteBatchOK ( com.google.gwtorm.jdbc.TestJdbcAccess.UPDATE , 0 , 1 ) ; java.sql.PreparedStatement insert = stubExecuteBatchOK ( com.google.gwtorm.jdbc.TestJdbcAccess.INSERT , 1 ) ; createClassUnderTest ( ) . upsert ( com.google.gwtorm.jdbc.TestJdbcAccess.TWO_ROWS ) ; verifyIds ( insert , 1 ) ; }

Target:
public void testUpdateOneDBException ( ) throws com.google.gwtorm.server.OrmException , java.sql.SQLException { java.sql.SQLException exception = new java.sql.BatchUpdateException ( ) ; java.sql.PreparedStatement update = stubStatementThrowExceptionOnExecute ( com.google.gwtorm.jdbc.TestJdbcAccess.UPDATE , exception ) ; com.google.gwtorm.jdbc.JdbcAccess < com.google.gwtorm.jdbc.TestJdbcAccess.Data , com.google.gwtorm.jdbc.TestJdbcAccess.Data.DataKey > classUnderTest = createClassUnderTest ( ) ; try { classUnderTest.update ( oneRow ) ; org.junit.Assert.fail ( "missingException" ) ; } catch ( com.google.gwtorm.server.OrmException e ) { org.junit.Assert.assertSame ( e.getCause ( ) , exception ) ; } com.google.gwtorm.jdbc.TestJdbcAccess.assertUsedBatchingOnly ( update ) ; }
Source:
private static Change.Key getChangeId ( org.eclipse.jgit.lib.ObjectId id , org.eclipse.jgit.revwalk.RevCommit emptyCommit ) { java.util.List < java.lang.String > idList = emptyCommit.getFooterLines ( FooterConstants.CHANGE_ID ) ; com.google.gerrit.reviewdb.client.Change.Key changeKey = ( ! ( idList.isEmpty ( ) ) ) ? new com.google.gerrit.reviewdb.client.Change.Key ( idList.get ( ( ( idList.size ( ) ) - 1 ) ) . trim ( ) ) : new com.google.gerrit.reviewdb.client.Change.Key ( ( "I" + ( id.name ( ) ) ) ) ; return changeKey ; }

Target:
private static org.eclipse.jgit.lib.ObjectId emptyTreeId ( org.eclipse.jgit.lib.ObjectInserter inserter ) throws java.io.IOException { return inserter.insert ( new org.eclipse.jgit.lib.TreeFormatter ( ) ) ; }
Source:
private void appendLineNone ( final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder m ) { m.openTd ( ) ; m.setStyleName ( "LineNumber" ) ; m.closeTd ( ) ; m.openTd ( ) ; m.addStyleName ( "FileLine" ) ; m.addStyleName ( "FileLineNone" ) ; m.closeTd ( ) ; }

Target:
private void appendLineNone ( final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder m ) { m.openTd ( ) ; m.setStyleName ( Gerrit.RESOURCES.css ( ) . lineNumber ( ) ) ; m.closeTd ( ) ; m.openTd ( ) ; m.addStyleName ( Gerrit.RESOURCES.css ( ) . fileLine ( ) ) ; m.addStyleName ( Gerrit.RESOURCES.css ( ) . fileLineNone ( ) ) ; m.closeTd ( ) ; }
Source:
private void deleteCommentFromTable ( com.google.common.collect.Table < com.google.gerrit.reviewdb.client.PatchSet.Id , java.lang.String , com.google.gerrit.reviewdb.client.PatchLineComment > t , com.google.gerrit.reviewdb.client.PatchLineComment c ) { com.google.gerrit.reviewdb.client.PatchLineComment old = t.remove ( psId , c.getKey ( ) . get ( ) ) ; com.google.common.base.Preconditions.checkArgument ( ( old != null ) , ( "Cannot delete following draft because one " + "did not previously exist with the same UUID: %s" ) , c ) ; }

Target:
public void deleteComment ( com.google.gerrit.reviewdb.client.PatchLineComment c ) { verifyComment ( c ) ; com.google.common.base.Preconditions.checkArgument ( draftNotes.containsComment ( c ) , ( "Cannot delete this comment" + " because it didn't previously exist as a draft" ) ) ; deleteComments.add ( c ) ; }
Source:
public static void deleteSshKeys ( java.lang.String account , java.util.Set < java.lang.Integer > sequenceNumbers , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.VoidResult > cb ) { com.google.gerrit.client.rpc.CallbackGroup group = new com.google.gerrit.client.rpc.CallbackGroup ( ) ; for ( int seq : sequenceNumbers ) { new com.google.gerrit.client.rpc.RestApi ( "/accounts/" ) . id ( account ) . view ( "sshkeys" ) . id ( seq ) . delete ( group.add ( cb ) ) ; cb = com.google.gerrit.client.rpc.CallbackGroup.emptyCallback ( ) ; } }

Target:
public static void deleteSshKeys ( java.lang.String account , java.util.Set < java.lang.Integer > sequenceNumbers , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.VoidResult > cb ) { com.google.gerrit.client.rpc.CallbackGroup group = new com.google.gerrit.client.rpc.CallbackGroup ( ) ; for ( int seq : sequenceNumbers ) { new com.google.gerrit.client.rpc.RestApi ( "/accounts/" ) . id ( account ) . view ( "sshkeys" ) . id ( seq ) . delete ( group.add ( cb ) ) ; cb = com.google.gerrit.client.rpc.CallbackGroup.emptyCallback ( ) ; } group.done ( ) ; }
Source:
public java.lang.Void call ( ) throws com.google.gwtorm.server.OrmException , java.io.IOException { if ( caller == ( java.lang.Thread.currentThread ( ) ) ) { updateGroups ( db ) ; } else { try ( com.google.gerrit.reviewdb.server.ReviewDb db = schemaFactory.open ( ) ) { updateGroups ( db ) ; } } return null ; }

Target:
private com.google.gerrit.server.git.ReceiveCommits.RequestState requestState ( java.lang.Thread caller ) throws com.google.gwtorm.server.OrmException , java.io.IOException { if ( caller == ( java.lang.Thread.currentThread ( ) ) ) { return new com.google.gerrit.server.git.ReceiveCommits.RequestState ( db , repo , rp.getRevWalk ( ) ) ; } else { return new com.google.gerrit.server.git.ReceiveCommits.RequestState ( project.getNameKey ( ) ) ; } }
Source:
public com.google.common.util.concurrent.ListenableFuture < ? > rebuildAsync ( final com.google.gerrit.reviewdb.client.Change.Id id , com.google.common.util.concurrent.ListeningExecutorService executor ) { return executor.submit ( new java.util.concurrent.Callable < java.lang.Void > ( ) { @ java.lang.Override public java.lang.Void call ( ) throws java.lang.Exception { try ( com.google.gerrit.reviewdb.server.ReviewDb db = schemaFactory.open ( ) ) { rebuild ( db , id ) ; } return null ; } } ) ; }

Target:
public final com.google.common.util.concurrent.ListenableFuture < com.google.gerrit.server.notedb.NoteDbChangeState > rebuildAsync ( final com.google.gerrit.reviewdb.client.Change.Id id , com.google.common.util.concurrent.ListeningExecutorService executor ) { return executor.submit ( new java.util.concurrent.Callable < com.google.gerrit.server.notedb.NoteDbChangeState > ( ) { @ java.lang.Override public com.google.gerrit.server.notedb.NoteDbChangeState call ( ) throws java.lang.Exception { try ( com.google.gerrit.reviewdb.server.ReviewDb db = schemaFactory.open ( ) ) { return rebuild ( db , id ) ; } } } ) ; }
Source:
protected MailMessage.Builder messageBuilderWithDefaultFields ( ) { com.google.gerrit.server.mail.receive.MailMessage.Builder b = com.google.gerrit.server.mail.receive.MailMessage.builder ( ) ; b.id ( "some id" ) ; b.from ( user.emailAddress ) ; b.addTo ( user.emailAddress ) ; b.subject ( "" ) ; b.dateReceived ( new org.joda.time.DateTime ( ) ) ; return b ; }

Target:
protected MailMessage.Builder messageBuilderWithDefaultFields ( ) { com.google.gerrit.server.mail.receive.MailMessage.Builder b = com.google.gerrit.server.mail.receive.MailMessage.builder ( ) ; b.id ( "some id" ) ; b.from ( user.emailAddress ) ; b.addTo ( user.emailAddress ) ; b.subject ( "" ) ; b.dateReceived ( java.time.Instant.now ( ) ) ; return b ; }
Source:
public void setSshInjector ( com.google.inject.Injector injector ) { sshModule = com.google.gerrit.server.plugins.PluginGuiceEnvironment.copy ( injector ) ; onStart.addAll ( com.google.gerrit.server.plugins.PluginGuiceEnvironment.listeners ( injector , com.google.gerrit.server.plugins.StartPluginListener.class ) ) ; onReload.addAll ( com.google.gerrit.server.plugins.PluginGuiceEnvironment.listeners ( injector , com.google.gerrit.server.plugins.ReloadPluginListener.class ) ) ; }

Target:
public void setSshInjector ( com.google.inject.Injector injector ) { sshModule = com.google.gerrit.server.plugins.PluginGuiceEnvironment.copy ( injector ) ; sshGen = injector.getProvider ( com.google.gerrit.server.plugins.ModuleGenerator.class ) ; onStart.addAll ( com.google.gerrit.server.plugins.PluginGuiceEnvironment.listeners ( injector , com.google.gerrit.server.plugins.StartPluginListener.class ) ) ; onReload.addAll ( com.google.gerrit.server.plugins.PluginGuiceEnvironment.listeners ( injector , com.google.gerrit.server.plugins.ReloadPluginListener.class ) ) ; }
Source:
public java.lang.String get ( final int idx ) { for ( int i = lastGetRange ; i < ( ranges.size ( ) ) ; i ++ ) { final com.google.gerrit.client.data.SparseFileContent.Range r = ranges.get ( i ) ; if ( r.contains ( idx ) ) { lastGetRange = i ; return r.get ( idx ) ; } } if ( ( lastGetRange ) != 0 ) { lastGetRange = 0 ; return get ( idx ) ; } throw new java.lang.ArrayIndexOutOfBoundsException ( idx ) ; }

Target:
public boolean contains ( final int idx ) { return ( getLine ( idx ) ) != null ; }
Source:
private org.apache.lucene.search.Query fullTextQuery ( com.google.gerrit.server.index.IndexPredicate < V > p ) throws com.google.gerrit.index.query.QueryParseException { java.lang.String value = p.getValue ( ) ; if ( value == null ) { throw new com.google.gerrit.index.query.QueryParseException ( "Full-text search over empty string not supported" ) ; } org.apache.lucene.search.Query query = queryBuilder.createPhraseQuery ( p.getField ( ) . getName ( ) , value ) ; if ( query == null ) { throw new com.google.gerrit.index.query.QueryParseException ( ( "Cannot create full-text query with value: " + value ) ) ; } return query ; }

Target:
private org.apache.lucene.search.Query fullTextQuery ( com.google.gerrit.index.query.IndexPredicate < V > p ) throws com.google.gerrit.index.query.QueryParseException { java.lang.String value = p.getValue ( ) ; if ( value == null ) { throw new com.google.gerrit.index.query.QueryParseException ( "Full-text search over empty string not supported" ) ; } org.apache.lucene.search.Query query = queryBuilder.createPhraseQuery ( p.getField ( ) . getName ( ) , value ) ; if ( query == null ) { throw new com.google.gerrit.index.query.QueryParseException ( ( "Cannot create full-text query with value: " + value ) ) ; } return query ; }
Source:
protected void includeWatchers ( com.google.gerrit.server.account.WatchConfig.NotifyType type ) { try { com.google.gerrit.server.mail.send.ProjectWatch.Watchers matching = getWatchers ( type ) ; add ( RecipientType.TO , matching.to ) ; add ( RecipientType.CC , matching.cc ) ; add ( RecipientType.BCC , matching.bcc ) ; } catch ( com.google.gwtorm.server.OrmException err ) { com.google.gerrit.server.mail.send.NotificationEmail.log.warn ( ( "Cannot BCC watchers for " + type ) , err ) ; } }

Target:
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 ) ; } }
Source:
public com.google.common.util.concurrent.ListenableFuture < com.google.gerrit.server.notedb.ChangeNotes > apply ( final com.google.gerrit.reviewdb.client.Change change ) { return executorService.submit ( new java.util.concurrent.Callable < com.google.gerrit.server.notedb.ChangeNotes > ( ) { @ java.lang.Override public com.google.gerrit.server.notedb.ChangeNotes call ( ) throws java.lang.Exception { com.google.common.base.Preconditions.checkArgument ( change.getProject ( ) . equals ( project ) , ( "passed project %s when creating ChangeNotes for %s," + " but actual project is %s" ) , project , changeId , change.getProject ( ) ) ; return new com.google.gerrit.server.notedb.ChangeNotes ( args , change , false , null ) . load ( ) ; } } ) ; }

Target:
public com.google.gerrit.server.notedb.ChangeNotes createChecked ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Project.NameKey project , com.google.gerrit.reviewdb.client.Change.Id changeId ) throws com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.Change change = com.google.gerrit.reviewdb.server.ReviewDbUtil.unwrapDb ( db ) . changes ( ) . get ( changeId ) ; if ( ( change == null ) || ( ! ( change.getProject ( ) . equals ( project ) ) ) ) { throw new com.google.gerrit.server.project.NoSuchChangeException ( changeId ) ; } return new com.google.gerrit.server.notedb.ChangeNotes ( args , change ) . load ( ) ; }
Source:
private boolean visible ( com.google.gerrit.server.change.ChangeResource change ) throws com.google.gerrit.server.permissions.PermissionBackendException { try { permissionBackend.user ( change.getUser ( ) ) . change ( change.getNotes ( ) ) . database ( dbProvider ) . check ( ChangePermission.READ ) ; return true ; } catch ( com.google.gerrit.extensions.restapi.AuthException e ) { return false ; } }

Target:
private boolean visible ( com.google.gerrit.server.change.ChangeResource change ) throws com.google.gerrit.server.permissions.PermissionBackendException , java.io.IOException { try { permissionBackend.user ( change.getUser ( ) ) . change ( change.getNotes ( ) ) . database ( dbProvider ) . check ( ChangePermission.READ ) ; return projectCache.checkedGet ( change.getProject ( ) ) . statePermitsRead ( ) ; } catch ( com.google.gerrit.extensions.restapi.AuthException e ) { return false ; } }
Source:
public boolean match ( com.google.gerrit.server.query.change.ChangeData object ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.Change c = object.change ( ) ; if ( c != null ) { try { return trackingFooters.extract ( object.commitFooters ( ) ) . values ( ) . contains ( getValue ( ) ) ; } catch ( java.io.IOException e ) { com.google.gerrit.server.query.change.TrackingIdPredicate.log.warn ( ( "Cannot extract footers from " + ( c.getChangeId ( ) ) ) , e ) ; } } return false ; }

Target:
public boolean match ( com.google.gerrit.server.query.change.ChangeData object ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.Change c = object.change ( ) ; if ( c != null ) { try { return trackingFooters.extract ( object.commitFooters ( ) ) . values ( ) . contains ( getValue ( ) ) ; } catch ( com.google.gerrit.server.project.NoSuchChangeException | java.io.IOException e ) { com.google.gerrit.server.query.change.TrackingIdPredicate.log.warn ( ( "Cannot extract footers from " + ( c.getChangeId ( ) ) ) , e ) ; } } return false ; }
Source:
public com.google.gerrit.reviewdb.client.Change update ( com.google.gerrit.reviewdb.client.Change change ) { change.setCurrentPatchSet ( info ) ; com.google.gerrit.server.ChangeUtil.updated ( change ) ; return change ; }

Target:
public com.google.gerrit.reviewdb.client.Change update ( com.google.gerrit.reviewdb.client.Change change ) { if ( change.getStatus ( ) . isClosed ( ) ) { return null ; } if ( ! ( change.currentPatchSetId ( ) . equals ( patchSetId ) ) ) { return null ; } if ( ( change.getStatus ( ) ) != ( com.google.gerrit.reviewdb.client.Change.Status.DRAFT ) ) { change.setStatus ( Change.Status.NEW ) ; } change.setLastSha1MergeTested ( null ) ; change.setCurrentPatchSet ( info ) ; com.google.gerrit.server.ChangeUtil.updated ( change ) ; return change ; }
Source:
public com.google.common.base.Optional < com.google.gerrit.reviewdb.client.PatchSetApproval > getSubmitApproval ( ) throws com.google.gwtorm.server.OrmException { for ( com.google.gerrit.reviewdb.client.PatchSetApproval psa : currentApprovals ( ) ) { if ( psa.isSubmit ( ) ) { return com.google.common.base.Optional.fromNullable ( psa ) ; } } return com.google.common.base.Optional.absent ( ) ; }

Target:
public com.google.common.base.Optional < com.google.gerrit.reviewdb.client.PatchSetApproval > getSubmitApproval ( ) throws com.google.gwtorm.server.OrmException { for ( com.google.gerrit.reviewdb.client.PatchSetApproval psa : currentApprovals ( ) ) { if ( psa.isLegacySubmit ( ) ) { return com.google.common.base.Optional.fromNullable ( psa ) ; } } return com.google.common.base.Optional.absent ( ) ; }
Source:
private void checkKeys ( com.google.gitiles.CommitSoyData.KeySet ks ) { com.google.common.base.Preconditions.checkState ( ( ( ! ( ks.contains ( "diffTree" ) ) ) || ( ( walk ) != null ) ) , "RevWalk required for diffTree" ) ; }

Target:
private void checkKeys ( com.google.gitiles.CommitSoyData.KeySet ks ) { com.google.common.base.Preconditions.checkState ( ( ( ! ( ks.contains ( "diffTree" ) ) ) || ( ( walk ) != null ) ) , "RevWalk required for diffTree" ) ; if ( ( ks.contains ( "archiveUrl" ) ) || ( ks.contains ( "archiveType" ) ) ) { com.google.common.base.Preconditions.checkState ( ( ( archiveFormat ) != null ) , "archive format required" ) ; } }
Source:
private void createParentForDeletedProjectsIfMissing ( ) throws com.google.gerrit.extensions.restapi.ResourceConflictException , java.io.IOException { if ( ( projectCache.get ( new com.google.gerrit.reviewdb.client.Project.NameKey ( com.googlesource.gerrit.plugins.deleteproject.HideProject.PARENT_FOR_DELETED_PROJECTS ) ) ) == null ) { try { createProjectFactory.create ( com.googlesource.gerrit.plugins.deleteproject.HideProject.PARENT_FOR_DELETED_PROJECTS ) . apply ( TopLevelResource.INSTANCE , null ) ; } catch ( com.google.gerrit.extensions.restapi.BadRequestException | com.google.gerrit.extensions.restapi.UnprocessableEntityException | com.google.gerrit.extensions.restapi.ResourceNotFoundException | com.google.gerrit.common.errors.ProjectCreationFailedException e ) { throw new com.google.gerrit.extensions.restapi.ResourceConflictException ( java.lang.String.format ( "Failed to create project %s" , com.googlesource.gerrit.plugins.deleteproject.HideProject.PARENT_FOR_DELETED_PROJECTS ) ) ; } } }

Target:
private void createProjectIfMissing ( java.lang.String projectName ) throws com.google.gerrit.extensions.restapi.ResourceConflictException , java.io.IOException { if ( ( projectCache.get ( new com.google.gerrit.reviewdb.client.Project.NameKey ( projectName ) ) ) == null ) { try { createProjectFactory.create ( projectName ) . apply ( TopLevelResource.INSTANCE , null ) ; } catch ( com.google.gerrit.extensions.restapi.BadRequestException | com.google.gerrit.extensions.restapi.UnprocessableEntityException | com.google.gerrit.extensions.restapi.ResourceNotFoundException | com.google.gerrit.common.errors.ProjectCreationFailedException e ) { throw new com.google.gerrit.extensions.restapi.ResourceConflictException ( java.lang.String.format ( "Failed to create project %s" , projectName ) ) ; } } }
Source:
public static void scheduleFullSync ( final com.google.gerrit.client.reviewdb.Project.NameKey project ) { for ( final com.google.gerrit.git.PushQueue.ReplicationConfig cfg : com.google.gerrit.git.PushQueue.allConfigs ( ) ) { for ( final org.spearce.jgit.transport.URIish uri : cfg.getURIs ( project ) ) { com.google.gerrit.git.PushQueue.scheduleImp ( project , PushOp.MIRROR_ALL , cfg , uri ) ; } } }

Target:
public static void scheduleFullSync ( final com.google.gerrit.client.reviewdb.Project.NameKey project , final java.lang.String urlMatch ) { for ( final com.google.gerrit.git.PushQueue.ReplicationConfig cfg : com.google.gerrit.git.PushQueue.allConfigs ( ) ) { for ( final org.spearce.jgit.transport.URIish uri : cfg.getURIs ( project , urlMatch ) ) { com.google.gerrit.git.PushQueue.scheduleImp ( project , PushOp.MIRROR_ALL , cfg , uri ) ; } } }
Source:
private void ccApprovals ( final boolean includeZero ) { if ( ( db ) != null ) { try { for ( com.google.gerrit.client.reviewdb.ChangeApproval ap : db.changeApprovals ( ) . byChange ( change.getId ( ) ) ) { if ( ( ! includeZero ) && ( ( ap.getValue ( ) ) == 0 ) ) { continue ; } add ( RecipientType.CC , ap.getAccountId ( ) ) ; } } catch ( com.google.gwtorm.client.OrmException err ) { } } }

Target:
private void ccApprovals ( final boolean includeZero ) { if ( ( db ) != null ) { try { for ( com.google.gerrit.client.reviewdb.PatchSetApproval ap : db.patchSetApprovals ( ) . byChange ( change.getId ( ) ) ) { if ( ( ! includeZero ) && ( ( ap.getValue ( ) ) == 0 ) ) { continue ; } add ( RecipientType.CC , ap.getAccountId ( ) ) ; } } catch ( com.google.gwtorm.client.OrmException err ) { } } }
Source:
private java.util.Map < java.lang.String , com.google.gerrit.reviewdb.client.PatchLineComment > patchSetDrafts ( com.google.gerrit.server.change.RevisionResource rsrc ) 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 ( db.get ( ) , rsrc.getPatchSet ( ) . getId ( ) , rsrc.getAccountId ( ) , rsrc.getNotes ( ) ) ) { drafts.put ( c.getKey ( ) . get ( ) , c ) ; } return drafts ; }

Target:
private java.util.Set < com.google.gerrit.server.change.PostReview.CommentSetEntry > readExistingComments ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx ) throws com.google.gwtorm.server.OrmException { java.util.Set < com.google.gerrit.server.change.PostReview.CommentSetEntry > r = new java.util.HashSet < > ( ) ; for ( com.google.gerrit.reviewdb.client.PatchLineComment c : plcUtil.publishedByChange ( ctx.getDb ( ) , ctx.getChangeNotes ( ) ) ) { r.add ( com.google.gerrit.server.change.PostReview.CommentSetEntry.create ( c ) ) ; } return r ; }
Source:
public com.google.gerrit.server.change.PatchSetInserter setMessage ( com.google.gerrit.reviewdb.client.ChangeMessage changeMessage ) { this . changeMessage = changeMessage ; return this ; }

Target:
public void updateRepo ( com.google.gerrit.server.git.BatchUpdate.RepoContext ctx ) throws com.google.gerrit.server.project.InvalidChangeOperationException , java.io.IOException { init ( ) ; validate ( ) ; patchSetInfo = patchSetInfoFactory.get ( ctx.getRevWalk ( ) , commit , psId ) ; ctx.addRefUpdate ( new org.eclipse.jgit.transport.ReceiveCommand ( org.eclipse.jgit.lib.ObjectId.zeroId ( ) , commit , getPatchSetId ( ) . toRefName ( ) , ReceiveCommand.Type.CREATE ) ) ; }
Source:
private static java.lang.String legacyPatch ( java.lang.String token ) { if ( com.google.gerrit.client.Dispatcher.matchPrefix ( "patch,sidebyside," , token ) ) { return com.google.gerrit.client.Dispatcher.toPatchSideBySide ( Patch.Key.parse ( com.google.gerrit.client.Dispatcher.skip ( token ) ) ) ; } if ( com.google.gerrit.client.Dispatcher.matchPrefix ( "patch,unified," , token ) ) { return com.google.gerrit.client.Dispatcher.toPatchUnified ( Patch.Key.parse ( com.google.gerrit.client.Dispatcher.skip ( token ) ) ) ; } return null ; }

Target:
private static java.lang.String legacyPatch ( java.lang.String token ) { if ( com.google.gerrit.client.Dispatcher.matchPrefix ( "patch,sidebyside," , token ) ) { return com.google.gerrit.client.Dispatcher.toPatch ( "" , null , Patch.Key.parse ( com.google.gerrit.client.Dispatcher.skip ( token ) ) ) ; } if ( com.google.gerrit.client.Dispatcher.matchPrefix ( "patch,unified," , token ) ) { return com.google.gerrit.client.Dispatcher.toPatch ( "unified" , null , Patch.Key.parse ( com.google.gerrit.client.Dispatcher.skip ( token ) ) ) ; } return null ; }
Source:
private com.google.gerrit.reviewdb.client.PatchSetInfo previousPatchSetInfo ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx ) throws com.google.gwtorm.server.OrmException { try { return patchSetInfoFactory.get ( ctx.getDb ( ) , new com.google.gerrit.reviewdb.client.PatchSet.Id ( psId.getParentKey ( ) , ( ( psId.get ( ) ) - 1 ) ) ) ; } catch ( com.google.gerrit.server.patch.PatchSetInfoNotAvailableException e ) { throw new com.google.gwtorm.server.OrmException ( e ) ; } }

Target:
private com.google.gerrit.reviewdb.client.PatchSetInfo previousPatchSetInfo ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx ) throws com.google.gwtorm.server.OrmException { try { return patchSetInfoFactory.get ( ctx.getDb ( ) , ctx.getNotes ( ) , new com.google.gerrit.reviewdb.client.PatchSet.Id ( psId.getParentKey ( ) , ( ( psId.get ( ) ) - 1 ) ) ) ; } catch ( com.google.gerrit.server.patch.PatchSetInfoNotAvailableException e ) { throw new com.google.gwtorm.server.OrmException ( e ) ; } }
Source:
public java.util.concurrent.ExecutorService createEmailReviewCommentsExecutor ( @ com.google.gerrit.server.config.GerritServerConfig org.eclipse.jgit.lib.Config config , com.google.gerrit.server.git.WorkQueue queues ) { int poolSize = config.getInt ( "sendemail" , null , "threadPoolSize" , 1 ) ; if ( poolSize == 0 ) { return com.google.common.util.concurrent.MoreExecutors.newDirectExecutorService ( ) ; } return queues.createQueue ( poolSize , "EmailReviewComments" ) ; }

Target:
public java.util.concurrent.ExecutorService createSendEmailExecutor ( @ com.google.gerrit.server.config.GerritServerConfig org.eclipse.jgit.lib.Config config , com.google.gerrit.server.git.WorkQueue queues ) { int poolSize = config.getInt ( "sendemail" , null , "threadPoolSize" , 1 ) ; if ( poolSize == 0 ) { return com.google.common.util.concurrent.MoreExecutors.newDirectExecutorService ( ) ; } return queues.createQueue ( poolSize , "SendEmail" ) ; }
Source:
private void display ( final com.google.gerrit.client.admin.AccountGroupDetail result ) { setTitleText ( Util.M.group ( result.group.getName ( ) ) ) ; groupNameTxt.setText ( result.group.getName ( ) ) ; ownerTxt.setText ( result.ownerGroup.getName ( ) ) ; descTxt.setText ( result.group.getDescription ( ) ) ; accounts = result.accounts ; members.display ( result.members ) ; members.finishDisplay ( true ) ; }

Target:
private void display ( final com.google.gerrit.client.admin.AccountGroupDetail result ) { setTitleText ( Util.M.group ( result.group.getName ( ) ) ) ; groupNameTxt.setText ( result.group.getName ( ) ) ; ownerTxt.setText ( result.ownerGroup.getName ( ) ) ; descTxt.setText ( result.group.getDescription ( ) ) ; if ( result.autoGroup ) { memberPanel.setVisible ( false ) ; } else { memberPanel.setVisible ( true ) ; accounts = result.accounts ; members.display ( result.members ) ; members.finishDisplay ( true ) ; } }
Source:
private com.google.inject.Injector createSysInjector ( ) { final java.util.List < com.google.inject.Module > modules = new java.util.ArrayList < com.google.inject.Module > ( ) ; modules.add ( cfgInjector.getInstance ( com.google.gerrit.server.config.GerritGlobalModule.class ) ) ; modules.add ( new com.google.gerrit.server.config.CanonicalWebUrlModule ( ) { @ java.lang.Override protected java.lang.Class < ? extends com.google.inject.Provider < java.lang.String > > provider ( ) { return com.google.gerrit.httpd.HttpCanonicalWebUrlProvider.class ; } } ) ; modules.add ( new com.google.gerrit.server.config.GerritMasterLifecycle ( ) ) ; return cfgInjector.createChildInjector ( modules ) ; }

Target:
private com.google.inject.Injector createSysInjector ( ) { final java.util.List < com.google.inject.Module > modules = new java.util.ArrayList < com.google.inject.Module > ( ) ; modules.add ( cfgInjector.getInstance ( com.google.gerrit.server.config.GerritGlobalModule.class ) ) ; modules.add ( new com.google.gerrit.server.config.CanonicalWebUrlModule ( ) { @ java.lang.Override protected java.lang.Class < ? extends com.google.inject.Provider < java.lang.String > > provider ( ) { return com.google.gerrit.httpd.HttpCanonicalWebUrlProvider.class ; } } ) ; modules.add ( new com.google.gerrit.server.config.MasterNodeStartup ( ) ) ; return cfgInjector.createChildInjector ( modules ) ; }
Source:
private void applyScoreStyles ( final int row ) { final com.google.gwt.user.client.ui.HTMLTable.CellFormatter fmt = table.getCellFormatter ( ) ; for ( int col = 0 ; col < ( types.size ( ) ) ; col ++ ) { fmt.addStyleName ( row , ( 2 + col ) , "approvalscore" ) ; } }

Target:
private void applyScoreStyles ( final int row ) { final com.google.gwt.user.client.ui.HTMLTable.CellFormatter fmt = table.getCellFormatter ( ) ; for ( int col = 0 ; col < ( types.size ( ) ) ; col ++ ) { fmt.addStyleName ( row , ( 2 + col ) , Gerrit.RESOURCES.css ( ) . approvalscore ( ) ) ; } }
Source:
private void addPadding ( net.codemirror.lib.CodeMirror cm , int line ) { com.google.gwt.dom.client.Element div = com.google.gwt.user.client.DOM.createDiv ( ) ; div.setClassName ( diffTable.style.padding ( ) ) ; cm.addLineWidget ( line , div , null ) ; }

Target:
private void insertEmptyLines ( net.codemirror.lib.CodeMirror cm , int line , int cnt ) { com.google.gwt.dom.client.Element div = com.google.gwt.user.client.DOM.createDiv ( ) ; div.setClassName ( diffTable.style.padding ( ) ) ; div.getStyle ( ) . setHeight ( cnt , Unit.EM ) ; net.codemirror.lib.Configuration config = net.codemirror.lib.Configuration.create ( ) . set ( "coverGutter" , true ) . set ( "above" , ( line == 0 ) ) ; cm.addLineWidget ( ( line == 0 ? 0 : line - 1 ) , div , config ) ; }
Source:
public void testMIXED_NullUser ( ) { setFrom ( "MIXED" ) ; org.easymock.EasyMock.replay ( accountCache ) ; final com.google.gerrit.server.mail.Address r = create ( ) . from ( null ) ; assertNotNull ( r ) ; assertEquals ( ident.getName ( ) , r.name ) ; assertEquals ( ident.getEmailAddress ( ) , r.email ) ; org.easymock.EasyMock.verify ( accountCache ) ; }

Target:
public void testCUSTOM_FullyConfiguredUser ( ) { setFrom ( "A ${user} B <my.server@email.address>" ) ; final java.lang.String name = "A U. Thor" ; final java.lang.String email = "a.u.thor@test.example.com" ; final com.google.gerrit.reviewdb.client.Account.Id user = user ( name , email ) ; org.easymock.EasyMock.replay ( accountCache ) ; final com.google.gerrit.server.mail.Address r = create ( ) . from ( user ) ; org.junit.Assert.assertNotNull ( r ) ; org.junit.Assert.assertEquals ( ( ( "A " + name ) + " B" ) , r.name ) ; org.junit.Assert.assertEquals ( "my.server@email.address" , r.email ) ; org.easymock.EasyMock.verify ( accountCache ) ; }
Source:
protected void deny ( java.lang.String permission , com.google.gerrit.reviewdb.client.AccountGroup.UUID id , java.lang.String ref ) throws java.lang.Exception { com.google.gerrit.server.git.ProjectConfig cfg = projectCache.checkedGet ( project ) . getConfig ( ) ; com.google.gerrit.server.project.Util.deny ( cfg , permission , id , ref ) ; saveProjectConfig ( project , cfg ) ; }

Target:
protected com.google.gerrit.common.data.PermissionRule block ( java.lang.String permission , com.google.gerrit.reviewdb.client.AccountGroup.UUID id , java.lang.String ref ) throws java.lang.Exception { return block ( permission , id , ref , project ) ; }
Source:
public void testSimpleChangeMessage ( ) { com.google.gerrit.server.mail.receive.MailMessage.Builder b = newMailMessageBuilder ( ) ; b.textContent ( ( "Looks good to me\n" + ( com.google.gerrit.server.mail.receive.TextParserTest.quotedFooter ) ) ) ; java.util.List < com.google.gerrit.reviewdb.client.Comment > comments = defaultComments ( ) ; java.util.List < com.google.gerrit.server.mail.receive.MailComment > parsedComments = com.google.gerrit.server.mail.receive.TextParser.parse ( b.build ( ) , comments , com.google.gerrit.server.mail.receive.TextParserTest.changeURL ) ; com.google.common.truth.Truth.assertThat ( parsedComments ) . hasSize ( 1 ) ; assertChangeMessage ( "Looks good to me" , parsedComments.get ( 0 ) ) ; }

Target:
public void simpleChangeMessage ( ) { com.google.gerrit.server.mail.receive.MailMessage.Builder b = newMailMessageBuilder ( ) ; b.textContent ( ( "Looks good to me\n" + ( com.google.gerrit.server.mail.receive.TextParserTest.quotedFooter ) ) ) ; java.util.List < com.google.gerrit.reviewdb.client.Comment > comments = defaultComments ( ) ; java.util.List < com.google.gerrit.server.mail.receive.MailComment > parsedComments = com.google.gerrit.server.mail.receive.TextParser.parse ( b.build ( ) , comments , changeURL ) ; com.google.common.truth.Truth.assertThat ( parsedComments ) . hasSize ( 1 ) ; assertChangeMessage ( "Looks good to me" , parsedComments.get ( 0 ) ) ; }
Source:
private java.util.Set < com.google.gerrit.reviewdb.AccountGroup.UUID > getEffectiveUserGroups ( ) { final java.util.Set < com.google.gerrit.reviewdb.AccountGroup.UUID > userGroups = user.getEffectiveGroups ( ) ; if ( isOwner ( ) ) { final java.util.Set < com.google.gerrit.reviewdb.AccountGroup.UUID > userGroupsOnProject = new java.util.HashSet < com.google.gerrit.reviewdb.AccountGroup.UUID > ( ( ( userGroups.size ( ) ) + 1 ) ) ; userGroupsOnProject.addAll ( userGroups ) ; userGroupsOnProject.add ( AccountGroup.PROJECT_OWNERS ) ; return java.util.Collections.unmodifiableSet ( userGroupsOnProject ) ; } else { return userGroups ; } }

Target:
boolean match ( com.google.gerrit.reviewdb.AccountGroup.UUID uuid ) { if ( AccountGroup.PROJECT_OWNERS.equals ( uuid ) ) { return isDeclaredOwner ( ) ; } else { return user.getEffectiveGroups ( ) . contains ( uuid ) ; } }
Source:
public static com.google.gerrit.common.data.PermissionRule allowExclusive ( com.google.gerrit.server.git.ProjectConfig project , java.lang.String permissionName , int min , int max , com.google.gerrit.reviewdb.client.AccountGroup.UUID group , java.lang.String ref ) { com.google.gerrit.common.data.PermissionRule rule = com.google.gerrit.server.project.testing.Util.newRule ( project , group ) ; rule.setMin ( min ) ; rule.setMax ( max ) ; return com.google.gerrit.server.project.testing.Util.grant ( project , permissionName , rule , ref , true ) ; }

Target:
public static com.google.gerrit.common.data.PermissionRule allowExclusive ( com.google.gerrit.server.project.ProjectConfig project , java.lang.String permissionName , int min , int max , com.google.gerrit.reviewdb.client.AccountGroup.UUID group , java.lang.String ref ) { com.google.gerrit.common.data.PermissionRule rule = com.google.gerrit.server.project.testing.Util.newRule ( project , group ) ; rule.setMin ( min ) ; rule.setMax ( max ) ; return com.google.gerrit.server.project.testing.Util.grant ( project , permissionName , rule , ref , true ) ; }
Source:
private static com.google.gerrit.client.change.RevisionsBox getRevisionBox ( com.google.gwt.dom.client.NativeEvent event ) { com.google.gerrit.client.change.Element e = event.getEventTarget ( ) . cast ( ) ; for ( e = com.google.gwt.user.client.DOM.getParent ( e ) ; e != null ; e = com.google.gwt.user.client.DOM.getParent ( e ) ) { com.google.gwt.user.client.EventListener l = com.google.gwt.user.client.DOM.getEventListener ( e ) ; if ( l instanceof com.google.gerrit.client.change.RevisionsBox ) { return ( ( com.google.gerrit.client.change.RevisionsBox ) ( l ) ) ; } } return null ; }

Target:
private static com.google.gerrit.client.change.PatchSetsBox getRevisionBox ( com.google.gwt.dom.client.NativeEvent event ) { com.google.gerrit.client.change.Element e = event.getEventTarget ( ) . cast ( ) ; for ( e = com.google.gwt.user.client.DOM.getParent ( e ) ; e != null ; e = com.google.gwt.user.client.DOM.getParent ( e ) ) { com.google.gwt.user.client.EventListener l = com.google.gwt.user.client.DOM.getEventListener ( e ) ; if ( l instanceof com.google.gerrit.client.change.PatchSetsBox ) { return ( ( com.google.gerrit.client.change.PatchSetsBox ) ( l ) ) ; } } return null ; }
Source:
void cleanup ( ) { tmpFile.delete ( ) ; }

Target:
void cleanup ( ) { try { jarFile.close ( ) ; } catch ( java.io.IOException err ) { } if ( ( ! ( tmpFile.delete ( ) ) ) && ( tmpFile.exists ( ) ) ) { PluginLoader.log.warn ( ( "Cannot delete " + ( tmpFile.getAbsolutePath ( ) ) ) ) ; } }
Source:
static com.google.gerrit.server.query.change.QueryResult create ( @ com.google.gerrit.common.Nullable java.lang.String query , com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > predicate , int limit , java.util.List < com.google.gerrit.server.query.change.ChangeData > changes ) { boolean moreChanges ; if ( ( changes.size ( ) ) > limit ) { moreChanges = true ; changes = changes.subList ( 0 , limit ) ; } else { moreChanges = false ; } return new com.google.gerrit.server.query.change.AutoValue_QueryResult ( query , predicate , changes , moreChanges ) ; }

Target:
static < T > com.google.gerrit.server.query.QueryResult < T > create ( @ com.google.gerrit.common.Nullable java.lang.String query , com.google.gerrit.server.query.Predicate < T > predicate , int limit , java.util.List < T > entites ) { boolean more ; if ( ( entites.size ( ) ) > limit ) { more = true ; entites = entites.subList ( 0 , limit ) ; } else { more = false ; } return new com.google.gerrit.server.query.AutoValue_QueryResult ( query , predicate , entites , more ) ; }
Source:
protected void bccStarredBy ( ) { if ( ( db ) != null ) { try { for ( com.google.gerrit.reviewdb.StarredChange w : db.starredChanges ( ) . byChange ( change.getId ( ) ) ) { add ( RecipientType.BCC , w.getAccountId ( ) ) ; } } catch ( com.google.gwtorm.client.OrmException err ) { } } }

Target:
protected void bccStarredBy ( ) { for ( com.google.gerrit.reviewdb.StarredChange w : starredChangesCache.byChange ( change.getId ( ) ) ) { add ( RecipientType.BCC , w.getAccountId ( ) ) ; } }
Source:
public void testUpsertOneException ( ) throws com.google.gwtorm.client.OrmException , java.sql.SQLException { stubExecuteBatchException ( com.google.gwtorm.jdbc.TestJdbcAccess.UPDATE , new java.sql.BatchUpdateException ( ) ) ; try { createClassUnderTest ( ) . upsert ( com.google.gwtorm.jdbc.TestJdbcAccess.ONE_ROW ) ; org.junit.Assert.fail ( "missingException" ) ; } catch ( com.google.gwtorm.client.OrmException e ) { } }

Target:
public void testInsertOneDBException ( ) throws com.google.gwtorm.server.OrmException , java.sql.SQLException { java.sql.SQLException exception = new java.sql.BatchUpdateException ( ) ; java.sql.PreparedStatement insert = stubStatementThrowExceptionOnExecute ( com.google.gwtorm.jdbc.TestJdbcAccess.INSERT , exception ) ; com.google.gwtorm.jdbc.JdbcAccess < com.google.gwtorm.jdbc.TestJdbcAccess.Data , com.google.gwtorm.jdbc.TestJdbcAccess.Data.DataKey > classUnderTest = createClassUnderTest ( ) ; try { classUnderTest.insert ( oneRow ) ; org.junit.Assert.fail ( "missingException" ) ; } catch ( com.google.gwtorm.server.OrmException e ) { org.junit.Assert.assertSame ( e.getCause ( ) , exception ) ; } com.google.gwtorm.jdbc.TestJdbcAccess.assertUsedBatchingOnly ( insert ) ; }
Source:
public static java.util.Collection < com.googlesource.gerrit.plugins.uploadvalidator.ComparableCommitValidationMessage > transformMessages ( java.util.List < com.google.gerrit.server.git.validators.CommitValidationMessage > messages ) { return com.google.common.collect.Collections2.transform ( messages , new com.google.common.base.Function < com.google.gerrit.server.git.validators.CommitValidationMessage , com.googlesource.gerrit.plugins.uploadvalidator.ComparableCommitValidationMessage > ( ) { @ java.lang.Override public com.googlesource.gerrit.plugins.uploadvalidator.ComparableCommitValidationMessage apply ( com.google.gerrit.server.git.validators.CommitValidationMessage input ) { return new com.googlesource.gerrit.plugins.uploadvalidator.ComparableCommitValidationMessage ( input.getMessage ( ) , input.isError ( ) ) ; } } ) ; }

Target:
public static java.util.List < java.lang.String > transformMessages ( java.util.List < com.google.gerrit.server.git.validators.CommitValidationMessage > messages ) { return com.google.common.collect.Lists.transform ( messages , new com.google.common.base.Function < com.google.gerrit.server.git.validators.CommitValidationMessage , java.lang.String > ( ) { @ java.lang.Override public java.lang.String apply ( com.google.gerrit.server.git.validators.CommitValidationMessage input ) { java.lang.String pre = ( input.isError ( ) ) ? "ERROR: " : "MSG: " ; return pre + ( input.getMessage ( ) ) ; } } ) ; }
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 queryChangesNoResults ( ) throws java.lang.Exception { createChange ( ) ; com.google.common.truth.Truth.assertThat ( query ( "message:test" ) ) . isNotEmpty ( ) ; com.google.common.truth.Truth.assertThat ( query ( ( ( "message:{" + ( getClass ( ) . getName ( ) ) ) + "fhqwhgads}" ) ) ) . isEmpty ( ) ; }
Source:
public static com.google.gerrit.server.project.CommentLinkInfo buildCommentLink ( org.eclipse.jgit.lib.Config cfg , java.lang.String name ) throws java.lang.IllegalArgumentException { java.lang.String match = cfg.getString ( com.google.gerrit.server.git.ProjectConfig.COMMENTLINK , name , com.google.gerrit.server.git.ProjectConfig.KEY_MATCH ) ; java.util.regex.Pattern.compile ( match ) ; java.lang.String link = cfg.getString ( com.google.gerrit.server.git.ProjectConfig.COMMENTLINK , name , com.google.gerrit.server.git.ProjectConfig.KEY_LINK ) ; java.lang.String html = cfg.getString ( com.google.gerrit.server.git.ProjectConfig.COMMENTLINK , name , com.google.gerrit.server.git.ProjectConfig.KEY_HTML ) ; return new com.google.gerrit.server.project.CommentLinkInfo ( name , match , link , html ) ; }

Target:
public static com.google.gerrit.server.project.CommentLinkInfo buildCommentLink ( org.eclipse.jgit.lib.Config cfg , java.lang.String name , boolean allowRaw ) throws java.lang.IllegalArgumentException { java.lang.String match = cfg.getString ( com.google.gerrit.server.git.ProjectConfig.COMMENTLINK , name , com.google.gerrit.server.git.ProjectConfig.KEY_MATCH ) ; java.util.regex.Pattern.compile ( match ) ; java.lang.String link = cfg.getString ( com.google.gerrit.server.git.ProjectConfig.COMMENTLINK , name , com.google.gerrit.server.git.ProjectConfig.KEY_LINK ) ; java.lang.String html = cfg.getString ( com.google.gerrit.server.git.ProjectConfig.COMMENTLINK , name , com.google.gerrit.server.git.ProjectConfig.KEY_HTML ) ; com.google.common.base.Preconditions.checkArgument ( ( allowRaw || ( com.google.common.base.Strings.isNullOrEmpty ( html ) ) ) , "Raw html replacement not allowed" ) ; return new com.google.gerrit.server.project.CommentLinkInfo ( name , match , link , html ) ; }
Source:
public com.google.gerrit.server.CurrentUser getCurrentUser ( ) { final com.google.gerrit.server.CurrentUser user = session.getCurrentUser ( ) ; if ( ( user != null ) && ( user.isIdentifiedUser ( ) ) ) { com.google.gerrit.server.IdentifiedUser identifiedUser = userFactory.create ( ( ( com.google.gerrit.server.IdentifiedUser ) ( user ) ) . getAccountId ( ) ) ; identifiedUser.setAccessPath ( user.getAccessPath ( ) ) ; return identifiedUser ; } return user ; }

Target:
public com.google.gerrit.server.CurrentUser getUser ( ) { final com.google.gerrit.server.CurrentUser user = session.getUser ( ) ; if ( ( user != null ) && ( user.isIdentifiedUser ( ) ) ) { com.google.gerrit.server.IdentifiedUser identifiedUser = userFactory.create ( ( ( com.google.gerrit.server.IdentifiedUser ) ( user ) ) . getAccountId ( ) ) ; identifiedUser.setAccessPath ( user.getAccessPath ( ) ) ; return identifiedUser ; } return user ; }
Source:
public java.lang.Object invoke ( java.lang.Object proxy , java.lang.reflect.Method method , java.lang.Object [ ] args ) throws java.lang.Throwable { java.lang.reflect.Method handler ; try { handler = com.google.gerrit.httpd.plugins.PluginServletContext.API.class . getDeclaredMethod ( method.getName ( ) , method.getParameterTypes ( ) ) ; } catch ( java.lang.NoSuchMethodException e ) { throw new java.lang.NoSuchMethodError ( java.lang.String.format ( "%s does not implement%s" , com.google.gerrit.httpd.plugins.PluginServletContext.class , method.toGenericString ( ) ) ) ; } return handler.invoke ( this , args ) ; }

Target:
public java.lang.Object invoke ( java.lang.Object proxy , java.lang.reflect.Method method , java.lang.Object [ ] args ) throws java.lang.Throwable { java.lang.reflect.Method handler ; try { handler = com.google.gerrit.httpd.plugins.PluginServletContext.API.class . getDeclaredMethod ( method.getName ( ) , method.getParameterTypes ( ) ) ; } catch ( java.lang.NoSuchMethodException e ) { throw new java.lang.NoSuchMethodError ( java.lang.String.format ( "%s does not implement %s" , com.google.gerrit.httpd.plugins.PluginServletContext.class , method.toGenericString ( ) ) ) ; } return handler.invoke ( this , args ) ; }