auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private org.apache.lucene.search.Query exactQuery ( com.google.gerrit.server.index.IndexPredicate < V > p ) { if ( p instanceof com.google.gerrit.server.index.RegexPredicate < ? > ) { return regexQuery ( p ) ; } return new org.apache.lucene.search.TermQuery ( new org.apache.lucene.index.Term ( p.getField ( ) . getName ( ) , p.getValue ( ) ) ) ; }

Target:
private org.apache.lucene.search.Query exactQuery ( com.google.gerrit.index.query.IndexPredicate < V > p ) { if ( p instanceof com.google.gerrit.index.query.RegexPredicate < ? > ) { return regexQuery ( p ) ; } return new org.apache.lucene.search.TermQuery ( new org.apache.lucene.index.Term ( p.getField ( ) . getName ( ) , p.getValue ( ) ) ) ; }
Source:
void setDiffPrefs ( final com.google.gerrit.reviewdb.client.AccountDiffPreference dp ) { diffPrefs = dp ; context = diffPrefs.getContext ( ) ; if ( ( context ) == ( com.google.gerrit.reviewdb.client.AccountDiffPreference.WHOLE_FILE_CONTEXT ) ) { context = com.google.gerrit.server.patch.PatchScriptBuilder.MAX_CONTEXT ; } else if ( ( context ) > ( com.google.gerrit.server.patch.PatchScriptBuilder.MAX_CONTEXT ) ) { context = com.google.gerrit.server.patch.PatchScriptBuilder.MAX_CONTEXT ; } }

Target:
void setDiffPrefs ( final com.google.gerrit.reviewdb.client.AccountDiffPreference dp ) { diffPrefs = dp ; context = diffPrefs.getContext ( ) ; if ( ( context ) == ( com.google.gerrit.reviewdb.client.AccountDiffPreference.WHOLE_FILE_CONTEXT ) ) { context = com.google.gerrit.httpd.rpc.patch.PatchScriptBuilder.MAX_CONTEXT ; } else if ( ( context ) > ( com.google.gerrit.httpd.rpc.patch.PatchScriptBuilder.MAX_CONTEXT ) ) { context = com.google.gerrit.httpd.rpc.patch.PatchScriptBuilder.MAX_CONTEXT ; } }
Source:
private void scheduleTask ( com.googlesource.gerrit.plugins.replication.PushOne pushOp , int delay , java.util.concurrent.TimeUnit unit ) { postEvent ( pushOp ) ; pool.schedule ( pushOp , delay , unit ) ; }

Target:
private void postReplicationFailedEvent ( com.googlesource.gerrit.plugins.replication.PushOne pushOp , org.eclipse.jgit.transport.RemoteRefUpdate.Status status ) { com.google.gerrit.reviewdb.client.Project.NameKey project = pushOp.getProjectNameKey ( ) ; java.lang.String targetNode = com.googlesource.gerrit.plugins.replication.PushResultProcessing.resolveNodeName ( pushOp.getURI ( ) ) ; for ( java.lang.String ref : pushOp.getRefs ( ) ) { com.googlesource.gerrit.plugins.replication.RefReplicatedEvent event = new com.googlesource.gerrit.plugins.replication.RefReplicatedEvent ( project.get ( ) , ref , targetNode , com.googlesource.gerrit.plugins.replication.ReplicationState.RefPushResult.FAILED , status ) ; eventDispatcher.get ( ) . postEvent ( new com.google.gerrit.reviewdb.client.Branch.NameKey ( project , ref ) , event ) ; } }
Source:
private void handleReviewResultErrors ( final com.google.gerrit.common.data.ReviewResult result ) { for ( com.google.gerrit.common.data.ReviewResult.Error resultError : result.getErrors ( ) ) { java.lang.String errMsg = ( "error: (change " + ( result.getChangeId ( ) ) ) + ") " ; errMsg += parseError ( resultError.getType ( ) ) ; if ( ( resultError.getMessage ( ) ) != null ) { errMsg += ": " + ( resultError.getMessage ( ) ) ; } writeError ( errMsg ) ; } }

Target:
private com.google.gerrit.extensions.api.changes.ChangeApi changeApi ( com.google.gerrit.reviewdb.client.PatchSet patchSet ) throws com.google.gerrit.extensions.restapi.RestApiException { return gApi.get ( ) . changes ( ) . id ( patchSet.getId ( ) . getParentKey ( ) . get ( ) ) ; }
Source:
public void cannotUploadToAnyRef ( ) { com.google.gerrit.server.project.Util.allow ( parent , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/*" ) ; com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) ; com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/for/refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = user ( local ) ; assertCannotUpload ( u ) ; assertCannotCreateChange ( "refs/heads/master" , u ) ; }

Target:
public void sortWithRegex ( ) { com.google.gerrit.server.project.testing.Util.allow ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.project.testing.Util.DEVS , "^refs/heads/.*" ) ; com.google.gerrit.server.project.testing.Util.allow ( parent , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "^refs/heads/.*-QA-.*" ) ; com.google.gerrit.server.project.ProjectControl u = user ( local , com.google.gerrit.server.project.testing.Util.DEVS ) ; com.google.gerrit.server.project.ProjectControl d = user ( local , com.google.gerrit.server.project.testing.Util.DEVS ) ; assertCanRead ( "refs/heads/foo-QA-bar" , u ) ; assertCanRead ( "refs/heads/foo-QA-bar" , d ) ; }
Source:
public void run ( ) { if ( ( prefs.context ( ) ) == ( com.google.gerrit.reviewdb.client.AccountDiffPreference.WHOLE_FILE_CONTEXT ) ) { contextEntireFile.setValue ( true ) ; } if ( view.canRenderEntireFile ( prefs ) ) { renderEntireFile.setEnabled ( true ) ; renderEntireFile.setValue ( prefs.renderEntireFile ( ) ) ; } else { renderEntireFile.setValue ( false ) ; renderEntireFile.setEnabled ( false ) ; } view.setContext ( prefs.context ( ) ) ; }

Target:
public void run ( ) { if ( ( prefs.context ( ) ) == ( com.google.gerrit.extensions.client.DiffPreferencesInfo.WHOLE_FILE_CONTEXT ) ) { contextEntireFile.setValue ( true ) ; } if ( view.canRenderEntireFile ( prefs ) ) { renderEntireFile.setEnabled ( true ) ; renderEntireFile.setValue ( prefs.renderEntireFile ( ) ) ; } else { renderEntireFile.setValue ( false ) ; renderEntireFile.setEnabled ( false ) ; } view.setContext ( prefs.context ( ) ) ; }
Source:
private boolean isTrusted ( final com.google.gerrit.reviewdb.client.AccountExternalId id ) { if ( id.isScheme ( AccountExternalId.SCHEME_MAILTO ) ) { return true ; } if ( id.isScheme ( AccountExternalId.SCHEME_UUID ) ) { return true ; } if ( id.isScheme ( AccountExternalId.SCHEME_USERNAME ) ) { return true ; } for ( final com.google.gerrit.server.auth.openid.OpenIdProviderPattern p : trustedOpenIDs ) { if ( p.matches ( id ) ) { return true ; } } return false ; }

Target:
private boolean isTrusted ( com.google.gerrit.server.account.ExternalId id ) { if ( id.isScheme ( com.google.gerrit.server.account.ExternalId.SCHEME_MAILTO ) ) { return true ; } if ( id.isScheme ( com.google.gerrit.server.account.ExternalId.SCHEME_UUID ) ) { return true ; } if ( id.isScheme ( com.google.gerrit.server.account.ExternalId.SCHEME_USERNAME ) ) { return true ; } for ( com.google.gerrit.server.auth.openid.OpenIdProviderPattern p : trustedOpenIDs ) { if ( p.matches ( id ) ) { return true ; } } return false ; }
Source:
private void listen ( com.google.gerrit.server.plugins.JarScanner.ExtensionMetaData def ) throws com.google.gerrit.server.plugins.InvalidPluginException { java.lang.Class < ? > clazz ; try { clazz = java.lang.Class.forName ( def.getClassName ( ) , false , classLoader ) ; } catch ( java.lang.ClassNotFoundException err ) { throw new com.google.gerrit.server.plugins.InvalidPluginException ( java.lang.String.format ( "Cannot load %s with @Listen" , def.getClassName ( ) ) , err ) ; } com.google.gerrit.extensions.annotations.Listen listen = clazz.getAnnotation ( com.google.gerrit.extensions.annotations.Listen.class ) ; if ( listen != null ) { listen ( clazz , clazz ) ; } else { PluginLoader.log.warn ( java.lang.String.format ( "In plugin %s asm incorrectly parsed %s with @Listen" , pluginName , clazz.getName ( ) ) ) ; } }

Target:
private void listen ( com.google.gerrit.server.plugins.PluginContentScanner.ExtensionMetaData def ) throws com.google.gerrit.server.plugins.InvalidPluginException { java.lang.Class < ? > clazz ; try { clazz = java.lang.Class.forName ( def.className , false , classLoader ) ; } catch ( java.lang.ClassNotFoundException err ) { throw new com.google.gerrit.server.plugins.InvalidPluginException ( java.lang.String.format ( "Cannot load %s with @Listen" , def.className ) , err ) ; } com.google.gerrit.extensions.annotations.Listen listen = clazz.getAnnotation ( com.google.gerrit.extensions.annotations.Listen.class ) ; if ( listen != null ) { listen ( clazz , clazz ) ; } else { PluginLoader.log.warn ( java.lang.String.format ( "In plugin %s asm incorrectly parsed %s with @Listen" , pluginName , clazz.getName ( ) ) ) ; } }
Source:
private void addRanges ( java.util.Map < java.lang.String , java.lang.Object > have , com.google.gerrit.server.account.CapabilityControl cc ) { for ( java.lang.String name : com.google.gerrit.common.data.GlobalCapability.getRangeNames ( ) ) { if ( ( want ( name ) ) && ( cc.hasExplicitRange ( name ) ) ) { have.put ( name , new com.google.gerrit.server.account.GetCapabilities.Range ( cc.getRange ( name ) ) ) ; } } }

Target:
private void addRanges ( java.util.Map < java.lang.String , java.lang.Object > have , com.google.gerrit.server.account.AccountLimits limits ) { for ( java.lang.String name : com.google.gerrit.common.data.GlobalCapability.getRangeNames ( ) ) { if ( ( want ( name ) ) && ( limits.hasExplicitRange ( name ) ) ) { have.put ( name , new com.google.gerrit.server.account.GetCapabilities.Range ( limits.getRange ( name ) ) ) ; } } }
Source:
private static java.lang.String legacyAll ( final java.lang.String token ) { if ( com.google.gerrit.client.Dispatcher.matchPrefix ( "all,abandoned," , token ) ) { return com.google.gerrit.common.PageLinks.toChangeQuery ( "status:abandoned" , com.google.gerrit.client.Dispatcher.skip ( token ) ) ; } if ( com.google.gerrit.client.Dispatcher.matchPrefix ( "all,merged," , token ) ) { return com.google.gerrit.common.PageLinks.toChangeQuery ( "status:merged" , com.google.gerrit.client.Dispatcher.skip ( token ) ) ; } if ( com.google.gerrit.client.Dispatcher.matchPrefix ( "all,open," , token ) ) { return com.google.gerrit.common.PageLinks.toChangeQuery ( "status:open" , com.google.gerrit.client.Dispatcher.skip ( token ) ) ; } return null ; }

Target:
private static void extension ( final java.lang.String token ) { com.google.gerrit.client.api.ExtensionScreen view = new com.google.gerrit.client.api.ExtensionScreen ( com.google.gerrit.client.Dispatcher.skip ( token ) ) ; if ( view.isFound ( ) ) { com.google.gerrit.client.Gerrit.display ( token , view ) ; } else { com.google.gerrit.client.Gerrit.display ( token , new com.google.gerrit.client.NotFoundScreen ( ) ) ; } }
Source:
public boolean match ( com.google.gerrit.index.project.ProjectData pd ) throws com.google.gwtorm.server.OrmException { return permissionBackend.user ( user ) . project ( pd.getProject ( ) . getNameKey ( ) ) . testOrFalse ( ProjectPermission.READ ) ; }

Target:
public boolean match ( com.google.gerrit.index.project.ProjectData pd ) throws com.google.gwtorm.server.OrmException { if ( ! ( pd.getProject ( ) . getState ( ) . permitsRead ( ) ) ) { return false ; } return permissionBackend.user ( user ) . project ( pd.getProject ( ) . getNameKey ( ) ) . testOrFalse ( ProjectPermission.READ ) ; }
Source:
private static com.google.gerrit.client.reviewdb.LoginType toType ( final org.spearce.jgit.lib.Config cfg ) { if ( com.google.gerrit.server.config.AuthConfig.isBecomeAnyoneEnabled ( ) ) { return com.google.gerrit.client.reviewdb.LoginType.DEVELOPMENT_BECOME_ANY_ACCOUNT ; } java.lang.String type = cfg.getString ( "auth" , null , "type" ) ; if ( type == null ) { return com.google.gerrit.client.reviewdb.LoginType.OPENID ; } for ( com.google.gerrit.client.reviewdb.LoginType t : com.google.gerrit.client.reviewdb.LoginType.values ( ) ) { if ( type.equalsIgnoreCase ( t.name ( ) ) ) { return t ; } } throw new java.lang.IllegalStateException ( ( "Unsupported auth.type: " + type ) ) ; }

Target:
private static com.google.gerrit.client.reviewdb.LoginType toType ( final org.spearce.jgit.lib.Config cfg ) { if ( com.google.gerrit.server.config.AuthConfig.isBecomeAnyoneEnabled ( ) ) { return com.google.gerrit.client.reviewdb.LoginType.DEVELOPMENT_BECOME_ANY_ACCOUNT ; } return com.google.gerrit.server.config.ConfigUtil.getEnum ( cfg , "auth" , null , "type" , LoginType.OPENID ) ; }
Source:
private int getInt ( com.google.gerrit.server.config.PluginConfig cfg , java.lang.String name , int defaultValue ) { try { return cfg.getInt ( name , defaultValue ) ; } catch ( java.lang.IllegalArgumentException e ) { com.ericsson.gerrit.plugins.highavailability.Configuration.log.error ( java.lang.String.format ( "invalid value for %s; using default value %d" , name , defaultValue ) ) ; com.ericsson.gerrit.plugins.highavailability.Configuration.log.debug ( ( "Failed retrieve integer value: " + ( e.getMessage ( ) ) ) , e ) ; return defaultValue ; } }

Target:
private static int getInt ( org.eclipse.jgit.lib.Config cfg , java.lang.String section , java.lang.String name , int defaultValue ) { try { return cfg.getInt ( section , name , defaultValue ) ; } catch ( java.lang.IllegalArgumentException e ) { com.ericsson.gerrit.plugins.highavailability.Configuration.log.error ( java.lang.String.format ( "invalid value for %s; using default value %d" , name , defaultValue ) ) ; com.ericsson.gerrit.plugins.highavailability.Configuration.log.debug ( ( "Failed to retrieve integer value: " + ( e.getMessage ( ) ) ) , e ) ; return defaultValue ; } }
Source:
public boolean isReviewer ( com.google.gerrit.reviewdb.ReviewDb db ) throws com.google.gwtorm.client.OrmException { if ( ( getCurrentUser ( ) ) instanceof com.google.gerrit.server.IdentifiedUser ) { final com.google.gerrit.server.IdentifiedUser user = ( ( com.google.gerrit.server.IdentifiedUser ) ( getCurrentUser ( ) ) ) ; com.google.gwtorm.client.ResultSet < com.google.gerrit.reviewdb.PatchSetApproval > results = db.patchSetApprovals ( ) . byChange ( change.getId ( ) ) ; for ( com.google.gerrit.reviewdb.PatchSetApproval approval : results ) { if ( user.getAccountId ( ) . equals ( approval.getAccountId ( ) ) ) { return true ; } } } return false ; }

Target:
public boolean isOwner ( ) { if ( ( getCurrentUser ( ) ) instanceof com.google.gerrit.server.IdentifiedUser ) { final com.google.gerrit.server.IdentifiedUser i = ( ( com.google.gerrit.server.IdentifiedUser ) ( getCurrentUser ( ) ) ) ; return i.getAccountId ( ) . equals ( change.getOwner ( ) ) ; } return false ; }
Source:
protected void configure ( ) { final com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < com.google.gerrit.server.patch.PatchListKey , com.google.gerrit.server.patch.PatchList > > type = new com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < com.google.gerrit.server.patch.PatchListKey , com.google.gerrit.server.patch.PatchList > > ( ) { } ; disk ( type , com.google.gerrit.server.patch.PatchListCacheImpl.CACHE_NAME ) . memoryLimit ( 128 ) . evictionPolicy ( EvictionPolicy.LRU ) ; bind ( com.google.gerrit.server.patch.PatchListCacheImpl.class ) ; bind ( com.google.gerrit.server.patch.PatchListCache.class ) . to ( com.google.gerrit.server.patch.PatchListCacheImpl.class ) ; }

Target:
protected void configure ( ) { final com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < com.google.gerrit.server.patch.PatchListKey , com.google.gerrit.server.patch.PatchList > > type = new com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < com.google.gerrit.server.patch.PatchListKey , com.google.gerrit.server.patch.PatchList > > ( ) { } ; disk ( type , com.google.gerrit.server.patch.PatchListCacheImpl.CACHE_NAME ) . memoryLimit ( 128 ) . evictionPolicy ( EvictionPolicy.LRU ) . populateWith ( com.google.gerrit.server.patch.PatchListCacheImpl.Loader.class ) ; bind ( com.google.gerrit.server.patch.PatchListCacheImpl.class ) ; bind ( com.google.gerrit.server.patch.PatchListCache.class ) . to ( com.google.gerrit.server.patch.PatchListCacheImpl.class ) ; }
Source:
public java.util.List < com.google.gerrit.client.reviewdb.AccountExternalId > run ( com.google.gerrit.client.reviewdb.ReviewDb db ) throws com.google.gwtorm.client.OrmException { final com.google.gerrit.client.reviewdb.Account.Id me = com.google.gerrit.client.rpc.Common.getAccountId ( ) ; return db.accountExternalIds ( ) . byAccount ( me ) . toList ( ) ; }

Target:
public com.google.gerrit.client.account.ExternalIdDetail run ( com.google.gerrit.client.reviewdb.ReviewDb db ) throws com.google.gwtorm.client.OrmException { final com.google.gerrit.client.reviewdb.Account.Id me = com.google.gerrit.client.rpc.Common.getAccountId ( ) ; final java.util.List < com.google.gerrit.client.reviewdb.TrustedExternalId > trusted = com.google.gerrit.client.rpc.Common.getGroupCache ( ) . getTrustedExternalIds ( db ) ; final java.util.List < com.google.gerrit.client.reviewdb.AccountExternalId > myIds = db.accountExternalIds ( ) . byAccount ( me ) . toList ( ) ; return new com.google.gerrit.client.account.ExternalIdDetail ( myIds , trusted ) ; }
Source:
public boolean match ( final T object ) throws com.google.gwtorm.server.OrmException { for ( final com.google.gerrit.server.query.Predicate < T > c : children ) { if ( ! ( c.match ( object ) ) ) { return false ; } } return true ; }

Target:
public boolean match ( final T object ) throws com.google.gwtorm.server.OrmException { for ( com.google.gerrit.server.query.Predicate < T > c : children ) { com.google.common.base.Preconditions.checkState ( c.isMatchable ( ) , ( "match invoked, but child predicate %s " + "doesn't implement %s" ) , c , com.google.gerrit.server.query.Matchable.class . getName ( ) ) ; if ( ! ( c.asMatchable ( ) . match ( object ) ) ) { return false ; } } return true ; }
Source:
private com.google.gerrit.server.query.Predicate [ ] children ( final org.antlr.runtime.tree.Tree r ) throws com.google.gerrit.server.query.QueryParseException , java.lang.IllegalArgumentException { final com.google.gerrit.server.query.Predicate [ ] p = new com.google.gerrit.server.query.Predicate [ r.getChildCount ( ) ] ; for ( int i = 0 ; i < ( p.length ) ; i ++ ) { p [ i ] = toPredicate ( r.getChild ( i ) ) ; } return p ; }

Target:
private com.google.gerrit.server.query.Predicate < T > [ ] children ( final org.antlr.runtime.tree.Tree r ) throws com.google.gerrit.server.query.QueryParseException , java.lang.IllegalArgumentException { final com.google.gerrit.server.query.Predicate < T > [ ] p = new com.google.gerrit.server.query.Predicate [ r.getChildCount ( ) ] ; for ( int i = 0 ; i < ( p.length ) ; i ++ ) { p [ i ] = toPredicate ( r.getChild ( i ) ) ; } return p ; }
Source:
public java.lang.Void call ( ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.git.UpdateException , com.google.gwtorm.server.OrmException { if ( caller == ( java.lang.Thread.currentThread ( ) ) ) { insertChange ( this . db ) ; } else { try ( com.google.gerrit.reviewdb.server.ReviewDb threadLocalDb = schemaFactory.open ( ) ) { insertChange ( threadLocalDb ) ; } } com.google.gerrit.server.git.ReceiveCommits.synchronizedIncrement ( newProgress ) ; return null ; }

Target:
public java.lang.Void call ( ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.git.UpdateException , com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.errors.RepositoryNotFoundException { try ( com.google.gerrit.server.git.ReceiveCommits.RequestState state = requestState ( caller ) ) { insertChange ( state ) ; } com.google.gerrit.server.git.ReceiveCommits.synchronizedIncrement ( newProgress ) ; return null ; }
Source:
public synchronized com.google.gerrit.testutil.InMemoryRepositoryManager.Repo createRepository ( com.google.gerrit.reviewdb.client.Project.NameKey name ) throws com.google.gerrit.server.git.RepositoryCaseMismatchException , org.eclipse.jgit.errors.RepositoryNotFoundException { com.google.gerrit.testutil.InMemoryRepositoryManager.Repo repo ; try { repo = get ( name ) ; if ( ! ( repo.getDescription ( ) . getRepositoryName ( ) . equals ( name.get ( ) ) ) ) { throw new com.google.gerrit.server.git.RepositoryCaseMismatchException ( name ) ; } } catch ( org.eclipse.jgit.errors.RepositoryNotFoundException e ) { repo = new com.google.gerrit.testutil.InMemoryRepositoryManager.Repo ( name ) ; repos.put ( com.google.gerrit.testutil.InMemoryRepositoryManager.normalize ( name ) , repo ) ; } return repo ; }

Target:
public synchronized com.google.gerrit.testutil.InMemoryRepositoryManager.Repo createRepository ( com.google.gerrit.reviewdb.client.Project.NameKey name ) throws com.google.gerrit.server.git.RepositoryCaseMismatchException , org.eclipse.jgit.errors.RepositoryNotFoundException { com.google.gerrit.testutil.InMemoryRepositoryManager.Repo repo ; try { repo = get ( name ) ; if ( ! ( repo.getDescription ( ) . getRepositoryName ( ) . equals ( name.get ( ) ) ) ) { throw new com.google.gerrit.server.git.RepositoryCaseMismatchException ( name ) ; } } catch ( org.eclipse.jgit.errors.RepositoryNotFoundException e ) { repo = new com.google.gerrit.testutil.InMemoryRepositoryManager.Repo ( notesMigration , name ) ; repos.put ( com.google.gerrit.testutil.InMemoryRepositoryManager.normalize ( name ) , repo ) ; } return repo ; }
Source:
private void insertDummyApproval ( final com.google.gerrit.server.git.ReceiveCommits.ReplaceResult result , final com.google.gerrit.reviewdb.Account.Id forAccount , final com.google.gerrit.reviewdb.ApprovalCategory.Id catId , final com.google.gerrit.reviewdb.ReviewDb db ) throws com.google.gwtorm.client.OrmException { insertDummyApproval ( result.change , result.patchSet.getId ( ) , forAccount , catId , db ) ; }

Target:
private void insertDummyApproval ( final com.google.gerrit.server.git.ReceiveCommits.ReplaceResult result , final com.google.gerrit.reviewdb.client.Account.Id forAccount , final com.google.gerrit.reviewdb.client.ApprovalCategory.Id catId , final com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { insertDummyApproval ( result.change , result.patchSet.getId ( ) , forAccount , catId , db ) ; }
Source:
public com.google.gerrit.extensions.client.GeneralPreferencesInfo apply ( com.google.gerrit.server.account.AccountResource rsrc ) throws com.google.gerrit.extensions.restapi.AuthException { if ( ( ( self.get ( ) ) != ( rsrc.getUser ( ) ) ) && ( ! ( self.get ( ) . getCapabilities ( ) . canModifyAccount ( ) ) ) ) { throw new com.google.gerrit.extensions.restapi.AuthException ( "requires Modify Account capability" ) ; } com.google.gerrit.reviewdb.client.Account.Id id = rsrc.getUser ( ) . getAccountId ( ) ; return accountCache.get ( id ) . getAccount ( ) . getGeneralPreferencesInfo ( ) ; }

Target:
public com.google.gerrit.extensions.client.GeneralPreferencesInfo apply ( com.google.gerrit.server.account.AccountResource rsrc ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.server.permissions.PermissionBackendException { if ( ( self.get ( ) ) != ( rsrc.getUser ( ) ) ) { permissionBackend.user ( self ) . check ( GlobalPermission.MODIFY_ACCOUNT ) ; } com.google.gerrit.reviewdb.client.Account.Id id = rsrc.getUser ( ) . getAccountId ( ) ; return accountCache.get ( id ) . getAccount ( ) . getGeneralPreferencesInfo ( ) ; }
Source:
private static boolean isLargeFile ( com.google.gerrit.client.diff.DiffInfo diffInfo ) { return ( ( ( diffInfo.meta_a ( ) ) != null ) && ( ( diffInfo.meta_a ( ) . lines ( ) ) > 500 ) ) || ( ( ( diffInfo.meta_b ( ) ) != null ) && ( ( diffInfo.meta_b ( ) . lines ( ) ) > 500 ) ) ; }

Target:
static void setHeightInPx ( com.google.gwt.dom.client.Element ele , double height ) { ele.getStyle ( ) . setHeight ( height , Unit.PX ) ; }
Source:
public void mergeWithMissingChange ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result draftResult = createDraftChange ( ) ; com.google.gerrit.acceptance.PushOneCommit.Result changeResult = createChange ( ) ; gApi.changes ( ) . id ( draftResult.getChangeId ( ) ) . delete ( ) ; submit ( changeResult.getChangeId ( ) , new com.google.gerrit.extensions.api.changes.SubmitInput ( ) , com.google.gerrit.extensions.restapi.ResourceConflictException.class , "nothing to merge" , false ) ; }

Target:
public void mergeWithMissingChange ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result draftResult = createDraftChange ( ) ; com.google.gerrit.acceptance.PushOneCommit.Result changeResult = createChange ( ) ; gApi.changes ( ) . id ( draftResult.getChangeId ( ) ) . delete ( ) ; submit ( changeResult.getChangeId ( ) , new com.google.gerrit.extensions.api.changes.SubmitInput ( ) , com.google.gerrit.extensions.restapi.ResourceConflictException.class , "nothing to merge" ) ; assertRefUpdatedEvents ( ) ; assertChangeMergedEvents ( ) ; }
Source:
static void setNotCacheable ( javax.servlet.http.HttpServletResponse res ) { res.setHeader ( com.google.common.net.HttpHeaders.CACHE_CONTROL , "no-cache, no-store, max-age=0, must-revalidate" ) ; res.setHeader ( com.google.common.net.HttpHeaders.PRAGMA , "no-cache" ) ; res.setHeader ( com.google.common.net.HttpHeaders.EXPIRES , "Fri, 01 Jan 1990 00:00:00 GMT" ) ; res.setDateHeader ( com.google.common.net.HttpHeaders.DATE , new org.joda.time.Instant ( ) . getMillis ( ) ) ; }

Target:
static void setNotCacheable ( javax.servlet.http.HttpServletResponse res ) { res.setHeader ( com.google.common.net.HttpHeaders.CACHE_CONTROL , "no-cache, no-store, max-age=0, must-revalidate" ) ; res.setHeader ( com.google.common.net.HttpHeaders.PRAGMA , "no-cache" ) ; res.setHeader ( com.google.common.net.HttpHeaders.EXPIRES , "Mon, 01 Jan 1990 00:00:00 GMT" ) ; res.setDateHeader ( com.google.common.net.HttpHeaders.DATE , new org.joda.time.Instant ( ) . getMillis ( ) ) ; }
Source:
private com.google.gerrit.server.notedb.ChangeNotesState buildState ( ) { return com.google.gerrit.server.notedb.ChangeNotesState.create ( id , new com.google.gerrit.reviewdb.client.Change.Key ( changeId ) , createdOn , lastUpdatedOn , ownerId , branch , currentPatchSetId , subject , topic , originalSubject , submissionId , status , assignee , hashtags , patchSets , buildApprovals ( ) , com.google.gerrit.server.ReviewerSet.fromTable ( com.google.common.collect.Tables.transpose ( reviewers ) ) , allPastReviewers , buildReviewerUpdates ( ) , submitRecords , buildAllMessages ( ) , buildMessagesByPatchSet ( ) , comments ) ; }

Target:
private com.google.gerrit.server.notedb.ChangeNotesState buildState ( ) { return com.google.gerrit.server.notedb.ChangeNotesState.create ( id , new com.google.gerrit.reviewdb.client.Change.Key ( changeId ) , createdOn , lastUpdatedOn , ownerId , branch , currentPatchSetId , subject , topic , originalSubject , submissionId , status , ( ( assignee ) != null ? assignee.orNull ( ) : null ) , hashtags , patchSets , buildApprovals ( ) , com.google.gerrit.server.ReviewerSet.fromTable ( com.google.common.collect.Tables.transpose ( reviewers ) ) , allPastReviewers , buildReviewerUpdates ( ) , submitRecords , buildAllMessages ( ) , buildMessagesByPatchSet ( ) , comments ) ; }
Source:
com.google.gerrit.httpd.WebSessionManager.Val createVal ( final com.google.gerrit.httpd.WebSessionManager.Key key , final com.google.gerrit.httpd.WebSessionManager.Val val ) { final com.google.gerrit.reviewdb.client.Account.Id who = val.getAccountId ( ) ; final boolean remember = val.isPersistentCookie ( ) ; final com.google.gerrit.reviewdb.client.AccountExternalId.Key lastLogin = val.getExternalId ( ) ; return createVal ( key , who , remember , lastLogin ) ; }

Target:
com.google.gerrit.httpd.WebSessionManager.Val createVal ( final com.google.gerrit.httpd.WebSessionManager.Key key , final com.google.gerrit.httpd.WebSessionManager.Val val ) { final com.google.gerrit.reviewdb.client.Account.Id who = val.getAccountId ( ) ; final boolean remember = val.isPersistentCookie ( ) ; final com.google.gerrit.reviewdb.client.AccountExternalId.Key lastLogin = val.getExternalId ( ) ; return createVal ( key , who , remember , lastLogin , val.sessionId ) ; }
Source:
protected void run ( ) throws com.google.gerrit.sshd.commands.Failure { try { com.google.gerrit.extensions.common.BanCommitInput input = com.google.gerrit.extensions.common.BanCommitInput.fromCommits ( com.google.common.collect.Lists.transform ( commitsToBan , ObjectId :: getName ) ) ; input.reason = reason ; com.google.gerrit.server.project.BanCommit.BanResultInfo r = banCommit.apply ( new com.google.gerrit.server.project.ProjectResource ( projectState , user ) , input ) ; printCommits ( r.newlyBanned , "The following commits were banned" ) ; printCommits ( r.alreadyBanned , "The following commits were already banned" ) ; printCommits ( r.ignored , "The following ids do not represent commits and were ignored" ) ; } catch ( java.lang.Exception e ) { throw die ( e ) ; } }

Target:
protected void run ( ) throws com.google.gerrit.sshd.commands.Failure { try { com.google.gerrit.extensions.api.projects.BanCommitInput input = com.google.gerrit.extensions.api.projects.BanCommitInput.fromCommits ( com.google.common.collect.Lists.transform ( commitsToBan , ObjectId :: getName ) ) ; input.reason = reason ; com.google.gerrit.server.project.BanCommit.BanResultInfo r = banCommit.apply ( new com.google.gerrit.server.project.ProjectResource ( projectState , user ) , input ) ; printCommits ( r.newlyBanned , "The following commits were banned" ) ; printCommits ( r.alreadyBanned , "The following commits were already banned" ) ; printCommits ( r.ignored , "The following ids do not represent commits and were ignored" ) ; } catch ( java.lang.Exception e ) { throw die ( e ) ; } }
Source:
public void deleteComment ( com.google.gerrit.reviewdb.client.PatchLineComment c ) { verifyComment ( c ) ; com.google.common.base.Preconditions.checkArgument ( draftNotes.containsComment ( c ) , ( "Cannot delete this comment " + "because it didn't previously exist as a draft" ) ) ; deleteComments.add ( c ) ; }

Target:
public void updateComment ( com.google.gerrit.reviewdb.client.PatchLineComment c ) throws com.google.gwtorm.server.OrmException { verifyComment ( c ) ; com.google.common.base.Preconditions.checkArgument ( ( ( c.getStatus ( ) ) == ( com.google.gerrit.reviewdb.client.PatchLineComment.Status.DRAFT ) ) , "Cannot update a published comment into a ChangeDraftUpdate" ) ; com.google.common.base.Preconditions.checkArgument ( draftNotes.containsComment ( c ) , "Cannot update this comment because it didn't exist previously" ) ; upsertComments.add ( c ) ; }
Source:
public boolean equals ( java.lang.Object o ) { if ( o instanceof com.google.gerrit.server.patch.PatchListKey ) { com.google.gerrit.server.patch.PatchListKey k = ( ( com.google.gerrit.server.patch.PatchListKey ) ( o ) ) ; return ( ( ( ( java.util.Objects.equals ( oldId , k.oldId ) ) && ( java.util.Objects.equals ( parentNum , k.parentNum ) ) ) && ( java.util.Objects.equals ( newId , k.newId ) ) ) && ( ( whitespace ) == ( k.whitespace ) ) ) && ( ( algorithm ) == ( k.algorithm ) ) ; } return false ; }

Target:
public boolean equals ( java.lang.Object o ) { if ( o instanceof com.google.gerrit.server.diff.PatchListKey ) { com.google.gerrit.server.diff.PatchListKey k = ( ( com.google.gerrit.server.diff.PatchListKey ) ( o ) ) ; return ( ( ( ( java.util.Objects.equals ( oldId , k.oldId ) ) && ( java.util.Objects.equals ( parentNum , k.parentNum ) ) ) && ( java.util.Objects.equals ( newId , k.newId ) ) ) && ( ( whitespace ) == ( k.whitespace ) ) ) && ( ( algorithm ) == ( k.algorithm ) ) ; } return false ; }
Source:
public void parseTopic ( ) throws java.lang.Exception { assertParseSucceeds ( ( "Update change\n" + ( ( ( ( ( "\n" + "Branch: refs/heads/master\n" ) + "Change-id: I577fb248e474018276351785930358ec0450e9f7\n" ) + "Patch-Set: 1\n" ) + "Topic: Some Topic\n" ) + "Subject: This is a test change\n" ) ) ) ; assertParseSucceeds ( ( "Update change\n" + ( ( ( ( ( "\n" + "Branch: refs/heads/master\n" ) + "Change-id: I577fb248e474018276351785930358ec0450e9f7\n" ) + "Patch-Set: 1\n" ) + "Topic:\n" ) + "Subject: This is a test change\n" ) ) ) ; assertParseFails ( ( "Update change\n" + ( ( ( "\n" + "Patch-Set: 1\n" ) + "Topic: Some Topic\n" ) + "Topic: Other Topic" ) ) ) ; }

Target:
public void parseTopic ( ) throws java.lang.Exception { assertParseSucceeds ( ( "Update change\n" + ( ( ( ( ( "\n" + "Branch: refs/heads/master\n" ) + "Change-id: I577fb248e474018276351785930358ec0450e9f7\n" ) + "Patch-set: 1\n" ) + "Topic: Some Topic\n" ) + "Subject: This is a test change\n" ) ) ) ; assertParseSucceeds ( ( "Update change\n" + ( ( ( ( ( "\n" + "Branch: refs/heads/master\n" ) + "Change-id: I577fb248e474018276351785930358ec0450e9f7\n" ) + "Patch-set: 1\n" ) + "Topic:\n" ) + "Subject: This is a test change\n" ) ) ) ; assertParseFails ( ( "Update change\n" + ( ( ( "\n" + "Patch-set: 1\n" ) + "Topic: Some Topic\n" ) + "Topic: Other Topic" ) ) ) ; }
Source:
public void fire ( com.google.gerrit.extensions.common.ChangeInfo change , com.google.gerrit.extensions.common.RevisionInfo revision , com.google.gerrit.extensions.common.AccountInfo abandoner , java.lang.String reason , java.sql.Timestamp when ) { if ( ! ( listeners.iterator ( ) . hasNext ( ) ) ) { return ; } com.google.gerrit.server.extensions.events.ChangeAbandoned.Event event = new com.google.gerrit.server.extensions.events.ChangeAbandoned.Event ( change , revision , abandoner , reason , when ) ; for ( com.google.gerrit.extensions.events.ChangeAbandonedListener l : listeners ) { try { l.onChangeAbandoned ( event ) ; } catch ( java.lang.Exception e ) { com.google.gerrit.server.extensions.events.ChangeAbandoned.log.warn ( "Error in event listener" , e ) ; } } }

Target:
public void fire ( com.google.gerrit.extensions.common.ChangeInfo change , com.google.gerrit.extensions.common.RevisionInfo revision , com.google.gerrit.extensions.common.AccountInfo abandoner , java.lang.String reason , java.sql.Timestamp when , com.google.gerrit.extensions.api.changes.NotifyHandling notifyHandling ) { if ( ! ( listeners.iterator ( ) . hasNext ( ) ) ) { return ; } com.google.gerrit.server.extensions.events.ChangeAbandoned.Event event = new com.google.gerrit.server.extensions.events.ChangeAbandoned.Event ( change , revision , abandoner , reason , when , notifyHandling ) ; for ( com.google.gerrit.extensions.events.ChangeAbandonedListener l : listeners ) { try { l.onChangeAbandoned ( event ) ; } catch ( java.lang.Exception e ) { com.google.gerrit.server.extensions.events.ChangeAbandoned.log.warn ( "Error in event listener" , e ) ; } } }
Source:
public void setUp ( ) throws java.lang.Exception { testRepo = new org.eclipse.jgit.junit.TestRepository ( ( ( org.eclipse.jgit.internal.storage.dfs.InMemoryRepository ) ( repoManager.openRepository ( project ) ) ) ) ; tip = testRepo.getRevWalk ( ) . parseCommit ( testRepo.getRepository ( ) . exactRef ( "HEAD" ) . getObjectId ( ) ) ; adminId = admin.getId ( ) ; checker = checkerProvider.get ( ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { serverSideTestRepo = new org.eclipse.jgit.junit.TestRepository ( ( ( org.eclipse.jgit.internal.storage.dfs.InMemoryRepository ) ( repoManager.openRepository ( project ) ) ) ) ; tip = serverSideTestRepo.getRevWalk ( ) . parseCommit ( serverSideTestRepo.getRepository ( ) . exactRef ( "HEAD" ) . getObjectId ( ) ) ; adminId = admin.getId ( ) ; checker = checkerProvider.get ( ) ; }
Source:
private void setListIdHeader ( ) { final java.lang.StringBuilder listid = new java.lang.StringBuilder ( ) ; listid.append ( "gerrit-" ) ; listid.append ( projectName.replace ( '/' , '-' ) ) ; listid.append ( "@" ) ; listid.append ( getGerritHost ( ) ) ; final java.lang.String listidStr = listid.toString ( ) ; setHeader ( "Mailing-List" , ( "list " + listidStr ) ) ; setHeader ( "List-Id" , ( ( "<" + ( listidStr.replace ( '@' , '.' ) ) ) + ">" ) ) ; if ( ( getSettingsUrl ( ) ) != null ) { setHeader ( "List-Unsubscribe" , ( ( "<" + ( getSettingsUrl ( ) ) ) + ">" ) ) ; } }

Target:
protected void formatChangeDetail ( ) { appendText ( getChangeDetail ( ) ) ; }
Source:
public void writeNoChanges ( ) throws java.lang.Exception { com.google.common.truth.Truth.assertThat ( modifier.createEdit ( change , ps ) ) . isEqualTo ( RefUpdate.Result.NEW ) ; try { modifier.modifyFile ( editUtil.byChange ( change ) . get ( ) , com.google.gerrit.acceptance.edit.ChangeEditIT.FILE_NAME , com.google.gerrit.acceptance.RestSession.newRawInput ( com.google.gerrit.acceptance.edit.ChangeEditIT.CONTENT_OLD ) ) ; org.junit.Assert.fail ( ) ; } catch ( com.google.gerrit.server.project.InvalidChangeOperationException e ) { com.google.common.truth.Truth.assertThat ( e.getMessage ( ) ) . isEqualTo ( "no changes were made" ) ; } }

Target:
public void writeNoChanges ( ) throws java.lang.Exception { com.google.common.truth.Truth.assertThat ( modifier.createEdit ( change , ps ) ) . isEqualTo ( RefUpdate.Result.NEW ) ; exception.expect ( com.google.gerrit.server.project.InvalidChangeOperationException.class ) ; exception.expectMessage ( "no changes were made" ) ; modifier.modifyFile ( editUtil.byChange ( change ) . get ( ) , com.google.gerrit.acceptance.edit.ChangeEditIT.FILE_NAME , com.google.gerrit.acceptance.RestSession.newRawInput ( com.google.gerrit.acceptance.edit.ChangeEditIT.CONTENT_OLD ) ) ; }
Source:
public void visit ( org.pegdown.ast.RefLinkNode node ) { org.pegdown.ast.ReferenceNode ref = references.get ( node.referenceKey , com.google.gitiles.doc.MarkdownHelper.getInnerText ( node ) ) ; if ( ref != null ) { html.open ( "a" ) . attribute ( "href" , ref.getUrl ( ) ) . attribute ( "title" , ref.getTitle ( ) ) ; visitChildren ( node ) ; html.close ( "a" ) ; } else { visitChildren ( node ) ; } }

Target:
public void visit ( org.pegdown.ast.RefLinkNode node ) { org.pegdown.ast.ReferenceNode ref = references.get ( node.referenceKey , com.google.gitiles.doc.MarkdownHelper.getInnerText ( node ) ) ; if ( ref != null ) { html.open ( "a" ) . attribute ( "href" , href ( ref.getUrl ( ) ) ) . attribute ( "title" , ref.getTitle ( ) ) ; visitChildren ( node ) ; html.close ( "a" ) ; } else { visitChildren ( node ) ; } }
Source:
protected java.lang.String getChangeMessageThreadId ( ) { final java.lang.StringBuilder r = new java.lang.StringBuilder ( ) ; r.append ( '<' ) ; r.append ( "gerrit" ) ; r.append ( '.' ) ; r.append ( change.getCreatedOn ( ) . getTime ( ) ) ; r.append ( '.' ) ; r.append ( change.getKey ( ) . get ( ) ) ; r.append ( '@' ) ; r.append ( getGerritHost ( ) ) ; r.append ( '>' ) ; return r.toString ( ) ; }

Target:
public java.lang.String getChangeMessageThreadId ( ) throws com.google.gerrit.server.mail.EmailException { return velocify ( ( "<gerrit.${change.createdOn.time}.$change.key.get()" + "@$email.gerritHost>" ) ) ; }
Source:
public static com.google.gerrit.server.account.ExternalId from ( com.google.gerrit.reviewdb.client.AccountExternalId externalId ) { if ( externalId == null ) { return null ; } return new com.google.gerrit.server.account.AutoValue_ExternalId ( com.google.gerrit.server.account.ExternalId.Key.parse ( externalId.getExternalId ( ) ) , externalId.getAccountId ( ) , externalId.getEmailAddress ( ) , externalId.getPassword ( ) ) ; }

Target:
public static com.google.gerrit.server.account.ExternalId from ( com.google.gerrit.reviewdb.client.AccountExternalId externalId ) { if ( externalId == null ) { return null ; } return new com.google.gerrit.server.account.AutoValue_ExternalId ( com.google.gerrit.server.account.ExternalId.Key.parse ( externalId.getExternalId ( ) ) , externalId.getAccountId ( ) , com.google.common.base.Strings.emptyToNull ( externalId.getEmailAddress ( ) ) , com.google.common.base.Strings.emptyToNull ( externalId.getPassword ( ) ) ) ; }
Source:
void setShowLineNumbers ( boolean b ) { cmA.setOption ( "lineNumbers" , b ) ; cmB.setOption ( "lineNumbers" , b ) ; if ( b ) { diffTable.addStyleName ( DiffTable.style.showLineNumbers ( ) ) ; } else { diffTable.removeStyleName ( DiffTable.style.showLineNumbers ( ) ) ; } }

Target:
void removeFileCommentBox ( com.google.gerrit.client.diff.DraftBox box ) { diffTable.onRemoveDraftBox ( box ) ; }
Source:
private com.google.common.collect.SetMultimap < org.eclipse.jgit.lib.ObjectId , org.eclipse.jgit.lib.Ref > changeRefsById ( ) { if ( ( refsById ) == null ) { refsById = com.google.common.collect.HashMultimap.create ( ) ; for ( org.eclipse.jgit.lib.Ref r : refsByChange ( ) . values ( ) ) { refsById.put ( r.getObjectId ( ) , r ) ; } } return refsById ; }

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:
public static com.google.inject.Injector createInjector ( final com.google.inject.Injector db ) { final com.google.inject.Injector cfg = db.createChildInjector ( new com.google.gerrit.server.config.GerritConfigModule ( ) ) ; final java.util.List < com.google.inject.Module > modules = new java.util.ArrayList < com.google.inject.Module > ( ) ; modules.add ( new com.google.gerrit.server.config.GerritGlobalModule ( ) ) ; return cfg.createChildInjector ( modules ) ; }

Target:
public static com.google.inject.Injector createInjector ( final com.google.inject.Injector db ) { final com.google.inject.Injector cfg = db.createChildInjector ( new com.google.gerrit.server.config.GerritConfigModule ( ) ) ; final java.util.List < com.google.inject.Module > modules = new java.util.ArrayList < com.google.inject.Module > ( ) ; modules.add ( cfg.getInstance ( com.google.gerrit.server.config.GerritGlobalModule.class ) ) ; return cfg.createChildInjector ( modules ) ; }
Source:
public int compare ( java.util.Map.Entry < java.lang.String , java.io.File > entry1 , java.util.Map.Entry < java.lang.String , java.io.File > entry2 ) { java.lang.String file1 = entry1.getValue ( ) . getName ( ) ; java.lang.String file2 = entry2.getValue ( ) . getName ( ) ; int cmp = file1.compareTo ( file2 ) ; if ( file1.endsWith ( ".jar" ) ) { return file2.endsWith ( ".jar" ) ? cmp : - 1 ; } else { return file2.endsWith ( ".jar" ) ? + 1 : cmp ; } }

Target:
public int compare ( java.util.Map.Entry < java.lang.String , java.nio.file.Path > e1 , java.util.Map.Entry < java.lang.String , java.nio.file.Path > e2 ) { java.nio.file.Path n1 = e1.getValue ( ) . getFileName ( ) ; java.nio.file.Path n2 = e2.getValue ( ) . getFileName ( ) ; return com.google.common.collect.ComparisonChain.start ( ) . compareTrueFirst ( n1.endsWith ( ".jar" ) , n2.endsWith ( ".jar" ) ) . compare ( n1 , n2 ) . result ( ) ; }
Source:
public static com.google.gerrit.client.changes.CommentInfo create ( java.lang.String path , com.google.gerrit.extensions.client.Side side , int line , com.google.gerrit.client.diff.CommentRange range ) { com.google.gerrit.client.changes.CommentInfo n = createObject ( ) . cast ( ) ; n.path ( path ) ; n.side ( side ) ; if ( range != null ) { n.line ( range.end_line ( ) ) ; n.range ( range ) ; } else if ( line > 0 ) { n.line ( line ) ; } return n ; }

Target:
public static com.google.gerrit.client.changes.CommentInfo create ( java.lang.String path , com.google.gerrit.extensions.client.Side side , int line , com.google.gerrit.client.diff.CommentRange range ) { com.google.gerrit.client.changes.CommentInfo n = createObject ( ) . cast ( ) ; n.path ( path ) ; n.side ( side ) ; if ( range != null ) { n.line ( range.endLine ( ) ) ; n.range ( range ) ; } else if ( line > 0 ) { n.line ( line ) ; } return n ; }
Source:
public com.google.gerrit.extensions.common.GroupInfo format ( com.google.gerrit.common.data.GroupDescription.Basic group ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.extensions.common.GroupInfo info = init ( group ) ; if ( ( options.contains ( com.google.gerrit.extensions.client.ListGroupsOption.MEMBERS ) ) || ( options.contains ( com.google.gerrit.extensions.client.ListGroupsOption.INCLUDES ) ) ) { com.google.gerrit.server.group.GroupResource rsrc = new com.google.gerrit.server.group.GroupResource ( groupControlFactory.controlFor ( group ) ) ; initMembersAndIncludes ( rsrc , info ) ; } return info ; }

Target:
public com.google.gerrit.extensions.common.GroupInfo format ( com.google.gerrit.common.data.GroupDescription.Basic group ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.extensions.common.GroupInfo info = init ( group ) ; if ( ( options.contains ( com.google.gerrit.extensions.client.ListGroupsOption.MEMBERS ) ) || ( options.contains ( com.google.gerrit.extensions.client.ListGroupsOption.INCLUDES ) ) ) { com.google.gerrit.server.group.GroupResource rsrc = new com.google.gerrit.server.group.GroupResource ( groupControlFactory.controlFor ( group ) ) ; initMembersAndSubgroups ( rsrc , info ) ; } return info ; }
Source:
public void run ( ) { try { threadScoper.scope ( new java.util.concurrent.Callable < java.lang.Void > ( ) { @ java.lang.Override public java.lang.Void call ( ) { runPushOperation ( ) ; return null ; } } ) . call ( ) ; } catch ( java.lang.Exception e ) { com.google.common.base.Throwables.propagateIfPossible ( e ) ; throw new java.lang.RuntimeException ( e ) ; } finally { statesCleanUp ( ) ; } }

Target:
public void run ( ) { try { threadScoper.scope ( new java.util.concurrent.Callable < java.lang.Void > ( ) { @ java.lang.Override public java.lang.Void call ( ) { runPushOperation ( ) ; return null ; } } ) . call ( ) ; } catch ( java.lang.Exception e ) { com.google.common.base.Throwables.throwIfUnchecked ( e ) ; throw new java.lang.RuntimeException ( e ) ; } finally { statesCleanUp ( ) ; } }
Source:
private com.google.inject.Injector getPluginInjector ( java.io.File jarFile ) throws java.io.IOException { final java.lang.String pluginName = com.google.common.base.Objects.firstNonNull ( com.google.gerrit.server.plugins.PluginLoader.getGerritJarPluginName ( jarFile ) , com.google.gerrit.server.plugins.PluginLoader.nameOf ( jarFile ) ) ; return initInjector.createChildInjector ( new com.google.inject.AbstractModule ( ) { @ java.lang.Override protected void configure ( ) { bind ( java.lang.String.class ) . annotatedWith ( com.google.gerrit.extensions.annotations.PluginName.class ) . toInstance ( pluginName ) ; } } ) ; }

Target:
private com.google.inject.Injector getPluginInjector ( final java.io.File jarFile ) throws java.io.IOException { final java.lang.String pluginName = com.google.common.base.Objects.firstNonNull ( com.google.gerrit.server.plugins.JarPluginProvider.getJarPluginName ( jarFile ) , com.google.gerrit.server.plugins.PluginLoader.nameOf ( jarFile ) ) ; return initInjector.createChildInjector ( new com.google.inject.AbstractModule ( ) { @ java.lang.Override protected void configure ( ) { bind ( java.lang.String.class ) . annotatedWith ( com.google.gerrit.extensions.annotations.PluginName.class ) . toInstance ( pluginName ) ; } } ) ; }