auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public com.google.gitiles.GitilesView.Builder setOldRevision ( com.google.gitiles.Revision revision ) { switch ( type ) { case DIFF : case LOG : break ; default : com.google.common.base.Preconditions.checkState ( ( revision == null ) , "cannot set old revision on %s view" , type ) ; break ; } this . oldRevision = revision ; return this ; }

Target:
public com.google.gitiles.GitilesView.Builder setOldRevision ( com.google.gitiles.Revision revision ) { switch ( type ) { case DIFF : case LOG : break ; default : revision = com.google.common.base.Objects.firstNonNull ( revision , Revision.NULL ) ; com.google.common.base.Preconditions.checkState ( ( revision == ( Revision.NULL ) ) , "cannot set old revision on %s view" , type ) ; break ; } this . oldRevision = revision ; return this ; }
Source:
public com.google.common.base.Optional < com.google.gerrit.reviewdb.client.AccountGroup > load ( java.lang.String name ) throws java.lang.Exception { try ( com.google.gerrit.reviewdb.server.ReviewDb db = schema.open ( ) ) { com.google.gerrit.reviewdb.client.AccountGroup.NameKey key = new com.google.gerrit.reviewdb.client.AccountGroup.NameKey ( name ) ; com.google.gerrit.reviewdb.client.AccountGroupName r = db.accountGroupNames ( ) . get ( key ) ; if ( r != null ) { return com.google.common.base.Optional.fromNullable ( db.accountGroups ( ) . get ( r.getId ( ) ) ) ; } return com.google.common.base.Optional.absent ( ) ; } }

Target:
public java.util.Optional < com.google.gerrit.reviewdb.client.AccountGroup > load ( java.lang.String name ) throws java.lang.Exception { try ( com.google.gerrit.reviewdb.server.ReviewDb db = schema.open ( ) ) { com.google.gerrit.reviewdb.client.AccountGroup.NameKey key = new com.google.gerrit.reviewdb.client.AccountGroup.NameKey ( name ) ; com.google.gerrit.reviewdb.client.AccountGroupName r = db.accountGroupNames ( ) . get ( key ) ; if ( r != null ) { return java.util.Optional.ofNullable ( db.accountGroups ( ) . get ( r.getId ( ) ) ) ; } return java.util.Optional.empty ( ) ; } }
Source:
public com.google.gerrit.extensions.restapi.Response < ? > apply ( com.google.gerrit.server.change.ChangeResource rsrc , com.google.gerrit.server.change.Index.Input input ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.server.project.ChangeControl ctl = rsrc.getControl ( ) ; if ( ( ! ( ctl.isOwner ( ) ) ) && ( ! ( ctl.getUser ( ) . getCapabilities ( ) . canMaintainServer ( ) ) ) ) { throw new com.google.gerrit.extensions.restapi.AuthException ( "Only change owner or server maintainer can reindex" ) ; } indexer.index ( db.get ( ) , rsrc.getChange ( ) ) ; return com.google.gerrit.extensions.restapi.Response.none ( ) ; }

Target:
public com.google.gerrit.extensions.restapi.Response < ? > apply ( com.google.gerrit.server.change.ChangeResource rsrc , com.google.gerrit.server.change.Index.Input input ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.server.permissions.PermissionBackendException , com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.server.project.ChangeControl ctl = rsrc.getControl ( ) ; if ( ! ( ctl.isOwner ( ) ) ) { permissionBackend.user ( user ) . check ( GlobalPermission.MAINTAIN_SERVER ) ; } indexer.index ( db.get ( ) , rsrc.getChange ( ) ) ; return com.google.gerrit.extensions.restapi.Response.none ( ) ; }
Source:
public int compare ( com.googlesource.gerrit.plugins.xdocs.client.FileInfo a , com.googlesource.gerrit.plugins.xdocs.client.FileInfo b ) { if ( Patch.COMMIT_MSG.equals ( a.path ( ) ) ) { return - 1 ; } else if ( Patch.COMMIT_MSG.equals ( b.path ( ) ) ) { return 1 ; } return a.path ( ) . compareTo ( b.path ( ) ) ; }

Target:
public int compare ( com.googlesource.gerrit.plugins.xdocs.client.FileInfo a , com.googlesource.gerrit.plugins.xdocs.client.FileInfo b ) { if ( com.googlesource.gerrit.plugins.xdocs.client.FileInfo.COMMIT_MSG.equals ( a.path ( ) ) ) { return - 1 ; } else if ( com.googlesource.gerrit.plugins.xdocs.client.FileInfo.COMMIT_MSG.equals ( b.path ( ) ) ) { return 1 ; } return a.path ( ) . compareTo ( b.path ( ) ) ; }
Source:
public org.eclipse.jgit.lib.Config load ( ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { java.io.File path = getPath ( ) ; if ( path == null ) { return null ; } org.eclipse.jgit.lib.Repository repo = new org.eclipse.jgit.internal.storage.file.FileRepository ( path ) ; try { load ( repo ) ; } finally { repo.close ( ) ; } return cfg ; }

Target:
public org.eclipse.jgit.lib.Config getConfig ( ) throws org.eclipse.jgit.errors.ConfigInvalidException { return cfg ; }
Source:
private void insertEmptyLines ( net.codemirror.lib.CodeMirror cm , int nextLine , int cnt ) { addPaddingWidget ( cm , DiffTable.style.padding ( ) , ( nextLine - 1 ) , ( 1.1 * cnt ) , Unit.EM , null ) ; }

Target:
private void insertEmptyLines ( net.codemirror.lib.CodeMirror cm , int nextLine , int lineOnOther , int cnt , boolean common ) { for ( int i = 0 ; i < cnt ; i ++ , lineOnOther ++ ) { net.codemirror.lib.CodeMirror.LineHandle handle = otherCm ( cm ) . getLineHandle ( lineOnOther ) ; linePaddingWidgetMap.put ( handle , new com.google.gerrit.client.diff.PaddingManager.LinePaddingWidgetWrapper ( addPaddingWidget ( cm , DiffTable.style.padding ( ) , ( nextLine - 1 ) , ( common ? 0 : 1.1 ) , Unit.EM , null ) , common ) ) ; } }
Source:
void play ( ) throws java.io.IOException { if ( ( status ) != 0 ) { com.google.gerrit.httpd.HttpServletResponseRecorder.log.debug ( "Replaying {}" , status , statusMsg ) ; if ( ( status ) == ( SC_MOVED_TEMPORARILY ) ) { super . sendRedirect ( getHeader ( "Location" ) ) ; } else { super . sendError ( status , statusMsg ) ; } } }

Target:
void play ( ) throws java.io.IOException { if ( ( status ) != 0 ) { com.google.gerrit.httpd.HttpServletResponseRecorder.log.debug ( "Replaying {}" , status , statusMsg ) ; if ( ( status ) == ( SC_MOVED_TEMPORARILY ) ) { super . sendRedirect ( headers.get ( com.google.gerrit.httpd.HttpServletResponseRecorder.LOCATION_HEADER ) ) ; } else { super . sendError ( status , statusMsg ) ; } } }
Source:
private org.apache.lucene.search.Query intQuery ( com.google.gerrit.server.index.IndexPredicate < com.google.gerrit.server.query.change.ChangeData > p ) throws com.google.gerrit.server.query.QueryParseException { int value ; try { value = java.lang.Integer.valueOf ( p.getValue ( ) ) ; } catch ( java.lang.IllegalArgumentException e ) { throw new com.google.gerrit.server.query.QueryParseException ( ( "not an integer: " + ( p.getValue ( ) ) ) ) ; } return new org.apache.lucene.search.TermQuery ( intTerm ( p.getOperator ( ) , value ) ) ; }

Target:
public com.google.common.util.concurrent.ListenableFuture < java.lang.Void > delete ( com.google.gerrit.server.query.change.ChangeData cd ) throws java.io.IOException { org.apache.lucene.index.Term id = idTerm ( cd ) ; if ( readOnly ) { return com.google.common.util.concurrent.Futures.immediateFuture ( null ) ; } return com.google.gerrit.lucene.LuceneChangeIndex.allOf ( openIndex.delete ( id ) , closedIndex.delete ( id ) ) ; }
Source:
public void testSubmodulesParseWithSubProjectFound ( ) throws java.lang.Exception { java.util.Map < java.lang.String , com.google.gerrit.server.util.SubmoduleSectionParserTest.SubmoduleSection > sectionsToReturn = new java.util.TreeMap < > ( ) ; sectionsToReturn.put ( "a/b" , new com.google.gerrit.server.util.SubmoduleSectionParserTest.SubmoduleSection ( "ssh://localhost/a/b" , "a/b" , "." ) ) ; java.util.Map < java.lang.String , java.lang.String > reposToBeFound = new java.util.HashMap < > ( ) ; reposToBeFound.put ( "a/b" , "a/b" ) ; reposToBeFound.put ( "b" , "b" ) ; com.google.gerrit.reviewdb.client.Branch.NameKey superBranchNameKey = new com.google.gerrit.reviewdb.client.Branch.NameKey ( new com.google.gerrit.reviewdb.client.Project.NameKey ( "super-project" ) , "refs/heads/master" ) ; java.util.Set < com.google.gerrit.reviewdb.client.SubmoduleSubscription > expectedSubscriptions = com.google.common.collect.Sets.newHashSet ( ) ; expectedSubscriptions.add ( new com.google.gerrit.reviewdb.client.SubmoduleSubscription ( superBranchNameKey , new com.google.gerrit.reviewdb.client.Branch.NameKey ( new com.google.gerrit.reviewdb.client.Project.NameKey ( "a/b" ) , "refs/heads/master" ) , "a/b" ) ) ; execute ( superBranchNameKey , sectionsToReturn , reposToBeFound , expectedSubscriptions ) ; }

Target:
public void testSubmodulesParseWithSubProjectFound ( ) throws java.lang.Exception { java.util.Map < java.lang.String , com.google.gerrit.server.util.SubmoduleSectionParserTest.SubmoduleSection > sectionsToReturn = new java.util.TreeMap < > ( ) ; sectionsToReturn.put ( "a/b" , new com.google.gerrit.server.util.SubmoduleSectionParserTest.SubmoduleSection ( "ssh://localhost/a/b" , "a/b" , "." ) ) ; java.util.Map < java.lang.String , java.lang.String > reposToBeFound = new java.util.HashMap < > ( ) ; reposToBeFound.put ( "a/b" , "a/b" ) ; reposToBeFound.put ( "b" , "b" ) ; com.google.gerrit.reviewdb.client.Branch.NameKey superBranchNameKey = new com.google.gerrit.reviewdb.client.Branch.NameKey ( new com.google.gerrit.reviewdb.client.Project.NameKey ( "super-project" ) , "refs/heads/master" ) ; java.util.Set < com.google.gerrit.reviewdb.client.SubmoduleSubscription > expectedSubscriptions = new java.util.HashSet < > ( ) ; expectedSubscriptions.add ( new com.google.gerrit.reviewdb.client.SubmoduleSubscription ( superBranchNameKey , new com.google.gerrit.reviewdb.client.Branch.NameKey ( new com.google.gerrit.reviewdb.client.Project.NameKey ( "a/b" ) , "refs/heads/master" ) , "a/b" ) ) ; execute ( superBranchNameKey , sectionsToReturn , reposToBeFound , expectedSubscriptions ) ; }
Source:
private void fireEvent ( com.google.gerrit.reviewdb.client.Project.NameKey project , com.google.gerrit.server.events.ProjectCreatedEvent event ) { for ( com.google.gerrit.common.ChangeHookRunner.EventListenerHolder holder : listeners.values ( ) ) { if ( isVisibleTo ( project , event , holder.user ) ) { holder.listener.onEvent ( event ) ; } } fireEventForUnrestrictedListeners ( event ) ; }

Target:
private void fireEvent ( com.google.gerrit.reviewdb.client.Project.NameKey project , com.google.gerrit.server.events.ProjectEvent event ) { for ( com.google.gerrit.common.ChangeHookRunner.EventListenerHolder holder : listeners.values ( ) ) { if ( isVisibleTo ( project , holder.user ) ) { holder.listener.onEvent ( event ) ; } } fireEventForUnrestrictedListeners ( event ) ; }
Source:
public void setReviewed ( java.lang.String path , boolean reviewed ) throws com.google.gerrit.extensions.restapi.RestApiException { try { com.google.gerrit.extensions.restapi.RestModifyView < com.google.gerrit.server.change.FileResource , com.google.gerrit.server.change.Reviewed.Input > view ; if ( reviewed ) { view = putReviewed ; } else { view = deleteReviewed ; } view.apply ( files.parse ( revision , com.google.gerrit.extensions.restapi.IdString.fromDecoded ( path ) ) , new com.google.gerrit.server.change.Reviewed.Input ( ) ) ; } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( "Cannot update reviewed flag" , e ) ; } }

Target:
public void setReviewed ( java.lang.String path , boolean reviewed ) throws com.google.gerrit.extensions.restapi.RestApiException { try { com.google.gerrit.extensions.restapi.RestModifyView < com.google.gerrit.server.change.FileResource , com.google.gerrit.extensions.common.Input > view ; if ( reviewed ) { view = putReviewed ; } else { view = deleteReviewed ; } view.apply ( files.parse ( revision , com.google.gerrit.extensions.restapi.IdString.fromDecoded ( path ) ) , new com.google.gerrit.extensions.common.Input ( ) ) ; } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( "Cannot update reviewed flag" , e ) ; } }
Source:
public void onSuccess ( com.google.gerrit.client.changes.ReviewInput result ) { com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( psId.getParentKey ( ) , java.lang.String.valueOf ( psId.get ( ) ) ) ) ; }

Target:
public void onSuccess ( com.google.gerrit.client.changes.ReviewInput result ) { com.google.gerrit.reviewdb.client.Change.Id changeId = psId.getParentKey ( ) ; java.lang.String rev = java.lang.String.valueOf ( psId.get ( ) ) ; com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( changeId , rev ) , new com.google.gerrit.client.change.ChangeScreen2 ( changeId , null , rev , false , submit ) ) ; }
Source:
public void testDoPostWrongMediaType ( ) throws java.lang.Exception { resetAll ( ) ; org.easymock.EasyMock.expect ( req.getContentType ( ) ) . andReturn ( com.google.common.net.MediaType.APPLICATION_XML_UTF_8.toString ( ) ) . anyTimes ( ) ; rsp.sendError ( javax.servlet.http.HttpServletResponse.SC_UNSUPPORTED_MEDIA_TYPE , ( ( "Expecting " + ( com.google.common.net.MediaType.JSON_UTF_8.toString ( ) ) ) + " content type" ) ) ; org.easymock.EasyMock.expectLastCall ( ) . once ( ) ; replayAll ( ) ; syncEventsRestApiServlet.doPost ( req , rsp ) ; verifyAll ( ) ; }

Target:
public void testDoPostWrongMediaType ( ) throws java.lang.Exception { org.mockito.Mockito.when ( req.getContentType ( ) ) . thenReturn ( com.google.common.net.MediaType.APPLICATION_XML_UTF_8.toString ( ) ) ; syncEventsRestApiServlet.doPost ( req , rsp ) ; org.mockito.Mockito.verify ( rsp ) . sendError ( javax.servlet.http.HttpServletResponse.SC_UNSUPPORTED_MEDIA_TYPE , ( ( "Expecting " + ( com.google.common.net.MediaType.JSON_UTF_8.toString ( ) ) ) + " content type" ) ) ; }
Source:
public void testSimplifyPathUpToNullRoot ( ) throws java.lang.Exception { assertNull ( com.google.gitiles.Paths.simplifyPathUpToRoot ( "/foo" , null ) ) ; assertNull ( com.google.gitiles.Paths.simplifyPathUpToRoot ( "../" , null ) ) ; assertNull ( com.google.gitiles.Paths.simplifyPathUpToRoot ( "../../" , null ) ) ; assertNull ( com.google.gitiles.Paths.simplifyPathUpToRoot ( ".././../" , null ) ) ; assertEquals ( "a/b" , com.google.gitiles.Paths.simplifyPathUpToRoot ( "a/b" , null ) ) ; assertEquals ( "a/c" , com.google.gitiles.Paths.simplifyPathUpToRoot ( "a/b/../c" , null ) ) ; }

Target:
public void simplifyPathUpToNullRootDetectsNullRoot ( ) throws java.lang.Exception { org.junit.Assert.assertNull ( com.google.gitiles.Paths.simplifyPathUpToRoot ( "/foo" , null ) ) ; org.junit.Assert.assertNull ( com.google.gitiles.Paths.simplifyPathUpToRoot ( "../" , null ) ) ; org.junit.Assert.assertNull ( com.google.gitiles.Paths.simplifyPathUpToRoot ( "../../" , null ) ) ; org.junit.Assert.assertNull ( com.google.gitiles.Paths.simplifyPathUpToRoot ( ".././../" , null ) ) ; org.junit.Assert.assertEquals ( "a/b" , com.google.gitiles.Paths.simplifyPathUpToRoot ( "a/b" , null ) ) ; org.junit.Assert.assertEquals ( "a/c" , com.google.gitiles.Paths.simplifyPathUpToRoot ( "a/b/../c" , null ) ) ; }
Source:
public Account.Id createEntry ( final java.lang.String username ) throws java.lang.Exception { try { final com.google.gerrit.reviewdb.server.ReviewDb db = schema.open ( ) ; try { final com.google.gerrit.reviewdb.client.AccountExternalId extId = db.accountExternalIds ( ) . get ( new com.google.gerrit.reviewdb.client.AccountExternalId.Key ( com.google.gerrit.reviewdb.client.AccountExternalId.SCHEME_GERRIT , username ) ) ; return extId != null ? extId.getAccountId ( ) : null ; } finally { db.close ( ) ; } } catch ( com.google.gwtorm.server.OrmException e ) { com.google.gerrit.server.auth.ldap.LdapRealm.log.warn ( "Cannot query for username in database" , e ) ; return null ; } }

Target:
public com.google.common.base.Optional < com.google.gerrit.reviewdb.client.Account.Id > load ( java.lang.String username ) throws java.lang.Exception { final com.google.gerrit.reviewdb.server.ReviewDb db = schema.open ( ) ; try { final com.google.gerrit.reviewdb.client.AccountExternalId extId = db.accountExternalIds ( ) . get ( new com.google.gerrit.reviewdb.client.AccountExternalId.Key ( com.google.gerrit.reviewdb.client.AccountExternalId.SCHEME_GERRIT , username ) ) ; if ( extId != null ) { return com.google.common.base.Optional.of ( extId.getAccountId ( ) ) ; } return com.google.common.base.Optional.absent ( ) ; } finally { db.close ( ) ; } }
Source:
public void nonSpecifiedProjectEventTypesNotPosted ( ) { config.setString ( com.googlesource.gerrit.plugins.webhooks.EventHandlerTest.REMOTE , com.googlesource.gerrit.plugins.webhooks.EventHandlerTest.FOO , com.googlesource.gerrit.plugins.webhooks.EventHandlerTest.URL , com.googlesource.gerrit.plugins.webhooks.EventHandlerTest.FOO_URL ) ; config.setString ( com.googlesource.gerrit.plugins.webhooks.EventHandlerTest.REMOTE , com.googlesource.gerrit.plugins.webhooks.EventHandlerTest.FOO , com.googlesource.gerrit.plugins.webhooks.EventHandlerTest.EVENT , "project-created" ) ; eventHandler.onEvent ( com.googlesource.gerrit.plugins.webhooks.EventHandlerTest.REF_UPDATED ) ; org.mockito.Mockito.verifyZeroInteractions ( postTask ) ; }

Target:
public void remoteUrlUndefinedTaskNotScheduled ( ) { org.mockito.Mockito.when ( config.getSubsections ( org.mockito.ArgumentMatchers.eq ( com.googlesource.gerrit.plugins.webhooks.EventHandlerTest.REMOTE ) ) ) . thenReturn ( com.google.common.collect.ImmutableSet.of ( com.googlesource.gerrit.plugins.webhooks.EventHandlerTest.FOO ) ) ; eventHandler.onEvent ( projectCreated ) ; org.mockito.Mockito.verifyZeroInteractions ( taskFactory ) ; org.mockito.Mockito.verifyZeroInteractions ( postTask ) ; }
Source:
private java.lang.String n ( final com.google.gerrit.reviewdb.client.AccountGroup a ) { java.lang.String n = a.getName ( ) ; if ( ( n != null ) && ( ( n.length ( ) ) > 0 ) ) { return n ; } n = a.getDescription ( ) ; if ( ( n != null ) && ( ( n.length ( ) ) > 0 ) ) { return n ; } return a.getId ( ) . toString ( ) ; }

Target:
private java.lang.String n ( com.google.gerrit.common.data.GroupDescription.Basic a ) { if ( a == null ) { return "" ; } java.lang.String n = a.getName ( ) ; if ( ( n != null ) && ( ( n.length ( ) ) > 0 ) ) { return n ; } return a.getGroupUUID ( ) . get ( ) ; }
Source:
void setChanges ( java.lang.String project , java.lang.String revision , com.google.gwt.core.client.JsArray < com.google.gerrit.client.change.RelatedChanges.ChangeAndCommit > changes ) { this . project = project ; render ( revision , changes ) ; }

Target:
void setChanges ( java.lang.String project , java.lang.String revision , com.google.gwt.core.client.JsArray < com.google.gerrit.client.change.RelatedChanges.ChangeAndCommit > changes ) { if ( 0 == ( changes.length ( ) ) ) { setError ( Resources.C.noChanges ( ) ) ; return ; } this . project = project ; view = new com.google.gerrit.client.change.RelatedChangesTab.NavigationList ( ) ; panel.setWidget ( view ) ; com.google.gerrit.client.change.RelatedChangesTab.DisplayCommand display = new com.google.gerrit.client.change.RelatedChangesTab.DisplayCommand ( revision , changes , view ) ; if ( display.execute ( ) ) { com.google.gwt.core.client.Scheduler.get ( ) . scheduleIncremental ( display ) ; } }
Source:
public void add ( org.bouncycastle.openpgp.PGPPublicKeyRing keyRing ) { int numMaster = 0 ; for ( org.bouncycastle.openpgp.PGPPublicKey key : keyRing ) { if ( key.isMasterKey ( ) ) { numMaster ++ ; } } if ( numMaster != 1 ) { throw new java.lang.IllegalArgumentException ( ( "Exactly 1 master key is required, found " + numMaster ) ) ; } com.google.gerrit.server.git.gpg.Fingerprint fp = new com.google.gerrit.server.git.gpg.Fingerprint ( keyRing.getPublicKey ( ) . getFingerprint ( ) ) ; toAdd.put ( fp , keyRing ) ; toRemove.remove ( fp ) ; }

Target:
public void add ( org.bouncycastle.openpgp.PGPPublicKeyRing keyRing ) { int numMaster = 0 ; for ( org.bouncycastle.openpgp.PGPPublicKey key : keyRing ) { if ( key.isMasterKey ( ) ) { numMaster ++ ; } } if ( numMaster != 1 ) { throw new java.lang.IllegalArgumentException ( ( "Exactly 1 master key is required, found " + numMaster ) ) ; } com.google.gerrit.gpg.Fingerprint fp = new com.google.gerrit.gpg.Fingerprint ( keyRing.getPublicKey ( ) . getFingerprint ( ) ) ; toAdd.put ( fp , keyRing ) ; toRemove.remove ( fp ) ; }
Source:
public java.util.List < com.google.gerrit.reviewdb.client.Project.NameKey > getNameKeys ( ) throws com.google.gerrit.server.project.NoSuchProjectException { java.util.List < com.google.gerrit.reviewdb.client.Project > pList = getProjects ( ) ; final java.util.List < com.google.gerrit.reviewdb.client.Project.NameKey > nameKeys = new java.util.ArrayList ( pList.size ( ) ) ; for ( com.google.gerrit.reviewdb.client.Project p : pList ) { nameKeys.add ( p.getNameKey ( ) ) ; } return nameKeys ; }

Target:
public java.util.List < com.google.gerrit.reviewdb.client.Project.NameKey > getNameKeys ( ) throws com.google.gerrit.server.permissions.PermissionBackendException { return permissionBackend.user ( user ) . filter ( ProjectPermission.ACCESS , parents ( ) ) . stream ( ) . sorted ( ) . collect ( java.util.stream.Collectors.toList ( ) ) ; }
Source:
public void listOneIncludeMember ( ) throws java.lang.Exception { java.lang.String gx = group ( "gx" ) ; java.lang.String gy = group ( "gy" ) ; gApi.groups ( ) . id ( gx ) . addGroups ( gy ) ; assertIncludes ( gApi.groups ( ) . id ( gx ) . includedGroups ( ) , gy ) ; }

Target:
private void assertMembers ( java.lang.String group , com.google.gerrit.acceptance.TestAccount ... expectedMembers ) throws java.lang.Exception { assertMembers ( gApi.groups ( ) . id ( group ) . members ( ) , com.google.gerrit.acceptance.TestAccount.names ( expectedMembers ) . toArray ( java.lang.String.class ) ) ; com.google.gerrit.acceptance.rest.account.AccountAssert.assertAccountInfos ( java.util.Arrays.asList ( expectedMembers ) , gApi.groups ( ) . id ( group ) . members ( ) ) ; }
Source:
void add ( final com.google.gerrit.client.reviewdb.ChangeApproval ca ) { approvals.add ( ca ) ; final java.sql.Timestamp g = ca.getGranted ( ) ; if ( ( g != null ) && ( ( g.compareTo ( sortOrder ) ) < 0 ) ) { sortOrder = g ; } }

Target:
void add ( final com.google.gerrit.client.reviewdb.ChangeApproval ca ) { approvals.add ( ca ) ; final java.sql.Timestamp g = ca.getGranted ( ) ; if ( ( g != null ) && ( ( g.compareTo ( sortOrder ) ) < 0 ) ) { sortOrder = g ; } if ( ( ca.getValue ( ) ) != 0 ) { hasNonZero = 1 ; } }
Source:
private void addNamedMap ( com.google.gson.JsonObject obj , java.lang.String name , java.util.Map < java.lang.String , com.googlesource.gerrit.plugins.findowners.Util.StringSet > map ) { com.google.gson.JsonObject jsonMap = new com.google.gson.JsonObject ( ) ; for ( java.lang.String key : com.googlesource.gerrit.plugins.findowners.Util.sort ( map.keySet ( ) ) ) { jsonMap.addProperty ( key , java.lang.String.join ( " " , com.googlesource.gerrit.plugins.findowners.Util.sort ( map.get ( key ) ) ) ) ; } obj.add ( name , jsonMap ) ; }

Target:
public com.google.gerrit.extensions.restapi.Response < com.googlesource.gerrit.plugins.findowners.RestResult > apply ( com.google.gerrit.reviewdb.server.ReviewDb reviewDb , com.google.gerrit.server.change.ChangeResource rsrc , com.googlesource.gerrit.plugins.findowners.Action.Parameters params ) throws com.google.gerrit.extensions.restapi.BadRequestException , com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.reviewdb.client.Change c = rsrc.getChange ( ) ; try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( c.getProject ( ) ) ) { com.google.gerrit.server.query.change.ChangeData changeData = changeDataFactory.create ( reviewDb , c ) ; return getChangeData ( repo , params , changeData ) ; } }
Source:
protected com.google.gerrit.common.data.ProjectAccess updateProjectConfig ( com.google.gerrit.server.git.ProjectConfig config , com.google.gerrit.server.git.MetaDataUpdate md ) throws com.google.gerrit.server.project.NoSuchProjectException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { config.commit ( md ) ; projectCache.evict ( config.getProject ( ) ) ; return projectAccessFactory.create ( projectName ) . call ( ) ; }

Target:
protected com.google.gerrit.common.data.ProjectAccess updateProjectConfig ( com.google.gerrit.server.git.ProjectConfig config , com.google.gerrit.server.git.MetaDataUpdate md ) throws com.google.gerrit.server.project.NoSuchProjectException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { org.eclipse.jgit.revwalk.RevCommit commit = config.commit ( md ) ; hooks.doRefUpdatedHook ( new com.google.gerrit.reviewdb.client.Branch.NameKey ( config.getProject ( ) . getNameKey ( ) , com.google.gerrit.server.git.GitRepositoryManager.REF_CONFIG ) , base , commit.getId ( ) , user.getAccount ( ) ) ; projectCache.evict ( config.getProject ( ) ) ; return projectAccessFactory.create ( projectName ) . call ( ) ; }
Source:
void addQuery ( java.lang.String name ) { if ( ( query ) == null ) { query = com.google.common.collect.Sets.newHashSet ( ) ; } com.google.common.collect.Iterables.addAll ( query , com.google.common.collect.Iterables.transform ( com.google.common.base.Splitter.onPattern ( "[, ]" ) . omitEmptyStrings ( ) . trimResults ( ) . split ( name ) , new com.google.common.base.Function < java.lang.String , java.lang.String > ( ) { @ java.lang.Override public java.lang.String apply ( java.lang.String input ) { return input.toLowerCase ( ) ; } } ) ) ; }

Target:
void addQuery ( java.lang.String name ) { if ( ( query ) == null ) { query = com.google.common.collect.Sets.newHashSet ( ) ; } com.google.common.collect.Iterables.addAll ( query , com.google.gerrit.server.OptionUtil.splitOptionValue ( name ) ) ; }
Source:
public void run ( ) { com.google.gerrit.pgm.Daemon.log.info ( "caught shutdown, cleaning up" ) ; if ( ( runId ) != null ) { runFile.delete ( ) ; } manager.stop ( ) ; }

Target:
public void run ( ) { com.google.gerrit.pgm.Daemon.log.info ( "caught shutdown, cleaning up" ) ; if ( ( runId ) != null ) { try { java.nio.file.Files.delete ( runFile ) ; } catch ( java.io.IOException err ) { com.google.gerrit.pgm.Daemon.log.warn ( ( "failed to delete " + ( runFile ) ) , err ) ; } } manager.stop ( ) ; }
Source:
protected void configure ( ) { bind ( com.google.gerrit.extensions.api.changes.Changes.class ) . to ( com.google.gerrit.server.api.changes.ChangesImpl.class ) ; factory ( ChangeApiImpl.Factory.class ) ; factory ( CommentApiImpl.Factory.class ) ; factory ( RobotCommentApiImpl.Factory.class ) ; factory ( DraftApiImpl.Factory.class ) ; factory ( RevisionApiImpl.Factory.class ) ; factory ( FileApiImpl.Factory.class ) ; factory ( ReviewerApiImpl.Factory.class ) ; factory ( RevisionReviewerApiImpl.Factory.class ) ; }

Target:
protected void configure ( ) { bind ( com.google.gerrit.extensions.api.changes.Changes.class ) . to ( com.google.gerrit.server.api.changes.ChangesImpl.class ) ; factory ( ChangeApiImpl.Factory.class ) ; factory ( CommentApiImpl.Factory.class ) ; factory ( RobotCommentApiImpl.Factory.class ) ; factory ( DraftApiImpl.Factory.class ) ; factory ( RevisionApiImpl.Factory.class ) ; factory ( FileApiImpl.Factory.class ) ; factory ( ReviewerApiImpl.Factory.class ) ; factory ( RevisionReviewerApiImpl.Factory.class ) ; factory ( ChangeEditApiImpl.Factory.class ) ; }
Source:
public static void doSignOut ( ) { com.google.gwt.user.client.Cookies.removeCookie ( com.google.gerrit.client.Gerrit.ACCOUNT_COOKIE ) ; com.google.gwt.user.client.Cookies.removeCookie ( com.google.gerrit.client.Gerrit.OPENIDUSER_COOKIE ) ; com.google.gerrit.client.Gerrit.refreshMenuBar ( ) ; }

Target:
public static void doSignOut ( ) { com.google.gwt.user.client.Cookies.removeCookie ( com.google.gerrit.client.Gerrit.ACCOUNT_COOKIE ) ; com.google.gwt.user.client.Cookies.removeCookie ( com.google.gerrit.client.Gerrit.OPENIDUSER_COOKIE ) ; com.google.gerrit.client.Gerrit.refreshMenuBar ( ) ; if ( ( ( com.google.gerrit.client.Gerrit.currentScreen ) != null ) && ( com.google.gerrit.client.Gerrit.currentScreen.isRequiresSignIn ( ) ) ) { com.google.gwt.user.client.History.newItem ( Link.ALL ) ; } }
Source:
public void asyncStarredChanges ( ) { if ( ( ( starredChanges ) == null ) && ( ( dbProvider ) != null ) ) { try { starredQuery = starredQuery ( ) ; } catch ( com.google.gwtorm.server.OrmException e ) { com.google.gerrit.server.IdentifiedUser.log.warn ( "Cannot query starred by user changes" , e ) ; starredQuery = null ; starredChanges = java.util.Collections.emptySet ( ) ; } } }

Target:
public java.util.Set < com.google.gerrit.reviewdb.client.Change.Id > getStarredChanges ( ) { if ( ( starredChanges ) == null ) { if ( ( starredChangesUtil ) == null ) { throw new java.lang.IllegalStateException ( "StarredChangesUtil is missing" ) ; } try { starredChanges = com.google.common.collect.FluentIterable.from ( ( ( starredQuery ) != null ? starredQuery : starredChangesUtil.query ( accountId ) ) ) . toSet ( ) ; } finally { starredQuery = null ; } } return starredChanges ; }
Source:
protected void run ( ) throws com.google.gerrit.sshd.plugin.Failure , com.google.gerrit.sshd.plugin.UnloggedFailure , java.lang.Exception { com.google.gerrit.sshd.plugin.LfsPluginAuthCommand.LfsSshPluginAuth pluginAuth = auth.get ( ) ; if ( pluginAuth == null ) { throw new com.google.gerrit.sshd.plugin.Failure ( 1 , ( "Server configuration error:" + " LFS auth over SSH is not properly configured." ) ) ; } stdout.print ( pluginAuth.authenticate ( user.get ( ) , args ) ) ; }

Target:
protected void run ( ) throws com.google.gerrit.sshd.plugin.Failure , com.google.gerrit.sshd.plugin.UnloggedFailure , java.lang.Exception { com.google.gerrit.sshd.plugin.LfsPluginAuthCommand.LfsSshPluginAuth pluginAuth = auth.get ( ) ; if ( pluginAuth == null ) { throw new com.google.gerrit.sshd.plugin.Failure ( 1 , "Server configuration error: LFS auth over SSH is not properly configured." ) ; } stdout.print ( pluginAuth.authenticate ( user.get ( ) , args ) ) ; }
Source:
private org.eclipse.jgit.lib.ObjectId pushChangeTo ( org.eclipse.jgit.junit.TestRepository < ? > repo , java.lang.String branch , java.lang.String message ) throws java.lang.Exception { org.eclipse.jgit.lib.ObjectId ret = repo.branch ( "HEAD" ) . commit ( ) . insertChangeId ( ) . message ( message ) . add ( "a.txt" , ( "a contents: " + ( com.google.gerrit.acceptance.git.SubmoduleSubscriptionsIT.contentCounter.addAndGet ( 1 ) ) ) ) . create ( ) ; repo.git ( ) . push ( ) . setRemote ( "origin" ) . setRefSpecs ( new org.eclipse.jgit.transport.RefSpec ( ( "HEAD:refs/heads/" + branch ) ) ) . call ( ) ; return ret ; }

Target:
private void expectToHaveCommitMessage ( org.eclipse.jgit.junit.TestRepository < ? > repo , java.lang.String branch , java.lang.String expectedMessage ) throws java.lang.Exception { org.eclipse.jgit.lib.ObjectId commitId = repo.git ( ) . fetch ( ) . setRemote ( "origin" ) . call ( ) . getAdvertisedRef ( ( "refs/heads/" + branch ) ) . getObjectId ( ) ; org.eclipse.jgit.revwalk.RevWalk rw = repo.getRevWalk ( ) ; org.eclipse.jgit.revwalk.RevCommit c = rw.parseCommit ( commitId ) ; com.google.common.truth.Truth.assertThat ( c.getFullMessage ( ) ) . isEqualTo ( expectedMessage ) ; }
Source:
private void emptycell ( final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder m , final int colspan ) { m.openTd ( ) ; m.addStyleName ( Gerrit.RESOURCES.css ( ) . dataCell ( ) ) ; m.addStyleName ( Gerrit.RESOURCES.css ( ) . diffLinkCell ( ) ) ; m.setAttribute ( "colspan" , colspan ) ; m.nbsp ( ) ; m.closeTd ( ) ; }

Target:
private void openWindow ( java.lang.String token ) { java.lang.String url = ( ( Window.Location.getPath ( ) ) + "#" ) + token ; com.google.gwt.user.client.Window.open ( url , "_blank" , null ) ; }
Source:
public void populateDownloadCommandLinks ( ) { if ( ! ( urls.isEmpty ( ) ) ) { if ( ( allowedCommands.contains ( DownloadCommand.CHECKOUT ) ) || ( allowedCommands.contains ( DownloadCommand.DEFAULT_DOWNLOADS ) ) ) { commands.add ( cmdLinkfactory.new com.google.gerrit.client.admin.CloneCommandLink ( ) ) ; } } }

Target:
public void populateDownloadCommandLinks ( ) { if ( ! ( urls.isEmpty ( ) ) ) { if ( ( allowedCommands.contains ( DownloadCommand.CHECKOUT ) ) || ( allowedCommands.contains ( DownloadCommand.DEFAULT_DOWNLOADS ) ) ) { commands.add ( cmdLinkfactory.new com.google.gerrit.client.admin.CloneCommandLink ( ) ) ; if ( ( ( com.google.gerrit.client.Gerrit.getConfig ( ) . getSshdAddress ( ) ) != null ) && ( com.google.gerrit.client.admin.ProjectInfoScreen.hasUserName ( ) ) ) { commands.add ( cmdLinkfactory.new com.google.gerrit.client.admin.CloneWithCommitMsgHookCommandLink ( getProjectKey ( ) ) ) ; } } } }
Source:
public static void scheduleFullSync ( final com.google.gerrit.client.reviewdb.Project.NameKey project , final java.lang.String urlMatch ) { 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 , urlMatch ) ) { com.google.gerrit.git.PushQueue.scheduleImp ( project , PushOp.MIRROR_ALL , cfg , uri ) ; } } }

Target:
public static void scheduleFullSync ( final com.google.gerrit.client.reviewdb.Project.NameKey project , final java.lang.String urlMatch ) { 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 , urlMatch ) ) { cfg.schedule ( project , PushOp.MIRROR_ALL , uri ) ; } } }
Source:
public void onKeyPress ( com.google.gwt.event.dom.client.KeyPressEvent event ) { submitOnSelection = false ; if ( ( event.getCharCode ( ) ) == ( com.google.gwt.event.dom.client.KeyCodes.KEY_ENTER ) ) { if ( nameTxt.isSuggestionListShowing ( ) ) { submitOnSelection = true ; } else { doAdd ( ) ; } } }

Target:
public void onKeyPress ( com.google.gwt.event.dom.client.KeyPressEvent event ) { submitOnSelection = false ; if ( ( event.getNativeEvent ( ) . getKeyCode ( ) ) == ( com.google.gwt.event.dom.client.KeyCodes.KEY_ENTER ) ) { if ( nameTxt.isSuggestionListShowing ( ) ) { submitOnSelection = true ; } else { doAdd ( ) ; } } }
Source:
public void onFailure ( final java.lang.Throwable caught ) { if ( com.google.gerrit.client.rpc.ScreenLoadCallback.isNoSuchEntity ( caught ) ) { com.google.gerrit.client.Gerrit.display ( screen.getToken ( ) , new com.google.gerrit.client.NotFoundScreen ( ) ) ; } else { super . onFailure ( caught ) ; } }

Target:
public void onFailure ( final java.lang.Throwable caught ) { if ( com.google.gerrit.client.rpc.ScreenLoadCallback.isNoSuchEntity ( caught ) ) { if ( com.google.gerrit.client.Gerrit.isSignedIn ( ) ) { com.google.gerrit.client.Gerrit.display ( screen.getToken ( ) , new com.google.gerrit.client.NotFoundScreen ( ) ) ; } else { new com.google.gerrit.client.NotSignedInDialog ( ) . center ( ) ; } } else { super . onFailure ( caught ) ; } }
Source:
public void onSuccess ( com.google.gwt.core.client.JavaScriptObject msg ) { if ( com.google.gerrit.client.rpc.NativeString.is ( msg ) ) { com.google.gerrit.client.rpc.NativeString str = ( ( com.google.gerrit.client.rpc.NativeString ) ( msg ) ) ; if ( ! ( str.asString ( ) . isEmpty ( ) ) ) { com.google.gwt.user.client.Window.alert ( str.asString ( ) ) ; } } com.google.gerrit.client.Gerrit.display ( target ) ; }

Target:
private com.google.gerrit.client.api.DefaultActions.UiResult asUiResult ( com.google.gwt.core.client.JavaScriptObject in ) { if ( com.google.gerrit.client.rpc.NativeString.is ( in ) ) { java.lang.String str = ( ( com.google.gerrit.client.rpc.NativeString ) ( in ) ) . asString ( ) ; return str.isEmpty ( ) ? com.google.gerrit.client.api.DefaultActions.UiResult.none ( ) : com.google.gerrit.client.api.DefaultActions.UiResult.alert ( str ) ; } return in.cast ( ) ; }
Source:
protected static java.util.Collection < com.google.gerrit.server.account.ProjectWatches.ProjectWatchKey > getWatches ( com.google.gerrit.server.query.change.ChangeQueryBuilder.Arguments args ) throws com.google.gerrit.index.query.QueryParseException { com.google.gerrit.server.CurrentUser user = args.getUser ( ) ; if ( user.isIdentifiedUser ( ) ) { return args.accountCache.get ( args.getUser ( ) . getAccountId ( ) ) . getProjectWatches ( ) . keySet ( ) ; } return java.util.Collections.< com.google.gerrit.server.account.ProjectWatches.ProjectWatchKey > emptySet ( ) ; }

Target:
protected static java.util.Collection < com.google.gerrit.server.account.ProjectWatches.ProjectWatchKey > getWatches ( com.google.gerrit.server.query.change.ChangeQueryBuilder.Arguments args ) throws com.google.gerrit.index.query.QueryParseException { com.google.gerrit.server.CurrentUser user = args.getUser ( ) ; if ( user.isIdentifiedUser ( ) ) { return user.asIdentifiedUser ( ) . state ( ) . getProjectWatches ( ) . keySet ( ) ; } return java.util.Collections.< com.google.gerrit.server.account.ProjectWatches.ProjectWatchKey > emptySet ( ) ; }
Source:
private java.util.Map < java.lang.String , org.eclipse.jgit.lib.Ref > visibleTags ( com.google.gerrit.server.project.ProjectControl pctl , org.eclipse.jgit.lib.Repository repo , java.util.Map < java.lang.String , org.eclipse.jgit.lib.Ref > tags ) { return refFilterFactory.create ( pctl.getProjectState ( ) , repo ) . setShowMetadata ( false ) . filter ( tags , true ) ; }

Target:
private java.util.Map < java.lang.String , org.eclipse.jgit.lib.Ref > visibleTags ( com.google.gerrit.server.project.ProjectState state , org.eclipse.jgit.lib.Repository repo , java.util.Map < java.lang.String , org.eclipse.jgit.lib.Ref > tags ) { return refFilterFactory.create ( state , repo ) . setShowMetadata ( false ) . filter ( tags , true ) ; }
Source:
public UiAction.Description getDescription ( com.google.gerrit.server.change.ChangeResource rsrc ) { com.google.gerrit.reviewdb.client.Change change = rsrc.getChange ( ) ; return new com.google.gerrit.extensions.webui.UiAction.Description ( ) . setLabel ( "Revert" ) . setTitle ( "Revert the change" ) . setVisible ( ( ( ( change.getStatus ( ) ) == ( Change.Status.MERGED ) ) && ( permissionBackend.user ( user ) . ref ( change.getDest ( ) ) . testOrFalse ( com.google.gerrit.server.permissions.RefPermission.CREATE_CHANGE ) ) ) ) ; }

Target:
public UiAction.Description getDescription ( com.google.gerrit.server.change.ChangeResource rsrc ) { com.google.gerrit.reviewdb.client.Change change = rsrc.getChange ( ) ; return new com.google.gerrit.extensions.webui.UiAction.Description ( ) . setLabel ( "Revert" ) . setTitle ( "Revert the change" ) . setVisible ( com.google.gerrit.extensions.conditions.BooleanCondition.and ( ( ( change.getStatus ( ) ) == ( Change.Status.MERGED ) ) , permissionBackend.user ( user ) . ref ( change.getDest ( ) ) . testCond ( com.google.gerrit.server.permissions.RefPermission.CREATE_CHANGE ) ) ) ; }
Source:
public void preformat4 ( ) { final com.google.gwtexpui.safehtml.client.SafeHtml o = com.google.gwtexpui.safehtml.client.SafeHtml_WikifyPreformatTest.html ( " Q\n <R>\n S\n\nB" ) ; final com.google.gwtexpui.safehtml.client.SafeHtml n = o.wikify ( ) ; com.google.common.truth.Truth.assertThat ( o ) . isNotSameAs ( n ) ; com.google.common.truth.Truth.assertThat ( n.asString ( ) ) . isEqualTo ( ( ( ( ( ( "<p>" + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyPreformatTest.pre ( " Q" ) ) ) + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyPreformatTest.pre ( " &lt;R&gt;" ) ) ) + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyPreformatTest.pre ( " S" ) ) ) + "</p>" ) + "<p>B</p>" ) ) ; }

Target:
public void preformat4 ( ) { final com.google.gwtexpui.safehtml.client.SafeHtml o = com.google.gwtexpui.safehtml.client.SafeHtml_WikifyPreformatTest.html ( " Q\n <R>\n S\n\nB" ) ; final com.google.gwtexpui.safehtml.client.SafeHtml n = o.wikify ( ) ; com.google.common.truth.Truth.assertThat ( o ) . isNotSameAs ( n ) ; com.google.common.truth.Truth.assertThat ( n.asString ( ) ) . isEqualTo ( ( ( ( ( "<p>" + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyPreformatTest.pre ( " Q" ) ) ) + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyPreformatTest.pre ( " &lt;R&gt;" ) ) ) + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyPreformatTest.pre ( " S" ) ) ) + "</p><p>B</p>" ) ) ; }
Source:
public final native void scrollToLine ( int line ) ;

Target:
public final void scrollToLine ( int line ) { int height = getHeight ( ) ; if ( ( lineAtHeight ( ( height - 20 ) ) ) < line ) { scrollToY ( ( ( heightAtLine ( line , "local" ) ) - ( 0.5 * height ) ) ) ; } setCursor ( net.codemirror.lib.Pos.create ( line ) ) ; }
Source:
private static void invalidateETag ( com.google.gerrit.reviewdb.client.Change.Id id , com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { if ( db instanceof com.google.gerrit.server.schema.DisabledChangesReviewDbWrapper ) { db = ( ( com.google.gerrit.server.schema.DisabledChangesReviewDbWrapper ) ( db ) ) . unsafeGetDelegate ( ) ; } com.google.gerrit.reviewdb.client.Change c = db.changes ( ) . get ( id ) ; if ( c != null ) { db.changes ( ) . update ( java.util.Collections.singleton ( c ) ) ; } }

Target:
private static void invalidateETag ( com.google.gerrit.reviewdb.client.Change.Id id , com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { db = com.google.gerrit.reviewdb.server.ReviewDbUtil.unwrapDb ( db ) ; com.google.gerrit.reviewdb.client.Change c = db.changes ( ) . get ( id ) ; if ( c != null ) { db.changes ( ) . update ( java.util.Collections.singleton ( c ) ) ; } }
Source:
private static boolean sameUpdate ( com.google.gerrit.server.notedb.ChangeRebuilder.Event event , com.google.gerrit.server.notedb.AbstractChangeUpdate update ) { return ( ( ( ( update != null ) && ( ( com.google.gerrit.server.notedb.ChangeRebuilder.round ( event.when ) ) == ( com.google.gerrit.server.notedb.ChangeRebuilder.round ( update.getWhen ( ) ) ) ) ) && ( event.who.equals ( update.getUser ( ) . getAccountId ( ) ) ) ) && ( event.psId.equals ( update.getPatchSetId ( ) ) ) ) && ( ! ( event instanceof com.google.gerrit.server.notedb.ChangeRebuilder.FinalUpdatesEvent ) ) ; }

Target:
PatchSet.Id getPatchSetId ( ) { com.google.gerrit.reviewdb.client.PatchSet.Id id = get ( 0 ) . psId ; for ( int i = 1 ; i < ( size ( ) ) ; i ++ ) { com.google.common.base.Preconditions.checkState ( java.util.Objects.equals ( id , get ( i ) . psId ) , "mismatched patch sets in EventList: %s != %s" , id , get ( i ) . psId ) ; } return id ; }
Source:
public void defaultGpgCertificationMatchesEmail ( ) throws java.lang.Exception { com.google.gerrit.gpg.testutil.TestKey key = com.google.gerrit.gpg.testutil.TestKeys.validKeyWithSecondUserId ( ) ; com.google.gerrit.gpg.GerritPublicKeyChecker checker = checkerFactory.create ( user ) ; assertProblems ( checker.check ( key.getPublicKey ( ) ) , Status.BAD , ( "Key must contain a valid certification for one of the following " + ( ( "identities:\n" + " gerrit:user\n" ) + " username:user" ) ) ) ; addExternalId ( "test" , "test" , "test5@example.com" ) ; checker = checkerFactory.create ( user ) ; assertNoProblems ( checker.check ( key.getPublicKey ( ) ) ) ; }

Target:
public void defaultGpgCertificationMatchesEmail ( ) throws java.lang.Exception { com.google.gerrit.gpg.testutil.TestKey key = com.google.gerrit.gpg.testutil.TestKeys.validKeyWithSecondUserId ( ) ; com.google.gerrit.gpg.PublicKeyChecker checker = checkerFactory.create ( ) . setExpectedUser ( user ) . disableTrust ( ) ; assertProblems ( checker.check ( key.getPublicKey ( ) ) , Status.BAD , ( "Key must contain a valid certification for one of the following " + ( ( "identities:\n" + " gerrit:user\n" ) + " username:user" ) ) ) ; addExternalId ( "test" , "test" , "test5@example.com" ) ; checker = checkerFactory.create ( ) . setExpectedUser ( user ) . disableTrust ( ) ; assertNoProblems ( checker.check ( key.getPublicKey ( ) ) ) ; }
Source:
private com.google.gwtorm.nosql.IndexFunction < com.google.gwtorm.data.TestPerson > index ( java.lang.String name , java.lang.String query ) throws com.google.gwtorm.client.OrmException { final com.google.gwtorm.schema.QueryModel qm = new com.google.gwtorm.schema.QueryModel ( people , name , query ) ; return new com.google.gwtorm.nosql.IndexFunctionGen ( new com.google.gwtorm.server.GeneratedClassLoader ( com.google.gwtorm.data.TestPerson.class . getClassLoader ( ) ) , qm , com.google.gwtorm.data.TestPerson.class ) . create ( ) ; }

Target:
private com.google.gwtorm.nosql.IndexFunction < com.google.gwtorm.data.Person > index ( java.lang.String name , java.lang.String query ) throws com.google.gwtorm.server.OrmException { final com.google.gwtorm.schema.QueryModel qm = new com.google.gwtorm.schema.QueryModel ( people , name , query ) ; return new com.google.gwtorm.nosql.IndexFunctionGen ( new com.google.gwtorm.server.GeneratedClassLoader ( com.google.gwtorm.data.Person.class . getClassLoader ( ) ) , qm , com.google.gwtorm.data.Person.class ) . create ( ) ; }
Source:
public void testInheritRead_OverrideWithDeny ( ) { com.google.gerrit.server.project.Util.allow ( parent , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/*" ) ; com.google.gerrit.server.project.Util.deny ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local ) ; org.junit.Assert.assertFalse ( "can't read" , u.isVisible ( ) ) ; }

Target:
public void testBlockPushDrafts ( ) { com.google.gerrit.server.project.Util.allow ( parent , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/for/refs/*" ) ; com.google.gerrit.server.project.Util.block ( parent , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/drafts/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local ) ; assertCanUpload ( "refs/heads/master" , u ) ; assertBlocked ( com.google.gerrit.common.data.Permission.PUSH , "refs/drafts/refs/heads/master" , u ) ; }
Source:
protected com.vmware.gerrit.owners.common.PathOwners createValue ( com.googlecode.prolog_cafe.lang.Prolog engine ) { com.google.gerrit.server.patch.PatchList patchList = StoredValues.PATCH_LIST.get ( engine ) ; org.eclipse.jgit.lib.Repository repository = StoredValues.REPOSITORY.get ( engine ) ; java.lang.String branch = com.google.gerrit.rules.StoredValues.getChange ( engine ) . getDest ( ) . get ( ) ; return new com.vmware.gerrit.owners.common.PathOwners ( accounts , repository , branch , patchList ) ; }

Target:
protected com.vmware.gerrit.owners.common.PathOwners createValue ( com.googlecode.prolog_cafe.lang.Prolog engine ) { com.google.gerrit.server.patch.PatchList patchList = StoredValues.PATCH_LIST.get ( engine ) ; org.eclipse.jgit.lib.Repository repository = StoredValues.REPOSITORY.get ( engine ) ; java.lang.String branch = com.google.gerrit.server.rules.StoredValues.getChange ( engine ) . getDest ( ) . get ( ) ; return new com.vmware.gerrit.owners.common.PathOwners ( accounts , repository , branch , patchList ) ; }
Source:
public boolean canAddMember ( final com.google.gerrit.reviewdb.Account.Id id ) { return isOwner ( ) ; }

Target:
public boolean canSeeMember ( com.google.gerrit.reviewdb.Account.Id id ) { if ( ( ( user ) instanceof com.google.gerrit.server.IdentifiedUser ) && ( ( ( com.google.gerrit.server.IdentifiedUser ) ( user ) ) . getAccountId ( ) . equals ( id ) ) ) { return true ; } return canSeeMembers ( ) ; }
Source:
public void onFailure ( final java.lang.Throwable caught ) { if ( ( ! ( com.google.gwt.core.client.GWT.isScript ( ) ) ) && ( ! ( com.google.gerrit.client.rpc.GerritCallback.isNotSignedIn ( caught ) ) ) ) { com.google.gwt.core.client.GWT.log ( "Unexpected failure from validating account" , caught ) ; } com.google.gwt.user.client.Cookies.removeCookie ( com.google.gerrit.client.Gerrit.ACCOUNT_COOKIE ) ; com.google.gerrit.client.Gerrit.refreshMenuBar ( ) ; showInitialScreen ( ) ; }

Target:
public void onFailure ( final java.lang.Throwable caught ) { com.google.gwt.core.client.GWT.log ( "Unexpected failure from validating account" , caught ) ; com.google.gwt.user.client.Cookies.removeCookie ( com.google.gerrit.client.Gerrit.ACCOUNT_COOKIE ) ; onModuleLoad3 ( ) ; }