auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void topoSortDepNotInInputList ( ) { com.google.gerrit.server.notedb.rebuild.Event e1 = new com.google.gerrit.server.notedb.rebuild.EventSorterTest.TestEvent ( com.google.gerrit.common.TimeUtil.nowTs ( ) ) ; com.google.gerrit.server.notedb.rebuild.Event e2 = new com.google.gerrit.server.notedb.rebuild.EventSorterTest.TestEvent ( com.google.gerrit.common.TimeUtil.nowTs ( ) ) ; com.google.gerrit.server.notedb.rebuild.Event e3 = new com.google.gerrit.server.notedb.rebuild.EventSorterTest.TestEvent ( com.google.gerrit.common.TimeUtil.nowTs ( ) ) ; e1.addDep ( e3 ) ; java.util.List < com.google.gerrit.server.notedb.rebuild.Event > events = events ( e2 , e1 ) ; try { new com.google.gerrit.server.notedb.rebuild.EventSorter ( events ) . sort ( ) ; org.junit.Assert.fail ( "expected IllegalArgumentException" ) ; } catch ( java.lang.IllegalArgumentException e ) { } }

Target:
public void topoSortDepNotInInputList ( ) { com.google.gerrit.server.notedb.rebuild.Event e1 = new com.google.gerrit.server.notedb.rebuild.EventSorterTest.TestEvent ( com.google.gerrit.common.TimeUtil.nowTs ( ) ) ; com.google.gerrit.server.notedb.rebuild.Event e2 = new com.google.gerrit.server.notedb.rebuild.EventSorterTest.TestEvent ( com.google.gerrit.common.TimeUtil.nowTs ( ) ) ; com.google.gerrit.server.notedb.rebuild.Event e3 = new com.google.gerrit.server.notedb.rebuild.EventSorterTest.TestEvent ( com.google.gerrit.common.TimeUtil.nowTs ( ) ) ; e1.addDep ( e3 ) ; java.util.List < com.google.gerrit.server.notedb.rebuild.Event > events = com.google.gerrit.server.notedb.rebuild.EventSorterTest.events ( e2 , e1 ) ; try { new com.google.gerrit.server.notedb.rebuild.EventSorter ( events ) . sort ( ) ; org.junit.Assert.fail ( "expected IllegalArgumentException" ) ; } catch ( java.lang.IllegalArgumentException e ) { } }
Source:
public com.google.gerrit.server.events.RefUpdatedEvent getOneRefUpdate ( java.lang.String project , java.lang.String refName ) { java.lang.String key = java.lang.String.format ( "%s-%s-%s" , RefUpdatedEvent.TYPE , project , refName ) ; com.google.common.truth.Truth.assertThat ( recordedEvents ) . containsKey ( key ) ; java.util.List < com.google.gerrit.server.events.RefEvent > events = recordedEvents.get ( key ) ; com.google.common.truth.Truth.assertThat ( events ) . hasSize ( 1 ) ; com.google.gerrit.server.events.Event e = events.get ( 0 ) ; com.google.common.truth.Truth.assertThat ( e ) . isInstanceOf ( com.google.gerrit.server.events.RefUpdatedEvent.class ) ; return ( ( com.google.gerrit.server.events.RefUpdatedEvent ) ( e ) ) ; }

Target:
public com.google.gerrit.server.events.RefUpdatedEvent getOneRefUpdate ( java.lang.String project , java.lang.String refName ) { java.lang.String key = com.google.gerrit.acceptance.EventRecorder.key ( RefUpdatedEvent.TYPE , project , refName ) ; com.google.common.truth.Truth.assertThat ( recordedEvents ) . containsKey ( key ) ; java.util.Collection < com.google.gerrit.server.events.RefEvent > events = recordedEvents.get ( key ) ; com.google.common.truth.Truth.assertThat ( events ) . hasSize ( 1 ) ; com.google.gerrit.server.events.Event e = events.iterator ( ) . next ( ) ; com.google.common.truth.Truth.assertThat ( e ) . isInstanceOf ( com.google.gerrit.server.events.RefUpdatedEvent.class ) ; return ( ( com.google.gerrit.server.events.RefUpdatedEvent ) ( e ) ) ; }
Source:
protected void configure ( ) { install ( new com.google.gerrit.server.schema.SchemaVersion.Module ( ) ) ; bind ( org.eclipse.jgit.lib.PersonIdent.class ) . annotatedWith ( com.google.gerrit.server.GerritPersonIdent.class ) . toProvider ( com.google.gerrit.server.GerritPersonIdentProvider.class ) ; bind ( com.google.gerrit.server.config.AllProjectsName.class ) . toProvider ( com.google.gerrit.server.config.AllProjectsNameProvider.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; bind ( java.lang.String.class ) . annotatedWith ( com.google.gerrit.server.config.AnonymousCowardName.class ) . toProvider ( com.google.gerrit.server.config.AnonymousCowardNameProvider.class ) ; }

Target:
protected void configure ( ) { install ( new com.google.gerrit.server.schema.SchemaVersion.Module ( ) ) ; bind ( org.eclipse.jgit.lib.PersonIdent.class ) . annotatedWith ( com.google.gerrit.server.GerritPersonIdent.class ) . toProvider ( com.google.gerrit.server.GerritPersonIdentProvider.class ) ; bind ( com.google.gerrit.server.config.AllProjectsName.class ) . toProvider ( com.google.gerrit.server.config.AllProjectsNameProvider.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; bind ( com.google.gerrit.server.config.AllUsersName.class ) . toProvider ( com.google.gerrit.server.config.AllUsersNameProvider.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; bind ( java.lang.String.class ) . annotatedWith ( com.google.gerrit.server.config.AnonymousCowardName.class ) . toProvider ( com.google.gerrit.server.config.AnonymousCowardNameProvider.class ) ; }
Source:
private com.google.gerrit.server.project.ChangeControl incrementPatchSet ( com.google.gerrit.server.project.ChangeControl ctl , org.eclipse.jgit.revwalk.RevCommit commit ) throws java.lang.Exception { com.google.gerrit.server.change.PatchSetInserter ins ; try ( com.google.gerrit.server.git.BatchUpdate bu = newUpdate ( ctl.getChange ( ) . getOwner ( ) ) ) { ins = patchSetInserterFactory.create ( ctl , nextPatchSetId ( ctl ) , commit ) . setValidatePolicy ( CommitValidators.Policy.NONE ) . setFireRevisionCreated ( false ) . setNotify ( NotifyHandling.NONE ) ; bu.addOp ( ctl.getId ( ) , ins ) . execute ( ) ; } return reload ( ctl ) ; }

Target:
private com.google.gerrit.server.project.ChangeControl incrementPatchSet ( com.google.gerrit.server.project.ChangeControl ctl , org.eclipse.jgit.revwalk.RevCommit commit ) throws java.lang.Exception { com.google.gerrit.server.change.PatchSetInserter ins ; try ( com.google.gerrit.server.update.BatchUpdate bu = newUpdate ( ctl.getChange ( ) . getOwner ( ) ) ) { ins = patchSetInserterFactory.create ( ctl , nextPatchSetId ( ctl ) , commit ) . setValidatePolicy ( CommitValidators.Policy.NONE ) . setFireRevisionCreated ( false ) . setNotify ( NotifyHandling.NONE ) ; bu.addOp ( ctl.getId ( ) , ins ) . execute ( ) ; } return reload ( ctl ) ; }
Source:
public static void write ( final java.io.ObjectOutputStream out , final org.spearce.jgit.lib.AnyObjectId id ) throws java.io.IOException { if ( id != null ) { out.writeBoolean ( true ) ; out.writeInt ( id.w1 ) ; out.writeInt ( id.w2 ) ; out.writeInt ( id.w3 ) ; out.writeInt ( id.w4 ) ; out.writeInt ( id.w5 ) ; } else { out.writeBoolean ( false ) ; } }

Target:
public static void writeCanBeNull ( final java.io.OutputStream out , final org.spearce.jgit.lib.AnyObjectId id ) throws java.io.IOException { if ( id != null ) { com.google.gerrit.server.ioutil.BasicSerialization.writeVarInt32 ( out , 1 ) ; org.spearce.jgit.lib.ObjectIdSerialization.writeNotNull ( out , id ) ; } else { com.google.gerrit.server.ioutil.BasicSerialization.writeVarInt32 ( out , 0 ) ; } }
Source:
private static void query ( final java.lang.String token ) { final java.lang.String s = com.google.gerrit.client.Dispatcher.skip ( token ) ; final int c = s.indexOf ( ',' ) ; com.google.gerrit.client.Gerrit.display ( token , new com.google.gerrit.client.changes.QueryScreen ( s.substring ( 0 , c ) , s.substring ( ( c + 1 ) ) ) ) ; }

Target:
private static void sbs2 ( final java.lang.String token , final com.google.gerrit.reviewdb.client.PatchSet.Id baseId , final com.google.gerrit.reviewdb.client.Patch.Key id , final com.google.gerrit.client.diff.DisplaySide side , final int line , final boolean edit ) { com.google.gwt.core.client.GWT.runAsync ( new com.google.gerrit.client.Dispatcher.AsyncSplit ( token ) { @ java.lang.Override public void onSuccess ( ) { com.google.gerrit.client.Gerrit.display ( token , ( edit ? new com.google.gerrit.client.editor.EditScreen ( id ) : new com.google.gerrit.client.diff.SideBySide2 ( baseId , id.getParentKey ( ) , id.get ( ) , side , line ) ) ) ; } } ) ; }
Source:
public void delete ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.notedb.ChangeUpdate update , com.google.gerrit.reviewdb.client.PatchSet ps ) throws com.google.gwtorm.server.OrmException { ensurePatchSetMatches ( ps.getId ( ) , update ) ; com.google.common.base.Preconditions.checkArgument ( ps.isDraft ( ) , "cannot delete non-draft patch set %s" , ps.getId ( ) ) ; update.setPatchSetState ( PatchSetState.DELETED ) ; db.patchSets ( ) . delete ( java.util.Collections.singleton ( ps ) ) ; }

Target:
public void delete ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.notedb.ChangeUpdate update , com.google.gerrit.reviewdb.client.PatchSet ps ) throws com.google.gwtorm.server.OrmException { ensurePatchSetMatches ( ps.getId ( ) , update ) ; com.google.common.base.Preconditions.checkArgument ( ps.isDraft ( ) , "cannot delete non-draft patch set %s" , ps.getId ( ) ) ; update.setPatchSetState ( PatchSetState.DELETED ) ; if ( ( com.google.gerrit.server.notedb.NoteDbChangeState.PrimaryStorage.of ( update.getChange ( ) ) ) == ( com.google.gerrit.server.notedb.NoteDbChangeState.PrimaryStorage.REVIEW_DB ) ) { db.patchSets ( ) . delete ( java.util.Collections.singleton ( ps ) ) ; } }
Source:
public void testBlockPushDrafts ( ) { com.google.gerrit.server.project.Util.grant ( util.getParentConfig ( ) , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/for/refs/*" ) ; 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/drafts/*" ) . setBlock ( ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local ) ; org.junit.Assert.assertTrue ( "can upload refs/heads/master" , u.controlForRef ( "refs/heads/master" ) . canUpload ( ) ) ; org.junit.Assert.assertTrue ( "push is blocked to refs/drafts/master" , u.controlForRef ( "refs/drafts/refs/heads/master" ) . isBlocked ( com.google.gerrit.common.data.Permission.PUSH ) ) ; }

Target:
public void testBlockPushDrafts ( ) { com.google.gerrit.server.project.Util.allow ( util.getParentConfig ( ) , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/for/refs/*" ) ; com.google.gerrit.server.project.Util.block ( util.getParentConfig ( ) , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/drafts/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local ) ; org.junit.Assert.assertTrue ( "can upload refs/heads/master" , u.controlForRef ( "refs/heads/master" ) . canUpload ( ) ) ; org.junit.Assert.assertTrue ( "push is blocked to refs/drafts/master" , u.controlForRef ( "refs/drafts/refs/heads/master" ) . isBlocked ( com.google.gerrit.common.data.Permission.PUSH ) ) ; }
Source:
static com.google.gerrit.acceptance.GerritServer.Description forTestClass ( com.google.gerrit.acceptance.Description testDesc , java.lang.String configName ) { return new com.google.gerrit.acceptance.AutoValue_GerritServer_Description ( configName , true , ( ! ( com.google.gerrit.acceptance.GerritServer.Description.hasNoHttpd ( testDesc.getTestClass ( ) ) ) ) , null , null ) ; }

Target:
static com.google.gerrit.acceptance.GerritServer.Description forTestClass ( com.google.gerrit.acceptance.Description testDesc , java.lang.String configName ) { return new com.google.gerrit.acceptance.AutoValue_GerritServer_Description ( configName , true , ( ! ( com.google.gerrit.acceptance.GerritServer.Description.has ( com.google.gerrit.acceptance.NoHttpd.class , testDesc.getTestClass ( ) ) ) ) , com.google.gerrit.acceptance.GerritServer.Description.has ( com.google.gerrit.acceptance.Sandboxed.class , testDesc.getTestClass ( ) ) , null , null ) ; }
Source:
private boolean isVisibleTo ( com.google.gerrit.reviewdb.client.Branch.NameKey branchName , com.google.gerrit.server.CurrentUser user ) { com.google.gerrit.server.project.ProjectState pe = projectCache.get ( branchName.getParentKey ( ) ) ; if ( pe == null ) { return false ; } 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 onPreReceive ( final org.eclipse.jgit.transport.ReceivePack arg0 , final java.util.Collection < org.eclipse.jgit.transport.ReceiveCommand > commands ) { parseCommands ( commands ) ; if ( ( ( newChange ) != null ) && ( ( newChange.getResult ( ) ) == ( org.eclipse.jgit.transport.ReceiveCommand.Result.NOT_ATTEMPTED ) ) ) { createNewChanges ( ) ; } doReplaces ( ) ; }

Target:
public void advertiseRefs ( org.eclipse.jgit.transport.BaseReceivePack rp ) throws org.eclipse.jgit.transport.ServiceMayNotContinueException { allRefs = rp.getAdvertisedRefs ( ) ; if ( ( allRefs ) == null ) { allRefs = rp.getRepository ( ) . getAllRefs ( ) ; } rp.setAdvertisedRefs ( allRefs , rp.getAdvertisedObjects ( ) ) ; }
Source:
public java.util.List < com.google.gerrit.server.query.change.ChangeData > bySubmissionId ( java.lang.String cs ) throws com.google.gwtorm.server.OrmException { if ( ( com.google.common.base.Strings.isNullOrEmpty ( cs ) ) || ( ! ( com.google.gerrit.server.query.change.InternalChangeQuery.schema ( indexes ) . hasField ( com.google.gerrit.server.index.ChangeField.SUBMISSIONID ) ) ) ) { return java.util.Collections.emptyList ( ) ; } else { return query ( new com.google.gerrit.server.query.change.SubmissionIdPredicate ( cs ) ) ; } }

Target:
public java.util.List < com.google.gerrit.server.query.change.ChangeData > bySubmissionId ( java.lang.String cs ) throws com.google.gwtorm.server.OrmException { if ( ( com.google.common.base.Strings.isNullOrEmpty ( cs ) ) || ( ! ( com.google.gerrit.server.query.change.InternalChangeQuery.schema ( indexes ) . hasField ( com.google.gerrit.server.index.change.ChangeField.SUBMISSIONID ) ) ) ) { return java.util.Collections.emptyList ( ) ; } else { return query ( new com.google.gerrit.server.query.change.SubmissionIdPredicate ( cs ) ) ; } }
Source:
public final void copyTo ( com.google.gerrit.extensions.client.EditPreferencesInfo p ) { p.tabSize = tabSize ( ) ; p.lineLength = lineLength ( ) ; p.cursorBlinkRate = cursorBlinkRate ( ) ; p.hideTopMenu = hideTopMenu ( ) ; p.showTabs = showTabs ( ) ; p.showWhitespaceErrors = showWhitespaceErrors ( ) ; p.syntaxHighlighting = syntaxHighlighting ( ) ; p.hideLineNumbers = hideLineNumbers ( ) ; p.matchBrackets = matchBrackets ( ) ; p.autoCloseBrackets = autoCloseBrackets ( ) ; p.theme = theme ( ) ; p.keyMapType = keyMapType ( ) ; }

Target:
public final void copyTo ( com.google.gerrit.extensions.client.EditPreferencesInfo p ) { p.tabSize = tabSize ( ) ; p.lineLength = lineLength ( ) ; p.cursorBlinkRate = cursorBlinkRate ( ) ; p.hideTopMenu = hideTopMenu ( ) ; p.showTabs = showTabs ( ) ; p.showWhitespaceErrors = showWhitespaceErrors ( ) ; p.syntaxHighlighting = syntaxHighlighting ( ) ; p.hideLineNumbers = hideLineNumbers ( ) ; p.matchBrackets = matchBrackets ( ) ; p.lineWrapping = lineWrapping ( ) ; p.autoCloseBrackets = autoCloseBrackets ( ) ; p.theme = theme ( ) ; p.keyMapType = keyMapType ( ) ; }
Source:
public static void abandon ( int changeId , java.lang.String message , com.google.gwtjsonrpc.common.AsyncCallback < com.google.gerrit.client.changes.ChangeInfo > callback ) { com.google.gerrit.client.changes.ChangeApi.Message msg = new com.google.gerrit.client.changes.ChangeApi.Message ( ) ; msg.setMessage ( message ) ; new com.google.gerrit.client.rpc.RestApi ( ( ( ( com.google.gerrit.client.changes.ChangeApi.URI ) + changeId ) + "/abandon" ) ) . data ( msg ) . post ( callback ) ; }

Target:
public static void abandon ( int changeId , java.lang.String message , com.google.gwtjsonrpc.common.AsyncCallback < com.google.gerrit.client.changes.ChangeInfo > callback ) { com.google.gerrit.client.changes.ChangeApi.Message msg = ( ( com.google.gerrit.client.changes.ChangeApi.Message ) ( com.google.gwt.core.client.JavaScriptObject.createObject ( ) ) ) ; msg.setMessage ( message ) ; new com.google.gerrit.client.rpc.RestApi ( ( ( ( com.google.gerrit.client.changes.ChangeApi.URI ) + changeId ) + "/abandon" ) ) . data ( msg ) . post ( callback ) ; }
Source:
public boolean match ( com.google.gerrit.server.query.change.ChangeData object ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.Change c = object.change ( ) ; com.google.common.base.Optional < java.lang.Boolean > m = object.isMergeable ( ) ; return ( ( c != null ) && ( m.isPresent ( ) ) ) && ( m.get ( ) ) ; }

Target:
static com.google.gerrit.server.index.FieldDef < com.google.gerrit.server.query.change.ChangeData , ? > mergeableField ( com.google.gerrit.server.index.Schema < com.google.gerrit.server.query.change.ChangeData > schema ) { if ( schema == null ) { return com.google.gerrit.server.index.ChangeField.LEGACY_MERGEABLE ; } com.google.gerrit.server.index.FieldDef < com.google.gerrit.server.query.change.ChangeData , ? > f = schema.getFields ( ) . get ( com.google.gerrit.server.index.ChangeField.MERGEABLE.getName ( ) ) ; if ( f != null ) { return f ; } return schema.getFields ( ) . get ( ChangeField.LEGACY_MERGEABLE.getName ( ) ) ; }
Source:
private void stateEdit ( final boolean inEdit ) { expandTimer.cancel ( ) ; setMessageTextVisible ( ( ! inEdit ) ) ; edit.setVisible ( ( ! inEdit ) ) ; text.setVisible ( inEdit ) ; save.setVisible ( inEdit ) ; cancel.setVisible ( ( inEdit && ( ! ( isNew ( ) ) ) ) ) ; discard.setVisible ( inEdit ) ; }

Target:
private void stateEdit ( final boolean inEdit ) { expandTimer.cancel ( ) ; setMessageTextVisible ( ( ! inEdit ) ) ; edit.setVisible ( ( ! inEdit ) ) ; if ( inEdit ) { text.setVisible ( true ) ; } else { text.setFocus ( false ) ; text.setVisible ( false ) ; } save.setVisible ( inEdit ) ; cancel.setVisible ( ( inEdit && ( ! ( isNew ( ) ) ) ) ) ; discard.setVisible ( inEdit ) ; }
Source:
public void run ( ) { com.google.codereview.Main.LOG.info ( "Shutting down thread pool." ) ; pool.shutdown ( ) ; boolean waiting = true ; do { try { waiting = pool.awaitTermination ( 10 , java.util.concurrent.TimeUnit.SECONDS ) ; } catch ( java.lang.InterruptedException ie ) { } } while ( waiting ) ; com.google.codereview.Main.LOG.info ( "Thread pool shutdown." ) ; }

Target:
public void run ( ) { com.google.codereview.Main.LOG.info ( "Shutting down thread pool." ) ; pool.shutdown ( ) ; boolean waiting = true ; do { try { waiting = pool.awaitTermination ( 10 , java.util.concurrent.TimeUnit.SECONDS ) ; } catch ( java.lang.InterruptedException ie ) { } } while ( waiting ) ; com.google.codereview.Main.LOG.info ( "Thread pool shutdown." ) ; org.apache.log4j.LogManager.shutdown ( ) ; }
Source:
public static void applyUserPreferences ( ) { if ( ( com.google.gerrit.client.Gerrit.myAccount ) != null ) { final com.google.gerrit.reviewdb.AccountGeneralPreferences p = com.google.gerrit.client.Gerrit.myAccount.getGeneralPreferences ( ) ; com.google.gwtexpui.clippy.client.CopyableLabel.setFlashEnabled ( p.isUseFlashClipboard ( ) ) ; if ( ( com.google.gerrit.client.Gerrit.siteHeader ) != null ) { com.google.gerrit.client.Gerrit.siteHeader.setVisible ( p.isShowSiteHeader ( ) ) ; } if ( ( com.google.gerrit.client.Gerrit.siteFooter ) != null ) { com.google.gerrit.client.Gerrit.siteFooter.setVisible ( p.isShowSiteHeader ( ) ) ; } } }

Target:
public static void applyUserPreferences ( ) { if ( ( com.google.gerrit.client.Gerrit.myAccount ) != null ) { final com.google.gerrit.reviewdb.AccountGeneralPreferences p = com.google.gerrit.client.Gerrit.myAccount.getGeneralPreferences ( ) ; com.google.gwtexpui.clippy.client.CopyableLabel.setFlashEnabled ( p.isUseFlashClipboard ( ) ) ; if ( ( com.google.gerrit.client.Gerrit.siteHeader ) != null ) { com.google.gerrit.client.Gerrit.siteHeader.setVisible ( p.isShowSiteHeader ( ) ) ; } if ( ( com.google.gerrit.client.Gerrit.siteFooter ) != null ) { com.google.gerrit.client.Gerrit.siteFooter.setVisible ( p.isShowSiteHeader ( ) ) ; } com.google.gerrit.client.FormatUtil.setPreferences ( com.google.gerrit.client.Gerrit.myAccount.getGeneralPreferences ( ) ) ; } }
Source:
public java.lang.Runnable doScroll ( final net.codemirror.lib.CodeMirror cm ) { final net.codemirror.lib.CodeMirror other = ( cm == ( cmA ) ) ? cmB : cmA ; return new java.lang.Runnable ( ) { public void run ( ) { cm.scrollToY ( other.getScrollInfo ( ) . getTop ( ) ) ; } } ; }

Target:
private java.lang.Runnable doScroll ( final net.codemirror.lib.CodeMirror cm ) { final net.codemirror.lib.CodeMirror other = otherCM ( cm ) ; return new java.lang.Runnable ( ) { public void run ( ) { cm.scrollToY ( other.getScrollInfo ( ) . getTop ( ) ) ; } } ; }
Source:
private synchronized com.google.gerrit.testutil.InMemoryRepositoryManager.Repo get ( com.google.gerrit.reviewdb.client.Project.NameKey name ) throws org.eclipse.jgit.errors.RepositoryNotFoundException { com.google.gerrit.testutil.InMemoryRepositoryManager.Repo repo = repos.get ( com.google.gerrit.testutil.InMemoryRepositoryManager.normalize ( name ) ) ; if ( repo != null ) { repo.incrementOpen ( ) ; return repo ; } throw new org.eclipse.jgit.errors.RepositoryNotFoundException ( name.get ( ) ) ; }

Target:
private synchronized com.google.gerrit.testing.InMemoryRepositoryManager.Repo get ( com.google.gerrit.reviewdb.client.Project.NameKey name ) throws org.eclipse.jgit.errors.RepositoryNotFoundException { com.google.gerrit.testing.InMemoryRepositoryManager.Repo repo = repos.get ( com.google.gerrit.testing.InMemoryRepositoryManager.normalize ( name ) ) ; if ( repo != null ) { repo.incrementOpen ( ) ; return repo ; } throw new org.eclipse.jgit.errors.RepositoryNotFoundException ( name.get ( ) ) ; }
Source:
private com.google.gerrit.reviewdb.client.PatchLineComment publishComment ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx , com.google.gerrit.reviewdb.client.PatchLineComment c , com.google.gerrit.reviewdb.client.PatchSet ps ) throws com.google.gwtorm.server.OrmException { c.setStatus ( PatchLineComment.Status.PUBLISHED ) ; c.setWrittenOn ( ctx.getWhen ( ) ) ; c.setTag ( in.tag ) ; com.google.gerrit.server.PatchLineCommentsUtil.setCommentRevId ( c , patchListCache , ctx.getChange ( ) , com.google.common.base.Preconditions.checkNotNull ( ps ) ) ; return c ; }

Target:
private com.google.gerrit.reviewdb.client.Comment publishComment ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx , com.google.gerrit.reviewdb.client.Comment c , com.google.gerrit.reviewdb.client.PatchSet ps ) throws com.google.gwtorm.server.OrmException { c.writtenOn = ctx.getWhen ( ) ; c.tag = in.tag ; com.google.gerrit.server.CommentsUtil.setCommentRevId ( c , patchListCache , ctx.getChange ( ) , com.google.common.base.Preconditions.checkNotNull ( ps ) ) ; return c ; }
Source:
protected void configure ( ) { com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.extensions.webui.TopMenu.class ) . to ( com.googlesource.gerrit.plugins.cookbook.HelloTopMenu.class ) ; install ( new com.google.gerrit.extensions.restapi.RestApiModule ( ) { @ java.lang.Override protected void configure ( ) { post ( com.google.gerrit.server.change.RevisionResource.REVISION_KIND , "hello-revision" ) . to ( com.googlesource.gerrit.plugins.cookbook.HelloRevisionAction.class ) ; post ( com.google.gerrit.server.project.ProjectResource.PROJECT_KIND , "hello-project" ) . to ( com.googlesource.gerrit.plugins.cookbook.HelloProjectAction.class ) ; get ( com.google.gerrit.server.change.RevisionResource.REVISION_KIND , "greetings" ) . to ( com.googlesource.gerrit.plugins.cookbook.Greetings.class ) ; } } ) ; }

Target:
protected void configure ( ) { com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.extensions.webui.TopMenu.class ) . to ( com.googlesource.gerrit.plugins.cookbook.HelloTopMenu.class ) ; install ( new com.google.gerrit.extensions.restapi.RestApiModule ( ) { @ java.lang.Override protected void configure ( ) { post ( com.google.gerrit.server.change.RevisionResource.REVISION_KIND , "hello-revision" ) . to ( com.googlesource.gerrit.plugins.cookbook.HelloRevisionAction.class ) ; post ( com.google.gerrit.server.project.ProjectResource.PROJECT_KIND , "hello-project" ) . to ( com.googlesource.gerrit.plugins.cookbook.HelloProjectAction.class ) ; get ( com.google.gerrit.server.change.RevisionResource.REVISION_KIND , "greetings" ) . to ( com.googlesource.gerrit.plugins.cookbook.Greetings.class ) ; } } ) ; configurePluginParameters ( ) ; }
Source:
public void clear ( ) { set ( cssText , headerHtml , footerHtml ) ; }

Target:
public void set ( com.google.gerrit.client.projects.ThemeInfo theme ) { if ( theme != null ) { set ( ( ( theme.css ( ) ) != null ? theme.css ( ) : cssText ) , ( ( theme.header ( ) ) != null ? theme.header ( ) : headerHtml ) , ( ( theme.footer ( ) ) != null ? theme.footer ( ) : footerHtml ) ) ; } else { set ( cssText , headerHtml , footerHtml ) ; } }
Source:
public void unifiedPatchDetail ( final com.google.gerrit.client.reviewdb.Patch.Key key , final com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.data.UnifiedPatchDetail > callback ) { final com.google.gerrit.git.RepositoryCache rc = server.getRepositoryCache ( ) ; if ( rc == null ) { callback.onFailure ( new java.lang.Exception ( "No Repository Cache configured" ) ) ; return ; } run ( callback , new com.google.gerrit.server.patch.UnifiedPatchDetailAction ( rc , key ) ) ; }

Target:
public void patchComments ( final com.google.gerrit.client.reviewdb.Patch.Key patchKey , final com.google.gerrit.client.reviewdb.PatchSet.Id psa , final com.google.gerrit.client.reviewdb.PatchSet.Id psb , final com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.patches.CommentDetail > callback ) { if ( psb == null ) { callback.onFailure ( new com.google.gerrit.client.rpc.NoSuchEntityException ( ) ) ; return ; } run ( callback , new com.google.gerrit.server.patch.PatchCommentAction ( patchKey , psa , psb ) ) ; }
Source:
public boolean isOwner ( ) { if ( canPerform ( com.google.gerrit.reviewdb.ApprovalCategory.OWN , ( ( short ) ( 1 ) ) ) ) { return true ; } if ( getRefName ( ) . equals ( RefRight.ALL.substring ( 0 , ( ( RefRight.ALL.length ( ) ) - 1 ) ) ) ) { return getCurrentUser ( ) . isAdministrator ( ) ; } else { return getProjectControl ( ) . isOwner ( ) ; } }

Target:
private boolean canPushWithForce ( ) { for ( com.google.gerrit.common.data.PermissionRule rule : access ( Permission.PUSH ) ) { if ( rule.getForce ( ) ) { return true ; } } return false ; }
Source:
public void onFailure ( java.lang.Throwable caught ) { if ( failed ) { return ; } failed = true ; failedThrowable = caught ; for ( com.google.gerrit.client.rpc.CallbackGroup.CallbackImpl < ? > cb : callbacks ) { cb.delegate.onFailure ( failedThrowable ) ; cb.delegate = null ; cb.result = null ; } callbacks.clear ( ) ; remaining.clear ( ) ; }

Target:
void applyFailed ( ) { com.google.gwt.user.client.rpc.AsyncCallback < T > cb = delegate ; if ( cb != null ) { delegate = null ; result = null ; cb.onFailure ( failedThrowable ) ; } }
Source:
java.lang.Iterable < com.google.gerrit.reviewdb.client.PatchSetApproval > getForPatchSet ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.project.ChangeControl ctl , com.google.gerrit.reviewdb.client.PatchSet.Id psId ) throws com.google.gwtorm.server.OrmException { return getForPatchSet ( db , ctl , psId , java.util.Collections.< com.google.gerrit.reviewdb.client.PatchSetApproval > emptyList ( ) ) ; }

Target:
public void copyInReviewDb ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.project.ChangeControl ctl , com.google.gerrit.reviewdb.client.PatchSet ps , @ com.google.gerrit.common.Nullable org.eclipse.jgit.revwalk.RevWalk rw , @ com.google.gerrit.common.Nullable org.eclipse.jgit.lib.Config repoConfig , java.lang.Iterable < com.google.gerrit.reviewdb.client.PatchSetApproval > dontCopy ) throws com.google.gwtorm.server.OrmException { if ( ( com.google.gerrit.server.notedb.NoteDbChangeState.PrimaryStorage.of ( ctl.getChange ( ) ) ) == ( com.google.gerrit.server.notedb.NoteDbChangeState.PrimaryStorage.REVIEW_DB ) ) { db.patchSetApprovals ( ) . insert ( getForPatchSet ( db , ctl , ps , rw , repoConfig , dontCopy ) ) ; } }
Source:
protected void onShowView ( com.google.gerrit.client.ui.Screen view ) { super . onShowView ( view ) ; view.onShowView ( ) ; }

Target:
protected void onShowView ( com.google.gerrit.client.ui.Screen view ) { final java.lang.String token = view.getToken ( ) ; if ( ! ( token.equals ( com.google.gwt.user.client.History.getToken ( ) ) ) ) { com.google.gwt.user.client.History.newItem ( token , false ) ; if ( ( com.google.gerrit.client.Gerrit.historyHooks ) != null ) { com.google.gerrit.client.Gerrit.dispatchHistoryHooks ( token ) ; } } super . onShowView ( view ) ; view.onShowView ( ) ; }
Source:
public void suggestReviewersChange ( ) throws java.lang.Exception { java.lang.String changeId = createChange ( ) . getChangeId ( ) ; java.util.List < com.google.gerrit.server.change.SuggestReviewers.SuggestedReviewerInfo > reviewers = suggestReviewers ( changeId , "u" , 6 ) ; org.junit.Assert.assertEquals ( reviewers.size ( ) , 6 ) ; reviewers = suggestReviewers ( changeId , "u" , 5 ) ; org.junit.Assert.assertEquals ( reviewers.size ( ) , 5 ) ; reviewers = suggestReviewers ( changeId , "users3" , 10 ) ; org.junit.Assert.assertEquals ( reviewers.size ( ) , 1 ) ; }

Target:
public void suggestReviewersChange ( ) throws java.lang.Exception { java.lang.String changeId = createChange ( ) . getChangeId ( ) ; java.util.List < com.google.gerrit.server.change.SuggestReviewers.SuggestedReviewerInfo > reviewers = suggestReviewers ( changeId , "u" , 6 ) ; com.google.common.truth.Truth.assertThat ( reviewers ) . hasSize ( 6 ) ; reviewers = suggestReviewers ( changeId , "u" , 5 ) ; com.google.common.truth.Truth.assertThat ( reviewers ) . hasSize ( 5 ) ; reviewers = suggestReviewers ( changeId , "users3" , 10 ) ; com.google.common.truth.Truth.assertThat ( reviewers ) . hasSize ( 1 ) ; }
Source:
public < T > com.google.gwtjsonrpc.common.AsyncCallback < T > addGwtjsonrpc ( final com.google.gwtjsonrpc.common.AsyncCallback < T > cb ) { callbacks.add ( cb ) ; return new com.google.gwtjsonrpc.common.AsyncCallback < com.google.gerrit.client.rpc.T > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.rpc.T result ) { results.put ( cb , result ) ; com.google.gerrit.client.rpc.CallbackGroup.this . onSuccess ( ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { com.google.gerrit.client.rpc.CallbackGroup.this . onFailure ( caught ) ; } } ; }

Target:
private < T > com.google.gerrit.client.rpc.CallbackGroup.Callback < T > handleAdd ( com.google.gwt.user.client.rpc.AsyncCallback < T > cb ) { if ( failed ) { cb.onFailure ( failedThrowable ) ; return com.google.gerrit.client.rpc.CallbackGroup.emptyCallback ( ) ; } com.google.gerrit.client.rpc.CallbackGroup.CallbackImpl < T > wrapper = new com.google.gerrit.client.rpc.CallbackGroup.CallbackImpl < T > ( cb ) ; callbacks.add ( wrapper ) ; remaining.add ( wrapper ) ; return wrapper ; }
Source:
private org.apache.http.conn.HttpClientConnectionManager customConnectionManager ( ) { org.apache.http.config.Registry < org.apache.http.conn.socket.ConnectionSocketFactory > socketFactoryRegistry = org.apache.http.config.RegistryBuilder.< org.apache.http.conn.socket.ConnectionSocketFactory > create ( ) . register ( "https" , buildSslSocketFactory ( ) ) . register ( "http" , PlainConnectionSocketFactory.INSTANCE ) . build ( ) ; org.apache.http.impl.conn.PoolingHttpClientConnectionManager connManager = new org.apache.http.impl.conn.PoolingHttpClientConnectionManager ( socketFactoryRegistry ) ; connManager.setDefaultMaxPerRoute ( com.googlesource.gerrit.plugins.webhooks.HttpClientProvider.CONNECTIONS_PER_ROUTE ) ; connManager.setMaxTotal ( com.googlesource.gerrit.plugins.webhooks.HttpClientProvider.MAX_CONNECTIONS ) ; connManager.setValidateAfterInactivity ( com.googlesource.gerrit.plugins.webhooks.HttpClientProvider.MAX_CONNECTION_INACTIVITY ) ; return connManager ; }

Target:
public org.apache.http.impl.client.CloseableHttpClient get ( ) { return org.apache.http.impl.client.HttpClients.custom ( ) . setConnectionManager ( create ( socketMgr.get ( ) ) ) . setDefaultRequestConfig ( customRequestConfig ( ) ) . setServiceUnavailableRetryStrategy ( customServiceUnavailRetryStrategy ( ) ) . build ( ) ; }
Source:
public com.googlesource.gerrit.plugins.imagare.ImageResource parse ( com.google.gerrit.server.project.ProjectResource parent , com.google.gerrit.extensions.restapi.IdString id ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( id ) ; }

Target:
public com.googlesource.gerrit.plugins.imagare.ImageResource parse ( com.google.gerrit.server.project.ProjectResource parent , com.google.gerrit.extensions.restapi.IdString id ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException { com.google.gerrit.server.project.RefControl refControl = parent.getControl ( ) . controlForRef ( new com.google.gerrit.reviewdb.client.Branch.NameKey ( parent.getNameKey ( ) , id.get ( ) ) ) ; if ( refControl.canRead ( ) ) { return new com.googlesource.gerrit.plugins.imagare.ImageResource ( refControl ) ; } else { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( id ) ; } }
Source:
public void testOptionsArgumentOverridesAllLimitPredicates ( ) throws java.lang.Exception { com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > in = parse ( "limit:1 file:a limit:3" ) ; com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > out = rewrite ( in , com.google.gerrit.server.index.change.ChangeIndexRewriterTest.options ( 0 , 5 ) ) ; com.google.common.truth.Truth.assertThat ( out.getClass ( ) ) . isEqualTo ( com.google.gerrit.server.query.change.AndSource.class ) ; com.google.common.truth.Truth.assertThat ( out.getChildren ( ) ) . containsExactly ( query ( in.getChild ( 1 ) , 5 ) , parse ( "limit:5" ) , parse ( "limit:5" ) ) . inOrder ( ) ; }

Target:
public void testOptionsArgumentOverridesAllLimitPredicates ( ) throws java.lang.Exception { com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > in = parse ( "limit:1 file:a limit:3" ) ; com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > out = rewrite ( in , com.google.gerrit.server.index.change.ChangeIndexRewriterTest.options ( 0 , 5 ) ) ; com.google.common.truth.Truth.assertThat ( out.getClass ( ) ) . isEqualTo ( com.google.gerrit.server.query.change.AndChangeSource.class ) ; com.google.common.truth.Truth.assertThat ( out.getChildren ( ) ) . containsExactly ( query ( in.getChild ( 1 ) , 5 ) , parse ( "limit:5" ) , parse ( "limit:5" ) ) . inOrder ( ) ; }
Source:
public void testUnblockInLocal_Fails ( ) { com.google.gerrit.server.project.Util.block ( util.getParentConfig ( ) , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.PUSH , fixers , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl f = util.user ( local , fixers ) ; org.junit.Assert.assertFalse ( "u can't push" , f.controlForRef ( "refs/heads/master" ) . canUpdate ( ) ) ; }

Target:
public void testUnblockInLocal_Fails ( ) { 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 ( local , com.google.gerrit.common.data.Permission.PUSH , fixers , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl f = util.user ( local , fixers ) ; org.junit.Assert.assertFalse ( "u can't push" , f.controlForRef ( "refs/heads/master" ) . canUpdate ( ) ) ; }
Source:
protected void onPostExecute ( java.lang.String errorMsg ) { if ( errorMsg != null ) { v.setEnabled ( true ) ; v.setBackgroundColor ( widgetUtil.color ( R.color.button ) ) ; widgetUtil.showError ( errorMsg ) ; } else { display ( com.google.reviewit.SortChangesFragment.class ) ; } }

Target:
protected void onPostExecute ( java.lang.String errorMsg ) { if ( errorMsg != null ) { v.setEnabled ( true ) ; v.setBackgroundColor ( widgetUtil.color ( R.color.button ) ) ; widgetUtil.showError ( errorMsg ) ; } else { widgetUtil.toast ( R.string.change_restored ) ; display ( com.google.reviewit.SortChangesFragment.class ) ; } }
Source:
public void wrongKeyId ( ) throws java.lang.Exception { com.google.gerrit.server.git.gpg.TestKey k = com.google.gerrit.server.git.gpg.TestKey.key1 ( ) ; long badId = ( k.getKeyId ( ) ) + 1 ; com.google.gerrit.server.git.gpg.CheckResult result = checker.check ( k.getPublicKey ( ) , badId ) ; org.junit.Assert.assertEquals ( java.util.Arrays.asList ( "Public key does not match ID 46328A8D" ) , result.getProblems ( ) ) ; }

Target:
public void wrongKeyId ( ) throws java.lang.Exception { com.google.gerrit.gpg.testutil.TestKey k = com.google.gerrit.gpg.testutil.TestKey.key1 ( ) ; long badId = ( k.getKeyId ( ) ) + 1 ; com.google.gerrit.gpg.CheckResult result = checker.check ( k.getPublicKey ( ) , badId ) ; org.junit.Assert.assertEquals ( java.util.Arrays.asList ( "Public key does not match ID 46328A8D" ) , result.getProblems ( ) ) ; }
Source:
public void rescheduleOnRecoverableException ( ) throws java.io.IOException { org.mockito.Mockito.when ( session.post ( com.googlesource.gerrit.plugins.webhooks.PostTaskTest.WEBHOOK_URL , com.googlesource.gerrit.plugins.webhooks.PostTaskTest.BODY ) ) . thenThrow ( java.io.IOException.class ) ; task.run ( ) ; org.mockito.Mockito.verify ( executor , org.mockito.Mockito.times ( 1 ) ) . schedule ( task , com.googlesource.gerrit.plugins.webhooks.PostTaskTest.RETRY_INTERVAL , java.util.concurrent.TimeUnit.MILLISECONDS ) ; }

Target:
public void noScheduleOnEmptyBody ( ) throws java.lang.Exception { org.mockito.Mockito.when ( processor.process ( org.mockito.ArgumentMatchers.eq ( projectCreated ) , org.mockito.ArgumentMatchers.eq ( remote ) ) ) . thenReturn ( java.util.Optional.empty ( ) ) ; task.run ( ) ; org.mockito.Mockito.verifyZeroInteractions ( session ) ; org.mockito.Mockito.verifyZeroInteractions ( executor ) ; }
Source:
void set ( com.google.gerrit.client.changes.ChangeInfo info ) { canEdit = ( info.has_actions ( ) ) && ( info.actions ( ) . containsKey ( "hashtags" ) ) ; this . changeId = info.legacy_id ( ) ; display ( info ) ; openForm.setVisible ( canEdit ) ; }

Target:
void set ( com.google.gerrit.client.changes.ChangeInfo info ) { canEdit = ( info.hasActions ( ) ) && ( info.actions ( ) . containsKey ( "hashtags" ) ) ; this . changeId = info.legacyId ( ) ; display ( info ) ; openForm.setVisible ( canEdit ) ; }
Source:
public void invalidRevision ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.enabled ( ) ) . isFalse ( ) ; com.google.gerrit.server.project.ChangeControl ctl = insertChange ( ) ; com.google.gerrit.reviewdb.client.PatchSet ps = com.google.gerrit.testutil.TestChanges.newPatchSet ( ctl.getChange ( ) . currentPatchSetId ( ) , "fooooooooooooooooooooooooooooooooooooooo" , adminId ) ; db.patchSets ( ) . update ( java.util.Collections.singleton ( ps ) ) ; assertProblems ( ctl , null , com.google.gerrit.acceptance.server.change.ConsistencyCheckerIT.problem ( "Invalid revision on patch set 1: fooooooooooooooooooooooooooooooooooooooo" ) ) ; }

Target:
public void invalidRevision ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isFalse ( ) ; com.google.gerrit.server.project.ChangeControl ctl = insertChange ( ) ; com.google.gerrit.reviewdb.client.PatchSet ps = com.google.gerrit.testutil.TestChanges.newPatchSet ( ctl.getChange ( ) . currentPatchSetId ( ) , "fooooooooooooooooooooooooooooooooooooooo" , adminId ) ; db.patchSets ( ) . update ( java.util.Collections.singleton ( ps ) ) ; assertProblems ( ctl , null , com.google.gerrit.acceptance.server.change.ConsistencyCheckerIT.problem ( "Invalid revision on patch set 1: fooooooooooooooooooooooooooooooooooooooo" ) ) ; }
Source:
public void inheritSubmit_OverridesAndDeniesOfRef ( ) { com.google.gerrit.server.project.Util.allow ( parent , com.google.gerrit.common.data.Permission.SUBMIT , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/*" ) ; com.google.gerrit.server.project.Util.deny ( local , com.google.gerrit.common.data.Permission.SUBMIT , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/*" ) ; com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.SUBMIT , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = user ( local ) ; assertCannotSubmit ( "refs/foobar" , u ) ; assertCannotSubmit ( "refs/tags/foobar" , u ) ; assertCanSubmit ( "refs/heads/foobar" , u ) ; }

Target:
public void cannotUploadToAnyRef ( ) { com.google.gerrit.server.project.testing.Util.allow ( parent , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/*" ) ; com.google.gerrit.server.project.testing.Util.allow ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.project.testing.Util.DEVS , "refs/heads/*" ) ; com.google.gerrit.server.project.testing.Util.allow ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.testing.Util.DEVS , "refs/for/refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = user ( local ) ; assertCannotUpload ( u ) ; assertCannotCreateChange ( "refs/heads/master" , u ) ; }
Source:
public static void refreshUserPreferences ( ) { if ( com.google.gerrit.client.Gerrit.isSignedIn ( ) ) { com.google.gerrit.client.account.AccountApi.self ( ) . view ( "preferences" ) . get ( new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.info.AccountPreferencesInfo > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.info.AccountPreferencesInfo prefs ) { com.google.gerrit.client.Gerrit.setUserPreferences ( prefs ) ; } } ) ; } else { com.google.gerrit.client.Gerrit.setUserPreferences ( com.google.gerrit.client.info.AccountPreferencesInfo.createDefault ( ) ) ; } }

Target:
public static void refreshUserPreferences ( ) { if ( com.google.gerrit.client.Gerrit.isSignedIn ( ) ) { com.google.gerrit.client.account.AccountApi.self ( ) . view ( "preferences" ) . get ( new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.info.GeneralPreferences > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.info.GeneralPreferences prefs ) { com.google.gerrit.client.Gerrit.setUserPreferences ( prefs ) ; } } ) ; } else { com.google.gerrit.client.Gerrit.setUserPreferences ( com.google.gerrit.client.info.GeneralPreferences.createDefault ( ) ) ; } }
Source:
public void setParentForAllProjects_Conflict ( ) throws java.lang.Exception { com.google.gerrit.acceptance.RestResponse r = adminSession.put ( ( ( "/projects/" + ( allProjects.get ( ) ) ) + "/parent" ) , newParentInput ( project.get ( ) ) ) ; r.assertConflict ( ) ; r.consume ( ) ; }

Target:
public void setParentForAllProjects_Conflict ( ) throws java.lang.Exception { com.google.gerrit.acceptance.RestResponse r = adminRestSession.put ( ( ( "/projects/" + ( allProjects.get ( ) ) ) + "/parent" ) , newParentInput ( project.get ( ) ) ) ; r.assertConflict ( ) ; r.consume ( ) ; }
Source:
public com.google.gerrit.server.events.MessageAttribute asMessageAttribute ( com.google.gerrit.reviewdb.client.ChangeMessage message ) { com.google.gerrit.server.events.MessageAttribute a = new com.google.gerrit.server.events.MessageAttribute ( ) ; a.timestamp = ( message.getWrittenOn ( ) . getTime ( ) ) / 1000L ; a.reviewer = ( ( message.getAuthor ( ) ) != null ) ? asAccountAttribute ( message.getAuthor ( ) ) : asAccountAttribute ( myIdent ) ; a.message = message.getMessage ( ) ; return a ; }

Target:
public com.google.gerrit.server.data.MessageAttribute asMessageAttribute ( com.google.gerrit.reviewdb.client.ChangeMessage message ) { com.google.gerrit.server.data.MessageAttribute a = new com.google.gerrit.server.data.MessageAttribute ( ) ; a.timestamp = ( message.getWrittenOn ( ) . getTime ( ) ) / 1000L ; a.reviewer = ( ( message.getAuthor ( ) ) != null ) ? asAccountAttribute ( message.getAuthor ( ) ) : asAccountAttribute ( myIdent ) ; a.message = message.getMessage ( ) ; return a ; }
Source:
public java.lang.Object createEntry ( final java.lang.Object key ) throws java.lang.Exception { return lookup ( ( ( com.google.gerrit.client.reviewdb.Account.Id ) ( key ) ) ) ; }

Target:
protected void configure ( ) { final com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < com.google.gerrit.client.reviewdb.Account.Id , com.google.gerrit.server.account.AccountState > > type = new com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < com.google.gerrit.client.reviewdb.Account.Id , com.google.gerrit.server.account.AccountState > > ( ) { } ; core ( type , com.google.gerrit.server.account.AccountCache.CACHE_NAME ) ; bind ( com.google.gerrit.server.account.AccountCache.class ) ; }
Source:
public static synchronized void resetWithClockStep ( long clockStep , java.util.concurrent.TimeUnit clockStepUnit ) { com.google.gerrit.testutil.TestTimeUtil.clockMs = new java.util.concurrent.atomic.AtomicLong ( new org.joda.time.DateTime ( 2009 , 9 , 30 , 17 , 0 , 0 , org.joda.time.DateTimeZone.forOffsetHours ( ( - 4 ) ) ) . getMillis ( ) ) ; com.google.gerrit.testutil.TestTimeUtil.setClockStep ( clockStep , clockStepUnit ) ; }

Target:
public static synchronized void resetWithClockStep ( long clockStep , java.util.concurrent.TimeUnit clockStepUnit ) { com.google.gerrit.testutil.TestTimeUtil.clockMs = new java.util.concurrent.atomic.AtomicLong ( com.google.gerrit.testutil.TestTimeUtil.START.getMillis ( ) ) ; com.google.gerrit.testutil.TestTimeUtil.setClockStep ( clockStep , clockStepUnit ) ; }
Source:
private boolean includedInOne ( final java.util.Collection < org.eclipse.jgit.lib.Ref > refs ) throws java.io.IOException { parseCommits ( refs ) ; java.util.List < org.eclipse.jgit.revwalk.RevCommit > before = com.google.common.collect.Lists.newLinkedList ( ) ; java.util.List < org.eclipse.jgit.revwalk.RevCommit > after = com.google.common.collect.Lists.newLinkedList ( ) ; partition ( before , after ) ; return ( ! ( includedIn ( after , 1 ) . isEmpty ( ) ) ) || ( ! ( includedIn ( before , 1 ) . isEmpty ( ) ) ) ; }

Target:
private boolean includedInOne ( final java.util.Collection < org.eclipse.jgit.lib.Ref > refs ) throws java.io.IOException { parseCommits ( refs ) ; java.util.List < org.eclipse.jgit.revwalk.RevCommit > before = new java.util.LinkedList < > ( ) ; java.util.List < org.eclipse.jgit.revwalk.RevCommit > after = new java.util.LinkedList < > ( ) ; partition ( before , after ) ; return ( ! ( includedIn ( after , 1 ) . isEmpty ( ) ) ) || ( ! ( includedIn ( before , 1 ) . isEmpty ( ) ) ) ; }