auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void push ( java.lang.String includeFileName ) throws java.io.IOException { fileInputStreamStack.push ( currentIs ) ; java.io.File inputFile = getFile ( includeFileName ) ; if ( ! ( inputFile.exists ( ) ) ) { throw new java.io.IOException ( ( ( ( ( ( "Cannot find file '" + includeFileName ) + "' included in " ) + ( currentIs.getFileName ( ) ) ) + ":" ) + ( currentIs.getLineNr ( ) ) ) ) ; } currentIs = new com.googlesource.gerrit.plugins.web.LookAheadFileInputStream ( inputFile ) ; in = currentIs ; }

Target:
private void push ( java.lang.String includeFileName ) throws java.io.IOException { fileInputStreamStack.push ( currentIs ) ; java.nio.file.Path inputFile = getFile ( includeFileName ) ; if ( ! ( java.nio.file.Files.exists ( inputFile ) ) ) { throw new java.io.IOException ( ( ( ( ( ( "Cannot find file '" + includeFileName ) + "' included in " ) + ( currentIs.getFileName ( ) ) ) + ":" ) + ( currentIs.getLineNr ( ) ) ) ) ; } currentIs = new com.googlesource.gerrit.plugins.web.LookAheadFileInputStream ( inputFile ) ; in = currentIs ; }
Source:
public void setUpMocks ( ) { indexer = createNiceMock ( com.google.gerrit.server.index.change.ChangeIndexer.class ) ; schemaFactory = createNiceMock ( com.google.gwtorm.server.SchemaFactory.class ) ; req = createNiceMock ( javax.servlet.http.HttpServletRequest.class ) ; rsp = createNiceMock ( javax.servlet.http.HttpServletResponse.class ) ; syncIndexRestApiServlet = new com.ericsson.gerrit.plugins.syncindex.SyncIndexRestApiServlet ( indexer , schemaFactory ) ; id = Change.Id.parse ( com.ericsson.gerrit.plugins.syncindex.SyncIndexRestApiServletTest.CHANGE_NUMBER ) ; org.easymock.EasyMock.expect ( req.getPathInfo ( ) ) . andReturn ( ( "/index/" + ( com.ericsson.gerrit.plugins.syncindex.SyncIndexRestApiServletTest.CHANGE_NUMBER ) ) ) ; }

Target:
public void setUpMocks ( ) { syncIndexRestApiServlet = new com.ericsson.gerrit.plugins.syncindex.SyncIndexRestApiServlet ( indexer , schemaFactory ) ; id = Change.Id.parse ( com.ericsson.gerrit.plugins.syncindex.SyncIndexRestApiServletTest.CHANGE_NUMBER ) ; org.mockito.Mockito.when ( req.getPathInfo ( ) ) . thenReturn ( ( "/index/" + ( com.ericsson.gerrit.plugins.syncindex.SyncIndexRestApiServletTest.CHANGE_NUMBER ) ) ) ; change = new com.google.gerrit.reviewdb.client.Change ( null , id , null , null , com.google.gerrit.common.TimeUtil.nowTs ( ) ) ; }
Source:
public void testIsEnabledEventSingleBranchRegExp ( ) { java.lang.String [ ] branches = new java.lang.String [ ] { "^refs/heads/test.*" } ; setupIsEnabled ( "true" , null , branches ) ; com.google.gerrit.server.events.PatchSetCreatedEvent event = new com.google.gerrit.server.events.PatchSetCreatedEvent ( ) ; com.google.gerrit.server.data.ChangeAttribute changeAttribute = new com.google.gerrit.server.data.ChangeAttribute ( ) ; changeAttribute.project = "testProject" ; changeAttribute.branch = "testBranch" ; event.change = com.google.common.base.Suppliers.ofInstance ( changeAttribute ) ; com.googlesource.gerrit.plugins.its.base.its.ItsConfig itsConfig = createItsConfig ( ) ; replayMocks ( ) ; assertTrue ( itsConfig.isEnabled ( event ) ) ; }

Target:
public void testIsEnabledEventSingleBranchRegExp ( ) { java.lang.String [ ] branches = new java.lang.String [ ] { "^refs/heads/test.*" } ; setupIsEnabled ( "true" , null , branches ) ; com.google.gerrit.server.events.PatchSetCreatedEvent event = new com.google.gerrit.server.events.PatchSetCreatedEvent ( testChange ( "testProject" , "testBranch" ) ) ; com.googlesource.gerrit.plugins.its.base.its.ItsConfig itsConfig = createItsConfig ( ) ; replayMocks ( ) ; assertTrue ( itsConfig.isEnabled ( event ) ) ; }
Source:
public void parseAuthor ( ) throws java.lang.Exception { assertParseSucceeds ( ( "Update change\n" + ( "\n" + "Patch-Set: 1\n" ) ) ) ; assertParseFails ( writeCommit ( ( "Update change\n" + ( "\n" + "Patch-Set: 1\n" ) ) , new org.eclipse.jgit.lib.PersonIdent ( "Change Owner" , "owner@example.com" , serverIdent.getWhen ( ) , serverIdent.getTimeZone ( ) ) ) ) ; assertParseFails ( writeCommit ( ( "Update change\n" + ( "\n" + "Patch-Set: 1\n" ) ) , new org.eclipse.jgit.lib.PersonIdent ( "Change Owner" , "x@gerrit" , serverIdent.getWhen ( ) , serverIdent.getTimeZone ( ) ) ) ) ; }

Target:
public void parseAuthor ( ) throws java.lang.Exception { assertParseSucceeds ( ( "Update change\n" + ( ( "\n" + "Branch: refs/heads/master\n" ) + "Patch-Set: 1\n" ) ) ) ; assertParseFails ( writeCommit ( ( "Update change\n" + ( "\n" + "Patch-Set: 1\n" ) ) , new org.eclipse.jgit.lib.PersonIdent ( "Change Owner" , "owner@example.com" , serverIdent.getWhen ( ) , serverIdent.getTimeZone ( ) ) ) ) ; assertParseFails ( writeCommit ( ( "Update change\n" + ( "\n" + "Patch-Set: 1\n" ) ) , new org.eclipse.jgit.lib.PersonIdent ( "Change Owner" , "x@gerrit" , serverIdent.getWhen ( ) , serverIdent.getTimeZone ( ) ) ) ) ; }
Source:
protected PushOneCommit.Result amendChange ( java.lang.String changeId , java.lang.String ref ) throws java.lang.Exception { java.util.Collections.shuffle ( com.google.gerrit.acceptance.AbstractDaemonTest.RANDOM ) ; com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , admin.getIdent ( ) , testRepo , PushOneCommit.SUBJECT , PushOneCommit.FILE_NAME , new java.lang.String ( com.google.common.primitives.Chars.toArray ( com.google.gerrit.acceptance.AbstractDaemonTest.RANDOM ) ) , changeId ) ; return push.to ( ref ) ; }

Target:
protected PushOneCommit.Result amendChange ( java.lang.String changeId , java.lang.String ref , com.google.gerrit.acceptance.TestAccount testAccount , org.eclipse.jgit.junit.TestRepository < ? > repo ) throws java.lang.Exception { java.util.Collections.shuffle ( com.google.gerrit.acceptance.AbstractDaemonTest.RANDOM ) ; com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , testAccount.getIdent ( ) , repo , PushOneCommit.SUBJECT , PushOneCommit.FILE_NAME , new java.lang.String ( com.google.common.primitives.Chars.toArray ( com.google.gerrit.acceptance.AbstractDaemonTest.RANDOM ) ) , changeId ) ; return push.to ( ref ) ; }
Source:
private com.google.gerrit.reviewdb.client.Change.Id getOrRegisterAccount ( com.google.gerrit.reviewdb.server.ReviewDb db , java.lang.String login , java.lang.String name , java.lang.String email ) throws com.google.gerrit.extensions.restapi.BadRequestException , com.google.gerrit.extensions.restapi.ResourceConflictException , com.google.gerrit.extensions.restapi.UnprocessableEntityException , com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { com.google.gerrit.reviewdb.client.AccountExternalId.Key userExtKey = new com.google.gerrit.reviewdb.client.AccountExternalId.Key ( com.google.gerrit.reviewdb.client.AccountExternalId.SCHEME_USERNAME , login ) ; com.google.gerrit.reviewdb.server.AccountExternalIdAccess gerritExtIds = db.accountExternalIds ( ) ; com.google.gerrit.reviewdb.client.AccountExternalId userExtId = gerritExtIds.get ( userExtKey ) ; if ( userExtId == null ) { return accountImporter.importAccount ( login , name , email ) ; } return userExtId.getAccountId ( ) ; }

Target:
private com.google.gerrit.reviewdb.client.Change.Id getOrRegisterAccount ( com.google.gerrit.reviewdb.server.ReviewDb db , java.lang.String login , java.lang.String name , java.lang.String email ) throws com.google.gerrit.extensions.restapi.BadRequestException , com.google.gerrit.extensions.restapi.ResourceConflictException , com.google.gerrit.extensions.restapi.UnprocessableEntityException , com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { java.util.Optional < com.google.gerrit.server.account.externalids.ExternalId > gerritId = externalIdByScheme ( ExternalId.SCHEME_GERRIT , login ) ; if ( gerritId.isPresent ( ) ) { return gerritId.get ( ) . accountId ( ) ; } return accountImporter.importAccount ( login , name , email ) ; }
Source:
public void createBranchByProjectOwnerCreateReferenceBlocked_Forbidden ( ) throws java.lang.Exception { grantOwner ( ) ; blockCreateReference ( ) ; com.google.gerrit.acceptance.RestResponse r = userSession.put ( ( ( ( "/projects/" + ( project.get ( ) ) ) + "/branches/" ) + ( branch.getShortName ( ) ) ) ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( HttpStatus.SC_FORBIDDEN ) ; }

Target:
private void assertCreateFails ( java.lang.Class < ? extends com.google.gerrit.extensions.restapi.RestApiException > errType ) throws java.lang.Exception { try { branch ( ) . create ( new com.google.gerrit.extensions.api.projects.BranchInput ( ) ) ; org.junit.Assert.fail ( ( "Expected " + ( errType.getSimpleName ( ) ) ) ) ; } catch ( com.google.gerrit.extensions.restapi.RestApiException expected ) { com.google.common.truth.Truth.assertThat ( expected ) . isInstanceOf ( errType ) ; } }
Source:
private void logError ( java.lang.String msg , java.lang.Throwable t ) { if ( com.google.gerrit.server.git.MergeOp.log.isErrorEnabled ( ) ) { if ( t != null ) { com.google.gerrit.server.git.MergeOp.log.error ( ( ( ( "[" + ( submissionId ) ) + "]" ) + msg ) , t ) ; } else { com.google.gerrit.server.git.MergeOp.log.error ( ( ( ( "[" + ( submissionId ) ) + "]" ) + msg ) ) ; } } }

Target:
private void logDebug ( java.lang.String msg , java.lang.Object ... args ) { if ( com.google.gerrit.server.git.MergeOp.log.isDebugEnabled ( ) ) { com.google.gerrit.server.git.MergeOp.log.debug ( ( ( submissionId ) + msg ) , args ) ; } }
Source:
public void noExternalIds ( ) throws java.lang.Exception { db.accountExternalIds ( ) . delete ( db.accountExternalIds ( ) . byAccount ( user.getAccountId ( ) ) ) ; reloadUser ( ) ; com.google.gerrit.gpg.testutil.TestKey key = com.google.gerrit.gpg.testutil.TestKeys.validKeyWithSecondUserId ( ) ; com.google.gerrit.gpg.PublicKeyChecker checker = checkerFactory.create ( user , store ) . disableTrust ( ) ; assertProblems ( checker.check ( key.getPublicKey ( ) ) , Status.BAD , ( "No identities found for user; check" + " http://test/#/settings/web-identities" ) ) ; checker = checkerFactory.create ( ) . setStore ( store ) . disableTrust ( ) ; assertProblems ( checker.check ( key.getPublicKey ( ) ) , Status.BAD , "Key is not associated with any users" ) ; db.accountExternalIds ( ) . insert ( java.util.Collections.singleton ( new com.google.gerrit.reviewdb.client.AccountExternalId ( user.getAccountId ( ) , com.google.gerrit.gpg.GerritPublicKeyChecker.toExtIdKey ( key.getPublicKey ( ) ) ) ) ) ; reloadUser ( ) ; assertProblems ( checker.check ( key.getPublicKey ( ) ) , Status.BAD , "No identities found for user" ) ; }

Target:
public void noExternalIds ( ) throws java.lang.Exception { db.accountExternalIds ( ) . delete ( db.accountExternalIds ( ) . byAccount ( user.getAccountId ( ) ) ) ; reloadUser ( ) ; com.google.gerrit.gpg.testutil.TestKey key = com.google.gerrit.gpg.testutil.TestKeys.validKeyWithSecondUserId ( ) ; com.google.gerrit.gpg.PublicKeyChecker checker = checkerFactory.create ( user , store ) . disableTrust ( ) ; assertProblems ( checker.check ( key.getPublicKey ( ) ) , Status.BAD , "No identities found for user; check http://test/#/settings/web-identities" ) ; checker = checkerFactory.create ( ) . setStore ( store ) . disableTrust ( ) ; assertProblems ( checker.check ( key.getPublicKey ( ) ) , Status.BAD , "Key is not associated with any users" ) ; db.accountExternalIds ( ) . insert ( java.util.Collections.singleton ( new com.google.gerrit.reviewdb.client.AccountExternalId ( user.getAccountId ( ) , com.google.gerrit.gpg.GerritPublicKeyChecker.toExtIdKey ( key.getPublicKey ( ) ) ) ) ) ; reloadUser ( ) ; assertProblems ( checker.check ( key.getPublicKey ( ) ) , Status.BAD , "No identities found for user" ) ; }
Source:
public static com.google.gerrit.server.index.IndexConfig create ( int maxLimit , int maxPages , int maxTerms ) { return new com.google.gerrit.server.index.AutoValue_IndexConfig ( com.google.gerrit.server.index.IndexConfig.checkLimit ( maxLimit , "maxLimit" , java.lang.Integer.MAX_VALUE ) , com.google.gerrit.server.index.IndexConfig.checkLimit ( maxPages , "maxPages" , java.lang.Integer.MAX_VALUE ) , com.google.gerrit.server.index.IndexConfig.checkLimit ( maxTerms , "maxTerms" , com.google.gerrit.server.index.IndexConfig.DEFAULT_MAX_TERMS ) ) ; }

Target:
public static com.google.gerrit.server.index.IndexConfig.Builder builder ( ) { return new com.google.gerrit.server.index.AutoValue_IndexConfig.Builder ( ) . maxLimit ( java.lang.Integer.MAX_VALUE ) . maxPages ( java.lang.Integer.MAX_VALUE ) . maxTerms ( com.google.gerrit.server.index.IndexConfig.DEFAULT_MAX_TERMS ) ; }
Source:
public static com.google.gwtorm.server.OrmException convertError ( java.lang.String op , java.sql.SQLException err ) { switch ( com.google.gerrit.server.schema.H2AccountPatchReviewStore.getSQLStateInt ( err ) ) { case 23001 : case 23505 : return new com.google.gwtorm.server.OrmDuplicateKeyException ( "ACCOUNT_PATCH_REVIEWS" , err ) ; default : if ( ( ( err.getCause ( ) ) == null ) && ( ( err.getNextException ( ) ) != null ) ) { err.initCause ( err.getNextException ( ) ) ; } return new com.google.gwtorm.server.OrmException ( ( op + " failure on ACCOUNT_PATCH_REVIEWS" ) , err ) ; } }

Target:
public com.google.gwtorm.server.OrmException convertError ( java.lang.String op , java.sql.SQLException err ) { switch ( getSQLStateInt ( err ) ) { case 23001 : case 23505 : return new com.google.gwtorm.server.OrmDuplicateKeyException ( "account_patch_reviews" , err ) ; default : if ( ( ( err.getCause ( ) ) == null ) && ( ( err.getNextException ( ) ) != null ) ) { err.initCause ( err.getNextException ( ) ) ; } return new com.google.gwtorm.server.OrmException ( ( op + " failure on account_patch_reviews" ) , err ) ; } }
Source:
private void failAndThrow ( com.google.gerrit.reviewdb.client.Change change , java.lang.RuntimeException e ) { fail ( change , e ) ; throw e ; }

Target:
public void run ( ) { try { future.get ( ) ; } catch ( java.lang.InterruptedException e ) { fail ( project , e ) ; } catch ( java.util.concurrent.ExecutionException e ) { ok.set ( false ) ; } catch ( java.lang.RuntimeException e ) { failAndThrow ( project , e ) ; } catch ( java.lang.Error e ) { failAndThrow ( project , e ) ; } finally { projTask.update ( 1 ) ; } }
Source:
protected void doPost ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse rsp ) { if ( ! ( currentUserProvider.get ( ) . getCapabilities ( ) . canAdministrateServer ( ) ) ) { sendError ( rsp , javax.servlet.http.HttpServletResponse.SC_FORBIDDEN ) ; return ; } this . healthy = true ; rsp.setStatus ( javax.servlet.http.HttpServletResponse.SC_NO_CONTENT ) ; }

Target:
protected void doDelete ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse rsp ) { if ( ! ( permissionBackend.user ( currentUserProvider.get ( ) ) . testOrFalse ( com.google.gerrit.server.permissions.GlobalPermission.ADMINISTRATE_SERVER ) ) ) { sendError ( rsp , javax.servlet.http.HttpServletResponse.SC_FORBIDDEN ) ; return ; } this . healthy = false ; rsp.setStatus ( javax.servlet.http.HttpServletResponse.SC_NO_CONTENT ) ; }
Source:
public void testIsEnabledEventDisabled ( ) { java.lang.String [ ] branches = new java.lang.String [ ] { "^refs/heads/testBranch" } ; setupIsEnabled ( "false" , null , branches ) ; com.google.gerrit.server.events.PatchSetCreatedEvent event = new com.google.gerrit.server.events.PatchSetCreatedEvent ( ) ; event.change = new com.google.gerrit.server.data.ChangeAttribute ( ) ; event.change.project = "testProject" ; event.change.branch = "testBranch" ; com.googlesource.gerrit.plugins.its.base.its.ItsConfig itsConfig = createItsConfig ( ) ; replayMocks ( ) ; assertFalse ( itsConfig.isEnabled ( event ) ) ; }

Target:
public void testIsEnabledEventDisabled ( ) { java.lang.String [ ] branches = new java.lang.String [ ] { "^refs/heads/testBranch" } ; setupIsEnabled ( "false" , null , branches ) ; com.google.gerrit.server.events.PatchSetCreatedEvent event = new com.google.gerrit.server.events.PatchSetCreatedEvent ( ) ; com.google.gerrit.server.data.ChangeAttribute changeAttribute = new com.google.gerrit.server.data.ChangeAttribute ( ) ; changeAttribute.project = "testProject" ; changeAttribute.branch = "testBranch" ; event.change = com.google.common.base.Suppliers.ofInstance ( changeAttribute ) ; com.googlesource.gerrit.plugins.its.base.its.ItsConfig itsConfig = createItsConfig ( ) ; replayMocks ( ) ; assertFalse ( itsConfig.isEnabled ( event ) ) ; }
Source:
public void parsePatchSetId ( ) throws java.lang.Exception { assertParseSucceeds ( ( "Update change\n" + ( "\n" + "Patch-Set: 1\n" ) ) ) ; assertParseFails ( ( "Update change\n" + "\n" ) ) ; assertParseFails ( ( "Update change\n" + ( ( "\n" + "Patch-Set: 1\n" ) + "Patch-Set: 1\n" ) ) ) ; assertParseSucceeds ( ( "Update change\n" + ( "\n" + "Patch-Set: 1\n" ) ) ) ; assertParseFails ( ( "Update change\n" + ( "\n" + "Patch-Set: x\n" ) ) ) ; }

Target:
public void parsePatchSetId ( ) throws java.lang.Exception { assertParseSucceeds ( ( "Update change\n" + ( ( ( "\n" + "Branch: refs/heads/master\n" ) + "Patch-Set: 1\n" ) + "Subject: This is a test change\n" ) ) ) ; assertParseFails ( ( "Update change\n" + "\n" ) ) ; assertParseFails ( ( "Update change\n" + ( ( "\n" + "Patch-Set: 1\n" ) + "Patch-Set: 1\n" ) ) ) ; assertParseSucceeds ( ( "Update change\n" + ( ( ( "\n" + "Branch: refs/heads/master\n" ) + "Patch-Set: 1\n" ) + "Subject: This is a test change\n" ) ) ) ; assertParseFails ( ( "Update change\n" + ( "\n" + "Patch-Set: x\n" ) ) ) ; }
Source:
public com.google.gerrit.reviewdb.client.Change abandon ( com.google.gerrit.server.project.ChangeControl control , final java.lang.String msgTxt , final com.google.gerrit.reviewdb.client.Account account ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.git.UpdateException { com.google.gerrit.server.change.Abandon.Op op = new com.google.gerrit.server.change.Abandon.Op ( msgTxt , account ) ; com.google.gerrit.reviewdb.client.Change c = control.getChange ( ) ; try ( com.google.gerrit.server.git.BatchUpdate u = batchUpdateFactory.create ( dbProvider.get ( ) , c.getProject ( ) , control.getUser ( ) , com.google.gerrit.common.TimeUtil.nowTs ( ) ) ) { u.addOp ( c.getId ( ) , op ) . execute ( ) ; } return op.change ; }

Target:
public com.google.gerrit.reviewdb.client.Change abandon ( com.google.gerrit.server.project.ChangeControl control , final java.lang.String msgTxt , final com.google.gerrit.reviewdb.client.Account account ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.git.UpdateException { com.google.gerrit.server.change.Abandon.Op op = new com.google.gerrit.server.change.Abandon.Op ( msgTxt , account ) ; try ( com.google.gerrit.server.git.BatchUpdate u = batchUpdateFactory.create ( dbProvider.get ( ) , control.getProject ( ) . getNameKey ( ) , control.getUser ( ) , com.google.gerrit.common.TimeUtil.nowTs ( ) ) ) { u.addOp ( control.getId ( ) , op ) . execute ( ) ; } return op.change ; }
Source:
private com.google.gerrit.server.change.ChangeInserter newInserter ( com.google.gerrit.reviewdb.client.Change.Id changeId , org.eclipse.jgit.revwalk.RevCommit commit ) { com.google.gerrit.server.change.ChangeInserter ins = changeInserterFactory.create ( changeId , commit , RefNames.REFS_CONFIG ) ; ins.setMessage ( "First patchset" ) . setValidate ( false ) . setUpdateRef ( false ) ; return ins ; }

Target:
private com.google.gerrit.server.change.ChangeInserter newInserter ( com.google.gerrit.reviewdb.client.Change.Id changeId , org.eclipse.jgit.revwalk.RevCommit commit ) { return changeInserterFactory.create ( changeId , commit , RefNames.REFS_CONFIG ) . setMessage ( com.google.gerrit.server.ApprovalsUtil.renderMessageWithApprovals ( 1 , com.google.common.collect.ImmutableMap.of ( ) , com.google.common.collect.ImmutableMap.of ( ) ) ) . setValidate ( false ) . setUpdateRef ( false ) ; }
Source:
public boolean canSeeGroup ( com.google.gerrit.reviewdb.AccountGroup.Id id ) { return isVisible ( ) ; }

Target:
public boolean canSeeMember ( com.google.gerrit.reviewdb.Account.Id id ) { if ( ( ( user ) instanceof com.google.gerrit.server.IdentifiedUser ) && ( ( ( com.google.gerrit.server.IdentifiedUser ) ( user ) ) . getAccountId ( ) . equals ( id ) ) ) { return true ; } return canSeeMembers ( ) ; }
Source:
private static org.eclipse.jgit.lib.Config config ( org.junit.runner.Description description ) { com.google.gerrit.acceptance.GerritConfigs cfgs = description.getAnnotation ( com.google.gerrit.acceptance.GerritConfigs.class ) ; com.google.gerrit.acceptance.GerritConfig cfg = description.getAnnotation ( com.google.gerrit.acceptance.GerritConfig.class ) ; if ( ( cfgs != null ) && ( cfg != null ) ) { throw new java.lang.IllegalStateException ( "Use either @GerritConfigs or @GerritConfig not both" ) ; } if ( cfgs != null ) { return com.google.gerrit.acceptance.ConfigAnnotationParser.parse ( cfgs ) ; } else if ( cfg != null ) { return com.google.gerrit.acceptance.ConfigAnnotationParser.parse ( cfg ) ; } else { return null ; } }

Target:
private static org.eclipse.jgit.lib.Config config ( org.junit.runner.Description description ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { org.eclipse.jgit.lib.Config base = com.google.gerrit.acceptance.ConfigAnnotationParser.parseFromSystemProperty ( ) ; com.google.gerrit.acceptance.GerritConfigs cfgs = description.getAnnotation ( com.google.gerrit.acceptance.GerritConfigs.class ) ; com.google.gerrit.acceptance.GerritConfig cfg = description.getAnnotation ( com.google.gerrit.acceptance.GerritConfig.class ) ; if ( ( cfgs != null ) && ( cfg != null ) ) { throw new java.lang.IllegalStateException ( "Use either @GerritConfigs or @GerritConfig not both" ) ; } if ( cfgs != null ) { return com.google.gerrit.acceptance.ConfigAnnotationParser.parse ( base , cfgs ) ; } else if ( cfg != null ) { return com.google.gerrit.acceptance.ConfigAnnotationParser.parse ( base , cfg ) ; } else { return base ; } }
Source:
public int arithCompareTo ( com.googlecode.prolog_cafe.lang.NumberTerm t ) { if ( t.isDouble ( ) ) return - ( t.arithCompareTo ( this ) ) ; int v = t.intValue ( ) ; if ( ( this . val ) == v ) return EQUAL ; if ( ( this . val ) > v ) return AFTER ; return BEFORE ; }

Target:
public int arithCompareTo ( com.googlecode.prolog_cafe.lang.NumberTerm t ) { if ( t instanceof com.googlecode.prolog_cafe.lang.DoubleTerm ) return - ( t.arithCompareTo ( this ) ) ; int v = t.intValue ( ) ; if ( ( this . val ) == v ) return EQUAL ; if ( ( this . val ) > v ) return AFTER ; return BEFORE ; }
Source:
private void updateHead ( org.eclipse.jgit.transport.URIish replicateURI , java.lang.String newHead ) { if ( ! ( replicateURI.isRemote ( ) ) ) { com.googlesource.gerrit.plugins.replication.ReplicationQueue.updateHeadLocally ( replicateURI , newHead ) ; } else if ( com.googlesource.gerrit.plugins.replication.ReplicationQueue.isSSH ( replicateURI ) ) { updateHeadRemoteSsh ( replicateURI , newHead ) ; } else { com.googlesource.gerrit.plugins.replication.ReplicationQueue.repLog.warn ( java.lang.String.format ( ( "Cannot update HEAD of project on remote site %s." + ( " Only local paths and SSH URLs are supported" + " for remote HEAD update." ) ) , replicateURI ) ) ; } }

Target:
private void updateHead ( org.eclipse.jgit.transport.URIish replicateURI , java.lang.String newHead ) { if ( ! ( replicateURI.isRemote ( ) ) ) { com.googlesource.gerrit.plugins.replication.ReplicationQueue.updateHeadLocally ( replicateURI , newHead ) ; } else if ( com.googlesource.gerrit.plugins.replication.ReplicationQueue.isSSH ( replicateURI ) ) { updateHeadRemoteSsh ( replicateURI , newHead ) ; } else { com.googlesource.gerrit.plugins.replication.ReplicationQueue.repLog.warn ( ( "Cannot update HEAD of project on remote site {}." + ( " Only local paths and SSH URLs are supported" + " for remote HEAD update." ) ) , replicateURI ) ; } }
Source:
static final void put ( com.google.gerrit.client.rpc.RestApi api , com.google.gwt.core.client.JavaScriptObject in , com.google.gwt.core.client.JavaScriptObject cb ) { api.put ( in , com.google.gerrit.client.api.ActionContext.wrap ( cb ) ) ; }

Target:
static final void put ( com.google.gerrit.client.rpc.RestApi api , com.google.gwt.core.client.JavaScriptObject in , com.google.gwt.core.client.JavaScriptObject cb ) { if ( com.google.gerrit.client.rpc.NativeString.is ( in ) ) { com.google.gerrit.client.api.ActionContext.put ( api , ( ( com.google.gerrit.client.rpc.NativeString ) ( in ) ) . asString ( ) , cb ) ; } else { api.put ( in , com.google.gerrit.client.api.ActionContext.wrap ( cb ) ) ; } }
Source:
public void abandonWipChange ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageWipChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.ABANDONED_CHANGES ) ; abandon ( sc.changeId , sc.owner ) ; assertThat ( sender ) . sent ( "abandon" , sc ) . notTo ( sc.owner ) . cc ( sc.reviewer , sc.ccer ) . to ( sc.reviewerByEmail ) . cc ( sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ABANDONED_CHANGES ) ; }

Target:
public void abandonWipChangeNotifyAll ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageWipChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.ABANDONED_CHANGES ) ; abandon ( sc.changeId , sc.owner , com.google.gerrit.extensions.api.changes.NotifyHandling.ALL ) ; assertThat ( sender ) . sent ( "abandon" , sc ) . notTo ( sc.owner ) . cc ( sc.reviewer , sc.ccer ) . to ( sc.reviewerByEmail ) . cc ( sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ABANDONED_CHANGES ) ; }
Source:
private static com.google.gerrit.server.query.change.ChangeData change ( java.lang.String ... files ) throws com.google.gwtorm.server.OrmException { java.util.Arrays.sort ( files ) ; com.google.gerrit.server.query.change.ChangeData cd = com.google.gerrit.server.query.change.ChangeData.createForTest ( new com.google.gerrit.reviewdb.client.Change.Id ( 1 ) , 1 ) ; cd.setCurrentFilePaths ( java.util.Arrays.asList ( files ) ) ; return cd ; }

Target:
private static com.google.gerrit.server.query.change.ChangeData change ( java.lang.String ... files ) throws com.google.gwtorm.server.OrmException { java.util.Arrays.sort ( files ) ; com.google.gerrit.server.query.change.ChangeData cd = com.google.gerrit.server.query.change.ChangeData.createForTest ( new com.google.gerrit.reviewdb.client.Project.NameKey ( "project" ) , new com.google.gerrit.reviewdb.client.Change.Id ( 1 ) , 1 ) ; cd.setCurrentFilePaths ( java.util.Arrays.asList ( files ) ) ; return cd ; }
Source:
private com.google.gerrit.common.data.LabelTypes getLabelTypes ( ) throws java.lang.Exception { db.create ( ) ; com.google.gerrit.server.git.ProjectConfig c = new com.google.gerrit.server.git.ProjectConfig ( allProjects ) ; try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( allProjects ) ) { c.load ( repo ) ; return new com.google.gerrit.common.data.LabelTypes ( com.google.common.collect.ImmutableList.copyOf ( c.getLabelSections ( ) . values ( ) ) ) ; } }

Target:
private com.google.gerrit.common.data.LabelTypes getLabelTypes ( ) throws java.lang.Exception { db.create ( ) ; com.google.gerrit.server.project.ProjectConfig c = new com.google.gerrit.server.project.ProjectConfig ( allProjects ) ; try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( allProjects ) ) { c.load ( repo ) ; return new com.google.gerrit.common.data.LabelTypes ( com.google.common.collect.ImmutableList.copyOf ( c.getLabelSections ( ) . values ( ) ) ) ; } }
Source:
private void doEnterAgreement ( ) { Util.ACCOUNT_SEC.enterAgreement ( current.getName ( ) , new com.google.gerrit.client.rpc.GerritCallback < com.google.gwtjsonrpc.common.VoidResult > ( ) { @ java.lang.Override public void onSuccess ( final com.google.gwtjsonrpc.common.VoidResult result ) { com.google.gerrit.client.Gerrit.display ( nextToken ) ; } @ java.lang.Override public void onFailure ( final java.lang.Throwable caught ) { yesIAgreeBox.setText ( "" ) ; super . onFailure ( caught ) ; } } ) ; }

Target:
private void doEnterAgreement ( ) { com.google.gerrit.client.account.AccountApi.enterAgreement ( "self" , current.getName ( ) , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.rpc.NativeString > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.rpc.NativeString result ) { com.google.gerrit.client.Gerrit.display ( nextToken ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { yesIAgreeBox.setText ( "" ) ; super . onFailure ( caught ) ; } } ) ; }
Source:
public java.lang.Object apply ( com.google.gerrit.server.group.MemberResource resource , com.google.gerrit.server.group.DeleteMembers.DeleteMember.Input input ) throws com.google.gerrit.common.errors.NoSuchGroupException , com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.BadRequestException , com.google.gerrit.extensions.restapi.MethodNotAllowedException , com.google.gwtorm.server.OrmException { com.google.gerrit.server.group.AddMembers.Input in = new com.google.gerrit.server.group.AddMembers.Input ( ) ; in._oneMember = resource.getUser ( ) . getAccountId ( ) . toString ( ) ; return delete.get ( ) . apply ( resource.getGroup ( ) , in ) ; }

Target:
public java.lang.Object apply ( com.google.gerrit.server.group.MemberResource resource , com.google.gerrit.server.group.DeleteMembers.DeleteMember.Input input ) throws com.google.gerrit.common.errors.NoSuchGroupException , com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.BadRequestException , com.google.gerrit.extensions.restapi.MethodNotAllowedException , com.google.gwtorm.server.OrmException { com.google.gerrit.server.group.AddMembers.Input in = new com.google.gerrit.server.group.AddMembers.Input ( ) ; in._oneMember = resource.getMember ( ) . getAccountId ( ) . toString ( ) ; return delete.get ( ) . apply ( resource , in ) ; }
Source:
private static void assertRef ( int changeId , int psId , java.lang.String refName ) { com.google.common.truth.Truth.assertThat ( com.google.gerrit.reviewdb.client.PatchSet.isRef ( refName ) ) . isTrue ( ) ; com.google.common.truth.Truth.assertThat ( PatchSet.Id.fromRef ( refName ) ) . isEqualTo ( new com.google.gerrit.reviewdb.client.PatchSet.Id ( new com.google.gerrit.reviewdb.client.Change.Id ( changeId ) , psId ) ) ; }

Target:
private static void assertRef ( int changeId , int psId , java.lang.String refName ) { com.google.common.truth.Truth.assertThat ( com.google.gerrit.reviewdb.client.PatchSet.isChangeRef ( refName ) ) . isTrue ( ) ; com.google.common.truth.Truth.assertThat ( PatchSet.Id.fromRef ( refName ) ) . isEqualTo ( new com.google.gerrit.reviewdb.client.PatchSet.Id ( new com.google.gerrit.reviewdb.client.Change.Id ( changeId ) , psId ) ) ; }
Source:
public void run ( ) { if ( ! ( cm.isClean ( generation ) ) ) { java.lang.String text = cm.getValue ( ) ; final int g = cm.changeGeneration ( false ) ; com.google.gerrit.client.changes.ChangeEditApi.put ( revision.getParentKey ( ) . get ( ) , path , text , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.VoidResult > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.VoidResult result ) { generation = g ; setClean ( cm.isClean ( g ) ) ; } } ) ; } }

Target:
public void onFailure ( final java.lang.Throwable caught ) { close.setEnabled ( true ) ; }
Source:
private static void pushForReview ( org.eclipse.jgit.junit.TestRepository < ? > testRepo , com.google.gerrit.acceptance.git.RemoteRefUpdate.Status expectedStatus , java.lang.String expectedMessage ) throws org.eclipse.jgit.api.errors.GitAPIException { java.lang.String ref = "refs/for/master" ; org.eclipse.jgit.transport.PushResult r = com.google.gerrit.acceptance.GitUtil.pushHead ( testRepo , ref ) ; com.google.gerrit.acceptance.git.RemoteRefUpdate refUpdate = r.getRemoteUpdate ( ref ) ; com.google.common.truth.Truth.assertThat ( refUpdate.getStatus ( ) ) . isEqualTo ( expectedStatus ) ; if ( expectedMessage != null ) { com.google.common.truth.Truth.assertThat ( refUpdate.getMessage ( ) ) . contains ( expectedMessage ) ; } }

Target:
private static void pushForReview ( org.eclipse.jgit.junit.TestRepository < ? > testRepo , org.eclipse.jgit.transport.RemoteRefUpdate.Status expectedStatus , java.lang.String expectedMessage ) throws org.eclipse.jgit.api.errors.GitAPIException { java.lang.String ref = "refs/for/master" ; org.eclipse.jgit.transport.PushResult r = com.google.gerrit.acceptance.GitUtil.pushHead ( testRepo , ref ) ; org.eclipse.jgit.transport.RemoteRefUpdate refUpdate = r.getRemoteUpdate ( ref ) ; com.google.common.truth.Truth.assertThat ( refUpdate.getStatus ( ) ) . isEqualTo ( expectedStatus ) ; if ( expectedMessage != null ) { com.google.common.truth.Truth.assertThat ( refUpdate.getMessage ( ) ) . contains ( expectedMessage ) ; } }
Source:
private void assertBranchesDeleted ( ) throws java.lang.Exception { assertBranches ( com.google.common.collect.ImmutableList.< java.lang.String > of ( ) ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { allow ( "refs/*" , Permission.CREATE , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS ) ; allow ( "refs/*" , Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS ) ; for ( java.lang.String name : com.google.gerrit.acceptance.rest.project.DeleteBranchesIT.BRANCHES ) { project ( ) . branch ( name ) . create ( new com.google.gerrit.extensions.api.projects.BranchInput ( ) ) ; } assertBranches ( com.google.gerrit.acceptance.rest.project.DeleteBranchesIT.BRANCHES ) ; }
Source:
public void testQuote2 ( ) { java.lang.String comment = "See this said:\n\n > a quoted\n > string block\n\nOK?" ; java.util.List < com.google.gerrit.server.mail.send.CommentFormatter.Block > result = com.google.gerrit.server.mail.send.CommentFormatter.parse ( comment ) ; com.google.common.truth.Truth.assertThat ( result ) . hasSize ( 3 ) ; assertBlock ( result , 0 , BlockType.PARAGRAPH , "See this said:" ) ; assertBlock ( result , 1 , BlockType.QUOTE , "a quoted\nstring block" ) ; assertBlock ( result , 2 , BlockType.PARAGRAPH , "OK?" ) ; }

Target:
public void testQuote1 ( ) { java.lang.String comment = "> I\'m happy\n > with quotes!\n\nSee above." ; java.util.List < com.google.gerrit.server.mail.send.CommentFormatter.Block > result = com.google.gerrit.server.mail.send.CommentFormatter.parse ( comment ) ; com.google.common.truth.Truth.assertThat ( result ) . hasSize ( 2 ) ; assertQuoteBlock ( result , 0 , 1 ) ; assertBlock ( result.get ( 0 ) . quotedBlocks , 0 , BlockType.PARAGRAPH , "I\'m happy\nwith quotes!" ) ; assertBlock ( result , 1 , BlockType.PARAGRAPH , "See above." ) ; }
Source:
public void testGetUrlIsDroppingTrailingSlash ( ) throws java.lang.Exception { org.mockito.Mockito.when ( configMock.getString ( com.ericsson.gerrit.plugins.highavailability.Configuration.PEER_INFO_SECTION , null , com.ericsson.gerrit.plugins.highavailability.Configuration.URL_KEY ) ) . thenReturn ( ( ( com.ericsson.gerrit.plugins.highavailability.ConfigurationTest.URL ) + "/" ) ) ; initializeConfiguration ( ) ; com.google.common.truth.Truth.assertThat ( configuration ) . isNotNull ( ) ; com.google.common.truth.Truth.assertThat ( configuration.peerInfo ( ) . url ( ) ) . isEqualTo ( com.ericsson.gerrit.plugins.highavailability.ConfigurationTest.URL ) ; }

Target:
public void testGetUrlIsDroppingTrailingSlash ( ) throws java.lang.Exception { org.mockito.Mockito.when ( configMock.getString ( com.ericsson.gerrit.plugins.highavailability.Configuration.PEER_INFO_SECTION , com.ericsson.gerrit.plugins.highavailability.Configuration.STATIC_SUBSECTION , com.ericsson.gerrit.plugins.highavailability.Configuration.URL_KEY ) ) . thenReturn ( ( ( com.ericsson.gerrit.plugins.highavailability.ConfigurationTest.URL ) + "/" ) ) ; initializeConfiguration ( ) ; com.google.common.truth.Truth.assertThat ( configuration ) . isNotNull ( ) ; com.google.common.truth.Truth.assertThat ( configuration.peerInfoStatic ( ) . url ( ) ) . isEqualTo ( com.ericsson.gerrit.plugins.highavailability.ConfigurationTest.URL ) ; }
Source:
public static void checkRequiresCapability ( com.google.inject.Provider < com.google.gerrit.server.CurrentUser > userProvider , java.lang.String pluginName , java.lang.Class < ? > clazz ) throws com.google.gerrit.extensions.restapi.AuthException { com.google.gerrit.extensions.annotations.RequiresCapability rc = com.google.gerrit.server.account.CapabilityUtils.getClassAnnotation ( clazz , com.google.gerrit.extensions.annotations.RequiresCapability.class ) ; com.google.gerrit.extensions.annotations.RequiresAnyCapability rac = com.google.gerrit.server.account.CapabilityUtils.getClassAnnotation ( clazz , com.google.gerrit.extensions.annotations.RequiresAnyCapability.class ) ; if ( ( rc != null ) && ( rac != null ) ) { com.google.gerrit.server.account.CapabilityUtils.log.error ( java.lang.String.format ( "Class %s uses both @%s and @%s" , clazz.getName ( ) , com.google.gerrit.extensions.annotations.RequiresCapability.class . getSimpleName ( ) , com.google.gerrit.extensions.annotations.RequiresAnyCapability.class . getSimpleName ( ) ) ) ; throw new com.google.gerrit.extensions.restapi.AuthException ( "cannot check capability" ) ; } com.google.gerrit.server.CurrentUser user = userProvider.get ( ) ; com.google.gerrit.server.account.CapabilityControl ctl = user.getCapabilities ( ) ; if ( ctl.canAdministrateServer ( ) ) { return ; } com.google.gerrit.server.account.CapabilityUtils.checkRequiresCapability ( ctl , pluginName , clazz , rc ) ; com.google.gerrit.server.account.CapabilityUtils.checkRequiresAnyCapability ( ctl , pluginName , clazz , rac ) ; }

Target:
public static void checkRequiresCapability ( com.google.inject.Provider < com.google.gerrit.server.CurrentUser > userProvider , java.lang.String pluginName , java.lang.Class < ? > clazz ) throws com.google.gerrit.extensions.restapi.AuthException { com.google.gerrit.server.account.CapabilityUtils.checkRequiresCapability ( userProvider.get ( ) , pluginName , clazz ) ; }
Source:
private java.lang.String url ( com.google.gerrit.client.info.FileInfo info ) { return info.binary ( ) ? com.google.gerrit.client.Dispatcher.toUnified ( base , curr , info.path ( ) ) : ( mode ) == ( com.google.gerrit.client.change.FileTable.Mode.REVIEW ) ? com.google.gerrit.client.Dispatcher.toSideBySide ( base , curr , info.path ( ) ) : com.google.gerrit.client.Dispatcher.toEditScreen ( curr , info.path ( ) ) ; }

Target:
private java.lang.String url ( com.google.gerrit.client.info.FileInfo info ) { return info.binary ( ) ? com.google.gerrit.client.Dispatcher.toUnified ( base , curr , info.path ( ) ) : ( mode ) == ( com.google.gerrit.client.change.FileTable.Mode.REVIEW ) ? com.google.gerrit.client.Dispatcher.toPatch ( base , curr , info.path ( ) ) : com.google.gerrit.client.Dispatcher.toEditScreen ( curr , info.path ( ) ) ; }
Source:
void onMatchBrackets ( com.google.gwt.event.logical.shared.ValueChangeEvent < java.lang.Boolean > e ) { prefs.matchBrackets ( e.getValue ( ) ) ; view.getCmFromSide ( DisplaySide.A ) . setOption ( "matchBrackets" , prefs.matchBrackets ( ) ) ; view.getCmFromSide ( DisplaySide.B ) . setOption ( "matchBrackets" , prefs.matchBrackets ( ) ) ; }

Target:
void onRenderEntireFile ( com.google.gwt.event.logical.shared.ValueChangeEvent < java.lang.Boolean > e ) { prefs.renderEntireFile ( e.getValue ( ) ) ; if ( ( view ) != null ) { view.updateRenderEntireFile ( ) ; } }
Source:
public void setSubject ( java.lang.String subject ) { this . subject = subject ; }

Target:
public void setCurrentPatchSet ( com.google.gerrit.reviewdb.client.PatchSet.Id psId , java.lang.String subject , java.lang.String originalSubject ) { if ( ! ( psId.getParentKey ( ) . equals ( changeId ) ) ) { throw new java.lang.IllegalArgumentException ( ( ( ( "patch set ID " + psId ) + " is not for change " ) + ( changeId ) ) ) ; } currentPatchSetId = psId.get ( ) ; this . subject = subject ; this . originalSubject = originalSubject ; }
Source:
public void delete ( com.google.gerrit.reviewdb.client.Project project ) throws java.lang.Exception { java.sql.Connection conn = ( ( com.google.gwtorm.jdbc.JdbcSchema ) ( db ) ) . getConnection ( ) ; conn.setAutoCommit ( false ) ; try { atomicDelete ( project ) ; conn.commit ( ) ; } catch ( java.lang.Exception e ) { conn.rollback ( ) ; throw e ; } finally { conn.setAutoCommit ( true ) ; } }

Target:
public void delete ( com.google.gerrit.reviewdb.client.Project project ) throws com.google.gwtorm.server.OrmException { java.sql.Connection conn = ( ( com.google.gwtorm.jdbc.JdbcSchema ) ( db ) ) . getConnection ( ) ; try { conn.setAutoCommit ( false ) ; try { atomicDelete ( project ) ; conn.commit ( ) ; } finally { conn.setAutoCommit ( true ) ; } } catch ( java.sql.SQLException e ) { try { conn.rollback ( ) ; } catch ( java.sql.SQLException ex ) { throw new com.google.gwtorm.server.OrmException ( ex ) ; } throw new com.google.gwtorm.server.OrmException ( e ) ; } }
Source:
public com.google.gerrit.extensions.client.EditPreferencesInfo apply ( com.google.gerrit.server.config.ConfigResource configResource , com.google.gerrit.extensions.client.EditPreferencesInfo input ) throws com.google.gerrit.extensions.restapi.BadRequestException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { if ( input == null ) { throw new com.google.gerrit.extensions.restapi.BadRequestException ( "input must be provided" ) ; } if ( ! ( com.google.gerrit.server.restapi.config.SetEditPreferences.hasSetFields ( input ) ) ) { throw new com.google.gerrit.extensions.restapi.BadRequestException ( "unsupported option" ) ; } try ( com.google.gerrit.server.git.MetaDataUpdate md = metaDataUpdateFactory.get ( ) . create ( allUsersName ) ) { com.google.gerrit.extensions.client.EditPreferencesInfo updatedPrefs = com.google.gerrit.server.account.Preferences.updateDefaultEditPreferences ( md , input ) ; accountCache.evictAll ( ) ; return updatedPrefs ; } }

Target:
public com.google.gerrit.extensions.client.EditPreferencesInfo apply ( com.google.gerrit.server.config.ConfigResource configResource , com.google.gerrit.extensions.client.EditPreferencesInfo input ) throws com.google.gerrit.extensions.restapi.BadRequestException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { if ( input == null ) { throw new com.google.gerrit.extensions.restapi.BadRequestException ( "input must be provided" ) ; } if ( ! ( com.google.gerrit.server.restapi.config.SetEditPreferences.hasSetFields ( input ) ) ) { throw new com.google.gerrit.extensions.restapi.BadRequestException ( "unsupported option" ) ; } try ( com.google.gerrit.server.git.meta.MetaDataUpdate md = metaDataUpdateFactory.get ( ) . create ( allUsersName ) ) { com.google.gerrit.extensions.client.EditPreferencesInfo updatedPrefs = com.google.gerrit.server.account.Preferences.updateDefaultEditPreferences ( md , input ) ; accountCache.evictAll ( ) ; return updatedPrefs ; } }
Source:
public void testMultipleSlashes ( ) throws java.lang.Exception { assertEquals ( Type.HOST_INDEX , getView ( "//" ) . getType ( ) ) ; assertEquals ( Type.REPOSITORY_INDEX , getView ( "//repo" ) . getType ( ) ) ; assertEquals ( Type.REPOSITORY_INDEX , getView ( "//repo//" ) . getType ( ) ) ; assertNull ( getView ( "/repo/+//master" ) ) ; assertNull ( getView ( "/repo/+/refs//heads//master" ) ) ; assertNull ( getView ( "/repo/+//master//" ) ) ; assertNull ( getView ( "/repo/+//master/foo//bar" ) ) ; }

Target:
public void testMultipleSlashes ( ) throws java.lang.Exception { repo.branch ( "refs/heads/master" ) . commit ( ) . create ( ) ; assertEquals ( Type.HOST_INDEX , getView ( "//" ) . getType ( ) ) ; assertEquals ( Type.REPOSITORY_INDEX , getView ( "//repo" ) . getType ( ) ) ; assertEquals ( Type.REPOSITORY_INDEX , getView ( "//repo//" ) . getType ( ) ) ; assertNull ( getView ( "/repo/+//master" ) ) ; assertNull ( getView ( "/repo/+/refs//heads//master" ) ) ; assertNull ( getView ( "/repo/+//master//" ) ) ; assertNull ( getView ( "/repo/+//master/foo//bar" ) ) ; }
Source:
public com.google.gerrit.server.change.Description getDescription ( com.google.gerrit.server.change.ChangeResource rsrc ) { return new com.google.gerrit.server.change.Description ( ) . setLabel ( "Start Review" ) . setTitle ( "Set Ready For Review" ) . setVisible ( ( ( ( rsrc.isUserOwner ( ) ) && ( ( rsrc.getChange ( ) . getStatus ( ) ) == ( com.google.gerrit.reviewdb.client.Change.Status.NEW ) ) ) && ( rsrc.getChange ( ) . isWorkInProgress ( ) ) ) ) ; }

Target:
public com.google.gerrit.server.change.Description getDescription ( com.google.gerrit.server.change.ChangeResource rsrc ) { return new com.google.gerrit.server.change.Description ( ) . setLabel ( "Start Review" ) . setTitle ( "Set Ready For Review" ) . setVisible ( com.google.gerrit.extensions.conditions.BooleanCondition.and ( ( ( ( rsrc.getChange ( ) . getStatus ( ) ) == ( com.google.gerrit.reviewdb.client.Change.Status.NEW ) ) && ( rsrc.getChange ( ) . isWorkInProgress ( ) ) ) , com.google.gerrit.extensions.conditions.BooleanCondition.or ( rsrc.isUserOwner ( ) , permissionBackend.user ( self ) . testCond ( GlobalPermission.ADMINISTRATE_SERVER ) ) ) ) ; }
Source:
public void testQuote2 ( ) { final com.google.gwtexpui.safehtml.client.SafeHtml o = com.google.gwtexpui.safehtml.client.SafeHtml_WikifyQuoteTest.html ( "See this said:\n\n > a quoted\n > string block\n\nOK?" ) ; final com.google.gwtexpui.safehtml.client.SafeHtml n = o.wikify ( ) ; org.junit.Assert.assertNotSame ( o , n ) ; org.junit.Assert.assertEquals ( ( ( "<p>See this said:</p>" + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyQuoteTest.quote ( "a quoted\nstring block" ) ) ) + "<p>OK?</p>" ) , n.asString ( ) ) ; }

Target:
public void testQuote2 ( ) { final com.google.gwtexpui.safehtml.client.SafeHtml o = com.google.gwtexpui.safehtml.client.SafeHtml_WikifyQuoteTest.html ( "See this said:\n\n > a quoted\n > string block\n\nOK?" ) ; final com.google.gwtexpui.safehtml.client.SafeHtml n = o.wikify ( ) ; com.google.common.truth.Truth.assertThat ( o ) . isNotSameAs ( n ) ; com.google.common.truth.Truth.assertThat ( n.asString ( ) ) . isEqualTo ( ( ( "<p>See this said:</p>" + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyQuoteTest.quote ( "a quoted\nstring block" ) ) ) + "<p>OK?</p>" ) ) ; }
Source:
public java.util.Set < com.google.gerrit.client.reviewdb.AccountGroup.Id > getGroups ( final com.google.gerrit.client.reviewdb.Account.Id id ) { java.util.Set < com.google.gerrit.client.reviewdb.AccountGroup.Id > g = groupCache.get ( id ) ; if ( g == null ) { g = com.google.gerrit.client.rpc.Common.getGroupCache ( ) . getEffectiveGroups ( id ) ; groupCache.put ( id , g ) ; } return g ; }

Target:
public java.util.Set < com.google.gerrit.client.reviewdb.AccountGroup.Id > getGroups ( final com.google.gerrit.client.reviewdb.Account.Id id ) { java.util.Set < com.google.gerrit.client.reviewdb.AccountGroup.Id > g = groupCache.get ( id ) ; if ( g == null ) { g = accountCache.get ( id ) . getEffectiveGroups ( ) ; groupCache.put ( id , g ) ; } return g ; }
Source:
public void fire ( com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.reviewdb.client.Account.Id accountId , com.google.common.collect.ImmutableSortedSet < java.lang.String > updatedHashtags , java.util.Set < java.lang.String > toAdd , java.util.Set < java.lang.String > toRemove ) { if ( ! ( listeners.iterator ( ) . hasNext ( ) ) ) { return ; } try { fire ( util.changeInfo ( change ) , util.accountInfo ( accountId ) , updatedHashtags , toAdd , toRemove ) ; } catch ( com.google.gwtorm.server.OrmException e ) { com.google.gerrit.server.extensions.events.HashtagsEdited.log.error ( "Couldn't fire event" , e ) ; } }

Target:
public void fire ( com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.reviewdb.client.Account.Id accountId , com.google.common.collect.ImmutableSortedSet < java.lang.String > hashtags , java.util.Set < java.lang.String > added , java.util.Set < java.lang.String > removed , java.sql.Timestamp when ) { if ( ! ( listeners.iterator ( ) . hasNext ( ) ) ) { return ; } try { fire ( util.changeInfo ( change ) , util.accountInfo ( accountId ) , hashtags , added , removed , when ) ; } catch ( com.google.gwtorm.server.OrmException e ) { com.google.gerrit.server.extensions.events.HashtagsEdited.log.error ( "Couldn't fire event" , e ) ; } }