auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testUpdateOneModified ( ) throws com.google.gwtorm.client.OrmException , java.sql.SQLException { stubExecuteBatchOK ( com.google.gwtorm.jdbc.TestJdbcAccess.UPDATE , 0 ) ; com.google.gwtorm.jdbc.JdbcAccess < com.google.gwtorm.jdbc.TestJdbcAccess.Data , com.google.gwtorm.jdbc.TestJdbcAccess.Data.DataKey > classUnderTest = createClassUnderTest ( ) ; try { classUnderTest.update ( com.google.gwtorm.jdbc.TestJdbcAccess.ONE_ROW ) ; org.junit.Assert.fail ( "missing OrmConcurrencyException" ) ; } catch ( com.google.gwtorm.client.OrmConcurrencyException e ) { } }

Target:
public void testUpsertTwoNotExisting ( ) throws com.google.gwtorm.server.OrmException , java.sql.SQLException { java.sql.PreparedStatement update = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.TestJdbcAccess.UPDATE , 0 , 0 ) ; java.sql.PreparedStatement insert = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.TestJdbcAccess.INSERT , 1 , 1 ) ; createClassUnderTest ( ) . upsert ( twoRows ) ; com.google.gwtorm.jdbc.TestJdbcAccess.assertUsedBatchingOnly ( update ) ; com.google.gwtorm.jdbc.TestJdbcAccess.assertUsedBatchingOnly ( insert ) ; com.google.gwtorm.jdbc.TestJdbcAccess.assertExpectedIdsUsed ( insert , 1 , 2 ) ; }
Source:
public java.lang.Object apply ( com.google.gerrit.server.project.ProjectResource resource , com.google.gerrit.server.project.SetDashboard.Input input ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.BadRequestException , com.google.gerrit.extensions.restapi.ResourceConflictException , java.lang.Exception { com.google.gerrit.server.project.SetDefaultDashboard set = setDefault.get ( ) ; set.inherited = inherited ; return set.apply ( com.google.gerrit.server.project.DashboardResource.projectDefault ( resource.getControl ( ) ) , input ) ; }

Target:
public java.lang.Object apply ( com.google.gerrit.server.project.ProjectResource resource , com.google.gerrit.server.project.SetDashboard.Input input ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.BadRequestException , com.google.gerrit.extensions.restapi.ResourceConflictException , java.lang.Exception { com.google.gerrit.server.project.SetDefaultDashboard set = setDefault.get ( ) ; set.inherited = inherited ; return com.google.gerrit.extensions.restapi.Response.created ( set.apply ( com.google.gerrit.server.project.DashboardResource.projectDefault ( resource.getControl ( ) ) , input ) ) ; }
Source:
public void addPatchSetComments ( com.google.gerrit.server.data.PatchSetAttribute patchSetAttribute , java.util.Collection < com.google.gerrit.reviewdb.client.PatchLineComment > patchLineComments ) { for ( com.google.gerrit.reviewdb.client.PatchLineComment comment : patchLineComments ) { if ( ( comment.getKey ( ) . getParentKey ( ) . getParentKey ( ) . get ( ) ) == ( java.lang.Integer.parseInt ( patchSetAttribute.number ) ) ) { if ( ( patchSetAttribute.comments ) == null ) { patchSetAttribute.comments = new java.util.ArrayList < > ( ) ; } patchSetAttribute.comments.add ( asPatchSetLineAttribute ( comment ) ) ; } } }

Target:
public void addPatchSetComments ( com.google.gerrit.server.data.PatchSetAttribute patchSetAttribute , java.util.Collection < com.google.gerrit.reviewdb.client.Comment > comments ) { for ( com.google.gerrit.reviewdb.client.Comment comment : comments ) { if ( ( comment.key.patchSetId ) == ( java.lang.Integer.parseInt ( patchSetAttribute.number ) ) ) { if ( ( patchSetAttribute.comments ) == null ) { patchSetAttribute.comments = new java.util.ArrayList < > ( ) ; } patchSetAttribute.comments.add ( asPatchSetLineAttribute ( comment ) ) ; } } }
Source:
public void init ( javax.servlet.FilterConfig config ) throws javax.servlet.ServletException { if ( isPropertyUndefined ( config , com.googlesource.gerrit.plugins.javamelody.GerritMonitoringFilter.JavamelodyFilter.HTTP_TRANSFORM_PATTERN , com.googlesource.gerrit.plugins.javamelody.GerritMonitoringFilter.JavamelodyFilter.GLOBAL_HTTP_TRANSFORM_PATTERN ) ) { java.lang.System.setProperty ( com.googlesource.gerrit.plugins.javamelody.GerritMonitoringFilter.JavamelodyFilter.GLOBAL_HTTP_TRANSFORM_PATTERN , com.googlesource.gerrit.plugins.javamelody.GerritMonitoringFilter.JavamelodyFilter.GERRIT_GROUPING ) ; } if ( isPropertyUndefined ( config , com.googlesource.gerrit.plugins.javamelody.GerritMonitoringFilter.JavamelodyFilter.STORAGE_DIR , com.googlesource.gerrit.plugins.javamelody.GerritMonitoringFilter.JavamelodyFilter.GLOBAL_STORAGE_DIR ) ) { java.lang.System.setProperty ( com.googlesource.gerrit.plugins.javamelody.GerritMonitoringFilter.JavamelodyFilter.GLOBAL_STORAGE_DIR , getStorageDir ( ) ) ; } super . init ( config ) ; }

Target:
private java.lang.String getTransformPattern ( ) { return cfg.getString ( com.googlesource.gerrit.plugins.javamelody.GerritMonitoringFilter.JavamelodyFilter.HTTP_TRANSFORM_PATTERN , com.googlesource.gerrit.plugins.javamelody.GerritMonitoringFilter.JavamelodyFilter.GERRIT_GROUPING ) ; }
Source:
public void postEvent ( final com.google.gerrit.reviewdb.client.Change change , final com.google.gerrit.server.events.ChangeEvent event , final com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { fireEvent ( change , event , db ) ; }

Target:
private void fireEvent ( final com.google.gerrit.reviewdb.client.Change change , final com.google.gerrit.server.events.Event event , final com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { for ( com.google.gerrit.common.ChangeHookRunner.EventListenerHolder holder : listeners.values ( ) ) { if ( isVisibleTo ( change , holder.user , db ) ) { holder.listener.onEvent ( event ) ; } } fireEventForUnrestrictedListeners ( event ) ; }
Source:
private com.googlecode.prolog_cafe.lang.Operation finishjtry ( com.googlecode.prolog_cafe.lang.Operation p , com.googlecode.prolog_cafe.lang.Operation next , com.googlecode.prolog_cafe.lang.ChoicePointFrame entry ) { entry.b0 = B0 ; entry.bp = next ; entry.tr = trail.top ( ) ; entry.timeStamp = ++ ( CPFTimeStamp ) ; stack.push ( entry ) ; return p ; }

Target:
public com.googlecode.prolog_cafe.lang.Operation jtry ( com.googlecode.prolog_cafe.lang.Operation p , com.googlecode.prolog_cafe.lang.Operation next , com.googlecode.prolog_cafe.lang.ChoicePointFrame entry ) { entry.cont = cont ; entry.b0 = B0 ; entry.bp = next ; entry.tr = trail.top ( ) ; entry.timeStamp = ++ ( CPFTimeStamp ) ; stack.push ( entry ) ; return p ; }
Source:
private boolean matchAny ( java.lang.Iterable < com.google.gerrit.common.data.PermissionRule > rules , com.google.common.base.Predicate < com.google.gerrit.common.data.PermissionRule > predicate ) { java.lang.Iterable < com.google.gerrit.reviewdb.client.AccountGroup.UUID > ids = com.google.common.collect.Iterables.transform ( com.google.common.collect.Iterables.filter ( rules , predicate ) , new com.google.common.base.Function < com.google.gerrit.common.data.PermissionRule , com.google.gerrit.reviewdb.client.AccountGroup.UUID > ( ) { @ java.lang.Override public AccountGroup.UUID apply ( com.google.gerrit.common.data.PermissionRule rule ) { return rule.getGroup ( ) . getUUID ( ) ; } } ) ; return user.getEffectiveGroups ( ) . containsAnyOf ( ids ) ; }

Target:
private boolean matchAny ( java.lang.Iterable < com.google.gerrit.common.data.PermissionRule > rules , com.google.common.base.Predicate < com.google.gerrit.common.data.PermissionRule > predicate ) { java.lang.Iterable < com.google.gerrit.reviewdb.client.AccountGroup.UUID > ids = com.google.common.collect.Iterables.transform ( com.google.common.collect.Iterables.filter ( rules , predicate ) , new com.google.common.base.Function < com.google.gerrit.common.data.PermissionRule , com.google.gerrit.reviewdb.client.AccountGroup.UUID > ( ) { @ java.lang.Override public AccountGroup.UUID apply ( com.google.gerrit.common.data.PermissionRule rule ) { return rule.getGroup ( ) . getUUID ( ) ; } } ) ; return user.memberOfAny ( ids ) ; }
Source:
private com.google.gerrit.httpd.raw.HostPageServlet.Page get ( ) { com.google.gerrit.httpd.raw.HostPageServlet.Page p = page ; if ( p.isStale ( ) ) { final com.google.gerrit.httpd.raw.HostPageServlet.Page newPage ; try { newPage = new com.google.gerrit.httpd.raw.HostPageServlet.Page ( ) ; } catch ( java.io.IOException e ) { com.google.gerrit.httpd.raw.HostPageServlet.log.error ( "Cannot refresh site header/footer" , e ) ; return p ; } p = newPage ; page = p ; } return p ; }

Target:
private com.google.gerrit.httpd.raw.HostPageServlet.Page get ( ) { com.google.gerrit.httpd.raw.HostPageServlet.Page p = page ; if ( ( refreshHeaderFooter ) && ( p.isStale ( ) ) ) { final com.google.gerrit.httpd.raw.HostPageServlet.Page newPage ; try { newPage = new com.google.gerrit.httpd.raw.HostPageServlet.Page ( ) ; } catch ( java.io.IOException e ) { com.google.gerrit.httpd.raw.HostPageServlet.log.error ( "Cannot refresh site header/footer" , e ) ; return p ; } p = newPage ; page = p ; } return p ; }
Source:
private void fireEvent ( com.google.gerrit.reviewdb.client.Branch.NameKey branchName , com.google.gerrit.common.Event event ) { for ( com.google.gerrit.common.ChangeHookRunner.EventListenerHolder holder : listeners.values ( ) ) { if ( isVisibleTo ( branchName , holder.user ) ) { holder.listener.onEvent ( event ) ; } } fireEventForUnrestrictedListeners ( event ) ; }

Target:
public void postEvent ( com.google.gerrit.common.Event event , com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { fireEvent ( event , db ) ; }
Source:
private PushOneCommit.Result push ( java.lang.String ref , java.lang.String subject , java.lang.String fileName , java.lang.String content ) throws java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { com.google.gerrit.acceptance.git.PushOneCommit push = new com.google.gerrit.acceptance.git.PushOneCommit ( db , admin.getIdent ( ) , subject , fileName , content ) ; return push.to ( git , ref ) ; }

Target:
private PushOneCommit.Result push ( java.lang.String ref , java.lang.String subject , java.lang.String fileName , java.lang.String content ) 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 , ref ) ; }
Source:
public com.google.gwtorm.client.OrmException convertError ( final java.lang.String op , final java.lang.String entity , final java.sql.SQLException err ) { return new com.google.gwtorm.client.OrmException ( ( ( op + " failure on " ) + entity ) , err ) ; }

Target:
public com.google.gwtorm.client.OrmException convertError ( final java.lang.String op , final java.lang.String entity , final java.sql.SQLException err ) { if ( ( ( err.getCause ( ) ) == null ) && ( ( err.getNextException ( ) ) != null ) ) { err.initCause ( err.getNextException ( ) ) ; } return new com.google.gwtorm.client.OrmException ( ( ( op + " failure on " ) + entity ) , err ) ; }
Source:
private java.lang.String getDisplayName ( final com.google.gerrit.reviewdb.Account account ) { if ( account != null ) { java.lang.String result = ( ( account.getFullName ( ) ) == null ) ? "Anonymous Coward" : account.getFullName ( ) ; if ( ( account.getPreferredEmail ( ) ) != null ) { result += ( " (" + ( account.getPreferredEmail ( ) ) ) + ")" ; } return result ; } return "Anonymous Coward" ; }

Target:
private java.lang.String getDisplayName ( final com.google.gerrit.reviewdb.Account account ) { if ( account != null ) { java.lang.String result = ( ( account.getFullName ( ) ) == null ) ? anonymousCowardName : account.getFullName ( ) ; if ( ( account.getPreferredEmail ( ) ) != null ) { result += ( " (" + ( account.getPreferredEmail ( ) ) ) + ")" ; } return result ; } return anonymousCowardName ; }
Source:
void addCC ( final java.lang.String nameOrEmail ) throws org.kohsuke.args4j.CmdLineException { try { ccId.add ( toAccountId ( nameOrEmail ) ) ; } catch ( com.google.gerrit.client.rpc.NoSuchAccountException e ) { throw new org.kohsuke.args4j.CmdLineException ( e.getMessage ( ) ) ; } catch ( com.google.gwtorm.client.OrmException e ) { throw new org.kohsuke.args4j.CmdLineException ( "database is down" ) ; } }

Target:
void addCC ( final com.google.gerrit.client.reviewdb.Account.Id id ) { ccId.add ( id ) ; }
Source:
private boolean isVisible ( final com.google.gerrit.reviewdb.client.Project.NameKey project , com.googlesource.gerrit.plugins.replication.ReplicationState ... states ) { try { return threadScoper.scope ( new java.util.concurrent.Callable < java.lang.Boolean > ( ) { @ java.lang.Override public java.lang.Boolean call ( ) throws com.google.gerrit.server.project.NoSuchProjectException { return controlFor ( project ) . isVisible ( ) ; } } ) . call ( ) ; } catch ( com.google.gerrit.server.project.NoSuchProjectException err ) { com.googlesource.gerrit.plugins.replication.Destination.stateLog.error ( java.lang.String.format ( "source project %s not available" , project ) , err , states ) ; } catch ( java.lang.Exception e ) { throw com.google.common.base.Throwables.propagate ( e ) ; } return false ; }

Target:
private boolean isVisible ( final com.google.gerrit.reviewdb.client.Project.NameKey project , com.googlesource.gerrit.plugins.replication.ReplicationState ... states ) { try { return threadScoper.scope ( new java.util.concurrent.Callable < java.lang.Boolean > ( ) { @ java.lang.Override public java.lang.Boolean call ( ) throws com.google.gerrit.server.project.NoSuchProjectException { return controlFor ( project ) . isVisible ( ) ; } } ) . call ( ) ; } catch ( com.google.gerrit.server.project.NoSuchProjectException err ) { stateLog.error ( java.lang.String.format ( "source project %s not available" , project ) , err , states ) ; } catch ( java.lang.Exception e ) { throw com.google.common.base.Throwables.propagate ( e ) ; } return false ; }
Source:
public static com.google.gerrit.client.rpc.RestApi revision ( com.google.gerrit.reviewdb.client.PatchSet.Id id ) { return com.google.gerrit.client.changes.ChangeApi.change ( id.getParentKey ( ) . get ( ) ) . view ( "revisions" ) . id ( id.get ( ) ) ; }

Target:
public static com.google.gerrit.client.rpc.RestApi revision ( com.google.gerrit.reviewdb.client.PatchSet.Id id ) { int cn = id.getParentKey ( ) . get ( ) ; java.lang.String revision = com.google.gerrit.client.changes.RevisionInfoCache.get ( id ) ; if ( revision != null ) { return com.google.gerrit.client.changes.ChangeApi.revision ( cn , revision ) ; } return com.google.gerrit.client.changes.ChangeApi.change ( cn ) . view ( "revisions" ) . id ( id.get ( ) ) ; }
Source:
protected void configure ( ) { switch ( loginType ) { case HTTP_LDAP : case LDAP : case LDAP_BIND : case CLIENT_SSL_CERT_LDAP : install ( new com.google.gerrit.server.auth.ldap.LdapModule ( ) ) ; break ; case CUSTOM_EXTENSION : break ; default : bind ( com.google.gerrit.server.account.Realm.class ) . to ( com.google.gerrit.server.account.DefaultRealm.class ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.server.auth.AuthBackend.class ) . to ( com.google.gerrit.server.auth.InternalAuthBackend.class ) ; break ; } }

Target:
protected void configure ( ) { switch ( loginType ) { case HTTP_LDAP : case LDAP : case LDAP_BIND : case CLIENT_SSL_CERT_LDAP : install ( new com.google.gerrit.server.auth.ldap.LdapModule ( ) ) ; break ; case OAUTH : bind ( com.google.gerrit.server.account.Realm.class ) . to ( com.google.gerrit.server.auth.oauth.OAuthRealm.class ) ; break ; case CUSTOM_EXTENSION : break ; default : bind ( com.google.gerrit.server.account.Realm.class ) . to ( com.google.gerrit.server.account.DefaultRealm.class ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.server.auth.AuthBackend.class ) . to ( com.google.gerrit.server.auth.InternalAuthBackend.class ) ; break ; } }
Source:
private static java.util.List < org.eclipse.jgit.revwalk.RevCommit > findMergeBases ( org.eclipse.jgit.revwalk.RevWalk rw , java.lang.Iterable < org.eclipse.jgit.revwalk.RevCommit > commits ) throws java.io.IOException { rw.setRevFilter ( RevFilter.MERGE_BASE ) ; com.google.gerrit.server.change.WalkSorter.markStart ( rw , commits ) ; java.util.List < org.eclipse.jgit.revwalk.RevCommit > result = new java.util.ArrayList < > ( ) ; org.eclipse.jgit.revwalk.RevCommit c ; while ( ( c = rw.next ( ) ) != null ) { result.add ( c ) ; } return result ; }

Target:
private static com.google.common.collect.Multimap < org.eclipse.jgit.revwalk.RevCommit , org.eclipse.jgit.revwalk.RevCommit > collectChildren ( java.util.Set < org.eclipse.jgit.revwalk.RevCommit > commits ) { com.google.common.collect.Multimap < org.eclipse.jgit.revwalk.RevCommit , org.eclipse.jgit.revwalk.RevCommit > children = com.google.common.collect.ArrayListMultimap.create ( ) ; for ( org.eclipse.jgit.revwalk.RevCommit c : commits ) { for ( org.eclipse.jgit.revwalk.RevCommit p : c.getParents ( ) ) { if ( commits.contains ( p ) ) { children.put ( p , c ) ; } } } return children ; }
Source:
public void submitWithErrorMessage ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = newChange ( ) ; com.google.gerrit.server.notedb.ChangeUpdate update = newUpdate ( c , changeOwner ) ; update.setSubjectForCommit ( "Submit patch set 1" ) ; update.merge ( "1-1453387607626-96fabc25" , com.google.common.collect.ImmutableList.of ( submitRecord ( "RULE_ERROR" , "Problem with patch set:\n1" ) ) ) ; update.commit ( ) ; assertBodyEquals ( ( "Submit patch set 1\n" + ( ( ( ( "\n" + "Patch-set: 1\n" ) + "Status: merged\n" ) + "Submission-id: 1-1453387607626-96fabc25\n" ) + "Submitted-with: RULE_ERROR Problem with patch set: 1\n" ) ) , update.getRevision ( ) ) ; }

Target:
public void submitWithErrorMessage ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = newChange ( ) ; com.google.gerrit.server.notedb.ChangeUpdate update = newUpdate ( c , changeOwner ) ; update.setSubjectForCommit ( "Submit patch set 1" ) ; update.merge ( "1-1453387607626-96fabc25" , com.google.common.collect.ImmutableList.of ( submitRecord ( "RULE_ERROR" , "Problem with patch set:\n1" ) ) ) ; update.commit ( ) ; assertBodyEquals ( ( "Submit patch set 1\n" + ( ( ( ( "\n" + "Patch-set: 1\n" ) + "Status: merged\n" ) + "Submission-id: 1-1453387607626-96fabc25\n" ) + "Submitted-with: RULE_ERROR Problem with patch set: 1\n" ) ) , update.getResult ( ) ) ; }
Source:
public static void block ( com.google.gerrit.server.git.ProjectConfig config , com.google.gerrit.common.data.AccessSection section , java.lang.String permission , com.google.gerrit.common.data.GroupReference ... groupList ) { com.google.gerrit.common.data.Permission p = section.getPermission ( permission , true ) ; for ( com.google.gerrit.common.data.GroupReference group : groupList ) { if ( group != null ) { com.google.gerrit.common.data.PermissionRule r = com.google.gerrit.server.schema.AclUtil.rule ( config , group ) ; r.setBlock ( ) ; p.add ( r ) ; } } }

Target:
public static void block ( com.google.gerrit.server.project.ProjectConfig config , com.google.gerrit.common.data.AccessSection section , java.lang.String permission , com.google.gerrit.common.data.GroupReference ... groupList ) { com.google.gerrit.common.data.Permission p = section.getPermission ( permission , true ) ; for ( com.google.gerrit.common.data.GroupReference group : groupList ) { if ( group != null ) { com.google.gerrit.common.data.PermissionRule r = com.google.gerrit.server.schema.AclUtil.rule ( config , group ) ; r.setBlock ( ) ; p.add ( r ) ; } } }
Source:
public void parseTopic ( ) throws java.lang.Exception { assertParseSucceeds ( ( "Update change\n" + ( ( "\n" + "Patch-Set: 1\n" ) + "Topic: Some Topic" ) ) ) ; assertParseSucceeds ( ( "Update change\n" + ( ( "\n" + "Patch-Set: 1\n" ) + "Topic:" ) ) ) ; assertParseFails ( ( "Update change\n" + ( ( ( "\n" + "Patch-Set: 1\n" ) + "Topic: Some Topic\n" ) + "Topic: Other Topic" ) ) ) ; }

Target:
public void parseTopic ( ) throws java.lang.Exception { assertParseSucceeds ( ( "Update change\n" + ( ( ( ( "\n" + "Branch: refs/heads/master\n" ) + "Patch-Set: 1\n" ) + "Topic: Some Topic\n" ) + "Subject: This is a test change\n" ) ) ) ; assertParseSucceeds ( ( "Update change\n" + ( ( ( ( "\n" + "Branch: refs/heads/master\n" ) + "Patch-Set: 1\n" ) + "Topic:\n" ) + "Subject: This is a test change\n" ) ) ) ; assertParseFails ( ( "Update change\n" + ( ( ( "\n" + "Patch-Set: 1\n" ) + "Topic: Some Topic\n" ) + "Topic: Other Topic" ) ) ) ; }
Source:
java.util.Set < com.google.gerrit.server.account.externalids.ExternalId > all ( ) throws java.io.IOException { checkReadEnabled ( ) ; try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( allUsersName ) ) { return all ( repo , com.google.gerrit.server.account.externalids.ExternalIdReader.readRevision ( repo ) ) ; } }

Target:
java.util.Set < com.google.gerrit.server.account.externalids.ExternalId > all ( org.eclipse.jgit.lib.ObjectId rev ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { checkReadEnabled ( ) ; try ( com.google.gerrit.metrics.Timer0.Context ctx = readAllLatency.start ( ) ; org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( allUsersName ) ) { return com.google.gerrit.server.account.externalids.ExternalIdNotes.loadReadOnly ( repo , rev ) . all ( ) ; } }
Source:
public boolean canForceUpdate ( ) { if ( ! ( canWrite ( ) ) ) { 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 ( getUser ( ) . getCapabilities ( ) . canAdministrateServer ( ) ) || ( ( isOwner ( ) ) && ( ! ( isForceBlocked ( Permission.PUSH ) ) ) ) ; } }

Target:
public boolean canForceUpdate ( ) { if ( ! ( canWrite ( ) ) ) { 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 ( getUser ( ) . getCapabilities ( ) . isAdmin_DoNotUse ( ) ) || ( ( isOwner ( ) ) && ( ! ( isForceBlocked ( Permission.PUSH ) ) ) ) ; } }
Source:
private void readObject ( java.io.ObjectInputStream in ) throws java.io.IOException { oldId = org.eclipse.jgit.lib.ObjectIdSerialization.readCanBeNull ( in ) ; int n = in.readInt ( ) ; parentNum = ( n == 0 ) ? null : java.lang.Integer.valueOf ( n ) ; newId = org.eclipse.jgit.lib.ObjectIdSerialization.readNotNull ( in ) ; char t = in.readChar ( ) ; whitespace = PatchListKey.WHITESPACE_TYPES.inverse ( ) . get ( t ) ; if ( ( whitespace ) == null ) { throw new java.io.IOException ( ( "Invalid whitespace type code: " + t ) ) ; } }

Target:
private void readObject ( java.io.ObjectInputStream in ) throws java.io.IOException { oldId = org.eclipse.jgit.lib.ObjectIdSerializer.read ( in ) ; int n = in.readInt ( ) ; parentNum = ( n == 0 ) ? null : java.lang.Integer.valueOf ( n ) ; newId = org.eclipse.jgit.lib.ObjectIdSerializer.read ( in ) ; char t = in.readChar ( ) ; whitespace = PatchListKey.WHITESPACE_TYPES.inverse ( ) . get ( t ) ; if ( ( whitespace ) == null ) { throw new java.io.IOException ( ( "Invalid whitespace type code: " + t ) ) ; } }
Source:
private void grant ( com.google.gerrit.server.git.ProjectConfig config , com.google.gerrit.common.data.AccessSection section , java.lang.String permission , com.google.gerrit.common.data.GroupReference ... groupList ) { com.google.gerrit.common.data.Permission p = section.getPermission ( permission , true ) ; for ( com.google.gerrit.common.data.GroupReference group : groupList ) { if ( group != null ) { p.add ( rule ( config , group ) ) ; } } }

Target:
private void grant ( com.google.gerrit.server.git.ProjectConfig config , com.google.gerrit.common.data.AccessSection section , java.lang.String permission , boolean force , com.google.gerrit.common.data.GroupReference ... groupList ) { com.google.gerrit.common.data.Permission p = section.getPermission ( permission , true ) ; for ( com.google.gerrit.common.data.GroupReference group : groupList ) { if ( group != null ) { com.google.gerrit.common.data.PermissionRule r = rule ( config , group ) ; r.setForce ( force ) ; p.add ( r ) ; } } }
Source:
public com.google.gerrit.server.IdentifiedUser parse ( java.lang.String id ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.UnprocessableEntityException , com.google.gwtorm.server.OrmException { com.google.gerrit.server.IdentifiedUser user = parseId ( id ) ; if ( user == null ) { throw new com.google.gerrit.extensions.restapi.UnprocessableEntityException ( java.lang.String.format ( "Account Not Found: %s" , id ) ) ; } else if ( ! ( accountControlFactory.get ( ) . canSee ( user.getAccount ( ) ) ) ) { throw new com.google.gerrit.extensions.restapi.UnprocessableEntityException ( java.lang.String.format ( "Account Not Found: %s" , id ) ) ; } return user ; }

Target:
public com.google.gerrit.server.IdentifiedUser parseOnBehalfOf ( @ com.google.gerrit.common.Nullable com.google.gerrit.server.CurrentUser caller , java.lang.String id ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.UnprocessableEntityException , com.google.gwtorm.server.OrmException { com.google.gerrit.server.IdentifiedUser user = parseIdOnBehalfOf ( caller , id ) ; if ( user == null ) { throw new com.google.gerrit.extensions.restapi.UnprocessableEntityException ( java.lang.String.format ( "Account Not Found: %s" , id ) ) ; } else if ( ! ( accountControlFactory.get ( ) . canSee ( user.getAccount ( ) ) ) ) { throw new com.google.gerrit.extensions.restapi.UnprocessableEntityException ( java.lang.String.format ( "Account Not Found: %s" , id ) ) ; } return user ; }
Source:
public com.google.gerrit.server.patch.PatchList get ( com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.reviewdb.client.PatchSet patchSet ) throws com.google.gerrit.server.patch.PatchListNotAvailableException { com.google.gerrit.reviewdb.client.Project.NameKey project = change.getProject ( ) ; org.eclipse.jgit.lib.ObjectId a = null ; if ( ( patchSet.getRevision ( ) ) == null ) { throw new com.google.gerrit.server.patch.PatchListNotAvailableException ( ( "revision is null for " + ( patchSet.getId ( ) ) ) ) ; } org.eclipse.jgit.lib.ObjectId b = org.eclipse.jgit.lib.ObjectId.fromString ( patchSet.getRevision ( ) . get ( ) ) ; com.google.gerrit.extensions.client.DiffPreferencesInfo.Whitespace ws = com.google.gerrit.extensions.client.DiffPreferencesInfo.Whitespace.IGNORE_NONE ; return get ( new com.google.gerrit.server.patch.PatchListKey ( a , b , ws ) , project ) ; }

Target:
public org.eclipse.jgit.lib.ObjectId getOldId ( com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.reviewdb.client.PatchSet patchSet , java.lang.Integer parentNum ) throws com.google.gerrit.server.patch.PatchListNotAvailableException { return get ( change , patchSet , parentNum ) . getOldId ( ) ; }
Source:
private static java.lang.String format ( final java.net.SocketAddress addr ) { if ( addr instanceof java.net.InetSocketAddress ) { final java.net.InetSocketAddress inetAddr = ( ( java.net.InetSocketAddress ) ( addr ) ) ; final java.net.InetAddress hostAddr = inetAddr.getAddress ( ) ; java.lang.String host ; if ( hostAddr.isAnyLocalAddress ( ) ) { host = "*" ; } else { host = ( "[" + ( hostAddr.getCanonicalHostName ( ) ) ) + "]" ; } return ( host + ":" ) + ( inetAddr.getPort ( ) ) ; } return addr.toString ( ) ; }

Target:
private static java.lang.String format ( final java.net.SocketAddress addr ) { if ( addr instanceof java.net.InetSocketAddress ) { final java.net.InetSocketAddress inetAddr = ( ( java.net.InetSocketAddress ) ( addr ) ) ; final java.net.InetAddress hostAddr = inetAddr.getAddress ( ) ; java.lang.String host ; if ( hostAddr.isAnyLocalAddress ( ) ) { host = "*" ; } else { host = ( "[" + ( hostAddr.getHostName ( ) ) ) + "]" ; } return ( host + ":" ) + ( inetAddr.getPort ( ) ) ; } return addr.toString ( ) ; }
Source:
public void subsetOfBranchesVisibleNotIncludingHead ( ) throws java.lang.Exception { deny ( Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/master" ) ; allow ( Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/branch" ) ; assertRefs ( "refs/changes/02/2/1" , "refs/changes/02/2/meta" , "refs/heads/branch" , "refs/tags/branch-tag" , "refs/tags/master-tag" ) ; }

Target:
public void subsetOfBranchesVisibleNotIncludingHead ( ) throws java.lang.Exception { deny ( Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/master" ) ; allow ( Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/branch" ) ; assertRefs ( ( ( r2 ) + "1" ) , ( ( r2 ) + "meta" ) , "refs/heads/branch" , "refs/tags/branch-tag" , "refs/tags/master-tag" ) ; }
Source:
protected java.sql.PreparedStatement prepareStatement ( final java.lang.String sql ) throws com.google.gwtorm.client.OrmException { try { return schema.getConnection ( ) . prepareStatement ( sql ) ; } catch ( java.sql.SQLException e ) { com.google.gwtorm.jdbc.JdbcAccess.linkCause ( e ) ; throw new com.google.gwtorm.client.OrmException ( ( "Prepare failure\n" + sql ) , e ) ; } }

Target:
protected java.sql.PreparedStatement prepareStatement ( final java.lang.String sql ) throws com.google.gwtorm.client.OrmException { try { return schema.getConnection ( ) . prepareStatement ( sql ) ; } catch ( java.sql.SQLException e ) { throw convertError ( ( ( "prepare SQL\n" + sql ) + "\n" ) , e ) ; } }
Source:
public com.google.gerrit.server.mail.Address from ( final com.google.gerrit.reviewdb.Account.Id fromId ) { if ( fromId != null ) { final com.google.gerrit.reviewdb.Account a = accountCache.get ( fromId ) . getAccount ( ) ; if ( ( a.getPreferredEmail ( ) ) != null ) { return new com.google.gerrit.server.mail.Address ( a.getFullName ( ) , a.getPreferredEmail ( ) ) ; } } return srvAddr ; }

Target:
public com.google.gerrit.server.mail.Address from ( final com.google.gerrit.reviewdb.Account.Id fromId ) { if ( fromId != null ) { com.google.gerrit.reviewdb.Account a = com.google.gerrit.server.util.FutureUtil.get ( accountCache.getAccount ( fromId ) ) ; if ( ( a.getPreferredEmail ( ) ) != null ) { return new com.google.gerrit.server.mail.Address ( a.getFullName ( ) , a.getPreferredEmail ( ) ) ; } } return srvAddr ; }
Source:
public void setMinusOne ( java.lang.String project , int number , java.lang.String commentTemplate ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.project.NoSuchChangeException , com.google.gerrit.server.update.UpdateException , com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.extensions.api.changes.ReviewInput message = createComment ( commentTemplate ) . label ( "Code-Review" , ( - 1 ) ) ; applyComment ( project , number , message ) ; }

Target:
public void commentOnReview ( java.lang.String project , int number , java.lang.String comment ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.update.UpdateException , com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.extensions.api.changes.ReviewInput reviewInput = createComment ( comment ) ; applyComment ( project , number , reviewInput ) ; }
Source:
public void testChildren ( ) { final com.google.gerrit.server.query.OrPredicateTest.TestPredicate a = com.google.gerrit.server.query.OrPredicateTest.f ( "author" , "alice" ) ; final com.google.gerrit.server.query.OrPredicateTest.TestPredicate b = com.google.gerrit.server.query.OrPredicateTest.f ( "author" , "bob" ) ; final com.google.gerrit.server.query.Predicate < java.lang.String > n = com.google.gerrit.server.query.Predicate.or ( a , b ) ; org.junit.Assert.assertEquals ( 2 , n.getChildCount ( ) ) ; org.junit.Assert.assertSame ( a , n.getChild ( 0 ) ) ; org.junit.Assert.assertSame ( b , n.getChild ( 1 ) ) ; }

Target:
public void testChildren ( ) { final com.google.gerrit.server.query.TestPredicate a = f ( "author" , "alice" ) ; final com.google.gerrit.server.query.TestPredicate b = f ( "author" , "bob" ) ; final com.google.gerrit.server.query.Predicate < java.lang.String > n = com.google.gerrit.server.query.Predicate.or ( a , b ) ; org.junit.Assert.assertEquals ( 2 , n.getChildCount ( ) ) ; org.junit.Assert.assertSame ( a , n.getChild ( 0 ) ) ; org.junit.Assert.assertSame ( b , n.getChild ( 1 ) ) ; }
Source:
public com.google.common.collect.ListMultimap < com.google.gerrit.reviewdb.client.PatchSet.Id , com.google.gerrit.reviewdb.client.PatchSetApproval > allApprovalsMap ( com.google.inject.Provider < com.google.gerrit.reviewdb.server.ReviewDb > db ) throws com.google.gwtorm.server.OrmException { if ( ( allApprovals ) == null ) { allApprovals = com.google.common.collect.ArrayListMultimap.create ( ) ; for ( com.google.gerrit.reviewdb.client.PatchSetApproval psa : com.google.gerrit.server.query.change.ChangeData.sortApprovals ( db.get ( ) . patchSetApprovals ( ) . byChange ( legacyId ) ) ) { allApprovals.put ( psa.getPatchSetId ( ) , psa ) ; } } return allApprovals ; }

Target:
public com.google.common.collect.ListMultimap < com.google.gerrit.reviewdb.client.PatchSet.Id , com.google.gerrit.reviewdb.client.PatchSetApproval > allApprovalsMap ( com.google.inject.Provider < com.google.gerrit.reviewdb.server.ReviewDb > db ) throws com.google.gwtorm.server.OrmException { if ( ( allApprovals ) == null ) { allApprovals = com.google.common.collect.ArrayListMultimap.create ( ) ; for ( com.google.gerrit.reviewdb.client.PatchSetApproval psa : com.google.gerrit.server.ApprovalsUtil.sortApprovals ( db.get ( ) . patchSetApprovals ( ) . byChange ( legacyId ) ) ) { allApprovals.put ( psa.getPatchSetId ( ) , psa ) ; } } return allApprovals ; }
Source:
public UiAction.Description getDescription ( com.google.gerrit.server.change.ChangeResource resource ) { return new com.google.gerrit.extensions.webui.UiAction.Description ( ) . setLabel ( "Abandon" ) . setVisible ( ( ( resource.getChange ( ) . getStatus ( ) . isOpen ( ) ) && ( resource.getControl ( ) . canAbandon ( ) ) ) ) ; }

Target:
public UiAction.Description getDescription ( com.google.gerrit.server.change.ChangeResource resource ) { return new com.google.gerrit.extensions.webui.UiAction.Description ( ) . setLabel ( "Abandon" ) . setTitle ( "Abandon the change" ) . setVisible ( ( ( resource.getChange ( ) . getStatus ( ) . isOpen ( ) ) && ( resource.getControl ( ) . canAbandon ( ) ) ) ) ; }
Source:
public com.google.gwtjsonrpc.client.VoidResult call ( ) throws com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException , java.io.IOException { final com.google.gerrit.reviewdb.client.Change.Id changeId = patchSetId.getParentKey ( ) ; final com.google.gerrit.server.project.ChangeControl control = changeControlFactory.validateFor ( changeId ) ; if ( ! ( control.canDeleteDraft ( db ) ) ) { throw new com.google.gerrit.server.project.NoSuchChangeException ( changeId ) ; } com.google.gerrit.server.ChangeUtil.deleteDraftChange ( patchSetId , gitManager , replication , db ) ; return com.google.gwtjsonrpc.client.VoidResult.INSTANCE ; }

Target:
public com.google.gwtjsonrpc.common.VoidResult call ( ) throws com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException , java.io.IOException { final com.google.gerrit.reviewdb.client.Change.Id changeId = patchSetId.getParentKey ( ) ; final com.google.gerrit.server.project.ChangeControl control = changeControlFactory.validateFor ( changeId ) ; if ( ! ( control.canDeleteDraft ( db ) ) ) { throw new com.google.gerrit.server.project.NoSuchChangeException ( changeId ) ; } com.google.gerrit.server.ChangeUtil.deleteDraftChange ( patchSetId , gitManager , replication , db ) ; return com.google.gwtjsonrpc.common.VoidResult.INSTANCE ; }
Source:
public void run ( ) { try { future.get ( ) ; done.update ( 1 ) ; } catch ( java.lang.InterruptedException e ) { fail ( change , e ) ; } catch ( java.util.concurrent.ExecutionException e ) { fail ( change , e ) ; } catch ( java.lang.RuntimeException e ) { failAndThrow ( change , e ) ; } catch ( java.lang.Error e ) { failAndThrow ( change , e ) ; } finally { sem.release ( ) ; } }

Target:
public void run ( ) { try { future.get ( ) ; } catch ( java.lang.InterruptedException e ) { fail ( project , e ) ; } catch ( java.util.concurrent.ExecutionException e ) { ok.set ( false ) ; } catch ( java.lang.RuntimeException e ) { failAndThrow ( project , e ) ; } catch ( java.lang.Error e ) { failAndThrow ( project , e ) ; } finally { projTask.update ( 1 ) ; } }
Source:
private static byte [ ] readWholeEntry ( java.util.jar.JarFile jar , java.util.jar.JarEntry entry ) throws java.io.IOException { byte [ ] data = new byte [ ( ( int ) ( entry.getSize ( ) ) ) ] ; java.io.InputStream in = jar.getInputStream ( entry ) ; try { org.eclipse.jgit.util.IO.readFully ( in , data , 0 , data.length ) ; } finally { in.close ( ) ; } return data ; }

Target:
private static byte [ ] readWholeEntry ( com.google.gerrit.server.plugins.PluginContentScanner scanner , com.google.gerrit.server.plugins.PluginEntry entry ) throws java.io.IOException { byte [ ] data = new byte [ entry.getSize ( ) . get ( ) . intValue ( ) ] ; java.io.InputStream in = scanner.getInputStream ( entry ) ; try { org.eclipse.jgit.util.IO.readFully ( in , data , 0 , data.length ) ; } finally { in.close ( ) ; } return data ; }
Source:
public void onClick ( final com.google.gwt.event.dom.client.ClickEvent event ) { b.setEnabled ( false ) ; PatchUtil.DETAIL_SVC.deleteDraftPatchSet ( patchSet.getId ( ) , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.common.data.ChangeDetail > ( ) { public void onSuccess ( final com.google.gerrit.common.data.ChangeDetail result ) { if ( result != null ) { detailCache.set ( result ) ; } else { com.google.gerrit.client.Gerrit.display ( PageLinks.MINE ) ; } } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { b.setEnabled ( true ) ; super . onFailure ( caught ) ; } } ) ; }

Target:
public void onClick ( final com.google.gwt.event.dom.client.ClickEvent event ) { b.setEnabled ( false ) ; PatchUtil.DETAIL_SVC.deleteDraftPatchSet ( patchSet.getId ( ) , new com.google.gerrit.client.changes.ChangeDetailCache.GerritWidgetCallback ( b ) { public void onSuccess ( final com.google.gerrit.common.data.ChangeDetail result ) { if ( result != null ) { detailCache.set ( result ) ; } else { com.google.gerrit.client.Gerrit.display ( PageLinks.MINE ) ; } } } ) ; }
Source:
public void onClick ( final com.google.gwt.event.dom.client.ClickEvent event ) { b.setEnabled ( false ) ; Util.MANAGE_SVC.publish ( patchSet.getId ( ) , new com.google.gerrit.client.changes.ChangeDetailCache.GerritWidgetCallback ( b ) ) ; }

Target:
public void onClick ( final com.google.gwt.event.dom.client.ClickEvent event ) { b.setEnabled ( false ) ; final com.google.gerrit.reviewdb.client.Change.Id id = patchSet.getId ( ) . getParentKey ( ) ; com.google.gerrit.client.changes.ChangeApi.publish ( id.get ( ) , patchSet.getRevision ( ) . get ( ) , com.google.gerrit.client.change.DraftActions.cs ( id ) ) ; }
Source:
private static byte [ ] readWholeEntry ( com.google.gerrit.server.plugins.PluginContentScanner scanner , com.google.gerrit.server.plugins.PluginEntry entry ) throws java.io.IOException { HEAD ( c4dc9d ) ; com.google.gerrit.httpd.plugins.Remove unused ; }

Target:
private static byte [ ] readWholeEntry ( com.google.gerrit.server.plugins.PluginContentScanner scanner , com.google.gerrit.server.plugins.PluginEntry entry ) throws java.io.IOException { try ( java.io.InputStream in = scanner.getInputStream ( entry ) ) { return org.eclipse.jgit.util.IO.readWholeStream ( in , entry.getSize ( ) . get ( ) . intValue ( ) ) . array ( ) ; } }
Source:
public boolean canMoveTo ( java.lang.String ref , com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { return ( getProjectControl ( ) . controlForRef ( ref ) . canUpload ( ) ) && ( canAbandon ( db ) ) ; }

Target:
private boolean canRebase ( com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { return ( ( ( ( isOwner ( ) ) || ( getRefControl ( ) . canSubmit ( isOwner ( ) ) ) ) || ( getRefControl ( ) . canRebase ( ) ) ) && ( getRefControl ( ) . canUpload ( ) ) ) && ( ! ( isPatchSetLocked ( db ) ) ) ; }
Source:
private void newProject ( ) throws com.google.gwtorm.server.OrmException , com.jcraft.jsch.JSchException , java.io.IOException , java.io.UnsupportedEncodingException { com.google.gerrit.acceptance.TestAccount admin = accounts.admin ( ) ; com.google.gerrit.acceptance.git.GitUtil.initSsh ( admin ) ; project = new com.google.gerrit.reviewdb.client.Project.NameKey ( "p" ) ; com.google.gerrit.acceptance.SshSession sshSession = new com.google.gerrit.acceptance.SshSession ( server , admin ) ; com.google.gerrit.acceptance.git.GitUtil.createProject ( sshSession , project.get ( ) ) ; sshSession.close ( ) ; }

Target:
private void newProject ( ) throws com.google.gwtorm.server.OrmException , com.jcraft.jsch.JSchException , java.io.IOException , java.io.UnsupportedEncodingException { com.google.gerrit.acceptance.TestAccount admin = accounts.admin ( ) ; com.google.gerrit.acceptance.GitUtil.initSsh ( admin ) ; project = new com.google.gerrit.reviewdb.client.Project.NameKey ( "p" ) ; com.google.gerrit.acceptance.SshSession sshSession = new com.google.gerrit.acceptance.SshSession ( server , admin ) ; com.google.gerrit.acceptance.GitUtil.createProject ( sshSession , project.get ( ) ) ; sshSession.close ( ) ; }
Source:
static com.googlecode.prolog_cafe.lang.Term export ( com.google.gerrit.common.data.LabelType type ) { com.google.gerrit.common.data.LabelValue min = type.getMin ( ) ; com.google.gerrit.common.data.LabelValue max = type.getMax ( ) ; return new com.googlecode.prolog_cafe.lang.StructureTerm ( gerrit.PRED_get_legacy_label_types_1.symLabelType , com.googlecode.prolog_cafe.lang.SymbolTerm.intern ( type.getName ( ) ) , com.googlecode.prolog_cafe.lang.SymbolTerm.intern ( type.getFunctionName ( ) ) , ( min != null ? new com.googlecode.prolog_cafe.lang.IntegerTerm ( min.getValue ( ) ) : gerrit.PRED_get_legacy_label_types_1.NONE ) , ( max != null ? new com.googlecode.prolog_cafe.lang.IntegerTerm ( max.getValue ( ) ) : gerrit.PRED_get_legacy_label_types_1.NONE ) ) ; }

Target:
static com.googlecode.prolog_cafe.lang.Term export ( com.google.gerrit.common.data.LabelType type ) { com.google.gerrit.common.data.LabelValue min = type.getMin ( ) ; com.google.gerrit.common.data.LabelValue max = type.getMax ( ) ; return new com.googlecode.prolog_cafe.lang.StructureTerm ( gerrit.PRED_get_legacy_label_types_1.symLabelType , com.googlecode.prolog_cafe.lang.SymbolTerm.intern ( type.getName ( ) ) , com.googlecode.prolog_cafe.lang.SymbolTerm.intern ( type.getFunction ( ) . getFunctionName ( ) ) , ( min != null ? new com.googlecode.prolog_cafe.lang.IntegerTerm ( min.getValue ( ) ) : gerrit.PRED_get_legacy_label_types_1.NONE ) , ( max != null ? new com.googlecode.prolog_cafe.lang.IntegerTerm ( max.getValue ( ) ) : gerrit.PRED_get_legacy_label_types_1.NONE ) ) ; }
Source:
public AccountResource.SshKey parse ( com.google.gerrit.server.account.AccountResource rsrc , com.google.gerrit.extensions.restapi.IdString id ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException , com.google.gwtorm.server.OrmException { if ( ( ( self.get ( ) ) != ( rsrc.getUser ( ) ) ) && ( ! ( self.get ( ) . getCapabilities ( ) . canAdministrateServer ( ) ) ) ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( ) ; } return parse ( rsrc.getUser ( ) , id ) ; }

Target:
public AccountResource.SshKey parse ( com.google.gerrit.server.account.AccountResource rsrc , com.google.gerrit.extensions.restapi.IdString id ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException , com.google.gwtorm.server.OrmException { if ( ( ( self.get ( ) ) != ( rsrc.getUser ( ) ) ) && ( ! ( self.get ( ) . getCapabilities ( ) . canModifyAccount ( ) ) ) ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( ) ; } return parse ( rsrc.getUser ( ) , id ) ; }
Source:
private java.util.Map < java.lang.String , org.eclipse.jgit.lib.Ref > fastHideRefsMetaConfig ( java.util.Map < java.lang.String , org.eclipse.jgit.lib.Ref > refs ) { if ( ( refs.containsKey ( com.google.gerrit.reviewdb.client.RefNames.REFS_CONFIG ) ) && ( ! ( projectCtl.controlForRef ( com.google.gerrit.reviewdb.client.RefNames.REFS_CONFIG ) . isVisible ( ) ) ) ) { java.util.Map < java.lang.String , org.eclipse.jgit.lib.Ref > r = new java.util.HashMap ( refs ) ; r.remove ( com.google.gerrit.reviewdb.client.RefNames.REFS_CONFIG ) ; return r ; } return refs ; }

Target:
private java.util.Map < java.lang.String , org.eclipse.jgit.lib.Ref > fastHideRefsMetaConfig ( java.util.Map < java.lang.String , org.eclipse.jgit.lib.Ref > refs ) { if ( ( refs.containsKey ( com.google.gerrit.reviewdb.client.RefNames.REFS_CONFIG ) ) && ( ! ( canReadRef ( com.google.gerrit.reviewdb.client.RefNames.REFS_CONFIG ) ) ) ) { java.util.Map < java.lang.String , org.eclipse.jgit.lib.Ref > r = new java.util.HashMap ( refs ) ; r.remove ( com.google.gerrit.reviewdb.client.RefNames.REFS_CONFIG ) ; return r ; } return refs ; }
Source:
public void testCreateGroupWithoutCapability_Forbidden ( ) throws java.lang.Exception { java.lang.String newGroupName = name ( "newGroup" ) ; com.google.gerrit.acceptance.RestResponse r = new com.google.gerrit.acceptance.RestSession ( server , user ) . put ( ( "/groups/" + newGroupName ) ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( HttpStatus.SC_FORBIDDEN ) ; }

Target:
public void testCreateGroupWithoutCapability_Forbidden ( ) throws java.lang.Exception { setApiUser ( user ) ; try { gApi.groups ( ) . create ( name ( "newGroup" ) ) ; } catch ( com.google.gerrit.extensions.restapi.AuthException expected ) { } }
Source:
public void onClick ( final com.google.gwt.event.dom.client.ClickEvent event ) { b.setEnabled ( false ) ; Util.MANAGE_SVC.submit ( patchSet.getId ( ) , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.common.data.ChangeDetail > ( ) { public void onSuccess ( com.google.gerrit.common.data.ChangeDetail result ) { onSubmitResult ( result ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { b.setEnabled ( true ) ; super . onFailure ( caught ) ; } } ) ; }

Target:
public void onClick ( final com.google.gwt.event.dom.client.ClickEvent event ) { b.setEnabled ( false ) ; Util.MANAGE_SVC.submit ( patchSet.getId ( ) , new com.google.gerrit.client.changes.ChangeDetailCache.GerritWidgetCallback ( b ) { public void onSuccess ( com.google.gerrit.common.data.ChangeDetail result ) { onSubmitResult ( result ) ; } } ) ; }
Source:
private com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > rewrite ( com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > in ) throws com.google.gerrit.server.query.QueryParseException { return rewrite.rewrite ( in ) ; }

Target:
public void testStartDoesNotExceedMaxLimit ( ) throws java.lang.Exception { com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > in = parse ( "file:a" ) ; org.junit.Assert.assertEquals ( query ( in ) , rewrite.rewrite ( in , 0 ) ) ; org.junit.Assert.assertEquals ( query ( in ) , rewrite.rewrite ( in , 1 ) ) ; }
Source:
private java.lang.String getContentType ( com.google.gerrit.client.diff.DiffInfo.FileMeta meta ) { return ( ( prefs.syntaxHighlighting ( ) ) && ( meta != null ) ) && ( ( meta.content_type ( ) ) != null ) ? net.codemirror.lib.ModeInjector.getContentType ( meta.content_type ( ) ) : null ; }

Target:
private java.lang.String getContentType ( com.google.gerrit.client.diff.DiffInfo.FileMeta meta ) { return ( ( prefs.syntaxHighlighting ( ) ) && ( meta != null ) ) && ( ( meta.content_type ( ) ) != null ) ? net.codemirror.mode.ModeInjector.getContentType ( meta.content_type ( ) ) : null ; }