auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void setUp ( ) throws java.lang.Exception { java.lang.String url = "http://localhost:" + ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpSessionTest.wireMockRule.port ( ) ) ; com.ericsson.gerrit.plugins.highavailability.Configuration cfg = org.mockito.Mockito.mock ( com.ericsson.gerrit.plugins.highavailability.Configuration.class ) ; org.mockito.Mockito.when ( cfg.getUser ( ) ) . thenReturn ( "user" ) ; org.mockito.Mockito.when ( cfg.getPassword ( ) ) . thenReturn ( "pass" ) ; org.mockito.Mockito.when ( cfg.getMaxTries ( ) ) . thenReturn ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpSessionTest.MAX_TRIES ) ; org.mockito.Mockito.when ( cfg.getConnectionTimeout ( ) ) . thenReturn ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpSessionTest.TIMEOUT ) ; org.mockito.Mockito.when ( cfg.getSocketTimeout ( ) ) . thenReturn ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpSessionTest.TIMEOUT ) ; org.mockito.Mockito.when ( cfg.getRetryInterval ( ) ) . thenReturn ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpSessionTest.RETRY_INTERVAL ) ; com.ericsson.gerrit.plugins.highavailability.peers.PeerInfo peerInfo = org.mockito.Mockito.mock ( com.ericsson.gerrit.plugins.highavailability.peers.PeerInfo.class ) ; org.mockito.Mockito.when ( peerInfo.getDirectUrl ( ) ) . thenReturn ( url ) ; httpSession = new com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpSession ( new com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpClientProvider ( cfg ) . get ( ) , com.google.inject.util.Providers.of ( peerInfo ) ) ; com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpSessionTest.wireMockRule.resetRequests ( ) ; }

Target:
public void testNoRequestWhenPeerInfoUnknown ( ) throws java.io.IOException { httpSession = new com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpSession ( new com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpClientProvider ( cfg ) . get ( ) , com.google.inject.util.Providers.of ( com.google.common.base.Optional.< com.ericsson.gerrit.plugins.highavailability.peers.PeerInfo > absent ( ) ) ) ; try { httpSession.post ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpSessionTest.ENDPOINT ) ; org.junit.Assert.fail ( "Expected PeerInfoNotAvailableException" ) ; } catch ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.PeerInfoNotAvailableException e ) { } com.github.tomakehurst.wiremock.client.WireMock.verify ( com.github.tomakehurst.wiremock.client.WireMock.exactly ( 0 ) , com.github.tomakehurst.wiremock.client.WireMock.anyRequestedFor ( com.github.tomakehurst.wiremock.client.WireMock.anyUrl ( ) ) ) ; }
Source:
public int hashCode ( ) { return value.hashCode ( ) ; }

Target:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( ! ( obj instanceof com.googlesource.gerrit.plugins.cfoauth.AccessToken ) ) { return false ; } com.googlesource.gerrit.plugins.cfoauth.AccessToken accessToken = ( ( com.googlesource.gerrit.plugins.cfoauth.AccessToken ) ( obj ) ) ; return ( ( value.equals ( accessToken.value ) ) && ( ( expiresAt ) == ( accessToken.expiresAt ) ) ) && ( userInfo.equals ( accessToken.userInfo ) ) ; }
Source:
private void assertCanEdit ( com.google.gerrit.server.notedb.ChangeNotes notes ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.server.permissions.PermissionBackendException { if ( ! ( currentUser.get ( ) . isIdentifiedUser ( ) ) ) { throw new com.google.gerrit.extensions.restapi.AuthException ( "Authentication required" ) ; } try { permissionBackend.user ( currentUser ) . database ( reviewDb ) . change ( notes ) . check ( ChangePermission.ADD_PATCH_SET ) ; } catch ( com.google.gerrit.extensions.restapi.AuthException denied ) { throw new com.google.gerrit.extensions.restapi.AuthException ( "edit not permitted" , denied ) ; } }

Target:
private void assertCanEdit ( com.google.gerrit.server.notedb.ChangeNotes notes ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.ResourceConflictException , com.google.gerrit.server.permissions.PermissionBackendException , java.io.IOException { if ( ! ( currentUser.get ( ) . isIdentifiedUser ( ) ) ) { throw new com.google.gerrit.extensions.restapi.AuthException ( "Authentication required" ) ; } try { permissionBackend.user ( currentUser ) . database ( reviewDb ) . change ( notes ) . check ( ChangePermission.ADD_PATCH_SET ) ; projectCache.checkedGet ( notes.getProjectName ( ) ) . checkStatePermitsWrite ( ) ; } catch ( com.google.gerrit.extensions.restapi.AuthException denied ) { throw new com.google.gerrit.extensions.restapi.AuthException ( "edit not permitted" , denied ) ; } }
Source:
public static void setReady ( com.google.gerrit.server.config.SitePaths sitePaths , int version , boolean ready ) throws java.io.IOException { try { org.eclipse.jgit.storage.file.FileBasedConfig cfg = com.google.gerrit.lucene.LuceneVersionManager.loadGerritIndexConfig ( sitePaths ) ; com.google.gerrit.lucene.LuceneVersionManager.setReady ( cfg , version , ready ) ; cfg.save ( ) ; } catch ( org.eclipse.jgit.errors.ConfigInvalidException e ) { throw new java.io.IOException ( e ) ; } }

Target:
static org.apache.lucene.index.Term idTerm ( com.google.gerrit.server.query.change.ChangeData cd ) { return com.google.gerrit.lucene.QueryBuilder.intTerm ( com.google.gerrit.server.index.change.ChangeField.LEGACY_ID.getName ( ) , cd.getId ( ) . get ( ) ) ; }
Source:
public void generateResultSetGet ( final com.google.gwtorm.jdbc.gen.CodeGenSupport cgs ) { cgs.fieldSetBegin ( ) ; cgs.pushSqlHandle ( ) ; cgs.pushColumnIndex ( ) ; cgs.mv.visitMethodInsn ( Opcodes.INVOKESTATIC , org.objectweb.asm.Type.getInternalName ( com.google.gwtorm.schema.sql.SqlByteArrayTypeInfo.class ) , "fromResultSet" , org.objectweb.asm.Type.getMethodDescriptor ( org.objectweb.asm.Type.getType ( byte [ ] . class ) , new org.objectweb.asm.Type [ ] { org.objectweb.asm.Type.getType ( java.sql.ResultSet.class ) , org.objectweb.asm.Type.INT_TYPE } ) ) ; cgs.fieldSetEnd ( ) ; }

Target:
public void generateResultSetGet ( final com.google.gwtorm.server.CodeGenSupport cgs ) { cgs.fieldSetBegin ( ) ; cgs.pushSqlHandle ( ) ; cgs.pushColumnIndex ( ) ; cgs.mv.visitMethodInsn ( Opcodes.INVOKESTATIC , org.objectweb.asm.Type.getInternalName ( com.google.gwtorm.schema.sql.SqlByteArrayTypeInfo.class ) , "fromResultSet" , org.objectweb.asm.Type.getMethodDescriptor ( org.objectweb.asm.Type.getType ( byte [ ] . class ) , new org.objectweb.asm.Type [ ] { org.objectweb.asm.Type.getType ( java.sql.ResultSet.class ) , org.objectweb.asm.Type.INT_TYPE } ) ) ; cgs.fieldSetEnd ( ) ; }
Source:
public static com.google.gerrit.client.changes.CommentInfo create ( java.lang.String path , com.google.gerrit.common.changes.Side side , int line , java.lang.String in_reply_to , java.lang.String message ) { com.google.gerrit.client.changes.CommentInfo info = createObject ( ) . cast ( ) ; info.setPath ( path ) ; info.setSide ( side ) ; info.setLine ( line ) ; info.setInReplyTo ( in_reply_to ) ; info.setMessage ( message ) ; return info ; }

Target:
public static com.google.gerrit.client.changes.CommentInfo createFile ( java.lang.String path , com.google.gerrit.common.changes.Side side , java.lang.String in_reply_to , java.lang.String message ) { com.google.gerrit.client.changes.CommentInfo info = createObject ( ) . cast ( ) ; info.setPath ( path ) ; info.setSide ( side ) ; info.setInReplyTo ( in_reply_to ) ; info.setMessage ( message ) ; return info ; }
Source:
protected void runImpl ( ) throws java.io.IOException { final org.eclipse.jgit.transport.UploadPack up = new org.eclipse.jgit.transport.UploadPack ( repo ) ; if ( ! ( projectControl.allRefsAreVisible ( ) ) ) { up.setRefFilter ( new com.google.gerrit.server.git.VisibleRefFilter ( repo , projectControl , db.get ( ) ) ) ; } up.upload ( in , out , err ) ; }

Target:
protected void runImpl ( ) throws com.google.gerrit.sshd.commands.Failure , java.io.IOException { final org.eclipse.jgit.transport.UploadPack up = new org.eclipse.jgit.transport.UploadPack ( repo ) ; if ( ! ( projectControl.allRefsAreVisible ( ) ) ) { up.setRefFilter ( new com.google.gerrit.server.git.VisibleRefFilter ( repo , projectControl , db.get ( ) ) ) ; } up.setTimeout ( config.getTimeout ( ) ) ; try { up.upload ( in , out , err ) ; } catch ( java.io.InterruptedIOException err ) { throw new com.google.gerrit.sshd.commands.Failure ( 128 , "fatal: client IO read/write timeout" , err ) ; } }
Source:
public boolean rollback ( ) { java.io.File gitDirectory = destinationDirectory ; if ( ! ( gitDirectory.exists ( ) ) ) { return false ; } try { org.apache.commons.io.FileUtils.deleteDirectory ( gitDirectory ) ; return true ; } catch ( java.io.IOException e ) { com.googlesrouce.gerrit.plugins.github.git.GitCloneStep.LOG.error ( ( "Cannot clean-up output Git directory " + gitDirectory ) ) ; return false ; } }

Target:
public boolean rollback ( ) { java.io.File gitDirectory = destinationDirectory ; if ( ! ( gitDirectory.exists ( ) ) ) { return false ; } try { org.apache.commons.io.FileUtils.deleteDirectory ( gitDirectory ) ; return true ; } catch ( java.io.IOException e ) { com.googlesource.gerrit.plugins.github.git.GitCloneStep.LOG.error ( ( "Cannot clean-up output Git directory " + gitDirectory ) ) ; return false ; } }
Source:
public com.google.gerrit.server.git.MetaDataUpdate create ( com.google.gerrit.reviewdb.client.Project.NameKey name ) throws java.io.IOException , org.eclipse.jgit.errors.RepositoryNotFoundException { com.google.gerrit.server.git.MetaDataUpdate md = factory.create ( name , mgr.openRepository ( name ) ) ; md.getCommitBuilder ( ) . setAuthor ( createPersonIdent ( ) ) ; md.getCommitBuilder ( ) . setCommitter ( serverIdent ) ; return md ; }

Target:
public com.google.gerrit.server.git.MetaDataUpdate create ( com.google.gerrit.reviewdb.client.Project.NameKey name ) throws java.io.IOException , org.eclipse.jgit.errors.RepositoryNotFoundException { return create ( name , identifiedUser.get ( ) ) ; }
Source:
void display ( final java.util.List < com.google.gerrit.reviewdb.client.AccountGroupMember > result ) { while ( 1 < ( table.getRowCount ( ) ) ) table.removeRow ( ( ( table.getRowCount ( ) ) - 1 ) ) ; for ( final com.google.gerrit.reviewdb.client.AccountGroupMember k : result ) { final int row = table.getRowCount ( ) ; table.insertRow ( row ) ; applyDataRowStyle ( row ) ; populate ( row , k ) ; } }

Target:
void display ( final java.util.List < com.google.gerrit.client.groups.MemberInfo > result ) { while ( 1 < ( table.getRowCount ( ) ) ) table.removeRow ( ( ( table.getRowCount ( ) ) - 1 ) ) ; for ( final com.google.gerrit.client.groups.MemberInfo i : result ) { final int row = table.getRowCount ( ) ; table.insertRow ( row ) ; applyDataRowStyle ( row ) ; populate ( row , i ) ; } }
Source:
private com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > copy ( com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > in , java.util.List < com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > > all ) { if ( in instanceof com.google.gerrit.server.query.AndPredicate ) { return new com.google.gerrit.server.query.change.AndChangeSource ( all ) ; } else if ( in instanceof com.google.gerrit.server.query.OrPredicate ) { return new com.google.gerrit.server.query.change.OrSource ( all ) ; } return in.copy ( all ) ; }

Target:
private com.google.gerrit.index.query.Predicate < com.google.gerrit.server.query.change.ChangeData > copy ( com.google.gerrit.index.query.Predicate < com.google.gerrit.server.query.change.ChangeData > in , java.util.List < com.google.gerrit.index.query.Predicate < com.google.gerrit.server.query.change.ChangeData > > all ) { if ( in instanceof com.google.gerrit.index.query.AndPredicate ) { return new com.google.gerrit.server.query.change.AndChangeSource ( all ) ; } else if ( in instanceof com.google.gerrit.index.query.OrPredicate ) { return new com.google.gerrit.server.query.change.OrSource ( all ) ; } return in.copy ( all ) ; }
Source:
public java.util.Collection < com.googlesource.gerrit.plugins.hooks.workflow.ActionRequest > actionRequestsFor ( java.lang.Iterable < com.googlesource.gerrit.plugins.hooks.workflow.Property > properties ) { throw new java.lang.RuntimeException ( "unimplemented" ) ; }

Target:
public java.util.Collection < com.googlesource.gerrit.plugins.hooks.workflow.ActionRequest > actionRequestsFor ( java.lang.Iterable < com.googlesource.gerrit.plugins.hooks.workflow.Property > properties ) { java.util.Collection < com.googlesource.gerrit.plugins.hooks.workflow.ActionRequest > ret = com.google.common.collect.Lists.newLinkedList ( ) ; for ( com.googlesource.gerrit.plugins.hooks.workflow.Rule rule : rules ) { ret.addAll ( rule.actionRequestsFor ( properties ) ) ; } return ret ; }
Source:
public static < T > com.google.inject.Key < com.google.gerrit.util.cli.OptionHandlerFactory < T > > keyFor ( final java.lang.Class < T > valueType ) { final java.lang.reflect.Type factoryType = new com.google.inject.internal.MoreTypes.ParameterizedTypeImpl ( null , com.google.gerrit.util.cli.OptionHandlerFactory.class , valueType ) ; return ( ( com.google.inject.Key < com.google.gerrit.util.cli.OptionHandlerFactory < T > > ) ( com.google.inject.Key.get ( com.google.inject.TypeLiteral.get ( factoryType ) ) ) ) ; }

Target:
public static < T > com.google.inject.Key < com.google.gerrit.util.cli.OptionHandlerFactory < T > > keyFor ( final java.lang.Class < T > valueType ) { final java.lang.reflect.Type factoryType = com.google.inject.util.Types.newParameterizedType ( com.google.gerrit.util.cli.OptionHandlerFactory.class , valueType ) ; return ( ( com.google.inject.Key < com.google.gerrit.util.cli.OptionHandlerFactory < T > > ) ( com.google.inject.Key.get ( factoryType ) ) ) ; }
Source:
boolean visibleForReplication ( ) { return ( ( getCurrentUser ( ) ) instanceof com.google.gerrit.server.ReplicationUser ) && ( ( ( com.google.gerrit.server.ReplicationUser ) ( getCurrentUser ( ) ) ) . isEverythingVisible ( ) ) ; }

Target:
public com.google.gerrit.server.project.RefControl controlForRef ( java.lang.String refName ) { if ( ( refControls ) == null ) { refControls = new java.util.HashMap < java.lang.String , com.google.gerrit.server.project.RefControl > ( ) ; } com.google.gerrit.server.project.RefControl ctl = refControls.get ( refName ) ; if ( ctl == null ) { com.google.gerrit.server.project.PermissionCollection relevant = com.google.gerrit.server.project.PermissionCollection.filter ( access ( ) , refName , user.getUserName ( ) ) ; ctl = new com.google.gerrit.server.project.RefControl ( this , refName , relevant ) ; refControls.put ( refName , ctl ) ; } return ctl ; }
Source:
protected com.google.gerrit.server.notedb.LoadHandle openHandle ( org.eclipse.jgit.lib.Repository repo ) throws java.io.IOException { if ( ( ( change ) != null ) && ( autoRebuild ) ) { com.google.gerrit.server.notedb.NoteDbChangeState state = com.google.gerrit.server.notedb.NoteDbChangeState.parse ( change ) ; if ( ( state == null ) || ( ! ( state.areDraftsUpToDate ( repo , author ) ) ) ) { return rebuildAndOpen ( repo ) ; } } return super . openHandle ( repo ) ; }

Target:
protected com.google.gerrit.server.notedb.LoadHandle openHandle ( org.eclipse.jgit.lib.Repository repo ) throws java.io.IOException { if ( ( ( change ) != null ) && ( autoRebuild ) ) { com.google.gerrit.server.notedb.NoteDbChangeState state = com.google.gerrit.server.notedb.NoteDbChangeState.parse ( change ) ; if ( ( state == null ) || ( ! ( state.areDraftsUpToDate ( new com.google.gerrit.server.git.RepoRefCache ( repo ) , author ) ) ) ) { return rebuildAndOpen ( repo ) ; } } return super . openHandle ( repo ) ; }
Source:
protected void onLoad ( ) { message.setText ( originalMessage ) ; save.setEnabled ( false ) ; com.google.gwt.core.client.Scheduler.get ( ) . scheduleDeferred ( new com.google.gwt.core.client.Scheduler.ScheduledCommand ( ) { @ java.lang.Override public void execute ( ) { message.setFocus ( true ) ; } } ) ; }

Target:
protected void onLoad ( ) { if ( message.getText ( ) . isEmpty ( ) ) { message.setText ( originalMessage ) ; save.setEnabled ( false ) ; } com.google.gwt.core.client.Scheduler.get ( ) . scheduleDeferred ( new com.google.gwt.core.client.Scheduler.ScheduledCommand ( ) { @ java.lang.Override public void execute ( ) { message.setFocus ( true ) ; } } ) ; }
Source:
public void onSuccess ( com.google.gerrit.client.VoidResult result ) { }

Target:
private com.google.gwt.user.client.ui.Widget createEditIcon ( ) { com.google.gerrit.reviewdb.client.PatchSet.Id id = ( ( idActive ) == null ) ? other.idActive : idActive ; com.google.gwt.user.client.ui.Anchor anchor = new com.google.gwt.user.client.ui.Anchor ( new com.google.gwt.user.client.ui.ImageResourceRenderer ( ) . render ( Gerrit.RESOURCES.edit ( ) ) , ( "#" + ( com.google.gerrit.client.Dispatcher.toEditScreen ( id , path ) ) ) ) ; anchor.setTitle ( PatchUtil.C.edit ( ) ) ; return anchor ; }
Source:
public void canReadCommitWhenAllRefsVisible ( ) throws java.lang.Exception { com.google.gerrit.server.project.Util.allow ( project , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/*" ) ; org.eclipse.jgit.lib.ObjectId id = repo.branch ( "master" ) . commit ( ) . create ( ) ; com.google.gerrit.server.project.ProjectControl pc = newProjectControl ( ) ; org.eclipse.jgit.revwalk.RevWalk rw = repo.getRevWalk ( ) ; org.junit.Assert.assertTrue ( pc.canReadCommit ( db , rw , rw.parseCommit ( id ) ) ) ; }

Target:
public void canReadCommitWhenAllRefsVisible ( ) throws java.lang.Exception { allow ( project , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/*" ) ; org.eclipse.jgit.lib.ObjectId id = repo.branch ( "master" ) . commit ( ) . create ( ) ; com.google.gerrit.server.project.ProjectControl pc = newProjectControl ( ) ; org.eclipse.jgit.revwalk.RevWalk rw = repo.getRevWalk ( ) ; org.eclipse.jgit.lib.Repository r = repo.getRepository ( ) ; org.junit.Assert.assertTrue ( pc.canReadCommit ( db , r , rw.parseCommit ( id ) ) ) ; }
Source:
public void fire ( com.google.gerrit.extensions.common.ChangeInfo change , com.google.gerrit.extensions.common.RevisionInfo revision , com.google.gerrit.extensions.common.AccountInfo uploader ) { if ( ! ( listeners.iterator ( ) . hasNext ( ) ) ) { return ; } com.google.gerrit.server.extensions.events.RevisionCreated.Event event = new com.google.gerrit.server.extensions.events.RevisionCreated.Event ( change , revision , uploader ) ; for ( com.google.gerrit.extensions.events.RevisionCreatedListener l : listeners ) { try { l.onRevisionCreated ( event ) ; } catch ( java.lang.Exception e ) { com.google.gerrit.server.extensions.events.RevisionCreated.log.warn ( "Error in event listener" , e ) ; } } }

Target:
public void fire ( com.google.gerrit.extensions.common.ChangeInfo change , com.google.gerrit.extensions.common.RevisionInfo revision , com.google.gerrit.extensions.common.AccountInfo uploader , java.sql.Timestamp when ) { if ( ! ( listeners.iterator ( ) . hasNext ( ) ) ) { return ; } com.google.gerrit.server.extensions.events.RevisionCreated.Event event = new com.google.gerrit.server.extensions.events.RevisionCreated.Event ( change , revision , uploader , when ) ; for ( com.google.gerrit.extensions.events.RevisionCreatedListener l : listeners ) { try { l.onRevisionCreated ( event ) ; } catch ( java.lang.Exception e ) { com.google.gerrit.server.extensions.events.RevisionCreated.log.warn ( "Error in event listener" , e ) ; } } }
Source:
com.google.gerrit.server.permissions.PermissionBackend.ForChange asForChange ( com.google.gerrit.server.query.change.ChangeData cd ) { return new com.google.gerrit.server.project.ChangeControl.ForChangeImpl ( cd ) ; }

Target:
public boolean isPrivateVisible ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.query.change.ChangeData cd ) throws com.google.gwtorm.server.OrmException { return ( ( ( isOwner ( ) ) || ( isReviewer ( db , cd ) ) ) || ( getRefControl ( ) . canViewPrivateChanges ( ) ) ) || ( getUser ( ) . isInternalUser ( ) ) ; }
Source:
public boolean containsComment ( com.google.gerrit.reviewdb.client.PatchLineComment c ) { com.google.common.collect.Table < com.google.gerrit.reviewdb.client.PatchSet.Id , java.lang.String , com.google.gerrit.reviewdb.client.PatchLineComment > t = ( ( c.getSide ( ) ) == ( ( short ) ( 0 ) ) ) ? getDraftBaseComments ( ) : getDraftPsComments ( ) ; return t.contains ( com.google.gerrit.server.notedb.CommentsInNotesUtil.getCommentPsId ( c ) , c.getKey ( ) . get ( ) ) ; }

Target:
public boolean containsComment ( com.google.gerrit.reviewdb.client.PatchLineComment c ) { for ( com.google.gerrit.reviewdb.client.PatchLineComment existing : comments.values ( ) ) { if ( c.getKey ( ) . equals ( existing.getKey ( ) ) ) { return true ; } } return false ; }
Source:
public static com.google.gwt.event.shared.HandlerRegistration addApplication ( final com.google.gwtexpui.globalkey.client.KeyCommand key ) { com.google.gwtexpui.globalkey.client.GlobalKey.init ( ) ; com.google.gwtexpui.globalkey.client.GlobalKey.keys.add ( key ) ; com.google.gwtexpui.globalkey.client.GlobalKey.keyApplication.add ( key ) ; return new com.google.gwt.event.shared.HandlerRegistration ( ) { @ java.lang.Override public void removeHandler ( ) { com.google.gwtexpui.globalkey.client.GlobalKey.keys.remove ( key ) ; com.google.gwtexpui.globalkey.client.GlobalKey.keyApplication.remove ( key ) ; } } ; }

Target:
public void onKeyPress ( final com.google.gwt.event.dom.client.KeyPressEvent event ) { com.google.gwtexpui.globalkey.client.GlobalKey.active.all.onKeyPress ( event ) ; }
Source:
public int run ( ) throws java.lang.Exception { com.google.gerrit.server.ssh.GerritSshDaemon.startSshd ( ) ; return never ( ) ; }

Target:
public int run ( ) throws java.lang.Exception { final com.google.inject.Injector injector = com.google.inject.Guice.createInjector ( new com.google.gerrit.server.GerritServerModule ( ) , new com.google.gerrit.server.ssh.SshDaemonModule ( ) ) ; com.google.gerrit.client.rpc.Common.setGerritConfig ( injector.getInstance ( com.google.gerrit.client.data.GerritConfig.class ) ) ; injector.getInstance ( com.google.gerrit.server.ssh.GerritSshDaemon.class ) . start ( ) ; return never ( ) ; }
Source:
public void resetToDefaults ( ) { maximumPageSize = com.google.gerrit.reviewdb.client.AccountGeneralPreferences.DEFAULT_PAGESIZE ; showSiteHeader = true ; useFlashClipboard = true ; copySelfOnEmail = false ; reversePatchSetOrder = false ; showUserInReview = false ; downloadUrl = null ; downloadCommand = null ; dateFormat = null ; timeFormat = null ; relativeDateInChangeTable = false ; commentVisibilityStrategy = null ; diffView = null ; changeScreen = null ; }

Target:
public void resetToDefaults ( ) { maximumPageSize = com.google.gerrit.reviewdb.client.AccountGeneralPreferences.DEFAULT_PAGESIZE ; showSiteHeader = true ; useFlashClipboard = true ; copySelfOnEmail = false ; reversePatchSetOrder = false ; showUserInReview = false ; downloadUrl = null ; downloadCommand = null ; dateFormat = null ; timeFormat = null ; relativeDateInChangeTable = false ; commentVisibilityStrategy = null ; diffView = null ; changeScreen = null ; sizeBarInChangeTable = true ; }
Source:
public static void extract ( final java.io.File dst , final java.lang.Class < ? > sibling , final java.lang.String name ) throws java.io.IOException { try ( java.io.InputStream in = com.google.gerrit.pgm.init.api.InitUtil.open ( sibling , name ) ) { if ( in != null ) { java.nio.ByteBuffer buf = org.eclipse.jgit.util.IO.readWholeStream ( in , 8192 ) ; com.google.gerrit.pgm.init.api.InitUtil.copy ( dst , buf ) ; } } }

Target:
public static void extract ( java.nio.file.Path dst , java.lang.Class < ? > sibling , java.lang.String name ) throws java.io.IOException { try ( java.io.InputStream in = com.google.gerrit.pgm.init.api.InitUtil.open ( sibling , name ) ) { if ( in != null ) { com.google.gerrit.pgm.init.api.InitUtil.copy ( dst , com.google.common.io.ByteStreams.toByteArray ( in ) ) ; } } }
Source:
private static boolean sameUpdate ( com.google.gerrit.server.notedb.ChangeRebuilder.Event event , com.google.gerrit.server.notedb.AbstractChangeUpdate update ) { return ( ( ( ( update != null ) && ( ( com.google.gerrit.server.notedb.ChangeRebuilder.round ( event.when ) ) == ( com.google.gerrit.server.notedb.ChangeRebuilder.round ( update.getWhen ( ) ) ) ) ) && ( event.who.equals ( update.getUser ( ) . getAccountId ( ) ) ) ) && ( event.psId.equals ( update.getPatchSetId ( ) ) ) ) && ( ! ( event instanceof com.google.gerrit.server.notedb.ChangeRebuilder.FinalUpdatesEvent ) ) ; }

Target:
com.google.gerrit.server.CurrentUser getUser ( com.google.gerrit.reviewdb.server.ReviewDb db ) { com.google.gerrit.reviewdb.client.Account.Id id = get ( 0 ) . who ; for ( int i = 1 ; i < ( size ( ) ) ; i ++ ) { com.google.common.base.Preconditions.checkState ( java.util.Objects.equals ( id , get ( i ) . who ) , "mismatched users in EventList: %s != %s" , id , get ( i ) . who ) ; } return id != null ? userFactory.create ( com.google.inject.util.Providers.of ( db ) , id ) : internalUserFactory.create ( ) ; }
Source:
public void onSuccess ( final java.util.List < com.google.gerrit.reviewdb.client.AccountSshKey > result ) { keys.display ( result ) ; if ( ( result.isEmpty ( ) ) && ( keys.isVisible ( ) ) ) { showAddKeyBlock ( true ) ; } if ( ( ++ ( loadCount ) ) == 2 ) { display ( ) ; } }

Target:
public void onSuccess ( com.google.gwt.core.client.JsArray < com.google.gerrit.client.account.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:
public com.googlesource.gerrit.plugins.imagare.GetConfig.ConfigInfo apply ( com.google.gerrit.server.config.ConfigResource resource ) { com.googlesource.gerrit.plugins.imagare.GetConfig.ConfigInfo info = new com.googlesource.gerrit.plugins.imagare.GetConfig.ConfigInfo ( ) ; info.defaultProject = com.google.common.base.Objects.firstNonNull ( cfg.getString ( "defaultProject" ) , "All-Projects" ) ; return info ; }

Target:
public com.googlesource.gerrit.plugins.imagare.GetConfig.ConfigInfo apply ( com.google.gerrit.server.config.ConfigResource resource ) { com.googlesource.gerrit.plugins.imagare.GetConfig.ConfigInfo info = new com.googlesource.gerrit.plugins.imagare.GetConfig.ConfigInfo ( ) ; info.defaultProject = com.google.common.base.Objects.firstNonNull ( cfg.getString ( "defaultProject" ) , "All-Projects" ) ; info.linkDecoration = cfg.getEnum ( "linkDecoration" , LinkDecoration.NONE ) ; if ( LinkDecoration.NONE.equals ( info.linkDecoration ) ) { info.linkDecoration = null ; } return info ; }
Source:
public static void patch ( java.lang.String token , final com.google.gerrit.reviewdb.Patch.Key id , final int patchIndex , final com.google.gerrit.common.data.PatchSetDetail patchSetDetail , final com.google.gerrit.client.changes.PatchTable patchTable ) { com.google.gerrit.client.Dispatcher.patch ( token , id , patchIndex , patchSetDetail , patchTable , null ) ; }

Target:
public static void patch ( java.lang.String token , final com.google.gerrit.reviewdb.Patch.Key id , final int patchIndex , final com.google.gerrit.common.data.PatchSetDetail patchSetDetail , final com.google.gerrit.client.changes.PatchTable patchTable , final com.google.gerrit.client.patches.PatchScreen.TopView topView ) { com.google.gerrit.client.Dispatcher.patch ( token , id , patchIndex , patchSetDetail , patchTable , topView , null ) ; }
Source:
public void update ( com.google.gerrit.reviewdb.client.Project.NameKey project ) throws java.io.IOException { try { for ( com.google.common.util.concurrent.CheckedFuture < ? , java.io.IOException > f : new com.google.gerrit.server.change.MergeabilityChecker.ProjectUpdateTask ( schemaFactory , project , false ) . call ( ) ) { f.checkedGet ( ) ; } } catch ( java.lang.Exception e ) { com.google.common.base.Throwables.propagateIfPossible ( e ) ; throw com.google.gerrit.server.change.MergeabilityChecker.MAPPER.apply ( e ) ; } }

Target:
public com.google.gerrit.server.change.MergeabilityChecker.Check addProject ( com.google.gerrit.reviewdb.client.Project.NameKey project ) { projects.add ( project ) ; return this ; }
Source:
protected void onOpenItem ( final com.google.gerrit.client.reviewdb.Patch item ) { com.google.gwt.user.client.History.newItem ( com.google.gerrit.client.Link.toPatchSideBySide ( item.getKey ( ) ) ) ; }

Target:
protected void onOpenRow ( final int row ) { com.google.gwt.user.client.ui.Widget link = table.getWidget ( row , com.google.gerrit.client.changes.PatchTable.MyTable.C_PATH ) ; if ( link instanceof com.google.gwt.user.client.ui.FlowPanel ) { link = ( ( com.google.gwt.user.client.ui.FlowPanel ) ( link ) ) . getWidget ( 0 ) ; } if ( link instanceof com.google.gerrit.client.ui.DirectScreenLink ) { ( ( com.google.gerrit.client.ui.DirectScreenLink ) ( link ) ) . go ( ) ; } }
Source:
public void revisionActionsOneChangePerTopic ( ) throws java.lang.Exception { java.lang.String changeId = createChangeWithTopic ( name ( "foo1" ) ) . getChangeId ( ) ; approve ( changeId ) ; java.util.Map < java.lang.String , com.google.gerrit.extensions.common.ActionInfo > actions = getActions ( changeId ) ; commonActionsAssertions ( actions ) ; noSubmitWholeTopicAssertions ( actions ) ; }

Target:
private PushOneCommit.Result createChangeWithTopic ( org.eclipse.jgit.junit.TestRepository < org.eclipse.jgit.internal.storage.dfs.InMemoryRepository > repo , java.lang.String topic , java.lang.String commitMsg , java.lang.String fileName , java.lang.String content ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , admin.getIdent ( ) , repo , commitMsg , fileName , content ) ; com.google.common.truth.Truth.assertThat ( topic ) . isNotEmpty ( ) ; return push.to ( ( "refs/for/master/" + ( name ( topic ) ) ) ) ; }
Source:
public void handle ( net.codemirror.lib.CodeMirror instance , int line , java.lang.String gutter , com.google.gwt.dom.client.NativeEvent clickEvent ) { if ( ! ( ( cm.hasActiveLine ( ) ) && ( ( instance.getLineNumber ( cm.getActiveLine ( ) ) ) == line ) ) ) { instance.setCursor ( net.codemirror.lib.LineCharacter.create ( line ) ) ; instance.setActiveLine ( cm.getLineHandle ( line ) ) ; } insertNewDraft ( cm ) . run ( ) ; }

Target:
public void run ( ) { com.google.gerrit.client.Gerrit.doSignIn ( getToken ( ) ) ; }
Source:
public com.google.gerrit.server.project.ChangeControl validateFor ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.server.CurrentUser user ) throws com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException { com.google.gerrit.server.project.ChangeControl c = controlFor ( db , change , user ) ; if ( ! ( c.isVisible ( db ) ) ) { throw new com.google.gerrit.server.project.NoSuchChangeException ( c.getId ( ) ) ; } return c ; }

Target:
public com.google.gerrit.server.project.ChangeControl validateFor ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.notedb.ChangeNotes notes , com.google.gerrit.server.CurrentUser user ) throws com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException { com.google.gerrit.server.project.ChangeControl c = controlFor ( notes , user ) ; if ( ! ( c.isVisible ( db ) ) ) { throw new com.google.gerrit.server.project.NoSuchChangeException ( c.getId ( ) ) ; } return c ; }
Source:
protected void onUnload ( ) { if ( ( updateAvailable ) != null ) { updateAvailable.hide ( true ) ; updateAvailable = null ; } if ( ( updateCheck ) != null ) { updateCheck.cancel ( ) ; updateCheck = null ; } for ( com.google.gwt.event.shared.HandlerRegistration h : handlers ) { h.removeHandler ( ) ; } handlers.clear ( ) ; super . onUnload ( ) ; }

Target:
private void initProjectLink ( com.google.gerrit.client.changes.ChangeInfo info ) { projectLink.setText ( info.project ( ) ) ; projectLink.setTargetHistoryToken ( com.google.gerrit.common.PageLinks.toChangeQuery ( com.google.gerrit.common.PageLinks.projectQuery ( info.project_name_key ( ) , info.status ( ) ) ) ) ; }
Source:
private static java.util.List < com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > > predicates ( java.util.Set < com.google.gerrit.reviewdb.client.Change.Id > ids ) { java.util.List < com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > > r = com.google.common.collect.Lists.newArrayListWithCapacity ( ids.size ( ) ) ; for ( com.google.gerrit.reviewdb.client.Change.Id id : ids ) { r.add ( new com.google.gerrit.server.query.change.LegacyChangeIdPredicate ( id ) ) ; } return r ; }

Target:
private static java.util.List < com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > > predicates ( com.google.gerrit.server.index.Schema < com.google.gerrit.server.query.change.ChangeData > schema , java.util.Set < com.google.gerrit.reviewdb.client.Change.Id > ids ) { java.util.List < com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > > r = com.google.common.collect.Lists.newArrayListWithCapacity ( ids.size ( ) ) ; for ( com.google.gerrit.reviewdb.client.Change.Id id : ids ) { r.add ( new com.google.gerrit.server.query.change.LegacyChangeIdPredicate ( schema , id ) ) ; } return r ; }
Source:
private static void unified ( 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 ) { 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 , new com.google.gerrit.client.diff.Unified ( baseId , id.getParentKey ( ) , id.get ( ) , side , line ) ) ; } } ) ; }

Target:
private static void unified ( final java.lang.String token , final com.google.gerrit.client.DiffObject base , final com.google.gerrit.reviewdb.client.Patch.Key id , final com.google.gerrit.client.diff.DisplaySide side , final int line ) { 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 , new com.google.gerrit.client.diff.Unified ( base , com.google.gerrit.client.DiffObject.patchSet ( id.getParentKey ( ) ) , id.get ( ) , side , line ) ) ; } } ) ; }
Source:
void onKeyMap ( @ java.lang.SuppressWarnings ( value = "unused" ) com.google.gwt.event.dom.client.ChangeEvent e ) { com.google.gerrit.extensions.client.KeyMapType keyMapType = com.google.gerrit.extensions.client.KeyMapType.valueOf ( keyMap.getValue ( keyMap.getSelectedIndex ( ) ) ) ; prefs.keyMapType ( keyMapType ) ; if ( ( view ) != null ) { view.getEditor ( ) . setOption ( "keyMap" , keyMapType.name ( ) . toLowerCase ( ) ) ; } }

Target:
void onShowBase ( com.google.gwt.event.logical.shared.ValueChangeEvent < java.lang.Boolean > e ) { java.lang.Boolean value = e.getValue ( ) ; prefs.showBase ( value ) ; if ( ( view ) != null ) { view.showBase.setValue ( value , true ) ; } }
Source:
public java.lang.Void call ( ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.git.UpdateException , com.google.gwtorm.server.OrmException { if ( caller == ( java.lang.Thread.currentThread ( ) ) ) { insertChange ( this . db ) ; } else { try ( com.google.gerrit.reviewdb.server.ReviewDb threadLocalDb = schemaFactory.open ( ) ) { insertChange ( threadLocalDb ) ; } } synchronized ( newProgress ) { newProgress.update ( 1 ) ; } return null ; }

Target:
public java.lang.Void call ( ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.git.UpdateException , com.google.gwtorm.server.OrmException { if ( caller == ( java.lang.Thread.currentThread ( ) ) ) { insertChange ( this . db ) ; } else { try ( com.google.gerrit.reviewdb.server.ReviewDb threadLocalDb = schemaFactory.open ( ) ) { insertChange ( threadLocalDb ) ; } } com.google.gerrit.server.git.ReceiveCommits.synchronizedIncrement ( newProgress ) ; return null ; }
Source:
private void runImpl ( ) throws java.io.IOException { org.eclipse.jgit.transport.Transport tn = org.eclipse.jgit.transport.Transport.open ( git , uri ) ; org.eclipse.jgit.transport.PushResult res ; try { res = pushVia ( tn ) ; } finally { try { tn.close ( ) ; } catch ( java.lang.Throwable e2 ) { com.googlesource.gerrit.plugins.replication.ReplicationQueue.repLog.warn ( ( "Unexpected error while closing " + ( uri ) ) , e2 ) ; } } updateStates ( res.getRemoteUpdates ( ) ) ; }

Target:
private void logCanceledWhileRunningException ( org.eclipse.jgit.errors.TransportException e ) { com.googlesource.gerrit.plugins.replication.ReplicationQueue.repLog.info ( ( ( ( "Cannot replicate to " + ( uri ) ) + "." ) + " It was canceled while running" ) , e ) ; }
Source:
com.google.gerrit.httpd.WebSessionManager.Val get ( final com.google.gerrit.httpd.WebSessionManager.Key key ) { com.google.gerrit.httpd.WebSessionManager.Val val = self.getIfPresent ( key.token ) ; if ( ( val != null ) && ( ( val.expiresAt ) <= ( com.google.gerrit.server.util.TimeUtil.nowMs ( ) ) ) ) { self.invalidate ( key.token ) ; return null ; } return val ; }

Target:
com.google.gerrit.httpd.WebSessionManager.Val get ( final com.google.gerrit.httpd.WebSessionManager.Key key ) { com.google.gerrit.httpd.WebSessionManager.Val val = self.getIfPresent ( key.token ) ; if ( ( val != null ) && ( ( val.expiresAt ) <= ( com.google.gerrit.common.TimeUtil.nowMs ( ) ) ) ) { self.invalidate ( key.token ) ; return null ; } return val ; }
Source:
com.google.gerrit.server.account.externalids.ExternalId get ( com.google.gerrit.server.account.externalids.ExternalId.Key key , org.eclipse.jgit.lib.ObjectId rev ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { checkReadEnabled ( ) ; if ( rev.equals ( org.eclipse.jgit.lib.ObjectId.zeroId ( ) ) ) { return null ; } try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( allUsersName ) ; org.eclipse.jgit.revwalk.RevWalk rw = new org.eclipse.jgit.revwalk.RevWalk ( repo ) ) { return com.google.gerrit.server.account.externalids.ExternalIdReader.parse ( key , rw , rev ) ; } }

Target:
java.util.Set < com.google.gerrit.server.account.externalids.ExternalId > all ( ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { checkReadEnabled ( ) ; try ( com.google.gerrit.metrics.Timer0.Context ctx = readAllLatency.start ( ) ; org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( allUsersName ) ) { return com.google.gerrit.server.account.externalids.ExternalIdNotes.loadReadOnly ( repo ) . all ( ) ; } }
Source:
private static boolean cacheForever ( final java.lang.String pathInfo ) { if ( pathInfo.endsWith ( ".cache.gif" ) ) { return true ; } if ( pathInfo.endsWith ( ".cache.html" ) ) { return true ; } if ( pathInfo.endsWith ( ".cache.png" ) ) { return true ; } return false ; }

Target:
private static boolean cacheForever ( final java.lang.String pathInfo ) { if ( pathInfo.endsWith ( ".cache.gif" ) ) { return true ; } if ( pathInfo.endsWith ( ".cache.html" ) ) { return true ; } if ( pathInfo.endsWith ( ".cache.png" ) ) { return true ; } if ( pathInfo.endsWith ( ".cache.jar" ) ) { return true ; } return false ; }
Source:
boolean isStale ( java.nio.file.Path p , com.google.gerrit.httpd.raw.ResourceServlet rs ) throws java.io.IOException { java.nio.file.attribute.FileTime t = rs.getLastModifiedTime ( p ) ; return ( ( ( t.toMillis ( ) ) == 0 ) || ( ( lastModified.toMillis ( ) ) == 0 ) ) || ( ! ( lastModified.equals ( t ) ) ) ; }

Target:
boolean isStale ( java.nio.file.Path p , com.google.gerrit.httpd.raw.ResourceServlet rs ) throws java.io.IOException { java.nio.file.attribute.FileTime t ; try { t = rs.getLastModifiedTime ( p ) ; } catch ( java.nio.file.NoSuchFileException e ) { return ( this ) != ( com.google.gerrit.httpd.raw.ResourceServlet.Resource.NOT_FOUND ) ; } return ( ( ( t.toMillis ( ) ) == 0 ) || ( ( lastModified.toMillis ( ) ) == 0 ) ) || ( ! ( lastModified.equals ( t ) ) ) ; }
Source:
private com.google.gerrit.client.diff.DraftBox addNewDraft ( net.codemirror.lib.CodeMirror cm , int line ) { return addDraftBox ( com.google.gerrit.client.changes.CommentInfo.createRange ( path , getSideFromCm ( cm ) , ( line + 1 ) , null , null , null ) ) ; }

Target:
private com.google.gerrit.client.diff.DraftBox addNewDraft ( net.codemirror.lib.CodeMirror cm , int line , net.codemirror.lib.TextMarker.FromTo fromTo ) { com.google.gerrit.client.diff.SideBySide2.DisplaySide side = getSideFromCm ( cm ) ; return addDraftBox ( com.google.gerrit.client.changes.CommentInfo.createRange ( path , getStoredSideFromDisplaySide ( side ) , ( line + 1 ) , null , null , com.google.gerrit.client.diff.CommentRange.create ( fromTo ) ) , side ) ; }
Source:
public void myAccount ( final com.google.gwtjsonrpc.common.AsyncCallback < com.google.gerrit.reviewdb.client.Account > callback ) { callback.onSuccess ( currentUser.get ( ) . getAccount ( ) ) ; }

Target:
public void myAccount ( final com.google.gwtjsonrpc.common.AsyncCallback < com.google.gerrit.reviewdb.client.Account > callback ) { run ( callback , new com.google.gerrit.httpd.rpc.account.Action < com.google.gerrit.reviewdb.client.Account > ( ) { @ java.lang.Override public com.google.gerrit.reviewdb.client.Account run ( com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { return db.accounts ( ) . get ( currentUser.get ( ) . getAccountId ( ) ) ; } } ) ; }
Source:
protected void setUp ( ) throws java.lang.Exception { repo = new org.eclipse.jgit.junit.TestRepository < org.eclipse.jgit.internal.storage.dfs.DfsRepository > ( new org.eclipse.jgit.internal.storage.dfs.InMemoryRepository ( new org.eclipse.jgit.internal.storage.dfs.DfsRepositoryDescription ( "test" ) ) ) ; servlet = new com.google.gitiles.RepositoryIndexServlet ( new com.google.gitiles.DefaultRenderer ( ) , new com.google.gitiles.TestGitilesAccess ( repo.getRepository ( ) ) , new com.google.gitiles.TimeCache ( ) ) ; }

Target:
protected void setUp ( ) throws java.lang.Exception { repo = new org.eclipse.jgit.junit.TestRepository < org.eclipse.jgit.internal.storage.dfs.DfsRepository > ( new org.eclipse.jgit.internal.storage.dfs.InMemoryRepository ( new org.eclipse.jgit.internal.storage.dfs.DfsRepositoryDescription ( "test" ) ) ) ; servlet = new com.google.gitiles.RepositoryIndexServlet ( new org.eclipse.jgit.lib.Config ( ) , new com.google.gitiles.DefaultRenderer ( ) , new com.google.gitiles.TestGitilesAccess ( repo.getRepository ( ) ) , new com.google.gitiles.TimeCache ( ) ) ; }
Source:
public java.util.Collection < com.google.gerrit.reviewdb.client.PatchSet > visiblePatchSets ( ) throws com.google.gwtorm.server.OrmException { return com.google.common.collect.FluentIterable.from ( patchSets ( ) ) . filter ( new com.google.common.base.Predicate < com.google.gerrit.reviewdb.client.PatchSet > ( ) { @ java.lang.Override public boolean apply ( com.google.gerrit.reviewdb.client.PatchSet input ) { try { return changeControl ( ) . isPatchVisible ( input , db ) ; } catch ( com.google.gwtorm.server.OrmException e ) { return false ; } } } ) . toList ( ) ; }

Target:
public java.util.Collection < com.google.gerrit.reviewdb.client.PatchSet > visiblePatchSets ( ) throws com.google.gwtorm.server.OrmException { com.google.common.base.Predicate < com.google.gerrit.reviewdb.client.PatchSet > predicate = new com.google.common.base.Predicate < com.google.gerrit.reviewdb.client.PatchSet > ( ) { @ java.lang.Override public boolean apply ( com.google.gerrit.reviewdb.client.PatchSet input ) { try { return changeControl ( ) . isPatchVisible ( input , db ) ; } catch ( com.google.gwtorm.server.OrmException e ) { return false ; } } } ; return com.google.common.collect.FluentIterable.from ( patchSets ( ) ) . filter ( predicate ) . toList ( ) ; }
Source:
protected void configure ( ) { bind ( new com.google.inject.TypeLiteral < com.google.common.base.Optional < com.ericsson.gerrit.plugins.highavailability.peers.PeerInfo > > ( ) { } ) . toProvider ( com.ericsson.gerrit.plugins.highavailability.peers.PeerInfoProvider.class ) ; listener ( ) . to ( com.ericsson.gerrit.plugins.highavailability.peers.JGroupsPeerInfoProvider.class ) ; }

Target:
protected void configure ( ) { bind ( new com.google.inject.TypeLiteral < java.util.Optional < com.ericsson.gerrit.plugins.highavailability.peers.PeerInfo > > ( ) { } ) . toProvider ( com.ericsson.gerrit.plugins.highavailability.peers.PeerInfoProvider.class ) ; if ( ( strategy ) == ( Configuration.PeerInfoStrategy.JGROUPS ) ) { listener ( ) . to ( com.ericsson.gerrit.plugins.highavailability.peers.jgroups.JGroupsPeerInfoProvider.class ) ; } }
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:
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 , @ com.google.gerrit.common.Nullable org.eclipse.jgit.revwalk.RevWalk rw , @ com.google.gerrit.common.Nullable org.eclipse.jgit.lib.Config repoConfig ) throws com.google.gwtorm.server.OrmException { return getForPatchSet ( db , ctl , psId , rw , repoConfig , java.util.Collections.< com.google.gerrit.reviewdb.client.PatchSetApproval > emptyList ( ) ) ; }
Source:
public static com.google.gerrit.server.index.IndexConfig create ( int maxLimit , int maxPages , int maxTerms ) { return new com.google.gerrit.server.index.AutoValue_IndexConfig ( com.google.gerrit.server.index.IndexConfig.checkLimit ( maxLimit , "maxLimit" , java.lang.Integer.MAX_VALUE ) , com.google.gerrit.server.index.IndexConfig.checkLimit ( maxPages , "maxPages" , java.lang.Integer.MAX_VALUE ) , com.google.gerrit.server.index.IndexConfig.checkLimit ( maxTerms , "maxTerms" , com.google.gerrit.server.index.IndexConfig.DEFAULT_MAX_TERMS ) ) ; }

Target:
public com.google.gerrit.server.index.IndexConfig build ( ) { com.google.gerrit.server.index.IndexConfig cfg = autoBuild ( ) ; com.google.gerrit.server.index.IndexConfig.checkLimit ( cfg.maxLimit ( ) , "maxLimit" ) ; com.google.gerrit.server.index.IndexConfig.checkLimit ( cfg.maxPages ( ) , "maxPages" ) ; com.google.gerrit.server.index.IndexConfig.checkLimit ( cfg.maxTerms ( ) , "maxTerms" ) ; return cfg ; }
Source:
public com.google.gerrit.server.notedb.ChangeNotes createFromIdOnlyWhenNotedbDisabled ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Change.Id changeId ) throws com.google.gwtorm.server.OrmException { com.google.common.base.Preconditions.checkState ( ( ! ( migration.readChanges ( ) ) ) , ( "do not call" + " createFromIdOnlyWhenNotedbDisabled when notedb is enabled" ) ) ; com.google.gerrit.reviewdb.client.Change change = com.google.gerrit.server.notedb.ChangeNotes.Factory.unwrap ( db ) . changes ( ) . get ( changeId ) ; return new com.google.gerrit.server.notedb.ChangeNotes ( repoManager , migration , allUsers , noteUtil , change.getProject ( ) , change ) . load ( ) ; }

Target:
public com.google.gerrit.server.notedb.ChangeNotes createFromIdOnlyWhenNoteDbDisabled ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Change.Id changeId ) throws com.google.gwtorm.server.OrmException { com.google.common.base.Preconditions.checkState ( ( ! ( migration.readChanges ( ) ) ) , ( "do not call" + " createFromIdOnlyWhenNoteDbDisabled when NoteDb is enabled" ) ) ; com.google.gerrit.reviewdb.client.Change change = com.google.gerrit.server.notedb.ChangeNotes.Factory.unwrap ( db ) . changes ( ) . get ( changeId ) ; return new com.google.gerrit.server.notedb.ChangeNotes ( repoManager , migration , allUsers , noteUtil , change.getProject ( ) , change ) . load ( ) ; }