auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private com.google.gerrit.server.account.AuthResult byAccountId ( java.lang.String idStr ) { final com.google.gerrit.reviewdb.client.Account.Id id ; try { id = Account.Id.parse ( idStr ) ; } catch ( java.lang.NumberFormatException nfe ) { return null ; } try ( com.google.gerrit.reviewdb.server.ReviewDb db = schema.open ( ) ) { return auth ( accounts.get ( db , id ) ) ; } catch ( com.google.gwtorm.server.OrmException e ) { getServletContext ( ) . log ( "cannot query database" , e ) ; return null ; } }

Target:
private com.google.gerrit.server.account.AuthResult byAccountId ( java.lang.String idStr ) { final com.google.gerrit.reviewdb.client.Account.Id id ; try { id = Account.Id.parse ( idStr ) ; } catch ( java.lang.NumberFormatException nfe ) { return null ; } try ( com.google.gerrit.reviewdb.server.ReviewDb db = schema.open ( ) ) { return auth ( accounts.get ( db , id ) ) ; } catch ( com.google.gwtorm.server.OrmException | java.io.IOException | org.eclipse.jgit.errors.ConfigInvalidException e ) { getServletContext ( ) . log ( "cannot query database" , e ) ; return null ; } }
Source:
private java.lang.String parseTopic ( org.eclipse.jgit.revwalk.RevCommit commit ) throws org.eclipse.jgit.errors.ConfigInvalidException { java.util.List < java.lang.String > topicLines = commit.getFooterLines ( com.google.gerrit.server.notedb.ChangeNoteUtil.FOOTER_TOPIC ) ; if ( topicLines.isEmpty ( ) ) { return null ; } else if ( ( topicLines.size ( ) ) > 1 ) { throw expectedOneFooter ( com.google.gerrit.server.notedb.ChangeNoteUtil.FOOTER_TOPIC , topicLines ) ; } return topicLines.get ( 0 ) ; }

Target:
private java.lang.String parseSubmissionId ( org.eclipse.jgit.revwalk.RevCommit commit ) throws org.eclipse.jgit.errors.ConfigInvalidException { return parseOneFooter ( commit , com.google.gerrit.server.notedb.ChangeNoteUtil.FOOTER_SUBMISSION_ID ) ; }
Source:
protected void configure ( ) { factory ( AddBranch.Factory.class ) ; factory ( ChangeProjectAccess.Factory.class ) ; factory ( CreateProjectHandler.Factory.class ) ; factory ( ChangeProjectSettings.Factory.class ) ; factory ( DeleteBranches.Factory.class ) ; factory ( ListBranches.Factory.class ) ; factory ( VisibleProjects.Factory.class ) ; factory ( ProjectAccessFactory.Factory.class ) ; factory ( ProjectDetailFactory.Factory.class ) ; }

Target:
protected void configure ( ) { factory ( AddBranch.Factory.class ) ; factory ( ChangeProjectAccess.Factory.class ) ; factory ( CreateProjectHandler.Factory.class ) ; factory ( ChangeProjectSettings.Factory.class ) ; factory ( DeleteBranches.Factory.class ) ; factory ( ListBranches.Factory.class ) ; factory ( VisibleProjects.Factory.class ) ; factory ( VisibleProjectDetails.Factory.class ) ; factory ( ProjectAccessFactory.Factory.class ) ; factory ( ProjectDetailFactory.Factory.class ) ; factory ( SuggestParentCandidatesHandler.Factory.class ) ; }
Source:
public void addListener ( java.lang.Runnable listener , java.util.concurrent.Executor executor ) { if ( ! ( isDone ( ) ) ) { notDoneNrtFutures.add ( this ) ; } super . addListener ( listener , executor ) ; }

Target:
public void addListener ( java.lang.Runnable listener , java.util.concurrent.Executor executor ) { if ( ( isGenAvailableNowForCurrentSearcher ( ) ) && ( ! ( isCancelled ( ) ) ) ) { set ( null ) ; } else if ( ! ( isDone ( ) ) ) { notDoneNrtFutures.add ( this ) ; } super . addListener ( listener , executor ) ; }
Source:
public void onChangeRestored ( com.google.gerrit.extensions.events.ChangeRestoredListener.Event event ) { com.google.gerrit.extensions.common.ChangeInfo change = event.getChange ( ) ; try { automergeChanges ( change , event.getRevision ( ) ) ; } catch ( com.google.gerrit.extensions.restapi.RestApiException | java.io.IOException | org.eclipse.jgit.errors.ConfigInvalidException | com.googlesource.gerrit.plugins.automerger.InvalidQueryParameterException e ) { com.googlesource.gerrit.plugins.automerger.DownstreamCreator.log.error ( "Automerger plugin failed onChangeRestored for {}" , change.id , e ) ; } }

Target:
public void onDraftPublished ( com.google.gerrit.extensions.events.DraftPublishedListener.Event event ) { try ( com.google.gerrit.server.util.ManualRequestContext ctx = oneOffRequestContext.openAs ( config.getContextUserId ( ) ) ) { com.google.gerrit.extensions.common.ChangeInfo change = event.getChange ( ) ; automergeChanges ( change , event.getRevision ( ) ) ; } catch ( com.google.gerrit.extensions.restapi.RestApiException | java.io.IOException | org.eclipse.jgit.errors.ConfigInvalidException | com.googlesource.gerrit.plugins.automerger.InvalidQueryParameterException | com.google.gwtorm.server.OrmException e ) { com.googlesource.gerrit.plugins.automerger.DownstreamCreator.log.error ( "Automerger plugin failed onDraftPublished for {}" , event.getChange ( ) . id , e ) ; } }
Source:
public com.google.gerrit.reviewdb.client.Change reloadChange ( ) throws com.google.gwtorm.server.OrmException { notes = notesFactory.create ( db , project , legacyId ) ; change = notes.getChange ( ) ; if ( ( change ) == null ) { throw new com.google.gwtorm.server.OrmException ( ( "Unable to load change " + ( legacyId ) ) ) ; } return change ; }

Target:
public com.google.gerrit.server.notedb.ChangeNotes notes ( ) throws com.google.gwtorm.server.OrmException { if ( ( notes ) == null ) { notes = notesFactory.create ( db , project ( ) , legacyId ) ; } return notes ; }
Source:
private com.google.gerrit.extensions.common.ChangeInfo newChangeInfo ( com.google.gerrit.extensions.client.ChangeStatus status ) { com.google.gerrit.extensions.common.ChangeInfo in = new com.google.gerrit.extensions.common.ChangeInfo ( ) ; in.project = project.get ( ) ; in.branch = "master" ; in.subject = "Empty change" ; in.topic = "support-gerrit-workflow-in-browser" ; in.status = status ; return in ; }

Target:
private com.google.gerrit.extensions.common.ChangeInput newChangeInput ( com.google.gerrit.extensions.client.ChangeStatus status ) { com.google.gerrit.extensions.common.ChangeInput in = new com.google.gerrit.extensions.common.ChangeInput ( ) ; in.project = project.get ( ) ; in.branch = "master" ; in.subject = "Empty change" ; in.topic = "support-gerrit-workflow-in-browser" ; in.status = status ; return in ; }
Source:
public java.util.List < com.google.gerrit.reviewdb.client.Account > load ( java.lang.Boolean key ) throws java.lang.Exception { return com.google.common.collect.ImmutableList.copyOf ( dbProvider.get ( ) . accounts ( ) . all ( ) ) ; }

Target:
public java.util.List < com.google.gerrit.reviewdb.client.Account > load ( java.lang.Boolean key ) throws java.lang.Exception { return com.google.common.collect.ImmutableList.copyOf ( com.google.common.collect.Iterables.filter ( dbProvider.get ( ) . accounts ( ) . all ( ) , new com.google.common.base.Predicate < com.google.gerrit.reviewdb.client.Account > ( ) { @ java.lang.Override public boolean apply ( com.google.gerrit.reviewdb.client.Account in ) { return in.isActive ( ) ; } } ) ) ; }
Source:
private void touch ( com.google.gerrit.server.cache.h2.H2CacheImpl.SqlHandle c , K key ) throws java.sql.SQLException { if ( ( c.touch ) == null ) { c.touch = c.conn.prepareStatement ( "UPDATE data SET accessed=? WHERE k=?" ) ; } try { c.touch.setTimestamp ( 1 , new java.sql.Timestamp ( java.lang.System.currentTimeMillis ( ) ) ) ; keyType.set ( c.touch , 2 , key ) ; c.touch.executeUpdate ( ) ; } finally { c.touch.clearParameters ( ) ; } }

Target:
private void touch ( com.google.gerrit.server.cache.h2.H2CacheImpl.SqlHandle c , K key ) throws java.sql.SQLException { if ( ( c.touch ) == null ) { c.touch = c.conn.prepareStatement ( "UPDATE data SET accessed=? WHERE k=?" ) ; } try { c.touch.setTimestamp ( 1 , new java.sql.Timestamp ( com.google.gerrit.server.util.TimeUtil.nowMs ( ) ) ) ; keyType.set ( c.touch , 2 , key ) ; c.touch.executeUpdate ( ) ; } finally { c.touch.clearParameters ( ) ; } }
Source:
public void unblockMoreSpecificRef_Fails ( ) { com.google.gerrit.server.project.Util.block ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/heads/master" ) ; com.google.gerrit.server.project.ProjectControl u = user ( local , com.google.gerrit.server.project.Util.DEVS ) ; assertCannotUpdate ( "refs/heads/master" , u ) ; }

Target:
public void unblockForceWithAllowNoForce_NotPossible ( ) { com.google.gerrit.common.data.PermissionRule r = com.google.gerrit.server.project.testing.Util.block ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/*" ) ; r.setForce ( true ) ; com.google.gerrit.server.project.testing.Util.allow ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.testing.Util.DEVS , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = user ( local , com.google.gerrit.server.project.testing.Util.DEVS ) ; assertCannotForceUpdate ( "refs/heads/master" , u ) ; }
Source:
private static int split ( java.lang.String line ) { int sp = line.indexOf ( ' ' ) ; int tab = line.indexOf ( '\t' ) ; if ( ( sp < 0 ) && ( tab < 0 ) ) { return - 1 ; } if ( ( sp < 0 ) && ( 0 <= tab ) ) { return tab ; } if ( ( 0 <= sp ) && ( tab < 0 ) ) { return sp ; } return java.lang.Math.min ( sp , tab ) ; }

Target:
private static java.lang.String pad ( int len , java.lang.String src ) { if ( len <= ( src.length ( ) ) ) { return src ; } java.lang.StringBuilder r = new java.lang.StringBuilder ( len ) ; r.append ( src ) ; while ( ( r.length ( ) ) < len ) { r.append ( ' ' ) ; } return r.toString ( ) ; }
Source:
void loadChangeInfo ( boolean fg , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.info.ChangeInfo > cb ) { com.google.gerrit.client.rpc.RestApi call = com.google.gerrit.client.changes.ChangeApi.detail ( changeId.get ( ) ) ; com.google.gerrit.client.changes.ChangeList.addOptions ( call , java.util.EnumSet.of ( ListChangesOption.CHANGE_ACTIONS , ListChangesOption.ALL_REVISIONS ) ) ; if ( ! fg ) { call.background ( ) ; } call.get ( cb ) ; }

Target:
void loadChangeInfo ( boolean fg , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.info.ChangeInfo > cb ) { com.google.gerrit.client.rpc.RestApi call = com.google.gerrit.client.changes.ChangeApi.detail ( changeId.get ( ) ) ; java.util.EnumSet < com.google.gerrit.extensions.client.ListChangesOption > opts = java.util.EnumSet.of ( ListChangesOption.ALL_REVISIONS , ListChangesOption.CHANGE_ACTIONS ) ; if ( enableSignedPush ( ) ) { opts.add ( ListChangesOption.PUSH_CERTIFICATES ) ; } com.google.gerrit.client.changes.ChangeList.addOptions ( call , opts ) ; if ( ! fg ) { call.background ( ) ; } call.get ( cb ) ; }
Source:
boolean canPerform ( java.lang.String permissionName ) { return ! ( access ( permissionName ) . isEmpty ( ) ) ; }

Target:
boolean canPerform ( java.lang.String permissionName ) { java.util.List < com.google.gerrit.common.data.PermissionRule > access = access ( permissionName ) ; for ( com.google.gerrit.common.data.PermissionRule rule : access ) { if ( ( rule.isBlock ( ) ) && ( ! ( rule.getForce ( ) ) ) ) { return false ; } } return ! ( access.isEmpty ( ) ) ; }
Source:
public < T > com.google.common.base.Optional < T > getResource ( java.lang.String resourcePath , java.lang.Class < ? extends T > resourceClass ) { return com.google.common.base.Optional.absent ( ) ; }

Target:
private com.google.common.base.Optional < com.google.gerrit.server.plugins.PluginEntry > resourceOf ( java.lang.String resourcePath ) { java.io.File file = getResourceFile ( resourcePath ) ; if ( ( file.exists ( ) ) && ( ( file.length ( ) ) > 0 ) ) { return com.google.common.base.Optional.of ( new com.google.gerrit.server.plugins.PluginEntry ( resourcePath , file.lastModified ( ) , file.length ( ) ) ) ; } else { return com.google.common.base.Optional.absent ( ) ; } }
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 ( ( idx + 1 ) ) ; m.closeTd ( ) ; }

Target:
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 ( ) ; }
Source:
public void onResize ( com.google.gwt.event.logical.shared.ResizeEvent event ) { int h = ( com.google.gerrit.client.Gerrit.getHeaderFooterHeight ( ) ) + ( reviewed.getOffsetHeight ( ) ) ; if ( ( cmA ) != null ) { cmA.setHeight ( ( ( event.getHeight ( ) ) - h ) ) ; cmA.refresh ( ) ; } if ( ( cmB ) != null ) { cmB.setHeight ( ( ( event.getHeight ( ) ) - h ) ) ; cmB.refresh ( ) ; } resizeBoxPaddings ( ) ; }

Target:
public void onResize ( com.google.gwt.event.logical.shared.ResizeEvent event ) { resizeCodeMirror ( ) ; resizeBoxPaddings ( ) ; }
Source:
protected void assertResultEquals ( java.lang.String message , com.google.gerrit.reviewdb.client.Change expected , com.google.gerrit.extensions.common.ChangeInfo actual ) { com.google.common.truth.Truth.assert_ ( ) . withFailureMessage ( message ) . that ( actual._number ) . isEqualTo ( expected.getId ( ) . get ( ) ) ; }

Target:
protected void assertQuery ( com.google.gerrit.extensions.api.changes.Changes.QueryRequest query , com.google.gerrit.reviewdb.client.Change ... changes ) throws java.lang.Exception { com.google.common.truth.Truth.assertThat ( ( ( java.lang.Iterable < java.lang.Integer > ) ( com.google.gerrit.server.query.change.AbstractQueryChangesTest.query ( query ) ) ) ) . named ( query.toString ( ) ) . containsExactlyElementsIn ( com.google.gerrit.server.query.change.AbstractQueryChangesTest.ids ( changes ) ) . inOrder ( ) ; }
Source:
public java.lang.String getListId ( ) throws com.google.gerrit.common.errors.EmailException { return velocify ( "gerrit-$projectName.replace('/', '-')@$email.gerritHost" ) ; }

Target:
private void setListIdHeader ( ) { setHeader ( "List-Id" , ( ( ( ( "<gerrit-" + ( branch.getParentKey ( ) . get ( ) . replace ( '/' , '-' ) ) ) + "." ) + ( getGerritHost ( ) ) ) + ">" ) ) ; if ( ( getSettingsUrl ( ) ) != null ) { setHeader ( "List-Unsubscribe" , ( ( "<" + ( getSettingsUrl ( ) ) ) + ">" ) ) ; } }
Source:
public java.util.Properties getStatistics ( ) { return statistics ; }

Target:
private void fire ( final com.google.gerrit.reviewdb.client.Project.NameKey p , final java.util.Properties statistics ) { if ( ! ( listeners.iterator ( ) . hasNext ( ) ) ) { return ; } com.google.gerrit.server.git.GarbageCollection.Event event = new com.google.gerrit.server.git.GarbageCollection.Event ( p , statistics ) ; for ( com.google.gerrit.extensions.events.GarbageCollectorListener l : listeners ) { try { l.onGarbageCollected ( event ) ; } catch ( java.lang.RuntimeException e ) { com.google.gerrit.server.git.GarbageCollection.log.warn ( "Failure in GarbageCollectorListener" , e ) ; } } }
Source:
public static java.lang.String readFile ( final java.io.File parentDir , final java.lang.String name ) throws java.io.IOException { if ( parentDir == null ) { return null ; } final java.io.File path = new java.io.File ( parentDir , name ) ; try { return com.google.gerrit.httpd.HtmlDomUtil.asString ( new java.io.FileInputStream ( path ) ) ; } catch ( java.io.FileNotFoundException e ) { return null ; } catch ( java.io.IOException e ) { throw new java.io.IOException ( ( "Error reading " + path ) , e ) ; } }

Target:
public static java.lang.String readFile ( java.io.File parentDir , java.lang.String name ) throws java.io.IOException { if ( parentDir == null ) { return null ; } java.io.File path = new java.io.File ( parentDir , name ) ; try ( java.io.FileInputStream in = new java.io.FileInputStream ( path ) ) { return new java.lang.String ( com.google.common.io.ByteStreams.toByteArray ( in ) , com.google.gerrit.httpd.HtmlDomUtil.ENC ) ; } catch ( java.io.FileNotFoundException e ) { return null ; } catch ( java.io.IOException e ) { throw new java.io.IOException ( ( "Error reading " + path ) , e ) ; } }
Source:
protected org.eclipse.jgit.lib.Config readConfig ( java.lang.String fileName ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { org.eclipse.jgit.lib.Config rc = new org.eclipse.jgit.lib.Config ( ) ; java.lang.String text = readUTF8 ( fileName ) ; if ( ! ( text.isEmpty ( ) ) ) { try { rc.fromText ( text ) ; } catch ( org.eclipse.jgit.errors.ConfigInvalidException err ) { throw new org.eclipse.jgit.errors.ConfigInvalidException ( ( ( ( "Invalid config file " + fileName ) + " in commit" ) + ( revision.name ( ) ) ) , err ) ; } } return rc ; }

Target:
protected org.eclipse.jgit.lib.Config readConfig ( java.lang.String fileName ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { org.eclipse.jgit.lib.Config rc = new org.eclipse.jgit.lib.Config ( ) ; java.lang.String text = readUTF8 ( fileName ) ; if ( ! ( text.isEmpty ( ) ) ) { try { rc.fromText ( text ) ; } catch ( org.eclipse.jgit.errors.ConfigInvalidException err ) { throw new org.eclipse.jgit.errors.ConfigInvalidException ( ( ( ( "Invalid config file " + fileName ) + " in commit " ) + ( revision.name ( ) ) ) , err ) ; } } return rc ; }
Source:
private void writeObject ( java.io.ObjectOutputStream out ) throws java.io.IOException { org.eclipse.jgit.lib.ObjectIdSerialization.writeCanBeNull ( out , oldId ) ; out.writeInt ( ( ( parentNum ) == null ? 0 : parentNum ) ) ; org.eclipse.jgit.lib.ObjectIdSerialization.writeNotNull ( out , newId ) ; java.lang.Character c = PatchListKey.WHITESPACE_TYPES.get ( whitespace ) ; if ( c == null ) { throw new java.io.IOException ( ( "Invalid whitespace type: " + ( whitespace ) ) ) ; } out.writeChar ( c ) ; }

Target:
private void writeObject ( java.io.ObjectOutputStream out ) throws java.io.IOException { org.eclipse.jgit.lib.ObjectIdSerializer.write ( out , oldId ) ; out.writeInt ( ( ( parentNum ) == null ? 0 : parentNum ) ) ; org.eclipse.jgit.lib.ObjectIdSerializer.write ( out , newId ) ; java.lang.Character c = PatchListKey.WHITESPACE_TYPES.get ( whitespace ) ; if ( c == null ) { throw new java.io.IOException ( ( "Invalid whitespace type: " + ( whitespace ) ) ) ; } out.writeChar ( c ) ; }
Source:
public com.google.gwtorm.server.OrmException convertError ( final java.lang.String op , final java.lang.String entity , final java.sql.SQLException err ) { switch ( getSQLStateInt ( err ) ) { case 23001 : return new com.google.gwtorm.server.OrmDuplicateKeyException ( entity , err ) ; case 23000 : default : return super . convertError ( op , entity , err ) ; } }

Target:
public com.google.gwtorm.server.OrmException convertError ( final java.lang.String op , final java.lang.String entity , final java.sql.SQLException err ) { switch ( getSQLStateInt ( err ) ) { case 23001 : case 23505 : return new com.google.gwtorm.server.OrmDuplicateKeyException ( entity , err ) ; default : return super . convertError ( op , entity , err ) ; } }
Source:
private static boolean amAdmin ( final com.google.gerrit.client.reviewdb.ReviewDb db ) throws com.google.gwtorm.client.OrmException { final com.google.gerrit.client.reviewdb.AccountGroup admin = db.accountGroups ( ) . get ( new com.google.gerrit.client.reviewdb.AccountGroup.NameKey ( "admin" ) ) ; if ( admin == null ) { return false ; } return ( db.accountGroupMembers ( ) . get ( new com.google.gerrit.client.reviewdb.AccountGroupMember.Key ( com.google.gerrit.client.rpc.RpcUtil.getAccountId ( ) , admin.getId ( ) ) ) ) != null ; }

Target:
private static boolean amAdmin ( final com.google.gerrit.client.reviewdb.ReviewDb db ) throws com.google.gwtorm.client.OrmException { final com.google.gerrit.client.reviewdb.AccountGroup admin = db.accountGroups ( ) . get ( com.google.gerrit.client.admin.ADMIN_GROUP ) ; if ( admin == null ) { return false ; } return ( db.accountGroupMembers ( ) . get ( new com.google.gerrit.client.reviewdb.AccountGroupMember.Key ( com.google.gerrit.client.rpc.RpcUtil.getAccountId ( ) , admin.getId ( ) ) ) ) != null ; }
Source:
public java.util.List < com.google.gerrit.extensions.common.ProjectInfo > children ( boolean recursive ) throws com.google.gerrit.extensions.restapi.RestApiException { com.google.gerrit.server.project.ListChildProjects list = children.list ( ) ; list.setRecursive ( recursive ) ; try { return list.apply ( checkExists ( ) ) ; } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( "Cannot list children" , e ) ; } }

Target:
public java.util.List < com.google.gerrit.extensions.common.ProjectInfo > children ( boolean recursive ) throws com.google.gerrit.extensions.restapi.RestApiException { com.google.gerrit.server.restapi.project.ListChildProjects list = children.list ( ) ; list.setRecursive ( recursive ) ; try { return list.apply ( checkExists ( ) ) ; } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( "Cannot list children" , e ) ; } }
Source:
private java.lang.String n ( final com.google.gerrit.reviewdb.client.Account a ) { java.lang.String n = a.getFullName ( ) ; if ( ( n != null ) && ( ( n.length ( ) ) > 0 ) ) { return n ; } n = a.getPreferredEmail ( ) ; if ( ( n != null ) && ( ( n.length ( ) ) > 0 ) ) { return n ; } return a.getId ( ) . toString ( ) ; }

Target:
private java.util.List < com.google.gerrit.reviewdb.client.AccountGroupMember > loadMembers ( ) throws com.google.gwtorm.server.OrmException { java.util.List < com.google.gerrit.reviewdb.client.AccountGroupMember > members = new java.util.ArrayList < > ( ) ; for ( com.google.gerrit.reviewdb.client.AccountGroupMember m : db.accountGroupMembers ( ) . byGroup ( groupId ) ) { if ( control.canSeeMember ( m.getAccountId ( ) ) ) { members.add ( m ) ; } } return members ; }
Source:
private com.google.gerrit.server.change.ReviewerJson.ReviewerInfo format ( com.google.gerrit.server.change.ReviewerResource rsrc , java.util.List < com.google.gerrit.reviewdb.client.PatchSetApproval > approvals ) throws com.google.gwtorm.server.OrmException { return format ( new com.google.gerrit.server.change.ReviewerJson.ReviewerInfo ( rsrc.getUser ( ) . getAccountId ( ) ) , rsrc.getNotes ( ) , rsrc.getUserControl ( ) , approvals ) ; }

Target:
public com.google.gerrit.server.change.ReviewerJson.ReviewerInfo format ( com.google.gerrit.server.change.ReviewerJson.ReviewerInfo out , com.google.gerrit.server.project.ChangeControl ctl , com.google.gerrit.server.notedb.ChangeNotes changeNotes ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.PatchSet.Id psId = ctl.getChange ( ) . currentPatchSetId ( ) ; return format ( out , ctl , approvalsUtil.byPatchSetUser ( db.get ( ) , changeNotes , psId , out._id ) ) ; }
Source:
public void delete ( com.google.gerrit.reviewdb.client.Change.Id id ) throws java.io.IOException { org.apache.lucene.index.Term idTerm = com.google.gerrit.lucene.QueryBuilder.idTerm ( id ) ; try { com.google.common.util.concurrent.Futures.allAsList ( openIndex.delete ( idTerm ) , closedIndex.delete ( idTerm ) ) . get ( ) ; } catch ( java.util.concurrent.ExecutionException | java.lang.InterruptedException e ) { throw new java.io.IOException ( e ) ; } }

Target:
public void deleteAll ( ) throws java.io.IOException { openIndex.deleteAll ( ) ; closedIndex.deleteAll ( ) ; }
Source:
abstract java.lang.Runnable toggleOpenBox ( final net.codemirror.lib.CodeMirror cm ) ;

Target:
java.lang.Runnable newDraftCallback ( final net.codemirror.lib.CodeMirror cm ) { if ( ! ( com.google.gerrit.client.Gerrit.isSignedIn ( ) ) ) { return signInCallback ( cm ) ; } return new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { if ( cm.extras ( ) . hasActiveLine ( ) ) { newDraft ( cm ) ; } } } ; }
Source:
private net.sf.ehcache.config.CacheConfiguration newCache ( final java.lang.String name ) { final net.sf.ehcache.config.CacheConfiguration c ; c = mgr.getDefaultCacheConfiguration ( ) . clone ( ) ; c.setName ( name ) ; return c ; }

Target:
private net.sf.ehcache.config.CacheConfiguration newCache ( final java.lang.String name ) { try { final net.sf.ehcache.config.CacheConfiguration c ; c = mgr.getDefaultCacheConfiguration ( ) . clone ( ) ; c.setName ( name ) ; return c ; } catch ( java.lang.CloneNotSupportedException e ) { throw new com.google.inject.ProvisionException ( ( "Cannot configure cache " + name ) , e ) ; } }
Source:
private boolean getInheritableBoolean ( com.google.common.base.Function < com.google.gerrit.reviewdb.client.Project , com.google.gerrit.extensions.client.InheritableBoolean > func ) { for ( com.google.gerrit.server.project.ProjectState s : tree ( ) ) { switch ( func.apply ( s.getProject ( ) ) ) { case TRUE : return true ; case FALSE : return false ; case INHERIT : default : continue ; } } return false ; }

Target:
private boolean getInheritableBoolean ( java.util.function.Function < com.google.gerrit.reviewdb.client.Project , com.google.gerrit.extensions.client.InheritableBoolean > func ) { for ( com.google.gerrit.server.project.ProjectState s : tree ( ) ) { switch ( func.apply ( s.getProject ( ) ) ) { case TRUE : return true ; case FALSE : return false ; case INHERIT : default : continue ; } } return false ; }
Source:
protected void onUnload ( ) { setRegisterKeys ( false ) ; if ( ( ( saveId ) != null ) && ( ( currentRow ) >= 0 ) ) { final RowItem c = com.google.gerrit.client.ui.NavigationTable.getRowItem ( currentRow ) ; if ( c != null ) { com.google.gerrit.client.ui.NavigationTable.savedPositions.put ( saveId , getRowItemKey ( c ) ) ; } } super . onUnload ( ) ; }

Target:
protected void onUnload ( ) { setRegisterKeys ( false ) ; if ( ( ( saveId ) != null ) && ( ( currentRow ) >= 0 ) ) { final RowItem c = com.google.gerrit.client.ui.NavigationTable.getRowItem ( currentRow ) ; if ( c != null ) { com.google.gerrit.client.ui.NavigationTable.savedPositions.put ( saveId , getRowItemKey ( c ) ) ; } } computedScrollType = false ; parentScrollPanel = null ; super . onUnload ( ) ; }
Source:
public com.gitblit.models.UserModel authenticate ( java.lang.String username , char [ ] password ) { java.lang.String passwordString = new java.lang.String ( password ) ; if ( passwordString.startsWith ( com.googlesource.gerrit.plugins.gitblit.auth.GerritToGitBlitUserService.SESSIONAUTH ) ) { return authenticateSSO ( username , passwordString.substring ( com.googlesource.gerrit.plugins.gitblit.auth.GerritToGitBlitUserService.SESSIONAUTH.length ( ) ) ) ; } else { return authenticateBasicAuth ( username , passwordString ) ; } }

Target:
public com.gitblit.models.UserModel authenticate ( java.lang.String username , char [ ] password ) { java.lang.String passwordString = new java.lang.String ( password ) ; if ( username.equals ( GerritToGitBlitUserModel.ANONYMOUS_USER ) ) { return com.googlesource.gerrit.plugins.gitblit.auth.GerritToGitBlitUserModel.getAnonymous ( projectControl ) ; } else if ( passwordString.startsWith ( com.googlesource.gerrit.plugins.gitblit.auth.GerritToGitBlitUserService.SESSIONAUTH ) ) { return authenticateSSO ( username , passwordString.substring ( com.googlesource.gerrit.plugins.gitblit.auth.GerritToGitBlitUserService.SESSIONAUTH.length ( ) ) ) ; } else { return authenticateBasicAuth ( username , passwordString ) ; } }
Source:
public void onResize ( com.google.gwt.event.logical.shared.ResizeEvent event ) { if ( ( cmA ) != null ) { cmA.setHeight ( ( ( event.getHeight ( ) ) - ( com.google.gerrit.client.diff.SideBySide2.HEADER_FOOTER ) ) ) ; cmA.refresh ( ) ; } if ( ( cmB ) != null ) { cmB.setHeight ( ( ( event.getHeight ( ) ) - ( com.google.gerrit.client.diff.SideBySide2.HEADER_FOOTER ) ) ) ; cmB.refresh ( ) ; } resizeBoxPaddings ( ) ; }

Target:
private void resizeCodeMirror ( ) { int h = ( com.google.gerrit.client.Gerrit.getHeaderFooterHeight ( ) ) + ( reviewed.getOffsetHeight ( ) ) ; if ( ( cmA ) != null ) { cmA.setHeight ( ( ( com.google.gwt.user.client.Window.getClientHeight ( ) ) - h ) ) ; cmA.refresh ( ) ; } if ( ( cmB ) != null ) { cmB.setHeight ( ( ( com.google.gwt.user.client.Window.getClientHeight ( ) ) - h ) ) ; cmB.refresh ( ) ; } }
Source:
private void setDefaultDateFormatterBuilder ( ) { if ( ( dateFormatterBuilder ) == null ) { dateFormatterBuilder = new com.google.gitiles.DateFormatterBuilder ( ) ; } }

Target:
private void setDefaultDateFormatterBuilder ( ) { if ( ( dateFormatterBuilder ) == null ) { java.lang.String tzStr = config.getString ( "gitiles" , null , "fixedTimeZone" ) ; com.google.common.base.Optional < java.util.TimeZone > tz ; if ( tzStr == null ) { tz = com.google.common.base.Optional.absent ( ) ; } else { tz = com.google.common.base.Optional.of ( java.util.TimeZone.getTimeZone ( tzStr ) ) ; } dateFormatterBuilder = new com.google.gitiles.DateFormatterBuilder ( tz ) ; } }
Source:
private static com.google.gerrit.extensions.client.GeneralPreferencesInfo parseDefaultGeneralPreferences ( org.eclipse.jgit.lib.Config defaultCfg , com.google.gerrit.extensions.client.GeneralPreferencesInfo input ) throws org.eclipse.jgit.errors.ConfigInvalidException { com.google.gerrit.extensions.client.GeneralPreferencesInfo allUserPrefs = new com.google.gerrit.extensions.client.GeneralPreferencesInfo ( ) ; com.google.gerrit.server.config.ConfigUtil.loadSection ( defaultCfg , UserConfigSections.GENERAL , null , allUserPrefs , com.google.gerrit.extensions.client.GeneralPreferencesInfo.defaults ( ) , input ) ; return com.google.gerrit.server.account.PreferencesConfig.updateGeneralPreferencesDefaults ( allUserPrefs ) ; }

Target:
private static com.google.gerrit.extensions.client.GeneralPreferencesInfo parseDefaultGeneralPreferences ( org.eclipse.jgit.lib.Config defaultCfg , com.google.gerrit.extensions.client.GeneralPreferencesInfo input ) throws org.eclipse.jgit.errors.ConfigInvalidException { com.google.gerrit.extensions.client.GeneralPreferencesInfo allUserPrefs = new com.google.gerrit.extensions.client.GeneralPreferencesInfo ( ) ; com.google.gerrit.server.config.ConfigUtil.loadSection ( defaultCfg , UserConfigSections.GENERAL , null , allUserPrefs , com.google.gerrit.extensions.client.GeneralPreferencesInfo.defaults ( ) , input ) ; return com.google.gerrit.server.account.Preferences.updateGeneralPreferencesDefaults ( allUserPrefs ) ; }
Source:
public void requestReceived ( com.github.tomakehurst.wiremock.http.Request request , com.github.tomakehurst.wiremock.http.Response response ) { if ( request.getAbsoluteUrl ( ) . contains ( flushRequest ) ) { try { checkPoint.await ( ) ; } catch ( java.lang.InterruptedException | java.util.concurrent.BrokenBarrierException e ) { org.junit.Assert.fail ( ) ; } } }

Target:
public void requestReceived ( com.github.tomakehurst.wiremock.http.Request request , com.github.tomakehurst.wiremock.http.Response response ) { if ( request.getAbsoluteUrl ( ) . contains ( flushRequest ) ) { expectedRequestLatch.countDown ( ) ; } }
Source:
public void listEmptyGroupIncludes ( ) throws java.lang.Exception { com.google.common.truth.Truth.assertThat ( GET ( "/groups/Administrators/groups/" ) ) . isEmpty ( ) ; }

Target:
public void listEmptyGroupIncludes ( ) throws java.lang.Exception { java.lang.String gx = group ( "gx" , "Administrators" ) ; PUT ( ( ( ( "/groups/" + gx ) + "/groups/" ) + ( name ( "emptygroup" ) ) ) ) ; com.google.common.truth.Truth.assertThat ( GET ( "/groups/Administrators/groups/" ) ) . isEmpty ( ) ; }
Source:
protected void configure ( ) { install ( new com.google.inject.assistedinject.FactoryModuleBuilder ( ) . implement ( com.google.gerrit.server.index.change.ChangeIndex.class , com.google.gerrit.elasticsearch.ElasticChangeIndex.class ) . build ( ChangeIndex.Factory.class ) ) ; install ( new com.google.inject.assistedinject.FactoryModuleBuilder ( ) . implement ( com.google.gerrit.server.index.account.AccountIndex.class , com.google.gerrit.lucene.LuceneAccountIndex.class ) . build ( AccountIndex.Factory.class ) ) ; install ( new com.google.gerrit.server.index.IndexModule ( threads ) ) ; install ( new com.google.gerrit.index.SingleVersionModule ( singleVersions ) ) ; }

Target:
protected void configure ( ) { install ( new com.google.inject.assistedinject.FactoryModuleBuilder ( ) . implement ( com.google.gerrit.server.index.change.ChangeIndex.class , com.google.gerrit.elasticsearch.ElasticChangeIndex.class ) . build ( ChangeIndex.Factory.class ) ) ; install ( new com.google.inject.assistedinject.FactoryModuleBuilder ( ) . implement ( com.google.gerrit.server.index.account.AccountIndex.class , com.google.gerrit.elasticsearch.ElasticAccountIndex.class ) . build ( AccountIndex.Factory.class ) ) ; install ( new com.google.gerrit.server.index.IndexModule ( threads ) ) ; install ( new com.google.gerrit.server.index.SingleVersionModule ( singleVersions ) ) ; }
Source:
private void fireEvent ( com.google.gerrit.common.Event event , com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { for ( com.google.gerrit.common.ChangeHookRunner.EventListenerHolder holder : listeners.values ( ) ) { if ( isVisibleTo ( event , holder.user , db ) ) { holder.listener.onEvent ( event ) ; } } fireEventForUnrestrictedListeners ( event ) ; }

Target:
private void fireEvent ( com.google.gerrit.common.Event event , com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { for ( com.google.gerrit.common.UserScopedEventListener listener : listeners ) { if ( isVisibleTo ( event , listener.getUser ( ) , db ) ) { listener.onEvent ( event ) ; } } fireEventForUnrestrictedListeners ( event ) ; }
Source:
public void addEmail ( com.google.gerrit.extensions.api.accounts.EmailInput input ) throws com.google.gerrit.extensions.restapi.RestApiException { com.google.gerrit.server.account.AccountResource.Email rsrc = new com.google.gerrit.server.account.AccountResource.Email ( account.getUser ( ) , input.email ) ; try { createEmailFactory.create ( input.email ) . apply ( rsrc , input ) ; } catch ( com.google.gerrit.common.errors.EmailException | com.google.gwtorm.server.OrmException | java.io.IOException | org.eclipse.jgit.errors.ConfigInvalidException | com.google.gerrit.server.permissions.PermissionBackendException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot add email" , e ) ; } }

Target:
public void addEmail ( com.google.gerrit.extensions.api.accounts.EmailInput input ) throws com.google.gerrit.extensions.restapi.RestApiException { com.google.gerrit.server.account.AccountResource.Email rsrc = new com.google.gerrit.server.account.AccountResource.Email ( account.getUser ( ) , input.email ) ; try { createEmailFactory.create ( input.email ) . apply ( rsrc , input ) ; } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( "Cannot add email" , e ) ; } }
Source:
public java.util.Map < com.google.gerrit.reviewdb.ApprovalCategory.Id , com.google.gerrit.reviewdb.PatchSetApproval > getApprovalMap ( ) { final java.util.HashMap < com.google.gerrit.reviewdb.ApprovalCategory.Id , com.google.gerrit.reviewdb.PatchSetApproval > r ; r = new java.util.HashMap < com.google.gerrit.reviewdb.ApprovalCategory.Id , com.google.gerrit.reviewdb.PatchSetApproval > ( ) ; for ( final com.google.gerrit.reviewdb.PatchSetApproval ca : approvals ) { r.put ( ca.getCategoryId ( ) , ca ) ; } return r ; }

Target:
public com.google.gerrit.reviewdb.PatchSetApproval getPatchSetApproval ( com.google.gerrit.reviewdb.ApprovalCategory.Id category ) { for ( com.google.gerrit.reviewdb.PatchSetApproval psa : approvals ) { if ( psa.getCategoryId ( ) . equals ( category ) ) { return psa ; } } return null ; }
Source:
public void onSuccess ( com.googlesource.gerrit.plugins.serviceuser.client.AccountCapabilities ac ) { boolean isAdmin = ac.canPerform ( "administrateServer" ) ; display ( serviceUserInfo , ( ( configInfo.getAllowEmail ( ) ) || isAdmin ) , ( ( configInfo.getAllowOwner ( ) ) || isAdmin ) ) ; }

Target:
public void onSuccess ( com.googlesource.gerrit.plugins.serviceuser.client.AccountCapabilities ac ) { boolean isAdmin = ac.canPerform ( "administrateServer" ) ; display ( serviceUserInfo , httpPassword.asString ( ) , ( ( configInfo.getAllowEmail ( ) ) || isAdmin ) , ( ( configInfo.getAllowOwner ( ) ) || isAdmin ) , ( ( configInfo.getAllowHttpPassword ( ) ) || isAdmin ) ) ; }
Source:
public void publishDraftChange ( ) throws java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { java.lang.String changeId = createDraftChange ( ) ; com.google.gerrit.server.change.ChangeJson.ChangeInfo c = getChange ( changeId ) ; org.junit.Assert.assertEquals ( ( "p~master~" + changeId ) , c.id ) ; org.junit.Assert.assertEquals ( Change.Status.DRAFT , c.status ) ; com.google.gerrit.acceptance.RestResponse r = publishChange ( changeId ) ; org.junit.Assert.assertEquals ( 204 , r.getStatusCode ( ) ) ; c = getChange ( changeId ) ; org.junit.Assert.assertEquals ( Change.Status.NEW , c.status ) ; }

Target:
public void publishDraftPatchSet ( ) throws com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { java.lang.String changeId = createDraftChange ( ) ; com.google.gerrit.server.change.ChangeJson.ChangeInfo c = getChange ( changeId ) ; org.junit.Assert.assertEquals ( ( "p~master~" + changeId ) , c.id ) ; org.junit.Assert.assertEquals ( Change.Status.DRAFT , c.status ) ; com.google.gerrit.acceptance.RestResponse r = publishPatchSet ( changeId ) ; org.junit.Assert.assertEquals ( 204 , r.getStatusCode ( ) ) ; c = getChange ( changeId ) ; org.junit.Assert.assertEquals ( Change.Status.NEW , c.status ) ; }
Source:
public com.google.gerrit.server.notedb.ChangeNotes createFromIdOnlyWhenNoteDbDisabled ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Change.Id changeId ) throws com.google.gwtorm.server.OrmException { com.google.common.base.Preconditions.checkState ( ( ! ( args.migration.readChanges ( ) ) ) , ( "do not call" + " createFromIdOnlyWhenNoteDbDisabled when NoteDb is enabled" ) ) ; com.google.gerrit.reviewdb.client.Change change = com.google.gerrit.server.notedb.ChangeNotes.unwrap ( db ) . changes ( ) . get ( changeId ) ; com.google.common.base.Preconditions.checkNotNull ( change , "change %s not found in ReviewDb" , changeId ) ; return new com.google.gerrit.server.notedb.ChangeNotes ( args , change ) . load ( ) ; }

Target:
public com.google.gerrit.server.notedb.ChangeNotes createFromIdOnlyWhenNoteDbDisabled ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Change.Id changeId ) throws com.google.gwtorm.server.OrmException { com.google.common.base.Preconditions.checkState ( ( ! ( args.migration.readChanges ( ) ) ) , ( "do not call" + " createFromIdOnlyWhenNoteDbDisabled when NoteDb is enabled" ) ) ; com.google.gerrit.reviewdb.client.Change change = com.google.gerrit.reviewdb.server.ReviewDbUtil.unwrapDb ( db ) . changes ( ) . get ( changeId ) ; com.google.common.base.Preconditions.checkNotNull ( change , "change %s not found in ReviewDb" , changeId ) ; return new com.google.gerrit.server.notedb.ChangeNotes ( args , change ) . load ( ) ; }
Source:
private void updateAccountInNoteDb ( org.eclipse.jgit.lib.Repository allUsersRepo , com.google.gerrit.reviewdb.client.Account account ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { com.google.gerrit.server.git.MetaDataUpdate md = new com.google.gerrit.server.git.MetaDataUpdate ( com.google.gerrit.server.extensions.events.GitReferenceUpdated.DISABLED , allUsersName , allUsersRepo ) ; org.eclipse.jgit.lib.PersonIdent ident = serverIdent.get ( ) ; md.getCommitBuilder ( ) . setAuthor ( ident ) ; md.getCommitBuilder ( ) . setCommitter ( ident ) ; new com.google.gerrit.server.account.AccountConfig ( account.getId ( ) , allUsersRepo ) . load ( ) . setAccount ( account ) . commit ( md ) ; }

Target:
private void updateAccountInNoteDb ( org.eclipse.jgit.lib.Repository allUsersRepo , com.google.gerrit.reviewdb.client.Account account ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { com.google.gerrit.server.git.meta.MetaDataUpdate md = new com.google.gerrit.server.git.meta.MetaDataUpdate ( com.google.gerrit.server.extensions.events.GitReferenceUpdated.DISABLED , allUsersName , allUsersRepo ) ; org.eclipse.jgit.lib.PersonIdent ident = serverIdent.get ( ) ; md.getCommitBuilder ( ) . setAuthor ( ident ) ; md.getCommitBuilder ( ) . setCommitter ( ident ) ; new com.google.gerrit.server.account.AccountConfig ( account.getId ( ) , allUsersRepo ) . load ( ) . setAccount ( account ) . commit ( md ) ; }
Source:
public static void scheduleFullSync ( final com.google.gerrit.client.reviewdb.Project.NameKey project ) { for ( final org.spearce.jgit.transport.RemoteConfig cfg : com.google.gerrit.git.PushQueue.allConfigs ( ) ) { for ( final org.spearce.jgit.transport.URIish uri : cfg.getURIs ( ) ) { com.google.gerrit.git.PushQueue.scheduleImp ( project , PushOp.MIRROR_ALL , cfg , com.google.gerrit.git.PushQueue.expandURI ( uri , project ) ) ; } } }

Target:
public static void scheduleFullSync ( final com.google.gerrit.client.reviewdb.Project.NameKey project ) { for ( final com.google.gerrit.git.PushQueue.ReplicationConfig cfg : com.google.gerrit.git.PushQueue.allConfigs ( ) ) { for ( final org.spearce.jgit.transport.URIish uri : cfg.getURIs ( project ) ) { com.google.gerrit.git.PushQueue.scheduleImp ( project , PushOp.MIRROR_ALL , cfg , uri ) ; } } }
Source:
private int checkApproval ( com.google.gerrit.acceptance.PushOneCommit.Result r ) throws java.lang.Exception { org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( r.getChange ( ) . project ( ) ) ; com.googlesource.gerrit.plugins.findowners.Cache cache = com.googlesource.gerrit.plugins.findowners.Cache.getInstance ( ) . init ( 0 , 0 ) ; com.googlesource.gerrit.plugins.findowners.OwnersDb db = cache.get ( accountCache , accounts , repo , r.getChange ( ) , 1 ) ; com.googlesource.gerrit.plugins.findowners.Checker c = new com.googlesource.gerrit.plugins.findowners.Checker ( repo , r.getChange ( ) , 1 ) ; return c.findApproval ( accountCache , db ) ; }

Target:
private int checkApproval ( com.google.gerrit.acceptance.PushOneCommit.Result r ) throws java.lang.Exception { org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( r.getChange ( ) . project ( ) ) ; com.googlesource.gerrit.plugins.findowners.Cache cache = com.googlesource.gerrit.plugins.findowners.Cache.getInstance ( ) . init ( 0 , 0 ) ; com.googlesource.gerrit.plugins.findowners.OwnersDb db = cache.get ( accountCache , emails , repo , r.getChange ( ) , 1 ) ; com.googlesource.gerrit.plugins.findowners.Checker c = new com.googlesource.gerrit.plugins.findowners.Checker ( repo , r.getChange ( ) , 1 ) ; return c.findApproval ( accountCache , db ) ; }
Source:
public void rootJson ( ) throws java.lang.Exception { java.lang.String name = repo.getRepository ( ) . getDescription ( ) . getRepositoryName ( ) ; java.util.Map < java.lang.String , com.google.gitiles.RepositoryDescription > res = buildJson ( "/" , new com.google.gson.reflect.TypeToken < java.util.Map < java.lang.String , com.google.gitiles.RepositoryDescription > > ( ) { } . getType ( ) ) ; com.google.common.truth.Truth.assertThat ( res ) . hasSize ( 1 ) ; com.google.common.truth.Truth.assertThat ( res ) . containsKey ( name ) ; com.google.gitiles.RepositoryDescription d = res.get ( name ) ; com.google.common.truth.Truth.assertThat ( d.name ) . isEqualTo ( name ) ; }

Target:
public void rootJson ( ) throws java.lang.Exception { java.lang.String name = repo.getRepository ( ) . getDescription ( ) . getRepositoryName ( ) ; java.util.Map < java.lang.String , com.google.gitiles.RepositoryDescription > res = buildJson ( "/" , com.google.gitiles.HostIndexServletTest.REPOS ) ; com.google.common.truth.Truth.assertThat ( res ) . hasSize ( 1 ) ; com.google.common.truth.Truth.assertThat ( res ) . containsKey ( name ) ; com.google.gitiles.RepositoryDescription d = res.get ( name ) ; com.google.common.truth.Truth.assertThat ( d.name ) . isEqualTo ( name ) ; }
Source:
private com.google.common.collect.FluentIterable < com.google.gerrit.extensions.api.projects.BranchInfo > filterBranches ( com.google.common.collect.FluentIterable < com.google.gerrit.extensions.api.projects.BranchInfo > branches ) throws com.google.gerrit.extensions.restapi.BadRequestException { if ( ! ( com.google.common.base.Strings.isNullOrEmpty ( matchSubstring ) ) ) { branches = branches.filter ( new com.google.gerrit.server.project.ListBranches.SubstringPredicate ( matchSubstring ) ) ; } else if ( ! ( com.google.common.base.Strings.isNullOrEmpty ( matchRegex ) ) ) { branches = branches.filter ( new com.google.gerrit.server.project.ListBranches.RegexPredicate ( matchRegex ) ) ; } return branches ; }

Target:
public java.util.List < com.google.gerrit.extensions.api.projects.BranchInfo > apply ( com.google.gerrit.server.project.ProjectResource rsrc ) throws com.google.gerrit.extensions.restapi.BadRequestException , com.google.gerrit.extensions.restapi.ResourceNotFoundException , java.io.IOException { return new com.google.gerrit.server.project.RefFilter < com.google.gerrit.extensions.api.projects.BranchInfo > ( org.eclipse.jgit.lib.Constants.R_HEADS ) . subString ( matchSubstring ) . regex ( matchRegex ) . start ( start ) . limit ( limit ) . filter ( allBranches ( rsrc ) ) ; }
Source:
public void onLoad ( ) { super . onLoad ( ) ; Util.ACCOUNT_SEC.validateEmail ( magicToken , new com.google.gerrit.client.rpc.GerritCallback < com.google.gwtjsonrpc.client.VoidResult > ( ) { public void onSuccess ( final com.google.gwtjsonrpc.client.VoidResult result ) { com.google.gwt.user.client.History.newItem ( Link.SETTINGS_CONTACT , true ) ; } } ) ; }

Target:
public void onLoad ( ) { super . onLoad ( ) ; Util.ACCOUNT_SEC.validateEmail ( magicToken , new com.google.gerrit.client.rpc.ScreenLoadCallback < com.google.gwtjsonrpc.client.VoidResult > ( this ) { @ java.lang.Override protected void preDisplay ( final com.google.gwtjsonrpc.client.VoidResult result ) { } @ java.lang.Override protected void postDisplay ( ) { com.google.gwt.user.client.History.newItem ( Link.SETTINGS_CONTACT , true ) ; } } ) ; }
Source:
private java.util.Set < java.lang.String > getRequestedFields ( ) { if ( ( requestedFields ) != null ) { return requestedFields ; } com.google.gerrit.server.index.Index < ? , T > index = indexes.getSearchIndex ( ) ; return index != null ? index.getSchema ( ) . getStoredFields ( ) . keySet ( ) : com.google.common.collect.ImmutableSet.< java.lang.String > of ( ) ; }

Target:
private java.util.Set < java.lang.String > getRequestedFields ( ) { if ( ( requestedFields ) != null ) { return requestedFields ; } com.google.gerrit.index.Index < ? , T > index = indexes.getSearchIndex ( ) ; return index != null ? index.getSchema ( ) . getStoredFields ( ) . keySet ( ) : com.google.common.collect.ImmutableSet.< java.lang.String > of ( ) ; }
Source:
public void setDraft ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.notedb.ChangeUpdate update , com.google.gerrit.reviewdb.client.PatchSet ps , boolean draft ) throws com.google.gwtorm.server.OrmException { ensurePatchSetMatches ( ps.getId ( ) , update ) ; ps.setDraft ( draft ) ; update.setPatchSetState ( ( draft ? com.google.gerrit.server.notedb.PatchSetState.DRAFT : com.google.gerrit.server.notedb.PatchSetState.PUBLISHED ) ) ; db.patchSets ( ) . update ( java.util.Collections.singleton ( ps ) ) ; }

Target:
public void publish ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.notedb.ChangeUpdate update , com.google.gerrit.reviewdb.client.PatchSet ps ) throws com.google.gwtorm.server.OrmException { ensurePatchSetMatches ( ps.getId ( ) , update ) ; ps.setDraft ( false ) ; update.setPatchSetState ( com.google.gerrit.server.notedb.PatchSetState.PUBLISHED ) ; db.patchSets ( ) . update ( java.util.Collections.singleton ( ps ) ) ; }