auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void notNot ( ) { final com.google.gerrit.server.query.TestPredicate p = f ( "author" , "bob" ) ; final com.google.gerrit.server.query.Predicate < java.lang.String > n = com.google.gerrit.server.query.Predicate.not ( p ) ; org.junit.Assert.assertTrue ( ( n instanceof com.google.gerrit.server.query.NotPredicate ) ) ; org.junit.Assert.assertNotSame ( p , n ) ; org.junit.Assert.assertSame ( p , com.google.gerrit.server.query.Predicate.not ( n ) ) ; }

Target:
public void notNot ( ) { final com.google.gerrit.index.query.TestPredicate p = f ( "author" , "bob" ) ; final com.google.gerrit.index.query.Predicate < java.lang.String > n = com.google.gerrit.index.query.Predicate.not ( p ) ; org.junit.Assert.assertTrue ( ( n instanceof com.google.gerrit.index.query.NotPredicate ) ) ; org.junit.Assert.assertNotSame ( p , n ) ; org.junit.Assert.assertSame ( p , com.google.gerrit.index.query.Predicate.not ( n ) ) ; }
Source:
public void messagesNotReturnedByDefault ( ) throws 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.server.change.ChangeJson.ChangeInfo c = getChange ( changeId ) ; org.junit.Assert.assertNull ( c.messages ) ; }

Target:
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.common.changes.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 ) ; }
Source:
public com.google.gerrit.server.notedb.ChangeNotes createChecked ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Project.NameKey project , com.google.gerrit.reviewdb.client.Change.Id changeId ) throws com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.Change change = com.google.gerrit.reviewdb.server.ReviewDbUtil.unwrapDb ( db ) . changes ( ) . get ( changeId ) ; if ( ( change == null ) || ( ! ( change.getProject ( ) . equals ( project ) ) ) ) { throw new com.google.gerrit.server.project.NoSuchChangeException ( 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 org.apache.lucene.search.Query booleanQuery ( com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > p , org.apache.lucene.search.BooleanClause.Occur o ) throws com.google.gerrit.server.query.QueryParseException { org.apache.lucene.search.BooleanQuery q = new org.apache.lucene.search.BooleanQuery ( ) ; for ( int i = 0 ; i < ( p.getChildCount ( ) ) ; i ++ ) { q.add ( toQuery ( p.getChild ( i ) ) , o ) ; } return q ; }

Target:
private static < V > com.google.common.util.concurrent.ListenableFuture < java.lang.Void > allOf ( com.google.common.util.concurrent.ListenableFuture < V > ... f ) { return com.google.common.util.concurrent.Futures.transform ( com.google.common.util.concurrent.Futures.allAsList ( f ) , new com.google.common.base.Function < java.util.List < V > , java.lang.Void > ( ) { @ java.lang.Override public java.lang.Void apply ( java.util.List < V > input ) { return null ; } } ) ; }
Source:
private java.util.List < com.google.gerrit.extensions.common.ProjectInfo > query ( com.google.gerrit.server.api.projects.QueryRequest r ) throws com.google.gerrit.extensions.restapi.RestApiException { try { com.google.gerrit.server.project.QueryProjects myQueryProjects = queryProvider.get ( ) ; myQueryProjects.setQuery ( r.getQuery ( ) ) ; myQueryProjects.setLimit ( r.getLimit ( ) ) ; myQueryProjects.setStart ( r.getStart ( ) ) ; return myQueryProjects.apply ( TopLevelResource.INSTANCE ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot query projects" , e ) ; } }

Target:
private java.util.List < com.google.gerrit.extensions.common.ProjectInfo > query ( com.google.gerrit.server.api.projects.QueryRequest r ) throws com.google.gerrit.extensions.restapi.RestApiException { try { com.google.gerrit.server.restapi.project.QueryProjects myQueryProjects = queryProvider.get ( ) ; myQueryProjects.setQuery ( r.getQuery ( ) ) ; myQueryProjects.setLimit ( r.getLimit ( ) ) ; myQueryProjects.setStart ( r.getStart ( ) ) ; return myQueryProjects.apply ( TopLevelResource.INSTANCE ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot query projects" , e ) ; } }
Source:
private com.google.gerrit.reviewdb.AccountDiffPreference.Whitespace getIgnoreWhitespace ( ) { final int sel = ignoreWhitespace.getSelectedIndex ( ) ; if ( 0 <= sel ) { return com.google.gerrit.reviewdb.AccountDiffPreference.Whitespace.valueOf ( ignoreWhitespace.getValue ( sel ) ) ; } return value.getWhitespace ( ) ; }

Target:
private short getContext ( ) { final int sel = context.getSelectedIndex ( ) ; if ( 0 <= sel ) { return java.lang.Short.parseShort ( context.getValue ( sel ) ) ; } return ( ( short ) ( value.getContext ( ) ) ) ; }
Source:
public void copyLabels ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.common.data.LabelTypes labelTypes , com.google.gerrit.reviewdb.client.PatchSet.Id source , com.google.gerrit.reviewdb.client.PatchSet dest , com.google.gerrit.server.change.ChangeKind changeKind ) throws com.google.gwtorm.server.OrmException { java.lang.Iterable < com.google.gerrit.reviewdb.client.PatchSetApproval > sourceApprovals = db.patchSetApprovals ( ) . byPatchSet ( source ) ; copyLabels ( db , labelTypes , sourceApprovals , source , dest , changeKind ) ; }

Target:
public void copyLabels ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.notedb.ChangeNotes notes , com.google.gerrit.common.data.LabelTypes labelTypes , com.google.gerrit.reviewdb.client.PatchSet.Id source , com.google.gerrit.reviewdb.client.PatchSet dest , com.google.gerrit.server.change.ChangeKind changeKind ) throws com.google.gwtorm.server.OrmException { copyLabels ( db , labelTypes , byPatchSet ( db , notes , source ) , source , dest , changeKind ) ; }
Source:
private boolean canAbandon ( com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { return ( ( ( ( ( isOwner ( ) ) || ( refControl.isOwner ( ) ) ) || ( getProjectControl ( ) . isOwner ( ) ) ) || ( refControl.canAbandon ( ) ) ) || ( getProjectControl ( ) . isAdmin ( ) ) ) && ( ! ( isPatchSetLocked ( db ) ) ) ; }

Target:
private boolean canAbandon ( com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { return ( ( ( ( ( isOwner ( ) ) || ( refControl.isOwner ( ) ) ) || ( getProjectControl ( ) . isOwner ( ) ) ) || ( refControl.canPerform ( Permission.ABANDON ) ) ) || ( getProjectControl ( ) . isAdmin ( ) ) ) && ( ! ( isPatchSetLocked ( db ) ) ) ; }
Source:
public void run ( ) { int line = ( cm.extras ( ) . hasActiveLine ( ) ) ? cm.getLineNumber ( cm.extras ( ) . activeLine ( ) ) : 0 ; int res = java.util.Collections.binarySearch ( chunks , new com.google.gerrit.client.diff.DiffChunkInfo ( cm.side ( ) , line , 0 , false ) , getDiffChunkComparator ( ) ) ; diffChunkNavHelper ( chunks , cm , res , dir ) ; }

Target:
public void run ( ) { int line = ( cm.extras ( ) . hasActiveLine ( ) ) ? cm.getLineNumber ( cm.extras ( ) . activeLine ( ) ) : 0 ; int res = java.util.Collections.binarySearch ( chunks , new com.google.gerrit.client.diff.DiffChunkInfo ( cm.side ( ) , line , 0 , false ) , getDiffChunkComparator ( ) ) ; diffChunkNavHelper ( chunks , host , res , dir ) ; }
Source:
public void display ( final com.google.gerrit.client.reviewdb.PatchSet.Id id , final java.util.List < com.google.gerrit.client.reviewdb.Patch > list ) { psid = id ; myTable = null ; final com.google.gerrit.client.changes.PatchTable.DisplayCommand cmd = new com.google.gerrit.client.changes.PatchTable.DisplayCommand ( list ) ; if ( cmd.execute ( ) ) { cmd.initMeter ( ) ; com.google.gwt.user.client.DeferredCommand.addCommand ( cmd ) ; } else { cmd.showTable ( ) ; } }

Target:
public void display ( final com.google.gerrit.client.reviewdb.PatchSet.Id id , final java.util.List < com.google.gerrit.client.reviewdb.Patch > list ) { psid = id ; myTable = null ; patchList = list ; final com.google.gerrit.client.changes.PatchTable.DisplayCommand cmd = new com.google.gerrit.client.changes.PatchTable.DisplayCommand ( list ) ; if ( cmd.execute ( ) ) { cmd.initMeter ( ) ; com.google.gwt.user.client.DeferredCommand.addCommand ( cmd ) ; } else { cmd.showTable ( ) ; } }
Source:
private void reindexChanges ( ) throws java.io.IOException { com.google.gerrit.server.index.ChangeIndexer.allAsList ( indexFutures ) . checkedGet ( ) ; }

Target:
private com.google.gerrit.server.git.BatchUpdate.ChangeContext newChangeContext ( com.google.gerrit.reviewdb.client.Change.Id id ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = newChanges.get ( id ) ; if ( c == null ) { c = com.google.gerrit.server.git.BatchUpdate.unwrap ( db ) . changes ( ) . get ( id ) ; } com.google.gerrit.server.notedb.ChangeNotes notes = changeNotesFactory.createForNew ( c ) ; com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx = new com.google.gerrit.server.git.BatchUpdate.ChangeContext ( changeControlFactory.controlFor ( notes , user ) , new com.google.gerrit.server.git.BatchUpdateReviewDb ( db ) ) ; return ctx ; }
Source:
public void preDisplay ( final com.google.gerrit.common.data.ProjectDetail result ) { enableForm ( result.canModifyAgreements , result.canModifyDescription , result.canModifyMergeType , result.canModifyState ) ; saveProject.setVisible ( ( ( ( ( result.canModifyAgreements ) || ( result.canModifyDescription ) ) || ( result.canModifyMergeType ) ) || ( result.canModifyState ) ) ) ; display ( result ) ; }

Target:
public void preDisplay ( final com.google.gerrit.common.data.ProjectDetail result ) { enableForm ( result.canModifyAgreements , result.canModifyDescription , result.canModifyMergeType , result.canModifyState , result.canModifyMaxObjectSizeLimit ) ; saveProject.setVisible ( ( ( ( ( result.canModifyAgreements ) || ( result.canModifyDescription ) ) || ( result.canModifyMergeType ) ) || ( result.canModifyState ) ) ) ; display ( result ) ; }
Source:
public com.google.common.base.Optional < com.google.gerrit.server.edit.ChangeEdit > byChange ( com.google.gerrit.reviewdb.client.Change change ) throws com.google.gerrit.extensions.restapi.AuthException , java.io.IOException { com.google.gerrit.server.CurrentUser currentUser = user.get ( ) ; if ( ! ( currentUser.isIdentifiedUser ( ) ) ) { throw new com.google.gerrit.extensions.restapi.AuthException ( "Authentication required" ) ; } return byChange ( change , currentUser.asIdentifiedUser ( ) ) ; }

Target:
public com.google.common.base.Optional < com.google.gerrit.server.edit.ChangeEdit > byChange ( com.google.gerrit.reviewdb.client.Change change ) throws com.google.gerrit.extensions.restapi.AuthException , java.io.IOException { try { return byChange ( changeControlFactory.controlFor ( change , user.get ( ) ) ) ; } catch ( com.google.gerrit.server.project.NoSuchChangeException e ) { throw new java.io.IOException ( e ) ; } }
Source:
void onKeyDownInput ( com.google.gwt.event.dom.client.KeyDownEvent e ) { if ( ( e.getNativeKeyCode ( ) ) == ( com.google.gwt.event.dom.client.KeyCodes.KEY_ESCAPE ) ) { onCancel ( null ) ; } else if ( ( e.getNativeKeyCode ( ) ) == ( com.google.gwt.event.dom.client.KeyCodes.KEY_ENTER ) ) { e.stopPropagation ( ) ; onSave ( null ) ; } }

Target:
void onKeyDownInput ( com.google.gwt.event.dom.client.KeyDownEvent e ) { if ( ( e.getNativeKeyCode ( ) ) == ( com.google.gwt.event.dom.client.KeyCodes.KEY_ESCAPE ) ) { onCancel ( null ) ; } else if ( ( e.getNativeKeyCode ( ) ) == ( com.google.gwt.event.dom.client.KeyCodes.KEY_ENTER ) ) { e.stopPropagation ( ) ; e.preventDefault ( ) ; onSave ( null ) ; } }
Source:
public com.google.gerrit.server.git.BatchUpdate setRepository ( org.eclipse.jgit.lib.Repository repo , org.eclipse.jgit.revwalk.RevWalk revWalk , org.eclipse.jgit.lib.ObjectInserter inserter ) { com.google.common.base.Preconditions.checkState ( ( ( this . repo ) == null ) , "repo already set" ) ; closeRepo = false ; this . repo = com.google.common.base.Preconditions.checkNotNull ( repo , "repo" ) ; this . revWalk = com.google.common.base.Preconditions.checkNotNull ( revWalk , "revWalk" ) ; this . inserter = com.google.common.base.Preconditions.checkNotNull ( inserter , "inserter" ) ; return this ; }

Target:
public com.google.gerrit.server.git.BatchUpdate setRepository ( org.eclipse.jgit.lib.Repository repo , org.eclipse.jgit.revwalk.RevWalk revWalk , org.eclipse.jgit.lib.ObjectInserter inserter ) { com.google.common.base.Preconditions.checkState ( ( ( this . repo ) == null ) , "repo already set" ) ; closeRepo = false ; this . repo = com.google.common.base.Preconditions.checkNotNull ( repo , "repo" ) ; this . revWalk = com.google.common.base.Preconditions.checkNotNull ( revWalk , "revWalk" ) ; this . inserter = com.google.common.base.Preconditions.checkNotNull ( inserter , "inserter" ) ; commands = new com.google.gerrit.server.git.ChainedReceiveCommands ( repo ) ; return this ; }
Source:
private java.util.SortedSet < com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.Scope > getScopes ( java.lang.String baseScopeKey , com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.Scope ... scopes ) { java.util.HashSet < com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.Scope > fullScopes = ( ( oAuthCookie ) == null ) ? new java.util.HashSet < com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.Scope > ( config.scopes.get ( baseScopeKey ) ) : new java.util.HashSet < com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.Scope > ( oAuthCookie.scopes ) ; fullScopes.addAll ( java.util.Arrays.asList ( scopes ) ) ; return new java.util.TreeSet < com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.Scope > ( fullScopes ) ; }

Target:
private java.util.List < com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.Scope > scopesForKey ( java.lang.String baseScopeKey ) { return com.google.common.base.Objects.firstNonNull ( config.scopes.get ( baseScopeKey ) , com.googlesource.gerrit.plugins.github.oauth.GitHubLogin.DEFAULT_SCOPES ) ; }
Source:
public java.util.Set < java.lang.String > getAllLoadedClassNames ( ) { java.util.Set < java.lang.String > classNames = com.google.common.collect.Sets.newHashSet ( ) ; for ( scala.collection.Iterator < java.lang.String > keysIter = scalaClasses.keys ( ) . iterator ( ) ; keysIter.hasNext ( ) ; ) { java.lang.String classFileName = keysIter.next ( ) ; classNames.add ( classFileName.substring ( 0 , ( ( classFileName.length ( ) ) - ( ".class" . length ( ) ) ) ) ) ; } return classNames ; }

Target:
public java.util.Set < java.lang.String > getAllLoadedClassNames ( ) { return scanTree ( "" , scalaClasses ) ; }
Source:
public void testUnblockInParentBlockInLocal ( ) { com.google.gerrit.server.project.Util.grant ( util.getParentConfig ( ) , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.ANONYMOUS , "refs/heads/*" ) . setBlock ( ) ; com.google.gerrit.server.project.Util.grant ( util.getParentConfig ( ) , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) ; com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) . setBlock ( ) ; com.google.gerrit.server.project.ProjectControl d = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; org.junit.Assert.assertFalse ( "u can't push" , d.controlForRef ( "refs/heads/master" ) . canUpdate ( ) ) ; }

Target:
public void testUnblockInParentBlockInLocal ( ) { com.google.gerrit.server.project.Util.grant ( util.getParentConfig ( ) , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/*" ) . setBlock ( ) ; com.google.gerrit.server.project.Util.grant ( util.getParentConfig ( ) , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) ; com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) . setBlock ( ) ; com.google.gerrit.server.project.ProjectControl d = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; org.junit.Assert.assertFalse ( "u can't push" , d.controlForRef ( "refs/heads/master" ) . canUpdate ( ) ) ; }
Source:
private boolean isVisibleTo ( com.google.gerrit.reviewdb.client.Branch.NameKey branchName , com.google.gerrit.server.CurrentUser user ) { final com.google.gerrit.server.project.ProjectState pe = projectCache.get ( branchName.getParentKey ( ) ) ; if ( pe == null ) { return false ; } final com.google.gerrit.server.project.ProjectControl pc = pe.controlFor ( user ) ; return pc.controlForRef ( branchName ) . isVisible ( ) ; }

Target:
public com.google.gerrit.server.data.PatchSetAttribute get ( ) { try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( change.getProject ( ) ) ; org.eclipse.jgit.revwalk.RevWalk revWalk = new org.eclipse.jgit.revwalk.RevWalk ( repo ) ) { return eventFactory.asPatchSetAttribute ( revWalk , change , patchSet ) ; } catch ( java.io.IOException e ) { throw com.google.common.base.Throwables.propagate ( e ) ; } }
Source:
public void onSuccess ( com.google.gwt.core.client.JsArray < com.googlesource.gerrit.plugins.serviceuser.client.SshKeyInfo > result ) { keys.display ( com.google.gerrit.plugin.client.rpc.Natives.asList ( result ) ) ; if ( ( ( result.length ( ) ) == 0 ) && ( keys.isVisible ( ) ) ) { showAddKeyBlock ( true ) ; } if ( ( ++ ( loadCount ) ) == 2 ) { display ( ) ; } }

Target:
public void onSuccess ( com.google.gwt.core.client.JsArray < com.googlesource.gerrit.plugins.serviceuser.client.SshKeyInfo > result ) { keys.display ( com.google.gerrit.client.rpc.Natives.asList ( result ) ) ; if ( ( ( result.length ( ) ) == 0 ) && ( keys.isVisible ( ) ) ) { showAddKeyBlock ( true ) ; } if ( ( ++ ( loadCount ) ) == 2 ) { display ( ) ; } }
Source:
private void setCreatedOnToVeryOldTimestamp ( com.google.gerrit.reviewdb.client.AccountGroup.Id groupId ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.AccountGroup group = db.accountGroups ( ) . get ( groupId ) ; java.time.Instant instant = java.time.LocalDateTime.of ( 1800 , java.time.Month.JANUARY , 1 , 0 , 0 ) . toInstant ( java.time.ZoneOffset.UTC ) ; group.setCreatedOn ( java.sql.Timestamp.from ( instant ) ) ; db.accountGroups ( ) . update ( com.google.common.collect.ImmutableList.of ( group ) ) ; }

Target:
private void setCreatedOnToVeryOldTimestamp ( com.google.gerrit.reviewdb.client.AccountGroup.Id groupId ) throws java.lang.Exception { createdOnUpdate.setInt ( 1 , groupId.get ( ) ) ; java.time.Instant instant = java.time.LocalDateTime.of ( 1800 , java.time.Month.JANUARY , 1 , 0 , 0 ) . toInstant ( java.time.ZoneOffset.UTC ) ; createdOnUpdate.setTimestamp ( 1 , java.sql.Timestamp.from ( instant ) ) ; createdOnUpdate.setInt ( 2 , groupId.get ( ) ) ; createdOnUpdate.executeUpdate ( ) ; }
Source:
public void run ( ) { synchronized ( pool ) { cnt.set ( true , pool.getNumActive ( ) ) ; cnt.set ( false , pool.getNumIdle ( ) ) ; } }

Target:
private void exportPoolMetrics ( org.apache.commons.dbcp.BasicDataSource pool ) { com.google.gerrit.metrics.CallbackMetric1 < java.lang.Boolean , java.lang.Integer > cnt = metrics.newCallbackMetric ( "sql/connection_pool/connections" , java.lang.Integer.class , new com.google.gerrit.metrics.Description ( "SQL database connections" ) . setGauge ( ) . setUnit ( "connections" ) , com.google.gerrit.metrics.Field.ofBoolean ( "active" ) ) ; metrics.newTrigger ( cnt , ( ) -> { synchronized ( pool ) { cnt.set ( true , pool.getNumActive ( ) ) ; cnt.set ( false , pool.getNumIdle ( ) ) ; } } ) ; }
Source:
private static com.google.gitiles.CommitJsonData.Ident toJsonData ( org.eclipse.jgit.lib.PersonIdent ident , org.eclipse.jgit.util.GitDateFormatter df ) { com.google.gitiles.CommitJsonData.Ident result = new com.google.gitiles.CommitJsonData.Ident ( ) ; result.name = ident.getName ( ) ; result.email = ident.getEmailAddress ( ) ; result.time = df.formatDate ( ident ) ; return result ; }

Target:
private static com.google.gitiles.CommitJsonData.Ident toJsonData ( org.eclipse.jgit.lib.PersonIdent ident , com.google.gitiles.DateFormatterBuilder.DateFormatter df ) { com.google.gitiles.CommitJsonData.Ident result = new com.google.gitiles.CommitJsonData.Ident ( ) ; result.name = ident.getName ( ) ; result.email = ident.getEmailAddress ( ) ; result.time = df.format ( ident ) ; return result ; }
Source:
public void testUnblockMoreSpecificRef_Fails ( ) { com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/*" ) . setBlock ( ) ; com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/heads/master" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; org.junit.Assert.assertFalse ( "u can't push" , u.controlForRef ( "refs/heads/master" ) . canUpdate ( ) ) ; }

Target:
public void testUnblockLargerScope_Fails ( ) { com.google.gerrit.server.project.Util.block ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/master" ) ; com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; org.junit.Assert.assertFalse ( "u can't push" , u.controlForRef ( "refs/heads/master" ) . canUpdate ( ) ) ; }
Source:
public void onBrowserEvent ( final com.google.gwt.user.client.Event event ) { if ( ( com.google.gwt.user.client.DOM.eventGetType ( event ) ) == ( com.google.gwt.user.client.Event.ONCLICK ) ) { com.google.gwt.user.client.History.newItem ( getTargetHistoryToken ( ) , false ) ; com.google.gerrit.client.Gerrit.display ( createScreen ( ) ) ; com.google.gwt.user.client.DOM.eventPreventDefault ( event ) ; } }

Target:
protected void onClick ( final com.google.gwt.user.client.Event event ) { com.google.gwt.user.client.History.newItem ( getTargetHistoryToken ( ) , false ) ; com.google.gerrit.client.Gerrit.display ( createScreen ( ) ) ; com.google.gwt.user.client.DOM.eventPreventDefault ( event ) ; }
Source:
public com.google.gerrit.testutil.TestDatabase create ( ) throws com.google.gwtorm.client.OrmException { if ( ! ( created ) ) { created = true ; final com.google.gerrit.reviewdb.ReviewDb c = open ( ) ; try { new com.google.gerrit.server.schema.SchemaCreator ( new java.io.File ( "." ) ) . create ( c ) ; } finally { c.close ( ) ; } } return this ; }

Target:
public com.google.gerrit.testutil.TestDatabase create ( ) throws com.google.gwtorm.client.OrmException { if ( ! ( created ) ) { created = true ; final com.google.gerrit.reviewdb.ReviewDb c = open ( ) ; try { new com.google.gerrit.server.schema.SchemaCreator ( new java.io.File ( "." ) , schemaVersion ) . create ( c ) ; } finally { c.close ( ) ; } } return this ; }
Source:
public com.google.gerrit.server.project.ProjectState checkedGet ( com.google.gerrit.reviewdb.client.Project.NameKey projectName ) { return get ( projectName ) ; }

Target:
protected void setUpEnvironment ( com.google.gerrit.rules.PrologEnvironment env ) { com.google.gerrit.reviewdb.client.Change change = new com.google.gerrit.reviewdb.client.Change ( new com.google.gerrit.reviewdb.client.Change.Key ( "Ibeef" ) , new com.google.gerrit.reviewdb.client.Change.Id ( 1 ) , new com.google.gerrit.reviewdb.client.Account.Id ( 2 ) , new com.google.gerrit.reviewdb.client.Branch.NameKey ( localKey , "refs/heads/master" ) ) ; env.set ( StoredValues.CHANGE , change ) ; env.set ( StoredValues.CHANGE_CONTROL , util.user ( local ) . controlFor ( change ) ) ; }
Source:
public void inheritRead_SingleBranchDeniesUpload ( ) { com.google.gerrit.server.project.Util.allow ( parent , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/*" ) ; com.google.gerrit.server.project.Util.allow ( parent , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/for/refs/*" ) ; com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/foobar" ) ; com.google.gerrit.server.project.Util.doNotInherit ( local , com.google.gerrit.common.data.Permission.READ , "refs/heads/foobar" ) ; com.google.gerrit.server.project.Util.doNotInherit ( local , com.google.gerrit.common.data.Permission.PUSH , "refs/for/refs/heads/foobar" ) ; com.google.gerrit.server.project.ProjectControl u = user ( local ) ; assertCanUpload ( u ) ; assertCanUpload ( "refs/heads/master" , u ) ; assertCannotUpload ( "refs/heads/foobar" , u ) ; }

Target:
public void inheritRead_SingleBranchDeniesUpload ( ) { com.google.gerrit.server.project.Util.allow ( parent , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/*" ) ; com.google.gerrit.server.project.Util.allow ( parent , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/for/refs/*" ) ; com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/foobar" ) ; com.google.gerrit.server.project.Util.doNotInherit ( local , com.google.gerrit.common.data.Permission.READ , "refs/heads/foobar" ) ; com.google.gerrit.server.project.Util.doNotInherit ( local , com.google.gerrit.common.data.Permission.PUSH , "refs/for/refs/heads/foobar" ) ; com.google.gerrit.server.project.ProjectControl u = user ( local ) ; assertCanUpload ( u ) ; assertCreateChange ( "refs/heads/master" , u ) ; assertCannotCreateChange ( "refs/heads/foobar" , u ) ; }
Source:
private void enableForm ( final boolean on ) { submitType.setEnabled ( on ) ; descTxt.setEnabled ( on ) ; useContributorAgreements.setEnabled ( on ) ; useSignedOffBy.setEnabled ( on ) ; }

Target:
private void enableForm ( final boolean canModifyAgreements , final boolean canModifyDescription , final boolean canModifyMergeType ) { submitType.setEnabled ( canModifyMergeType ) ; descTxt.setEnabled ( canModifyDescription ) ; useContributorAgreements.setEnabled ( canModifyAgreements ) ; useSignedOffBy.setEnabled ( canModifyAgreements ) ; saveProject.setEnabled ( ( ( canModifyAgreements || canModifyDescription ) || canModifyMergeType ) ) ; }
Source:
private net.sf.ehcache.config.Configuration createCacheConfiguration ( ) { final net.sf.ehcache.config.Configuration mgrCfg = new net.sf.ehcache.config.Configuration ( ) ; configureDiskStore ( mgrCfg ) ; configureDefaultCache ( mgrCfg ) ; return mgrCfg ; }

Target:
private net.sf.ehcache.config.Configuration createCacheConfiguration ( ) { final net.sf.ehcache.config.Configuration mgrCfg = new net.sf.ehcache.config.Configuration ( ) ; configureDiskStore ( mgrCfg ) ; configureDefaultCache ( mgrCfg ) ; if ( ( sConfig.getLoginType ( ) ) == ( com.google.gerrit.client.reviewdb.SystemConfig.LoginType.OPENID ) ) { final net.sf.ehcache.config.CacheConfiguration c ; c = configureNamedCache ( mgrCfg , "openid" , false , 5 ) ; c.setTimeToLiveSeconds ( c.getTimeToIdleSeconds ( ) ) ; mgrCfg.addCache ( c ) ; } return mgrCfg ; }
Source:
public void updateRepo ( com.google.gerrit.server.git.BatchUpdate.RepoContext ctx ) throws com.google.gerrit.extensions.restapi.ResourceConflictException , java.io.IOException { validate ( ctx ) ; if ( ! ( updateRef ) ) { return ; } }

Target:
public void updateRepo ( com.google.gerrit.server.git.BatchUpdate.RepoContext ctx ) throws com.google.gerrit.extensions.restapi.ResourceConflictException , java.io.IOException { validate ( ctx ) ; if ( ! ( updateRef ) ) { return ; } if ( ( updateRefCommand ) == null ) { ctx.addRefUpdate ( new org.eclipse.jgit.transport.ReceiveCommand ( org.eclipse.jgit.lib.ObjectId.zeroId ( ) , commit , psId.toRefName ( ) ) ) ; } else { ctx.addRefUpdate ( updateRefCommand ) ; } }
Source:
public java.util.Map < java.lang.String , com.google.gerrit.extensions.common.FileInfo > files ( ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return ( ( java.util.Map < java.lang.String , com.google.gerrit.extensions.common.FileInfo > ) ( listFiles.apply ( revision ) . value ( ) ) ) ; } catch ( com.google.gwtorm.server.OrmException | java.io.IOException | com.google.gerrit.server.patch.PatchListNotAvailableException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot retrieve files" , e ) ; } }

Target:
public java.util.Map < java.lang.String , com.google.gerrit.extensions.common.FileInfo > files ( ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return ( ( java.util.Map < java.lang.String , com.google.gerrit.extensions.common.FileInfo > ) ( listFiles.apply ( revision ) . value ( ) ) ) ; } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( "Cannot retrieve files" , e ) ; } }
Source:
private void loadDefaults ( ) { approvals = com.google.common.collect.ImmutableListMultimap.of ( ) ; reviewers = com.google.common.collect.ImmutableSetMultimap.of ( ) ; submitRecords = com.google.common.collect.ImmutableList.of ( ) ; changeMessages = com.google.common.collect.ImmutableListMultimap.of ( ) ; }

Target:
private void loadDefaults ( ) { approvals = com.google.common.collect.ImmutableListMultimap.of ( ) ; reviewers = com.google.common.collect.ImmutableSetMultimap.of ( ) ; submitRecords = com.google.common.collect.ImmutableList.of ( ) ; changeMessages = com.google.common.collect.ImmutableListMultimap.of ( ) ; commentsForBase = com.google.common.collect.ImmutableListMultimap.of ( ) ; commentsForPS = com.google.common.collect.ImmutableListMultimap.of ( ) ; }
Source:
public void run ( com.google.gerrit.server.project.ProjectState project , com.google.gerrit.server.CurrentUser user ) throws java.io.IOException , org.eclipse.jgit.lfs.errors.LfsException { com.googlesource.gerrit.plugins.lfs.locks.LfsDeleteLockInput input = context.input ( com.googlesource.gerrit.plugins.lfs.locks.LfsDeleteLockInput.class ) ; com.googlesource.gerrit.plugins.lfs.locks.LfsLockResponse lock = handler.deleteLock ( project.getProject ( ) . getName ( ) , user , lockId , input ) ; context.sendResponse ( lock ) ; }

Target:
public void run ( com.google.gerrit.server.project.ProjectState project , com.google.gerrit.server.CurrentUser user ) throws java.io.IOException , org.eclipse.jgit.lfs.errors.LfsException { com.googlesource.gerrit.plugins.lfs.locks.LfsDeleteLockInput input = context.input ( com.googlesource.gerrit.plugins.lfs.locks.LfsDeleteLockInput.class ) ; com.googlesource.gerrit.plugins.lfs.locks.LfsLockResponse lock = handler.deleteLock ( project.getProject ( ) . getNameKey ( ) , user , lockId , input ) ; context.sendResponse ( lock ) ; }
Source:
public boolean canRunUploadPack ( ) { return isAnyIncludedIn ( uploadGroups , user.getEffectiveGroups ( ) ) ; }

Target:
private java.util.Set < java.lang.String > allRefPatterns ( java.lang.String permissionName ) { java.util.Set < java.lang.String > all = new java.util.HashSet < java.lang.String > ( ) ; for ( com.google.gerrit.common.data.AccessSection section : access ( ) ) { com.google.gerrit.common.data.Permission permission = section.getPermission ( permissionName ) ; if ( permission != null ) { all.add ( section.getRefPattern ( ) ) ; } } return all ; }
Source:
protected boolean canDelete ( com.google.gerrit.server.project.ProjectResource rsrc ) { com.google.gerrit.server.account.CapabilityControl ctl = userProvider.get ( ) . getCapabilities ( ) ; return ( ( ctl.canAdministrateServer ( ) ) || ( ctl.canPerform ( ( ( ( pluginName ) + "-" ) + ( com.googlesource.gerrit.plugins.deleteproject.DeleteProjectCapability.DELETE_PROJECT ) ) ) ) ) || ( ( ctl.canPerform ( ( ( ( pluginName ) + "-" ) + ( com.googlesource.gerrit.plugins.deleteproject.DeleteOwnProjectCapability.DELETE_OWN_PROJECT ) ) ) ) && ( rsrc.getControl ( ) . isOwner ( ) ) ) ; }

Target:
protected boolean canDelete ( com.google.gerrit.server.project.ProjectResource rsrc ) { com.google.gerrit.server.permissions.PermissionBackend.WithUser userPermission = permissionBackend.user ( userProvider ) ; return ( ( userPermission.testOrFalse ( GlobalPermission.ADMINISTRATE_SERVER ) ) || ( userPermission.testOrFalse ( new com.google.gerrit.extensions.api.access.PluginPermission ( pluginName , com.googlesource.gerrit.plugins.deleteproject.DeleteProjectCapability.DELETE_PROJECT ) ) ) ) || ( ( userPermission.testOrFalse ( new com.google.gerrit.extensions.api.access.PluginPermission ( pluginName , com.googlesource.gerrit.plugins.deleteproject.DeleteOwnProjectCapability.DELETE_OWN_PROJECT ) ) ) && ( rsrc.getControl ( ) . isOwner ( ) ) ) ; }
Source:
static com.google.gerrit.server.plugins.Plugin.ApiType getApiType ( java.util.jar.Manifest manifest ) throws com.google.gerrit.server.plugins.InvalidPluginException { java.util.jar.Attributes main = manifest.getMainAttributes ( ) ; java.lang.String v = main.getValue ( "Gerrit-ApiType" ) ; if ( ( com.google.common.base.Strings.isNullOrEmpty ( v ) ) || ( com.google.gerrit.server.plugins.Plugin.ApiType.EXTENSION.name ( ) . equalsIgnoreCase ( v ) ) ) { return com.google.gerrit.server.plugins.Plugin.ApiType.EXTENSION ; } else if ( com.google.gerrit.server.plugins.Plugin.ApiType.PLUGIN.name ( ) . equalsIgnoreCase ( v ) ) { return com.google.gerrit.server.plugins.Plugin.ApiType.PLUGIN ; } else { throw new com.google.gerrit.server.plugins.InvalidPluginException ( ( "Invalid Gerrit-ApiType: " + v ) ) ; } }

Target:
public java.io.File get ( ) { if ( ! ( ready ) ) { synchronized ( dataDir ) { if ( ( ! ( dataDir.exists ( ) ) ) && ( ! ( dataDir.mkdirs ( ) ) ) ) { throw new com.google.inject.ProvisionException ( java.lang.String.format ( "Cannot create %s for plugin %s" , dataDir.getAbsolutePath ( ) , name ) ) ; } ready = true ; } } return dataDir ; }
Source:
private org.kohsuke.github.PagedIterable < org.kohsuke.github.GHRepository > getRepositories ( com.googlesource.gerrit.plugins.github.oauth.GitHubLogin hubLogin , java.lang.String organisation ) throws java.io.IOException { if ( organisation.equals ( hubLogin.getMyself ( ) . getLogin ( ) ) ) { return hubLogin.getMyself ( ) . listRepositories ( config.repositoryListPageSize ) ; } else { org.kohsuke.github.GHOrganization ghOrganisation = hubLogin.getMyself ( ) . getOrganizations ( ) . byLogin ( organisation ) ; return ghOrganisation.listRepositories ( config.repositoryListPageSize ) ; } }

Target:
private org.kohsuke.github.PagedIterable < org.kohsuke.github.GHRepository > getRepositories ( com.googlesource.gerrit.plugins.github.oauth.GitHubLogin hubLogin , java.lang.String organisation ) throws java.io.IOException { if ( organisation.equals ( hubLogin.getMyself ( ) . getLogin ( ) ) ) { return hubLogin.getMyself ( ) . listRepositories ( config.repositoryListPageSize ) ; } else { org.kohsuke.github.GHOrganization ghOrganisation = hubLogin.getMyself ( ) . getAllOrganizations ( ) . byLogin ( organisation ) ; return ghOrganisation.listRepositories ( config.repositoryListPageSize ) ; } }
Source:
public com.google.gerrit.extensions.restapi.Response < java.lang.String > apply ( com.google.gerrit.server.config.CacheResource rsrc , com.google.gerrit.server.config.FlushCache.Input input ) throws com.google.gerrit.extensions.restapi.AuthException { if ( ( com.google.gerrit.server.config.FlushCache.WEB_SESSIONS.equals ( rsrc.getName ( ) ) ) && ( ! ( self.get ( ) . getCapabilities ( ) . canAdministrateServer ( ) ) ) ) { throw new com.google.gerrit.extensions.restapi.AuthException ( java.lang.String.format ( "only site administrators can flush %s" , com.google.gerrit.server.config.FlushCache.WEB_SESSIONS ) ) ; } rsrc.getCache ( ) . invalidateAll ( ) ; return com.google.gerrit.extensions.restapi.Response.ok ( "ok" ) ; }

Target:
public com.google.gerrit.extensions.restapi.Response < java.lang.String > apply ( com.google.gerrit.server.config.CacheResource rsrc , com.google.gerrit.server.config.FlushCache.Input input ) throws com.google.gerrit.extensions.restapi.AuthException { if ( ( com.google.gerrit.server.config.FlushCache.WEB_SESSIONS.equals ( rsrc.getName ( ) ) ) && ( ! ( self.get ( ) . getCapabilities ( ) . canAdministrateServer ( ) ) ) ) { throw new com.google.gerrit.extensions.restapi.AuthException ( java.lang.String.format ( "only site administrators can flush %s" , com.google.gerrit.server.config.FlushCache.WEB_SESSIONS ) ) ; } rsrc.getCache ( ) . invalidateAll ( ) ; return com.google.gerrit.extensions.restapi.Response.ok ( "" ) ; }
Source:
private void executePostOps ( ) throws java.lang.Exception { com.google.gerrit.server.update.BatchUpdate.Context ctx = new com.google.gerrit.server.update.BatchUpdate.Context ( ) ; for ( com.google.gerrit.server.update.BatchUpdate.Op op : ops.values ( ) ) { op.postUpdate ( ctx ) ; } for ( com.google.gerrit.server.update.BatchUpdate.RepoOnlyOp op : repoOnlyOps ) { op.postUpdate ( ctx ) ; } }

Target:
private void executePostOps ( ) throws java.lang.Exception { com.google.gerrit.server.update.BatchUpdate.ContextImpl ctx = new com.google.gerrit.server.update.BatchUpdate.ContextImpl ( ) ; for ( com.google.gerrit.server.update.BatchUpdate.Op op : ops.values ( ) ) { op.postUpdate ( ctx ) ; } for ( com.google.gerrit.server.update.BatchUpdate.RepoOnlyOp op : repoOnlyOps ) { op.postUpdate ( ctx ) ; } }
Source:
public void testUnblockNoForce ( ) { com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.ANONYMOUS , "refs/heads/*" ) . setBlock ( ) ; com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; org.junit.Assert.assertTrue ( "u can push" , u.controlForRef ( "refs/heads/master" ) . canUpdate ( ) ) ; }

Target:
public void testUnblockNoForce ( ) { com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/*" ) . setBlock ( ) ; com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; org.junit.Assert.assertTrue ( "u can push" , u.controlForRef ( "refs/heads/master" ) . canUpdate ( ) ) ; }
Source:
public org.eclipse.jgit.revwalk.RevCommit next ( ) throws java.io.IOException , org.eclipse.jgit.errors.IncorrectObjectTypeException , org.eclipse.jgit.errors.MissingObjectException { if ( done ) { return null ; } org.eclipse.jgit.revwalk.RevCommit commit ; if ( ( first ) != null ) { commit = first ; first = null ; } else { commit = walk.next ( ) ; } if ( ( ++ ( n ) ) == ( limit ) ) { nextStart = walk.next ( ) ; done = true ; } else if ( commit == null ) { done = true ; } return commit ; }

Target:
public org.eclipse.jgit.revwalk.RevCommit next ( ) throws java.io.IOException , org.eclipse.jgit.errors.IncorrectObjectTypeException , org.eclipse.jgit.errors.MissingObjectException { if ( done ) { return null ; } org.eclipse.jgit.revwalk.RevCommit commit ; if ( ( first ) != null ) { commit = first ; first = null ; } else { commit = nextWithRename ( ) ; } if ( ( ++ ( n ) ) == ( limit ) ) { nextStart = nextWithRename ( ) ; done = true ; } else if ( commit == null ) { done = true ; } return commit ; }
Source:
void addPatchSetId ( final java.lang.String token ) { try { com.google.gerrit.reviewdb.client.PatchSet ps = com.google.gerrit.sshd.commands.CommandUtils.parsePatchSet ( token , db , projectControl , branch ) ; patchSets.add ( ps ) ; } catch ( com.google.gerrit.sshd.commands.UnloggedFailure e ) { throw new java.lang.IllegalArgumentException ( e.getMessage ( ) , e ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new java.lang.IllegalArgumentException ( "database error" , e ) ; } }

Target:
void addPatchSetId ( final java.lang.String token ) { try { com.google.gerrit.reviewdb.client.PatchSet ps = com.google.gerrit.sshd.commands.CommandUtils.parsePatchSet ( token , db , queryProvider.get ( ) , projectControl , branch ) ; patchSets.add ( ps ) ; } catch ( com.google.gerrit.sshd.commands.UnloggedFailure e ) { throw new java.lang.IllegalArgumentException ( e.getMessage ( ) , e ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new java.lang.IllegalArgumentException ( "database error" , e ) ; } }
Source:
public com.google.gerrit.reviewdb.client.Change reloadChange ( ) throws com.google.gwtorm.server.OrmException { notes = notesFactory.create ( db , project , legacyId ) ; change = notes.getChange ( ) ; if ( ( change ) == null ) { throw new com.google.gwtorm.server.OrmException ( ( "Unable to load change " + ( legacyId ) ) ) ; } return change ; }

Target:
public com.google.gerrit.reviewdb.client.Change reloadChange ( ) throws com.google.gwtorm.server.OrmException { if ( ( project ) == null ) { notes = notesFactory.createFromIdOnlyWhenNotedbDisabled ( db , legacyId ) ; } else { notes = notesFactory.create ( db , project , legacyId ) ; } change = notes.getChange ( ) ; if ( ( change ) == null ) { throw new com.google.gwtorm.server.OrmException ( ( "Unable to load change " + ( legacyId ) ) ) ; } return change ; }
Source:
private static com.google.gerrit.extensions.restapi.BinaryResult base64 ( com.google.gerrit.extensions.restapi.BinaryResult bin ) throws java.io.IOException { int max = 4 * ( com.google.common.math.IntMath.divide ( ( ( int ) ( bin.getContentLength ( ) ) ) , 3 , java.math.RoundingMode.CEILING ) ) ; org.eclipse.jgit.util.TemporaryBuffer.Heap buf = com.google.gerrit.httpd.restapi.RestApiServlet.heap ( max ) ; java.io.OutputStream encoded = com.google.common.io.BaseEncoding.base64 ( ) . encodingStream ( new java.io.OutputStreamWriter ( buf , java.nio.charset.StandardCharsets.ISO_8859_1 ) ) ; bin.writeTo ( encoded ) ; encoded.close ( ) ; return com.google.gerrit.httpd.restapi.RestApiServlet.asBinaryResult ( buf ) ; }

Target:
private static com.google.gerrit.extensions.restapi.BinaryResult base64 ( com.google.gerrit.extensions.restapi.BinaryResult bin ) throws java.io.IOException { int maxSize = com.google.gerrit.httpd.restapi.RestApiServlet.base64MaxSize ( bin.getContentLength ( ) ) ; int estSize = java.lang.Math.min ( com.google.gerrit.httpd.restapi.RestApiServlet.base64MaxSize ( com.google.gerrit.httpd.restapi.RestApiServlet.HEAP_EST_SIZE ) , maxSize ) ; org.eclipse.jgit.util.TemporaryBuffer.Heap buf = com.google.gerrit.httpd.restapi.RestApiServlet.heap ( estSize , maxSize ) ; java.io.OutputStream encoded = com.google.common.io.BaseEncoding.base64 ( ) . encodingStream ( new java.io.OutputStreamWriter ( buf , java.nio.charset.StandardCharsets.ISO_8859_1 ) ) ; bin.writeTo ( encoded ) ; encoded.close ( ) ; return com.google.gerrit.httpd.restapi.RestApiServlet.asBinaryResult ( buf ) ; }
Source:
private static void var ( final java.lang.StringBuilder r , final java.lang.String n , final java.lang.String v ) { if ( ( r.length ( ) ) > 0 ) { r.append ( ";" ) ; } r.append ( n ) ; r.append ( "=" ) ; r.append ( com.google.gwt.http.client.URL.encodeComponent ( v ) ) ; }

Target:
public java.lang.String toBranch ( final com.google.gerrit.reviewdb.Branch.NameKey branch ) { com.google.gerrit.common.data.ParamertizedString pattern = new com.google.gerrit.common.data.ParamertizedString ( type.getBranch ( ) ) ; final java.util.Map < java.lang.String , java.lang.String > p = new java.util.HashMap < java.lang.String , java.lang.String > ( ) ; p.put ( "project" , com.google.gwt.http.client.URL.encodeComponent ( branch.getParentKey ( ) . get ( ) ) ) ; p.put ( "branch" , com.google.gwt.http.client.URL.encodeComponent ( branch.get ( ) ) ) ; return ( baseUrl ) + ( pattern.replace ( p ) ) ; }
Source:
private void removeUI ( ) { if ( ( replyToBox ) != null ) { replyToBox.unregisterReplyBox ( ) ; } getCommentManager ( ) . setUnsaved ( this , false ) ; setRangeHighlight ( false ) ; clearRange ( ) ; getGutterWrapper ( ) . remove ( ) ; getCommentGroup ( ) . remove ( this ) ; getCm ( ) . focus ( ) ; }

Target:
private void removeUI ( ) { if ( ( replyToBox ) != null ) { replyToBox.unregisterReplyBox ( ) ; } getCommentManager ( ) . setUnsaved ( this , false ) ; setRangeHighlight ( false ) ; clearRange ( ) ; getMark ( ) . remove ( ) ; getCommentGroup ( ) . remove ( this ) ; getCm ( ) . focus ( ) ; }
Source:
public void deleteReviewerFromWipChange ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageWipChange ( ) ; removeReviewer ( sc , extraReviewer ) ; assertThat ( sender ) . sent ( "deleteReviewer" , sc ) . notTo ( sc.owner ) . to ( extraReviewer ) . to ( sc.reviewerByEmail ) . cc ( extraCcer , sc.reviewer , sc.ccer ) . cc ( sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; }

Target:
public void deleteReviewerByEmailFromWipChangeInNoteDb ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isTrue ( ) ; com.google.gerrit.acceptance.server.mail.StagedChange sc = stageWipChange ( ) ; gApi.changes ( ) . id ( sc.changeId ) . reviewer ( sc.reviewerByEmail ) . remove ( ) ; assertThat ( sender ) . notSent ( ) ; }
Source:
public com.google.gerrit.extensions.restapi.Response < ? > apply ( com.google.gerrit.server.change.ChangeResource rsrc , com.google.gerrit.server.change.DeleteChangeEdit.Input input ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.ResourceNotFoundException , com.google.gwtorm.server.OrmException , java.io.IOException { java.util.Optional < com.google.gerrit.server.edit.ChangeEdit > edit = editUtil.byChange ( rsrc.getChange ( ) ) ; if ( edit.isPresent ( ) ) { editUtil.delete ( edit.get ( ) ) ; } else { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( ) ; } return com.google.gerrit.extensions.restapi.Response.none ( ) ; }

Target:
public com.google.gerrit.extensions.restapi.Response < ? > apply ( com.google.gerrit.server.change.ChangeResource rsrc , com.google.gerrit.server.change.DeleteChangeEdit.Input input ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.ResourceNotFoundException , com.google.gwtorm.server.OrmException , java.io.IOException { java.util.Optional < com.google.gerrit.server.edit.ChangeEdit > edit = editUtil.byChange ( rsrc.getNotes ( ) , rsrc.getUser ( ) ) ; if ( edit.isPresent ( ) ) { editUtil.delete ( edit.get ( ) ) ; } else { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( ) ; } return com.google.gerrit.extensions.restapi.Response.none ( ) ; }