auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void changeMessageCommitFormatSimple ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = com.google.gerrit.testutil.TestChanges.newChange ( project , changeOwner , 1 ) ; com.google.gerrit.server.notedb.ChangeUpdate update = newUpdate ( c , changeOwner ) ; update.setChangeMessage ( ( "Just a little code change.\n" + "How about a new line" ) ) ; update.commit ( ) ; org.junit.Assert.assertEquals ( "refs/changes/01/1/meta" , update.getRefName ( ) ) ; assertBodyEquals ( ( "Update patch set 1\n" + ( ( ( ( "\n" + "Just a little code change.\n" ) + "How about a new line\n" ) + "\n" ) + "Patch-set: 1\n" ) ) , update.getRevision ( ) ) ; }

Target:
public void changeMessageCommitFormatSimple ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = com.google.gerrit.testutil.TestChanges.newChange ( project , changeOwner.getAccountId ( ) , 1 ) ; com.google.gerrit.server.notedb.ChangeUpdate update = newUpdate ( c , changeOwner ) ; update.setChangeMessage ( ( "Just a little code change.\n" + "How about a new line" ) ) ; update.commit ( ) ; org.junit.Assert.assertEquals ( "refs/changes/01/1/meta" , update.getRefName ( ) ) ; assertBodyEquals ( ( "Update patch set 1\n" + ( ( ( ( "\n" + "Just a little code change.\n" ) + "How about a new line\n" ) + "\n" ) + "Patch-set: 1\n" ) ) , update.getRevision ( ) ) ; }
Source:
private com.google.gerrit.server.group.db.InternalGroupCreation getGroupCreation ( com.google.gerrit.server.Sequences seqs , com.google.gerrit.common.data.GroupReference groupReference ) throws com.google.gwtorm.server.OrmException { int next = seqs.nextGroupId ( ) ; return com.google.gerrit.server.group.db.InternalGroupCreation.builder ( ) . setNameKey ( new com.google.gerrit.reviewdb.client.AccountGroup.NameKey ( groupReference.getName ( ) ) ) . setId ( new com.google.gerrit.reviewdb.client.AccountGroup.Id ( next ) ) . setGroupUUID ( groupReference.getUUID ( ) ) . setCreatedOn ( com.google.gerrit.common.TimeUtil.nowTs ( ) ) . build ( ) ; }

Target:
private com.google.gerrit.server.group.db.InternalGroupCreation getGroupCreation ( com.google.gerrit.server.Sequences seqs , com.google.gerrit.common.data.GroupReference groupReference ) throws com.google.gwtorm.server.OrmException { int next = seqs.nextGroupId ( ) ; return com.google.gerrit.server.group.db.InternalGroupCreation.builder ( ) . setNameKey ( new com.google.gerrit.reviewdb.client.AccountGroup.NameKey ( groupReference.getName ( ) ) ) . setId ( new com.google.gerrit.reviewdb.client.AccountGroup.Id ( next ) ) . setGroupUUID ( groupReference.getUUID ( ) ) . build ( ) ; }
Source:
private synchronized void unloadPlugin ( com.google.gerrit.server.plugins.Plugin plugin ) { persistentCacheFactory.onStop ( plugin ) ; java.lang.String name = plugin.getName ( ) ; com.google.gerrit.server.plugins.PluginLoader.log.info ( java.lang.String.format ( "Unloading plugin %s, version %s" , name , plugin.getVersion ( ) ) ) ; plugin.stop ( env ) ; env.onStopPlugin ( plugin ) ; running.remove ( name ) ; disabled.remove ( name ) ; toCleanup.add ( plugin ) ; }

Target:
private synchronized void unloadPlugin ( com.google.gerrit.server.plugins.Plugin plugin ) { persistentCacheFactory.onStop ( plugin.getName ( ) ) ; java.lang.String name = plugin.getName ( ) ; com.google.gerrit.server.plugins.PluginLoader.log.info ( java.lang.String.format ( "Unloading plugin %s, version %s" , name , plugin.getVersion ( ) ) ) ; plugin.stop ( env ) ; env.onStopPlugin ( plugin ) ; running.remove ( name ) ; disabled.remove ( name ) ; toCleanup.add ( plugin ) ; }
Source:
private void parseUpdate ( final org.eclipse.jgit.transport.ReceiveCommand cmd ) { com.google.gerrit.server.project.RefControl ctl = projectControl.controlForRef ( cmd.getRefName ( ) ) ; if ( ctl.canUpdate ( ) ) { if ( ( com.google.gerrit.server.git.ReceiveCommits.isHead ( cmd ) ) && ( ! ( isCommit ( cmd ) ) ) ) { return ; } validateNewCommits ( ctl , cmd ) ; cmd.execute ( rp ) ; } else { com.google.gerrit.server.git.ReceiveCommits.reject ( cmd , "can not update the reference as a fast forward" ) ; } }

Target:
private void parseUpdate ( final org.eclipse.jgit.transport.ReceiveCommand cmd ) { com.google.gerrit.server.project.RefControl ctl = projectControl.controlForRef ( cmd.getRefName ( ) ) ; if ( ctl.canUpdate ( ) ) { if ( ( com.google.gerrit.server.git.ReceiveCommits.isHead ( cmd ) ) && ( ! ( isCommit ( cmd ) ) ) ) { return ; } validateNewCommits ( ctl , cmd ) ; cmd.execute ( rp ) ; } else { reject ( cmd , "can not update the reference as a fast forward" ) ; } }
Source:
public java.lang.String getETag ( ) { com.google.gerrit.server.CurrentUser user = control.getUser ( ) ; com.google.common.hash.Hasher h = com.google.common.hash.Hashing.md5 ( ) . newHasher ( ) . putBoolean ( user.getStarredChanges ( ) . contains ( getChange ( ) . getId ( ) ) ) ; prepareETag ( h , user ) ; return h.hash ( ) . toString ( ) ; }

Target:
public java.lang.String getETag ( ) { com.google.gerrit.server.CurrentUser user = control.getUser ( ) ; com.google.common.hash.Hasher h = com.google.common.hash.Hashing.md5 ( ) . newHasher ( ) . putBoolean ( user.getStarredChanges ( ) . contains ( getId ( ) ) ) ; prepareETag ( h , user ) ; return h.hash ( ) . toString ( ) ; }
Source:
private static void validateRequestMethod ( javax.servlet.http.HttpServletRequest req ) throws com.google.gerrit.extensions.restapi.MethodNotAllowedException { if ( ( ! ( "GET" . equals ( req.getMethod ( ) ) ) ) && ( ! ( "HEAD" . equals ( req.getMethod ( ) ) ) ) ) { throw new com.google.gerrit.extensions.restapi.MethodNotAllowedException ( ) ; } }

Target:
private static void validateRequestMethod ( javax.servlet.http.HttpServletRequest req ) throws com.google.gerrit.extensions.restapi.MethodNotAllowedException { if ( ! ( ( "GET" . equals ( req.getMethod ( ) ) ) || ( "HEAD" . equals ( req.getMethod ( ) ) ) ) ) { throw new com.google.gerrit.extensions.restapi.MethodNotAllowedException ( ) ; } }
Source:
protected java.nio.file.Path getResourcePath ( java.lang.String pathInfo ) { java.nio.file.Path p = staticBase.resolve ( pathInfo ) ; try { p = p.toRealPath ( ) . normalize ( ) ; if ( ! ( p.startsWith ( staticBase ) ) ) { return null ; } return p ; } catch ( java.io.IOException e ) { return null ; } }

Target:
protected java.nio.file.Path getResourcePath ( java.lang.String pathInfo ) { return staticBase.resolve ( pathInfo ) ; }
Source:
public void testNoteInMiddle ( ) throws java.lang.Exception { assertEquals ( ( "a\n" + ( ( ( ( "\n" + "NOTE: This\n" ) + "does not fix it.\n" ) + "\n" ) + "Change-Id: I988a127969a6ee5e58db546aab74fc46e66847f8\n" ) ) , call ( ( "a\n" + ( ( "\n" + "NOTE: This\n" ) + "does not fix it.\n" ) ) ) ) ; }

Target:
public void testNoteInMiddle ( ) throws java.lang.Exception { org.junit.Assert.assertEquals ( ( "a\n" + ( ( ( ( "\n" + "NOTE: This\n" ) + "does not fix it.\n" ) + "\n" ) + "Change-Id: I988a127969a6ee5e58db546aab74fc46e66847f8\n" ) ) , call ( ( "a\n" + ( ( "\n" + "NOTE: This\n" ) + "does not fix it.\n" ) ) ) ) ; }
Source:
public static void getMeta ( com.google.gerrit.reviewdb.client.PatchSet.Id id , java.lang.String path , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.editor.EditFileInfo > cb ) { if ( ( id.get ( ) ) != 0 ) { throw new java.lang.IllegalStateException ( "only supported for edits" ) ; } com.google.gerrit.client.changes.ChangeEditApi.editFile ( id.getParentKey ( ) . get ( ) , path ) . view ( "meta" ) . get ( cb ) ; }

Target:
public static void getMeta ( @ com.google.gerrit.common.Nullable java.lang.String project , com.google.gerrit.reviewdb.client.PatchSet.Id id , java.lang.String path , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.editor.EditFileInfo > cb ) { if ( ( id.get ( ) ) != 0 ) { throw new java.lang.IllegalStateException ( "only supported for edits" ) ; } com.google.gerrit.client.changes.ChangeEditApi.editFile ( project , id.getParentKey ( ) . get ( ) , path ) . view ( "meta" ) . get ( cb ) ; }
Source:
public com.google.gwtorm.server.ResultSet < com.google.gerrit.server.query.change.ChangeData > restart ( com.google.gerrit.server.query.change.ChangeData last ) throws com.google.gwtorm.server.OrmException { pred = com.google.gerrit.server.index.IndexedChangeQuery.replaceSortKeyPredicates ( pred , last.change ( ) . getSortKey ( ) ) ; try { source = index.getSource ( pred , limit ) ; } catch ( com.google.gerrit.server.query.QueryParseException e ) { throw new com.google.gwtorm.server.OrmException ( e ) ; } return read ( ) ; }

Target:
public com.google.gwtorm.server.ResultSet < com.google.gerrit.server.query.change.ChangeData > restart ( com.google.gerrit.server.query.change.ChangeData last ) throws com.google.gwtorm.server.OrmException { pred = com.google.gerrit.server.index.IndexedChangeQuery.replaceSortKeyPredicates ( pred , last.change ( ) . getSortKey ( ) ) ; try { source = index.getSource ( pred , 0 , limit ) ; } catch ( com.google.gerrit.server.query.QueryParseException e ) { throw new com.google.gwtorm.server.OrmException ( e ) ; } return read ( ) ; }
Source:
private static com.google.gerrit.common.data.LabelType category ( int pos , java.lang.String id , java.lang.String name , com.google.gerrit.common.data.LabelValue ... values ) { com.google.gerrit.common.data.LabelType type = new com.google.gerrit.common.data.LabelType ( name , java.util.Arrays.asList ( values ) ) ; type.setId ( id ) ; type.setPosition ( ( ( short ) ( pos ) ) ) ; return type ; }

Target:
private static com.google.gerrit.common.data.LabelType category ( java.lang.String id , java.lang.String name , com.google.gerrit.common.data.LabelValue ... values ) { return new com.google.gerrit.common.data.LabelType ( id , name , java.util.Arrays.asList ( values ) ) ; }
Source:
public static boolean canFastForward ( final com.google.gerrit.server.git.MergeSorter mergeSorter , final com.google.gerrit.server.git.CodeReviewCommit mergeTip , final org.eclipse.jgit.revwalk.RevWalk rw , final com.google.gerrit.server.git.CodeReviewCommit toMerge ) throws com.google.gerrit.server.git.MergeException { if ( com.google.gerrit.server.git.MergeUtil.hasMissingDependencies ( mergeSorter , toMerge ) ) { return false ; } try { return ( mergeTip == null ) || ( rw.isMergedInto ( mergeTip , toMerge ) ) ; } catch ( java.io.IOException e ) { throw new com.google.gerrit.server.git.MergeException ( "Cannot fast-forward test during merge" , e ) ; } }

Target:
public boolean canFastForward ( final com.google.gerrit.server.git.MergeSorter mergeSorter , final com.google.gerrit.server.git.CodeReviewCommit mergeTip , final org.eclipse.jgit.revwalk.RevWalk rw , final com.google.gerrit.server.git.CodeReviewCommit toMerge ) throws com.google.gerrit.server.git.MergeException { if ( hasMissingDependencies ( mergeSorter , toMerge ) ) { return false ; } try { return ( mergeTip == null ) || ( rw.isMergedInto ( mergeTip , toMerge ) ) ; } catch ( java.io.IOException e ) { throw new com.google.gerrit.server.git.MergeException ( "Cannot fast-forward test during merge" , e ) ; } }
Source:
public void delete ( com.google.gerrit.reviewdb.client.Project project , boolean preserveGitRepository ) throws java.io.IOException , org.eclipse.jgit.errors.RepositoryNotFoundException { final org.eclipse.jgit.lib.Repository repository = repoManager.openRepository ( project.getNameKey ( ) ) ; if ( repository == null ) { throw new org.eclipse.jgit.errors.RepositoryNotFoundException ( "There was an error finding the project." ) ; } cleanCache ( repository ) ; if ( ! preserveGitRepository ) { deleteGitRepository ( project.getNameKey ( ) , repository ) ; } }

Target:
public void delete ( com.google.gerrit.reviewdb.client.Project project , boolean preserveGitRepository ) throws java.io.IOException , org.eclipse.jgit.errors.RepositoryNotFoundException { org.eclipse.jgit.lib.Repository repository = repoManager.openRepository ( project.getNameKey ( ) ) ; cleanCache ( repository ) ; if ( ! preserveGitRepository ) { deleteGitRepository ( project.getNameKey ( ) , repository ) ; } }
Source:
private void toGerrit ( final java.lang.String target , final javax.servlet.http.HttpServletRequest req , final javax.servlet.http.HttpServletResponse rsp ) throws java.io.IOException { final java.lang.StringBuilder url = new java.lang.StringBuilder ( ) ; url.append ( req.getContextPath ( ) ) ; url.append ( '/' ) ; url.append ( '#' ) ; url.append ( target ) ; rsp.sendRedirect ( url.toString ( ) ) ; }

Target:
static void toGerrit ( final java.lang.String target , final javax.servlet.http.HttpServletRequest req , final javax.servlet.http.HttpServletResponse rsp ) throws java.io.IOException { final java.lang.StringBuilder url = new java.lang.StringBuilder ( ) ; url.append ( req.getContextPath ( ) ) ; url.append ( '/' ) ; url.append ( '#' ) ; url.append ( target ) ; rsp.sendRedirect ( url.toString ( ) ) ; }
Source:
private com.google.gerrit.sshd.SshSession newSession ( ) { final java.net.SocketAddress peer ; if ( ( peerAddress ) == null ) { peer = session.get ( ) . getRemoteAddress ( ) ; } else { peer = peerAddress ; } return new com.google.gerrit.sshd.SshSession ( session.get ( ) , peer , userFactory.create ( AccessPath.SSH_COMMAND , new com.google.inject.Provider < java.net.SocketAddress > ( ) { @ java.lang.Override public java.net.SocketAddress get ( ) { return peer ; } } , accountId ) ) ; }

Target:
private com.google.gerrit.sshd.SshSession newSession ( ) { final java.net.SocketAddress peer ; if ( ( peerAddress ) == null ) { peer = session.get ( ) . getRemoteAddress ( ) ; } else { peer = peerAddress ; } return new com.google.gerrit.sshd.SshSession ( session.get ( ) , peer , userFactory.create ( peer , accountId ) ) ; }
Source:
private org.asciidoctor.Attributes getAttributes ( com.googlesource.gerrit.plugins.xdocs.ConfigSection cfg , java.lang.String revision ) { org.asciidoctor.AttributesBuilder ab = org.asciidoctor.AttributesBuilder.attributes ( ) . tableOfContents ( cfg.getBoolean ( com.googlesource.gerrit.plugins.xdocs.XDocGlobalConfig.KEY_INCLUDE_TOC , true ) ) . sourceHighlighter ( "prettify" ) ; for ( java.lang.String name : attributes.stringPropertyNames ( ) ) { ab.attribute ( name , attributes.getProperty ( name ) ) ; } ab.attribute ( "last-update-label!" ) ; ab.attribute ( "revnumber" , revision ) ; return ab.get ( ) ; }

Target:
private org.asciidoctor.AttributesBuilder getAttributes ( com.googlesource.gerrit.plugins.xdocs.ConfigSection cfg , java.lang.String revision ) { org.asciidoctor.AttributesBuilder ab = org.asciidoctor.AttributesBuilder.attributes ( ) . tableOfContents ( cfg.getBoolean ( com.googlesource.gerrit.plugins.xdocs.XDocGlobalConfig.KEY_INCLUDE_TOC , true ) ) . sourceHighlighter ( "prettify" ) ; for ( java.lang.String name : attributes.stringPropertyNames ( ) ) { ab.attribute ( name , attributes.getProperty ( name ) ) ; } ab.attribute ( "last-update-label!" ) ; ab.attribute ( "revnumber" , revision ) ; return ab ; }
Source:
public void assertCanDelete ( com.google.gerrit.reviewdb.client.Project project ) throws java.lang.Exception { if ( db.submoduleSubscriptions ( ) . bySuperProjectProject ( project.getNameKey ( ) ) . iterator ( ) . hasNext ( ) ) { throw new java.lang.Exception ( "Project has subscribed submodules." ) ; } if ( db.submoduleSubscriptions ( ) . bySubmoduleProject ( project.getNameKey ( ) ) . iterator ( ) . hasNext ( ) ) { throw new java.lang.Exception ( "Project is subscribed by other projects." ) ; } }

Target:
public void assertCanDelete ( com.google.gerrit.reviewdb.client.Project project ) throws java.lang.Exception { if ( db.submoduleSubscriptions ( ) . bySubmoduleProject ( project.getNameKey ( ) ) . iterator ( ) . hasNext ( ) ) { throw new java.lang.Exception ( "Project is subscribed by other projects." ) ; } }
Source:
public void cannotGetDashboardWithInheritedForNonDefault ( ) throws java.lang.Exception { com.google.gerrit.extensions.api.projects.DashboardInfo info = createDashboard ( DashboardsCollection.DEFAULT_DASHBOARD_NAME , "test" ) ; exception.expect ( com.google.gerrit.extensions.restapi.BadRequestException.class ) ; exception.expectMessage ( "inherited flag can only be used with default" ) ; gApi.projects ( ) . name ( project.get ( ) ) . dashboard ( info.id ) . get ( true ) ; }

Target:
public void cannotGetDashboardWithInheritedForNonDefault ( ) throws java.lang.Exception { com.google.gerrit.extensions.api.projects.DashboardInfo info = createDashboard ( DashboardsCollection.DEFAULT_DASHBOARD_NAME , "test" ) ; exception.expect ( com.google.gerrit.extensions.restapi.BadRequestException.class ) ; exception.expectMessage ( "inherited flag can only be used with default" ) ; project ( ) . dashboard ( info.id ) . get ( true ) ; }
Source:
public boolean match ( final com.google.gerrit.server.query.change.ChangeData cd ) throws com.google.gwtorm.server.OrmException { if ( cd.fastIsVisibleTo ( user ) ) { return true ; } try { com.google.gerrit.reviewdb.client.Change c = cd.change ( db ) ; if ( c == null ) { return false ; } com.google.gerrit.server.project.ChangeControl cc = changeControl.controlFor ( c , user ) ; if ( cc.isVisible ( db.get ( ) ) ) { cd.cacheVisibleTo ( cc ) ; return true ; } } catch ( com.google.gerrit.server.project.NoSuchChangeException e ) { } return false ; }

Target:
public boolean match ( final com.google.gerrit.server.query.change.ChangeData cd ) throws com.google.gwtorm.server.OrmException { if ( cd.fastIsVisibleTo ( user ) ) { return true ; } try { com.google.gerrit.reviewdb.client.Change c = cd.change ( ) ; if ( c == null ) { return false ; } com.google.gerrit.server.project.ChangeControl cc = changeControl.controlFor ( c , user ) ; if ( cc.isVisible ( db.get ( ) ) ) { cd.cacheVisibleTo ( cc ) ; return true ; } } catch ( com.google.gerrit.server.project.NoSuchChangeException e ) { } return false ; }
Source:
static com.google.gerrit.server.auth.ldap.LdapType guessType ( final javax.naming.directory.DirContext ctx ) throws javax.naming.NamingException { final javax.naming.directory.SearchControls cons = new javax.naming.directory.SearchControls ( ) ; final javax.naming.NamingEnumeration < javax.naming.directory.SearchResult > res ; final javax.naming.directory.Attributes rootAtts = ctx.getAttributes ( "" ) ; javax.naming.directory.Attribute supported = rootAtts.get ( "supportedCapabilities" ) ; if ( ( supported != null ) && ( supported.contains ( "1.2.840.113556.1.4.800" ) ) ) { return new com.google.gerrit.server.auth.ldap.LdapType.ActiveDirectory ( rootAtts ) ; } return com.google.gerrit.server.auth.ldap.LdapType.RFC_2307 ; }

Target:
static com.google.gerrit.server.auth.ldap.LdapType guessType ( final javax.naming.directory.DirContext ctx ) throws javax.naming.NamingException { final javax.naming.directory.Attributes rootAtts = ctx.getAttributes ( "" ) ; javax.naming.directory.Attribute supported = rootAtts.get ( "supportedCapabilities" ) ; if ( ( supported != null ) && ( supported.contains ( "1.2.840.113556.1.4.800" ) ) ) { return new com.google.gerrit.server.auth.ldap.LdapType.ActiveDirectory ( rootAtts ) ; } return com.google.gerrit.server.auth.ldap.LdapType.RFC_2307 ; }
Source:
public com.google.gerrit.extensions.common.ChangeInfo format ( com.google.gerrit.server.change.RevisionResource rsrc ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.server.query.change.ChangeData cd = changeDataFactory.create ( db.get ( ) , rsrc.getControl ( ) ) ; return format ( cd , com.google.common.base.Optional.of ( rsrc.getPatchSet ( ) . getId ( ) ) ) ; }

Target:
public com.google.gerrit.extensions.common.ChangeInfo format ( com.google.gerrit.server.change.RevisionResource rsrc ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.server.query.change.ChangeData cd = changeDataFactory.create ( db.get ( ) , rsrc.getControl ( ) ) ; return format ( cd , com.google.common.base.Optional.of ( rsrc.getPatchSet ( ) . getId ( ) ) , true ) ; }
Source:
public < V > void newConstantMetric ( java.lang.String name , final V value , com.google.gerrit.metrics.Description desc ) { desc.setConstant ( ) ; @ java.lang.SuppressWarnings ( value = "unchecked" ) java.lang.Class < V > type = ( ( java.lang.Class < V > ) ( value.getClass ( ) ) ) ; final com.google.gerrit.metrics.CallbackMetric0 < V > metric = newCallbackMetric ( name , type , desc ) ; newTrigger ( metric , new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { metric.set ( value ) ; } } ) ; }

Target:
public < V > void newConstantMetric ( java.lang.String name , V value , com.google.gerrit.metrics.Description desc ) { desc.setConstant ( ) ; @ java.lang.SuppressWarnings ( value = "unchecked" ) java.lang.Class < V > type = ( ( java.lang.Class < V > ) ( value.getClass ( ) ) ) ; com.google.gerrit.metrics.CallbackMetric0 < V > metric = newCallbackMetric ( name , type , desc ) ; newTrigger ( metric , ( ) -> { metric.set ( value ) ; } ) ; }
Source:
public static void query ( com.google.gwtjsonrpc.common.AsyncCallback < com.google.gerrit.client.rpc.NativeList < com.google.gerrit.client.changes.ChangeList > > callback , java.lang.String ... queries ) { assert ( queries.length ) >= 2 ; com.google.gerrit.client.rpc.RestApi call = new com.google.gerrit.client.rpc.RestApi ( com.google.gerrit.client.changes.ChangeList.URI ) ; for ( java.lang.String q : queries ) { call.addParameterRaw ( "q" , com.google.gwtorm.client.KeyUtil.encode ( q ) ) ; } com.google.gerrit.client.changes.ChangeList.addOptions ( call , ListChangesOption.LABELS ) ; call.send ( callback ) ; }

Target:
public static void query ( com.google.gwtjsonrpc.common.AsyncCallback < com.google.gerrit.client.rpc.NativeList < com.google.gerrit.client.changes.ChangeList > > callback , java.lang.String ... queries ) { assert ( queries.length ) >= 2 ; com.google.gerrit.client.rpc.RestApi call = new com.google.gerrit.client.rpc.RestApi ( com.google.gerrit.client.changes.ChangeList.URI ) ; for ( java.lang.String q : queries ) { call.addParameterRaw ( "q" , com.google.gwtorm.client.KeyUtil.encode ( q ) ) ; } com.google.gerrit.client.changes.ChangeList.addOptions ( call , ListChangesOption.LABELS ) ; call.get ( callback ) ; }
Source:
public java.lang.Void call ( ) throws java.lang.Exception { for ( int i = 1 ; i < 100 ; i ++ ) { java.lang.String p = "p" + i ; createProject ( p ) ; com.google.gerrit.acceptance.GitUtil.cloneProject ( ( ( ( sshSession.getUrl ( ) ) + "/" ) + p ) ) ; } return null ; }

Target:
public java.lang.Void call ( ) throws java.lang.Exception { for ( int i = 1 ; i < 100 ; i ++ ) { java.lang.String p = "p" + i ; createProject ( p ) ; com.google.gerrit.acceptance.GitUtil.cloneProject ( new com.google.gerrit.reviewdb.client.Project.NameKey ( p ) , sshSession ) ; } return null ; }
Source:
public void run ( ) throws com.google.gerrit.sshd.commands.Failure { parseCommandLine ( ) ; java.lang.String v = com.google.gerrit.common.Version.getVersion ( ) ; if ( v == null ) { throw new com.google.gerrit.sshd.commands.Failure ( 1 , "fatal: version unavailable" ) ; } final java.io.PrintWriter stdout = toPrintWriter ( out ) ; stdout.println ( ( "gerrit version " + v ) ) ; stdout.flush ( ) ; }

Target:
protected void run ( ) throws com.google.gerrit.sshd.commands.Failure { java.lang.String v = com.google.gerrit.common.Version.getVersion ( ) ; if ( v == null ) { throw new com.google.gerrit.sshd.commands.Failure ( 1 , "fatal: version unavailable" ) ; } stdout.println ( ( "gerrit version " + v ) ) ; }
Source:
public void remove ( com.google.gerrit.common.data.AccessSection section ) { if ( section != null ) { com.google.gerrit.common.data.AccessSection a = accessSections.get ( section.getName ( ) ) ; if ( sectionsWithUnknownPermissions.contains ( a ) ) { accessSections.remove ( a ) ; } else { a.setPermissions ( new java.util.ArrayList < com.google.gerrit.common.data.Permission > ( ) ) ; } } }

Target:
public void remove ( com.google.gerrit.common.data.AccessSection section ) { if ( section != null ) { java.lang.String name = section.getName ( ) ; if ( sectionsWithUnknownPermissions.contains ( name ) ) { com.google.gerrit.common.data.AccessSection a = accessSections.get ( name ) ; a.setPermissions ( new java.util.ArrayList < com.google.gerrit.common.data.Permission > ( ) ) ; } else { accessSections.remove ( name ) ; } } }
Source:
public void testAppend_String ( ) { final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder b = new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) ; assertSame ( b , b.append ( ( ( java.lang.String ) ( null ) ) ) ) ; assertEquals ( "" , b.asString ( ) ) ; assertSame ( b , b.append ( "foo" ) ) ; assertSame ( b , b.append ( "bar" ) ) ; assertEquals ( "foobar" , b.asString ( ) ) ; }

Target:
public void testAppend_String ( ) { final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder b = new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) ; org.junit.Assert.assertSame ( b , b.append ( ( ( java.lang.String ) ( null ) ) ) ) ; org.junit.Assert.assertEquals ( "" , b.asString ( ) ) ; org.junit.Assert.assertSame ( b , b.append ( "foo" ) ) ; org.junit.Assert.assertSame ( b , b.append ( "bar" ) ) ; org.junit.Assert.assertEquals ( "foobar" , b.asString ( ) ) ; }
Source:
public boolean equals ( java.lang.Object o ) { com.google.gerrit.server.project.ProjectState.Grant grant = ( ( com.google.gerrit.server.project.ProjectState.Grant ) ( o ) ) ; return ( group.equals ( grant.group ) ) && ( pattern.equals ( grant.pattern ) ) ; }

Target:
public boolean equals ( java.lang.Object o ) { if ( o == null ) return false ; com.google.gerrit.server.project.ProjectState.Grant grant = ( ( com.google.gerrit.server.project.ProjectState.Grant ) ( o ) ) ; return ( group.equals ( grant.group ) ) && ( pattern.equals ( grant.pattern ) ) ; }
Source:
public com.google.gerrit.extensions.common.ChangeInfo get ( java.util.EnumSet < com.google.gerrit.extensions.client.ListChangesOption > s ) throws com.google.gerrit.extensions.restapi.RestApiException { try { com.google.gerrit.server.CurrentUser u = user.get ( ) ; if ( u.isIdentifiedUser ( ) ) { u.asIdentifiedUser ( ) . clearStarredChanges ( ) ; } return changeJson.create ( s ) . format ( change ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot retrieve change" , e ) ; } }

Target:
public com.google.gerrit.extensions.common.ChangeInfo get ( java.util.EnumSet < com.google.gerrit.extensions.client.ListChangesOption > s ) throws com.google.gerrit.extensions.restapi.RestApiException { try { if ( user.isIdentifiedUser ( ) ) { user.asIdentifiedUser ( ) . clearStarredChanges ( ) ; } return changeJson.create ( s ) . format ( change ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot retrieve change" , e ) ; } }
Source:
private void checkPermission ( ) throws com.google.gerrit.common.errors.PermissionDeniedException { com.google.gerrit.server.account.CapabilityControl ctl = userProvider.get ( ) . getCapabilities ( ) ; if ( ! ( ctl.canPerform ( ( ( ( pluginName ) + "-" ) + ( SaveReportCapability.ID ) ) ) ) ) { throw new com.google.gerrit.common.errors.PermissionDeniedException ( java.lang.String.format ( "%s does not have \"%s\" capability." , userProvider.get ( ) . getUserName ( ) , new com.googlesource.gerrit.plugins.verifystatus.SaveReportCapability ( ) . getDescription ( ) ) ) ; } }

Target:
private void checkPermission ( ) throws com.google.gerrit.common.errors.PermissionDeniedException { com.google.gerrit.server.account.CapabilityControl ctl = userProvider.get ( ) . getCapabilities ( ) ; if ( ! ( ctl.canPerform ( com.googlesource.gerrit.plugins.verifystatus.SaveReportCapability.getName ( pluginName ) ) ) ) { throw new com.google.gerrit.common.errors.PermissionDeniedException ( java.lang.String.format ( "%s does not have \"%s\" capability." , userProvider.get ( ) . getUserName ( ) , new com.googlesource.gerrit.plugins.verifystatus.SaveReportCapability ( ) . getDescription ( ) ) ) ; } }
Source:
public void onScreenLoad ( com.google.gerrit.client.ui.ScreenLoadEvent event ) { com.google.gerrit.client.ui.Screen screen = event.getScreen ( ) ; com.google.gerrit.reviewdb.client.Project.NameKey projectKey ; if ( screen instanceof com.google.gerrit.client.admin.ProjectScreen ) { projectKey = ( ( com.google.gerrit.client.admin.ProjectScreen ) ( screen ) ) . getProjectKey ( ) ; } else { projectKey = com.google.gerrit.client.admin.ProjectScreen.getSavedKey ( ) ; } if ( projectKey != null ) { setVisible ( true ) ; setTargetHistoryToken ( com.google.gerrit.client.Dispatcher.toProjectAdmin ( projectKey , panel ) ) ; } else { setVisible ( false ) ; } super . onScreenLoad ( event ) ; }

Target:
public void onScreenLoad ( com.google.gerrit.client.ui.ScreenLoadEvent event ) { com.google.gerrit.client.ui.Screen screen = event.getScreen ( ) ; com.google.gerrit.reviewdb.client.Project.NameKey projectKey ; if ( screen instanceof com.google.gerrit.client.admin.ProjectScreen ) { projectKey = ( ( com.google.gerrit.client.admin.ProjectScreen ) ( screen ) ) . getProjectKey ( ) ; } else { projectKey = com.google.gerrit.client.admin.ProjectScreen.getSavedKey ( ) ; } if ( projectKey != null ) { setVisible ( true ) ; onScreenLoad ( projectKey ) ; } else { setVisible ( false ) ; } super . onScreenLoad ( event ) ; }
Source:
public com.google.gerrit.server.notedb.ChangeNotes createFromIdOnlyWhenNoteDbDisabled ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Change.Id changeId ) throws com.google.gwtorm.server.OrmException { com.google.common.base.Preconditions.checkState ( ( ! ( args.migration.readChanges ( ) ) ) , ( "do not call" + " createFromIdOnlyWhenNoteDbDisabled when NoteDb is enabled" ) ) ; com.google.gerrit.reviewdb.client.Change change = com.google.gerrit.server.notedb.ChangeNotes.unwrap ( db ) . changes ( ) . get ( changeId ) ; com.google.common.base.Preconditions.checkNotNull ( change , "change %s not found in ReviewDb" , changeId ) ; return new com.google.gerrit.server.notedb.ChangeNotes ( args , change.getProject ( ) , change ) . load ( ) ; }

Target:
public com.google.gerrit.server.notedb.ChangeNotes createFromIdOnlyWhenNoteDbDisabled ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Change.Id changeId ) throws com.google.gwtorm.server.OrmException { com.google.common.base.Preconditions.checkState ( ( ! ( args.migration.readChanges ( ) ) ) , ( "do not call" + " createFromIdOnlyWhenNoteDbDisabled when NoteDb is enabled" ) ) ; com.google.gerrit.reviewdb.client.Change change = com.google.gerrit.server.notedb.ChangeNotes.unwrap ( db ) . changes ( ) . get ( changeId ) ; com.google.common.base.Preconditions.checkNotNull ( change , "change %s not found in ReviewDb" , changeId ) ; return new com.google.gerrit.server.notedb.ChangeNotes ( args , change ) . load ( ) ; }
Source:
public void review ( com.google.gerrit.extensions.api.changes.ReviewInput in ) throws com.google.gerrit.extensions.restapi.RestApiException { try { review.get ( ) . apply ( revision , in ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot post review" , e ) ; } catch ( java.io.IOException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot post review" , e ) ; } }

Target:
public void review ( com.google.gerrit.extensions.api.changes.ReviewInput in ) throws com.google.gerrit.extensions.restapi.RestApiException { try { review.get ( ) . apply ( revision , in ) ; } catch ( com.google.gwtorm.server.OrmException | java.io.IOException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot post review" , e ) ; } }
Source:
protected org.eclipse.jgit.lib.PersonIdent newAuthorIdent ( ) { com.google.gerrit.server.CurrentUser u = getUser ( ) ; if ( u instanceof com.google.gerrit.server.IdentifiedUser ) { return com.google.gerrit.server.notedb.ChangeNoteUtil.newIdent ( u.asIdentifiedUser ( ) . getAccount ( ) , when , serverIdent , anonymousCowardName ) ; } else if ( u instanceof com.google.gerrit.server.InternalUser ) { return serverIdent ; } throw new java.lang.IllegalStateException ( ) ; }

Target:
private org.eclipse.jgit.lib.PersonIdent newAuthorIdent ( ) { com.google.gerrit.server.CurrentUser u = getUser ( ) ; if ( u instanceof com.google.gerrit.server.IdentifiedUser ) { return com.google.gerrit.server.notedb.ChangeNoteUtil.newIdent ( u.asIdentifiedUser ( ) . getAccount ( ) , when , serverIdent , anonymousCowardName ) ; } else if ( u instanceof com.google.gerrit.server.InternalUser ) { return serverIdent ; } throw new java.lang.IllegalStateException ( ) ; }
Source:
public java.util.Map < java.lang.String , com.google.gerrit.extensions.common.GpgKeyInfo > listGpgKeys ( com.google.gerrit.server.account.AccountResource account ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.GpgException { try { return gpgKeys.list ( ) . apply ( account ) ; } catch ( com.google.gwtorm.server.OrmException | org.bouncycastle.openpgp.PGPException | java.io.IOException e ) { throw new com.google.gerrit.server.GpgException ( e ) ; } }

Target:
public java.util.Map < java.lang.String , com.google.gerrit.extensions.common.GpgKeyInfo > listGpgKeys ( com.google.gerrit.server.account.AccountResource account ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.GpgException { try { return gpgKeys.get ( ) . list ( ) . apply ( account ) ; } catch ( com.google.gwtorm.server.OrmException | org.bouncycastle.openpgp.PGPException | java.io.IOException e ) { throw new com.google.gerrit.server.GpgException ( e ) ; } }
Source:
private boolean isApprovalRemoved ( com.google.gerrit.reviewdb.client.PatchSet.Id psId , com.google.gerrit.reviewdb.client.Account.Id accountId , java.lang.String label ) { com.google.common.collect.Multimap < com.google.gerrit.reviewdb.client.Account.Id , java.lang.String > curr = removedApprovals.get ( psId ) ; if ( curr == null ) { return false ; } return curr.containsEntry ( accountId , label ) ; }

Target:
private boolean isApprovalRemoved ( com.google.gerrit.reviewdb.client.PatchSet.Id psId , com.google.gerrit.reviewdb.client.Account.Id accountId , java.lang.String label ) { com.google.common.collect.Multimap < com.google.gerrit.reviewdb.client.Account.Id , java.lang.String > curr = removedApprovals.get ( psId ) ; return ( curr != null ) && ( curr.containsEntry ( accountId , label ) ) ; }
Source:
public void getGrandChildProject_NotFound ( ) throws java.lang.Exception { com.google.gerrit.acceptance.SshSession sshSession = new com.google.gerrit.acceptance.SshSession ( server , admin ) ; com.google.gerrit.reviewdb.client.Project.NameKey child = new com.google.gerrit.reviewdb.client.Project.NameKey ( "p1" ) ; createProject ( child.get ( ) ) ; com.google.gerrit.reviewdb.client.Project.NameKey grandChild = new com.google.gerrit.reviewdb.client.Project.NameKey ( "p1.1" ) ; createProject ( grandChild.get ( ) , child ) ; sshSession.close ( ) ; assertChildNotFound ( allProjects , grandChild.get ( ) ) ; }

Target:
public void getGrandChildProject_NotFound ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Project.NameKey child = createProject ( "p1" ) ; com.google.gerrit.reviewdb.client.Project.NameKey grandChild = createProject ( "p1.1" , child ) ; assertChildNotFound ( allProjects , grandChild.get ( ) ) ; }
Source:
private org.eclipse.jgit.dircache.DirCache readTree ( org.eclipse.jgit.revwalk.RevTree tree ) throws java.io.IOException , org.eclipse.jgit.errors.IncorrectObjectTypeException , org.eclipse.jgit.errors.MissingObjectException { org.eclipse.jgit.dircache.DirCache dc = org.eclipse.jgit.dircache.DirCache.newInCore ( ) ; if ( tree != null ) { org.eclipse.jgit.dircache.DirCacheBuilder b = dc.builder ( ) ; b.addTree ( new byte [ 0 ] , DirCacheEntry.STAGE_0 , reader , tree ) ; b.finish ( ) ; } return dc ; }

Target:
protected org.eclipse.jgit.dircache.DirCache readTree ( org.eclipse.jgit.revwalk.RevTree tree ) throws java.io.IOException , org.eclipse.jgit.errors.IncorrectObjectTypeException , org.eclipse.jgit.errors.MissingObjectException { org.eclipse.jgit.dircache.DirCache dc = org.eclipse.jgit.dircache.DirCache.newInCore ( ) ; if ( tree != null ) { org.eclipse.jgit.dircache.DirCacheBuilder b = dc.builder ( ) ; b.addTree ( new byte [ 0 ] , DirCacheEntry.STAGE_0 , reader , tree ) ; b.finish ( ) ; } return dc ; }
Source:
private Account.Id parseIdent ( org.eclipse.jgit.revwalk.RevCommit commit ) throws org.eclipse.jgit.errors.ConfigInvalidException { java.lang.String email = commit.getCommitterIdent ( ) . getEmailAddress ( ) ; int at = email.indexOf ( '@' ) ; if ( at >= 0 ) { java.lang.String host = email.substring ( ( at + 1 ) , email.length ( ) ) ; java.lang.Integer id = com.google.common.primitives.Ints.tryParse ( email.substring ( 0 , at ) ) ; if ( ( id != null ) && ( host.equals ( com.google.gerrit.server.notedb.ChangeNoteUtil.GERRIT_PLACEHOLDER_HOST ) ) ) { return new com.google.gerrit.reviewdb.client.Account.Id ( id ) ; } } throw parseException ( "invalid committer, expected <id>@%s: %s" , com.google.gerrit.server.notedb.ChangeNoteUtil.GERRIT_PLACEHOLDER_HOST , email ) ; }

Target:
private Account.Id parseIdent ( org.eclipse.jgit.revwalk.RevCommit commit ) throws org.eclipse.jgit.errors.ConfigInvalidException { return parseIdent ( commit.getCommitterIdent ( ) ) ; }
Source:
protected void doGet ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse rsp ) throws java.io.IOException { com.google.gerrit.server.tools.ToolsCatalog.Entry ent = toc.get ( req.getPathInfo ( ) ) ; if ( ent == null ) { rsp.sendError ( javax.servlet.http.HttpServletResponse.SC_NOT_FOUND ) ; return ; } switch ( ent.getType ( ) ) { case FILE : doGetFile ( ent , req , rsp ) ; break ; case DIR : doGetDirectory ( ent , req , rsp ) ; break ; default : rsp.sendError ( javax.servlet.http.HttpServletResponse.SC_NOT_FOUND ) ; break ; } }

Target:
protected void doGet ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse rsp ) throws java.io.IOException { com.google.gerrit.server.tools.ToolsCatalog.Entry ent = toc.get ( req.getPathInfo ( ) ) ; if ( ent == null ) { rsp.sendError ( javax.servlet.http.HttpServletResponse.SC_NOT_FOUND ) ; return ; } switch ( ent.getType ( ) ) { case FILE : doGetFile ( ent , rsp ) ; break ; case DIR : doGetDirectory ( ent , req , rsp ) ; break ; default : rsp.sendError ( javax.servlet.http.HttpServletResponse.SC_NOT_FOUND ) ; break ; } }
Source:
public void testGetPassword ( ) throws java.lang.Exception { com.google.common.truth.Truth.assertThat ( getConfiguration ( ) . http ( ) . password ( ) ) . isEqualTo ( com.ericsson.gerrit.plugins.highavailability.ConfigurationTest.EMPTY ) ; globalPluginConfig.setString ( com.ericsson.gerrit.plugins.highavailability.Configuration.HTTP_SECTION , null , com.ericsson.gerrit.plugins.highavailability.Configuration.PASSWORD_KEY , com.ericsson.gerrit.plugins.highavailability.ConfigurationTest.PASS ) ; com.google.common.truth.Truth.assertThat ( getConfiguration ( ) . http ( ) . password ( ) ) . isEqualTo ( com.ericsson.gerrit.plugins.highavailability.ConfigurationTest.PASS ) ; }

Target:
public void testGetPassword ( ) throws java.lang.Exception { com.google.common.truth.Truth.assertThat ( getConfiguration ( ) . http ( ) . password ( ) ) . isEmpty ( ) ; globalPluginConfig.setString ( com.ericsson.gerrit.plugins.highavailability.Configuration.HTTP_SECTION , null , com.ericsson.gerrit.plugins.highavailability.Configuration.PASSWORD_KEY , com.ericsson.gerrit.plugins.highavailability.ConfigurationTest.PASS ) ; com.google.common.truth.Truth.assertThat ( getConfiguration ( ) . http ( ) . password ( ) ) . isEqualTo ( com.ericsson.gerrit.plugins.highavailability.ConfigurationTest.PASS ) ; }
Source:
public void testReadVarInt32 ( ) throws java.io.IOException { assertEquals ( 0 , com.google.gerrit.server.ioutil.BasicSerialization.readVarInt32 ( com.google.gerrit.server.ioutil.BasicSerializationTest.r ( com.google.gerrit.server.ioutil.BasicSerializationTest.b ( 0 ) ) ) ) ; assertEquals ( 3 , com.google.gerrit.server.ioutil.BasicSerialization.readVarInt32 ( com.google.gerrit.server.ioutil.BasicSerializationTest.r ( com.google.gerrit.server.ioutil.BasicSerializationTest.b ( 3 ) ) ) ) ; assertEquals ( 255 , com.google.gerrit.server.ioutil.BasicSerialization.readVarInt32 ( com.google.gerrit.server.ioutil.BasicSerializationTest.r ( com.google.gerrit.server.ioutil.BasicSerializationTest.b ( ( 128 | 127 ) , 1 ) ) ) ) ; }

Target:
public void testReadVarInt32 ( ) throws java.io.IOException { org.junit.Assert.assertEquals ( 0 , com.google.gerrit.server.ioutil.BasicSerialization.readVarInt32 ( com.google.gerrit.server.ioutil.BasicSerializationTest.r ( com.google.gerrit.server.ioutil.BasicSerializationTest.b ( 0 ) ) ) ) ; org.junit.Assert.assertEquals ( 3 , com.google.gerrit.server.ioutil.BasicSerialization.readVarInt32 ( com.google.gerrit.server.ioutil.BasicSerializationTest.r ( com.google.gerrit.server.ioutil.BasicSerializationTest.b ( 3 ) ) ) ) ; org.junit.Assert.assertEquals ( 255 , com.google.gerrit.server.ioutil.BasicSerialization.readVarInt32 ( com.google.gerrit.server.ioutil.BasicSerializationTest.r ( com.google.gerrit.server.ioutil.BasicSerializationTest.b ( ( 128 | 127 ) , 1 ) ) ) ) ; }
Source:
void setValue ( com.google.gerrit.client.rpc.NativeMap < com.google.gerrit.client.diff.FileInfo > fileMap , java.sql.Timestamp myLastReply , com.google.gerrit.client.rpc.NativeMap < com.google.gwt.core.client.JsArray < com.google.gerrit.client.changes.CommentInfo > > comments , com.google.gerrit.client.rpc.NativeMap < com.google.gwt.core.client.JsArray < com.google.gerrit.client.changes.CommentInfo > > drafts , com.google.gerrit.client.change.FileTable.Mode mode ) { com.google.gwt.core.client.JsArray < com.google.gerrit.client.diff.FileInfo > list = fileMap.values ( ) ; com.google.gerrit.client.diff.FileInfo.sortFileInfoByPath ( list ) ; com.google.gerrit.client.change.FileTable.DisplayCommand cmd = new com.google.gerrit.client.change.FileTable.DisplayCommand ( fileMap , list , myLastReply , comments , drafts , mode ) ; if ( cmd.execute ( ) ) { cmd.showProgressBar ( ) ; com.google.gwt.core.client.Scheduler.get ( ) . scheduleIncremental ( cmd ) ; } }

Target:
void setValue ( com.google.gerrit.client.rpc.NativeMap < com.google.gerrit.client.diff.FileInfo > fileMap , java.sql.Timestamp myLastReply , com.google.gerrit.client.rpc.NativeMap < com.google.gwt.core.client.JsArray < com.google.gerrit.client.changes.CommentInfo > > comments , com.google.gerrit.client.rpc.NativeMap < com.google.gwt.core.client.JsArray < com.google.gerrit.client.changes.CommentInfo > > drafts ) { com.google.gwt.core.client.JsArray < com.google.gerrit.client.diff.FileInfo > list = fileMap.values ( ) ; com.google.gerrit.client.diff.FileInfo.sortFileInfoByPath ( list ) ; com.google.gerrit.client.change.FileTable.DisplayCommand cmd = new com.google.gerrit.client.change.FileTable.DisplayCommand ( fileMap , list , myLastReply , comments , drafts ) ; if ( cmd.execute ( ) ) { cmd.showProgressBar ( ) ; com.google.gwt.core.client.Scheduler.get ( ) . scheduleIncremental ( cmd ) ; } }
Source:
public void copyMinScoreOnRework ( ) throws java.lang.Exception { codeReview.setCopyMinScore ( true ) ; saveLabelConfig ( ) ; com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; revision ( r ) . review ( com.google.gerrit.extensions.api.changes.ReviewInput.reject ( ) ) ; assertApproval ( r , ( - 2 ) ) ; r = amendChange ( r.getChangeId ( ) ) ; assertApproval ( r , ( - 2 ) ) ; }

Target:
public void copyMinScoreOnRework ( ) throws java.lang.Exception { codeReview.setCopyMinScore ( true ) ; saveLabelConfig ( ) ; com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; revision ( r ) . review ( com.google.gerrit.extensions.api.changes.ReviewInput.reject ( ) ) ; r = amendChange ( r.getChangeId ( ) ) ; assertApproval ( r , ( - 2 ) ) ; }
Source:
public com.google.gerrit.common.data.PermissionRule getRule ( com.google.gerrit.common.data.GroupReference group , boolean create ) { initRules ( ) ; for ( com.google.gerrit.common.data.PermissionRule r : rules ) { if ( com.google.gerrit.common.data.Permission.sameGroup ( r , group ) ) { return r ; } } if ( create ) { com.google.gerrit.common.data.PermissionRule r = new com.google.gerrit.common.data.PermissionRule ( group ) ; rules.add ( r ) ; return r ; } else { return null ; } }

Target:
public com.google.gerrit.common.data.PermissionRule getRule ( com.google.gerrit.common.data.GroupReference group , boolean create ) { initRules ( ) ; for ( com.google.gerrit.common.data.PermissionRule r : rules ) { if ( com.google.gerrit.common.data.Permission.sameGroup ( r , group ) ) { return r ; } } if ( create ) { com.google.gerrit.common.data.PermissionRule r = new com.google.gerrit.common.data.PermissionRule ( group ) ; rules.add ( r ) ; return r ; } return null ; }
Source:
void onEdit ( com.google.gwt.event.dom.client.ClickEvent e ) { e.stopPropagation ( ) ; com.google.gerrit.client.editor.EditScreen.scrollToLine ( comment.line ( ) ) ; java.lang.String token = com.google.gerrit.client.Dispatcher.toEditScreen ( psId , comment.path ( ) ) ; if ( ! ( com.google.gerrit.client.Gerrit.isSignedIn ( ) ) ) { com.google.gerrit.client.Gerrit.doSignIn ( token ) ; } else { com.google.gerrit.client.Gerrit.display ( token ) ; } }

Target:
void onEdit ( com.google.gwt.event.dom.client.ClickEvent e ) { e.stopPropagation ( ) ; java.lang.String t = com.google.gerrit.client.Dispatcher.toEditScreen ( psId , comment.path ( ) , comment.line ( ) ) ; if ( ! ( com.google.gerrit.client.Gerrit.isSignedIn ( ) ) ) { com.google.gerrit.client.Gerrit.doSignIn ( t ) ; } else { com.google.gerrit.client.Gerrit.display ( t ) ; } }
Source:
private com.google.gerrit.server.plugins.Plugin loadPlugin ( java.lang.String name , java.nio.file.Path srcPlugin , org.eclipse.jgit.internal.storage.file.FileSnapshot snapshot ) throws com.google.gerrit.server.plugins.InvalidPluginException { java.lang.String pluginName = srcPlugin.getFileName ( ) . toString ( ) ; if ( com.google.gerrit.server.plugins.PluginLoader.isUiPlugin ( pluginName ) ) { return loadJsPlugin ( name , srcPlugin , snapshot ) ; } else if ( serverPluginFactory.handles ( srcPlugin ) ) { return loadServerPlugin ( srcPlugin , snapshot ) ; } else { throw new com.google.gerrit.server.plugins.InvalidPluginException ( java.lang.String.format ( "Unsupported plugin type: %s" , srcPlugin.getFileName ( ) ) ) ; } }

Target:
private com.google.gerrit.server.plugins.Plugin loadPlugin ( java.lang.String name , java.nio.file.Path srcPlugin , org.eclipse.jgit.internal.storage.file.FileSnapshot snapshot ) throws com.google.gerrit.server.plugins.InvalidPluginException { java.lang.String pluginName = srcPlugin.getFileName ( ) . toString ( ) ; if ( isUiPlugin ( pluginName ) ) { return loadJsPlugin ( name , srcPlugin , snapshot ) ; } else if ( serverPluginFactory.handles ( srcPlugin ) ) { return loadServerPlugin ( srcPlugin , snapshot ) ; } else { throw new com.google.gerrit.server.plugins.InvalidPluginException ( java.lang.String.format ( "Unsupported plugin type: %s" , srcPlugin.getFileName ( ) ) ) ; } }
Source:
private static boolean getBooleanParam ( com.google.gitiles.GitilesView view , java.lang.String name ) { java.util.List < java.lang.String > values = view.getParameters ( ) . get ( name ) ; return ( ! ( values.isEmpty ( ) ) ) && ( ( values.get ( 0 ) . equals ( "" ) ) || ( values.get ( 0 ) . equals ( "1" ) ) ) ; }

Target:
private static boolean getBooleanParam ( com.google.gitiles.GitilesView view , java.lang.String name ) { java.util.List < java.lang.String > values = view.getParameters ( ) . get ( name ) ; return ( ! ( values.isEmpty ( ) ) ) && ( ( values.get ( 0 ) . isEmpty ( ) ) || ( values.get ( 0 ) . equals ( "1" ) ) ) ; }
Source:
public com.google.gerrit.extensions.common.ProjectInfo apply ( com.google.gerrit.server.project.ChildProjectResource rsrc ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException { if ( ( recursive ) || ( rsrc.isDirectChild ( ) ) ) { return json.format ( rsrc.getChild ( ) . getProject ( ) ) ; } throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( rsrc.getChild ( ) . getProject ( ) . getName ( ) ) ; }

Target:
public com.google.gerrit.extensions.common.ProjectInfo apply ( com.google.gerrit.server.project.ChildProjectResource rsrc ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException { if ( ( recursive ) || ( rsrc.isDirectChild ( ) ) ) { return json.format ( rsrc.getChild ( ) . getProject ( ) ) ; } throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( rsrc.getChild ( ) . getName ( ) ) ; }