auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private boolean canPerformOnAllRefs ( java.lang.String permission ) { boolean canPerform = false ; java.util.Set < java.lang.String > patterns = allRefPatterns ( permission ) ; if ( patterns.contains ( AccessSection.ALL ) ) { for ( final java.lang.String pattern : patterns ) { if ( controlForRef ( pattern ) . canPerform ( permission ) ) { canPerform = true ; } else { return false ; } } } return canPerform ; }

Target:
private boolean canPerformOnAllRefs ( java.lang.String permission , java.util.Set < java.lang.String > except ) { boolean canPerform = false ; java.util.Set < java.lang.String > patterns = allRefPatterns ( permission ) ; if ( patterns.contains ( AccessSection.ALL ) ) { for ( final java.lang.String pattern : patterns ) { if ( controlForRef ( pattern ) . canPerform ( permission ) ) { canPerform = true ; } else if ( except.contains ( pattern ) ) { continue ; } else { return false ; } } } return canPerform ; }
Source:
void selectRow ( int select ) { movePointerTo ( select , true ) ; }

Target:
private void renderSelected ( int row , boolean selected ) { com.google.gwt.user.client.Element e = getRow ( row ) ; if ( e != null ) { if ( selected ) { e.addClassName ( RelatedChanges.R.css ( ) . activeRow ( ) ) ; } else { e.removeClassName ( RelatedChanges.R.css ( ) . activeRow ( ) ) ; } } }
Source:
public static com.google.gwt.event.shared.HandlerRegistration add ( final com.google.gwtexpui.globalkey.client.KeyCommandSet set ) { com.google.gwtexpui.globalkey.client.GlobalKey.init ( ) ; com.google.gwtexpui.globalkey.client.GlobalKey.keys.add ( set ) ; return new com.google.gwt.event.shared.HandlerRegistration ( ) { @ java.lang.Override public void removeHandler ( ) { com.google.gwtexpui.globalkey.client.GlobalKey.keys.remove ( set ) ; } } ; }

Target:
public static com.google.gwt.event.shared.HandlerRegistration add ( final com.google.gwt.user.client.ui.Widget widget , final com.google.gwtexpui.globalkey.client.KeyCommandSet cmdSet ) { com.google.gwtexpui.globalkey.client.GlobalKey.initEvents ( ) ; final com.google.gwtexpui.globalkey.client.GlobalKey.State state = com.google.gwtexpui.globalkey.client.GlobalKey.stateFor ( widget ) ; state.add ( cmdSet ) ; return new com.google.gwt.event.shared.HandlerRegistration ( ) { @ java.lang.Override public void removeHandler ( ) { state.remove ( cmdSet ) ; } } ; }
Source:
private java.util.List < java.util.regex.Pattern > getCommentRegexList ( ) { java.util.ArrayList < java.util.regex.Pattern > regexList = new java.util.ArrayList < java.util.regex.Pattern > ( ) ; java.lang.String match = gerritConfig.getString ( "commentLink" , itsName , "match" ) ; if ( match != null ) { regexList.add ( java.util.regex.Pattern.compile ( match ) ) ; } return regexList ; }

Target:
private java.util.List < java.util.regex.Pattern > getCommentRegexList ( ) { java.util.ArrayList < java.util.regex.Pattern > regexList = new java.util.ArrayList < java.util.regex.Pattern > ( ) ; java.util.regex.Pattern pattern = getPattern ( ) ; if ( pattern != null ) { regexList.add ( pattern ) ; } return regexList ; }
Source:
public com.google.gerrit.extensions.registration.RegistrationHandle add ( final T item ) { final java.util.concurrent.atomic.AtomicReference < T > ref = new java.util.concurrent.atomic.AtomicReference < T > ( item ) ; items.add ( ref ) ; return new com.google.gerrit.extensions.registration.RegistrationHandle ( ) { @ java.lang.Override public void remove ( ) { if ( ref.compareAndSet ( item , null ) ) { items.remove ( ref ) ; } } } ; }

Target:
public com.google.gerrit.extensions.registration.RegistrationHandle add ( final T item ) { return add ( com.google.inject.util.Providers.of ( item ) ) ; }
Source:
private void checkLoaded ( ) { com.google.common.base.Preconditions.checkNotNull ( projectWatches , "project watches not loaded yet" ) ; }

Target:
public java.lang.String toString ( ) { java.util.List < com.google.gerrit.server.account.WatchConfig.NotifyType > notifyTypes = new java.util.ArrayList < > ( notifyTypes ( ) ) ; java.lang.StringBuilder notifyValue = new java.lang.StringBuilder ( ) ; notifyValue.append ( com.google.common.base.MoreObjects.firstNonNull ( filter ( ) , com.google.gerrit.server.account.WatchConfig.FILTER_ALL ) ) . append ( " [" ) ; com.google.common.base.Joiner.on ( ", " ) . appendTo ( notifyValue , notifyTypes ) ; notifyValue.append ( "]" ) ; return notifyValue.toString ( ) ; }
Source:
public void updateRepo ( com.google.gerrit.server.git.BatchUpdate.RepoContext ctx ) throws java.io.IOException { if ( ( deleteChangeOp ) != null ) { deleteChangeOp.updateRepo ( ctx ) ; return ; } ctx.addRefUpdate ( new org.eclipse.jgit.transport.ReceiveCommand ( org.eclipse.jgit.lib.ObjectId.fromString ( patchSet.getRevision ( ) . get ( ) ) , org.eclipse.jgit.lib.ObjectId.zeroId ( ) , patchSet.getRefName ( ) ) ) ; }

Target:
public void updateRepo ( com.google.gerrit.server.update.BatchUpdate.RepoContext ctx ) throws java.io.IOException { if ( ( deleteChangeOp ) != null ) { deleteChangeOp.updateRepo ( ctx ) ; return ; } ctx.addRefUpdate ( new org.eclipse.jgit.transport.ReceiveCommand ( org.eclipse.jgit.lib.ObjectId.fromString ( patchSet.getRevision ( ) . get ( ) ) , org.eclipse.jgit.lib.ObjectId.zeroId ( ) , patchSet.getRefName ( ) ) ) ; }
Source:
protected void onCellSingleClick ( int row , int column ) { if ( column == 2 ) { onCellDoubleClick ( row , column ) ; } }

Target:
protected void onCellSingleClick ( int row , int column ) { if ( ( column == 1 ) || ( column == 2 ) ) { if ( ! ( "" . equals ( table.getText ( row , column ) ) ) ) { onCellDoubleClick ( row , column ) ; } } }
Source:
private com.google.gwtjsonrpc.server.ActiveCall parseRequest ( final javax.servlet.http.HttpServletRequest req ) throws java.io.IOException , java.io.UnsupportedEncodingException { final java.io.Reader in = new java.io.InputStreamReader ( req.getInputStream ( ) , com.google.gwtjsonrpc.server.JsonServlet.ENC ) ; try { try { return parseRequest ( in ) ; } catch ( com.google.gson.JsonParseException err ) { final com.google.gwtjsonrpc.server.ActiveCall call = new com.google.gwtjsonrpc.server.ActiveCall ( ) ; call.error = err ; return call ; } } finally { in.close ( ) ; } }

Target:
private void parseRequest ( final com.google.gwtjsonrpc.server.ActiveCall call ) throws java.io.IOException , java.io.UnsupportedEncodingException { final javax.servlet.http.HttpServletRequest req = call.httpRequest ; final java.io.Reader in = new java.io.InputStreamReader ( req.getInputStream ( ) , com.google.gwtjsonrpc.server.JsonServlet.ENC ) ; try { try { parseRequest ( call , in ) ; } catch ( com.google.gson.JsonParseException err ) { call.method = null ; call.params = null ; call.error = err ; } } finally { in.close ( ) ; } }
Source:
private void parseDelete ( final org.eclipse.jgit.transport.ReceiveCommand cmd ) { com.google.gerrit.server.project.RefControl ctl = projectControl.controlForRef ( cmd.getRefName ( ) ) ; if ( ctl.canDelete ( ) ) { batch.addCommand ( cmd ) ; } else { if ( GitRepositoryManager.REF_CONFIG.equals ( ctl.getRefName ( ) ) ) { reject ( cmd , "cannot delete project configuration" ) ; } else { errors.put ( com.google.gerrit.server.git.ReceiveCommits.Error.DELETE , ctl.getRefName ( ) ) ; reject ( cmd , "can not delete references" ) ; } } }

Target:
private void parseDelete ( final org.eclipse.jgit.transport.ReceiveCommand cmd ) { com.google.gerrit.server.project.RefControl ctl = projectControl.controlForRef ( cmd.getRefName ( ) ) ; if ( ctl.canDelete ( ) ) { batch.addCommand ( cmd ) ; } else { if ( GitRepositoryManager.REF_CONFIG.equals ( ctl.getRefName ( ) ) ) { reject ( cmd , "cannot delete project configuration" ) ; } else { errors.put ( com.google.gerrit.server.git.ReceiveCommits.Error.DELETE , ctl.getRefName ( ) ) ; reject ( cmd , "cannot delete references" ) ; } } }
Source:
public org.eclipse.jgit.lib.Repository openRepository ( java.lang.String name ) throws org.eclipse.jgit.errors.RepositoryNotFoundException { if ( isUnreasonableName ( name ) ) { throw new org.eclipse.jgit.errors.RepositoryNotFoundException ( ( "Invalid name: " + name ) ) ; } try { final org.eclipse.jgit.lib.RepositoryCache.FileKey loc = org.eclipse.jgit.lib.RepositoryCache.FileKey.lenient ( new java.io.File ( basePath , name ) , FS.DETECTED ) ; return org.eclipse.jgit.lib.RepositoryCache.open ( loc ) ; } catch ( java.io.IOException e1 ) { final org.eclipse.jgit.errors.RepositoryNotFoundException e2 ; e2 = new org.eclipse.jgit.errors.RepositoryNotFoundException ( ( "Cannot open repository " + name ) ) ; e2.initCause ( e1 ) ; throw e2 ; } }

Target:
public org.eclipse.jgit.lib.Repository openRepository ( com.google.gerrit.reviewdb.Project.NameKey name ) throws org.eclipse.jgit.errors.RepositoryNotFoundException { if ( isUnreasonableName ( name ) ) { throw new org.eclipse.jgit.errors.RepositoryNotFoundException ( ( "Invalid name: " + name ) ) ; } try { final org.eclipse.jgit.lib.RepositoryCache.FileKey loc = org.eclipse.jgit.lib.RepositoryCache.FileKey.lenient ( gitDirOf ( name ) , FS.DETECTED ) ; return org.eclipse.jgit.lib.RepositoryCache.open ( loc ) ; } catch ( java.io.IOException e1 ) { final org.eclipse.jgit.errors.RepositoryNotFoundException e2 ; e2 = new org.eclipse.jgit.errors.RepositoryNotFoundException ( ( "Cannot open repository " + name ) ) ; e2.initCause ( e1 ) ; throw e2 ; } }
Source:
private static java.util.Properties loadBuckProperties ( java.nio.file.Path gen ) throws java.io.FileNotFoundException , java.io.IOException { java.util.Properties properties = new java.util.Properties ( ) ; try ( java.io.InputStream in = new java.io.FileInputStream ( gen.resolve ( java.nio.file.Paths.get ( "tools/buck/buck.properties" ) ) . toFile ( ) ) ) { properties.load ( in ) ; } return properties ; }

Target:
private static java.util.Properties loadBuckProperties ( java.nio.file.Path gen ) throws java.io.IOException { java.util.Properties properties = new java.util.Properties ( ) ; java.nio.file.Path p = gen.resolve ( java.nio.file.Paths.get ( "tools/buck/buck.properties" ) ) ; try ( java.io.InputStream in = java.nio.file.Files.newInputStream ( p ) ) { properties.load ( in ) ; } catch ( java.nio.file.NoSuchFileException e ) { } return properties ; }
Source:
public void run ( ) { try { status.update ( Code.SYNC , "Init" , "Initializing import steps ..." ) ; for ( com.googlesrouce.gerrit.plugins.github.git.ImportStep importStep : importSteps ) { importStep.doImport ( this ) ; } status.update ( GitJobStatus.Code.COMPLETE , "Done" , "Done: repository replicated to Gerrit." ) ; } catch ( java.lang.Exception e ) { if ( ( status.getStatus ( ) ) == ( com.googlesrouce.gerrit.plugins.github.git.GitJobStatus.Code.SYNC ) ) { this . exception = e ; status.update ( GitJobStatus.Code.FAILED , "Failed" , getStatusDescription ( ) ) ; } rollback ( ) ; } }

Target:
public void run ( ) { try { status.update ( Code.SYNC , "Init" , "Initializing import steps ..." ) ; for ( com.googlesource.gerrit.plugins.github.git.ImportStep importStep : importSteps ) { importStep.doImport ( this ) ; } status.update ( GitJobStatus.Code.COMPLETE , "Done" , "Done: repository replicated to Gerrit." ) ; } catch ( java.lang.Exception e ) { if ( ( status.getStatus ( ) ) == ( com.googlesource.gerrit.plugins.github.git.GitJobStatus.Code.SYNC ) ) { this . exception = e ; status.update ( GitJobStatus.Code.FAILED , "Failed" , getStatusDescription ( ) ) ; } rollback ( ) ; } }
Source:
private java.util.Map < com.google.gerrit.reviewdb.client.Change.Id , com.google.gerrit.reviewdb.client.Change > allOpenChanges ( com.google.gerrit.server.change.RevisionResource rsrc ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.server.ReviewDb db = dbProvider.get ( ) ; return db.changes ( ) . toMap ( db.changes ( ) . byBranchOpenAll ( rsrc.getChange ( ) . getDest ( ) ) ) ; }

Target:
private java.util.Map < com.google.gerrit.reviewdb.client.Change.Id , com.google.gerrit.server.query.change.ChangeData > allOpenChanges ( com.google.gerrit.server.change.RevisionResource rsrc ) throws com.google.gwtorm.server.OrmException { return com.google.gerrit.server.query.change.ChangeData.asMap ( queryProvider.get ( ) . byBranchOpen ( rsrc.getChange ( ) . getDest ( ) ) ) ; }
Source:
public void testMIXED_NullUser ( ) { setFrom ( "MIXED" ) ; org.easymock.EasyMock.replay ( accountCache ) ; final com.google.gerrit.server.mail.Address r = create ( ) . from ( null ) ; org.junit.Assert.assertNotNull ( r ) ; org.junit.Assert.assertEquals ( ident.getName ( ) , r.name ) ; org.junit.Assert.assertEquals ( ident.getEmailAddress ( ) , r.email ) ; org.easymock.EasyMock.verify ( accountCache ) ; }

Target:
public void testMIXED_NoPreferredEmailUser ( ) { setFrom ( "MIXED" ) ; final java.lang.String name = "A U. Thor" ; final com.google.gerrit.reviewdb.client.Account.Id user = user ( name , null ) ; org.easymock.EasyMock.replay ( accountCache ) ; final com.google.gerrit.server.mail.Address r = create ( ) . from ( user ) ; com.google.common.truth.Truth.assertThat ( r ) . isNotNull ( ) ; com.google.common.truth.Truth.assertThat ( r.name ) . isEqualTo ( ( name + " (Code Review)" ) ) ; com.google.common.truth.Truth.assertThat ( r.email ) . isEqualTo ( ident.getEmailAddress ( ) ) ; org.easymock.EasyMock.verify ( accountCache ) ; }
Source:
protected void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; java.lang.Class.forName ( com.mysql.jdbc.Driver.class . getName ( ) ) ; final java.lang.String host = "localhost" ; final java.lang.String database = "gwtorm" ; final java.lang.String user = "gwtorm" ; final java.lang.String pass = "gwtorm" ; final java.lang.String url = ( ( "jdbc:mysql://" + host ) + "/" ) + database ; db = java.sql.DriverManager.getConnection ( url , user , pass ) ; dialect = new com.google.gwtorm.schema.sql.DialectMySQL ( ) . refine ( db ) ; final java.util.Properties p = new java.util.Properties ( ) ; p.setProperty ( "driver" , com.mysql.jdbc.Driver.class . getName ( ) ) ; p.setProperty ( "url" , db.getMetaData ( ) . getURL ( ) ) ; p.setProperty ( "user" , user ) ; p.setProperty ( "password" , pass ) ; phoneBook = new com.google.gwtorm.jdbc.Database < com.google.gwtorm.data.PhoneBookDb > ( new com.google.gwtorm.jdbc.SimpleDataSource ( p ) , com.google.gwtorm.data.PhoneBookDb.class ) ; drop ( "TABLE address_id" ) ; drop ( "TABLE addresses" ) ; drop ( "TABLE cnt" ) ; drop ( "TABLE foo" ) ; drop ( "TABLE people" ) ; }

Target:
protected void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; java.lang.Class.forName ( com.mysql.jdbc.Driver.class . getName ( ) ) ; final java.lang.String host = "localhost" ; final java.lang.String database = "gwtorm" ; final java.lang.String user = "gwtorm" ; final java.lang.String pass = "gwtorm" ; final java.lang.String url = ( ( "jdbc:mysql://" + host ) + "/" ) + database ; db = java.sql.DriverManager.getConnection ( url , user , pass ) ; dialect = new com.google.gwtorm.schema.sql.DialectMySQL ( ) . refine ( db ) ; final java.util.Properties p = new java.util.Properties ( ) ; p.setProperty ( "driver" , com.mysql.jdbc.Driver.class . getName ( ) ) ; p.setProperty ( "url" , db.getMetaData ( ) . getURL ( ) ) ; p.setProperty ( "user" , user ) ; p.setProperty ( "password" , pass ) ; phoneBook = new com.google.gwtorm.jdbc.Database < com.google.gwtorm.data.PhoneBookDb > ( new com.google.gwtorm.jdbc.SimpleDataSource ( p ) , com.google.gwtorm.data.PhoneBookDb.class ) ; phoneBook2 = new com.google.gwtorm.jdbc.Database < com.google.gwtorm.data.PhoneBookDb2 > ( new com.google.gwtorm.jdbc.SimpleDataSource ( p ) , com.google.gwtorm.data.PhoneBookDb2.class ) ; drop ( "TABLE address_id" ) ; drop ( "TABLE addresses" ) ; drop ( "TABLE cnt" ) ; drop ( "TABLE foo" ) ; drop ( "TABLE people" ) ; }
Source:
public void listNoChildren ( ) throws java.io.IOException { com.google.gerrit.acceptance.RestResponse r = GET ( ( ( "/projects/" + ( allProjects.get ( ) ) ) + "/children/" ) ) ; org.junit.Assert.assertEquals ( HttpStatus.SC_OK , r.getStatusCode ( ) ) ; java.util.List < com.google.gerrit.acceptance.rest.project.ProjectInfo > children = new com.google.gson.Gson ( ) . fromJson ( r.getReader ( ) , new com.google.gson.reflect.TypeToken < java.util.List < com.google.gerrit.acceptance.rest.project.ProjectInfo > > ( ) { } . getType ( ) ) ; org.junit.Assert.assertTrue ( children.isEmpty ( ) ) ; }

Target:
private static java.util.List < com.google.gerrit.server.project.ProjectJson.ProjectInfo > toProjectInfoList ( com.google.gerrit.acceptance.RestResponse r ) throws java.io.IOException { return newGson ( ) . fromJson ( r.getReader ( ) , new com.google.gson.reflect.TypeToken < java.util.List < com.google.gerrit.server.project.ProjectJson.ProjectInfo > > ( ) { } . getType ( ) ) ; }
Source:
public void onSuccess ( com.google.gerrit.client.account.EmailInfo result ) { box.hide ( ) ; if ( com.google.gerrit.client.Gerrit.info ( ) . auth ( ) . isDev ( ) ) { currentEmail = addr ; if ( ( emailPick.getItemCount ( ) ) == 0 ) { final com.google.gerrit.reviewdb.client.Account me = com.google.gerrit.client.Gerrit.getUserAccount ( ) ; me.setPreferredEmail ( addr ) ; onSaveSuccess ( me ) ; } else { save.setEnabled ( true ) ; } updateEmailList ( ) ; } }

Target:
public void onSuccess ( com.google.gerrit.client.account.EmailInfo result ) { box.hide ( ) ; if ( com.google.gerrit.client.Gerrit.info ( ) . auth ( ) . isDev ( ) ) { currentEmail = addr ; if ( ( emailPick.getItemCount ( ) ) == 0 ) { com.google.gerrit.client.info.AccountInfo me = com.google.gerrit.client.Gerrit.getUserAccount ( ) ; me.email ( addr ) ; onSaveSuccess ( me ) ; } else { save.setEnabled ( true ) ; } updateEmailList ( ) ; } }
Source:
boolean isStale ( java.nio.file.Path p ) { try { return ! ( lastModified.equals ( java.nio.file.Files.getLastModifiedTime ( p ) ) ) ; } catch ( java.io.IOException e ) { return true ; } }

Target:
boolean isStale ( java.nio.file.Path p , com.google.gerrit.httpd.raw.ResourceServlet rs ) throws java.io.IOException { java.nio.file.attribute.FileTime t = rs.getLastModifiedTime ( p ) ; return ( ( ( t.toMillis ( ) ) == 0 ) || ( ( lastModified.toMillis ( ) ) == 0 ) ) || ( ! ( lastModified.equals ( t ) ) ) ; }
Source:
public void doClaSignupHook ( com.google.gerrit.reviewdb.client.Account account , com.google.gerrit.common.data.ContributorAgreement cla ) { if ( account != null ) { java.util.List < java.lang.String > args = new java.util.ArrayList < > ( ) ; addArg ( args , "--submitter" , getDisplayName ( account ) ) ; addArg ( args , "--user-id" , account.getId ( ) . toString ( ) ) ; addArg ( args , "--cla-name" , cla.getName ( ) ) ; runHook ( claSignedHook , args ) ; } }

Target:
public void doClaSignupHook ( com.google.gerrit.reviewdb.client.Account account , java.lang.String claName ) { if ( account != null ) { java.util.List < java.lang.String > args = new java.util.ArrayList < > ( ) ; addArg ( args , "--submitter" , getDisplayName ( account ) ) ; addArg ( args , "--user-id" , account.getId ( ) . toString ( ) ) ; addArg ( args , "--cla-name" , claName ) ; runHook ( claSignedHook , args ) ; } }
Source:
private java.util.Collection < com.google.gerrit.extensions.common.AccountInfo > toAccountInfo ( java.util.Collection < com.google.gerrit.reviewdb.client.Account.Id > accounts ) { return com.google.common.collect.FluentIterable.from ( accounts ) . transform ( new com.google.common.base.Function < com.google.gerrit.reviewdb.client.Account.Id , com.google.gerrit.extensions.common.AccountInfo > ( ) { @ java.lang.Override public com.google.gerrit.extensions.common.AccountInfo apply ( com.google.gerrit.reviewdb.client.Account.Id id ) { return accountLoader.get ( id ) ; } } ) . toSortedList ( AccountInfoComparator.ORDER_NULLS_FIRST ) ; }

Target:
private java.util.Collection < com.google.gerrit.extensions.common.AccountInfo > toAccountInfo ( java.util.Collection < com.google.gerrit.reviewdb.client.Account.Id > accounts ) { return accounts.stream ( ) . map ( accountLoader :: get ) . sorted ( AccountInfoComparator.ORDER_NULLS_FIRST ) . collect ( java.util.stream.Collectors.toList ( ) ) ; }
Source:
static void deleteSessionCookie ( ) { com.google.gerrit.client.Gerrit.myAccount = com.google.gerrit.client.info.AccountInfo.create ( 0 , null , null , null ) ; com.google.gerrit.client.Gerrit.myAccountDiffPref = null ; com.google.gerrit.client.Gerrit.myPrefs = com.google.gerrit.client.info.AccountPreferencesInfo.createDefault ( ) ; com.google.gerrit.client.Gerrit.urlAliasMatcher.clearUserAliases ( ) ; com.google.gerrit.client.Gerrit.xGerritAuth = null ; com.google.gerrit.client.Gerrit.refreshMenuBar ( ) ; com.google.gwt.user.client.Cookies.removeCookie ( "GerritAccount" ) ; }

Target:
static void deleteSessionCookie ( ) { com.google.gerrit.client.Gerrit.myAccount = com.google.gerrit.client.info.AccountInfo.create ( 0 , null , null , null ) ; com.google.gerrit.client.Gerrit.myAccountDiffPref = null ; com.google.gerrit.client.Gerrit.editPrefs = null ; com.google.gerrit.client.Gerrit.myPrefs = com.google.gerrit.client.info.AccountPreferencesInfo.createDefault ( ) ; com.google.gerrit.client.Gerrit.urlAliasMatcher.clearUserAliases ( ) ; com.google.gerrit.client.Gerrit.xGerritAuth = null ; com.google.gerrit.client.Gerrit.refreshMenuBar ( ) ; com.google.gwt.user.client.Cookies.removeCookie ( "GerritAccount" ) ; }
Source:
private static boolean eq ( final java.lang.String a , final java.lang.String b ) { if ( ( a == null ) && ( b == null ) ) { return true ; } return a != null ? a.equals ( b ) : false ; }

Target:
private com.google.inject.Injector createSysInjector ( final com.google.gerrit.pgm.Init.SiteInit init ) { final java.util.List < com.google.inject.Module > modules = new java.util.ArrayList < com.google.inject.Module > ( ) ; modules.add ( new com.google.inject.AbstractModule ( ) { @ java.lang.Override protected void configure ( ) { bind ( com.google.gerrit.pgm.util.ConsoleUI.class ) . toInstance ( init.ui ) ; bind ( com.google.gerrit.pgm.init.InitFlags.class ) . toInstance ( init.flags ) ; bind ( com.google.gerrit.server.git.GitRepositoryManager.class ) ; bind ( com.google.gerrit.server.git.GitProjectImporter.class ) ; } } ) ; return createDbInjector ( com.google.gerrit.pgm.util.DataSourceProvider.Context.SINGLE_USER ) . createChildInjector ( modules ) ; }
Source:
public java.lang.String toRevision ( final com.google.gerrit.client.reviewdb.Project.NameKey project , final com.google.gerrit.client.reviewdb.PatchSet ps ) { final java.lang.StringBuilder r = new java.lang.StringBuilder ( ) ; com.google.gerrit.client.data.GitwebLink.p ( r , project ) ; com.google.gerrit.client.data.GitwebLink.h ( r , ps ) ; return ( baseUrl ) + r ; }

Target:
public java.lang.String toRevision ( final com.google.gerrit.client.reviewdb.Project.NameKey project , final com.google.gerrit.client.reviewdb.PatchSet ps ) { final java.lang.StringBuilder r = new java.lang.StringBuilder ( ) ; com.google.gerrit.client.data.GitwebLink.p ( r , project ) ; com.google.gerrit.client.data.GitwebLink.a ( r , "commit" ) ; com.google.gerrit.client.data.GitwebLink.h ( r , ps ) ; return ( baseUrl ) + r ; }
Source:
public static org.spearce.jgit.lib.ObjectId read ( final java.io.ObjectInputStream in ) throws java.io.IOException { if ( in.readBoolean ( ) ) { final int w1 = in.readInt ( ) ; final int w2 = in.readInt ( ) ; final int w3 = in.readInt ( ) ; final int w4 = in.readInt ( ) ; final int w5 = in.readInt ( ) ; return new org.spearce.jgit.lib.ObjectId ( w1 , w2 , w3 , w4 , w5 ) ; } else { return null ; } }

Target:
public static org.spearce.jgit.lib.ObjectId readNotNull ( final java.io.InputStream in ) throws java.io.IOException { final int w1 = com.google.gerrit.server.ioutil.BasicSerialization.readFixInt32 ( in ) ; final int w2 = com.google.gerrit.server.ioutil.BasicSerialization.readFixInt32 ( in ) ; final int w3 = com.google.gerrit.server.ioutil.BasicSerialization.readFixInt32 ( in ) ; final int w4 = com.google.gerrit.server.ioutil.BasicSerialization.readFixInt32 ( in ) ; final int w5 = com.google.gerrit.server.ioutil.BasicSerialization.readFixInt32 ( in ) ; return new org.spearce.jgit.lib.ObjectId ( w1 , w2 , w3 , w4 , w5 ) ; }
Source:
public void refresh ( ) { Util.DETAIL_SVC.changeDetail ( changeId , new com.google.gerrit.client.rpc.ScreenLoadCallback < com.google.gerrit.client.data.ChangeDetail > ( ) { public void onSuccess ( final com.google.gerrit.client.data.ChangeDetail r ) { if ( isAttached ( ) ) { setStarred ( r.isStarred ( ) ) ; display ( r ) ; } } } ) ; }

Target:
public void refresh ( ) { Util.DETAIL_SVC.changeDetail ( changeId , new com.google.gerrit.client.rpc.ScreenLoadCallback < com.google.gerrit.client.data.ChangeDetail > ( this ) { @ java.lang.Override protected void preDisplay ( final com.google.gerrit.client.data.ChangeDetail r ) { setStarred ( r.isStarred ( ) ) ; display ( r ) ; } } ) ; }
Source:
private com.google.gerrit.extensions.api.GerritApi connect ( com.google.reviewit.app.ServerConfig serverCfg ) { return new com.urswolfer.gerrit.client.rest.GerritRestApiFactory ( ) . create ( new com.urswolfer.gerrit.client.rest.GerritAuthData.Basic ( serverCfg.url , serverCfg.user , serverCfg.password ) ) ; }

Target:
public void process ( org.apache.http.HttpRequest request , org.apache.http.protocol.HttpContext context ) throws java.io.IOException , org.apache.http.HttpException { org.apache.http.Header existingUserAgent = request.getFirstHeader ( HttpHeaders.USER_AGENT ) ; java.lang.String userAgent = java.lang.String.format ( "%s/%s" , getApplicationName ( ) , getVersion ( ) ) ; userAgent += " using " + ( existingUserAgent.getValue ( ) ) ; request.setHeader ( HttpHeaders.USER_AGENT , userAgent ) ; }
Source:
public void evaluate ( ) throws java.lang.Throwable { boolean mem = ( description.getAnnotation ( com.google.gerrit.acceptance.UseLocalDisk.class ) ) == null ; boolean enableHttpd = ( ( description.getAnnotation ( com.google.gerrit.acceptance.NoHttpd.class ) ) == null ) && ( ( description.getTestClass ( ) . getAnnotation ( com.google.gerrit.acceptance.NoHttpd.class ) ) == null ) ; beforeTest ( config ( description ) , mem , enableHttpd ) ; base.evaluate ( ) ; afterTest ( ) ; }

Target:
protected boolean isAllowDrafts ( ) { return cfg.getBoolean ( "change" , "allowDrafts" , true ) ; }
Source:
public static void match ( java.lang.String match , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.projects.ProjectMap > cb ) { new com.google.gerrit.client.rpc.RestApi ( "/projects/" ) . addParameter ( "m" , match ) . addParameterRaw ( "type" , "ALL" ) . addParameterTrue ( "d" ) . get ( com.google.gerrit.client.rpc.NativeMap.copyKeysIntoChildren ( cb ) ) ; }

Target:
public static void match ( java.lang.String match , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.projects.ProjectMap > cb ) { if ( ( match == null ) || ( "" . equals ( match ) ) ) { com.google.gerrit.client.projects.ProjectMap.all ( cb ) ; } else { new com.google.gerrit.client.rpc.RestApi ( "/projects/" ) . addParameter ( "m" , match ) . addParameterRaw ( "type" , "ALL" ) . addParameterTrue ( "d" ) . get ( com.google.gerrit.client.rpc.NativeMap.copyKeysIntoChildren ( cb ) ) ; } }
Source:
public void onClick ( final com.google.gwt.event.dom.client.ClickEvent event ) { final boolean prior = starred ; setStarred ( ( ! prior ) ) ; final com.google.gerrit.client.changes.ToggleStarRequest req = new com.google.gerrit.client.changes.ToggleStarRequest ( ) ; req.toggle ( changeId , starred ) ; Util.LIST_SVC.toggleStars ( req , new com.google.gerrit.client.rpc.GerritCallback < com.google.gwtjsonrpc.client.VoidResult > ( ) { public void onSuccess ( final com.google.gwtjsonrpc.client.VoidResult result ) { } @ java.lang.Override public void onFailure ( final java.lang.Throwable caught ) { super . onFailure ( caught ) ; setStarred ( prior ) ; } } ) ; }

Target:
private void toggleStar ( ) { final boolean prior = starred ; setStarred ( ( ! prior ) ) ; final com.google.gerrit.client.changes.ToggleStarRequest req = new com.google.gerrit.client.changes.ToggleStarRequest ( ) ; req.toggle ( changeId , starred ) ; Util.LIST_SVC.toggleStars ( req , new com.google.gerrit.client.rpc.GerritCallback < com.google.gwtjsonrpc.client.VoidResult > ( ) { public void onSuccess ( final com.google.gwtjsonrpc.client.VoidResult result ) { } @ java.lang.Override public void onFailure ( final java.lang.Throwable caught ) { super . onFailure ( caught ) ; setStarred ( prior ) ; } } ) ; }
Source:
public void start ( com.google.gerrit.server.plugins.PluginGuiceEnvironment env ) throws java.lang.Exception { manager = new com.google.gerrit.lifecycle.LifecycleManager ( ) ; java.lang.String fileName = getSrcFile ( ) . getName ( ) ; httpInjector = com.google.inject.Guice.createInjector ( new com.google.gerrit.server.plugins.JsPlugin.StandaloneJsPluginModule ( getName ( ) , fileName ) ) ; manager.start ( ) ; }

Target:
public void start ( com.google.gerrit.server.plugins.PluginGuiceEnvironment env ) throws java.lang.Exception { manager = new com.google.gerrit.lifecycle.LifecycleManager ( ) ; java.lang.String fileName = getSrcFile ( ) . getFileName ( ) . toString ( ) ; httpInjector = com.google.inject.Guice.createInjector ( new com.google.gerrit.server.plugins.JsPlugin.StandaloneJsPluginModule ( getName ( ) , fileName ) ) ; manager.start ( ) ; }
Source:
private java.util.Map < java.lang.String , java.util.Set < java.lang.String > > extractFrom ( com.google.gerrit.server.events.RefUpdatedEvent event , java.util.Set < com.googlesource.gerrit.plugins.its.base.workflow.Property > common ) { common.add ( propertyFactory.create ( "event-type" , event.type ) ) ; common.addAll ( propertyAttributeExtractor.extractFrom ( event.submitter.get ( ) , "submitter" ) ) ; common.addAll ( propertyAttributeExtractor.extractFrom ( event.refUpdate.get ( ) ) ) ; return issueExtractor.getIssueIds ( event.refUpdate.get ( ) . project , event.refUpdate.get ( ) . newRev ) ; }

Target:
private java.util.Map < java.lang.String , java.util.Set < java.lang.String > > extractFrom ( com.google.gerrit.server.events.RefUpdatedEvent event , java.util.Set < com.googlesource.gerrit.plugins.its.base.workflow.Property > common ) { common.add ( propertyFactory.create ( "event-type" , event.type ) ) ; common.addAll ( propertyAttributeExtractor.extractFrom ( event.submitter.get ( ) , "submitter" ) ) ; common.addAll ( propertyAttributeExtractor.extractFrom ( event.refUpdate.get ( ) ) ) ; return issueExtractor.getIssueIds ( event.getProjectNameKey ( ) . get ( ) , event.refUpdate.get ( ) . newRev ) ; }
Source:
public void onClick ( final com.google.gwt.event.dom.client.ClickEvent event ) { sendButton.setEnabled ( false ) ; PatchUtil.DETAIL_SVC.abandonChange ( psid , message.getText ( ) . trim ( ) , new com.google.gerrit.client.rpc.GerritCallback < com.google.gwtjsonrpc.client.VoidResult > ( ) { public void onSuccess ( com.google.gwtjsonrpc.client.VoidResult result ) { if ( ( appCallback ) != null ) { appCallback.onSuccess ( null ) ; } hide ( ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { sendButton.setEnabled ( true ) ; super . onFailure ( caught ) ; } } ) ; }

Target:
public void onClick ( final com.google.gwt.event.dom.client.ClickEvent event ) { sendButton.setEnabled ( false ) ; Util.MANAGE_SVC.abandonChange ( psid , message.getText ( ) . trim ( ) , new com.google.gerrit.client.rpc.GerritCallback < com.google.gwtjsonrpc.client.VoidResult > ( ) { public void onSuccess ( com.google.gwtjsonrpc.client.VoidResult result ) { if ( ( appCallback ) != null ) { appCallback.onSuccess ( null ) ; } hide ( ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { sendButton.setEnabled ( true ) ; super . onFailure ( caught ) ; } } ) ; }
Source:
private static com.google.gerrit.client.changes.AccountInfo asInfo ( com.google.gerrit.reviewdb.client.Account acct ) { if ( acct == null ) { return com.google.gerrit.client.changes.AccountInfo.create ( 0 , null , null ) ; } return com.google.gerrit.client.changes.AccountInfo.create ( ( ( acct.getId ( ) ) != null ? acct.getId ( ) . get ( ) : 0 ) , acct.getFullName ( ) , acct.getPreferredEmail ( ) ) ; }

Target:
private static com.google.gerrit.client.account.AccountInfo asInfo ( com.google.gerrit.reviewdb.client.Account acct ) { if ( acct == null ) { return com.google.gerrit.client.account.AccountInfo.create ( 0 , null , null ) ; } return com.google.gerrit.client.account.AccountInfo.create ( ( ( acct.getId ( ) ) != null ? acct.getId ( ) . get ( ) : 0 ) , acct.getFullName ( ) , acct.getPreferredEmail ( ) ) ; }
Source:
public void setNew_MethodNotAllowed ( ) throws java.lang.Exception { com.google.gerrit.server.account.PutUsername.Input in = new com.google.gerrit.server.account.PutUsername.Input ( ) ; in.username = "newUsername" ; com.google.gerrit.acceptance.RestResponse r = adminSession.put ( ( ( "/accounts/" + ( admin.username ) ) + "/username" ) , in ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( HttpStatus.SC_METHOD_NOT_ALLOWED ) ; }

Target:
public void setNew_MethodNotAllowed ( ) throws java.lang.Exception { com.google.gerrit.server.account.PutUsername.Input in = new com.google.gerrit.server.account.PutUsername.Input ( ) ; in.username = "newUsername" ; adminSession.put ( ( ( "/accounts/" + ( admin.username ) ) + "/username" ) , in ) . assertMethodNotAllowed ( ) ; }
Source:
public static java.lang.String toProjectAdmin ( final com.google.gerrit.reviewdb.Project.NameKey n , final java.lang.String tab ) { return ( ( "admin,project," + ( n.toString ( ) ) ) + "," ) + tab ; }

Target:
public static java.lang.String toProjectAdmin ( com.google.gerrit.reviewdb.Project.NameKey n , java.lang.String panel ) { if ( ProjectScreen.INFO.equals ( panel ) ) { return "/admin/projects/" + ( n.toString ( ) ) ; } return ( ( "/admin/projects/" + ( n.toString ( ) ) ) + "," ) + panel ; }
Source:
public void setText ( final java.lang.String newText ) { text = newText ; if ( ( textLabel ) != null ) { textLabel.setText ( getText ( ) ) ; } if ( ( textBox ) != null ) { textBox.setText ( getText ( ) ) ; textBox.selectAll ( ) ; } embedMovie ( ) ; }

Target:
public void setText ( final java.lang.String newText ) { text = newText ; visibleLen = newText.length ( ) ; if ( ( textLabel ) != null ) { textLabel.setText ( getText ( ) ) ; } if ( ( textBox ) != null ) { textBox.setText ( getText ( ) ) ; textBox.selectAll ( ) ; } embedMovie ( ) ; }
Source:
private boolean canPerformOnAnyRef ( com.google.gerrit.reviewdb.ApprovalCategory.Id actionId , short requireValue ) { return canPerform ( actionId , requireValue , null ) ; }

Target:
private boolean canPerformOnAllRefs ( com.google.gerrit.reviewdb.ApprovalCategory.Id actionId , short requireValue ) { boolean canPerform = false ; final java.util.Set < java.lang.String > patterns = allRefPatterns ( actionId ) ; if ( patterns.contains ( RefRight.ALL ) ) { for ( final java.lang.String pattern : patterns ) { if ( controlForRef ( pattern ) . canPerform ( actionId , requireValue ) ) { canPerform = true ; } else { return false ; } } } return canPerform ; }
Source:
public void close ( ) { com.google.common.util.concurrent.MoreExecutors.shutdownAndAwaitTermination ( executor , java.lang.Long.MAX_VALUE , java.util.concurrent.TimeUnit.SECONDS ) ; try { openIndex.close ( ) ; } finally { closedIndex.close ( ) ; } }

Target:
public void close ( ) { java.util.List < com.google.common.util.concurrent.ListenableFuture < ? > > closeFutures = com.google.common.collect.Lists.newArrayListWithCapacity ( 2 ) ; closeFutures.add ( executor.submit ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { openIndex.close ( ) ; } } ) ) ; closeFutures.add ( executor.submit ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { closedIndex.close ( ) ; } } ) ) ; com.google.common.util.concurrent.Futures.getUnchecked ( com.google.common.util.concurrent.Futures.allAsList ( closeFutures ) ) ; }
Source:
public com.google.gerrit.server.change.RevisionResource getRevisionResource ( java.lang.String project , int changeNumber ) throws com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException { com.google.gerrit.server.project.ChangeControl ctl = changeFactory.validateFor ( db.get ( ) , new com.google.gerrit.reviewdb.client.Change.Id ( changeNumber ) , getBotUser ( ) ) ; com.google.gerrit.server.query.change.ChangeData changeData = changeDataFactory.create ( db.get ( ) , new com.google.gerrit.reviewdb.client.Project.NameKey ( project ) , new com.google.gerrit.reviewdb.client.Change.Id ( changeNumber ) ) ; com.google.gerrit.server.change.RevisionResource r = new com.google.gerrit.server.change.RevisionResource ( collection.parse ( ctl ) , changeData.currentPatchSet ( ) ) ; return r ; }

Target:
public com.google.gerrit.server.change.RevisionResource getRevisionResource ( java.lang.String project , int changeNumber ) throws com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException { com.google.gerrit.server.project.ChangeControl ctl = changeFactory.validateFor ( db.get ( ) , new com.criteo.gerrit.plugins.automerge.Change.Id ( changeNumber ) , getBotUser ( ) ) ; com.google.gerrit.server.query.change.ChangeData changeData = changeDataFactory.create ( db.get ( ) , new com.google.gerrit.reviewdb.client.Project.NameKey ( project ) , new com.criteo.gerrit.plugins.automerge.Change.Id ( changeNumber ) ) ; com.google.gerrit.server.change.RevisionResource r = new com.google.gerrit.server.change.RevisionResource ( collection.parse ( ctl ) , changeData.currentPatchSet ( ) ) ; return r ; }
Source:
public void allQueryPrev ( final java.lang.String query , final java.lang.String pos , final int pageSize , final com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.common.data.SingleListChangeInfo > callback ) { run ( callback , new com.google.gerrit.httpd.rpc.ChangeListServiceImpl.QueryPrev ( pageSize , pos ) { @ java.lang.Override com.google.gwtorm.client.ResultSet < com.google.gerrit.reviewdb.Change > query ( com.google.gerrit.reviewdb.ReviewDb db , int lim , java.lang.String key ) throws com.google.gerrit.common.errors.InvalidQueryException , com.google.gwtorm.client.OrmException { return searchQuery ( db , query , lim , key , com.google.gerrit.httpd.rpc.ChangeListServiceImpl.QUERY_PREV ) ; } } ) ; }

Target:
public void allQueryPrev ( final java.lang.String query , final java.lang.String pos , final int pageSize , final com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.common.data.SingleListChangeInfo > callback ) { try { run ( callback , new com.google.gerrit.httpd.rpc.ChangeListServiceImpl.QueryPrev ( pageSize , pos ) { @ java.lang.Override com.google.gwtorm.client.ResultSet < com.google.gerrit.reviewdb.Change > query ( com.google.gerrit.reviewdb.ReviewDb db , int lim , java.lang.String key ) throws com.google.gerrit.common.errors.InvalidQueryException , com.google.gwtorm.client.OrmException { return searchQuery ( db , query , lim , key , com.google.gerrit.httpd.rpc.ChangeListServiceImpl.QUERY_PREV ) ; } } ) ; } catch ( com.google.gerrit.common.errors.InvalidQueryException e ) { callback.onFailure ( e ) ; } }
Source:
private java.lang.String createServiceUserNote ( java.lang.String branch , com.googlesource.gerrit.plugins.serviceuser.GetServiceUser.ServiceUserInfo serviceUser ) throws com.google.gwtorm.server.OrmException { com.googlesource.gerrit.plugins.serviceuser.HeaderFormatter fmt = new com.googlesource.gerrit.plugins.serviceuser.HeaderFormatter ( gerritServerIdent.getTimeZone ( ) , anonymousCowardName ) ; fmt.appendDate ( ) ; fmt.append ( "Project" , project.get ( ) ) ; fmt.append ( "Branch" , branch ) ; fmt.appendUser ( com.googlesource.gerrit.plugins.serviceuser.CreateServiceUser.KEY_CREATED_BY , serviceUser.createdBy ) ; for ( com.google.gerrit.server.account.AccountInfo owner : serviceUserResolver.listOwners ( serviceUser ) ) { fmt.appendUser ( com.googlesource.gerrit.plugins.serviceuser.CreateServiceUser.KEY_OWNER , owner ) ; } return fmt.toString ( ) ; }

Target:
private java.lang.String createServiceUserNote ( java.lang.String branch , com.googlesource.gerrit.plugins.serviceuser.GetServiceUser.ServiceUserInfo serviceUser ) throws com.google.gwtorm.server.OrmException { com.googlesource.gerrit.plugins.serviceuser.HeaderFormatter fmt = new com.googlesource.gerrit.plugins.serviceuser.HeaderFormatter ( gerritServerIdent.getTimeZone ( ) , anonymousCowardName ) ; fmt.appendDate ( ) ; fmt.append ( "Project" , project.get ( ) ) ; fmt.append ( "Branch" , branch ) ; fmt.appendUser ( com.googlesource.gerrit.plugins.serviceuser.CreateServiceUser.KEY_CREATED_BY , serviceUser.createdBy ) ; for ( com.google.gerrit.server.account.AccountInfo owner : serviceUserResolver.listActiveOwners ( serviceUser ) ) { fmt.appendUser ( com.googlesource.gerrit.plugins.serviceuser.CreateServiceUser.KEY_OWNER , owner ) ; } return fmt.toString ( ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { sessionOwner = new com.google.gerrit.acceptance.RestSession ( server , user ) ; com.google.gerrit.acceptance.SshSession sshSession = new com.google.gerrit.acceptance.SshSession ( server , user ) ; com.google.gerrit.acceptance.GitUtil.initSsh ( user ) ; com.google.gerrit.acceptance.GitUtil.createProject ( sshSession , "foo" ) ; git = com.google.gerrit.acceptance.GitUtil.cloneProject ( ( ( ( sshSession.getUrl ( ) ) + "/" ) + ( project.get ( ) ) ) ) ; sshSession.close ( ) ; user2 = accounts.user2 ( ) ; sessionDev = new com.google.gerrit.acceptance.RestSession ( server , user2 ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { sessionOwner = new com.google.gerrit.acceptance.RestSession ( server , user ) ; com.google.gerrit.acceptance.SshSession sshSession = new com.google.gerrit.acceptance.SshSession ( server , user ) ; com.google.gerrit.acceptance.GitUtil.initSsh ( user ) ; sshSession.open ( ) ; git = com.google.gerrit.acceptance.GitUtil.cloneProject ( ( ( ( sshSession.getUrl ( ) ) + "/" ) + ( project.get ( ) ) ) ) ; sshSession.close ( ) ; user2 = accounts.user2 ( ) ; sessionDev = new com.google.gerrit.acceptance.RestSession ( server , user2 ) ; }
Source:
public void remove ( ) { if ( ref.compareAndSet ( item , null ) ) { items.remove ( ref ) ; } }

Target:
public com.google.gerrit.extensions.registration.RegistrationHandle add ( final com.google.inject.Provider < T > item ) { final java.util.concurrent.atomic.AtomicReference < com.google.inject.Provider < T > > ref = new java.util.concurrent.atomic.AtomicReference < com.google.inject.Provider < T > > ( item ) ; items.add ( ref ) ; return new com.google.gerrit.extensions.registration.RegistrationHandle ( ) { @ java.lang.Override public void remove ( ) { if ( ref.compareAndSet ( item , null ) ) { items.remove ( ref ) ; } } } ; }
Source:
private org.eclipse.jgit.lib.ObjectId getEditRev ( ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gwtorm.server.OrmException , java.io.IOException { edit = editReader.byChange ( change ) ; if ( edit.isPresent ( ) ) { return edit.get ( ) . getEditCommit ( ) ; } throw new com.google.gerrit.server.project.NoSuchChangeException ( change.getId ( ) ) ; }

Target:
private org.eclipse.jgit.lib.ObjectId getEditRev ( ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gwtorm.server.OrmException , java.io.IOException { edit = editReader.byChange ( control.getNotes ( ) ) ; if ( edit.isPresent ( ) ) { return edit.get ( ) . getEditCommit ( ) ; } throw new com.google.gerrit.server.project.NoSuchChangeException ( change.getId ( ) ) ; }
Source:
public com.google.common.collect.SetMultimap < com.google.gerrit.server.ApprovalsUtil.ReviewerState , com.google.gerrit.reviewdb.client.Account.Id > reviewers ( com.google.inject.Provider < com.google.gerrit.reviewdb.server.ReviewDb > db ) throws com.google.gwtorm.server.OrmException { return com.google.gerrit.server.ApprovalsUtil.getReviewers ( allApprovals ( db ) ) ; }

Target:
public com.google.common.collect.ListMultimap < com.google.gerrit.reviewdb.client.PatchSet.Id , com.google.gerrit.reviewdb.client.PatchSetApproval > allApprovalsMap ( ) throws com.google.gwtorm.server.OrmException { if ( ( allApprovals ) == null ) { allApprovals = com.google.common.collect.ArrayListMultimap.create ( ) ; for ( com.google.gerrit.reviewdb.client.PatchSetApproval psa : com.google.gerrit.server.ApprovalsUtil.sortApprovals ( db.patchSetApprovals ( ) . byChange ( legacyId ) ) ) { allApprovals.put ( psa.getPatchSetId ( ) , psa ) ; } } return allApprovals ; }
Source:
private java.util.Map < com.google.gerrit.reviewdb.client.Change.Key , com.google.gerrit.reviewdb.client.Change > openChangesByKey ( com.google.gerrit.reviewdb.client.Branch.NameKey branch ) throws com.google.gwtorm.server.OrmException { final java.util.Map < com.google.gerrit.reviewdb.client.Change.Key , com.google.gerrit.reviewdb.client.Change > r = new java.util.HashMap < > ( ) ; for ( com.google.gerrit.reviewdb.client.Change c : db.changes ( ) . byBranchOpenAll ( branch ) ) { r.put ( c.getKey ( ) , c ) ; } return r ; }

Target:
private java.util.Map < com.google.gerrit.reviewdb.client.Change.Key , com.google.gerrit.reviewdb.client.Change > openChangesByBranch ( com.google.gerrit.reviewdb.client.Branch.NameKey branch ) throws com.google.gwtorm.server.OrmException { final java.util.Map < com.google.gerrit.reviewdb.client.Change.Key , com.google.gerrit.reviewdb.client.Change > r = new java.util.HashMap < > ( ) ; for ( com.google.gerrit.server.query.change.ChangeData cd : queryProvider.get ( ) . byBranchOpen ( branch ) ) { r.put ( cd.change ( ) . getKey ( ) , cd.change ( ) ) ; } return r ; }
Source:
com.google.gerrit.server.account.externalids.ExternalId get ( com.google.gerrit.server.account.externalids.ExternalId.Key key , org.eclipse.jgit.lib.ObjectId rev ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { checkReadEnabled ( ) ; if ( rev.equals ( org.eclipse.jgit.lib.ObjectId.zeroId ( ) ) ) { return null ; } try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( allUsersName ) ; org.eclipse.jgit.revwalk.RevWalk rw = new org.eclipse.jgit.revwalk.RevWalk ( repo ) ) { return com.google.gerrit.server.account.externalids.ExternalIdReader.parse ( key , rw , rev ) ; } }

Target:
java.util.Set < com.google.gerrit.server.account.externalids.ExternalId > all ( org.eclipse.jgit.lib.ObjectId rev ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { checkReadEnabled ( ) ; try ( com.google.gerrit.metrics.Timer0.Context ctx = readAllLatency.start ( ) ; org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( allUsersName ) ) { return com.google.gerrit.server.account.externalids.ExternalIdNotes.loadReadOnly ( repo , rev ) . all ( ) ; } }
Source:
public void testPostResponseOK ( ) throws java.lang.Exception { com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpSessionTest.wireMockRule.givenThat ( com.github.tomakehurst.wiremock.client.WireMock.post ( com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpSessionTest.ENDPOINT ) ) . willReturn ( com.github.tomakehurst.wiremock.client.WireMock.aResponse ( ) . withStatus ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpSessionTest.NO_CONTENT ) ) ) ; com.google.common.truth.Truth.assertThat ( httpSession.post ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpSessionTest.ENDPOINT ) . isSuccessful ( ) ) . isTrue ( ) ; }

Target:
public void testPostResponseOK ( ) throws java.lang.Exception { wireMockRule.givenThat ( com.github.tomakehurst.wiremock.client.WireMock.post ( com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpSessionTest.ENDPOINT ) ) . willReturn ( com.github.tomakehurst.wiremock.client.WireMock.aResponse ( ) . withStatus ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpSessionTest.NO_CONTENT ) ) ) ; com.google.common.truth.Truth.assertThat ( httpSession.post ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpSessionTest.ENDPOINT ) . isSuccessful ( ) ) . isTrue ( ) ; }
Source:
public boolean equals ( final java.lang.Object o ) { return ( ( ( o instanceof com.google.gerrit.client.reviewdb.ChangeApproval.Key ) && ( ( ( com.google.gerrit.client.reviewdb.ChangeApproval.Key ) ( o ) ) . changeId.equals ( changeId ) ) ) && ( ( ( com.google.gerrit.client.reviewdb.ChangeApproval.Key ) ( o ) ) . accountId.equals ( accountId ) ) ) && ( ( ( com.google.gerrit.client.reviewdb.ChangeApproval.Key ) ( o ) ) . categoryId.equals ( categoryId ) ) ; }

Target:
public com.google.gerrit.client.reviewdb.com.google.gwtorm [ ] members ( ) { return new com.google.gwtorm.client.Key < ? > [ ] { accountId , categoryId } ; }