auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public com.googlecode.prolog_cafe.builtin.Operation exec ( com.googlecode.prolog_cafe.builtin.Prolog engine ) { engine.setB0 ( ) ; com.googlecode.prolog_cafe.builtin.Term a1 ; a1 = arg1 ; a1 = a1.dereference ( ) ; if ( a1.isVariable ( ) ) throw new com.googlecode.prolog_cafe.builtin.PInstantiationException ( this , 1 ) ; if ( ! ( a1.isInteger ( ) ) ) throw new com.googlecode.prolog_cafe.builtin.IllegalTypeException ( this , 1 , "integer" , a1 ) ; engine.halt = 1 + ( ( ( com.googlecode.prolog_cafe.builtin.IntegerTerm ) ( a1 ) ) . intValue ( ) ) ; return cont ; }

Target:
public com.googlecode.prolog_cafe.builtin.Operation exec ( com.googlecode.prolog_cafe.builtin.Prolog engine ) { engine.setB0 ( ) ; com.googlecode.prolog_cafe.builtin.Term a1 ; a1 = arg1 ; a1 = a1.dereference ( ) ; if ( a1.isVariable ( ) ) throw new com.googlecode.prolog_cafe.exceptions.PInstantiationException ( this , 1 ) ; if ( ! ( a1.isInteger ( ) ) ) throw new com.googlecode.prolog_cafe.exceptions.IllegalTypeException ( this , 1 , "integer" , a1 ) ; engine.halt = 1 + ( ( ( com.googlecode.prolog_cafe.builtin.IntegerTerm ) ( a1 ) ) . intValue ( ) ) ; return cont ; }
Source:
protected void configure ( ) { bind ( com.google.inject.Key.get ( javax.sql.DataSource.class , com.google.inject.name.Names.named ( "ReviewDb" ) ) ) . toProvider ( com.google.gerrit.httpd.ReviewDbDataSourceProvider.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; listener ( ) . to ( com.google.gerrit.httpd.ReviewDbDataSourceProvider.class ) ; }

Target:
protected void configure ( ) { bind ( com.google.gerrit.server.schema.DataSourceType.class ) . toInstance ( dst ) ; bind ( DataSourceProvider.Context.class ) . toInstance ( DataSourceProvider.Context.MULTI_USER ) ; bind ( com.google.inject.Key.get ( javax.sql.DataSource.class , com.google.inject.name.Names.named ( "ReviewDb" ) ) ) . toProvider ( com.google.gerrit.server.schema.DataSourceProvider.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; listener ( ) . to ( com.google.gerrit.server.schema.DataSourceProvider.class ) ; }
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 abstract com.google.gerrit.server.index.IndexConfig.Builder maxPages ( int maxPages ) ;
Source:
private com.google.gerrit.server.account.AccountState missing ( com.google.gerrit.reviewdb.client.Account.Id accountId ) { com.google.gerrit.reviewdb.client.Account account = new com.google.gerrit.reviewdb.client.Account ( accountId , com.google.gerrit.common.TimeUtil.nowTs ( ) ) ; account.setActive ( false ) ; return new com.google.gerrit.server.account.AccountState ( allUsersName , account , java.util.Collections.emptySet ( ) , new java.util.HashMap < > ( ) ) ; }

Target:
private com.google.gerrit.server.account.AccountState missing ( com.google.gerrit.reviewdb.client.Account.Id accountId ) { com.google.gerrit.reviewdb.client.Account account = new com.google.gerrit.reviewdb.client.Account ( accountId , com.google.gerrit.common.TimeUtil.nowTs ( ) ) ; account.setActive ( false ) ; return new com.google.gerrit.server.account.AccountState ( allUsersName , account , java.util.Collections.emptySet ( ) , new java.util.HashMap < > ( ) , com.google.gerrit.extensions.client.GeneralPreferencesInfo.defaults ( ) ) ; }
Source:
protected void configureServlets ( ) { install ( new com.google.gerrit.server.config.FactoryModule ( ) { @ java.lang.Override protected void configure ( ) { factory ( AgreementInfoFactory.Factory.class ) ; factory ( ExternalIdDetailFactory.Factory.class ) ; } } ) ; rpc ( com.google.gerrit.server.rpc.account.AccountSecurityImpl.class ) ; rpc ( com.google.gerrit.server.rpc.account.AccountServiceImpl.class ) ; }

Target:
protected void configureServlets ( ) { install ( new com.google.gerrit.server.config.FactoryModule ( ) { @ java.lang.Override protected void configure ( ) { factory ( AgreementInfoFactory.Factory.class ) ; factory ( ExternalIdDetailFactory.Factory.class ) ; factory ( GroupDetailFactory.Factory.class ) ; } } ) ; rpc ( com.google.gerrit.server.rpc.account.AccountSecurityImpl.class ) ; rpc ( com.google.gerrit.server.rpc.account.AccountServiceImpl.class ) ; rpc ( com.google.gerrit.server.rpc.account.GroupAdminServiceImpl.class ) ; }
Source:
protected void configureServlets ( ) { com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.extensions.webui.WebUiPlugin.class ) . toInstance ( new com.google.gerrit.extensions.webui.GwtPlugin ( "imagare" ) ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.extensions.webui.WebUiPlugin.class ) . toInstance ( new com.google.gerrit.extensions.webui.JavaScriptPlugin ( "imagare.js" ) ) ; }

Target:
protected void configureServlets ( ) { serveRegex ( ( ( "^" + ( ImageServlet.PATH_PREFIX ) ) + "(.+)?$" ) ) . with ( com.googlesource.gerrit.plugins.imagare.ImageServlet.class ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.extensions.webui.WebUiPlugin.class ) . toInstance ( new com.google.gerrit.extensions.webui.GwtPlugin ( "imagare" ) ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.extensions.webui.WebUiPlugin.class ) . toInstance ( new com.google.gerrit.extensions.webui.JavaScriptPlugin ( "imagare.js" ) ) ; }
Source:
public static byte [ ] readBytes ( final java.io.InputStream input ) throws java.io.IOException { final int len = com.google.gerrit.server.ioutil.BasicSerialization.readVarInt32 ( input ) ; if ( len == 0 ) { return com.google.gerrit.server.ioutil.BasicSerialization.NO_BYTES ; } final byte [ ] buf = new byte [ len ] ; org.eclipse.jgit.util.NB.readFully ( input , buf , 0 , len ) ; return buf ; }

Target:
public static byte [ ] readBytes ( final java.io.InputStream input ) throws java.io.IOException { final int len = com.google.gerrit.server.ioutil.BasicSerialization.readVarInt32 ( input ) ; if ( len == 0 ) { return com.google.gerrit.server.ioutil.BasicSerialization.NO_BYTES ; } final byte [ ] buf = new byte [ len ] ; org.eclipse.jgit.util.IO.readFully ( input , buf , 0 , len ) ; return buf ; }
Source:
private void ensurePermitted ( com.google.gerrit.server.project.ChangeControl changeControl ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gwtorm.server.OrmException { if ( ! ( changeControl.canAddPatchSet ( reviewDb.get ( ) ) ) ) { throw new com.google.gerrit.extensions.restapi.AuthException ( "Not allowed to edit a change." ) ; } }

Target:
private void assertCanEdit ( com.google.gerrit.server.project.ChangeControl changeControl ) 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 ( changeControl.getNotes ( ) ) . 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 ) ; } }
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.reviewdb.client.Change.Id changeId , com.google.gerrit.server.CurrentUser user ) throws com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException { return validateFor ( db , notesFactory.createChecked ( changeId ) , user ) ; }
Source:
private com.google.gerrit.server.git.BatchUpdate.ChangeContext newChangeContext ( com.google.gerrit.reviewdb.server.ReviewDb db , org.eclipse.jgit.lib.Repository repo , org.eclipse.jgit.revwalk.RevWalk rw , com.google.gerrit.reviewdb.client.Change.Id id ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = newChanges.get ( id ) ; if ( c == null ) { c = com.google.gerrit.reviewdb.server.ReviewDbUtil.unwrapDb ( db ) . changes ( ) . get ( id ) ; } com.google.gerrit.server.notedb.ChangeNotes notes = changeNotesFactory.createForBatchUpdate ( c ) ; com.google.gerrit.server.project.ChangeControl ctl = changeControlFactory.controlFor ( notes , user ) ; return new com.google.gerrit.server.git.BatchUpdate.ChangeContext ( ctl , new com.google.gerrit.server.git.BatchUpdateReviewDb ( db ) , repo , rw ) ; }

Target:
private com.google.gerrit.server.git.BatchUpdate.ChangeContext newChangeContext ( com.google.gerrit.reviewdb.server.ReviewDb db , org.eclipse.jgit.lib.Repository repo , org.eclipse.jgit.revwalk.RevWalk rw , com.google.gerrit.reviewdb.client.Change.Id id ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = newChanges.get ( id ) ; if ( c == null ) { c = com.google.gerrit.server.notedb.ChangeNotes.readOneReviewDbChange ( db , id ) ; } com.google.gerrit.server.notedb.ChangeNotes notes = changeNotesFactory.createForBatchUpdate ( c ) ; com.google.gerrit.server.project.ChangeControl ctl = changeControlFactory.controlFor ( notes , user ) ; return new com.google.gerrit.server.git.BatchUpdate.ChangeContext ( ctl , new com.google.gerrit.server.git.BatchUpdateReviewDb ( db ) , repo , rw ) ; }
Source:
protected void bccWatchesNotifyAllComments ( ) { if ( ( db ) != null ) { try { final com.google.gerrit.client.reviewdb.Project project = getProject ( ) ; if ( project != null ) { for ( com.google.gerrit.client.reviewdb.AccountProjectWatch w : db.accountProjectWatches ( ) . notifyAllComments ( project.getId ( ) ) ) { add ( RecipientType.BCC , w.getAccountId ( ) ) ; } } } catch ( com.google.gwtorm.client.OrmException err ) { } } }

Target:
protected void bccWatchesNotifyAllComments ( ) { if ( ( db ) != null ) { try { final com.google.gerrit.server.project.ProjectState ps = getProjectState ( ) ; if ( ps != null ) { for ( final com.google.gerrit.client.reviewdb.AccountProjectWatch w : db.accountProjectWatches ( ) . notifyAllComments ( ps.getProject ( ) . getNameKey ( ) ) ) { add ( RecipientType.BCC , w.getAccountId ( ) ) ; } } } catch ( com.google.gwtorm.client.OrmException err ) { } } }
Source:
boolean wouldPushRef ( java.lang.String ref ) { if ( ( ! ( replicatePermissions ) ) && ( GitRepositoryManager.REF_CONFIG.equals ( ref ) ) ) { return false ; } for ( org.eclipse.jgit.transport.RefSpec s : remote.getPushRefSpecs ( ) ) { if ( s.matchSource ( ref ) ) { return true ; } } return false ; }

Target:
boolean wouldPushRef ( java.lang.String ref ) { if ( ( ! ( replicatePermissions ) ) && ( RefNames.REFS_CONFIG.equals ( ref ) ) ) { return false ; } for ( org.eclipse.jgit.transport.RefSpec s : remote.getPushRefSpecs ( ) ) { if ( s.matchSource ( ref ) ) { return true ; } } return false ; }
Source:
public int compareTo ( com.googlecode.prolog_cafe.lang.Term anotherTerm ) { if ( ( val ) != ( this ) ) return val.compareTo ( anotherTerm ) ; if ( ! ( anotherTerm.isVariable ( ) ) ) return BEFORE ; if ( ( this ) == anotherTerm ) return EQUAL ; int x = ( this . hashCode ( ) ) - ( ( ( com.googlecode.prolog_cafe.lang.VariableTerm ) ( anotherTerm ) ) . hashCode ( ) ) ; if ( x != 0 ) return x ; throw new com.googlecode.prolog_cafe.lang.InternalException ( "VariableTerm is not unique" ) ; }

Target:
public int compareTo ( com.googlecode.prolog_cafe.lang.Term anotherTerm ) { if ( ( val ) != ( this ) ) return val.compareTo ( anotherTerm ) ; if ( ! ( anotherTerm.isVariable ( ) ) ) return BEFORE ; if ( ( this ) == anotherTerm ) return EQUAL ; int x = ( this . hashCode ( ) ) - ( ( ( com.googlecode.prolog_cafe.lang.VariableTerm ) ( anotherTerm ) ) . hashCode ( ) ) ; if ( x != 0 ) return x ; throw new com.googlecode.prolog_cafe.exceptions.InternalException ( "VariableTerm is not unique" ) ; }
Source:
public com.google.gerrit.extensions.common.PluginInfo apply ( com.google.gerrit.server.plugins.PluginResource resource , com.google.gerrit.server.plugins.DisablePlugin.Input input ) throws com.google.gerrit.extensions.restapi.RestApiException { try { permissionBackend.user ( user ) . check ( GlobalPermission.ADMINISTRATE_SERVER ) ; } catch ( com.google.gerrit.server.permissions.PermissionBackendException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Could not check permission" , e ) ; } if ( ! ( loader.isRemoteAdminEnabled ( ) ) ) { throw new com.google.gerrit.extensions.restapi.MethodNotAllowedException ( "remote plugin administration is disabled" ) ; } java.lang.String name = resource.getName ( ) ; loader.disablePlugins ( com.google.common.collect.ImmutableSet.of ( name ) ) ; return com.google.gerrit.server.plugins.ListPlugins.toPluginInfo ( loader.get ( name ) ) ; }

Target:
public com.google.gerrit.extensions.common.PluginInfo apply ( com.google.gerrit.server.plugins.PluginResource resource , com.google.gerrit.server.plugins.DisablePlugin.Input input ) throws com.google.gerrit.extensions.restapi.RestApiException { try { permissionBackend.user ( user ) . check ( GlobalPermission.ADMINISTRATE_SERVER ) ; } catch ( com.google.gerrit.server.permissions.PermissionBackendException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Could not check permission" , e ) ; } loader.checkRemoteAdminEnabled ( ) ; java.lang.String name = resource.getName ( ) ; loader.disablePlugins ( com.google.common.collect.ImmutableSet.of ( name ) ) ; return com.google.gerrit.server.plugins.ListPlugins.toPluginInfo ( loader.get ( name ) ) ; }
Source:
public void testReplaceLocalName ( ) { final com.google.gerrit.server.ParamertizedString p = new com.google.gerrit.server.ParamertizedString ( "${a.localPart}" ) ; assertEquals ( 1 , p.getParameterNames ( ) . size ( ) ) ; assertTrue ( p.getParameterNames ( ) . contains ( "a" ) ) ; final java.util.Map < java.lang.String , java.lang.String > a = new java.util.HashMap < java.lang.String , java.lang.String > ( ) ; a.put ( "a" , "foo@example.com" ) ; assertNotNull ( p.bind ( a ) ) ; assertEquals ( 1 , p.bind ( a ) . length ) ; assertEquals ( "foo" , p.bind ( a ) [ 0 ] ) ; assertEquals ( "foo" , p.replace ( a ) ) ; a.put ( "a" , "foo" ) ; assertNotNull ( p.bind ( a ) ) ; assertEquals ( 1 , p.bind ( a ) . length ) ; assertEquals ( "foo" , p.bind ( a ) [ 0 ] ) ; assertEquals ( "foo" , p.replace ( a ) ) ; }

Target:
public void testReplaceLocalName ( ) { final com.google.gerrit.common.data.ParamertizedString p = new com.google.gerrit.common.data.ParamertizedString ( "${a.localPart}" ) ; assertEquals ( 1 , p.getParameterNames ( ) . size ( ) ) ; assertTrue ( p.getParameterNames ( ) . contains ( "a" ) ) ; final java.util.Map < java.lang.String , java.lang.String > a = new java.util.HashMap < java.lang.String , java.lang.String > ( ) ; a.put ( "a" , "foo@example.com" ) ; assertNotNull ( p.bind ( a ) ) ; assertEquals ( 1 , p.bind ( a ) . length ) ; assertEquals ( "foo" , p.bind ( a ) [ 0 ] ) ; assertEquals ( "foo" , p.replace ( a ) ) ; a.put ( "a" , "foo" ) ; assertNotNull ( p.bind ( a ) ) ; assertEquals ( 1 , p.bind ( a ) . length ) ; assertEquals ( "foo" , p.bind ( a ) [ 0 ] ) ; assertEquals ( "foo" , p.replace ( a ) ) ; }
Source:
private static void addResourceStateHeaders ( javax.servlet.http.HttpServletResponse res , com.google.gerrit.extensions.restapi.RestResource rsrc ) { if ( rsrc instanceof com.google.gerrit.extensions.restapi.RestResource.HasLastModified ) { res.setDateHeader ( com.google.common.net.HttpHeaders.LAST_MODIFIED , ( ( com.google.gerrit.extensions.restapi.RestResource.HasLastModified ) ( rsrc ) ) . getLastModified ( ) . getTime ( ) ) ; } }

Target:
private static void addResourceStateHeaders ( javax.servlet.http.HttpServletResponse res , com.google.gerrit.extensions.restapi.RestResource rsrc ) { if ( rsrc instanceof com.google.gerrit.extensions.restapi.RestResource.HasETag ) { res.setHeader ( com.google.common.net.HttpHeaders.ETAG , ( ( com.google.gerrit.extensions.restapi.RestResource.HasETag ) ( rsrc ) ) . getETag ( ) ) ; } if ( rsrc instanceof com.google.gerrit.extensions.restapi.RestResource.HasLastModified ) { res.setDateHeader ( com.google.common.net.HttpHeaders.LAST_MODIFIED , ( ( com.google.gerrit.extensions.restapi.RestResource.HasLastModified ) ( rsrc ) ) . getLastModified ( ) . getTime ( ) ) ; } }
Source:
private com.google.gerrit.sshd.SshSession newSession ( ) { return new com.google.gerrit.sshd.SshSession ( session , session.getRemoteAddress ( ) , userFactory.create ( AccessPath.GIT , new com.google.inject.Provider < java.net.SocketAddress > ( ) { @ java.lang.Override public java.net.SocketAddress get ( ) { return session.getRemoteAddress ( ) ; } } , user.getAccountId ( ) ) ) ; }

Target:
private com.google.gerrit.sshd.SshSession newSession ( ) { com.google.gerrit.sshd.SshSession n = new com.google.gerrit.sshd.SshSession ( session , session.getRemoteAddress ( ) , userFactory.create ( session.getRemoteAddress ( ) , user.getAccountId ( ) ) ) ; n.setAccessPath ( AccessPath.GIT ) ; return n ; }
Source:
public void manualCertificationMatchesExternalId ( ) throws java.lang.Exception { addExternalId ( "foo" , "myId" , null ) ; com.google.gerrit.gpg.GerritPublicKeyChecker checker = checkerFactory.create ( user ) ; assertNoProblems ( checker.check ( com.google.gerrit.gpg.testutil.TestKeys.validKeyWithSecondUserId ( ) . getPublicKey ( ) ) ) ; }

Target:
public void manualCertificationMatchesExternalId ( ) throws java.lang.Exception { addExternalId ( "foo" , "myId" , null ) ; com.google.gerrit.gpg.PublicKeyChecker checker = checkerFactory.create ( ) . setExpectedUser ( user ) . disableTrust ( ) ; assertNoProblems ( checker.check ( com.google.gerrit.gpg.testutil.TestKeys.validKeyWithSecondUserId ( ) . getPublicKey ( ) ) ) ; }
Source:
public void index ( com.google.gerrit.server.query.change.ChangeData cd ) throws java.io.IOException { try { new com.google.gerrit.server.index.ChangeIndexer.Task ( cd , false ) . call ( ) ; } catch ( java.lang.RuntimeException e ) { throw e ; } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.index.ChangeIndexer.MAPPER.apply ( e ) ; } }

Target:
public void index ( com.google.gerrit.server.query.change.ChangeData cd ) throws java.io.IOException { for ( com.google.gerrit.server.index.ChangeIndex i : getWriteIndexes ( ) ) { i.replace ( cd ) ; } }
Source:
private void addExternalId ( java.lang.String scheme , java.lang.String id , java.lang.String email ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.AccountExternalId extId = new com.google.gerrit.reviewdb.client.AccountExternalId ( user.getAccountId ( ) , new com.google.gerrit.reviewdb.client.AccountExternalId.Key ( scheme , id ) ) ; if ( email != null ) { extId.setEmailAddress ( email ) ; } db.accountExternalIds ( ) . insert ( java.util.Collections.singleton ( extId ) ) ; reloadUser ( ) ; }

Target:
private void addExternalId ( java.lang.String scheme , java.lang.String id , java.lang.String email ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.AccountExternalId extId = new com.google.gerrit.reviewdb.client.AccountExternalId ( user.getAccountId ( ) , new com.google.gerrit.reviewdb.client.AccountExternalId.Key ( scheme , id ) ) ; if ( email != null ) { extId.setEmailAddress ( email ) ; } db.accountExternalIds ( ) . insert ( java.util.Collections.singleton ( extId ) ) ; externalIdCache.onCreate ( extId ) ; reloadUser ( ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { mergeResults = com.google.common.collect.Maps.newHashMap ( ) ; com.google.gerrit.server.CurrentUser listenerUser = factory.create ( user.id ) ; hooks.addChangeListener ( new com.google.gerrit.common.ChangeListener ( ) { @ java.lang.Override public void onChangeEvent ( com.google.gerrit.server.events.ChangeEvent event ) { if ( event instanceof com.google.gerrit.server.events.ChangeMergedEvent ) { com.google.gerrit.server.events.ChangeMergedEvent cMEvent = ( ( com.google.gerrit.server.events.ChangeMergedEvent ) ( event ) ) ; mergeResults.put ( cMEvent.change.number , cMEvent.newRev ) ; } } } , listenerUser ) ; project = new com.google.gerrit.reviewdb.client.Project.NameKey ( "p2" ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { mergeResults = com.google.common.collect.Maps.newHashMap ( ) ; com.google.gerrit.server.CurrentUser listenerUser = factory.create ( user.id ) ; hooks.addEventListener ( new com.google.gerrit.common.EventListener ( ) { @ java.lang.Override public void onEvent ( com.google.gerrit.server.events.Event event ) { if ( event instanceof com.google.gerrit.server.events.ChangeMergedEvent ) { com.google.gerrit.server.events.ChangeMergedEvent changeMergedEvent = ( ( com.google.gerrit.server.events.ChangeMergedEvent ) ( event ) ) ; mergeResults.put ( changeMergedEvent.change.number , changeMergedEvent.newRev ) ; } } } , listenerUser ) ; project = new com.google.gerrit.reviewdb.client.Project.NameKey ( "p2" ) ; }
Source:
public java.util.List < com.google.gerrit.server.project.ProjectJson.ProjectInfo > apply ( com.google.gerrit.server.project.ProjectResource rsrc ) { java.util.List < com.google.gerrit.server.project.ProjectJson.ProjectInfo > childProjects = com.google.common.collect.Lists.newArrayList ( ) ; for ( com.google.gerrit.reviewdb.client.Project.NameKey projectName : projectCache.all ( ) ) { com.google.gerrit.server.project.ProjectState e = projectCache.get ( projectName ) ; if ( e == null ) { continue ; } if ( rsrc.getNameKey ( ) . equals ( e.getProject ( ) . getParent ( allProjects ) ) ) { childProjects.add ( json.format ( e.getProject ( ) ) ) ; } } return childProjects ; }

Target:
public java.util.List < com.google.gerrit.server.project.ProjectJson.ProjectInfo > apply ( com.google.gerrit.server.project.ProjectResource rsrc ) { if ( recursive ) { return getChildProjectsRecursively ( rsrc.getNameKey ( ) , rsrc.getControl ( ) . getCurrentUser ( ) ) ; } else { return getDirectChildProjects ( rsrc.getNameKey ( ) ) ; } }
Source:
public com.googlecode.prolog_cafe.lang.Operation exec ( com.googlecode.prolog_cafe.lang.Prolog engine ) throws com.googlecode.prolog_cafe.lang.PrologException { com.google.gerrit.reviewdb.PatchSetInfo psInfo ; try { psInfo = getPatchSetInfo ( engine ) ; } catch ( com.google.gerrit.server.patch.PatchSetInfoNotAvailableException err ) { throw new com.googlecode.prolog_cafe.lang.JavaException ( this , 1 , err ) ; } com.google.gerrit.reviewdb.UserIdentity committer = psInfo.getCommitter ( ) ; return exec ( engine , committer ) ; }

Target:
public com.googlecode.prolog_cafe.lang.Operation exec ( com.googlecode.prolog_cafe.lang.Prolog engine ) throws com.googlecode.prolog_cafe.lang.PrologException { com.google.gerrit.reviewdb.PatchSetInfo psInfo = StoredValues.PATCH_SET_INFO.get ( engine ) ; com.google.gerrit.reviewdb.UserIdentity committer = psInfo.getCommitter ( ) ; return exec ( engine , committer ) ; }
Source:
public void testPatternWCommentLink ( ) { com.googlesource.gerrit.plugins.hooks.its.ItsConfig itsConfig = createItsConfig ( ) ; org.easymock.EasyMock.expect ( serverConfig.getString ( "ItsTestName" , null , "commentlink" ) ) . andReturn ( "foo" ) . atLeastOnce ( ) ; org.easymock.EasyMock.expect ( serverConfig.getString ( "commentlink" , "foo" , "match" ) ) . andReturn ( "TestPattern" ) . atLeastOnce ( ) ; replayMocks ( ) ; assertEquals ( "Expected and generated pattern are not equal" , "TestPattern" , itsConfig.getIssuePattern ( ) . pattern ( ) ) ; }

Target:
public void testGetIssuePatternWCommentLink ( ) { com.googlesource.gerrit.plugins.hooks.its.ItsConfig itsConfig = createItsConfig ( ) ; org.easymock.EasyMock.expect ( serverConfig.getString ( "ItsTestName" , null , "commentlink" ) ) . andReturn ( "foo" ) . atLeastOnce ( ) ; org.easymock.EasyMock.expect ( serverConfig.getString ( "commentlink" , "foo" , "match" ) ) . andReturn ( "TestPattern" ) . atLeastOnce ( ) ; replayMocks ( ) ; assertEquals ( "Expected and generated pattern are not equal" , "TestPattern" , itsConfig.getIssuePattern ( ) . pattern ( ) ) ; }
Source:
protected void rcptToAuthors ( final javax.mail.Message.RecipientType rt ) throws javax.mail.MessagingException { add ( rt , change.getOwner ( ) ) ; if ( ( patchSet ) != null ) { add ( rt , patchSet.getUploader ( ) ) ; } if ( ( patchSetInfo ) != null ) { add ( rt , patchSetInfo.getAuthor ( ) ) ; add ( rt , patchSetInfo.getCommitter ( ) ) ; } }

Target:
protected void rcptToAuthors ( final com.google.gerrit.server.mail.RecipientType rt ) { add ( rt , change.getOwner ( ) ) ; if ( ( patchSet ) != null ) { add ( rt , patchSet.getUploader ( ) ) ; } if ( ( patchSetInfo ) != null ) { add ( rt , patchSetInfo.getAuthor ( ) ) ; add ( rt , patchSetInfo.getCommitter ( ) ) ; } }
Source:
public com.google.gerrit.server.git.BatchUpdate insertChange ( com.google.gerrit.server.git.BatchUpdate.InsertChangeOp op ) { com.google.gerrit.reviewdb.client.Change c = op.getChange ( ) ; com.google.common.base.Preconditions.checkArgument ( ( ! ( newChanges.containsKey ( c.getId ( ) ) ) ) , "only one op allowed to create change %s" , c.getId ( ) ) ; newChanges.put ( c.getId ( ) , c ) ; ops.get ( c.getId ( ) ) . add ( 0 , op ) ; return this ; }

Target:
public com.google.gerrit.server.git.BatchUpdate insertChange ( com.google.gerrit.server.git.BatchUpdate.InsertChangeOp op ) throws java.io.IOException { com.google.gerrit.server.git.BatchUpdate.Context ctx = new com.google.gerrit.server.git.BatchUpdate.Context ( ) ; com.google.gerrit.reviewdb.client.Change c = op.createChange ( ctx ) ; com.google.common.base.Preconditions.checkArgument ( ( ! ( newChanges.containsKey ( c.getId ( ) ) ) ) , "only one op allowed to create change %s" , c.getId ( ) ) ; newChanges.put ( c.getId ( ) , c ) ; ops.get ( c.getId ( ) ) . add ( 0 , op ) ; return this ; }
Source:
private void appendLineNumber ( final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder m , final int idx ) { m.openTd ( ) ; m.setStyleName ( Gerrit.RESOURCES.css ( ) . lineNumber ( ) ) ; m.append ( com.google.gwtexpui.safehtml.client.SafeHtml.asis ( ( ( "<a href=\"javascript:void(0)\">" + ( idx + 1 ) ) + "</a>" ) ) ) ; m.closeTd ( ) ; }

Target:
private void appendLineNumberForSideB ( final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder m , final int idx ) { m.openTd ( ) ; m.setStyleName ( Gerrit.RESOURCES.css ( ) . lineNumber ( ) ) ; m.append ( com.google.gwtexpui.safehtml.client.SafeHtml.asis ( ( ( "<a href=\"javascript:void(0)\">" + ( idx + 1 ) ) + "</a>" ) ) ) ; m.closeTd ( ) ; }
Source:
public void getRelatedNoResult ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , admin.getIdent ( ) , testRepo ) ; com.google.gerrit.reviewdb.client.PatchSet.Id ps = push.to ( "refs/for/master" ) . getPatchSetId ( ) ; java.util.List < com.google.gerrit.server.change.GetRelated.ChangeAndCommit > related = getRelated ( ps ) ; com.google.common.truth.Truth.assertThat ( related ) . isEmpty ( ) ; }

Target:
public void getRelatedNoResult ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , admin.getIdent ( ) , testRepo ) ; assertRelated ( push.to ( "refs/for/master" ) . getPatchSetId ( ) ) ; }
Source:
public void signatureByExpiredKeyBeforeExpiration ( ) throws java.lang.Exception { com.google.gerrit.gpg.testutil.TestKey key3 = com.google.gerrit.gpg.testutil.TestKeys.expiredKey ( ) ; java.util.Date now = new java.text.SimpleDateFormat ( "YYYY-MM-dd HH:mm:ss Z" ) . parse ( "2005-07-10 12:00:00 -0400" ) ; org.eclipse.jgit.transport.PushCertificate cert = newSignedCert ( validNonce ( ) , key3 , now ) ; assertNoProblems ( cert ) ; }

Target:
public void signatureByExpiredKeyBeforeExpiration ( ) throws java.lang.Exception { com.google.gerrit.gpg.testutil.TestKey key3 = com.google.gerrit.gpg.testutil.TestKeys.expiredKey ( ) ; java.util.Date now = new java.text.SimpleDateFormat ( "yyyy-MM-dd HH:mm:ss Z" ) . parse ( "2005-07-10 12:00:00 -0400" ) ; org.eclipse.jgit.transport.PushCertificate cert = newSignedCert ( validNonce ( ) , key3 , now ) ; assertNoProblems ( cert ) ; }
Source:
private void saveSecureStore ( ) throws java.io.IOException { if ( ( secureStoreInitData ) != null ) { java.io.File dst = new java.io.File ( site.lib_dir , secureStoreInitData.jarFile.getName ( ) ) ; com.google.common.io.Files.copy ( secureStoreInitData.jarFile , dst ) ; com.google.gerrit.pgm.init.api.Section gerritSection = sectionFactory.get ( "gerrit" , null ) ; gerritSection.set ( "secureStoreClass" , secureStoreInitData.className ) ; } }

Target:
private void saveSecureStore ( ) throws java.io.IOException { if ( ( secureStoreInitData ) != null ) { java.nio.file.Path dst = site.lib_dir.resolve ( secureStoreInitData.jarFile.getFileName ( ) ) ; java.nio.file.Files.copy ( secureStoreInitData.jarFile , dst ) ; com.google.gerrit.pgm.init.api.Section gerritSection = sectionFactory.get ( "gerrit" , null ) ; gerritSection.set ( "secureStoreClass" , secureStoreInitData.className ) ; } }
Source:
private void verifyComment ( com.google.gerrit.reviewdb.client.PatchLineComment c ) { com.google.common.base.Preconditions.checkArgument ( ( ( c.getRevId ( ) ) != null ) ) ; com.google.common.base.Preconditions.checkArgument ( c.getAuthor ( ) . equals ( getUser ( ) . getAccountId ( ) ) , ( "The author for the following comment does not match the author of" + " this ChangeDraftUpdate (%s): %s" ) , getUser ( ) . getAccountId ( ) , c ) ; }

Target:
private void verifyComment ( com.google.gerrit.reviewdb.client.PatchLineComment c ) { com.google.common.base.Preconditions.checkArgument ( ( ( c.getRevId ( ) ) != null ) , "RevId required for comment: %s" , c ) ; com.google.common.base.Preconditions.checkArgument ( c.getAuthor ( ) . equals ( getAccountId ( ) ) , ( "The author for the following comment does not match the author of" + " this ChangeDraftUpdate (%s): %s" ) , getAccountId ( ) , c ) ; }
Source:
protected void onUnload ( ) { super . onUnload ( ) ; if ( ( resizeHandler ) != null ) { resizeHandler.removeHandler ( ) ; resizeHandler = null ; } if ( ( cmA ) != null ) { cmA.getWrapperElement ( ) . removeFromParent ( ) ; cmA = null ; } if ( ( cmB ) != null ) { cmB.getWrapperElement ( ) . removeFromParent ( ) ; cmB = null ; } com.google.gwt.user.client.Window.enableScrolling ( true ) ; }

Target:
protected void onUnload ( ) { super . onUnload ( ) ; removeKeyHandlerRegs ( ) ; if ( ( resizeHandler ) != null ) { resizeHandler.removeHandler ( ) ; resizeHandler = null ; } if ( ( cmA ) != null ) { cmA.getWrapperElement ( ) . removeFromParent ( ) ; cmA = null ; } if ( ( cmB ) != null ) { cmB.getWrapperElement ( ) . removeFromParent ( ) ; cmB = null ; } com.google.gwt.user.client.Window.enableScrolling ( true ) ; }
Source:
public com.google.gerrit.server.notedb.NoteDbUpdateManager stage ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Change.Id changeId ) throws com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException , java.io.IOException { db = unwrapDb ( db ) ; com.google.gerrit.reviewdb.client.Change change = db.changes ( ) . get ( changeId ) ; if ( change == null ) { throw new com.google.gerrit.server.project.NoSuchChangeException ( changeId ) ; } com.google.gerrit.server.notedb.NoteDbUpdateManager manager = updateManagerFactory.create ( change.getProject ( ) ) ; buildUpdates ( manager , com.google.gerrit.server.notedb.ChangeBundle.fromReviewDb ( db , changeId ) ) ; manager.stage ( ) ; return manager ; }

Target:
public com.google.gerrit.server.notedb.NoteDbUpdateManager stage ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Change.Id changeId ) throws com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException , java.io.IOException { db = com.google.gerrit.reviewdb.server.ReviewDbUtil.unwrapDb ( db ) ; com.google.gerrit.reviewdb.client.Change change = db.changes ( ) . get ( changeId ) ; if ( change == null ) { throw new com.google.gerrit.server.project.NoSuchChangeException ( changeId ) ; } com.google.gerrit.server.notedb.NoteDbUpdateManager manager = updateManagerFactory.create ( change.getProject ( ) ) ; buildUpdates ( manager , com.google.gerrit.server.notedb.ChangeBundle.fromReviewDb ( db , changeId ) ) ; manager.stage ( ) ; return manager ; }
Source:
public void setUp ( ) { easyMock = new org.easymock.EasyMockSupport ( ) ; storeMock = easyMock.createMock ( com.ericsson.gerrit.plugins.eventslog.EventStore.class ) ; poolMock = new com.ericsson.gerrit.plugins.eventslog.EventHandlerTest.PoolMock ( 1 ) ; listener = new com.ericsson.gerrit.plugins.eventslog.EventHandler ( storeMock , poolMock ) ; }

Target:
public void passEventToStore ( ) { com.google.gerrit.server.events.ChangeEvent eventMock = easyMock.createNiceMock ( com.google.gerrit.server.events.ChangeEvent.class ) ; easyMock.resetAll ( ) ; storeMock.storeEvent ( eventMock ) ; org.easymock.EasyMock.expectLastCall ( ) . once ( ) ; easyMock.replayAll ( ) ; poolMock = new com.ericsson.gerrit.plugins.eventslog.EventHandlerTest.PoolMock ( 1 ) ; listener = new com.ericsson.gerrit.plugins.eventslog.EventHandler ( storeMock , poolMock ) ; listener.onEvent ( eventMock ) ; easyMock.verifyAll ( ) ; }
Source:
private com.google.gerrit.server.notedb.ChangeNotes createFromChangeOnlyWhenNotedbDisabled ( com.google.gerrit.reviewdb.client.Change change ) throws com.google.gwtorm.server.OrmException { com.google.common.base.Preconditions.checkState ( ( ! ( migration.readChanges ( ) ) ) , ( "do not call" + " createFromChangeWhenNotedbDisabled when notedb is enabled" ) ) ; return new com.google.gerrit.server.notedb.ChangeNotes ( repoManager , migration , allUsers , change.getProject ( ) , change ) . load ( ) ; }

Target:
private com.google.gerrit.server.notedb.ChangeNotes createFromChangeOnlyWhenNotedbDisabled ( com.google.gerrit.reviewdb.client.Change change ) throws com.google.gwtorm.server.OrmException { com.google.common.base.Preconditions.checkState ( ( ! ( migration.readChanges ( ) ) ) , ( "do not call" + " createFromChangeWhenNotedbDisabled when notedb is enabled" ) ) ; return new com.google.gerrit.server.notedb.ChangeNotes ( repoManager , migration , allUsers , changeNoteUtil , commentsUtil , change.getProject ( ) , change ) . load ( ) ; }
Source:
private java.util.Properties loadBuckProperties ( ) throws java.io.IOException { java.util.Properties properties = new java.util.Properties ( ) ; java.nio.file.Path propertiesPath = gen.resolve ( "tools" ) . resolve ( "buck.properties" ) ; if ( java.nio.file.Files.exists ( propertiesPath ) ) { try ( java.io.InputStream in = java.nio.file.Files.newInputStream ( propertiesPath ) ) { properties.load ( in ) ; } } return properties ; }

Target:
private java.util.Properties loadBuckProperties ( ) throws java.io.IOException { java.util.Properties properties = new java.util.Properties ( ) ; java.nio.file.Path propertiesPath = gen.resolve ( java.nio.file.Paths.get ( "tools/buck/buck.properties" ) ) ; if ( java.nio.file.Files.exists ( propertiesPath ) ) { try ( java.io.InputStream in = java.nio.file.Files.newInputStream ( propertiesPath ) ) { properties.load ( in ) ; } } return properties ; }
Source:
private boolean matchAny ( java.util.List < com.google.gerrit.common.data.PermissionRule > rules ) { java.util.Set < com.google.gerrit.reviewdb.AccountGroup.UUID > groups = user.getEffectiveGroups ( ) ; for ( com.google.gerrit.common.data.PermissionRule rule : rules ) { if ( com.google.gerrit.server.account.CapabilityControl.match ( groups , rule ) ) { return true ; } } return false ; }

Target:
private boolean matchAny ( java.lang.Iterable < com.google.gerrit.common.data.PermissionRule > rules , com.google.common.base.Predicate < com.google.gerrit.common.data.PermissionRule > predicate ) { java.lang.Iterable < com.google.gerrit.reviewdb.client.AccountGroup.UUID > ids = com.google.common.collect.Iterables.transform ( com.google.common.collect.Iterables.filter ( rules , predicate ) , new com.google.common.base.Function < com.google.gerrit.common.data.PermissionRule , com.google.gerrit.reviewdb.client.AccountGroup.UUID > ( ) { @ java.lang.Override public AccountGroup.UUID apply ( com.google.gerrit.common.data.PermissionRule rule ) { return rule.getGroup ( ) . getUUID ( ) ; } } ) ; return user.getEffectiveGroups ( ) . containsAnyOf ( ids ) ; }
Source:
private java.util.List < com.google.gerrit.extensions.common.SuggestedReviewerInfo > suggestReviewers ( com.google.gerrit.acceptance.RestSession session , java.lang.String changeId , java.lang.String query , int n ) throws java.io.IOException { return newGson ( ) . fromJson ( session.get ( ( ( ( ( ( "/changes/" + changeId ) + "/suggest_reviewers?q=" ) + query ) + "&n=" ) + n ) ) . getReader ( ) , new com.google.gson.reflect.TypeToken < java.util.List < com.google.gerrit.extensions.common.SuggestedReviewerInfo > > ( ) { } . getType ( ) ) ; }

Target:
private java.util.List < com.google.gerrit.extensions.common.SuggestedReviewerInfo > suggestReviewers ( com.google.gerrit.acceptance.RestSession session , java.lang.String changeId , java.lang.String query , int n ) throws java.io.IOException { return newGson ( ) . fromJson ( session.get ( ( ( ( ( ( "/changes/" + changeId ) + "/suggest_reviewers?q=" ) + ( com.google.gerrit.extensions.restapi.Url.encode ( query ) ) ) + "&n=" ) + n ) ) . getReader ( ) , new com.google.gson.reflect.TypeToken < java.util.List < com.google.gerrit.extensions.common.SuggestedReviewerInfo > > ( ) { } . getType ( ) ) ; }
Source:
private java.lang.String getCommentChangeAbandoned ( java.util.Map < java.lang.String , java.lang.String > map ) { return getCommentChangeEvent ( "abandoned" , "abandoner" , map ) ; }

Target:
public void execute ( java.lang.String issue , com.googlesource.gerrit.plugins.its.base.workflow.ActionRequest actionRequest , java.util.Set < com.googlesource.gerrit.plugins.its.base.workflow.Property > properties ) throws java.io.IOException { java.lang.String comment = buildComment ( properties ) ; if ( ! ( com.google.common.base.Strings.isNullOrEmpty ( comment ) ) ) { its.addComment ( issue , comment ) ; } }
Source:
public com.google.gerrit.reviewdb.client.Change reloadChange ( ) throws com.google.gwtorm.server.OrmException { notes = notesFactory.create ( db , project , legacyId ) ; change = notes.getChange ( ) ; if ( ( change ) == null ) { throw new com.google.gwtorm.server.OrmException ( ( "Unable to load change " + ( legacyId ) ) ) ; } setPatchSets ( null ) ; return change ; }

Target:
public java.util.Set < com.google.gerrit.reviewdb.client.Account.Id > draftsByUser ( ) throws com.google.gwtorm.server.OrmException { return draftRefs ( ) . keySet ( ) ; }
Source:
public com.google.gerrit.acceptance.RestResponse post ( java.lang.String endPoint , java.lang.Object content ) throws java.io.IOException { org.apache.http.client.methods.HttpPost post = new org.apache.http.client.methods.HttpPost ( ( ( ( url ) + "/a" ) + endPoint ) ) ; if ( content != null ) { post.addHeader ( new org.apache.http.message.BasicHeader ( "Content-Type" , "application/json" ) ) ; post.setEntity ( new org.apache.http.entity.StringEntity ( new com.google.gson.Gson ( ) . toJson ( content ) , com.google.common.base.Charsets.UTF_8.name ( ) ) ) ; } return new com.google.gerrit.acceptance.RestResponse ( getClient ( ) . execute ( post ) ) ; }

Target:
public com.google.gerrit.acceptance.RestResponse post ( java.lang.String endPoint , java.lang.Object content ) throws java.io.IOException { org.apache.http.client.methods.HttpPost post = new org.apache.http.client.methods.HttpPost ( ( ( ( url ) + "/a" ) + endPoint ) ) ; if ( content != null ) { post.addHeader ( new org.apache.http.message.BasicHeader ( "Content-Type" , "application/json" ) ) ; post.setEntity ( new org.apache.http.entity.StringEntity ( OutputFormat.JSON_COMPACT.newGson ( ) . toJson ( content ) , com.google.common.base.Charsets.UTF_8.name ( ) ) ) ; } return new com.google.gerrit.acceptance.RestResponse ( getClient ( ) . execute ( post ) ) ; }
Source:
public static java.lang.String shard ( int id ) { if ( id < 0 ) { return null ; } java.lang.StringBuilder r = new java.lang.StringBuilder ( ) ; int n = id % 100 ; if ( n < 10 ) { r.append ( '0' ) ; } r.append ( n ) ; r.append ( '/' ) ; r.append ( id ) ; return r.toString ( ) ; }

Target:
public static java.lang.String shard ( int id ) { if ( id < 0 ) { return null ; } return com.google.gerrit.reviewdb.client.RefNames.shard ( id , com.google.gerrit.reviewdb.client.RefNames.newStringBuilder ( ) ) . toString ( ) ; }
Source:
public void onFailure ( final java.lang.Throwable caught ) { if ( com.google.gerrit.client.rpc.GerritCallback.isNotSignedIn ( caught ) ) { new com.google.gerrit.client.ErrorDialog ( Util.C.errorNotSignedIn ( ) ) . center ( ) ; } else if ( caught instanceof com.google.gwtjsonrpc.client.ServerUnavailableException ) { new com.google.gerrit.client.ErrorDialog ( Util.C.errorServerUnavailable ( ) ) . center ( ) ; } else { com.google.gwt.core.client.GWT.log ( ( ( ( getClass ( ) . getName ( ) ) + " caught " ) + caught ) , caught ) ; new com.google.gerrit.client.ErrorDialog ( caught ) . center ( ) ; } }

Target:
public void onFailure ( final java.lang.Throwable caught ) { if ( com.google.gerrit.client.rpc.GerritCallback.isNotSignedIn ( caught ) ) { new com.google.gerrit.client.ErrorDialog ( RpcUtil.C.errorNotSignedIn ( ) ) . center ( ) ; } else if ( caught instanceof com.google.gwtjsonrpc.client.ServerUnavailableException ) { new com.google.gerrit.client.ErrorDialog ( RpcUtil.C.errorServerUnavailable ( ) ) . center ( ) ; } else { com.google.gwt.core.client.GWT.log ( ( ( ( getClass ( ) . getName ( ) ) + " caught " ) + caught ) , caught ) ; new com.google.gerrit.client.ErrorDialog ( caught ) . center ( ) ; } }
Source:
protected void ccExistingReviewers ( ) { try { for ( com.google.gerrit.reviewdb.client.Account.Id id : getReviewers ( ) . get ( ReviewerState.REVIEWER ) ) { add ( RecipientType.CC , id ) ; } } catch ( com.google.gwtorm.server.OrmException err ) { com.google.gerrit.server.mail.ChangeEmail.log.warn ( "Cannot CC users that commented on updated change" , err ) ; } }

Target:
protected void ccExistingReviewers ( ) { try { for ( com.google.gerrit.reviewdb.client.Account.Id id : changeData.reviewers ( ) . get ( ReviewerState.REVIEWER ) ) { add ( RecipientType.CC , id ) ; } } catch ( com.google.gwtorm.server.OrmException err ) { com.google.gerrit.server.mail.ChangeEmail.log.warn ( "Cannot CC users that commented on updated change" , err ) ; } }
Source:
public boolean isReviewer ( com.google.gerrit.reviewdb.server.ReviewDb db , @ com.google.gerrit.common.Nullable com.google.gerrit.server.query.change.ChangeData cd ) throws com.google.gwtorm.server.OrmException { if ( getCurrentUser ( ) . isIdentifiedUser ( ) ) { java.util.Collection < com.google.gerrit.reviewdb.client.Account.Id > results = ( cd != null ) ? cd.reviewers ( ) . values ( ) : approvalsUtil.getReviewers ( db , getChange ( ) . getId ( ) ) . values ( ) ; com.google.gerrit.server.IdentifiedUser user = ( ( com.google.gerrit.server.IdentifiedUser ) ( getCurrentUser ( ) ) ) ; return results.contains ( user.getAccountId ( ) ) ; } return false ; }

Target:
public boolean isReviewer ( com.google.gerrit.reviewdb.server.ReviewDb db , @ com.google.gerrit.common.Nullable com.google.gerrit.server.query.change.ChangeData cd ) throws com.google.gwtorm.server.OrmException { if ( getCurrentUser ( ) . isIdentifiedUser ( ) ) { java.util.Collection < com.google.gerrit.reviewdb.client.Account.Id > results = changeData ( db , cd ) . reviewers ( ) . values ( ) ; com.google.gerrit.server.IdentifiedUser user = ( ( com.google.gerrit.server.IdentifiedUser ) ( getCurrentUser ( ) ) ) ; return results.contains ( user.getAccountId ( ) ) ; } return false ; }
Source:
public void commentOnWipChangeByOwnerNotifyAll ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageWipChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; review ( sc.owner , sc.changeId , com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy.ENABLED , com.google.gerrit.extensions.api.changes.NotifyHandling.ALL ) ; assertThat ( sender ) . sent ( "comment" , sc ) . notTo ( sc.owner ) . cc ( sc.reviewer , sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; }

Target:
public void commentOnWipChangeByBot ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageWipChange ( ) ; com.google.gerrit.acceptance.TestAccount bot = sc.testAccount ( "bot" ) ; review ( bot , sc.changeId , com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy.ENABLED , null , "tag" ) ; assertThat ( sender ) . sent ( "comment" , sc ) . to ( sc.owner ) . noOneElse ( ) ; }
Source:
com.ericsson.gerrit.plugins.eventslog.sql.SQLClient provideLocalSqlClient ( com.ericsson.gerrit.plugins.eventslog.EventsLogConfig cfg ) { java.lang.String path = cfg.getLocalStorePath ( ) . toString ( ) ; path = ( path.endsWith ( "/" ) ) ? path : path + "/" ; return new com.ericsson.gerrit.plugins.eventslog.sql.SQLClient ( cfg.getLocalStoreDriver ( ) , ( ( com.ericsson.gerrit.plugins.eventslog.sql.SQLModule.H2_DB_PREFIX ) + path ) , cfg.getUrlOptions ( ) ) ; }

Target:
com.ericsson.gerrit.plugins.eventslog.sql.SQLClient provideLocalSqlClient ( com.ericsson.gerrit.plugins.eventslog.EventsLogConfig cfg ) { java.lang.String path = cfg.getLocalStorePath ( ) . toString ( ) ; path = ( path.endsWith ( "/" ) ) ? path : path + "/" ; com.ericsson.gerrit.plugins.eventslog.sql.SQLClient sqlClient = new com.ericsson.gerrit.plugins.eventslog.sql.SQLClient ( cfg.getLocalStoreDriver ( ) , ( ( com.ericsson.gerrit.plugins.eventslog.sql.SQLModule.H2_DB_PREFIX ) + path ) , cfg.getUrlOptions ( ) ) ; sqlClient.setEvictIdleTime ( cfg.getEvictIdleTime ( ) ) ; return sqlClient ; }
Source:
public void testQuote1 ( ) { final com.google.gwtexpui.safehtml.client.SafeHtml o = com.google.gwtexpui.safehtml.client.SafeHtml_WikifyQuoteTest.html ( "> I\'m happy\n > with quotes!\n\nSee above." ) ; final com.google.gwtexpui.safehtml.client.SafeHtml n = o.wikify ( ) ; org.junit.Assert.assertNotSame ( o , n ) ; org.junit.Assert.assertEquals ( ( ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyQuoteTest.quote ( "I&#39;m happy\nwith quotes!" ) ) + "<p>See above.</p>" ) , n.asString ( ) ) ; }

Target:
public void testQuote1 ( ) { final com.google.gwtexpui.safehtml.client.SafeHtml o = com.google.gwtexpui.safehtml.client.SafeHtml_WikifyQuoteTest.html ( "> I\'m happy\n > with quotes!\n\nSee above." ) ; final com.google.gwtexpui.safehtml.client.SafeHtml n = o.wikify ( ) ; com.google.common.truth.Truth.assertThat ( o ) . isNotSameAs ( n ) ; com.google.common.truth.Truth.assertThat ( n.asString ( ) ) . isEqualTo ( ( ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyQuoteTest.quote ( "I&#39;m happy\nwith quotes!" ) ) + "<p>See above.</p>" ) ) ; }