auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private java.util.Optional < com.google.gerrit.reviewdb.client.Account > loadAccount ( com.google.gerrit.reviewdb.client.Account.Id accountId , org.eclipse.jgit.revwalk.RevWalk rw , org.eclipse.jgit.lib.ObjectId commit ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { rw.reset ( ) ; com.google.gerrit.server.account.AccountConfig accountConfig = new com.google.gerrit.server.account.AccountConfig ( null , accountId ) ; accountConfig.load ( rw , commit ) ; return accountConfig.getLoadedAccount ( ) ; }

Target:
private java.util.Optional < com.google.gerrit.reviewdb.client.Account > loadAccount ( com.google.gerrit.reviewdb.client.Account.Id accountId , org.eclipse.jgit.revwalk.RevWalk rw , org.eclipse.jgit.lib.ObjectId commit ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { rw.reset ( ) ; com.google.gerrit.server.account.AccountConfig accountConfig = new com.google.gerrit.server.account.AccountConfig ( accountId ) ; accountConfig.load ( rw , commit ) ; return accountConfig.getLoadedAccount ( ) ; }
Source:
private void goUpToChange ( boolean openReplyBox ) { java.lang.String b = ( ( base ) != null ) ? java.lang.String.valueOf ( base.get ( ) ) : null ; java.lang.String rev = java.lang.String.valueOf ( revision.get ( ) ) ; com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( changeId , rev ) , new com.google.gerrit.client.change.ChangeScreen2 ( changeId , b , rev , openReplyBox , false ) ) ; }

Target:
private void goUpToChange ( boolean openReplyBox ) { java.lang.String b = ( ( base ) != null ) ? java.lang.String.valueOf ( base.get ( ) ) : null ; java.lang.String rev = java.lang.String.valueOf ( revision.get ( ) ) ; com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( changeId , rev ) , new com.google.gerrit.client.change.ChangeScreen2 ( changeId , b , rev , openReplyBox ) ) ; }
Source:
public static boolean canRebase ( com.google.gerrit.reviewdb.client.PatchSet patchSet , com.google.gerrit.reviewdb.client.Branch.NameKey dest , org.eclipse.jgit.lib.Repository git , org.eclipse.jgit.revwalk.RevWalk rw , com.google.gerrit.reviewdb.server.ReviewDb db ) { try { com.google.gerrit.server.change.RebaseUtil.findBaseRevision ( patchSet , dest , git , rw , db ) ; return true ; } catch ( com.google.gerrit.extensions.restapi.RestApiException e ) { return false ; } catch ( com.google.gwtorm.server.OrmException | java.io.IOException e ) { com.google.gerrit.server.change.RebaseUtil.log.warn ( java.lang.String.format ( "Error checking if patch set %s on %s can be rebased" , patchSet.getId ( ) , dest ) , e ) ; return false ; } }

Target:
public boolean canRebase ( com.google.gerrit.reviewdb.client.PatchSet patchSet , com.google.gerrit.reviewdb.client.Branch.NameKey dest , org.eclipse.jgit.lib.Repository git , org.eclipse.jgit.revwalk.RevWalk rw ) { try { findBaseRevision ( patchSet , dest , git , rw ) ; return true ; } catch ( com.google.gerrit.extensions.restapi.RestApiException e ) { return false ; } catch ( com.google.gwtorm.server.OrmException | java.io.IOException e ) { com.google.gerrit.server.change.RebaseUtil.log.warn ( java.lang.String.format ( "Error checking if patch set %s on %s can be rebased" , patchSet.getId ( ) , dest ) , e ) ; return false ; } }
Source:
private static java.lang.String text ( java.lang.String branch , java.lang.String topic ) { if ( ( topic != null ) && ( ! ( topic.isEmpty ( ) ) ) ) { return ( ( branch + " (" ) + topic ) + ")" ; } else { return branch ; } }

Target:
private static java.lang.String text ( java.lang.String branch , java.lang.String topic ) { if ( ( topic != null ) && ( ! ( topic.isEmpty ( ) ) ) ) { return ( ( branch + " (" ) + topic ) + ")" ; } return branch ; }
Source:
private static java.util.List < com.google.gerrit.reviewdb.client.PatchSet > toPatchSets ( com.google.gerrit.client.changes.ChangeInfo info ) { com.google.gwt.core.client.JsArray < com.google.gerrit.client.changes.ChangeInfo.RevisionInfo > all = info.revisions ( ) . values ( ) ; com.google.gerrit.client.changes.ChangeInfo.RevisionInfo.sortRevisionInfoByNumber ( all ) ; java.util.List < com.google.gerrit.reviewdb.client.PatchSet > r = new java.util.ArrayList < com.google.gerrit.reviewdb.client.PatchSet > ( all.length ( ) ) ; for ( com.google.gerrit.client.changes.ChangeInfo.RevisionInfo rev : com.google.gerrit.client.rpc.Natives.asList ( all ) ) { r.add ( com.google.gerrit.client.changes.ChangeDetailCache.toPatchSet ( info , rev ) ) ; } return r ; }

Target:
private static java.util.List < com.google.gerrit.reviewdb.client.PatchSet > toPatchSets ( com.google.gerrit.client.changes.ChangeInfo info ) { com.google.gwt.core.client.JsArray < com.google.gerrit.client.changes.ChangeInfo.RevisionInfo > all = info.revisions ( ) . values ( ) ; com.google.gerrit.client.changes.ChangeInfo.RevisionInfo.sortRevisionInfoByNumber ( all ) ; java.util.List < com.google.gerrit.reviewdb.client.PatchSet > r = new java.util.ArrayList ( all.length ( ) ) ; for ( com.google.gerrit.client.changes.ChangeInfo.RevisionInfo rev : com.google.gerrit.client.rpc.Natives.asList ( all ) ) { r.add ( com.google.gerrit.client.changes.ChangeDetailCache.toPatchSet ( info , rev ) ) ; } return r ; }
Source:
private void addDiffChunkAndPadding ( net.codemirror.lib.CodeMirror cmToPad , int lineToPad , int lineOnOther , int chunkSize ) { net.codemirror.lib.CodeMirror otherCm = otherCm ( cmToPad ) ; linePaddingOnOtherSideMap.put ( otherCm.getLineHandle ( lineOnOther ) , new com.google.gerrit.client.diff.PaddingManager.LinePaddingWidgetWrapper ( addPaddingWidget ( cmToPad , DiffTable.style.padding ( ) , lineToPad , 0 , Unit.EM , null ) , lineToPad , chunkSize ) ) ; diffChunks.add ( new com.google.gerrit.client.diff.SideBySide2.DiffChunkInfo ( getSideFromCm ( otherCm ) , ( ( lineOnOther - chunkSize ) + 1 ) , lineOnOther ) ) ; }

Target:
private void addDiffChunkAndPadding ( net.codemirror.lib.CodeMirror cmToPad , int lineToPad , int lineOnOther , int chunkSize , boolean edit ) { net.codemirror.lib.CodeMirror otherCm = otherCm ( cmToPad ) ; linePaddingOnOtherSideMap.put ( otherCm.getLineHandle ( lineOnOther ) , new com.google.gerrit.client.diff.PaddingManager.LinePaddingWidgetWrapper ( addPaddingWidget ( cmToPad , DiffTable.style.padding ( ) , lineToPad , 0 , Unit.EM , null ) , lineToPad , chunkSize ) ) ; diffChunks.add ( new com.google.gerrit.client.diff.SideBySide2.DiffChunkInfo ( getSideFromCm ( otherCm ) , ( ( lineOnOther - chunkSize ) + 1 ) , lineOnOther , edit ) ) ; }
Source:
public com.google.gerrit.server.group.GroupInfo apply ( com.google.gerrit.server.group.GroupResource resource , com.google.gerrit.server.group.AddIncludedGroups.PutIncludedGroup.Input input ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.BadRequestException , com.google.gerrit.extensions.restapi.MethodNotAllowedException , com.google.gwtorm.server.OrmException { com.google.gerrit.server.group.AddIncludedGroups.Input in = new com.google.gerrit.server.group.AddIncludedGroups.Input ( ) ; in.groups = com.google.common.collect.ImmutableList.of ( id ) ; java.util.List < com.google.gerrit.server.group.GroupInfo > list = put.get ( ) . apply ( resource , in ) ; if ( ( list.size ( ) ) == 1 ) { return list.get ( 0 ) ; } else { throw new java.lang.IllegalStateException ( ) ; } }

Target:
public com.google.gerrit.server.group.GroupInfo apply ( com.google.gerrit.server.group.GroupResource resource , com.google.gerrit.server.group.AddIncludedGroups.PutIncludedGroup.Input input ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.BadRequestException , com.google.gerrit.extensions.restapi.MethodNotAllowedException , com.google.gwtorm.server.OrmException { com.google.gerrit.server.group.AddIncludedGroups.Input in = new com.google.gerrit.server.group.AddIncludedGroups.Input ( ) ; in.groups = com.google.common.collect.ImmutableList.of ( id ) ; java.util.List < com.google.gerrit.server.group.GroupInfo > list = put.get ( ) . apply ( resource , in ) ; if ( ( list.size ( ) ) == 1 ) { return list.get ( 0 ) ; } throw new java.lang.IllegalStateException ( ) ; }
Source:
private boolean canForceUpdate ( ) { if ( ! ( isProjectStatePermittingWrite ( ) ) ) { return false ; } if ( canPushWithForce ( ) ) { return true ; } switch ( getUser ( ) . getAccessPath ( ) ) { case GIT : return false ; case JSON_RPC : case REST_API : case SSH_COMMAND : case UNKNOWN : case WEB_BROWSER : default : return ( ( isOwner ( ) ) && ( ! ( isForceBlocked ( Permission.PUSH ) ) ) ) || ( projectControl.isAdmin ( ) ) ; } }

Target:
private boolean canForceUpdate ( ) { if ( canPushWithForce ( ) ) { return true ; } switch ( getUser ( ) . getAccessPath ( ) ) { case GIT : return false ; case JSON_RPC : case REST_API : case SSH_COMMAND : case UNKNOWN : case WEB_BROWSER : default : return ( ( isOwner ( ) ) && ( ! ( isForceBlocked ( Permission.PUSH ) ) ) ) || ( projectControl.isAdmin ( ) ) ; } }
Source:
private static void recursivelyDelete ( java.io.File dir ) throws java.io.IOException { if ( ! ( dir.getPath ( ) . equals ( dir.getCanonicalPath ( ) ) ) ) { return ; } java.io.File [ ] contents = dir.listFiles ( ) ; if ( contents != null ) { for ( java.io.File d : contents ) { if ( d.isDirectory ( ) ) { com.google.gerrit.testutil.TempFileUtil.recursivelyDelete ( d ) ; } else { com.google.gerrit.testutil.TempFileUtil.deleteNowOrOnExit ( d ) ; } } } com.google.gerrit.testutil.TempFileUtil.deleteNowOrOnExit ( dir ) ; }

Target:
public static void recursivelyDelete ( java.io.File dir ) throws java.io.IOException { if ( ! ( dir.getPath ( ) . equals ( dir.getCanonicalPath ( ) ) ) ) { return ; } java.io.File [ ] contents = dir.listFiles ( ) ; if ( contents != null ) { for ( java.io.File d : contents ) { if ( d.isDirectory ( ) ) { com.google.gerrit.testutil.TempFileUtil.recursivelyDelete ( d ) ; } else { com.google.gerrit.testutil.TempFileUtil.deleteNowOrOnExit ( d ) ; } } } com.google.gerrit.testutil.TempFileUtil.deleteNowOrOnExit ( dir ) ; }
Source:
public long getEffectiveMaxObjectSizeLimit ( com.google.gerrit.server.project.ProjectState p ) { long global = getMaxObjectSizeLimit ( ) ; long local = p.getMaxObjectSizeLimit ( ) ; if ( ( global > 0 ) && ( local > 0 ) ) { return java.lang.Math.min ( global , local ) ; } else { return java.lang.Math.max ( global , local ) ; } }

Target:
public long getEffectiveMaxObjectSizeLimit ( com.google.gerrit.server.project.ProjectState p ) { long global = getMaxObjectSizeLimit ( ) ; long local = p.getMaxObjectSizeLimit ( ) ; if ( ( global > 0 ) && ( local > 0 ) ) { return java.lang.Math.min ( global , local ) ; } return java.lang.Math.max ( global , local ) ; }
Source:
private com.google.gerrit.extensions.common.CommentInfo addDraft ( java.lang.String changeId , java.lang.String revId , com.google.gerrit.extensions.api.changes.ReviewInput.CommentInput c ) throws java.io.IOException { com.google.gerrit.acceptance.RestResponse r = userSession.put ( ( ( ( ( "/changes/" + changeId ) + "/revisions/" ) + revId ) + "/drafts" ) , c ) ; org.junit.Assert.assertEquals ( HttpStatus.SC_CREATED , r.getStatusCode ( ) ) ; return newGson ( ) . fromJson ( r.getReader ( ) , com.google.gerrit.extensions.common.CommentInfo.class ) ; }

Target:
private com.google.gerrit.extensions.common.CommentInfo addDraft ( java.lang.String changeId , java.lang.String revId , com.google.gerrit.extensions.api.changes.ReviewInput.CommentInput c ) throws java.io.IOException { com.google.gerrit.acceptance.RestResponse r = userSession.put ( ( ( ( ( "/changes/" + changeId ) + "/revisions/" ) + revId ) + "/drafts" ) , c ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( HttpStatus.SC_CREATED ) ; return newGson ( ) . fromJson ( r.getReader ( ) , com.google.gerrit.extensions.common.CommentInfo.class ) ; }
Source:
private void addRanges ( java.util.Map < java.lang.String , java.lang.Object > have , com.google.gerrit.server.account.AccountResource rsrc ) { com.google.gerrit.server.account.CapabilityControl cc = rsrc.getUser ( ) . getCapabilities ( ) ; for ( java.lang.String name : com.google.gerrit.common.data.GlobalCapability.getRangeNames ( ) ) { if ( ( want ( name ) ) && ( cc.hasExplicitRange ( name ) ) ) { have.put ( name , new com.google.gerrit.server.account.GetCapabilities.Range ( cc.getRange ( name ) ) ) ; } } }

Target:
private void addRanges ( java.util.Map < java.lang.String , java.lang.Object > have , com.google.gerrit.server.account.CapabilityControl cc ) { for ( java.lang.String name : com.google.gerrit.common.data.GlobalCapability.getRangeNames ( ) ) { if ( ( want ( name ) ) && ( cc.hasExplicitRange ( name ) ) ) { have.put ( name , new com.google.gerrit.server.account.GetCapabilities.Range ( cc.getRange ( name ) ) ) ; } } }
Source:
private void offer ( final com.google.gerrit.server.events.Event event ) { synchronized ( taskLock ) { if ( ! ( queue.offer ( event ) ) ) { dropped = true ; } if ( ( ( task ) == null ) && ( ! ( done ) ) ) { task = pool.submit ( writer ) ; } } }

Target:
private void offer ( com.google.gerrit.server.events.Event event ) { synchronized ( taskLock ) { if ( ! ( queue.offer ( event ) ) ) { dropped = true ; } if ( ( ( task ) == null ) && ( ! ( done ) ) ) { task = pool.submit ( writer ) ; } } }
Source:
public void onSuccess ( com.google.gwt.core.client.JsArray < com.google.gerrit.client.changes.ChangeList > result ) { java.util.List < com.google.gerrit.client.changes.ChangeList > cls = com.google.gerrit.client.rpc.Natives.asList ( result ) ; updateColumnsForLabels ( cls.toArray ( new com.google.gerrit.client.changes.ChangeList [ cls.size ( ) ] ) ) ; for ( int i = 0 ; i < ( cls.size ( ) ) ; i ++ ) { sections.get ( i ) . display ( cls.get ( i ) ) ; } finishDisplay ( ) ; }

Target:
public void onSuccess ( com.google.gerrit.client.changes.ChangeList result ) { updateColumnsForLabels ( result ) ; sections.get ( 0 ) . display ( result ) ; finishDisplay ( ) ; }
Source:
public int shutdown ( ) { int cnt = 0 ; if ( ( pool ) != null ) { HEAD ( ( 5723.0F - 2.15 ) ) ; com.googlesource.gerrit.plugins.replication.Destination.repLog.warn ( java.lang.String.format ( "Cancelling replication events" ) ) ; for ( java.lang.Runnable r : pool.getQueue ( ) ) { com.googlesource.gerrit.plugins.replication.Destination.repLog.warn ( "Cancelling replication event {}" , r ) ; } BRANCH ( 454 ) ; com.googlesource.gerrit.plugins.replication.bfe Fix ; com.googlesource.gerrit.plugins.replication.deletion logs ; cnt = pool.shutdownNow ( ) . size ( ) ; pool = null ; } return cnt ; }

Target:
public int shutdown ( ) { int cnt = 0 ; if ( ( pool ) != null ) { com.googlesource.gerrit.plugins.replication.Destination.repLog.warn ( "Cancelling replication events" ) ; cnt = pool.shutdownNow ( ) . size ( ) ; pool = null ; } return cnt ; }
Source:
public void go ( ) { if ( ( com.google.gerrit.client.Gerrit.patchScreen ) != null ) { if ( type == ( com.google.gerrit.client.Gerrit.patchScreen.getPatchScreenType ( ) ) ) { com.google.gerrit.client.Gerrit.patchScreen.setTopView ( PatchScreen.TopView.MAIN ) ; com.google.gwt.dom.client.AnchorElement.as ( getElement ( ) ) . blur ( ) ; } else { new com.google.gerrit.client.ui.PatchLink ( "" , type , com.google.gerrit.client.Gerrit.patchScreen ) . go ( ) ; } } }

Target:
public void go ( ) { if ( ( com.google.gerrit.client.Gerrit.patchScreen ) != null ) { com.google.gerrit.client.Gerrit.patchScreen.setTopView ( PatchScreen.TopView.MAIN ) ; if ( type == ( com.google.gerrit.client.Gerrit.patchScreen.getPatchScreenType ( ) ) ) { com.google.gwt.dom.client.AnchorElement.as ( getElement ( ) ) . blur ( ) ; } else { new com.google.gerrit.client.ui.PatchLink ( "" , type , com.google.gerrit.client.Gerrit.patchScreen ) . go ( ) ; } } }
Source:
private static com.google.gerrit.extensions.restapi.BinaryResult base64 ( com.google.gerrit.extensions.restapi.BinaryResult bin ) throws java.io.IOException { int maxSize = com.google.gerrit.httpd.restapi.RestApiServlet.base64MaxSize ( bin.getContentLength ( ) ) ; int estSize = java.lang.Math.min ( com.google.gerrit.httpd.restapi.RestApiServlet.base64MaxSize ( com.google.gerrit.httpd.restapi.RestApiServlet.HEAP_EST_SIZE ) , maxSize ) ; org.eclipse.jgit.util.TemporaryBuffer.Heap buf = com.google.gerrit.httpd.restapi.RestApiServlet.heap ( estSize , maxSize ) ; java.io.OutputStream encoded = com.google.common.io.BaseEncoding.base64 ( ) . encodingStream ( new java.io.OutputStreamWriter ( buf , java.nio.charset.StandardCharsets.ISO_8859_1 ) ) ; bin.writeTo ( encoded ) ; encoded.close ( ) ; return com.google.gerrit.httpd.restapi.RestApiServlet.asBinaryResult ( buf ) ; }

Target:
private static com.google.gerrit.extensions.restapi.BinaryResult base64 ( com.google.gerrit.extensions.restapi.BinaryResult bin ) throws java.io.IOException { int maxSize = com.google.gerrit.httpd.restapi.RestApiServlet.base64MaxSize ( bin.getContentLength ( ) ) ; int estSize = java.lang.Math.min ( com.google.gerrit.httpd.restapi.RestApiServlet.base64MaxSize ( com.google.gerrit.httpd.restapi.RestApiServlet.HEAP_EST_SIZE ) , maxSize ) ; org.eclipse.jgit.util.TemporaryBuffer.Heap buf = com.google.gerrit.httpd.restapi.RestApiServlet.heap ( estSize , maxSize ) ; try ( java.io.OutputStream encoded = com.google.common.io.BaseEncoding.base64 ( ) . encodingStream ( new java.io.OutputStreamWriter ( buf , java.nio.charset.StandardCharsets.ISO_8859_1 ) ) ) { bin.writeTo ( encoded ) ; } return com.google.gerrit.httpd.restapi.RestApiServlet.asBinaryResult ( buf ) ; }
Source:
protected void preDisplay ( com.google.gerrit.client.projects.ConfigInfoCache.Entry result ) { commentManager = new com.google.gerrit.client.diff.SideBySideCommentManager ( this , getBase ( ) , getRevision ( ) , getPath ( ) , result.getCommentLinkProcessor ( ) , getChangeStatus ( ) . isOpen ( ) ) ; setTheme ( result.getTheme ( ) ) ; display ( comments ) ; }

Target:
protected void preDisplay ( com.google.gerrit.client.projects.ConfigInfoCache.Entry result ) { commentManager = new com.google.gerrit.client.diff.SideBySideCommentManager ( this , base , revision , path , result.getCommentLinkProcessor ( ) , getChangeStatus ( ) . isOpen ( ) ) ; setTheme ( result.getTheme ( ) ) ; display ( comments ) ; }
Source:
private void fireCommentAddedHook ( com.google.gerrit.server.change.RevisionResource rsrc ) { com.google.gerrit.server.IdentifiedUser user = ( ( com.google.gerrit.server.IdentifiedUser ) ( rsrc.getControl ( ) . getCurrentUser ( ) ) ) ; try { hooks.doCommentAddedHook ( change , user.getAccount ( ) , rsrc.getPatchSet ( ) , message.getMessage ( ) , categories , db ) ; } catch ( com.google.gwtorm.server.OrmException e ) { com.google.gerrit.server.change.PostReview.log.warn ( "ChangeHook.doCommentAddedHook delivery failed" , e ) ; } }

Target:
private void fireCommentAddedHook ( com.google.gerrit.server.change.RevisionResource rsrc ) { com.google.gerrit.server.IdentifiedUser user = ( ( com.google.gerrit.server.IdentifiedUser ) ( rsrc.getControl ( ) . getCurrentUser ( ) ) ) ; try { hooks.doCommentAddedHook ( change , user.getAccount ( ) , rsrc.getPatchSet ( ) , message.getMessage ( ) , categories , db.get ( ) ) ; } catch ( com.google.gwtorm.server.OrmException e ) { com.google.gerrit.server.change.PostReview.log.warn ( "ChangeHook.doCommentAddedHook delivery failed" , e ) ; } }
Source:
protected void setUseSignedOffBy ( com.google.gerrit.extensions.client.InheritableBoolean value ) throws java.lang.Exception { com.google.gerrit.server.git.MetaDataUpdate md = metaDataUpdateFactory.create ( project ) ; com.google.gerrit.server.git.ProjectConfig config = com.google.gerrit.server.git.ProjectConfig.read ( md ) ; config.getProject ( ) . setUseSignedOffBy ( value ) ; config.commit ( md ) ; projectCache.evict ( config.getProject ( ) ) ; }

Target:
protected void setUseSignedOffBy ( com.google.gerrit.extensions.client.InheritableBoolean value ) throws java.lang.Exception { try ( com.google.gerrit.server.git.MetaDataUpdate md = metaDataUpdateFactory.create ( project ) ) { com.google.gerrit.server.git.ProjectConfig config = com.google.gerrit.server.git.ProjectConfig.read ( md ) ; config.getProject ( ) . setUseSignedOffBy ( value ) ; config.commit ( md ) ; projectCache.evict ( config.getProject ( ) ) ; } }
Source:
protected void configure ( ) { factory ( ChangeProjectAccess.Factory.class ) ; factory ( ReviewProjectAccess.Factory.class ) ; factory ( ChangeProjectSettings.Factory.class ) ; factory ( DeleteBranches.Factory.class ) ; factory ( ListBranches.Factory.class ) ; factory ( VisibleProjectDetails.Factory.class ) ; factory ( ProjectAccessFactory.Factory.class ) ; factory ( ProjectDetailFactory.Factory.class ) ; }

Target:
protected void configure ( ) { factory ( ChangeProjectAccess.Factory.class ) ; factory ( ReviewProjectAccess.Factory.class ) ; factory ( ChangeProjectSettings.Factory.class ) ; factory ( ListBranches.Factory.class ) ; factory ( VisibleProjectDetails.Factory.class ) ; factory ( ProjectAccessFactory.Factory.class ) ; factory ( ProjectDetailFactory.Factory.class ) ; }
Source:
public static java.lang.String refsEditPrefix ( com.google.gerrit.reviewdb.client.Account.Id accountId , com.google.gerrit.reviewdb.client.Change.Id changeId ) { return new java.lang.StringBuilder ( com.google.gerrit.reviewdb.client.RefNames.refsUsers ( accountId ) ) . append ( '/' ) . append ( com.google.gerrit.reviewdb.client.RefNames.EDIT_PREFIX ) . append ( changeId.get ( ) ) . append ( '/' ) . toString ( ) ; }

Target:
public static java.lang.String refsEditPrefix ( com.google.gerrit.reviewdb.client.Account.Id accountId , com.google.gerrit.reviewdb.client.Change.Id changeId ) { return ( ( com.google.gerrit.reviewdb.client.RefNames.refsEditPrefix ( accountId ) ) + ( changeId.get ( ) ) ) + '/' ; }
Source:
public void funnel ( K from , com.google.common.hash.PrimitiveSink into ) { try { java.io.ObjectOutputStream ser = new java.io.ObjectOutputStream ( new com.google.gerrit.server.cache.h2.H2CacheImpl.SinkOutputStream ( into ) ) ; ser.writeObject ( from ) ; ser.flush ( ) ; } catch ( java.io.IOException err ) { throw new java.lang.RuntimeException ( "Cannot hash as Serializable" , err ) ; } }

Target:
public void funnel ( K from , com.google.common.hash.PrimitiveSink into ) { try { java.io.ObjectOutputStream ser = new java.io.ObjectOutputStream ( new com.google.gerrit.server.cache.h2.H2CacheImpl.SinkOutputStream ( into ) ) ; try { ser.writeObject ( from ) ; ser.flush ( ) ; } finally { ser.close ( ) ; } } catch ( java.io.IOException err ) { throw new java.lang.RuntimeException ( "Cannot hash as Serializable" , err ) ; } }
Source:
private boolean isTrusted ( final com.google.gerrit.reviewdb.client.AccountExternalId id ) { if ( id.isScheme ( AccountExternalId.LEGACY_GAE ) ) { return isAllowGoogleAccountUpgrade ( ) ; } if ( id.isScheme ( AccountExternalId.SCHEME_MAILTO ) ) { return true ; } if ( id.isScheme ( AccountExternalId.SCHEME_UUID ) ) { return true ; } if ( id.isScheme ( AccountExternalId.SCHEME_USERNAME ) ) { return true ; } for ( final com.google.gerrit.server.auth.openid.OpenIdProviderPattern p : trustedOpenIDs ) { if ( p.matches ( id ) ) { return true ; } } return false ; }

Target:
private boolean isTrusted ( final com.google.gerrit.reviewdb.client.AccountExternalId id ) { if ( id.isScheme ( AccountExternalId.SCHEME_MAILTO ) ) { return true ; } if ( id.isScheme ( AccountExternalId.SCHEME_UUID ) ) { return true ; } if ( id.isScheme ( AccountExternalId.SCHEME_USERNAME ) ) { return true ; } for ( final com.google.gerrit.server.auth.openid.OpenIdProviderPattern p : trustedOpenIDs ) { if ( p.matches ( id ) ) { return true ; } } return false ; }
Source:
private java.lang.Iterable < com.google.gerrit.server.query.change.ChangeData > byCommitsOnBranchNotMergedFromIndex ( com.google.gerrit.reviewdb.client.Branch.NameKey branch , java.util.List < java.lang.String > hashes ) throws com.google.gwtorm.server.OrmException { return query ( com.google.gerrit.server.query.Predicate.and ( com.google.gerrit.server.query.change.InternalChangeQuery.ref ( branch ) , com.google.gerrit.server.query.change.InternalChangeQuery.project ( branch.getParentKey ( ) ) , com.google.gerrit.server.query.Predicate.not ( com.google.gerrit.server.query.change.InternalChangeQuery.status ( Change.Status.MERGED ) ) , com.google.gerrit.server.query.Predicate.or ( com.google.gerrit.server.query.change.InternalChangeQuery.commits ( com.google.gerrit.server.query.change.InternalChangeQuery.schema ( indexes ) , hashes ) ) ) ) ; }

Target:
private java.lang.Iterable < com.google.gerrit.server.query.change.ChangeData > byCommitsOnBranchNotMergedFromIndex ( com.google.gerrit.reviewdb.client.Branch.NameKey branch , java.util.List < java.lang.String > hashes ) throws com.google.gwtorm.server.OrmException { return query ( com.google.gerrit.server.query.Predicate.and ( com.google.gerrit.server.query.change.InternalChangeQuery.ref ( branch ) , com.google.gerrit.server.query.change.InternalChangeQuery.project ( branch.getParentKey ( ) ) , com.google.gerrit.server.query.Predicate.not ( com.google.gerrit.server.query.change.InternalChangeQuery.status ( Change.Status.MERGED ) ) , com.google.gerrit.server.query.Predicate.or ( com.google.gerrit.server.query.change.InternalChangeQuery.commits ( hashes ) ) ) ) ; }
Source:
public void testRejectJavaScript_AnchorHref ( ) { final java.lang.String href = "javascript:window.close();" ; try { new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) . openAnchor ( ) . setAttribute ( "href" , href ) ; fail ( "accepted javascript in a href" ) ; } catch ( java.lang.RuntimeException e ) { assertEquals ( ( "javascript unsafe in href: " + href ) , e.getMessage ( ) ) ; } }

Target:
public void testRejectJavaScript_AnchorHref ( ) { final java.lang.String href = "javascript:window.close();" ; try { new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) . openAnchor ( ) . setAttribute ( "href" , href ) ; org.junit.Assert.fail ( "accepted javascript in a href" ) ; } catch ( java.lang.RuntimeException e ) { org.junit.Assert.assertEquals ( ( "javascript unsafe in href: " + href ) , e.getMessage ( ) ) ; } }
Source:
static void initLibrary ( com.google.gwt.user.client.rpc.AsyncCallback < java.lang.Void > cb ) { if ( net.codemirror.lib.Loader.isLibLoaded ( ) ) { cb.onSuccess ( null ) ; } else { net.codemirror.lib.Loader.injectCss ( Lib.I.css ( ) ) ; net.codemirror.lib.Loader.injectScript ( Lib.I.js ( ) . getSafeUri ( ) , cb ) ; } }

Target:
public void onSuccess ( java.lang.Void result ) { }
Source:
protected PushOneCommit.Result createChange ( org.eclipse.jgit.api.Git git , java.lang.String subject , java.lang.String fileName , java.lang.String content , java.lang.String topic ) throws java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , admin.getIdent ( ) , subject , fileName , content ) ; return push.to ( git , ( "refs/for/master/" + topic ) ) ; }

Target:
protected PushOneCommit.Result createChange ( org.eclipse.jgit.api.Git git , java.lang.String subject , java.lang.String fileName , java.lang.String content , java.lang.String topic ) throws java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , admin.getIdent ( ) , git , subject , fileName , content ) ; return push.to ( ( "refs/for/master/" + topic ) ) ; }
Source:
private void deleteDraft ( java.lang.String changeId , java.lang.String revId , java.lang.String uuid ) throws java.io.IOException { com.google.gerrit.acceptance.RestResponse r = userSession.delete ( ( ( ( ( ( "/changes/" + changeId ) + "/revisions/" ) + revId ) + "/drafts/" ) + uuid ) ) ; org.junit.Assert.assertEquals ( HttpStatus.SC_NO_CONTENT , r.getStatusCode ( ) ) ; }

Target:
private void deleteDraft ( java.lang.String changeId , java.lang.String revId , java.lang.String uuid ) throws java.io.IOException { com.google.gerrit.acceptance.RestResponse r = userSession.delete ( ( ( ( ( ( "/changes/" + changeId ) + "/revisions/" ) + revId ) + "/drafts/" ) + uuid ) ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( HttpStatus.SC_NO_CONTENT ) ; }
Source:
public boolean match ( com.google.gerrit.server.query.change.ChangeData object ) throws com.google.gwtorm.server.OrmException { try { for ( com.google.gerrit.server.query.change.ChangeData cData : index.getSource ( com.google.gerrit.server.query.Predicate.and ( new com.google.gerrit.server.query.change.LegacyChangeIdPredicate ( db , object.getId ( ) ) , this ) ) . read ( ) ) { if ( cData.getId ( ) . equals ( object.getId ( ) ) ) { return true ; } } } catch ( com.google.gerrit.server.query.QueryParseException e ) { throw new com.google.gwtorm.server.OrmException ( e ) ; } return false ; }

Target:
public boolean match ( com.google.gerrit.server.query.change.ChangeData object ) throws com.google.gwtorm.server.OrmException { try { for ( com.google.gerrit.server.query.change.ChangeData cData : index.getSource ( com.google.gerrit.server.query.Predicate.and ( new com.google.gerrit.server.query.change.LegacyChangeIdPredicate ( db , object.getId ( ) ) , this ) , 1 ) . read ( ) ) { if ( cData.getId ( ) . equals ( object.getId ( ) ) ) { return true ; } } } catch ( com.google.gerrit.server.query.QueryParseException e ) { throw new com.google.gwtorm.server.OrmException ( e ) ; } return false ; }
Source:
public com.google.gerrit.server.CurrentUser getCurrentUser ( ) { if ( isSignedIn ( ) ) { return identified.create ( val.getAccountId ( ) ) ; } return anonymousProvider.get ( ) ; }

Target:
public com.google.gerrit.server.CurrentUser getCurrentUser ( ) { if ( ( user ) == null ) { if ( isSignedIn ( ) ) { user = identified.create ( val.getAccountId ( ) ) ; } else { user = anonymousProvider.get ( ) ; } } return user ; }
Source:
public com.google.gerrit.server.patch.PatchList get ( final com.google.gerrit.client.reviewdb.Change change , final com.google.gerrit.client.reviewdb.PatchSet patchSet , final com.google.gerrit.client.data.PatchScriptSettings.Whitespace whitespace ) { final com.google.gerrit.client.reviewdb.Project.NameKey projectKey = change.getProject ( ) ; final org.spearce.jgit.lib.ObjectId a = null ; final org.spearce.jgit.lib.ObjectId b = org.spearce.jgit.lib.ObjectId.fromString ( patchSet.getRevision ( ) . get ( ) ) ; return get ( new com.google.gerrit.server.patch.PatchListKey ( projectKey , a , b , whitespace ) ) ; }

Target:
public com.google.gerrit.server.patch.PatchList get ( com.google.gerrit.client.reviewdb.Change change , com.google.gerrit.client.reviewdb.PatchSet patchSet , com.google.gerrit.client.data.PatchScriptSettings.Whitespace whitespace ) ;
Source:
private void setListBox ( final com.google.gwt.user.client.ui.ListBox f , final short defaultValue , final short currentValue ) { final int n = f.getItemCount ( ) ; for ( int i = 0 ; i < n ; i ++ ) { if ( ( java.lang.Short.parseShort ( f.getValue ( i ) ) ) == currentValue ) { f.setSelectedIndex ( i ) ; return ; } } if ( currentValue != defaultValue ) { setListBox ( f , defaultValue , defaultValue ) ; } }

Target:
private void setListBox ( final com.google.gwt.user.client.ui.ListBox f , final java.lang.String defaultValue , final java.lang.String currentValue ) { final int n = f.getItemCount ( ) ; for ( int i = 0 ; i < n ; i ++ ) { if ( f.getValue ( i ) . equals ( currentValue ) ) { f.setSelectedIndex ( i ) ; return ; } } if ( currentValue != defaultValue ) { setListBox ( f , defaultValue , defaultValue ) ; } }
Source:
private com.google.gerrit.extensions.client.SubmitType getSubmitType ( com.google.gerrit.server.CurrentUser user , com.google.gerrit.server.query.change.ChangeData cd , com.google.gerrit.reviewdb.client.PatchSet patchSet ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.common.data.SubmitTypeRecord rec = submitRuleEvaluatorFactory.create ( user , cd ) . setPatchSet ( patchSet ) . getSubmitType ( ) ; if ( ( rec.status ) != ( SubmitTypeRecord.Status.OK ) ) { throw new com.google.gwtorm.server.OrmException ( ( "Submit type rule failed: " + rec ) ) ; } return rec.type ; }

Target:
private com.google.gerrit.extensions.client.SubmitType getSubmitType ( com.google.gerrit.server.query.change.ChangeData cd , com.google.gerrit.reviewdb.client.PatchSet patchSet ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.common.data.SubmitTypeRecord rec = submitRuleEvaluatorFactory.create ( cd ) . setPatchSet ( patchSet ) . getSubmitType ( ) ; if ( ( rec.status ) != ( SubmitTypeRecord.Status.OK ) ) { throw new com.google.gwtorm.server.OrmException ( ( "Submit type rule failed: " + rec ) ) ; } return rec.type ; }
Source:
public void testCreateProjectApiWithGitSuffix ( ) throws java.lang.Exception { final java.lang.String newProjectName = "newProject" ; com.google.gerrit.extensions.common.ProjectInfo p = gApi.projects ( ) . name ( ( newProjectName + ".git" ) ) . create ( ) . get ( ) ; com.google.common.truth.Truth.assertThat ( p.name ) . isEqualTo ( newProjectName ) ; com.google.gerrit.server.project.ProjectState projectState = projectCache.get ( new com.google.gerrit.reviewdb.client.Project.NameKey ( newProjectName ) ) ; com.google.common.truth.Truth.assertThat ( projectState ) . isNotNull ( ) ; com.google.gerrit.acceptance.rest.project.ProjectAssert.assertProjectInfo ( projectState.getProject ( ) , p ) ; assertHead ( newProjectName , "refs/heads/master" ) ; }

Target:
public void testCreateProjectApiWithGitSuffix ( ) throws java.lang.Exception { final java.lang.String newProjectName = "newProject" ; com.google.gerrit.extensions.common.ProjectInfo p = gApi.projects ( ) . create ( ( newProjectName + ".git" ) ) . get ( ) ; com.google.common.truth.Truth.assertThat ( p.name ) . isEqualTo ( newProjectName ) ; com.google.gerrit.server.project.ProjectState projectState = projectCache.get ( new com.google.gerrit.reviewdb.client.Project.NameKey ( newProjectName ) ) ; com.google.common.truth.Truth.assertThat ( projectState ) . isNotNull ( ) ; com.google.gerrit.acceptance.rest.project.ProjectAssert.assertProjectInfo ( projectState.getProject ( ) , p ) ; assertHead ( newProjectName , "refs/heads/master" ) ; }
Source:
public void run ( ) { int line = ( cm.extras ( ) . hasActiveLine ( ) ) ? cm.getLineNumber ( cm.extras ( ) . activeLine ( ) ) : 0 ; int res = java.util.Collections.binarySearch ( chunks , new com.google.gerrit.client.diff.UnifiedDiffChunkInfo ( cm.side ( ) , 0 , 0 , line , false ) , getDiffChunkComparatorCmLine ( ) ) ; diffChunkNavHelper ( chunks , host , res , dir ) ; }

Target:
public void run ( ) { int line = ( cm.extras ( ) . hasActiveLine ( ) ) ? cm.getLineNumber ( cm.extras ( ) . activeLine ( ) ) : 0 ; int res = java.util.Collections.binarySearch ( chunks , new com.google.gerrit.client.diff.UnifiedDiffChunkInfo ( cm.side ( ) , 0 , 0 , 0 , line , false ) , getDiffChunkComparatorCmLine ( ) ) ; diffChunkNavHelper ( chunks , host , res , dir ) ; }
Source:
public void abandonReviewableChangeByOwnerCcingSelf ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.ABANDONED_CHANGES ) ; abandon ( sc.changeId , sc.owner , com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy.CC_ON_OWN_COMMENTS ) ; assertThat ( sender ) . sent ( "abandon" , sc ) . to ( sc.owner ) . cc ( sc.reviewer , sc.ccer ) . to ( sc.reviewerByEmail ) . cc ( sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ABANDONED_CHANGES ) ; }

Target:
public void abandonReviewableChangeByOwnerCcingSelf ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.ABANDONED_CHANGES ) ; abandon ( sc.changeId , sc.owner , com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy.CC_ON_OWN_COMMENTS ) ; assertThat ( sender ) . sent ( "abandon" , sc ) . to ( sc.owner ) . cc ( sc.reviewer , sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ABANDONED_CHANGES ) ; }
Source:
public void testEquals ( ) throws java.lang.Exception { com.google.common.truth.Truth.assertThat ( entry1.equals ( null ) ) . isFalse ( ) ; com.google.common.truth.Truth.assertThat ( entry1.equals ( "String object" ) ) . isFalse ( ) ; com.google.common.truth.Truth.assertThat ( entry1.equals ( entry1 ) ) . isTrue ( ) ; com.google.common.truth.Truth.assertThat ( entry1.equals ( entry2 ) ) . isFalse ( ) ; com.google.common.truth.Truth.assertThat ( entry1.equals ( entry4 ) ) . isTrue ( ) ; }

Target:
public void testEquals ( ) throws java.lang.Exception { com.google.common.truth.Truth.assertThat ( entry1.equals ( null ) ) . isFalse ( ) ; com.google.common.truth.Truth.assertThat ( entry1.equals ( "String object" ) ) . isFalse ( ) ; com.google.common.truth.Truth.assertThat ( entry1.equals ( entry2 ) ) . isFalse ( ) ; com.google.common.truth.Truth.assertThat ( entry1.equals ( entry4 ) ) . isTrue ( ) ; }
Source:
private static java.util.Set < java.lang.String > scanSectionNames ( com.google.gerrit.server.git.ProjectConfig config ) { java.util.Set < java.lang.String > names = new java.util.HashSet < java.lang.String > ( ) ; for ( com.google.gerrit.common.data.AccessSection section : config.getAccessSections ( ) ) { names.add ( section.getRefPattern ( ) ) ; } return names ; }

Target:
private static java.util.Set < java.lang.String > scanSectionNames ( com.google.gerrit.server.git.ProjectConfig config ) { java.util.Set < java.lang.String > names = new java.util.HashSet < java.lang.String > ( ) ; for ( com.google.gerrit.common.data.AccessSection section : config.getAccessSections ( ) ) { names.add ( section.getName ( ) ) ; } return names ; }
Source:
private org.eclipse.jgit.lib.Repository openRepository ( java.lang.String name ) throws java.io.IOException { name = com.googlesource.gerrit.plugins.supermanifest.SuperManifestRefUpdatedListener.urlToRepoKey ( canonicalWebUrl , name ) ; if ( repos.containsKey ( name ) ) { return repos.get ( name ) ; } org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( new com.google.gerrit.reviewdb.client.Project.NameKey ( name ) ) ; repos.put ( name , repo ) ; return repo ; }

Target:
public org.eclipse.jgit.lib.Repository openRepository ( java.lang.String name ) throws java.io.IOException { name = com.googlesource.gerrit.plugins.supermanifest.SuperManifestRefUpdatedListener.urlToRepoKey ( canonicalWebUrl , name ) ; if ( repos.containsKey ( name ) ) { return repos.get ( name ) ; } org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( new com.google.gerrit.reviewdb.client.Project.NameKey ( name ) ) ; repos.put ( name , repo ) ; return repo ; }
Source:
public void testThreeLevelTreeWithSomeIndexPredicates ( ) throws java.lang.Exception { com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > in = parse ( "-foo:a (file:b OR file:c)" ) ; com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > out = rewrite ( in ) ; assertEquals ( com.google.gerrit.server.query.change.AndSource.class , out.getClass ( ) ) ; assertEquals ( com.google.common.collect.ImmutableList.of ( query ( in.getChild ( 1 ) ) , in.getChild ( 0 ) ) , out.getChildren ( ) ) ; }

Target:
public void testThreeLevelTreeWithSomeIndexPredicates ( ) throws java.lang.Exception { com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > in = parse ( "-foo:a (file:b OR file:c)" ) ; com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > out = rewrite ( in ) ; org.junit.Assert.assertEquals ( com.google.gerrit.server.query.change.AndSource.class , out.getClass ( ) ) ; org.junit.Assert.assertEquals ( com.google.common.collect.ImmutableList.of ( query ( in.getChild ( 1 ) ) , in.getChild ( 0 ) ) , out.getChildren ( ) ) ; }
Source:
private void applyComment ( java.lang.String project , int number , com.google.gerrit.extensions.api.changes.ReviewInput comment ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.update.UpdateException , com.google.gwtorm.server.OrmException , java.io.IOException { BRANCH ( f1d0f4 ) ; com.criteo.gerrit.plugins.automerge.Format all ; files ( ( ( ( google ) - ( java ) ) - ( format ) ) ) ; com.google.gerrit.server.change.RevisionResource r = atomicityHelper.getRevisionResource ( project , number ) ; reviewer.get ( ) . apply ( r , comment ) ; }

Target:
private void applyComment ( java.lang.String project , int number , com.google.gerrit.extensions.api.changes.ReviewInput comment ) throws java.lang.Exception { com.google.gerrit.server.change.RevisionResource r = atomicityHelper.getRevisionResource ( project , number ) ; reviewer.get ( ) . apply ( r , comment ) ; }
Source:
public boolean isVisible ( com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { if ( ( ( getChange ( ) . getStatus ( ) ) == ( Change.Status.DRAFT ) ) && ( ! ( isDraftVisible ( db , null ) ) ) ) { return false ; } return isRefVisible ( ) ; }

Target:
public boolean isVisible ( com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { return isVisible ( db , null ) ; }
Source:
private com.google.common.collect.FluentIterable < com.google.gerrit.server.project.ListBranches.BranchInfo > filterBranches ( java.util.List < com.google.gerrit.server.project.ListBranches.BranchInfo > branchList ) throws com.google.gerrit.extensions.restapi.BadRequestException { com.google.common.collect.FluentIterable < com.google.gerrit.server.project.ListBranches.BranchInfo > branches = com.google.common.collect.FluentIterable.from ( branchList ) ; 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:
private com.google.common.collect.FluentIterable < com.google.gerrit.server.project.ListBranches.BranchInfo > filterBranches ( com.google.common.collect.FluentIterable < com.google.gerrit.server.project.ListBranches.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 ; }
Source:
public void byStatus ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < com.google.gerrit.testutil.InMemoryRepositoryManager.Repo > repo = createProject ( "repo" ) ; com.google.gerrit.server.change.ChangeInserter ins1 = newChangeWithStatus ( repo , Change.Status.NEW ) ; com.google.gerrit.reviewdb.client.Change change1 = insert ( ins1 ) ; com.google.gerrit.server.change.ChangeInserter ins2 = newChangeWithStatus ( repo , Change.Status.MERGED ) ; com.google.gerrit.reviewdb.client.Change change2 = insert ( ins2 ) ; assertQuery ( "status:new" , change1 ) ; assertQuery ( "status:NEW" , change1 ) ; assertQuery ( "is:new" , change1 ) ; assertQuery ( "status:merged" , change2 ) ; assertQuery ( "is:merged" , change2 ) ; }

Target:
public void byStatus ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < com.google.gerrit.testutil.InMemoryRepositoryManager.Repo > repo = createProject ( "repo" ) ; com.google.gerrit.server.change.ChangeInserter ins1 = newChangeWithStatus ( repo , Change.Status.NEW ) ; com.google.gerrit.reviewdb.client.Change change1 = insert ( repo , ins1 ) ; com.google.gerrit.server.change.ChangeInserter ins2 = newChangeWithStatus ( repo , Change.Status.MERGED ) ; com.google.gerrit.reviewdb.client.Change change2 = insert ( repo , ins2 ) ; assertQuery ( "status:new" , change1 ) ; assertQuery ( "status:NEW" , change1 ) ; assertQuery ( "is:new" , change1 ) ; assertQuery ( "status:merged" , change2 ) ; assertQuery ( "is:merged" , change2 ) ; }
Source:
public void emptyPermissionRangeOmitsResult ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.PatchSetApproval cr = psa ( userId , "Code-Review" , 1 ) ; com.google.gerrit.reviewdb.client.PatchSetApproval v = psa ( userId , "Verified" , 1 ) ; org.junit.Assert.assertEquals ( com.google.gerrit.server.git.LabelNormalizer.Result.create ( com.google.gerrit.server.git.LabelNormalizerTest.list ( ) , com.google.gerrit.server.git.LabelNormalizerTest.list ( ) , com.google.gerrit.server.git.LabelNormalizerTest.list ( cr , v ) ) , norm.normalize ( change , com.google.gerrit.server.git.LabelNormalizerTest.list ( cr , v ) ) ) ; }

Target:
public void emptyPermissionRangeOmitsResult ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.PatchSetApproval cr = psa ( userId , "Code-Review" , 1 ) ; com.google.gerrit.reviewdb.client.PatchSetApproval v = psa ( userId , "Verified" , 1 ) ; org.junit.Assert.assertEquals ( com.google.gerrit.server.git.LabelNormalizer.Result.create ( com.google.gerrit.server.git.LabelNormalizerTest.list ( ) , com.google.gerrit.server.git.LabelNormalizerTest.list ( ) , com.google.gerrit.server.git.LabelNormalizerTest.list ( cr , v ) ) , norm.normalize ( notes , com.google.gerrit.server.git.LabelNormalizerTest.list ( cr , v ) ) ) ; }
Source:
public java.util.Set < com.google.gerrit.reviewdb.client.PatchSet.Id > patchIds ( ) throws com.google.gwtorm.server.OrmException { java.util.Set < com.google.gerrit.reviewdb.client.PatchSet.Id > ret = new java.util.HashSet < > ( ) ; for ( com.google.gerrit.server.query.change.ChangeData cd : changeData ) { ret.add ( cd.change ( ) . currentPatchSetId ( ) ) ; } return ret ; }

Target:
public java.util.Set < com.google.gerrit.reviewdb.client.PatchSet.Id > patchIds ( ) throws com.google.gwtorm.server.OrmException { java.util.Set < com.google.gerrit.reviewdb.client.PatchSet.Id > ret = new java.util.HashSet < > ( ) ; for ( com.google.gerrit.server.query.change.ChangeData cd : changeData.values ( ) ) { ret.add ( cd.change ( ) . currentPatchSetId ( ) ) ; } return ret ; }
Source:
private static void initVimKeys ( ) { net.codemirror.lib.KeyMap km = net.codemirror.lib.CodeMirror.cloneKeyMap ( "vim" ) ; for ( java.lang.String s : new java.lang.String [ ] { "A" , "C" , "O" , "R" , "U" , "Ctrl-C" } ) { km.remove ( s ) ; } net.codemirror.lib.CodeMirror.addKeyMap ( "vim_ro" , km ) ; net.codemirror.lib.CodeMirror.mapVimKey ( "j" , "gj" ) ; net.codemirror.lib.CodeMirror.mapVimKey ( "k" , "gk" ) ; net.codemirror.lib.CodeMirror.mapVimKey ( "Down" , "gj" ) ; net.codemirror.lib.CodeMirror.mapVimKey ( "Up" , "gk" ) ; }

Target:
private static void initVimKeys ( ) { net.codemirror.lib.KeyMap km = net.codemirror.lib.CodeMirror.cloneKeyMap ( "vim" ) ; for ( java.lang.String s : new java.lang.String [ ] { "A" , "C" , "O" , "R" , "U" , "Ctrl-C" } ) { km.remove ( s ) ; } net.codemirror.lib.CodeMirror.addKeyMap ( "vim_ro" , km ) ; }