auphong2707/dl4se-code-review-dataset huggingface dataset:
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.setSubject ( "Submit patch set 1" ) ; update.submit ( 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: submitted\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.setSubject ( "Submit patch set 1" ) ; update.submit ( 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" ) + "Submitted-with: RULE_ERROR Problem with patch set: 1\n" ) ) , update.getRevision ( ) ) ; }
Source:
public void onFailure ( final java.lang.Throwable caught ) { text.setReadOnly ( false ) ; text.setFocus ( true ) ; save.setEnabled ( true ) ; cancel.setEnabled ( true ) ; discard.setEnabled ( true ) ; super . onFailure ( caught ) ; onSave.onFailure ( caught ) ; }

Target:
public void onFailure ( final java.lang.Throwable caught ) { text.setReadOnly ( false ) ; text.setFocus ( true ) ; save.setEnabled ( true ) ; cancel.setEnabled ( true ) ; discard.setEnabled ( true ) ; lc.setInlineComment ( com.google.gerrit.client.patches.CommentEditorPanel.toInput ( comment ) ) ; super . onFailure ( caught ) ; onSave.onFailure ( caught ) ; }
Source:
public boolean isVisible ( ) { return ( ( ( ( user.isInternalUser ( ) ) || ( groupBackend.isVisibleToAll ( group.getGroupUUID ( ) ) ) ) || ( user.getEffectiveGroups ( ) . contains ( group.getGroupUUID ( ) ) ) ) || ( user.getCapabilities ( ) . isAdmin_DoNotUse ( ) ) ) || ( isOwner ( ) ) ; }

Target:
public boolean isVisible ( ) { return ( ( ( ( user.isInternalUser ( ) ) || ( groupBackend.isVisibleToAll ( group.getGroupUUID ( ) ) ) ) || ( user.getEffectiveGroups ( ) . contains ( group.getGroupUUID ( ) ) ) ) || ( isOwner ( ) ) ) || ( canAdministrateServer ( ) ) ; }
Source:
static com.google.gerrit.server.project.SectionSortCache.EntryKey create ( java.lang.String refName , java.util.List < com.google.gerrit.common.data.AccessSection > sections ) { int hc = refName.hashCode ( ) ; java.util.List < java.lang.String > patterns = new java.util.ArrayList ( sections.size ( ) ) ; for ( com.google.gerrit.common.data.AccessSection s : sections ) { java.lang.String n = s.getName ( ) ; patterns.add ( n ) ; hc = ( hc * 31 ) + ( n.hashCode ( ) ) ; } return new com.google.gerrit.server.project.AutoValue_SectionSortCache_EntryKey ( refName , com.google.common.collect.ImmutableList.copyOf ( patterns ) , hc ) ; }

Target:
static com.google.gerrit.server.permissions.SectionSortCache.EntryKey create ( java.lang.String refName , java.util.List < com.google.gerrit.common.data.AccessSection > sections ) { int hc = refName.hashCode ( ) ; java.util.List < java.lang.String > patterns = new java.util.ArrayList ( sections.size ( ) ) ; for ( com.google.gerrit.common.data.AccessSection s : sections ) { java.lang.String n = s.getName ( ) ; patterns.add ( n ) ; hc = ( hc * 31 ) + ( n.hashCode ( ) ) ; } return new com.google.gerrit.server.permissions.AutoValue_SectionSortCache_EntryKey ( refName , com.google.common.collect.ImmutableList.copyOf ( patterns ) , hc ) ; }
Source:
public java.util.Set < java.lang.Class < ? > > eval ( java.io.File scalaFile ) throws java.io.IOException , java.lang.ClassNotFoundException { if ( scalaFile.isFile ( ) ) { return evalFiles ( java.util.Arrays.asList ( scalaFile ) ) ; } else if ( scalaFile.isDirectory ( ) ) { return evalDirectory ( scalaFile ) ; } else { throw new java.io.IOException ( ( ( "File " + scalaFile ) + " is not a supported for loading Scala scripts" ) ) ; } }

Target:
public java.util.Set < java.lang.Class < ? > > eval ( java.nio.file.Path scalaFile ) throws java.io.IOException , java.lang.ClassNotFoundException { if ( java.nio.file.Files.isRegularFile ( scalaFile ) ) { return evalFiles ( java.util.Arrays.asList ( scalaFile ) ) ; } else if ( java.nio.file.Files.isDirectory ( scalaFile ) ) { return evalDirectory ( scalaFile ) ; } else { throw new java.io.IOException ( ( ( "File " + scalaFile ) + " is not a supported for loading Scala scripts" ) ) ; } }
Source:
public void parsePatchSetGroups ( ) throws java.lang.Exception { assertParseSucceeds ( ( "Update change\n" + ( ( ( ( ( ( "\n" + "Patch-set: 1\n" ) + "Branch: refs/heads/master\n" ) + "Change-id: I577fb248e474018276351785930358ec0450e9f7\n" ) + "Commit: abcd1234abcd1234abcd1234abcd1234abcd1234\n" ) + "Subject: Change subject\n" ) + "Groups: a,b,c\n" ) ) ) ; assertParseFails ( ( "Update change\n" + ( ( ( ( "\n" + "Patch-set: 1\n" ) + "Branch: refs/heads/master\n" ) + "Subject: Change subject\n" ) + "Groups: a,b,c\n" ) ) ) ; assertParseFails ( ( "Update change\n" + ( ( ( ( ( ( "\n" + "Patch-set: 1\n" ) + "Branch: refs/heads/master\n" ) + "Commit: abcd1234abcd1234abcd1234abcd1234abcd1234\n" ) + "Subject: Change subject\n" ) + "Groups: a,b,c\n" ) + "Groups: d,e,f\n" ) ) ) ; }

Target:
public void parsePatchSetGroups ( ) throws java.lang.Exception { assertParseSucceeds ( ( "Update change\n" + ( ( ( ( ( ( "\n" + "Patch-set: 2\n" ) + "Branch: refs/heads/master\n" ) + "Change-id: I577fb248e474018276351785930358ec0450e9f7\n" ) + "Commit: abcd1234abcd1234abcd1234abcd1234abcd1234\n" ) + "Subject: Change subject\n" ) + "Groups: a,b,c\n" ) ) ) ; assertParseFails ( ( "Update change\n" + ( ( ( ( ( ( "\n" + "Patch-set: 2\n" ) + "Branch: refs/heads/master\n" ) + "Commit: abcd1234abcd1234abcd1234abcd1234abcd1234\n" ) + "Subject: Change subject\n" ) + "Groups: a,b,c\n" ) + "Groups: d,e,f\n" ) ) ) ; }
Source:
public void includeExistingGroup_OK ( ) throws java.lang.Exception { group ( "newGroup" ) ; PUT ( "/groups/Administrators/groups/newGroup" ) . consume ( ) ; com.google.common.truth.Truth.assertThat ( PUT ( "/groups/Administrators/groups/newGroup" ) . getStatusCode ( ) ) . isEqualTo ( HttpStatus.SC_OK ) ; }

Target:
public void includeExistingGroup_OK ( ) throws java.lang.Exception { java.lang.String p = group ( "parent" ) ; java.lang.String g = group ( "newGroup" ) ; PUT ( ( ( ( "/groups/" + p ) + "/groups/" ) + g ) ) . consume ( ) ; com.google.common.truth.Truth.assertThat ( PUT ( ( ( ( "/groups/" + p ) + "/groups/" ) + g ) ) . getStatusCode ( ) ) . isEqualTo ( HttpStatus.SC_OK ) ; }
Source:
public void queryChangesOneTerm ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r1 = createChange ( ) ; com.google.gerrit.acceptance.PushOneCommit.Result r2 = createChange ( ) ; java.util.List < com.google.gerrit.extensions.common.ChangeInfo > results = query ( "status:open" ) ; com.google.common.truth.Truth.assertThat ( results ) . hasSize ( 2 ) ; com.google.common.truth.Truth.assertThat ( results.get ( 0 ) . changeId ) . isEqualTo ( r2.getChangeId ( ) ) ; com.google.common.truth.Truth.assertThat ( results.get ( 1 ) . changeId ) . isEqualTo ( r1.getChangeId ( ) ) ; }

Target:
public void queryChangesNoResults ( ) throws java.lang.Exception { createChange ( ) ; com.google.common.truth.Truth.assertThat ( query ( "message:test" ) ) . isNotEmpty ( ) ; com.google.common.truth.Truth.assertThat ( query ( ( ( "message:{" + ( getClass ( ) . getName ( ) ) ) + "fhqwhgads}" ) ) ) . isEmpty ( ) ; }
Source:
public java.lang.String select ( final java.lang.String title , java.lang.String name , java.lang.String dv , java.util.Set < java.lang.String > allowedValues ) { final java.lang.String ov = get ( name ) ; java.lang.String nv = ui.readString ( ( ov != null ? ov : dv ) , allowedValues , "%s" , title ) ; if ( ! ( com.google.gerrit.pgm.init.api.Section.eq ( ov , nv ) ) ) { set ( name , nv ) ; } return nv ; }

Target:
public java.lang.String select ( final java.lang.String title , java.lang.String name , java.lang.String dv , java.util.Set < java.lang.String > allowedValues ) { final java.lang.String ov = get ( name ) ; java.lang.String nv = ui.readString ( ( ov != null ? ov : dv ) , allowedValues , "%s" , title ) ; if ( ! ( java.util.Objects.equals ( ov , nv ) ) ) { set ( name , nv ) ; } return nv ; }
Source:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { label.setVisible ( false ) ; edit.setVisible ( false ) ; input.setVisible ( true ) ; save.setVisible ( true ) ; cancel.setVisible ( true ) ; }

Target:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { label.setVisible ( false ) ; edit.setVisible ( false ) ; input.setVisible ( true ) ; save.setVisible ( true ) ; if ( ( warning ) != null ) { warning.setVisible ( true ) ; } cancel.setVisible ( true ) ; }
Source:
void notifyStarting ( com.googlesource.gerrit.plugins.replication.PushOne op ) { synchronized ( pending ) { if ( ! ( op.wasCanceled ( ) ) ) { pending.remove ( op.getURI ( ) ) ; } } }

Target:
boolean requestRunway ( com.googlesource.gerrit.plugins.replication.PushOne op ) { synchronized ( stateLock ) { if ( op.wasCanceled ( ) ) { return false ; } pending.remove ( op.getURI ( ) ) ; if ( inFlight.containsKey ( op.getURI ( ) ) ) { return false ; } inFlight.put ( op.getURI ( ) , op ) ; } return true ; }
Source:
private static com.google.gerrit.extensions.restapi.BinaryResult compress ( com.google.gerrit.extensions.restapi.BinaryResult bin ) throws java.io.IOException { org.eclipse.jgit.util.TemporaryBuffer.Heap buf = com.google.gerrit.httpd.restapi.RestApiServlet.heap ( ( 20 << 20 ) ) ; java.util.zip.GZIPOutputStream gz = new java.util.zip.GZIPOutputStream ( buf ) ; bin.writeTo ( gz ) ; gz.close ( ) ; return com.google.gerrit.httpd.restapi.RestApiServlet.asBinaryResult ( buf ) . setContentType ( bin.getContentType ( ) ) ; }

Target:
private static com.google.gerrit.extensions.restapi.BinaryResult compress ( com.google.gerrit.extensions.restapi.BinaryResult bin ) throws java.io.IOException { org.eclipse.jgit.util.TemporaryBuffer.Heap buf = com.google.gerrit.httpd.restapi.RestApiServlet.heap ( com.google.gerrit.httpd.restapi.RestApiServlet.HEAP_EST_SIZE , ( 20 << 20 ) ) ; java.util.zip.GZIPOutputStream gz = new java.util.zip.GZIPOutputStream ( buf ) ; bin.writeTo ( gz ) ; gz.close ( ) ; return com.google.gerrit.httpd.restapi.RestApiServlet.asBinaryResult ( buf ) . setContentType ( bin.getContentType ( ) ) ; }
Source:
public java.lang.Iterable < com.google.gerrit.server.WebLinks.Link > getProjectLinks ( java.lang.String project ) { java.util.List < com.google.gerrit.server.WebLinks.Link > links = com.google.common.collect.Lists.newArrayList ( ) ; for ( com.google.gerrit.extensions.webui.ProjectWebLink webLink : projectLinks ) { links.add ( new com.google.gerrit.server.WebLinks.Link ( webLink.getLinkName ( ) , webLink.getProjectUrl ( project ) ) ) ; } return links ; }

Target:
public java.lang.Iterable < com.google.gerrit.extensions.common.WebLinkInfo > getProjectLinks ( java.lang.String project ) { java.util.List < com.google.gerrit.extensions.common.WebLinkInfo > links = com.google.common.collect.Lists.newArrayList ( ) ; for ( com.google.gerrit.extensions.webui.ProjectWebLink webLink : projectLinks ) { links.add ( new com.google.gerrit.extensions.common.WebLinkInfo ( webLink.getLinkName ( ) , webLink.getProjectUrl ( project ) ) ) ; } return links ; }
Source:
private void initHttpd ( ) { webInjector = createWebInjector ( ) ; sysInjector.getInstance ( com.google.gerrit.httpd.HttpCanonicalWebUrlProvider.class ) . setHttpServletRequest ( webInjector.getProvider ( javax.servlet.http.HttpServletRequest.class ) ) ; httpdInjector = createHttpdInjector ( ) ; manager.add ( webInjector , httpdInjector ) ; }

Target:
private void initHttpd ( ) { webInjector = createWebInjector ( ) ; sysInjector.getInstance ( com.google.gerrit.server.plugins.PluginGuiceEnvironment.class ) . setHttpInjector ( webInjector ) ; sysInjector.getInstance ( com.google.gerrit.httpd.HttpCanonicalWebUrlProvider.class ) . setHttpServletRequest ( webInjector.getProvider ( javax.servlet.http.HttpServletRequest.class ) ) ; httpdInjector = createHttpdInjector ( ) ; manager.add ( webInjector , httpdInjector ) ; }
Source:
public void setTopView ( com.google.gerrit.client.patches.PatchScreen.TopView tv ) { topPanel.clear ( ) ; switch ( tv ) { case COMMIT : topPanel.add ( commitMessageBlock ) ; break ; case PREFERENCES : topPanel.add ( settingsPanel ) ; break ; case PATCH_SETS : topPanel.add ( historyTable ) ; break ; case FILES : topPanel.add ( fileList ) ; break ; } }

Target:
public void setTopView ( com.google.gerrit.client.patches.PatchScreen.TopView tv ) { topView = tv ; topPanel.clear ( ) ; switch ( tv ) { case COMMIT : topPanel.add ( commitMessageBlock ) ; break ; case PREFERENCES : topPanel.add ( settingsPanel ) ; break ; case PATCH_SETS : topPanel.add ( historyTable ) ; break ; case FILES : topPanel.add ( fileList ) ; break ; } }
Source:
private void disableChangeCache ( ) { globalConfig.setLong ( "cache" , "changes" , "maximumWeight" , 0 ) ; }

Target:
private void overrideConfig ( ) { if ( ( com.google.gerrit.server.index.IndexModule.getIndexType ( dbInjector ) ) == ( com.google.gerrit.server.index.IndexModule.IndexType.LUCENE ) ) { globalConfig.setLong ( "index" , "changes_open" , "commitWithin" , ( - 1 ) ) ; globalConfig.setLong ( "index" , "changes_closed" , "commitWithin" , ( - 1 ) ) ; } globalConfig.setLong ( "cache" , "changes" , "maximumWeight" , 0 ) ; globalConfig.setBoolean ( "index" , null , "autoReindexIfStale" , false ) ; }
Source:
private void setDefaultBlameCache ( ) { if ( ( blameCache ) == null ) { if ( config.getSubsections ( "cache" ) . contains ( "blame" ) ) { blameCache = new com.google.gitiles.BlameCacheImpl ( com.google.gitiles.ConfigUtil.getCacheBuilder ( config , "blame" ) ) ; } else { blameCache = new com.google.gitiles.BlameCacheImpl ( ) ; } } }

Target:
private void setDefaultBlameCache ( ) { if ( ( blameCache ) == null ) { if ( config.getSubsections ( "cache" ) . contains ( "blame" ) ) { blameCache = new com.google.gitiles.BlameCacheImpl ( com.google.gitiles.ConfigUtil.getCacheBuilder ( com.google.gitiles.BlameCacheImpl.newBuilder ( ) , config , "blame" ) ) ; } else { blameCache = new com.google.gitiles.BlameCacheImpl ( ) ; } } }
Source:
public void clearReviewed ( com.google.gerrit.reviewdb.client.PatchSet.Id psId ) throws com.google.gwtorm.server.OrmException { java.sql.Connection con = ds.getConnection ( ) ; java.sql.PreparedStatement stmt = HEAD ( ( b67f80 ? JestClientBuilder : Format ( ( ( ( google ) - ( java ) ) - ( format ) ) ) ) ) . prepareStatement ( ( "DELETE FROM ACCOUNT_PATCH_REVIEWS " + "WHERE CHANGE_ID + ? AND PATCH_SET_ID = ?" ) ) ; }

Target:
public void clearReviewed ( com.google.gerrit.reviewdb.client.PatchSet.Id psId ) throws com.google.gwtorm.server.OrmException { try ( java.sql.Connection con = ds.getConnection ( ) ; java.sql.PreparedStatement stmt = con.prepareStatement ( ( "DELETE FROM account_patch_reviews " + "WHERE change_id = ? AND patch_set_id = ?" ) ) ) { stmt.setInt ( 1 , psId.getParentKey ( ) . get ( ) ) ; stmt.setInt ( 2 , psId.get ( ) ) ; stmt.executeUpdate ( ) ; } catch ( java.sql.SQLException e ) { throw com.google.gerrit.server.schema.H2AccountPatchReviewStore.convertError ( "delete" , e ) ; } }
Source:
private org.eclipse.jgit.treewalk.CanonicalTreeParser getOnlyChildSubtree ( org.eclipse.jgit.revwalk.RevWalk rw , org.eclipse.jgit.lib.ObjectId id , byte [ ] prefix ) throws java.io.IOException { org.eclipse.jgit.treewalk.CanonicalTreeParser p = new org.eclipse.jgit.treewalk.CanonicalTreeParser ( prefix , rw.getObjectReader ( ) , id ) ; if ( ( p.eof ( ) ) || ( ( p.getEntryFileMode ( ) ) != ( org.eclipse.jgit.lib.FileMode.TREE ) ) ) { return null ; } p.next ( 1 ) ; return p.eof ( ) ? p : null ; }

Target:
private org.eclipse.jgit.treewalk.CanonicalTreeParser getOnlyChildSubtree ( org.eclipse.jgit.lib.ObjectReader reader , org.eclipse.jgit.lib.ObjectId id , byte [ ] prefix ) throws java.io.IOException { org.eclipse.jgit.treewalk.CanonicalTreeParser p = new org.eclipse.jgit.treewalk.CanonicalTreeParser ( prefix , reader , id ) ; if ( ( p.eof ( ) ) || ( ( p.getEntryFileMode ( ) ) != ( org.eclipse.jgit.lib.FileMode.TREE ) ) ) { return null ; } p.next ( 1 ) ; return p.eof ( ) ? p : null ; }
Source:
private void checkCreateCommit ( com.google.inject.Provider < ? extends com.google.gerrit.server.CurrentUser > user , org.eclipse.jgit.lib.Repository repo , org.eclipse.jgit.revwalk.RevCommit commit , com.google.gerrit.server.project.ProjectState projectState , com.google.gerrit.server.permissions.PermissionBackend.ForRef forRef ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.server.permissions.PermissionBackendException { try { forRef.check ( RefPermission.UPDATE ) ; return ; } catch ( com.google.gerrit.extensions.restapi.AuthException denied ) { } if ( projectState.controlFor ( user.get ( ) ) . isReachableFromHeadsOrTags ( repo , commit ) ) { return ; } throw new com.google.gerrit.extensions.restapi.AuthException ( java.lang.String.format ( "%s for creating new commit object not permitted" , RefPermission.UPDATE.describeForException ( ) ) ) ; }

Target:
private void checkCreateCommit ( org.eclipse.jgit.lib.Repository repo , org.eclipse.jgit.revwalk.RevCommit commit , com.google.gerrit.server.project.ProjectState projectState , com.google.gerrit.server.permissions.PermissionBackend.ForRef forRef ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.server.permissions.PermissionBackendException { try { forRef.check ( RefPermission.UPDATE ) ; return ; } catch ( com.google.gerrit.extensions.restapi.AuthException denied ) { } if ( reachable.fromHeadsOrTags ( projectState , repo , commit ) ) { return ; } throw new com.google.gerrit.extensions.restapi.AuthException ( java.lang.String.format ( "%s for creating new commit object not permitted" , RefPermission.UPDATE.describeForException ( ) ) ) ; }
Source:
private static void configureDefault ( java.util.Map < java.lang.String , java.util.List < com.google.gerrit.common.data.PermissionRule > > res , com.google.gerrit.common.data.AccessSection section , java.lang.String capName , com.google.gerrit.common.data.GroupReference group ) { if ( ( section.getPermission ( capName ) ) == null ) { com.google.gerrit.common.data.PermissionRange.WithDefaults range = com.google.gerrit.common.data.GlobalCapability.getRange ( capName ) ; if ( range != null ) { com.google.gerrit.common.data.PermissionRule rule = new com.google.gerrit.common.data.PermissionRule ( group ) ; rule.setRange ( range.getDefaultMin ( ) , range.getDefaultMax ( ) ) ; res.put ( capName , java.util.Collections.singletonList ( rule ) ) ; } } }

Target:
private static boolean match ( java.util.Set < com.google.gerrit.reviewdb.AccountGroup.UUID > groups , com.google.gerrit.common.data.PermissionRule rule ) { return groups.contains ( rule.getGroup ( ) . getUUID ( ) ) ; }
Source:
public void addPatchSets ( com.google.gerrit.server.data.ChangeAttribute ca , java.util.Collection < com.google.gerrit.reviewdb.client.PatchSet > ps , java.util.Map < com.google.gerrit.reviewdb.client.PatchSet.Id , java.util.Collection < com.google.gerrit.reviewdb.client.PatchSetApproval > > approvals , com.google.gerrit.common.data.LabelTypes labelTypes ) { addPatchSets ( ca , ps , approvals , false , null , labelTypes ) ; }

Target:
public void addPatchSets ( com.google.gerrit.reviewdb.server.ReviewDb db , org.eclipse.jgit.revwalk.RevWalk revWalk , com.google.gerrit.server.data.ChangeAttribute ca , java.util.Collection < com.google.gerrit.reviewdb.client.PatchSet > ps , java.util.Map < com.google.gerrit.reviewdb.client.PatchSet.Id , java.util.Collection < com.google.gerrit.reviewdb.client.PatchSetApproval > > approvals , com.google.gerrit.common.data.LabelTypes labelTypes ) { addPatchSets ( db , revWalk , ca , ps , approvals , false , null , labelTypes ) ; }
Source:
private java.util.Map < java.lang.String , java.lang.Integer > getSingleSchemaVersions ( ) { java.util.Map < java.lang.String , java.lang.Integer > singleVersions = new java.util.HashMap < > ( ) ; putSchemaVersion ( singleVersions , AccountSchemaDefinitions.INSTANCE ) ; putSchemaVersion ( singleVersions , ChangeSchemaDefinitions.INSTANCE ) ; putSchemaVersion ( singleVersions , GroupSchemaDefinitions.INSTANCE ) ; return singleVersions ; }

Target:
private java.util.Map < java.lang.String , java.lang.Integer > getSingleSchemaVersions ( ) { java.util.Map < java.lang.String , java.lang.Integer > singleVersions = new java.util.HashMap < > ( ) ; putSchemaVersion ( singleVersions , AccountSchemaDefinitions.INSTANCE ) ; putSchemaVersion ( singleVersions , ChangeSchemaDefinitions.INSTANCE ) ; putSchemaVersion ( singleVersions , GroupSchemaDefinitions.INSTANCE ) ; putSchemaVersion ( singleVersions , ProjectSchemaDefinitions.INSTANCE ) ; return singleVersions ; }
Source:
protected void doRun ( ) throws java.io.IOException , org.eclipse.jgit.lfs.errors.LfsException { java.util.regex.Matcher matcher = com.googlesource.gerrit.plugins.lfs.locks.LfsGetLocksAction.LFS_LOCKS_URL.matcher ( context.path ) ; if ( matcher.matches ( ) ) { java.lang.String project = matcher.group ( 1 ) ; listLocks ( project ) ; } throw new org.eclipse.jgit.lfs.errors.LfsException ( ( "no repository at " + ( context.path ) ) ) ; }

Target:
protected void authorizeUser ( com.google.gerrit.server.project.ProjectControl control ) throws org.eclipse.jgit.lfs.errors.LfsUnauthorized { if ( ! ( control.isReadable ( ) ) ) { throwUnauthorizedOp ( "list locks" , control ) ; } }
Source:
static com.google.gerrit.server.patch.ComparisonType readFrom ( java.io.InputStream in ) throws java.io.IOException { int p = com.google.gerrit.server.ioutil.BasicSerialization.readVarInt32 ( in ) ; java.lang.Integer parentNum = ( p > 0 ) ? p : null ; boolean autoMerge = ( com.google.gerrit.server.ioutil.BasicSerialization.readVarInt32 ( in ) ) != 0 ; return new com.google.gerrit.server.patch.ComparisonType ( parentNum , autoMerge ) ; }

Target:
static com.google.gerrit.server.diff.ComparisonType readFrom ( java.io.InputStream in ) throws java.io.IOException { int p = com.google.gerrit.server.ioutil.BasicSerialization.readVarInt32 ( in ) ; java.lang.Integer parentNum = ( p > 0 ) ? p : null ; boolean autoMerge = ( com.google.gerrit.server.ioutil.BasicSerialization.readVarInt32 ( in ) ) != 0 ; return new com.google.gerrit.server.diff.ComparisonType ( parentNum , autoMerge ) ; }
Source:
public com.googlesource.gerrit.plugins.imagare.GetConfig.ConfigInfo apply ( com.google.gerrit.server.config.ConfigResource resource ) { com.googlesource.gerrit.plugins.imagare.GetConfig.ConfigInfo info = new com.googlesource.gerrit.plugins.imagare.GetConfig.ConfigInfo ( ) ; info.defaultProject = com.google.common.base.Objects.firstNonNull ( cfg.getString ( "defaultProject" ) , "All-Projects" ) ; info.linkDecoration = cfg.getEnum ( "linkDecoration" , LinkDecoration.NONE ) ; if ( LinkDecoration.NONE.equals ( info.linkDecoration ) ) { info.linkDecoration = null ; } return info ; }

Target:
public com.googlesource.gerrit.plugins.imagare.GetConfig.ConfigInfo apply ( com.google.gerrit.server.config.ConfigResource resource ) { com.googlesource.gerrit.plugins.imagare.GetConfig.ConfigInfo info = new com.googlesource.gerrit.plugins.imagare.GetConfig.ConfigInfo ( ) ; info.defaultProject = com.google.common.base.Objects.firstNonNull ( cfg.getString ( "defaultProject" ) , "All-Projects" ) ; info.linkDecoration = cfg.getEnum ( "linkDecoration" , LinkDecoration.NONE ) ; if ( LinkDecoration.NONE.equals ( info.linkDecoration ) ) { info.linkDecoration = null ; } info.stage = cfg.getBoolean ( "stage" , false ) ; if ( ! ( info.stage ) ) { info.stage = null ; } return info ; }
Source:
public void setUp ( ) throws java.lang.Exception { project = new com.google.gerrit.reviewdb.client.Project.NameKey ( "p2" ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { mergeResults = com.google.common.collect.Maps.newHashMap ( ) ; com.google.gerrit.server.CurrentUser listenerUser = factory.create ( user.id ) ; hooks.addChangeListener ( new com.google.gerrit.common.ChangeListener ( ) { @ java.lang.Override public void onChangeEvent ( com.google.gerrit.server.events.ChangeEvent event ) { if ( event instanceof com.google.gerrit.server.events.ChangeMergedEvent ) { com.google.gerrit.server.events.ChangeMergedEvent cMEvent = ( ( com.google.gerrit.server.events.ChangeMergedEvent ) ( event ) ) ; mergeResults.put ( cMEvent.change.number , cMEvent.newRev ) ; } } } , listenerUser ) ; project = new com.google.gerrit.reviewdb.client.Project.NameKey ( "p2" ) ; }
Source:
private void initMode ( ) { mode.addItem ( "" , "" ) ; for ( java.util.Map.Entry < java.lang.String , java.lang.String > e : com.google.gerrit.client.diff.PreferencesBox.NAME_TO_MODE.entrySet ( ) ) { mode.addItem ( e.getKey ( ) , e.getValue ( ) ) ; } }

Target:
private void initTheme ( ) { for ( com.google.gerrit.extensions.client.Theme t : com.google.gerrit.extensions.client.Theme.values ( ) ) { theme.addItem ( t.name ( ) . toLowerCase ( ) , t.name ( ) ) ; } }
Source:
public boolean isOwner ( ) { if ( canPerform ( com.google.gerrit.reviewdb.ApprovalCategory.OWN , ( ( short ) ( 1 ) ) ) ) { return true ; } if ( ( ! ( RefRight.ALL.equals ( getRefName ( ) ) ) ) && ( getProjectControl ( ) . isOwner ( ) ) ) { return true ; } return false ; }

Target:
public boolean isOwner ( ) { if ( canPerform ( com.google.gerrit.reviewdb.ApprovalCategory.OWN , ( ( short ) ( 1 ) ) ) ) { return true ; } if ( ( ! ( getRefName ( ) . equals ( RefRight.ALL.substring ( 0 , ( ( RefRight.ALL.length ( ) ) - 1 ) ) ) ) ) && ( getProjectControl ( ) . isOwner ( ) ) ) { return true ; } return false ; }
Source:
private void setDefaultRenderer ( javax.servlet.FilterConfig filterConfig ) { if ( ( renderer ) == null ) { renderer = new com.google.gitiles.DefaultRenderer ( ( ( filterConfig.getServletContext ( ) . getContextPath ( ) ) + ( com.google.gitiles.GitilesServlet.STATIC_PREFIX ) ) , com.google.common.collect.FluentIterable.from ( java.util.Arrays.asList ( config.getStringList ( "gitiles" , null , "customTemplates" ) ) ) . transform ( new com.google.gitiles.Renderer.FileUrlMapper ( ) ) , com.google.common.base.Objects.firstNonNull ( config.getString ( "gitiles" , null , "siteTitle" ) , "Gitiles" ) ) ; } }

Target:
private void setDefaultRenderer ( javax.servlet.FilterConfig filterConfig ) { if ( ( renderer ) == null ) { renderer = new com.google.gitiles.DefaultRenderer ( ( ( filterConfig.getServletContext ( ) . getContextPath ( ) ) + ( com.google.gitiles.GitilesServlet.STATIC_PREFIX ) ) , com.google.common.collect.FluentIterable.from ( java.util.Arrays.asList ( config.getStringList ( "gitiles" , null , "customTemplates" ) ) ) . transform ( new com.google.gitiles.Renderer.FileUrlMapper ( ) ) , com.google.common.base.MoreObjects.firstNonNull ( config.getString ( "gitiles" , null , "siteTitle" ) , "Gitiles" ) ) ; } }
Source:
private void doPerformAction ( java.lang.String issueKey , java.lang.String actionName ) throws com.googlesource.gerrit.plugins.its.base.its.InvalidTransitionException , java.io.IOException { log.debug ( "Trying to perform action: on issue {}" , actionName , issueKey ) ; boolean ret = client ( ) . doTransition ( issueKey , actionName ) ; if ( ret ) { log.debug ( "Action successful on Issue {}" , actionName , issueKey ) ; } else { log.debug ( "Action on Issue not possible" , actionName , issueKey ) ; } }

Target:
private void doPerformAction ( java.lang.String issueKey , java.lang.String actionName ) throws com.googlesource.gerrit.plugins.its.base.its.InvalidTransitionException , java.io.IOException { log.debug ( "Trying to perform action: on issue {}" , actionName , issueKey ) ; boolean ret = jiraClient.doTransition ( issueKey , actionName ) ; if ( ret ) { log.debug ( "Action successful on Issue {}" , actionName , issueKey ) ; } else { log.debug ( "Action on Issue not possible" , actionName , issueKey ) ; } }
Source:
private void printTree ( final com.google.gerrit.sshd.commands.TreeNode node , final int level , final boolean isLast ) { printNode ( node , level , isLast ) ; final java.util.SortedSet < ? extends com.google.gerrit.sshd.commands.TreeNode > childNodes = node.getChildren ( ) ; int i = 0 ; final int size = childNodes.size ( ) ; for ( final com.google.gerrit.sshd.commands.TreeNode childNode : childNodes ) { final boolean isLastChild = ( ++ i ) == size ; printTree ( childNode , ( level + 1 ) , isLastChild ) ; } }

Target:
public void printTree ( final com.google.gerrit.sshd.commands.TreeFormatter.TreeNode rootNode ) { printTree ( rootNode , 0 , true ) ; }
Source:
public void testRejectJavaScript_AnchorHref ( ) { final java.lang.String href = "javascript:window.close();" ; try { new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) . openAnchor ( ) . setAttribute ( "href" , href ) ; org.junit.Assert.fail ( "accepted javascript in a href" ) ; } catch ( java.lang.RuntimeException e ) { org.junit.Assert.assertEquals ( ( "javascript unsafe in href: " + href ) , e.getMessage ( ) ) ; } }

Target:
public void testRejectJavaScript_AnchorHref ( ) { final java.lang.String href = "javascript:window.close();" ; exception.expect ( java.lang.RuntimeException.class ) ; exception.expectMessage ( ( "javascript unsafe in href: " + href ) ) ; new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) . openAnchor ( ) . setAttribute ( "href" , href ) ; }
Source:
static void call ( final com.google.gerrit.reviewdb.client.Change.Id id , java.lang.String revision ) { com.google.gerrit.client.changes.ChangeApi.rebase ( id.get ( ) , revision , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.changes.ChangeInfo > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.changes.ChangeInfo result ) { com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( id ) ) ; } } ) ; }

Target:
public void onClose ( com.google.gwt.event.logical.shared.CloseEvent < com.google.gwt.user.client.ui.PopupPanel > event ) { super . onClose ( event ) ; b.setEnabled ( true ) ; }
Source:
public int compareTo ( com.google.gerrit.server.notedb.ChangeRebuilder.Event other ) { return com.google.common.collect.ComparisonChain.start ( ) . compare ( com.google.gerrit.server.notedb.ChangeRebuilder.round ( when ) , com.google.gerrit.server.notedb.ChangeRebuilder.round ( other.when ) ) . compare ( who.get ( ) , other.who.get ( ) ) . compare ( psId.get ( ) , other.psId.get ( ) ) . result ( ) ; }

Target:
public int compare ( com.google.gerrit.server.notedb.ChangeRebuilder.Event a , com.google.gerrit.server.notedb.ChangeRebuilder.Event b ) { return com.google.common.collect.ComparisonChain.start ( ) . compare ( a.when , b.when ) . compare ( a.who.get ( ) , b.who.get ( ) ) . compare ( a.psId.get ( ) , b.psId.get ( ) ) . result ( ) ; }
Source:
public void run ( ) { java.lang.String mode = ( ( m != null ) && ( ! ( m.isEmpty ( ) ) ) ) ? m : null ; view.getCmFromSide ( DisplaySide.A ) . setOption ( "mode" , mode ) ; view.getCmFromSide ( DisplaySide.B ) . setOption ( "mode" , mode ) ; }

Target:
private java.lang.String getSelectedMode ( ) { java.lang.String m = mode.getValue ( mode.getSelectedIndex ( ) ) ; return ( m != null ) && ( ! ( m.isEmpty ( ) ) ) ? m : null ; }
Source:
public void testRelativeAlternateLocation ( ) { configMock = org.easymock.EasyMock.createNiceMock ( com.google.gerrit.server.config.RepositoryConfig.class ) ; org.easymock.EasyMock.expect ( configMock.getAllBasePaths ( ) ) . andReturn ( java.util.Arrays.asList ( java.nio.file.Paths.get ( "repos" ) ) ) . anyTimes ( ) ; org.easymock.EasyMock.replay ( configMock ) ; repoManager = new com.google.gerrit.server.git.MultiBaseLocalDiskRepositoryManager ( site , cfg , configMock ) ; }

Target:
public void testRelativeAlternateLocation ( ) { configMock = org.easymock.EasyMock.createNiceMock ( com.google.gerrit.server.config.RepositoryConfig.class ) ; org.easymock.EasyMock.expect ( configMock.getAllBasePaths ( ) ) . andReturn ( com.google.common.collect.ImmutableList.of ( java.nio.file.Paths.get ( "repos" ) ) ) . anyTimes ( ) ; org.easymock.EasyMock.replay ( configMock ) ; repoManager = new com.google.gerrit.server.git.MultiBaseLocalDiskRepositoryManager ( site , cfg , configMock ) ; }
Source:
public void noExternalIds ( ) throws java.lang.Exception { db.accountExternalIds ( ) . delete ( db.accountExternalIds ( ) . byAccount ( user.getAccountId ( ) ) ) ; reloadUser ( ) ; com.google.gerrit.gpg.testutil.TestKey key = com.google.gerrit.gpg.testutil.TestKeys.validKeyWithSecondUserId ( ) ; com.google.gerrit.gpg.PublicKeyChecker checker = checkerFactory.create ( ) . setExpectedUser ( user ) . disableTrust ( ) ; assertProblems ( checker.check ( key.getPublicKey ( ) ) , Status.BAD , ( "No identities found for user; check" + " http://test/#/settings/web-identities" ) ) ; checker = checkerFactory.create ( ) . disableTrust ( ) ; assertProblems ( checker.check ( key.getPublicKey ( ) ) , Status.BAD , "Key is not associated with any users" ) ; db.accountExternalIds ( ) . insert ( java.util.Collections.singleton ( new com.google.gerrit.reviewdb.client.AccountExternalId ( user.getAccountId ( ) , com.google.gerrit.gpg.GerritPublicKeyChecker.toExtIdKey ( key.getPublicKey ( ) ) ) ) ) ; reloadUser ( ) ; assertProblems ( checker.check ( key.getPublicKey ( ) ) , Status.BAD , "No identities found for user" ) ; }

Target:
public void noExternalIds ( ) throws java.lang.Exception { db.accountExternalIds ( ) . delete ( db.accountExternalIds ( ) . byAccount ( user.getAccountId ( ) ) ) ; reloadUser ( ) ; com.google.gerrit.gpg.testutil.TestKey key = com.google.gerrit.gpg.testutil.TestKeys.validKeyWithSecondUserId ( ) ; com.google.gerrit.gpg.PublicKeyChecker checker = checkerFactory.create ( user , store ) . disableTrust ( ) ; assertProblems ( checker.check ( key.getPublicKey ( ) ) , Status.BAD , ( "No identities found for user; check" + " http://test/#/settings/web-identities" ) ) ; checker = checkerFactory.create ( ) . setStore ( store ) . disableTrust ( ) ; assertProblems ( checker.check ( key.getPublicKey ( ) ) , Status.BAD , "Key is not associated with any users" ) ; db.accountExternalIds ( ) . insert ( java.util.Collections.singleton ( new com.google.gerrit.reviewdb.client.AccountExternalId ( user.getAccountId ( ) , com.google.gerrit.gpg.GerritPublicKeyChecker.toExtIdKey ( key.getPublicKey ( ) ) ) ) ) ; reloadUser ( ) ; assertProblems ( checker.check ( key.getPublicKey ( ) ) , Status.BAD , "No identities found for user" ) ; }
Source:
public void signAgreement ( java.lang.String agreementName ) throws com.google.gerrit.extensions.restapi.RestApiException { try { com.google.gerrit.extensions.common.AgreementInput input = new com.google.gerrit.extensions.common.AgreementInput ( ) ; input.name = agreementName ; putAgreement.apply ( account , input ) ; } catch ( java.io.IOException | com.google.gwtorm.server.OrmException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot sign agreement" , e ) ; } }

Target:
public void signAgreement ( java.lang.String agreementName ) throws com.google.gerrit.extensions.restapi.RestApiException { try { com.google.gerrit.extensions.common.AgreementInput input = new com.google.gerrit.extensions.common.AgreementInput ( ) ; input.name = agreementName ; putAgreement.apply ( account , input ) ; } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( "Cannot sign agreement" , e ) ; } }
Source:
public static com.google.gerrit.reviewdb.client.Change.Id fromRef ( final java.lang.String ref ) { return PatchSet.Id.fromRef ( ref ) . getParentKey ( ) ; }

Target:
public static com.google.gerrit.reviewdb.client.Change.Id fromRef ( java.lang.String ref ) { int cs = com.google.gerrit.reviewdb.client.Change.Id.startIndex ( ref ) ; if ( cs < 0 ) { return null ; } int ce = com.google.gerrit.reviewdb.client.Change.Id.nextNonDigit ( ref , cs ) ; int patchSetId = PatchSet.Id.fromRef ( ref , ce ) ; if ( patchSetId < 0 ) { return null ; } return new com.google.gerrit.reviewdb.client.Change.Id ( java.lang.Integer.parseInt ( ref.substring ( cs , ce ) ) ) ; }
Source:
private void insertDummyApproval ( final com.google.gerrit.server.git.ReceiveCommits.ReplaceResult result , final com.google.gerrit.reviewdb.Account.Id forAccount , final com.google.gerrit.reviewdb.ApprovalCategory.Id catId , final com.google.gerrit.reviewdb.ReviewDb db ) throws com.google.gwtorm.client.OrmException { insertDummyApproval ( result.change , result.patchSet.getId ( ) , forAccount , catId , db ) ; }

Target:
void sendMessage ( java.lang.String what ) ;
Source:
protected void configure ( ) { factory ( AbandonChange.Factory.class ) ; factory ( ChangeDetailFactory.Factory.class ) ; factory ( PatchSetDetailFactory.Factory.class ) ; factory ( PatchSetPublishDetailFactory.Factory.class ) ; factory ( SubmitAction.Factory.class ) ; }

Target:
protected void configure ( ) { factory ( AbandonChange.Factory.class ) ; factory ( ChangeDetailFactory.Factory.class ) ; factory ( IncludedInDetailFactory.Factory.class ) ; factory ( PatchSetDetailFactory.Factory.class ) ; factory ( PatchSetPublishDetailFactory.Factory.class ) ; factory ( SubmitAction.Factory.class ) ; }
Source:
private void doAssertApproval ( int expected , com.google.gerrit.extensions.common.ChangeInfo c ) { com.google.gerrit.extensions.common.LabelInfo cr = c.labels.get ( "Code-Review" ) ; org.junit.Assert.assertEquals ( ( - 1 ) , ( ( int ) ( cr.defaultValue ) ) ) ; org.junit.Assert.assertEquals ( 1 , cr.all.size ( ) ) ; org.junit.Assert.assertEquals ( "Administrator" , cr.all.get ( 0 ) . name ) ; org.junit.Assert.assertEquals ( expected , cr.all.get ( 0 ) . value.intValue ( ) ) ; }

Target:
private void doAssertApproval ( int expected , com.google.gerrit.extensions.common.ChangeInfo c ) { com.google.gerrit.extensions.common.LabelInfo cr = c.labels.get ( "Code-Review" ) ; com.google.common.truth.Truth.assertThat ( ( ( int ) ( cr.defaultValue ) ) ) . isEqualTo ( ( - 1 ) ) ; com.google.common.truth.Truth.assertThat ( cr.all ) . hasSize ( 1 ) ; com.google.common.truth.Truth.assertThat ( cr.all.get ( 0 ) . name ) . isEqualTo ( "Administrator" ) ; com.google.common.truth.Truth.assertThat ( cr.all.get ( 0 ) . value.intValue ( ) ) . isEqualTo ( expected ) ; }
Source:
public boolean canEditTopicName ( ) { if ( getChange ( ) . getStatus ( ) . isOpen ( ) ) { return ( ( ( ( isOwner ( ) ) || ( getRefControl ( ) . isOwner ( ) ) ) || ( getProjectControl ( ) . isOwner ( ) ) ) || ( getCurrentUser ( ) . getCapabilities ( ) . canAdministrateServer ( ) ) ) || ( getRefControl ( ) . canEditTopicName ( ) ) ; } else { return getRefControl ( ) . canForceEditTopicName ( ) ; } }

Target:
public boolean canEditTopicName ( ) { if ( getChange ( ) . getStatus ( ) . isOpen ( ) ) { return ( ( ( ( isOwner ( ) ) || ( getRefControl ( ) . isOwner ( ) ) ) || ( getProjectControl ( ) . isOwner ( ) ) ) || ( getUser ( ) . getCapabilities ( ) . canAdministrateServer ( ) ) ) || ( getRefControl ( ) . canEditTopicName ( ) ) ; } else { return getRefControl ( ) . canForceEditTopicName ( ) ; } }
Source:
public void groupNamesRefIsMissing ( ) throws java.lang.Exception { java.util.List < com.google.gerrit.extensions.api.config.ConsistencyCheckInfo.ConsistencyProblemInfo > problems = com.google.gerrit.server.group.db.GroupsNoteDbConsistencyChecker.checkWithGroupNameNotes ( allUsersRepo , "g-1" , new com.google.gerrit.reviewdb.client.AccountGroup.UUID ( "uuid-1" ) ) ; com.google.common.truth.Truth.assertThat ( problems ) . containsExactly ( com.google.gerrit.extensions.api.config.ConsistencyCheckInfo.ConsistencyProblemInfo.warning ( "Group with name 'g-1' doesn't exist in the list of all names" ) ) ; }

Target:
public void groupNamesRefIsMissing ( ) throws java.lang.Exception { java.util.List < com.google.gerrit.extensions.api.config.ConsistencyCheckInfo.ConsistencyProblemInfo > problems = com.google.gerrit.server.group.db.GroupsNoteDbConsistencyChecker.checkWithGroupNameNotes ( allUsersRepo , new com.google.gerrit.reviewdb.client.AccountGroup.NameKey ( "g-1" ) , new com.google.gerrit.reviewdb.client.AccountGroup.UUID ( "uuid-1" ) ) ; com.google.common.truth.Truth.assertThat ( problems ) . containsExactly ( com.google.gerrit.extensions.api.config.ConsistencyCheckInfo.ConsistencyProblemInfo.warning ( "Group with name 'g-1' doesn't exist in the list of all names" ) ) ; }
Source:
private void streamFile ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse res ) throws java.io.IOException { java.io.File f = resolveFile ( req ) ; res.setStatus ( HttpServletResponse.SC_OK ) ; res.setContentType ( "application/octet-stream" ) ; res.setContentLength ( ( ( int ) ( f.length ( ) ) ) ) ; java.io.OutputStream out = res.getOutputStream ( ) ; try ( java.io.InputStream in = new java.io.FileInputStream ( f ) ) { com.google.common.io.ByteStreams.copy ( in , out ) ; } }

Target:
private void streamFile ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse res ) throws java.io.IOException { java.io.File f = resolvePath ( req ) . toFile ( ) ; res.setStatus ( HttpServletResponse.SC_OK ) ; res.setContentType ( "application/octet-stream" ) ; res.setContentLength ( ( ( int ) ( f.length ( ) ) ) ) ; java.io.OutputStream out = res.getOutputStream ( ) ; try ( java.io.InputStream in = new java.io.FileInputStream ( f ) ) { com.google.common.io.ByteStreams.copy ( in , out ) ; } }
Source:
protected void onInitUI ( ) { super . onInitUI ( ) ; setPageTitle ( Util.C.projectListTitle ( ) ) ; projects = new com.google.gerrit.client.admin.ProjectListScreen.ProjectTable ( ) ; projects.setSavePointerId ( Link.ADMIN_PROJECTS ) ; add ( projects ) ; final com.google.gwt.user.client.ui.VerticalPanel fp = new com.google.gwt.user.client.ui.VerticalPanel ( ) ; fp.setStyleName ( "gerrit-AddSshKeyPanel" ) ; fp.add ( new com.google.gerrit.client.ui.SmallHeading ( Util.C.headingCreateGroup ( ) ) ) ; }

Target:
public void registerKeys ( ) { super . registerKeys ( ) ; projects.setRegisterKeys ( true ) ; }
Source:
public void setUp ( ) { java.lang.String tz = "US/Eastern" ; systemTimeZoneProperty = java.lang.System.setProperty ( "user.timezone" , tz ) ; systemTimeZone = java.util.TimeZone.getDefault ( ) ; java.util.TimeZone.setDefault ( java.util.TimeZone.getTimeZone ( tz ) ) ; long maxMs = com.google.gerrit.server.notedb.rebuild.ChangeRebuilderImpl.MAX_WINDOW_MS ; com.google.common.truth.Truth.assertThat ( maxMs ) . isGreaterThan ( 1000L ) ; com.google.gerrit.testutil.TestTimeUtil.resetWithClockStep ( ( maxMs * 2 ) , java.util.concurrent.TimeUnit.MILLISECONDS ) ; project = new com.google.gerrit.reviewdb.client.Project.NameKey ( "project" ) ; accountId = new com.google.gerrit.reviewdb.client.Account.Id ( 100 ) ; }

Target:
public void setUp ( ) { systemTimeZoneProperty = java.lang.System.setProperty ( "user.timezone" , com.google.gerrit.server.notedb.ChangeBundleTest.TIMEZONE_ID ) ; systemTimeZone = java.util.TimeZone.getDefault ( ) ; java.util.TimeZone.setDefault ( java.util.TimeZone.getTimeZone ( com.google.gerrit.server.notedb.ChangeBundleTest.TIMEZONE_ID ) ) ; long maxMs = com.google.gerrit.server.notedb.rebuild.ChangeRebuilderImpl.MAX_WINDOW_MS ; com.google.common.truth.Truth.assertThat ( maxMs ) . isGreaterThan ( 1000L ) ; com.google.gerrit.testutil.TestTimeUtil.resetWithClockStep ( ( maxMs * 2 ) , java.util.concurrent.TimeUnit.MILLISECONDS ) ; project = new com.google.gerrit.reviewdb.client.Project.NameKey ( "project" ) ; accountId = new com.google.gerrit.reviewdb.client.Account.Id ( 100 ) ; }
Source:
private static final java.net.InetSocketAddress newPort ( ) throws java.io.IOException { java.net.ServerSocket s = new java.net.ServerSocket ( 0 , 0 , java.net.InetAddress.getLocalHost ( ) ) ; try { return ( ( java.net.InetSocketAddress ) ( s.getLocalSocketAddress ( ) ) ) ; } finally { s.close ( ) ; } }

Target:
private static final java.net.InetSocketAddress newPort ( ) throws java.io.IOException { java.net.ServerSocket s = new java.net.ServerSocket ( 0 , 0 , com.google.gerrit.acceptance.GerritServer.getLocalHost ( ) ) ; try { return ( ( java.net.InetSocketAddress ) ( s.getLocalSocketAddress ( ) ) ) ; } finally { s.close ( ) ; } }
Source:
void display ( final java.util.List < com.google.gerrit.reviewdb.client.Branch > result ) { canDelete = false ; while ( 1 < ( table.getRowCount ( ) ) ) table.removeRow ( ( ( table.getRowCount ( ) ) - 1 ) ) ; for ( final com.google.gerrit.reviewdb.client.Branch k : result ) { final int row = table.getRowCount ( ) ; table.insertRow ( row ) ; applyDataRowStyle ( row ) ; populate ( row , k ) ; } }

Target:
void display ( java.util.List < com.google.gerrit.client.projects.BranchInfo > branches ) { canDelete = false ; while ( 1 < ( table.getRowCount ( ) ) ) table.removeRow ( ( ( table.getRowCount ( ) ) - 1 ) ) ; for ( final com.google.gerrit.client.projects.BranchInfo k : branches ) { final int row = table.getRowCount ( ) ; table.insertRow ( row ) ; applyDataRowStyle ( row ) ; populate ( row , k ) ; } }
Source:
public com.google.common.base.Optional < com.googlesource.gerrit.plugins.manager.gson.SmartJson > getOptional ( java.lang.String fieldName ) { if ( ( ( jsonElem ) != null ) && ( ( jsonElem.getAsJsonObject ( ) . get ( fieldName ) ) != null ) ) { return com.google.common.base.Optional.of ( com.googlesource.gerrit.plugins.manager.gson.SmartJson.of ( jsonElem.getAsJsonObject ( ) . get ( fieldName ) ) ) ; } else { return com.google.common.base.Optional.absent ( ) ; } }

Target:
public java.util.Optional < com.googlesource.gerrit.plugins.manager.gson.SmartJson > getOptional ( java.lang.String fieldName ) { if ( ( ( jsonElem ) != null ) && ( ( jsonElem.getAsJsonObject ( ) . get ( fieldName ) ) != null ) ) { return java.util.Optional.of ( com.googlesource.gerrit.plugins.manager.gson.SmartJson.of ( jsonElem.getAsJsonObject ( ) . get ( fieldName ) ) ) ; } return java.util.Optional.empty ( ) ; }
Source:
public void testParseNonVisibleCommitSha ( ) throws java.lang.Exception { org.eclipse.jgit.revwalk.RevCommit other = repo.commit ( ) . create ( ) ; repo.branch ( "master" ) . commit ( ) . create ( ) ; assertEquals ( null , parser.parse ( other.name ( ) ) ) ; repo.branch ( "other" ) . update ( other ) ; assertEquals ( new com.google.gitiles.RevisionParser.Result ( com.google.gitiles.Revision.peeled ( other.name ( ) , other ) ) , parser.parse ( other.name ( ) ) ) ; }

Target:
public void parseNonVisibleCommitSha ( ) throws java.lang.Exception { org.eclipse.jgit.revwalk.RevCommit other = repo.commit ( ) . create ( ) ; repo.branch ( "master" ) . commit ( ) . create ( ) ; org.junit.Assert.assertEquals ( null , parser.parse ( other.name ( ) ) ) ; repo.branch ( "other" ) . update ( other ) ; org.junit.Assert.assertEquals ( new com.google.gitiles.RevisionParser.Result ( com.google.gitiles.Revision.peeled ( other.name ( ) , other ) ) , parser.parse ( other.name ( ) ) ) ; }
Source:
private org.eclipse.jgit.notes.NoteMap loadRejectCommitsMap ( ) throws java.io.IOException { java.lang.String rejectNotes = "refs/meta/reject-commits" ; try { org.eclipse.jgit.lib.Ref ref = repo.getRef ( rejectNotes ) ; if ( ref == null ) { return null ; } org.eclipse.jgit.revwalk.RevWalk rw = rp.getRevWalk ( ) ; org.eclipse.jgit.revwalk.RevCommit map = rw.parseCommit ( ref.getObjectId ( ) ) ; return org.eclipse.jgit.notes.NoteMap.read ( rw.getObjectReader ( ) , map ) ; } catch ( java.io.IOException badMap ) { throw new java.io.IOException ( ( "Cannot load " + rejectNotes ) , badMap ) ; } }

Target:
private org.eclipse.jgit.notes.NoteMap loadRejectCommitsMap ( ) throws java.io.IOException { java.lang.String rejectNotes = "refs/meta/reject-commits" ; try { org.eclipse.jgit.lib.Ref ref = repo.getRef ( rejectNotes ) ; if ( ref == null ) { return org.eclipse.jgit.notes.NoteMap.newEmptyMap ( ) ; } org.eclipse.jgit.revwalk.RevWalk rw = rp.getRevWalk ( ) ; org.eclipse.jgit.revwalk.RevCommit map = rw.parseCommit ( ref.getObjectId ( ) ) ; return org.eclipse.jgit.notes.NoteMap.read ( rw.getObjectReader ( ) , map ) ; } catch ( java.io.IOException badMap ) { throw new java.io.IOException ( ( "Cannot load " + rejectNotes ) , badMap ) ; } }