auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testNestedQuotes1 ( ) { java.lang.String comment = " > > prior\n > \n > next\n" ; 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 ( 1 ) ; assertBlock ( result , 0 , BlockType.QUOTE , "> prior\n\nnext" ) ; }

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:
private void preMerge ( final com.google.gerrit.server.git.strategy.SubmitStrategy strategy , final java.util.List < com.google.gerrit.server.git.CodeReviewCommit > toMerge ) throws com.google.gerrit.server.git.MergeException { mergeTip = strategy.run ( branchTip , toMerge ) ; refLogIdent = strategy.getRefLogIdent ( ) ; commits.putAll ( strategy.getNewCommits ( ) ) ; }

Target:
private void preMerge ( com.google.gerrit.server.git.strategy.SubmitStrategy strategy , java.util.List < com.google.gerrit.server.git.CodeReviewCommit > toMerge ) throws com.google.gerrit.server.git.MergeException { logDebug ( "Running submit strategy for commits" , strategy.getClass ( ) . getSimpleName ( ) , toMerge.size ( ) ) ; mergeTip = strategy.run ( branchTip , toMerge ) ; refLogIdent = strategy.getRefLogIdent ( ) ; logDebug ( "Produced new commits" , strategy.getNewCommits ( ) . size ( ) ) ; commits.putAll ( strategy.getNewCommits ( ) ) ; }
Source:
protected void run ( ) throws com.google.gerrit.sshd.commands.Failure { try { performRenameGroupFactory.create ( ) . renameGroup ( groupName , newGroupName ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw die ( e ) ; } catch ( com.google.gerrit.common.errors.NameAlreadyUsedException e ) { throw die ( e ) ; } catch ( com.google.gerrit.common.errors.NoSuchGroupException e ) { throw die ( e ) ; } }

Target:
protected void run ( ) throws com.google.gerrit.sshd.commands.Failure { try { performRenameGroupFactory.create ( ) . renameGroup ( groupName , newGroupName ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw die ( e ) ; } catch ( com.google.gerrit.common.errors.InvalidNameException e ) { throw die ( e ) ; } catch ( com.google.gerrit.common.errors.NameAlreadyUsedException e ) { throw die ( e ) ; } catch ( com.google.gerrit.common.errors.NoSuchGroupException e ) { throw die ( e ) ; } }
Source:
public void storeLocalOffline ( ) throws java.lang.Exception { setUpClientMock ( ) ; org.mockito.Mockito.doThrow ( new java.sql.SQLException ( new java.net.ConnectException ( ) ) ) . when ( eventsDb ) . createDBIfNotCreated ( ) ; org.mockito.Mockito.doThrow ( new java.sql.SQLException ( ) ) . when ( eventsDb ) . queryOne ( ) ; }

Target:
public void storeLocalOffline ( ) throws java.lang.Exception { setUpClientMock ( ) ; org.mockito.Mockito.doThrow ( new java.sql.SQLException ( new java.net.ConnectException ( ) ) ) . when ( eventsDb ) . createDBIfNotCreated ( ) ; org.mockito.Mockito.doThrow ( new java.sql.SQLException ( ) ) . when ( eventsDb ) . queryOne ( ) ; store = new com.ericsson.gerrit.plugins.eventslog.sql.SQLStore ( userProviderMock , cfgMock , eventsDb , localEventsDb , poolMock , permissionBackendMock ) ; store.start ( ) ; store.storeEvent ( mockEvent ) ; org.mockito.Mockito.verify ( localEventsDb ) . storeEvent ( mockEvent ) ; }
Source:
public static synchronized void setClockStep ( long clockStep , java.util.concurrent.TimeUnit clockStepUnit ) { com.google.common.base.Preconditions.checkState ( ( ( com.google.gerrit.testutil.TestTimeUtil.clockMs ) != null ) , "call resetWithClockStep first" ) ; com.google.gerrit.testutil.TestTimeUtil.clockStepMs = java.util.concurrent.TimeUnit.MILLISECONDS.convert ( clockStep , clockStepUnit ) ; HEAD ( ( 6899000.0 - 2.14 ) ) ; org.joda.time.DateTimeUtils.setCurrentMillisProvider ( new org.joda.time.DateTimeUtils.MillisProvider ( ) { @ java.lang.Override public long getMillis ( ) { return com.google.gerrit.testutil.TestTimeUtil.clockMs.getAndAdd ( com.google.gerrit.testutil.TestTimeUtil.clockStepMs ) ; } } ) ; }

Target:
public java.lang.String getenv ( java.lang.String variable ) { return defaultReader.getenv ( variable ) ; }
Source:
public void testIsEnabledRefParentNoBranchEnforced ( ) { java.lang.String [ ] branches = new java.lang.String [ ] { } ; setupIsEnabled ( "false" , "enforced" , branches ) ; com.googlesource.gerrit.plugins.its.base.its.ItsConfig itsConfig = createItsConfig ( ) ; replayMocks ( ) ; assertTrue ( itsConfig.isEnabled ( "testProject" , "refs/heads/testBranch" ) ) ; }

Target:
public void testIsEnabledRefParentNoBranchEnforced ( ) { java.lang.String [ ] branches = new java.lang.String [ ] { } ; setupIsEnabled ( "false" , "enforced" , branches ) ; com.googlesource.gerrit.plugins.its.base.its.ItsConfig itsConfig = createItsConfig ( ) ; replayMocks ( ) ; com.google.gerrit.reviewdb.client.Project.NameKey projectNK = new com.google.gerrit.reviewdb.client.Project.NameKey ( "testProject" ) ; assertTrue ( itsConfig.isEnabled ( projectNK , "refs/heads/testBranch" ) ) ; }
Source:
public com.google.gerrit.extensions.client.EditPreferencesInfo apply ( com.google.gerrit.server.account.AccountResource rsrc ) throws com.google.gerrit.extensions.restapi.AuthException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { if ( ( ( self.get ( ) ) != ( rsrc.getUser ( ) ) ) && ( ! ( self.get ( ) . getCapabilities ( ) . canModifyAccount ( ) ) ) ) { throw new com.google.gerrit.extensions.restapi.AuthException ( "requires Modify Account capability" ) ; } return com.google.gerrit.server.account.GetEditPreferences.readFromGit ( rsrc.getUser ( ) . getAccountId ( ) , gitMgr , allUsersName , null ) ; }

Target:
public com.google.gerrit.extensions.client.EditPreferencesInfo apply ( com.google.gerrit.server.account.AccountResource rsrc ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.server.permissions.PermissionBackendException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { if ( ( self.get ( ) ) != ( rsrc.getUser ( ) ) ) { permissionBackend.user ( self ) . check ( GlobalPermission.MODIFY_ACCOUNT ) ; } return com.google.gerrit.server.account.GetEditPreferences.readFromGit ( rsrc.getUser ( ) . getAccountId ( ) , gitMgr , allUsersName , null ) ; }
Source:
public com.google.gerrit.common.data.ChangeDetail call ( ) throws com.google.gerrit.common.errors.NoSuchEntityException , com.google.gerrit.server.patch.PatchSetInfoNotAvailableException , com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.client.OrmException , java.lang.IllegalStateException { final com.google.gerrit.reviewdb.Change.Id changeId = patchSetId.getParentKey ( ) ; final com.google.gerrit.server.project.ChangeControl changeControl = changeControlFactory.validateFor ( changeId ) ; if ( ( ! ( changeControl.isOwner ( ) ) ) && ( ! ( changeControl.isVisible ( db ) ) ) ) { throw new java.lang.IllegalStateException ( "Cannot publish patchset" ) ; } com.google.gerrit.server.ChangeUtil.publishDraftPatchSet ( db , patchSetId ) ; return changeDetailFactory.create ( changeId ) . call ( ) ; }

Target:
public com.google.gerrit.common.data.ChangeDetail call ( ) throws com.google.gerrit.common.errors.NoSuchEntityException , com.google.gerrit.server.patch.PatchSetInfoNotAvailableException , com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.client.OrmException , java.lang.IllegalStateException { final com.google.gerrit.reviewdb.Change.Id changeId = patchSetId.getParentKey ( ) ; final com.google.gerrit.server.project.ChangeControl changeControl = changeControlFactory.validateFor ( changeId ) ; if ( ! ( changeControl.canPublish ( db ) ) ) { throw new java.lang.IllegalStateException ( "Cannot publish patchset" ) ; } com.google.gerrit.server.ChangeUtil.publishDraftPatchSet ( db , patchSetId ) ; return changeDetailFactory.create ( changeId ) . call ( ) ; }
Source:
public com.google.gerrit.server.notedb.ChangeNotes createFromIdOnlyWhenNoteDbDisabled ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Change.Id changeId ) throws com.google.gwtorm.server.OrmException { com.google.common.base.Preconditions.checkState ( ( ! ( args.migration.readChanges ( ) ) ) , ( "do not call" + " createFromIdOnlyWhenNoteDbDisabled when NoteDb is enabled" ) ) ; com.google.gerrit.reviewdb.client.Change change = com.google.gerrit.reviewdb.server.ReviewDbUtil.unwrapDb ( db ) . changes ( ) . get ( changeId ) ; com.google.common.base.Preconditions.checkNotNull ( change , "change %s not found in ReviewDb" , changeId ) ; return new com.google.gerrit.server.notedb.ChangeNotes ( args , change ) . load ( ) ; }

Target:
public static com.google.gerrit.reviewdb.client.Change readOneReviewDbChange ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Change.Id id ) throws com.google.gwtorm.server.OrmException { return com.google.gerrit.reviewdb.server.ReviewDbUtil.unwrapDb ( db ) . changes ( ) . get ( id ) ; }
Source:
private com.google.gerrit.reviewdb.client.ChangeMessage buildChangeMessage ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Change dest , com.google.gerrit.reviewdb.client.PatchSet newPatchSet , com.google.gerrit.reviewdb.client.Account.Id pullRequestAuthorId , java.lang.String pullRequestMessage ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.ChangeMessage cmsg = new com.google.gerrit.reviewdb.client.ChangeMessage ( new com.google.gerrit.reviewdb.client.ChangeMessage.Key ( dest.getId ( ) , com.google.gerrit.server.ChangeUtil.messageUUID ( db ) ) , pullRequestAuthorId , com.google.gerrit.server.util.TimeUtil.nowTs ( ) , newPatchSet.getId ( ) ) ; cmsg.setMessage ( pullRequestMessage ) ; return cmsg ; }

Target:
private com.google.gerrit.reviewdb.client.ChangeMessage buildChangeMessage ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Change dest , com.google.gerrit.reviewdb.client.PatchSet newPatchSet , com.google.gerrit.reviewdb.client.Account.Id pullRequestAuthorId , java.lang.String pullRequestMessage ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.ChangeMessage cmsg = new com.google.gerrit.reviewdb.client.ChangeMessage ( new com.google.gerrit.reviewdb.client.ChangeMessage.Key ( dest.getId ( ) , com.google.gerrit.server.ChangeUtil.messageUUID ( db ) ) , pullRequestAuthorId , com.google.gerrit.common.TimeUtil.nowTs ( ) , newPatchSet.getId ( ) ) ; cmsg.setMessage ( pullRequestMessage ) ; return cmsg ; }
Source:
private java.nio.file.Path getReplicationStatusPath ( java.lang.String key ) throws java.io.IOException { java.lang.String sanitizedKey = key.replace ( "." , "_" ) . replace ( " " , "_" ) ; java.nio.file.Path projectPath = pluginData.resolve ( ( sanitizedKey + ".replication-error.json" ) ) ; java.nio.file.Files.createDirectories ( projectPath.getParent ( ) ) ; return projectPath ; }

Target:
private java.lang.String getSanitizedKey ( java.lang.String key ) { java.lang.String sanitizedKey = key.replace ( "." , "_" ) . replace ( " " , "_" ) ; return sanitizedKey ; }
Source:
void set ( com.google.gerrit.client.info.ChangeInfo info ) { this . changeId = info.legacyId ( ) ; this . canEdit = ( info.hasActions ( ) ) && ( info.actions ( ) . containsKey ( "assignee" ) ) ; setAssignee ( info.assignee ( ) ) ; assigneeSuggestOracle.setChange ( changeId ) ; editAssigneeIcon.setVisible ( canEdit ) ; }

Target:
void set ( com.google.gerrit.client.info.ChangeInfo info ) { this . changeId = info.legacyId ( ) ; this . canEdit = ( info.hasActions ( ) ) && ( info.actions ( ) . containsKey ( "assignee" ) ) ; setAssignee ( info.assignee ( ) ) ; assigneeSuggestOracle.setChange ( changeId ) ; editAssigneeIcon.setVisible ( canEdit ) ; if ( ! ( canEdit ) ) { show.setTitle ( null ) ; } }
Source:
public com.google.gerrit.extensions.restapi.Response < java.lang.String > apply ( com.google.gerrit.server.account.AccountResource rsrc , com.google.gerrit.server.account.PutName.Input input ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.MethodNotAllowedException , com.google.gerrit.extensions.restapi.ResourceNotFoundException , com.google.gwtorm.server.OrmException { if ( ( ( self.get ( ) ) != ( rsrc.getUser ( ) ) ) && ( ! ( self.get ( ) . getCapabilities ( ) . canAdministrateServer ( ) ) ) ) { throw new com.google.gerrit.extensions.restapi.AuthException ( "not allowed to change name" ) ; } return apply ( rsrc.getUser ( ) , input ) ; }

Target:
public com.google.gerrit.extensions.restapi.Response < java.lang.String > apply ( com.google.gerrit.server.account.AccountResource rsrc , com.google.gerrit.server.account.PutName.Input input ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.MethodNotAllowedException , com.google.gerrit.extensions.restapi.ResourceNotFoundException , com.google.gwtorm.server.OrmException { if ( ( ( self.get ( ) ) != ( rsrc.getUser ( ) ) ) && ( ! ( self.get ( ) . getCapabilities ( ) . canModifyAccount ( ) ) ) ) { throw new com.google.gerrit.extensions.restapi.AuthException ( "not allowed to change name" ) ; } return apply ( rsrc.getUser ( ) , input ) ; }
Source:
public void onSuccess ( final com.google.gerrit.client.projects.ProjectMap result ) { if ( ( ( mySubname == null ) && ( ( subname ) == null ) ) || ( ( mySubname != null ) && ( mySubname.equals ( subname ) ) ) ) { display ( result ) ; } }

Target:
public void onSuccess ( final com.google.gerrit.client.projects.ProjectMap result ) { projectsTab.display ( result , subname ) ; if ( firstPopupLoad ) { firstPopupLoad = false ; displayPopup ( ) ; } }
Source:
public void testTokenSerializationDeserialization ( ) throws java.lang.Exception { com.googlesource.gerrit.plugins.lfs.LfsAuthTokenTest.TestTokenProessor processor = new com.googlesource.gerrit.plugins.lfs.LfsAuthTokenTest.TestTokenProessor ( cipher ) ; com.googlesource.gerrit.plugins.lfs.LfsAuthTokenTest.TestToken token = new com.googlesource.gerrit.plugins.lfs.LfsAuthTokenTest.TestToken ( 0 ) ; java.lang.String serialized = processor.serialize ( token ) ; com.google.common.truth.Truth.assertThat ( serialized ) . isNotEmpty ( ) ; com.google.common.base.Optional < com.googlesource.gerrit.plugins.lfs.LfsAuthTokenTest.TestToken > deserialized = processor.deserialize ( serialized ) ; com.google.common.truth.Truth.assertThat ( deserialized.isPresent ( ) ) . isTrue ( ) ; com.google.common.truth.Truth.assertThat ( token.expiresAt ) . isEqualTo ( deserialized.get ( ) . expiresAt ) ; }

Target:
public void testTokenSerializationDeserialization ( ) throws java.lang.Exception { com.googlesource.gerrit.plugins.lfs.LfsAuthTokenTest.TestTokenProessor processor = new com.googlesource.gerrit.plugins.lfs.LfsAuthTokenTest.TestTokenProessor ( cipher ) ; com.googlesource.gerrit.plugins.lfs.LfsAuthTokenTest.TestToken token = new com.googlesource.gerrit.plugins.lfs.LfsAuthTokenTest.TestToken ( 0 ) ; java.lang.String serialized = processor.serialize ( token ) ; com.google.common.truth.Truth.assertThat ( serialized ) . isNotEmpty ( ) ; java.util.Optional < com.googlesource.gerrit.plugins.lfs.LfsAuthTokenTest.TestToken > deserialized = processor.deserialize ( serialized ) ; com.google.common.truth.Truth.assertThat ( deserialized.isPresent ( ) ) . isTrue ( ) ; com.google.common.truth.Truth.assertThat ( token.expiresAt ) . isEqualTo ( deserialized.get ( ) . expiresAt ) ; }
Source:
public static void query ( com.google.gwt.user.client.rpc.AsyncCallback < com.google.gwt.core.client.JsArray < com.google.gerrit.client.changes.ChangeList > > callback , java.util.EnumSet < com.google.gerrit.extensions.client.ListChangesOption > options , java.lang.String ... queries ) { assert ( queries.length ) >= 2 ; com.google.gerrit.client.rpc.RestApi call = new com.google.gerrit.client.rpc.RestApi ( com.google.gerrit.client.changes.ChangeList.URI ) ; for ( java.lang.String q : queries ) { call.addParameterRaw ( "q" , com.google.gwtorm.client.KeyUtil.encode ( q ) ) ; } com.google.gerrit.client.changes.ChangeList.OPTIONS.addAll ( options ) ; com.google.gerrit.client.changes.ChangeList.addOptions ( call , com.google.gerrit.client.changes.ChangeList.OPTIONS ) ; call.get ( callback ) ; }

Target:
public void onFailure ( java.lang.Throwable caught ) { callback.onFailure ( caught ) ; }
Source:
private com.google.common.collect.Multimap < java.lang.String , org.eclipse.jgit.diff.Edit > getEditsDueToRebasePerFilePath ( org.eclipse.jgit.revwalk.RevWalk revWalk , org.eclipse.jgit.revwalk.RevCommit commitB , org.eclipse.jgit.revwalk.RevCommit commitA ) throws com.google.gerrit.server.patch.PatchListNotAvailableException , java.io.IOException { if ( ! ( arePatchSetCommitsWithRebaseInBetween ( revWalk , commitA , commitB ) ) ) { return com.google.common.collect.ImmutableMultimap.of ( ) ; } return getEditsDueToRebasePerFilePath ( commitA , commitB ) ; }

Target:
private static boolean haveCommonParent ( org.eclipse.jgit.revwalk.RevCommit commitA , org.eclipse.jgit.revwalk.RevCommit commitB ) { return org.eclipse.jgit.lib.ObjectId.equals ( commitA.getParent ( 0 ) , commitB.getParent ( 0 ) ) ; }
Source:
public com.googlecode.prolog_cafe.lang.Operation exec ( com.googlecode.prolog_cafe.lang.Prolog engine ) throws com.googlecode.prolog_cafe.lang.PrologException { engine.setB0 ( ) ; com.googlecode.prolog_cafe.lang.Term a1 = arg1.dereference ( ) ; com.google.gerrit.reviewdb.client.Change change = StoredValues.CHANGE.get ( engine ) ; com.google.gerrit.reviewdb.client.Project.NameKey name = change.getProject ( ) ; if ( ! ( a1.unify ( com.googlecode.prolog_cafe.lang.SymbolTerm.create ( name.get ( ) ) , engine.trail ) ) ) { return engine.fail ( ) ; } return cont ; }

Target:
public com.googlecode.prolog_cafe.lang.Operation exec ( com.googlecode.prolog_cafe.lang.Prolog engine ) throws com.googlecode.prolog_cafe.lang.PrologException { engine.setB0 ( ) ; com.googlecode.prolog_cafe.lang.Term a1 = arg1.dereference ( ) ; com.google.gerrit.reviewdb.client.Change change = StoredValues.CHANGE_DATA.get ( engine ) . getChange ( ) ; com.google.gerrit.reviewdb.client.Project.NameKey name = change.getProject ( ) ; if ( ! ( a1.unify ( com.googlecode.prolog_cafe.lang.SymbolTerm.create ( name.get ( ) ) , engine.trail ) ) ) { return engine.fail ( ) ; } return cont ; }
Source:
private com.google.inject.Key < javax.servlet.http.HttpServlet > notFound ( ) { return key ( new javax.servlet.http.HttpServlet ( ) { @ java.lang.Override protected void doGet ( final javax.servlet.http.HttpServletRequest req , final javax.servlet.http.HttpServletResponse rsp ) throws java.io.IOException { rsp.sendError ( HttpServletResponse.SC_NOT_FOUND ) ; } } ) ; }

Target:
private com.google.inject.Key < javax.servlet.http.HttpServlet > notFound ( ) { return key ( new javax.servlet.http.HttpServlet ( ) { private static final long serialVersionUID = 1L ; @ java.lang.Override protected void doGet ( final javax.servlet.http.HttpServletRequest req , final javax.servlet.http.HttpServletResponse rsp ) throws java.io.IOException { rsp.sendError ( HttpServletResponse.SC_NOT_FOUND ) ; } } ) ; }
Source:
public void run ( ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { }

Target:
public void run ( ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { java.nio.file.Path deprecatedRules = sitePaths.etc_dir.normalize ( ) . resolve ( "its" ) . resolve ( "action.config" ) ; if ( deprecatedRules.toFile ( ) . exists ( ) ) { ui.error ( ( "Deprecated rules file '%s' (No trailing 's' in 'action') will not be read. " + ( "Please migrate to 'etc/its/actions.config' (Trailing 's' in 'actions') and retry " + "the init step.\n" ) ) , deprecatedRules ) ; throw new org.eclipse.jgit.errors.ConfigInvalidException ( ( "Deprecated configuration file found: " + ( deprecatedRules.toRealPath ( ) ) ) ) ; } }
Source:
public boolean canSubmit ( ) { return getRefControl ( ) . canSubmit ( isOwner ( ) ) ; }

Target:
public boolean canDelete ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Change.Status status ) throws com.google.gwtorm.server.OrmException { if ( ! ( isVisible ( db ) ) ) { return false ; } switch ( status ) { case DRAFT : return ( isOwner ( ) ) || ( getRefControl ( ) . canDeleteDrafts ( ) ) ; case NEW : case ABANDONED : return ( isAdmin ( ) ) || ( ( isOwner ( ) ) && ( getRefControl ( ) . canDeleteOwnChanges ( ) ) ) ; case MERGED : default : return false ; } }
Source:
private java.util.Map < com.google.gerrit.reviewdb.client.AccountGroup.UUID , com.google.gerrit.reviewdb.client.AccountGroupById > getIncludedGroups ( final com.google.gerrit.reviewdb.client.AccountGroup.Id groupId ) throws com.google.gwtorm.server.OrmException { final java.util.Map < com.google.gerrit.reviewdb.client.AccountGroup.UUID , com.google.gerrit.reviewdb.client.AccountGroupById > groups = com.google.common.collect.Maps.newHashMap ( ) ; for ( com.google.gerrit.reviewdb.client.AccountGroupById g : db.get ( ) . accountGroupById ( ) . byGroup ( groupId ) ) { groups.put ( g.getIncludeUUID ( ) , g ) ; } return groups ; }

Target:
private java.util.Map < com.google.gerrit.reviewdb.client.AccountGroup.UUID , com.google.gerrit.reviewdb.client.AccountGroupById > getIncludedGroups ( final com.google.gerrit.reviewdb.client.AccountGroup.Id groupId ) throws com.google.gwtorm.server.OrmException { final java.util.Map < com.google.gerrit.reviewdb.client.AccountGroup.UUID , com.google.gerrit.reviewdb.client.AccountGroupById > groups = new java.util.HashMap < > ( ) ; for ( com.google.gerrit.reviewdb.client.AccountGroupById g : db.get ( ) . accountGroupById ( ) . byGroup ( groupId ) ) { groups.put ( g.getIncludeUUID ( ) , g ) ; } return groups ; }
Source:
private com.google.gerrit.extensions.api.changes.AddReviewerResult putAccount ( java.lang.String reviewer , com.google.gerrit.server.change.ReviewerResource rsrc , boolean cc ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.git.UpdateException , com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.Account member = rsrc.getReviewerUser ( ) . getAccount ( ) ; com.google.gerrit.server.project.ChangeControl control = rsrc.getReviewerControl ( ) ; com.google.gerrit.extensions.api.changes.AddReviewerResult result = new com.google.gerrit.extensions.api.changes.AddReviewerResult ( reviewer ) ; if ( isValidReviewer ( member , control ) ) { addReviewers ( rsrc.getChangeResource ( ) , result , com.google.common.collect.ImmutableMap.of ( member.getId ( ) , control ) , cc ) ; } return result ; }

Target:
private com.google.gerrit.server.change.PostReviewers.Addition putAccount ( java.lang.String reviewer , com.google.gerrit.server.change.ReviewerResource rsrc , com.google.gerrit.extensions.client.ReviewerState state ) { com.google.gerrit.reviewdb.client.Account member = rsrc.getReviewerUser ( ) . getAccount ( ) ; com.google.gerrit.server.project.ChangeControl control = rsrc.getReviewerControl ( ) ; if ( isValidReviewer ( member , control ) ) { return new com.google.gerrit.server.change.PostReviewers.Addition ( reviewer , rsrc.getChangeResource ( ) , com.google.common.collect.ImmutableMap.of ( member.getId ( ) , control ) , state ) ; } return new com.google.gerrit.server.change.PostReviewers.Addition ( reviewer ) ; }
Source:
static com.googlecode.prolog_cafe.lang.Term export ( com.google.gerrit.common.data.LabelType type ) { return new com.googlecode.prolog_cafe.lang.StructureTerm ( gerrit.PRED_get_legacy_label_types_1.symLabelType , com.googlecode.prolog_cafe.lang.SymbolTerm.intern ( type.getName ( ) ) , com.googlecode.prolog_cafe.lang.SymbolTerm.intern ( type.getFunctionName ( ) ) , new com.googlecode.prolog_cafe.lang.IntegerTerm ( type.getMin ( ) . getValue ( ) ) , new com.googlecode.prolog_cafe.lang.IntegerTerm ( type.getMax ( ) . getValue ( ) ) ) ; }

Target:
static com.googlecode.prolog_cafe.lang.Term export ( com.google.gerrit.common.data.LabelType type ) { com.google.gerrit.common.data.LabelValue min = type.getMin ( ) ; com.google.gerrit.common.data.LabelValue max = type.getMax ( ) ; return new com.googlecode.prolog_cafe.lang.StructureTerm ( gerrit.PRED_get_legacy_label_types_1.symLabelType , com.googlecode.prolog_cafe.lang.SymbolTerm.intern ( type.getName ( ) ) , com.googlecode.prolog_cafe.lang.SymbolTerm.intern ( type.getFunctionName ( ) ) , ( min != null ? new com.googlecode.prolog_cafe.lang.IntegerTerm ( min.getValue ( ) ) : gerrit.PRED_get_legacy_label_types_1.NONE ) , ( max != null ? new com.googlecode.prolog_cafe.lang.IntegerTerm ( max.getValue ( ) ) : gerrit.PRED_get_legacy_label_types_1.NONE ) ) ; }
Source:
private void render ( com.google.gwtexpui.safehtml.client.SafeHtmlBuilder sb , com.google.gerrit.client.diff.FileInfo info ) { sb.openTr ( ) ; sb.openTd ( ) . setStyleName ( com.google.gerrit.client.change.FileTable.R.css ( ) . pointer ( ) ) . closeTd ( ) ; columnReviewed ( sb , info ) ; columnPath ( sb , info ) ; columnComments ( sb , info ) ; columnDelta1 ( sb , info ) ; columnDelta2 ( sb , info ) ; sb.closeTr ( ) ; }

Target:
private void render ( com.google.gwtexpui.safehtml.client.SafeHtmlBuilder sb , com.google.gerrit.client.diff.FileInfo info ) { sb.openTr ( ) ; sb.openTd ( ) . setStyleName ( com.google.gerrit.client.change.FileTable.R.css ( ) . pointer ( ) ) . closeTd ( ) ; columnReviewed ( sb , info ) ; columnStatus ( sb , info ) ; columnPath ( sb , info ) ; columnComments ( sb , info ) ; columnDelta1 ( sb , info ) ; columnDelta2 ( sb , info ) ; sb.closeTr ( ) ; }
Source:
public com.google.gerrit.server.group.GroupJson addOption ( com.google.gerrit.common.groups.ListGroupsOption o ) { options.add ( o ) ; return this ; }

Target:
public static com.google.gerrit.extensions.common.GroupOptionsInfo createOptions ( com.google.gerrit.common.data.GroupDescription.Basic group ) { com.google.gerrit.extensions.common.GroupOptionsInfo options = new com.google.gerrit.extensions.common.GroupOptionsInfo ( ) ; com.google.gerrit.reviewdb.client.AccountGroup ag = com.google.gerrit.common.data.GroupDescriptions.toAccountGroup ( group ) ; if ( ( ag != null ) && ( ag.isVisibleToAll ( ) ) ) { options.visibleToAll = true ; } return options ; }
Source:
private java.sql.PreparedStatement stubExecuteBatchOK ( java.lang.String command , final int ... updateCounts ) throws java.sql.SQLException { java.sql.PreparedStatement ps = setupPreparedStatementForBatch ( updateCounts ) ; org.mockito.Mockito.stub ( conn.prepareStatement ( command ) ) . toReturn ( ps ) ; return ps ; }

Target:
private java.sql.PreparedStatement stubStatementThrowExceptionOnExecute ( java.lang.String command , java.sql.SQLException exception ) throws java.sql.SQLException { java.sql.PreparedStatement ps = org.mockito.Mockito.mock ( java.sql.PreparedStatement.class ) ; org.mockito.Mockito.doNothing ( ) . when ( ps ) . addBatch ( ) ; org.mockito.Mockito.when ( ps.executeBatch ( ) ) . thenThrow ( exception ) ; org.mockito.Mockito.when ( ps.executeUpdate ( ) ) . thenThrow ( exception ) ; org.mockito.Mockito.when ( conn.prepareStatement ( command ) ) . thenReturn ( ps ) ; return ps ; }
Source:
public void addThenRemove ( ) throws java.lang.Exception { com.google.gerrit.gpg.testutil.TestKey key1 = com.google.gerrit.gpg.testutil.TestKeys.validKeyWithoutExpiration ( ) ; store.add ( key1.getPublicKeyRing ( ) ) ; store.remove ( key1.getPublicKey ( ) . getFingerprint ( ) ) ; org.junit.Assert.assertEquals ( RefUpdate.Result.NO_CHANGE , store.save ( newCommitBuilder ( ) ) ) ; assertKeys ( key1.getKeyId ( ) ) ; }

Target:
public void addThenRemove ( ) throws java.lang.Exception { com.google.gerrit.gpg.testing.TestKey key1 = com.google.gerrit.gpg.testing.TestKeys.validKeyWithoutExpiration ( ) ; store.add ( key1.getPublicKeyRing ( ) ) ; store.remove ( key1.getPublicKey ( ) . getFingerprint ( ) ) ; org.junit.Assert.assertEquals ( RefUpdate.Result.NO_CHANGE , store.save ( newCommitBuilder ( ) ) ) ; assertKeys ( key1.getKeyId ( ) ) ; }
Source:
public java.io.Reader getReader ( ) throws java.io.IOException , java.lang.IllegalStateException { if ( ( ( reader ) == null ) && ( ( response.getEntity ( ) ) != null ) ) { reader = new java.io.InputStreamReader ( response.getEntity ( ) . getContent ( ) ) ; reader.skip ( JSON_MAGIC.length ) ; } return reader ; }

Target:
public java.io.Reader getReader ( ) throws java.io.IOException , java.lang.IllegalStateException { if ( ( ( reader ) == null ) && ( ( response.getEntity ( ) ) != null ) ) { reader = new java.io.InputStreamReader ( response.getEntity ( ) . getContent ( ) , java.nio.charset.StandardCharsets.UTF_8 ) ; reader.skip ( JSON_MAGIC.length ) ; } return reader ; }
Source:
public com.google.gerrit.common.data.GroupReference apply ( com.google.gerrit.server.account.AccountState state ) { com.google.gerrit.reviewdb.client.AccountGroup.UUID uuid ; if ( state.getUserName ( ) . isPresent ( ) ) { uuid = com.googlesource.gerrit.plugins.singleusergroup.SingleUserGroup.uuid ( state.getUserName ( ) . get ( ) ) ; } else { uuid = com.googlesource.gerrit.plugins.singleusergroup.SingleUserGroup.uuid ( state.getAccount ( ) . getId ( ) ) ; } return new com.google.gerrit.common.data.GroupReference ( uuid , com.googlesource.gerrit.plugins.singleusergroup.SingleUserGroup.nameOf ( uuid , state ) ) ; }

Target:
private static com.google.gerrit.common.data.GroupReference accountToGroup ( com.google.gerrit.server.account.AccountState s ) { com.google.gerrit.reviewdb.client.AccountGroup.UUID uuid = com.googlesource.gerrit.plugins.singleusergroup.SingleUserGroup.uuid ( ( s.getUserName ( ) . isPresent ( ) ? s.getUserName ( ) . get ( ) : com.googlesource.gerrit.plugins.singleusergroup.SingleUserGroup.uuid ( s.getAccount ( ) . getId ( ) ) ) ) ; return new com.google.gerrit.common.data.GroupReference ( uuid , com.googlesource.gerrit.plugins.singleusergroup.SingleUserGroup.nameOf ( uuid , s ) ) ; }
Source:
public void unblockInParentBlockInLocal ( ) { com.google.gerrit.server.project.Util.block ( parent , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.Util.allow ( parent , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) ; com.google.gerrit.server.project.Util.block ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl d = user ( local , com.google.gerrit.server.project.Util.DEVS ) ; assertCannotUpdate ( "refs/heads/master" , d ) ; }

Target:
public void unblockInParentBlockInLocal ( ) { com.google.gerrit.server.project.testing.Util.block ( parent , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.testing.Util.allow ( parent , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.testing.Util.DEVS , "refs/heads/*" ) ; com.google.gerrit.server.project.testing.Util.block ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.testing.Util.DEVS , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl d = user ( local , com.google.gerrit.server.project.testing.Util.DEVS ) ; assertCannotUpdate ( "refs/heads/master" , d ) ; }
Source:
public void testOwnerProject ( ) { grant ( local , com.google.gerrit.common.data.Permission.OWNER , com.google.gerrit.server.project.Util.ADMIN , "refs/*" ) ; com.google.gerrit.server.project.ProjectControl uBlah = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; com.google.gerrit.server.project.ProjectControl uAdmin = util.user ( local , com.google.gerrit.server.project.Util.DEVS , com.google.gerrit.server.project.Util.ADMIN ) ; assertFalse ( "not owner" , uBlah.isOwner ( ) ) ; assertTrue ( "is owner" , uAdmin.isOwner ( ) ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; local = new com.google.gerrit.server.git.ProjectConfig ( localKey ) ; local.createInMemory ( ) ; util.add ( local ) ; }
Source:
private com.google.gerrit.reviewdb.client.PatchSetInfo previousPatchSetInfo ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx ) throws com.google.gwtorm.server.OrmException { try { return patchSetInfoFactory.get ( ctx.getDb ( ) , ctx.getNotes ( ) , new com.google.gerrit.reviewdb.client.PatchSet.Id ( psId.getParentKey ( ) , ( ( psId.get ( ) ) - 1 ) ) ) ; } catch ( com.google.gerrit.server.patch.PatchSetInfoNotAvailableException e ) { throw new com.google.gwtorm.server.OrmException ( e ) ; } }

Target:
private com.google.gerrit.reviewdb.client.PatchSetInfo previousPatchSetInfo ( com.google.gerrit.server.update.BatchUpdate.ChangeContext ctx ) throws com.google.gwtorm.server.OrmException { try { return patchSetInfoFactory.get ( ctx.getDb ( ) , ctx.getNotes ( ) , new com.google.gerrit.reviewdb.client.PatchSet.Id ( psId.getParentKey ( ) , ( ( psId.get ( ) ) - 1 ) ) ) ; } catch ( com.google.gerrit.server.patch.PatchSetInfoNotAvailableException e ) { throw new com.google.gwtorm.server.OrmException ( e ) ; } }
Source:
private Account.Id parseIdent ( org.eclipse.jgit.revwalk.RevCommit commit ) throws org.eclipse.jgit.errors.ConfigInvalidException { org.eclipse.jgit.lib.PersonIdent a = commit.getAuthorIdent ( ) ; org.eclipse.jgit.lib.PersonIdent c = commit.getCommitterIdent ( ) ; if ( ( a.getName ( ) . equals ( c.getName ( ) ) ) && ( a.getEmailAddress ( ) . equals ( c.getEmailAddress ( ) ) ) ) { return null ; } return noteUtil.parseIdent ( commit.getAuthorIdent ( ) , id ) ; }

Target:
private Account.Id parseIdent ( com.google.gerrit.server.notedb.ChangeNotesCommit commit ) throws org.eclipse.jgit.errors.ConfigInvalidException { org.eclipse.jgit.lib.PersonIdent a = commit.getAuthorIdent ( ) ; org.eclipse.jgit.lib.PersonIdent c = commit.getCommitterIdent ( ) ; if ( ( a.getName ( ) . equals ( c.getName ( ) ) ) && ( a.getEmailAddress ( ) . equals ( c.getEmailAddress ( ) ) ) ) { return null ; } return noteUtil.parseIdent ( commit.getAuthorIdent ( ) , id ) ; }
Source:
public void defaultMessage ( ) throws java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { java.lang.String changeId = createChange ( ) ; com.google.gerrit.server.change.ChangeJson.ChangeInfo c = getChange ( changeId , com.google.gerrit.extensions.common.ListChangesOption.MESSAGES ) ; org.junit.Assert.assertNotNull ( c.messages ) ; org.junit.Assert.assertEquals ( 1 , c.messages.size ( ) ) ; org.junit.Assert.assertEquals ( "Uploaded patch set 1." , c.messages.iterator ( ) . next ( ) . message ) ; }

Target:
public void messagesNotReturnedByDefault ( ) throws com.google.gerrit.extensions.restapi.RestApiException , java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { java.lang.String changeId = createChange ( ) ; postMessage ( changeId , "Some nits need to be fixed." ) ; com.google.gerrit.extensions.common.ChangeInfo c = getChange ( ( "p~master~" + changeId ) , java.util.EnumSet.noneOf ( com.google.gerrit.extensions.common.ListChangesOption.class ) ) ; org.junit.Assert.assertNull ( c.messages ) ; }
Source:
private void assertIsHealthy ( ) { javax.servlet.http.HttpServletResponse responseMock = mock ( javax.servlet.http.HttpServletResponse.class ) ; servlet.doGet ( null , responseMock ) ; org.mockito.Mockito.verify ( responseMock ) . setStatus ( javax.servlet.http.HttpServletResponse.SC_NO_CONTENT ) ; }

Target:
public void testErrorDuringTransitionToHealty ( ) throws java.io.IOException { java.nio.file.Files.createFile ( tempFolder.newFolder ( "unhealthy.txt" ) . toPath ( ) . resolve ( "child" ) ) ; javax.servlet.http.HttpServletResponse responseMock = org.mockito.Mockito.mock ( javax.servlet.http.HttpServletResponse.class ) ; servlet.doPost ( null , responseMock ) ; org.mockito.Mockito.verify ( responseMock ) . sendError ( javax.servlet.http.HttpServletResponse.SC_INTERNAL_SERVER_ERROR ) ; }
Source:
private com.google.gerrit.server.account.AccountState makeUser ( final java.lang.String name , final java.lang.String email ) { final com.google.gerrit.reviewdb.client.Account.Id userId = new com.google.gerrit.reviewdb.client.Account.Id ( 42 ) ; final com.google.gerrit.reviewdb.client.Account account = new com.google.gerrit.reviewdb.client.Account ( userId , com.google.gerrit.common.TimeUtil.nowTs ( ) ) ; account.setFullName ( name ) ; account.setPreferredEmail ( email ) ; return new com.google.gerrit.server.account.AccountState ( account , java.util.Collections.< com.google.gerrit.reviewdb.client.AccountGroup.UUID > emptySet ( ) , java.util.Collections.< com.google.gerrit.reviewdb.client.AccountExternalId > emptySet ( ) ) ; }

Target:
private com.google.gerrit.server.account.AccountState makeUser ( final java.lang.String name , final java.lang.String email ) { final com.google.gerrit.reviewdb.client.Account.Id userId = new com.google.gerrit.reviewdb.client.Account.Id ( 42 ) ; final com.google.gerrit.reviewdb.client.Account account = new com.google.gerrit.reviewdb.client.Account ( userId , com.google.gerrit.common.TimeUtil.nowTs ( ) ) ; account.setFullName ( name ) ; account.setPreferredEmail ( email ) ; return new com.google.gerrit.server.account.AccountState ( account , java.util.Collections.< com.google.gerrit.reviewdb.client.AccountGroup.UUID > emptySet ( ) , java.util.Collections.< com.google.gerrit.reviewdb.client.AccountExternalId > emptySet ( ) , java.util.Collections.< com.google.gerrit.reviewdb.client.AccountProjectWatch > emptySet ( ) ) ; }
Source:
public void onScreenLoad ( com.google.gerrit.client.ui.ScreenLoadEvent event ) { com.google.gerrit.client.ui.Screen screen = event.getScreen ( ) ; if ( screen instanceof com.google.gerrit.client.admin.ProjectScreen ) { com.google.gerrit.reviewdb.client.Project.NameKey projectKey = ( ( com.google.gerrit.client.admin.ProjectScreen ) ( screen ) ) . getProjectKey ( ) ; setTargetHistoryToken ( com.google.gerrit.client.Dispatcher.toProjectAdmin ( projectKey , panel ) ) ; } super . onScreenLoad ( event ) ; }

Target:
public void onScreenLoad ( com.google.gerrit.client.ui.ScreenLoadEvent event ) { com.google.gerrit.client.ui.Screen screen = event.getScreen ( ) ; if ( screen instanceof com.google.gerrit.client.admin.ProjectScreen ) { com.google.gerrit.reviewdb.client.Project.NameKey projectKey = ( ( com.google.gerrit.client.admin.ProjectScreen ) ( screen ) ) . getProjectKey ( ) ; setTargetHistoryToken ( com.google.gerrit.client.Dispatcher.toProjectAdmin ( projectKey , panel ) ) ; setVisible ( true ) ; } else { setVisible ( false ) ; } super . onScreenLoad ( event ) ; }
Source:
private static < T extends com.google.gwt.core.client.JavaScriptObject > T parseJson ( com.google.gwt.http.client.Response res ) throws com.google.gwt.json.client.JSONException { java.lang.String json = res.getText ( ) ; if ( json.startsWith ( com.google.gerrit.client.rpc.RestApi.JSON_MAGIC ) ) { json = json.substring ( com.google.gerrit.client.rpc.RestApi.JSON_MAGIC.length ( ) ) ; } if ( json.isEmpty ( ) ) { throw new com.google.gwt.json.client.JSONException ( "response was empty" ) ; } return com.google.gerrit.client.rpc.RestApi.cast ( com.google.gwt.json.client.JSONParser.parseStrict ( json ) ) ; }

Target:
private static java.lang.String trimJsonMagic ( java.lang.String json ) { if ( json.startsWith ( com.google.gerrit.client.rpc.RestApi.JSON_MAGIC ) ) { json = json.substring ( com.google.gerrit.client.rpc.RestApi.JSON_MAGIC.length ( ) ) ; } return json ; }
Source:
private void createDraftUpdateIfNull ( com.google.gerrit.reviewdb.client.PatchLineComment c ) { if ( ( draftUpdate ) == null ) { draftUpdate = draftUpdateFactory.create ( ctl , when ) ; if ( ( psId ) != null ) { draftUpdate.setPatchSetId ( psId ) ; } else { draftUpdate.setPatchSetId ( com.google.gerrit.server.notedb.CommentsInNotesUtil.getCommentPsId ( c ) ) ; } } }

Target:
private void createDraftUpdateIfNull ( com.google.gerrit.reviewdb.client.PatchLineComment c ) { if ( ( draftUpdate ) == null ) { draftUpdate = draftUpdateFactory.create ( ctl , when ) ; if ( ( psId ) != null ) { draftUpdate.setPatchSetId ( psId ) ; } else { draftUpdate.setPatchSetId ( com.google.gerrit.server.PatchLineCommentsUtil.getCommentPsId ( c ) ) ; } } }
Source:
public synchronized void add ( java.lang.String event ) throws java.io.IOException { long next = ( getHead ( ) ) + 1 ; java.nio.file.Path epath = paths.event ( next ) ; com.googlesource.gerrit.plugins.events.fsstore.Fs.createDirectories ( epath.getParent ( ) ) ; java.nio.file.Files.write ( epath , ( event + "\n" ) . getBytes ( ) ) ; stores.head.increment ( ) ; }

Target:
public long getHead ( ) throws java.io.IOException { return stores.head.spinGet ( com.googlesource.gerrit.plugins.events.fsstore.FsStore.MAX_GET_SPINS ) ; }
Source:
public void testUpdateOneModified ( ) throws com.google.gwtorm.client.OrmException , java.sql.SQLException { stubExecuteBatchOK ( com.google.gwtorm.jdbc.TestJdbcAccess.UPDATE , 0 ) ; com.google.gwtorm.jdbc.JdbcAccess < com.google.gwtorm.jdbc.TestJdbcAccess.Data , com.google.gwtorm.jdbc.TestJdbcAccess.Data.DataKey > classUnderTest = createClassUnderTest ( ) ; try { classUnderTest.update ( com.google.gwtorm.jdbc.TestJdbcAccess.ONE_ROW ) ; org.junit.Assert.fail ( "missing OrmConcurrencyException" ) ; } catch ( com.google.gwtorm.client.OrmConcurrencyException e ) { } }

Target:
public void testDeleteOneNotExisting ( ) throws com.google.gwtorm.server.OrmException , java.sql.SQLException { java.sql.PreparedStatement delete = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.TestJdbcAccess.DELETE , 0 ) ; com.google.gwtorm.jdbc.JdbcAccess < com.google.gwtorm.jdbc.TestJdbcAccess.Data , com.google.gwtorm.jdbc.TestJdbcAccess.Data.DataKey > classUnderTest = createClassUnderTest ( ) ; try { classUnderTest.delete ( oneRow ) ; org.junit.Assert.fail ( "missing OrmConcurrencyException" ) ; } catch ( com.google.gwtorm.server.OrmConcurrencyException e ) { } com.google.gwtorm.jdbc.TestJdbcAccess.assertUsedBatchingOnly ( delete ) ; }
Source:
public void onSuccess ( com.google.gerrit.client.rpc.NativeMap < com.google.gwt.core.client.JsArray < com.google.gerrit.client.changes.CommentInfo > > result ) { attachComments ( result ) ; displayComments ( result ) ; send.setEnabled ( true ) ; }

Target:
public void onKeyPress ( com.google.gwt.event.dom.client.KeyPressEvent e ) { e.stopPropagation ( ) ; if ( ( ( ( e.getCharCode ( ) ) == '\n' ) || ( ( e.getCharCode ( ) ) == ( com.google.gwt.event.dom.client.KeyCodes.KEY_ENTER ) ) ) && ( e.isControlKeyDown ( ) ) ) { e.preventDefault ( ) ; onSend ( null ) ; } }
Source:
public void self ( ) throws java.lang.Exception { com.google.gerrit.extensions.common.AccountInfo info = gApi.accounts ( ) . self ( ) . get ( ) ; com.google.common.truth.Truth.assertThat ( info.name ) . isEqualTo ( "Administrator" ) ; com.google.common.truth.Truth.assertThat ( info.email ) . isEqualTo ( "admin@example.com" ) ; com.google.common.truth.Truth.assertThat ( info.username ) . isEqualTo ( "admin" ) ; }

Target:
public void self ( ) throws java.lang.Exception { com.google.gerrit.extensions.common.AccountInfo info = gApi.accounts ( ) . self ( ) . get ( ) ; assertUser ( info , admin ) ; info = gApi.accounts ( ) . id ( "self" ) . get ( ) ; assertUser ( info , admin ) ; }
Source:
protected void doDelete ( 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 = false ; 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 pushWithInvalidChangeIdFromEgit ( ) throws java.lang.Exception { com.google.gerrit.acceptance.git.AbstractPushForReview.createCommit ( testRepo , ( "Message with invalid Change-Id\n" + ( "\n" + "Change-Id: I0000000000000000000000000000000000000000\n" ) ) ) ; com.google.gerrit.acceptance.git.AbstractPushForReview.pushForReviewRejected ( testRepo , "invalid Change-Id line format in commit message footer" ) ; com.google.gerrit.server.git.ProjectConfig config = projectCache.checkedGet ( project ) . getConfig ( ) ; config.getProject ( ) . setRequireChangeID ( InheritableBoolean.FALSE ) ; saveProjectConfig ( project , config ) ; com.google.gerrit.acceptance.git.AbstractPushForReview.pushForReviewRejected ( testRepo , "invalid Change-Id line format in commit message footer" ) ; }

Target:
private void testPushWithInvalidChangeIdFromEgit ( ) throws java.lang.Exception { com.google.gerrit.acceptance.git.AbstractPushForReview.createCommit ( testRepo , ( "Message with invalid Change-Id\n" + ( "\n" + "Change-Id: I0000000000000000000000000000000000000000\n" ) ) ) ; com.google.gerrit.acceptance.git.AbstractPushForReview.pushForReviewRejected ( testRepo , "invalid Change-Id line format in commit message footer" ) ; com.google.gerrit.server.git.ProjectConfig config = projectCache.checkedGet ( project ) . getConfig ( ) ; config.getProject ( ) . setRequireChangeID ( InheritableBoolean.FALSE ) ; saveProjectConfig ( project , config ) ; com.google.gerrit.acceptance.git.AbstractPushForReview.pushForReviewRejected ( testRepo , "invalid Change-Id line format in commit message footer" ) ; }
Source:
public void shouldCreateSharedDirectoryIfItDoesNotExist ( ) throws java.io.IOException { java.io.File configuredDirectory = tempFolder.newFolder ( ) ; com.google.common.truth.Truth.assertThat ( configuredDirectory.delete ( ) ) . isTrue ( ) ; org.mockito.Mockito.when ( pluginConfigMock.getString ( "sharedDirectory" ) ) . thenReturn ( configuredDirectory.getAbsolutePath ( ) ) ; java.nio.file.Path sharedDirectory = module.getSharedDirectory ( pluginConfigFactoryMock , com.ericsson.gerrit.plugins.highavailability.ModuleTest.PLUGIN_NAME ) ; com.google.common.truth.Truth.assertThat ( sharedDirectory.toFile ( ) . exists ( ) ) . isTrue ( ) ; }

Target:
public void shouldCreateSharedDirectoryIfItDoesNotExist ( ) throws java.io.IOException { java.io.File configuredDirectory = tempFolder.newFolder ( ) ; com.google.common.truth.Truth.assertThat ( configuredDirectory.delete ( ) ) . isTrue ( ) ; org.mockito.Mockito.when ( pluginConfigMock.getString ( com.ericsson.gerrit.plugins.highavailability.Configuration.SHARED_DIRECTORY ) ) . thenReturn ( configuredDirectory.getAbsolutePath ( ) ) ; java.nio.file.Path sharedDirectory = module.getSharedDirectory ( pluginConfigFactoryMock , com.ericsson.gerrit.plugins.highavailability.ModuleTest.PLUGIN_NAME ) ; com.google.common.truth.Truth.assertThat ( sharedDirectory.toFile ( ) . exists ( ) ) . isTrue ( ) ; }
Source:
public void onResize ( com.google.gwt.event.logical.shared.ResizeEvent event ) { if ( ( cmA ) != null ) { cmA.setHeight ( ( ( event.getHeight ( ) ) - ( com.google.gerrit.client.diff.SideBySide2.HEADER_FOOTER ) ) ) ; cmA.refresh ( ) ; } if ( ( cmB ) != null ) { cmB.setHeight ( ( ( event.getHeight ( ) ) - ( com.google.gerrit.client.diff.SideBySide2.HEADER_FOOTER ) ) ) ; cmB.refresh ( ) ; } }

Target:
public void onResize ( com.google.gwt.event.logical.shared.ResizeEvent event ) { resizeCodeMirror ( ) ; }