auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void validateCanReadCommit ( org.eclipse.jgit.lib.Repository repo , com.google.gerrit.server.project.ProjectControl projectControl , org.eclipse.jgit.lib.ObjectId revId ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException , java.io.IOException { org.eclipse.jgit.revwalk.RevWalk rw = new org.eclipse.jgit.revwalk.RevWalk ( repo ) ; try { org.eclipse.jgit.revwalk.RevCommit commit = rw.parseCommit ( revId ) ; if ( ! ( projectControl.canReadCommit ( db.get ( ) , rw , commit ) ) ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( ) ; } } finally { rw.release ( ) ; } }

Target:
private void validateCanReadCommit ( org.eclipse.jgit.lib.Repository repo , com.google.gerrit.server.project.ProjectControl projectControl , org.eclipse.jgit.lib.ObjectId revId ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException , java.io.IOException { try ( org.eclipse.jgit.revwalk.RevWalk rw = new org.eclipse.jgit.revwalk.RevWalk ( repo ) ) { org.eclipse.jgit.revwalk.RevCommit commit = rw.parseCommit ( revId ) ; if ( ! ( projectControl.canReadCommit ( db.get ( ) , rw , commit ) ) ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( ) ; } } }
Source:
public PatchSet.Id call ( ) throws com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException , java.io.IOException { try { if ( magicBranch.edit ) { return upsertEdit ( ) ; } else if ( caller == ( java.lang.Thread.currentThread ( ) ) ) { return insertPatchSet ( db ) ; } else { com.google.gerrit.reviewdb.server.ReviewDb db = schemaFactory.open ( ) ; try { return insertPatchSet ( db ) ; } finally { db.close ( ) ; } } } finally { synchronized ( replaceProgress ) { replaceProgress.update ( 1 ) ; } } }

Target:
public PatchSet.Id call ( ) throws com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException , java.io.IOException { try { if ( caller == ( java.lang.Thread.currentThread ( ) ) ) { return insertPatchSet ( db ) ; } else { com.google.gerrit.reviewdb.server.ReviewDb db = schemaFactory.open ( ) ; try { return insertPatchSet ( db ) ; } finally { db.close ( ) ; } } } finally { synchronized ( replaceProgress ) { replaceProgress.update ( 1 ) ; } } }
Source:
private com.google.gerrit.reviewdb.client.ChangeMessage message ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx , com.google.gerrit.reviewdb.client.PatchSet.Id psId , java.lang.String body ) { com.google.common.base.Preconditions.checkNotNull ( psId ) ; java.lang.String uuid ; try { uuid = com.google.gerrit.server.ChangeUtil.messageUUID ( ctx.getDb ( ) ) ; } catch ( com.google.gwtorm.server.OrmException e ) { return null ; } com.google.gerrit.reviewdb.client.ChangeMessage m = new com.google.gerrit.reviewdb.client.ChangeMessage ( new com.google.gerrit.reviewdb.client.ChangeMessage.Key ( psId.getParentKey ( ) , uuid ) , ctx.getUser ( ) . getAccountId ( ) , ctx.getWhen ( ) , psId ) ; m.setMessage ( body ) ; return m ; }

Target:
private com.google.gerrit.reviewdb.client.ChangeMessage message ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx , com.google.gerrit.reviewdb.client.PatchSet.Id psId , java.lang.String body ) { com.google.common.base.Preconditions.checkNotNull ( psId ) ; java.lang.String uuid ; try { uuid = com.google.gerrit.server.ChangeUtil.messageUUID ( ctx.getDb ( ) ) ; } catch ( com.google.gwtorm.server.OrmException e ) { return null ; } com.google.gerrit.reviewdb.client.ChangeMessage m = new com.google.gerrit.reviewdb.client.ChangeMessage ( new com.google.gerrit.reviewdb.client.ChangeMessage.Key ( psId.getParentKey ( ) , uuid ) , ctx.getAccountId ( ) , ctx.getWhen ( ) , psId ) ; m.setMessage ( body ) ; return m ; }
Source:
public static void scheduleUpdate ( final com.google.gerrit.client.reviewdb.Project.NameKey project , final java.lang.String ref ) { for ( final com.google.gerrit.git.PushQueue.ReplicationConfig cfg : com.google.gerrit.git.PushQueue.allConfigs ( ) ) { if ( cfg.wouldPushRef ( ref ) ) { for ( final org.spearce.jgit.transport.URIish uri : cfg.getURIs ( project ) ) { com.google.gerrit.git.PushQueue.scheduleImp ( project , ref , cfg , uri ) ; } } } }

Target:
public static void scheduleUpdate ( final com.google.gerrit.client.reviewdb.Project.NameKey project , final java.lang.String ref ) { for ( final com.google.gerrit.git.PushQueue.ReplicationConfig cfg : com.google.gerrit.git.PushQueue.allConfigs ( ) ) { if ( cfg.wouldPushRef ( ref ) ) { for ( final org.spearce.jgit.transport.URIish uri : cfg.getURIs ( project , null ) ) { com.google.gerrit.git.PushQueue.scheduleImp ( project , ref , cfg , uri ) ; } } } }
Source:
private boolean canReadCommitFromVisibleRef ( com.google.gerrit.reviewdb.server.ReviewDb db , org.eclipse.jgit.lib.Repository repo , org.eclipse.jgit.revwalk.RevCommit commit ) { try ( org.eclipse.jgit.revwalk.RevWalk rw = new org.eclipse.jgit.revwalk.RevWalk ( repo ) ) { return isMergedIntoVisibleRef ( repo , db , rw , commit , repo.getAllRefs ( ) . values ( ) ) ; } catch ( java.io.IOException e ) { java.lang.String msg = java.lang.String.format ( "Cannot verify permissions to commit object %s in repository %s" , commit.name ( ) , getProject ( ) . getNameKey ( ) ) ; com.google.gerrit.server.project.ProjectControl.log.error ( msg , e ) ; return false ; } }

Target:
private boolean canReadCommitFromVisibleRef ( org.eclipse.jgit.lib.Repository repo , org.eclipse.jgit.revwalk.RevCommit commit ) { try ( org.eclipse.jgit.revwalk.RevWalk rw = new org.eclipse.jgit.revwalk.RevWalk ( repo ) ) { return isMergedIntoVisibleRef ( repo , rw , commit , repo.getAllRefs ( ) . values ( ) ) ; } catch ( java.io.IOException e ) { java.lang.String msg = java.lang.String.format ( "Cannot verify permissions to commit object %s in repository %s" , commit.name ( ) , getProject ( ) . getNameKey ( ) ) ; com.google.gerrit.server.project.ProjectControl.log.error ( msg , e ) ; return false ; } }
Source:
public void submitWithCherryPickIfFastForwardPossible ( ) throws java.lang.Exception { org.eclipse.jgit.api.Git git = createProject ( ) ; com.google.gerrit.acceptance.PushOneCommit.Result change = createChange ( git ) ; submit ( change.getChangeId ( ) ) ; assertCherryPick ( git , false ) ; com.google.common.truth.Truth.assertThat ( getRemoteHead ( ) . getParent ( 0 ) ) . isEqualTo ( change.getCommit ( ) . getParent ( 0 ) ) ; }

Target:
public void submitWithCherryPickIfFastForwardPossible ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result change = createChange ( git ) ; submit ( change.getChangeId ( ) ) ; assertCherryPick ( git , false ) ; com.google.common.truth.Truth.assertThat ( getRemoteHead ( ) . getParent ( 0 ) ) . isEqualTo ( change.getCommit ( ) . getParent ( 0 ) ) ; }
Source:
protected void configure ( ) { bind ( com.google.gerrit.common.ChangeHookRunner.class ) ; bind ( com.google.gerrit.common.ChangeHooks.class ) . to ( com.google.gerrit.common.ChangeHookRunner.class ) ; bind ( com.google.gerrit.common.EventDispatcher.class ) . to ( com.google.gerrit.common.ChangeHookRunner.class ) ; bind ( com.google.gerrit.common.EventSource.class ) . to ( com.google.gerrit.common.ChangeHookRunner.class ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.extensions.events.NewProjectCreatedListener.class ) . to ( com.google.gerrit.common.ChangeHookRunner.class ) ; listener ( ) . to ( com.google.gerrit.common.ChangeHookRunner.class ) ; }

Target:
protected void configure ( ) { bind ( com.google.gerrit.common.ChangeHookRunner.class ) ; bind ( com.google.gerrit.common.ChangeHooks.class ) . to ( com.google.gerrit.common.ChangeHookRunner.class ) ; listener ( ) . to ( com.google.gerrit.common.ChangeHookRunner.class ) ; }
Source:
protected void migrateData ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.schema.UpdateUI ui ) throws com.google.gwtorm.server.OrmException , java.sql.SQLException { try { migrateStartReplicationCapability ( db , scanForReplicationPlugin ( ) ) ; } catch ( org.eclipse.jgit.errors.RepositoryNotFoundException e ) { throw new com.google.gwtorm.server.OrmException ( e ) ; } catch ( java.sql.SQLException e ) { throw new com.google.gwtorm.server.OrmException ( e ) ; } catch ( java.io.IOException e ) { throw new com.google.gwtorm.server.OrmException ( e ) ; } catch ( org.eclipse.jgit.errors.ConfigInvalidException e ) { throw new com.google.gwtorm.server.OrmException ( e ) ; } }

Target:
protected void migrateData ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.schema.UpdateUI ui ) throws com.google.gwtorm.server.OrmException , java.sql.SQLException { try { migrateStartReplicationCapability ( scanForReplicationPlugin ( ) ) ; } catch ( java.io.IOException | org.eclipse.jgit.errors.ConfigInvalidException e ) { throw new com.google.gwtorm.server.OrmException ( e ) ; } }
Source:
public void funnel ( K from , com.google.common.hash.PrimitiveSink into ) { try { java.io.ObjectOutputStream ser = new java.io.ObjectOutputStream ( new com.google.gerrit.server.cache.h2.H2CacheImpl.SinkOutputStream ( into ) ) ; try { ser.writeObject ( from ) ; ser.flush ( ) ; } finally { ser.close ( ) ; } } catch ( java.io.IOException err ) { throw new java.lang.RuntimeException ( "Cannot hash as Serializable" , err ) ; } }

Target:
public void funnel ( K from , com.google.common.hash.PrimitiveSink into ) { try ( java.io.ObjectOutputStream ser = new java.io.ObjectOutputStream ( new com.google.gerrit.server.cache.h2.H2CacheImpl.SinkOutputStream ( into ) ) ) { ser.writeObject ( from ) ; ser.flush ( ) ; } catch ( java.io.IOException err ) { throw new java.lang.RuntimeException ( "Cannot hash as Serializable" , err ) ; } }
Source:
void onCursoBlinkRate ( com.google.gwt.event.logical.shared.ValueChangeEvent < java.lang.String > e ) { java.lang.String v = e.getValue ( ) ; if ( ( v != null ) && ( ( v.length ( ) ) > 0 ) ) { prefs.cursorBlinkRate ( java.lang.Math.max ( 0 , java.lang.Integer.parseInt ( v ) ) ) ; view.getEditor ( ) . setOption ( "cursorBlinkRate" , prefs.cursorBlinkRate ( ) ) ; } }

Target:
void onCursoBlinkRate ( com.google.gwt.event.logical.shared.ValueChangeEvent < java.lang.String > e ) { java.lang.String v = e.getValue ( ) ; if ( ( v != null ) && ( ( v.length ( ) ) > 0 ) ) { prefs.cursorBlinkRate ( java.lang.Math.max ( 0 , java.lang.Integer.parseInt ( v ) ) ) ; if ( ( view ) != null ) { view.getEditor ( ) . setOption ( "cursorBlinkRate" , prefs.cursorBlinkRate ( ) ) ; } } }
Source:
private static boolean sameUpdate ( com.google.gerrit.server.notedb.ChangeRebuilder.Event event , com.google.gerrit.server.notedb.ChangeUpdate update ) { return ( ( ( update != null ) && ( ( com.google.gerrit.server.notedb.ChangeRebuilder.round ( event.when ) ) == ( com.google.gerrit.server.notedb.ChangeRebuilder.round ( update.getWhen ( ) ) ) ) ) && ( event.who.equals ( update.getUser ( ) ) ) ) && ( event.psId.equals ( update.getPatchSetId ( ) ) ) ; }

Target:
private static boolean sameUpdate ( com.google.gerrit.server.notedb.ChangeRebuilder.Event event , com.google.gerrit.server.notedb.ChangeUpdate update ) { return ( ( ( update != null ) && ( ( com.google.gerrit.server.notedb.ChangeRebuilder.round ( event.when ) ) == ( com.google.gerrit.server.notedb.ChangeRebuilder.round ( update.getWhen ( ) ) ) ) ) && ( event.who.equals ( update.getUser ( ) . getAccountId ( ) ) ) ) && ( event.psId.equals ( update.getPatchSetId ( ) ) ) ; }
Source:
private void deleteGitRepository ( final org.eclipse.jgit.lib.Repository repository ) throws com.google.gerrit.sshd.BaseCommand.UnloggedFailure { java.io.File parentFile = repository.getDirectory ( ) . getParentFile ( ) ; if ( ! ( recursiveDelete ( repository.getDirectory ( ) ) ) ) { throw new com.google.gerrit.sshd.BaseCommand.UnloggedFailure ( ( "Error trying to delete " + ( repository.getDirectory ( ) . getAbsolutePath ( ) ) ) ) ; } recursiveDeleteParent ( parentFile , gitDir ) ; }

Target:
private void deleteGitRepository ( final org.eclipse.jgit.lib.Repository repository ) throws java.io.IOException { java.io.File parentFile = repository.getDirectory ( ) . getParentFile ( ) ; if ( ! ( recursiveDelete ( repository.getDirectory ( ) ) ) ) { throw new java.io.IOException ( ( "Error trying to delete " + ( repository.getDirectory ( ) . getAbsolutePath ( ) ) ) ) ; } recursiveDeleteParent ( parentFile , gitDir ) ; }
Source:
com.google.gerrit.client.diff.DiffChunkInfo getFirst ( ) { if ( ! ( chunks.isEmpty ( ) ) ) { for ( com.google.gerrit.client.diff.DiffChunkInfo d : chunks ) { if ( ( d.getSide ( ) ) == ( DisplaySide.B ) ) { return d ; } } return chunks.get ( 0 ) ; } return null ; }

Target:
com.google.gerrit.client.diff.DiffChunkInfo getFirst ( ) { return ! ( chunks.isEmpty ( ) ) ? chunks.get ( 0 ) : null ; }
Source:
private void printTree ( final com.google.gerrit.sshd.commands.TreeNode node , final int level , final boolean isLast ) { printNode ( node , level , isLast ) ; final java.util.SortedSet < ? extends com.google.gerrit.sshd.commands.TreeNode > childNodes = node.getChildren ( ) ; int i = 0 ; for ( final com.google.gerrit.sshd.commands.TreeNode childNode : childNodes ) { final boolean isLastChild = ( ++ i ) == ( childNodes.size ( ) ) ; printTree ( childNode , ( level + 1 ) , isLastChild ) ; } }

Target:
private void printTree ( final com.google.gerrit.sshd.commands.TreeNode node , final int level , final boolean isLast ) { printNode ( node , level , isLast ) ; final java.util.SortedSet < ? extends com.google.gerrit.sshd.commands.TreeNode > childNodes = node.getChildren ( ) ; int i = 0 ; final int size = childNodes.size ( ) ; for ( final com.google.gerrit.sshd.commands.TreeNode childNode : childNodes ) { final boolean isLastChild = ( ++ i ) == size ; printTree ( childNode , ( level + 1 ) , isLastChild ) ; } }
Source:
public void printJson ( final java.lang.StringBuffer sb , final java.util.List < T > o ) { sb.append ( '[' ) ; boolean first = true ; for ( final T item : o ) { if ( first ) { first = false ; } else { sb.append ( ',' ) ; } if ( item != null ) { serializer.printJson ( sb , item ) ; } else { sb.append ( com.google.gwtjsonrpc.client.JS_NULL ) ; } } sb.append ( ']' ) ; }

Target:
public void printJson ( final java.lang.StringBuilder sb , final java.util.List < T > o ) { sb.append ( '[' ) ; boolean first = true ; for ( final T item : o ) { if ( first ) { first = false ; } else { sb.append ( ',' ) ; } if ( item != null ) { serializer.printJson ( sb , item ) ; } else { sb.append ( com.google.gwtjsonrpc.client.JS_NULL ) ; } } sb.append ( ']' ) ; }
Source:
public void testSubsequentGetReads ( ) throws com.google.gwtorm.client.OrmException { db.create ( ) ; final com.google.gerrit.reviewdb.SystemConfig exp = db.getSystemConfig ( ) ; final com.google.gerrit.reviewdb.SystemConfig act = db.getSystemConfig ( ) ; assertNotSame ( exp , act ) ; assertEquals ( exp.sitePath , act.sitePath ) ; assertEquals ( exp.registerEmailPrivateKey , act.registerEmailPrivateKey ) ; }

Target:
public void testSubsequentGetReads ( ) throws com.google.gwtorm.client.OrmException { db.create ( ) ; final com.google.gerrit.reviewdb.SystemConfig exp = db.getSystemConfig ( ) ; final com.google.gerrit.reviewdb.SystemConfig act = db.getSystemConfig ( ) ; assertNotSame ( exp , act ) ; assertEquals ( exp.sitePath , act.sitePath ) ; }
Source:
public void run ( ) { try { final java.io.BufferedReader br = new java.io.BufferedReader ( new java.io.InputStreamReader ( in , "ISO-8859-1" ) ) ; java.lang.String line ; while ( ( line = br.readLine ( ) ) != null ) { com.google.gerrit.httpd.gitweb.GitWebServlet.log.error ( ( "CGI: " + line ) ) ; } br.close ( ) ; } catch ( java.io.IOException e ) { com.google.gerrit.httpd.gitweb.GitWebServlet.log.debug ( "Unexpected error copying stderr from CGI" , e ) ; } }

Target:
public void run ( ) { try { final java.io.BufferedReader br = new java.io.BufferedReader ( new java.io.InputStreamReader ( in , "ISO-8859-1" ) ) ; try { java.lang.String line ; while ( ( line = br.readLine ( ) ) != null ) { com.google.gerrit.httpd.gitweb.GitWebServlet.log.error ( ( "CGI: " + line ) ) ; } } finally { br.close ( ) ; } } catch ( java.io.IOException e ) { com.google.gerrit.httpd.gitweb.GitWebServlet.log.debug ( "Unexpected error copying stderr from CGI" , e ) ; } }
Source:
public java.lang.String getCookieText ( final java.lang.String cookieName ) { final java.lang.String val = com.google.gwtjsonrpc.client.CookieAccess.get ( cookieName ) ; boolean ok ; try { ok = checkToken ( val , null ) ; } catch ( com.google.gwtjsonrpc.server.XsrfException e ) { ok = false ; } return ok ? com.google.gwtjsonrpc.client.CookieAccess.getTokenText ( cookieName ) : null ; }

Target:
public java.lang.String getCookieText ( final java.lang.String cookieName ) { final java.lang.String val = com.google.gwtjsonrpc.client.CookieAccess.get ( cookieName ) ; boolean ok ; try { ok = ( checkToken ( val , null ) ) != null ; } catch ( com.google.gwtjsonrpc.server.XsrfException e ) { ok = false ; } return ok ? com.google.gwtjsonrpc.client.CookieAccess.getTokenText ( cookieName ) : null ; }
Source:
public void testBulletList1 ( ) { final com.google.gwtexpui.safehtml.client.SafeHtml o = com.google.gwtexpui.safehtml.client.SafeHtml_WikifyListTest.html ( "A\n\n* line 1\n* 2nd line" ) ; final com.google.gwtexpui.safehtml.client.SafeHtml n = o.wikify ( ) ; assertNotSame ( o , n ) ; assertEquals ( ( ( ( ( "<p>A</p>" + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyListTest.BEGIN_LIST ) ) + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyListTest.item ( "line 1" ) ) ) + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyListTest.item ( "2nd line" ) ) ) + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyListTest.END_LIST ) ) , n.asString ( ) ) ; }

Target:
public void testBulletList1 ( ) { final com.google.gwtexpui.safehtml.client.SafeHtml o = com.google.gwtexpui.safehtml.client.SafeHtml_WikifyListTest.html ( "A\n\n* line 1\n* 2nd line" ) ; final com.google.gwtexpui.safehtml.client.SafeHtml n = o.wikify ( ) ; org.junit.Assert.assertNotSame ( o , n ) ; org.junit.Assert.assertEquals ( ( ( ( ( "<p>A</p>" + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyListTest.BEGIN_LIST ) ) + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyListTest.item ( "line 1" ) ) ) + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyListTest.item ( "2nd line" ) ) ) + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyListTest.END_LIST ) ) , n.asString ( ) ) ; }
Source:
private static com.google.gerrit.server.project.ChangeControl validate ( final com.google.gerrit.server.project.ChangeControl c , final com.google.gerrit.reviewdb.ReviewDb db ) throws com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.client.OrmException { if ( ! ( c.isVisible ( db ) ) ) { throw new com.google.gerrit.server.project.NoSuchChangeException ( c.getChange ( ) . getId ( ) ) ; } return c ; }

Target:
private static com.google.gerrit.server.project.ChangeControl validate ( final com.google.gerrit.server.project.ChangeControl c , final com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException { if ( ! ( c.isVisible ( db ) ) ) { throw new com.google.gerrit.server.project.NoSuchChangeException ( c.getChange ( ) . getId ( ) ) ; } return c ; }
Source:
private java.util.List < com.google.gerrit.server.change.GetRelated.ChangeAndCommit > getRelated ( com.google.gerrit.reviewdb.client.PatchSet.Id ps ) throws java.io.IOException { java.lang.String url = java.lang.String.format ( "/changes/%d/revisions/%d/related" , ps.getParentKey ( ) . get ( ) , ps.get ( ) ) ; return newGson ( ) . fromJson ( adminSession.get ( url ) . getReader ( ) , com.google.gerrit.server.change.GetRelated.RelatedInfo.class ) . changes ; }

Target:
private java.util.List < com.google.gerrit.server.change.GetRelated.ChangeAndCommit > getRelated ( com.google.gerrit.reviewdb.client.PatchSet.Id ps ) throws java.io.IOException { return getRelated ( ps.getParentKey ( ) , ps.get ( ) ) ; }
Source:
public void onSuccess ( com.google.gerrit.client.changes.CommentInfo result ) { notifyDraftDelta ( ( wasNew ? 1 : 0 ) ) ; comment = com.google.gerrit.client.patches.CommentEditorPanel.toComment ( psId , comment.getKey ( ) . get ( ) , result ) ; text.setReadOnly ( false ) ; save.setEnabled ( true ) ; cancel.setEnabled ( true ) ; discard.setEnabled ( true ) ; render ( ) ; onSave.onSuccess ( VoidResult.INSTANCE ) ; }

Target:
public void onSuccess ( com.google.gerrit.client.changes.CommentInfo result ) { notifyDraftDelta ( ( wasNew ? 1 : 0 ) ) ; comment = com.google.gerrit.client.patches.CommentEditorPanel.toComment ( psId , comment.getKey ( ) . getParentKey ( ) . get ( ) , result ) ; text.setReadOnly ( false ) ; save.setEnabled ( true ) ; cancel.setEnabled ( true ) ; discard.setEnabled ( true ) ; render ( ) ; onSave.onSuccess ( VoidResult.INSTANCE ) ; }
Source:
private static java.util.List < com.google.gwtorm.schema.QueryModel.OrderBy > orderByLeaves ( java.util.List < com.google.gwtorm.schema.QueryModel.OrderBy > in ) { java.util.ArrayList < com.google.gwtorm.schema.QueryModel.OrderBy > r = new java.util.ArrayList < com.google.gwtorm.schema.QueryModel.OrderBy > ( in.size ( ) ) ; for ( com.google.gwtorm.schema.QueryModel.OrderBy m : in ) { if ( m.column.isNested ( ) ) { for ( com.google.gwtorm.schema.ColumnModel c : m.column.getAllLeafColumns ( ) ) { r.add ( new com.google.gwtorm.schema.QueryModel.OrderBy ( c , m.descending ) ) ; } } else { r.add ( m ) ; } } return r ; }

Target:
private static java.util.List < com.google.gwtorm.schema.QueryModel.OrderBy > orderByLeaves ( java.util.List < com.google.gwtorm.schema.QueryModel.OrderBy > in ) { java.util.ArrayList < com.google.gwtorm.schema.QueryModel.OrderBy > r = new java.util.ArrayList ( in.size ( ) ) ; for ( com.google.gwtorm.schema.QueryModel.OrderBy m : in ) { if ( m.column.isNested ( ) ) { for ( com.google.gwtorm.schema.ColumnModel c : m.column.getAllLeafColumns ( ) ) { r.add ( new com.google.gwtorm.schema.QueryModel.OrderBy ( c , m.descending ) ) ; } } else { r.add ( m ) ; } } return r ; }
Source:
private void initChangeRepo ( ) throws java.io.IOException { if ( ( changeRepo ) == null ) { com.google.common.base.Preconditions.checkState ( ( ! ( changeUpdates.isEmpty ( ) ) ) ) ; changeRepo = openRepo ( changeUpdates.values ( ) . iterator ( ) . next ( ) . getProjectName ( ) ) ; } }

Target:
private void initChangeRepo ( ) throws java.io.IOException { if ( ( changeRepo ) == null ) { changeRepo = openRepo ( projectName ) ; } }
Source:
public void createEditByDeletingExistingFileRest ( ) throws java.lang.Exception { com.google.gerrit.acceptance.RestResponse r = adminSession.delete ( urlEditFile ( ) ) ; org.junit.Assert.assertEquals ( org.apache.http.HttpStatus.SC_NO_CONTENT , r.getStatusCode ( ) ) ; com.google.common.base.Optional < com.google.gerrit.server.edit.ChangeEdit > edit = editUtil.byChange ( change ) ; try { fileUtil.getContent ( edit.get ( ) . getChange ( ) . getProject ( ) , edit.get ( ) . getRevision ( ) . get ( ) , com.google.gerrit.acceptance.edit.ChangeEditIT.FILE_NAME ) ; org.junit.Assert.fail ( "ResourceNotFoundException expected" ) ; } catch ( com.google.gerrit.extensions.restapi.ResourceNotFoundException rnfe ) { } }

Target:
public void createEditByDeletingExistingFileRest ( ) throws java.lang.Exception { com.google.gerrit.acceptance.RestResponse r = adminSession.delete ( urlEditFile ( ) ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( org.apache.http.HttpStatus.SC_NO_CONTENT ) ; com.google.common.base.Optional < com.google.gerrit.server.edit.ChangeEdit > edit = editUtil.byChange ( change ) ; try { fileUtil.getContent ( edit.get ( ) . getChange ( ) . getProject ( ) , edit.get ( ) . getRevision ( ) . get ( ) , com.google.gerrit.acceptance.edit.ChangeEditIT.FILE_NAME ) ; org.junit.Assert.fail ( "ResourceNotFoundException expected" ) ; } catch ( com.google.gerrit.extensions.restapi.ResourceNotFoundException rnfe ) { } }
Source:
public void onSuccess ( final java.util.List < com.google.gerrit.common.data.AccountInfo > result ) { final java.util.ArrayList < com.google.gerrit.client.ui.AccountSuggestOracle.AccountSuggestion > r = new java.util.ArrayList < com.google.gerrit.client.ui.AccountSuggestOracle.AccountSuggestion > ( result.size ( ) ) ; for ( final com.google.gerrit.common.data.AccountInfo p : result ) { r.add ( new com.google.gerrit.client.ui.AccountSuggestOracle.AccountSuggestion ( p ) ) ; } callback.onSuggestionsReady ( req , new com.google.gerrit.client.ui.Response ( r ) ) ; }

Target:
public void onSuccess ( final java.util.List < com.google.gerrit.common.data.AccountInfo > result ) { final java.util.ArrayList < com.google.gerrit.client.ui.AccountSuggestOracle.AccountSuggestion > r = new java.util.ArrayList ( result.size ( ) ) ; for ( final com.google.gerrit.common.data.AccountInfo p : result ) { r.add ( new com.google.gerrit.client.ui.AccountSuggestOracle.AccountSuggestion ( p ) ) ; } callback.onSuggestionsReady ( req , new com.google.gerrit.client.ui.Response ( r ) ) ; }
Source:
public void onBlur ( final com.google.gwt.event.dom.client.BlurEvent event ) { if ( "" . equals ( nameTxtBox.getText ( ) ) ) { nameTxtBox.setText ( Util.C.defaultAccountName ( ) ) ; nameTxtBox.addStyleName ( Gerrit.RESOURCES.css ( ) . inputFieldTypeHint ( ) ) ; } }

Target:
public java.lang.String getText ( ) { java.lang.String s = nameTxtBox.getText ( ) ; return s == null ? "" : s ; }
Source:
protected void doGet ( final javax.servlet.http.HttpServletRequest req , final javax.servlet.http.HttpServletResponse rsp ) throws java.io.IOException { java.lang.String path = java.lang.String.format ( "/register%s" , ( slash ? req.getPathInfo ( ) : "" ) ) ; com.google.gerrit.httpd.UrlModule.toGerrit ( path , req , rsp ) ; BRANCH ( aaaf45 ) ; com.google.gerrit.httpd.Fix StringIndexOutOfBoundsException = ( on ) / ( register ) ; com.google.gerrit.httpd.URL pr ; }

Target:
protected void doGet ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse rsp ) throws java.io.IOException { java.lang.String path = java.lang.String.format ( "/register%s" , ( slash ? req.getPathInfo ( ) : "" ) ) ; com.google.gerrit.httpd.UrlModule.toGerrit ( path , req , rsp ) ; }
Source:
private com.google.inject.Injector createSshInjector ( ) { final java.util.List < com.google.inject.Module > modules = new java.util.ArrayList < > ( ) ; modules.add ( sysInjector.getInstance ( com.google.gerrit.sshd.SshModule.class ) ) ; modules.add ( new com.google.gerrit.sshd.SshHostKeyModule ( ) ) ; modules.add ( new com.google.gerrit.sshd.commands.DefaultCommandModule ( false , sysInjector.getInstance ( com.google.gerrit.server.config.DownloadConfig.class ) , sysInjector.getInstance ( com.google.inject.Module.class ) ) ) ; modules.add ( new com.google.gerrit.sshd.commands.IndexCommandsModule ( ) ) ; return sysInjector.createChildInjector ( modules ) ; }

Target:
private com.google.inject.Injector createSshInjector ( ) { final java.util.List < com.google.inject.Module > modules = new java.util.ArrayList < > ( ) ; modules.add ( sysInjector.getInstance ( com.google.gerrit.sshd.SshModule.class ) ) ; modules.add ( new com.google.gerrit.sshd.SshHostKeyModule ( ) ) ; modules.add ( new com.google.gerrit.sshd.commands.DefaultCommandModule ( false , sysInjector.getInstance ( com.google.gerrit.server.config.DownloadConfig.class ) , sysInjector.getInstance ( com.google.inject.Module.class ) ) ) ; modules.add ( new com.google.gerrit.sshd.commands.IndexCommandsModule ( sysInjector ) ) ; return sysInjector.createChildInjector ( modules ) ; }
Source:
protected void setUp ( ) throws java.lang.Exception { repo = new org.eclipse.jgit.junit.TestRepository < org.eclipse.jgit.internal.storage.dfs.DfsRepository > ( new org.eclipse.jgit.internal.storage.dfs.InMemoryRepository ( new org.eclipse.jgit.internal.storage.dfs.DfsRepositoryDescription ( "test" ) ) ) ; servlet = new com.google.gitiles.RepositoryIndexServlet ( new org.eclipse.jgit.lib.Config ( ) , new com.google.gitiles.DefaultRenderer ( ) , new com.google.gitiles.TestGitilesAccess ( repo.getRepository ( ) ) , new com.google.gitiles.TimeCache ( ) ) ; }

Target:
protected void setUp ( ) throws java.lang.Exception { repo = new org.eclipse.jgit.junit.TestRepository < org.eclipse.jgit.internal.storage.dfs.DfsRepository > ( new org.eclipse.jgit.internal.storage.dfs.InMemoryRepository ( new org.eclipse.jgit.internal.storage.dfs.DfsRepositoryDescription ( "test" ) ) ) ; servlet = new com.google.gitiles.RepositoryIndexServlet ( new com.google.gitiles.DefaultRenderer ( ) , new com.google.gitiles.TestGitilesAccess ( repo.getRepository ( ) ) , new com.google.gitiles.TimeCache ( ) ) ; }
Source:
public void stop ( ) { com.google.gerrit.server.index.ChangeIndex read = searchIndex.get ( ) ; if ( read != null ) { read.close ( ) ; } for ( com.google.gerrit.server.index.ChangeIndex write : writeIndexes ) { if ( write != read ) { read.close ( ) ; } } }

Target:
public void stop ( ) { com.google.gerrit.server.index.ChangeIndex read = searchIndex.get ( ) ; if ( read != null ) { read.close ( ) ; } for ( com.google.gerrit.server.index.ChangeIndex write : writeIndexes ) { if ( write != read ) { write.close ( ) ; } } }
Source:
protected static java.io.PrintWriter toPrintWriter ( final java.io.OutputStream o ) { try { return new java.io.PrintWriter ( new java.io.BufferedWriter ( new java.io.OutputStreamWriter ( o , com.google.gerrit.sshd.BaseCommand.ENC ) ) ) ; } catch ( java.io.UnsupportedEncodingException e ) { throw new java.lang.RuntimeException ( ( ( "JVM lacks " + ( com.google.gerrit.sshd.BaseCommand.ENC ) ) + " encoding" ) , e ) ; } }

Target:
protected static java.io.PrintWriter toPrintWriter ( final java.io.OutputStream o ) { return new java.io.PrintWriter ( new java.io.BufferedWriter ( new java.io.OutputStreamWriter ( o , com.google.gerrit.sshd.BaseCommand.ENC ) ) ) ; }
Source:
protected java.util.SortedSet < java.lang.String > cacheNames ( ) { final java.util.SortedSet < java.lang.String > names = new java.util.TreeSet < java.lang.String > ( ) ; names.add ( "groups" ) ; names.add ( "accounts" ) ; for ( final net.sf.ehcache.Ehcache c : getAllCaches ( ) ) { names.add ( c.getName ( ) ) ; } return names ; }

Target:
protected java.util.SortedSet < java.lang.String > cacheNames ( ) { final java.util.SortedSet < java.lang.String > names = new java.util.TreeSet < java.lang.String > ( ) ; names.add ( "accounts" ) ; for ( final net.sf.ehcache.Ehcache c : getAllCaches ( ) ) { names.add ( c.getName ( ) ) ; } return names ; }
Source:
public RefUpdate.Result call ( ) throws java.lang.Exception { org.eclipse.jgit.lib.Ref ref = repo.exactRef ( refName ) ; afterReadRef.run ( ) ; org.eclipse.jgit.lib.ObjectId oldId ; if ( ref == null ) { oldId = org.eclipse.jgit.lib.ObjectId.zeroId ( ) ; next = seed.get ( ) ; } else { oldId = ref.getObjectId ( ) ; next = parse ( rw , oldId ) ; } return store ( repo , rw , oldId , ( ( next ) + ( count ) ) ) ; }

Target:
public RefUpdate.Result call ( ) throws java.lang.Exception { org.eclipse.jgit.lib.Ref ref = repo.exactRef ( refName ) ; afterReadRef.run ( ) ; org.eclipse.jgit.lib.ObjectId oldId ; if ( ref == null ) { oldId = org.eclipse.jgit.lib.ObjectId.zeroId ( ) ; next = seed.get ( ) ; } else { oldId = ref.getObjectId ( ) ; next = parse ( oldId ) ; } return store ( repo , rw , oldId , ( ( next ) + ( count ) ) ) ; }
Source:
protected < T > void doInvoke ( final java.lang.String methodName , final boolean allowXsrf , final java.lang.String reqData , final com.google.gwtjsonrpc.client.JsonSerializer < T > ser , final com.google.gwt.user.client.rpc.AsyncCallback < T > cb ) throws com.google.gwt.user.client.rpc.InvocationException { if ( ( url ) == null ) { throw new com.google.gwtjsonrpc.client.NoServiceEntryPointSpecifiedException ( ) ; } new com.google.gwtjsonrpc.client.JsonCall < T > ( this , methodName , allowXsrf , reqData , ser , cb ) . send ( ) ; }

Target:
protected < T > void doInvoke ( final java.lang.String methodName , final java.lang.String reqData , final com.google.gwtjsonrpc.client.JsonSerializer < T > ser , final com.google.gwt.user.client.rpc.AsyncCallback < T > cb ) throws com.google.gwt.user.client.rpc.InvocationException { if ( ( url ) == null ) { throw new com.google.gwtjsonrpc.client.NoServiceEntryPointSpecifiedException ( ) ; } new com.google.gwtjsonrpc.client.JsonCall < T > ( this , methodName , reqData , ser , cb ) . send ( ) ; }
Source:
protected void configure ( ) { bindScope ( com.google.inject.servlet.SessionScoped.class , SshScopes.SESSION ) ; bindScope ( com.google.inject.servlet.RequestScoped.class , SshScopes.REQUEST ) ; configureSessionScope ( ) ; configureRequestScope ( ) ; bind ( com.google.gerrit.server.ssh.SshInfo.class ) . to ( com.google.gerrit.server.ssh.SshDaemon.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; bind ( org.apache.sshd.server.CommandFactory.class ) . toProvider ( com.google.gerrit.server.ssh.CommandFactoryProvider.class ) ; bind ( org.apache.sshd.server.PublickeyAuthenticator.class ) . to ( com.google.gerrit.server.ssh.DatabasePubKeyAuth.class ) ; install ( new com.google.gerrit.server.ssh.commands.DefaultCommandModule ( ) ) ; }

Target:
protected void configure ( ) { bindScope ( com.google.inject.servlet.SessionScoped.class , SshScopes.SESSION ) ; bindScope ( com.google.inject.servlet.RequestScoped.class , SshScopes.REQUEST ) ; configureSessionScope ( ) ; configureRequestScope ( ) ; bind ( com.google.gerrit.server.ssh.SshInfo.class ) . to ( com.google.gerrit.server.ssh.SshDaemon.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; bind ( com.google.gerrit.server.ssh.CommandFactoryProvider.class ) ; bind ( org.apache.sshd.server.CommandFactory.class ) . toProvider ( com.google.gerrit.server.ssh.CommandFactoryProvider.class ) ; bind ( org.apache.sshd.server.PublickeyAuthenticator.class ) . to ( com.google.gerrit.server.ssh.DatabasePubKeyAuth.class ) ; install ( new com.google.gerrit.server.ssh.commands.DefaultCommandModule ( ) ) ; }
Source:
public com.google.gerrit.server.project.ChangeControl controlFor ( final com.google.gerrit.client.reviewdb.Change change ) throws com.google.gerrit.server.project.NoSuchChangeException { try { final com.google.gerrit.client.reviewdb.Project.NameKey projectKey = change.getDest ( ) . getParentKey ( ) ; return projectControl.validateFor ( projectKey ) . controlFor ( change ) ; } catch ( com.google.gerrit.server.project.NoSuchProjectException e ) { throw new com.google.gerrit.server.project.NoSuchChangeException ( change.getId ( ) , e ) ; } }

Target:
public com.google.gerrit.server.project.ChangeControl controlFor ( final com.google.gerrit.client.reviewdb.Change change ) throws com.google.gerrit.server.project.NoSuchChangeException { try { final com.google.gerrit.client.reviewdb.Project.NameKey projectKey = change.getProject ( ) ; return projectControl.validateFor ( projectKey ) . controlFor ( change ) ; } catch ( com.google.gerrit.server.project.NoSuchProjectException e ) { throw new com.google.gerrit.server.project.NoSuchChangeException ( change.getId ( ) , e ) ; } }
Source:
public java.lang.Iterable < com.google.gerrit.server.query.change.ChangeData > byCommitsOnBranchNotMerged ( com.google.gerrit.reviewdb.client.Branch.NameKey branch , java.util.List < java.lang.String > hashes ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.server.index.Schema < com.google.gerrit.server.query.change.ChangeData > schema = com.google.gerrit.server.query.change.InternalChangeQuery.schema ( indexes ) ; int batchSize ; if ( ( schema != null ) && ( schema.hasField ( ChangeField.EXACT_COMMIT ) ) ) { batchSize = ( indexConfig.maxTerms ( ) ) - 3 ; } else { batchSize = indexConfig.maxPrefixTerms ( ) ; } return byCommitsOnBranchNotMerged ( schema , branch , hashes , batchSize ) ; }

Target:
public java.lang.Iterable < com.google.gerrit.server.query.change.ChangeData > byCommitsOnBranchNotMerged ( org.eclipse.jgit.lib.Repository repo , com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Branch.NameKey branch , java.util.List < java.lang.String > hashes ) throws com.google.gwtorm.server.OrmException , java.io.IOException { return byCommitsOnBranchNotMerged ( repo , db , branch , hashes , ( ( indexConfig.maxTerms ( ) ) - 3 ) ) ; }
Source:
public void run ( ) { try { future.get ( ) ; done.update ( 1 ) ; } catch ( java.lang.InterruptedException e ) { fail ( change , e ) ; } catch ( java.util.concurrent.ExecutionException e ) { fail ( change , e ) ; } catch ( java.lang.RuntimeException e ) { failAndThrow ( change , e ) ; } catch ( java.lang.Error e ) { failAndThrow ( change , e ) ; } finally { sem.release ( ) ; } }

Target:
private void failAndThrow ( com.google.gerrit.reviewdb.client.Project.NameKey project , java.lang.RuntimeException e ) { fail ( project , e ) ; throw e ; }
Source:
protected void configure ( ) { factory ( RenameGroupOp.Factory.class ) ; factory ( MetaDataUpdate.InternalFactory.class ) ; bind ( MetaDataUpdate.Server.class ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , org.eclipse.jgit.transport.PostUploadHook.class ) . to ( com.google.gerrit.server.git.UploadPackMetricsHook.class ) ; com.google.gerrit.extensions.registration.DynamicItem.itemOf ( binder ( ) , com.google.gerrit.server.git.ChangeReportFormatter.class ) ; com.google.gerrit.extensions.registration.DynamicItem.bind ( binder ( ) , com.google.gerrit.server.git.ChangeReportFormatter.class ) . to ( com.google.gerrit.server.git.DefaultChangeReportFormatter.class ) ; }

Target:
protected void configure ( ) { factory ( MetaDataUpdate.InternalFactory.class ) ; bind ( MetaDataUpdate.Server.class ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , org.eclipse.jgit.transport.PostUploadHook.class ) . to ( com.google.gerrit.server.git.UploadPackMetricsHook.class ) ; com.google.gerrit.extensions.registration.DynamicItem.itemOf ( binder ( ) , com.google.gerrit.server.git.ChangeReportFormatter.class ) ; com.google.gerrit.extensions.registration.DynamicItem.bind ( binder ( ) , com.google.gerrit.server.git.ChangeReportFormatter.class ) . to ( com.google.gerrit.server.git.DefaultChangeReportFormatter.class ) ; }
Source:
public void testTransitionToUnhealthy ( ) throws java.io.IOException { assertIsHealthy ( ) ; javax.servlet.http.HttpServletResponse responseMock = mock ( javax.servlet.http.HttpServletResponse.class ) ; servlet.doDelete ( null , responseMock ) ; org.mockito.Mockito.verify ( responseMock ) . setStatus ( javax.servlet.http.HttpServletResponse.SC_NO_CONTENT ) ; assertIsUnhealthy ( ) ; responseMock = mock ( javax.servlet.http.HttpServletResponse.class ) ; servlet.doDelete ( null , responseMock ) ; org.mockito.Mockito.verify ( responseMock ) . setStatus ( javax.servlet.http.HttpServletResponse.SC_NO_CONTENT ) ; assertIsUnhealthy ( ) ; }

Target:
public void testTransitionToUnhealthy ( ) throws java.io.IOException { assertIsHealthy ( ) ; javax.servlet.http.HttpServletResponse responseMock = org.mockito.Mockito.mock ( javax.servlet.http.HttpServletResponse.class ) ; servlet.doDelete ( null , responseMock ) ; org.mockito.Mockito.verify ( responseMock ) . setStatus ( javax.servlet.http.HttpServletResponse.SC_NO_CONTENT ) ; assertIsUnhealthy ( ) ; responseMock = org.mockito.Mockito.mock ( javax.servlet.http.HttpServletResponse.class ) ; servlet.doDelete ( null , responseMock ) ; org.mockito.Mockito.verify ( responseMock ) . setStatus ( javax.servlet.http.HttpServletResponse.SC_NO_CONTENT ) ; assertIsUnhealthy ( ) ; }
Source:
public java.util.List < com.google.gerrit.server.git.VersionedMetaData.PathInfo > getPathInfos ( boolean recursive ) throws java.io.IOException { org.eclipse.jgit.treewalk.TreeWalk tw = new org.eclipse.jgit.treewalk.TreeWalk ( reader ) ; tw.addTree ( revision.getTree ( ) ) ; tw.setRecursive ( recursive ) ; java.util.List < com.google.gerrit.server.git.VersionedMetaData.PathInfo > paths = new java.util.ArrayList < > ( ) ; while ( tw.next ( ) ) { paths.add ( new com.google.gerrit.server.git.VersionedMetaData.PathInfo ( tw ) ) ; } return paths ; }

Target:
public java.util.List < com.google.gerrit.server.git.VersionedMetaData.PathInfo > getPathInfos ( boolean recursive ) throws java.io.IOException { try ( org.eclipse.jgit.treewalk.TreeWalk tw = new org.eclipse.jgit.treewalk.TreeWalk ( reader ) ) { tw.addTree ( revision.getTree ( ) ) ; tw.setRecursive ( recursive ) ; java.util.List < com.google.gerrit.server.git.VersionedMetaData.PathInfo > paths = new java.util.ArrayList < > ( ) ; while ( tw.next ( ) ) { paths.add ( new com.google.gerrit.server.git.VersionedMetaData.PathInfo ( tw ) ) ; } return paths ; } }
Source:
public void blobText ( ) throws java.lang.Exception { repo.branch ( "master" ) . commit ( ) . add ( "foo" , "contents" ) . create ( ) ; java.lang.String text = buildBlob ( "/repo/+/master/foo" , "100644" ) ; org.junit.Assert.assertEquals ( "contents" , text ) ; }

Target:
public void blobText ( ) throws java.lang.Exception { repo.branch ( "master" ) . commit ( ) . add ( "foo" , "contents" ) . create ( ) ; java.lang.String text = buildBlob ( "/repo/+/master/foo" , "100644" ) ; com.google.common.truth.Truth.assertThat ( text ) . isEqualTo ( "contents" ) ; }
Source:
public void checkRemoveReviewer ( com.google.gerrit.server.notedb.ChangeNotes notes , com.google.gerrit.server.CurrentUser currentUser , com.google.gerrit.reviewdb.client.PatchSetApproval approval ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.server.permissions.PermissionBackendException , com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException { if ( canRemoveReviewerWithoutPermissionCheck ( notes.getChange ( ) , currentUser , approval.getAccountId ( ) , approval.getValue ( ) ) ) { return ; } permissionBackend.user ( currentUser ) . change ( notes ) . database ( dbProvider ) . check ( ChangePermission.REMOVE_REVIEWER ) ; }

Target:
public void checkRemoveReviewer ( com.google.gerrit.server.notedb.ChangeNotes notes , com.google.gerrit.server.CurrentUser currentUser , com.google.gerrit.reviewdb.client.PatchSetApproval approval ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.server.permissions.PermissionBackendException , com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException { checkRemoveReviewer ( notes , currentUser , approval.getAccountId ( ) , approval.getValue ( ) ) ; }
Source:
public void setAndGetEmptyWatch ( ) throws java.lang.Exception { java.lang.String projectName = createProject ( com.google.gerrit.acceptance.rest.account.WatchedProjectsIT.NEW_PROJECT_NAME ) . get ( ) ; java.util.List < com.google.gerrit.extensions.client.ProjectWatchInfo > projectsToWatch = new java.util.LinkedList < > ( ) ; com.google.gerrit.extensions.client.ProjectWatchInfo pwi = new com.google.gerrit.extensions.client.ProjectWatchInfo ( ) ; pwi.project = projectName ; projectsToWatch.add ( pwi ) ; gApi.accounts ( ) . self ( ) . setWatchedProjects ( projectsToWatch ) ; java.util.List < com.google.gerrit.extensions.client.ProjectWatchInfo > persistedWatchedProjects = gApi.accounts ( ) . self ( ) . getWatchedProjects ( ) ; com.google.common.truth.Truth.assertThat ( persistedWatchedProjects ) . containsAllIn ( projectsToWatch ) ; }

Target:
public void setAndGetEmptyWatch ( ) throws java.lang.Exception { java.lang.String projectName = createProject ( com.google.gerrit.acceptance.rest.account.WatchedProjectsIT.NEW_PROJECT_NAME ) . get ( ) ; java.util.List < com.google.gerrit.extensions.client.ProjectWatchInfo > projectsToWatch = new java.util.ArrayList < > ( ) ; com.google.gerrit.extensions.client.ProjectWatchInfo pwi = new com.google.gerrit.extensions.client.ProjectWatchInfo ( ) ; pwi.project = projectName ; projectsToWatch.add ( pwi ) ; gApi.accounts ( ) . self ( ) . setWatchedProjects ( projectsToWatch ) ; java.util.List < com.google.gerrit.extensions.client.ProjectWatchInfo > persistedWatchedProjects = gApi.accounts ( ) . self ( ) . getWatchedProjects ( ) ; com.google.common.truth.Truth.assertThat ( persistedWatchedProjects ) . containsAllIn ( projectsToWatch ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; loggedEvents = com.google.common.collect.Lists.newArrayList ( ) ; loggerName = this . getClass ( ) . getCanonicalName ( ) ; loggerName = loggerName.substring ( 0 , ( ( loggerName.length ( ) ) - 4 ) ) ; loggerSettings = com.google.gerrit.testutil.log.LogUtil.logToCollection ( loggerName , loggedEvents ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; loggedEvents = new java.util.ArrayList < > ( ) ; loggerName = this . getClass ( ) . getCanonicalName ( ) ; loggerName = loggerName.substring ( 0 , ( ( loggerName.length ( ) ) - 4 ) ) ; loggerSettings = com.google.gerrit.testutil.log.LogUtil.logToCollection ( loggerName , loggedEvents ) ; }
Source:
public void onSend ( ) { com.google.gerrit.client.changes.ChangeApi.cherrypick ( id.get ( ) , revision , getDestinationBranch ( ) , getMessageText ( ) , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.changes.ChangeInfo > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.changes.ChangeInfo result ) { sent = true ; hide ( ) ; com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange2 ( result.legacy_id ( ) ) ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { enableButtons ( true ) ; super . onFailure ( caught ) ; } } ) ; }

Target:
public void onSend ( ) { com.google.gerrit.client.changes.ChangeApi.cherrypick ( info.legacy_id ( ) . get ( ) , revision , getDestinationBranch ( ) , getMessageText ( ) , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.changes.ChangeInfo > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.changes.ChangeInfo result ) { sent = true ; hide ( ) ; com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange2 ( result.legacy_id ( ) ) ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { enableButtons ( true ) ; super . onFailure ( caught ) ; } } ) ; }
Source:
public com.google.gerrit.extensions.restapi.Response < java.lang.String > apply ( com.google.gerrit.server.change.ChangeResource rsrc , com.google.gerrit.server.change.Unmute.Input input ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.StarredChangesUtil.IllegalLabelException , com.google.gwtorm.server.OrmException { if ( ( rsrc.isUserOwner ( ) ) || ( ! ( isMuted ( rsrc.getChange ( ) ) ) ) ) { return com.google.gerrit.extensions.restapi.Response.ok ( "" ) ; } stars.unmute ( rsrc ) ; return com.google.gerrit.extensions.restapi.Response.ok ( "" ) ; }

Target:
public com.google.gerrit.extensions.restapi.Response < java.lang.String > apply ( com.google.gerrit.server.change.ChangeResource rsrc , com.google.gerrit.server.change.Unmute.Input input ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.StarredChangesUtil.IllegalLabelException , com.google.gwtorm.server.OrmException { if ( ( rsrc.isUserOwner ( ) ) || ( ! ( isMuted ( rsrc ) ) ) ) { return com.google.gerrit.extensions.restapi.Response.ok ( "" ) ; } stars.unmute ( rsrc ) ; return com.google.gerrit.extensions.restapi.Response.ok ( "" ) ; }
Source:
public com.google.common.collect.Multimap < com.google.gerrit.reviewdb.client.Branch.NameKey , com.google.gerrit.reviewdb.client.Change.Id > changesByBranch ( ) throws com.google.gwtorm.server.OrmException { com.google.common.collect.ListMultimap < com.google.gerrit.reviewdb.client.Branch.NameKey , com.google.gerrit.reviewdb.client.Change.Id > ret = com.google.common.collect.ArrayListMultimap.create ( ) ; for ( com.google.gerrit.server.query.change.ChangeData cd : changeData ) { ret.put ( cd.change ( ) . getDest ( ) , cd.getId ( ) ) ; } return ret ; }

Target:
public com.google.common.collect.Multimap < com.google.gerrit.reviewdb.client.Branch.NameKey , com.google.gerrit.server.query.change.ChangeData > changesByBranch ( ) throws com.google.gwtorm.server.OrmException { com.google.common.collect.ListMultimap < com.google.gerrit.reviewdb.client.Branch.NameKey , com.google.gerrit.server.query.change.ChangeData > ret = com.google.common.collect.ArrayListMultimap.create ( ) ; for ( com.google.gerrit.server.query.change.ChangeData cd : changeData ) { ret.put ( cd.change ( ) . getDest ( ) , cd ) ; } return ret ; }