auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
void resizePaddingWidget ( ) { com.google.gwt.core.client.Scheduler.get ( ) . scheduleDeferred ( new com.google.gwt.core.client.Scheduler.ScheduledCommand ( ) { public void execute ( ) { if ( ( ( selfWidget ) == null ) || ( ( widgetManager ) == null ) ) { throw new java.lang.IllegalStateException ( "resizePaddingWidget() called before setting up widgets" ) ; } selfWidget.changed ( ) ; widgetManager.resizePaddingWidget ( ) ; } } ) ; }

Target:
void resizePaddingWidget ( ) { com.google.gwt.core.client.Scheduler.get ( ) . scheduleDeferred ( new com.google.gwt.core.client.Scheduler.ScheduledCommand ( ) { public void execute ( ) { assert ( selfWidget ) != null ; assert ( widgetManager ) != null ; selfWidget.changed ( ) ; widgetManager.resizePaddingWidget ( ) ; } } ) ; }
Source:
public void visit ( org.pegdown.ast.HeaderNode node ) { java.lang.String tag = "h" + ( node.getLevel ( ) ) ; html.open ( tag ) ; html.attribute ( "id" , toc.idFromHeader ( node ) ) ; visitChildren ( node ) ; html.close ( tag ) ; }

Target:
public void visit ( org.pegdown.ast.HeaderNode node ) { java.lang.String tag = "h" + ( node.getLevel ( ) ) ; html.open ( tag ) ; java.lang.String id = toc.idFromHeader ( node ) ; if ( id != null ) { html.attribute ( "id" , id ) ; } visitChildren ( node ) ; html.close ( tag ) ; }
Source:
public boolean isOwner ( ) { if ( getUser ( ) . isIdentifiedUser ( ) ) { com.google.gerrit.reviewdb.client.Account.Id id = getUser ( ) . asIdentifiedUser ( ) . getAccountId ( ) ; return id.equals ( getChange ( ) . getOwner ( ) ) ; } return false ; }

Target:
private boolean isOwner ( ) { if ( getUser ( ) . isIdentifiedUser ( ) ) { com.google.gerrit.reviewdb.client.Account.Id id = getUser ( ) . asIdentifiedUser ( ) . getAccountId ( ) ; return id.equals ( getChange ( ) . getOwner ( ) ) ; } return false ; }
Source:
private com.google.gerrit.reviewdb.client.AccountGroup group ( java.lang.String name ) throws java.lang.Exception { com.google.gerrit.server.account.CreateGroupArgs args = new com.google.gerrit.server.account.CreateGroupArgs ( ) ; args.setGroupName ( name ) ; args.initialMembers = java.util.Collections.singleton ( admin.getId ( ) ) ; return createGroupFactory.create ( args ) . createGroup ( ) ; }

Target:
private com.google.gerrit.reviewdb.client.AccountGroup group ( java.lang.String name ) throws java.lang.Exception { com.google.gerrit.server.account.CreateGroupArgs args = new com.google.gerrit.server.account.CreateGroupArgs ( ) ; args.setGroupName ( name ( name ) ) ; args.initialMembers = java.util.Collections.singleton ( admin.getId ( ) ) ; return createGroupFactory.create ( args ) . createGroup ( ) ; }
Source:
public com.google.gerrit.server.group.GroupResource parse ( com.google.gerrit.extensions.restapi.TopLevelResource parent , java.lang.String id ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException , java.lang.Exception { final com.google.gerrit.server.CurrentUser user = self.get ( ) ; if ( user instanceof com.google.gerrit.server.AnonymousUser ) { throw new com.google.gerrit.extensions.restapi.AuthException ( "Authentication required" ) ; } else if ( ! ( user instanceof com.google.gerrit.server.IdentifiedUser ) ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( id ) ; } return com.google.gerrit.server.group.GroupsCollection.parse ( id , groupControlFactory ) ; }

Target:
public com.google.gerrit.server.group.GroupResource parse ( com.google.gerrit.extensions.restapi.TopLevelResource parent , java.lang.String id ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException , java.lang.Exception { final com.google.gerrit.server.CurrentUser user = self.get ( ) ; if ( user instanceof com.google.gerrit.server.AnonymousUser ) { throw new com.google.gerrit.extensions.restapi.AuthException ( "Authentication required" ) ; } else if ( ! ( user instanceof com.google.gerrit.server.IdentifiedUser ) ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( id ) ; } return parse ( id ) ; }
Source:
public boolean unify ( com.googlecode.prolog_cafe.lang.Term t , com.googlecode.prolog_cafe.lang.Trail trail ) { t = t.dereference ( ) ; if ( t.isVariable ( ) ) { ( ( com.googlecode.prolog_cafe.lang.VariableTerm ) ( t ) ) . bind ( this , trail ) ; return true ; } return com.googlecode.prolog_cafe.lang.SymbolTerm.eq ( this , t ) ; }

Target:
public boolean unify ( com.googlecode.prolog_cafe.lang.Term t , com.googlecode.prolog_cafe.lang.Trail trail ) { t = t.dereference ( ) ; if ( t instanceof com.googlecode.prolog_cafe.lang.VariableTerm ) { ( ( com.googlecode.prolog_cafe.lang.VariableTerm ) ( t ) ) . bind ( this , trail ) ; return true ; } return com.googlecode.prolog_cafe.lang.SymbolTerm.eq ( this , t ) ; }
Source:
public void deleteVoteFromReviewableWipChange ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableWipChange ( ) ; deleteVote ( sc , voter ) ; assertThat ( sender ) . sent ( "deleteVote" , sc ) . notTo ( voter ) . to ( sc.owner ) . to ( sc.reviewerByEmail ) . cc ( sc.reviewer , sc.ccer ) . cc ( sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; }

Target:
public void deleteVoteFromReviewableWipChange ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableWipChange ( ) ; deleteVote ( sc , voter ) ; assertThat ( sender ) . sent ( "deleteVote" , sc ) . notTo ( voter ) . to ( sc.owner ) . cc ( sc.reviewer , sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; }
Source:
private com.google.gerrit.common.data.PermissionRule grant ( com.google.gerrit.server.git.ProjectConfig project , java.lang.String permissionName , com.google.gerrit.reviewdb.AccountGroup.UUID group , java.lang.String ref ) { com.google.gerrit.common.data.PermissionRule rule = newRule ( project , group ) ; project.getAccessSection ( ref , true ) . getPermission ( permissionName , true ) . add ( rule ) ; return rule ; }

Target:
private com.google.gerrit.common.data.PermissionRule grant ( com.google.gerrit.server.git.ProjectConfig project , java.lang.String permissionName , com.google.gerrit.common.data.PermissionRule rule , java.lang.String ref ) { project.getAccessSection ( ref , true ) . getPermission ( permissionName , true ) . add ( rule ) ; return rule ; }
Source:
public void setUpInjector ( ) throws java.lang.Exception { lifecycle = new com.google.gerrit.lifecycle.LifecycleManager ( ) ; com.google.inject.Injector injector = createInjector ( lifecycle ) ; injector.injectMembers ( this ) ; lifecycle.start ( ) ; db = schemaFactory.open ( ) ; schemaCreator.create ( db ) ; userId = accountManager.authenticate ( com.google.gerrit.server.account.AuthRequest.forUser ( "user" ) ) . getAccountId ( ) ; com.google.gerrit.reviewdb.client.Account userAccount = db.accounts ( ) . get ( userId ) ; userAccount.setPreferredEmail ( "user@example.com" ) ; db.accounts ( ) . update ( com.google.common.collect.ImmutableList.of ( userAccount ) ) ; user = userFactory.create ( userId ) ; requestContext.setContext ( newRequestContext ( userAccount.getId ( ) ) ) ; }

Target:
public void setUpInjector ( ) throws java.lang.Exception { lifecycle = new com.google.gerrit.lifecycle.LifecycleManager ( ) ; com.google.inject.Injector injector = createInjector ( ) ; lifecycle.add ( injector ) ; injector.injectMembers ( this ) ; lifecycle.start ( ) ; db = schemaFactory.open ( ) ; schemaCreator.create ( db ) ; userId = accountManager.authenticate ( com.google.gerrit.server.account.AuthRequest.forUser ( "user" ) ) . getAccountId ( ) ; com.google.gerrit.reviewdb.client.Account userAccount = db.accounts ( ) . get ( userId ) ; userAccount.setPreferredEmail ( "user@example.com" ) ; db.accounts ( ) . update ( com.google.common.collect.ImmutableList.of ( userAccount ) ) ; user = userFactory.create ( com.google.inject.util.Providers.of ( db ) , userId ) ; requestContext.setContext ( newRequestContext ( userAccount.getId ( ) ) ) ; }
Source:
private org.apache.lucene.search.Query exactQuery ( com.google.gerrit.server.index.IndexPredicate < V > p ) { if ( p instanceof com.google.gerrit.server.index.RegexPredicate < ? > ) { return regexQuery ( p ) ; } else { return new org.apache.lucene.search.TermQuery ( new org.apache.lucene.index.Term ( p.getField ( ) . getName ( ) , p.getValue ( ) ) ) ; } }

Target:
private org.apache.lucene.search.Query exactQuery ( com.google.gerrit.server.index.IndexPredicate < V > p ) { if ( p instanceof com.google.gerrit.server.index.RegexPredicate < ? > ) { return regexQuery ( p ) ; } return new org.apache.lucene.search.TermQuery ( new org.apache.lucene.index.Term ( p.getField ( ) . getName ( ) , p.getValue ( ) ) ) ; }
Source:
private com.googlesource.gerrit.plugins.quota.Publisher.UsageDataEvent createRepoSizeEvent ( ) throws java.util.concurrent.ExecutionException { com.googlesource.gerrit.plugins.quota.Publisher.UsageDataEvent event = new com.googlesource.gerrit.plugins.quota.Publisher.UsageDataEvent ( com.googlesource.gerrit.plugins.quota.Publisher.REPO_SIZE ) ; for ( com.google.gerrit.reviewdb.client.Project.NameKey p : projectCache.all ( ) ) { long size = repoSizeCache.get ( p ) . get ( ) ; event.addData ( size , p.get ( ) ) ; } return event ; }

Target:
private com.googlesource.gerrit.plugins.quota.Publisher.UsageDataEvent createRepoSizeEvent ( ) { com.googlesource.gerrit.plugins.quota.Publisher.UsageDataEvent event = new com.googlesource.gerrit.plugins.quota.Publisher.UsageDataEvent ( com.googlesource.gerrit.plugins.quota.Publisher.REPO_SIZE ) ; for ( com.google.gerrit.reviewdb.client.Project.NameKey p : projectCache.all ( ) ) { long size = repoSizeCache.get ( p ) ; if ( size > 0 ) { event.addData ( size , p.get ( ) ) ; } } return event ; }
Source:
public SiteIndexer.Result indexAll ( final com.google.gerrit.server.index.project.ProjectIndex index ) { org.eclipse.jgit.lib.ProgressMonitor progress = new org.eclipse.jgit.lib.TextProgressMonitor ( new java.io.PrintWriter ( progressOut ) ) ; progress.start ( 2 ) ; com.google.common.base.Stopwatch sw = com.google.common.base.Stopwatch.createStarted ( ) ; java.util.List < com.google.gerrit.reviewdb.client.Project.NameKey > names ; try { names = collectProjects ( progress ) ; } catch ( com.google.gwtorm.server.OrmException e ) { com.google.gerrit.server.index.project.AllProjectsIndexer.log.error ( "Error collecting projects" , e ) ; return new com.google.gerrit.index.SiteIndexer.Result ( sw , false , 0 , 0 ) ; } return reindexProjects ( index , names , progress ) ; }

Target:
public SiteIndexer.Result indexAll ( final com.google.gerrit.server.index.project.ProjectIndex index ) { org.eclipse.jgit.lib.ProgressMonitor progress = new org.eclipse.jgit.lib.TextProgressMonitor ( new java.io.PrintWriter ( progressOut ) ) ; progress.start ( 2 ) ; java.util.List < com.google.gerrit.reviewdb.client.Project.NameKey > names = collectProjects ( progress ) ; return reindexProjects ( index , names , progress ) ; }
Source:
com.google.gerrit.httpd.raw.ResourceServlet.Resource getResource ( java.lang.String name ) { try { java.nio.file.Path p = getResourcePath ( name ) ; return cache.get ( p , newLoader ( p ) ) ; } catch ( java.util.concurrent.ExecutionException e ) { com.google.gerrit.httpd.raw.ResourceServlet.log.warn ( java.lang.String.format ( "Cannot load static resource %s" , name ) , e ) ; return null ; } }

Target:
com.google.gerrit.httpd.raw.ResourceServlet.Resource getResource ( java.lang.String name ) { try { java.nio.file.Path p = getResourcePath ( name ) ; return cache.get ( p , newLoader ( p ) ) ; } catch ( java.util.concurrent.ExecutionException | java.io.IOException e ) { com.google.gerrit.httpd.raw.ResourceServlet.log.warn ( java.lang.String.format ( "Cannot load static resource %s" , name ) , e ) ; return null ; } }
Source:
private com.google.gerrit.server.change.ChangeJson.ChangeInfo getChange ( com.google.gerrit.acceptance.PushOneCommit.Result pr ) throws java.io.IOException { com.google.gerrit.acceptance.RestResponse r = session.get ( ( ( "/changes/" + ( pr.getChangeId ( ) ) ) + "/detail" ) ) ; org.junit.Assert.assertEquals ( HttpStatus.SC_OK , r.getStatusCode ( ) ) ; return com.google.gerrit.acceptance.server.project.LabelTypeIT.newGson ( ) . fromJson ( r.getReader ( ) , com.google.gerrit.server.change.ChangeJson.ChangeInfo.class ) ; }

Target:
private com.google.gerrit.server.change.ChangeJson.ChangeInfo getChange ( com.google.gerrit.acceptance.PushOneCommit.Result pr ) throws java.io.IOException { com.google.gerrit.acceptance.RestResponse r = session.get ( ( ( "/changes/" + ( pr.getChangeId ( ) ) ) + "/detail" ) ) ; org.junit.Assert.assertEquals ( HttpStatus.SC_OK , r.getStatusCode ( ) ) ; return newGson ( ) . fromJson ( r.getReader ( ) , com.google.gerrit.server.change.ChangeJson.ChangeInfo.class ) ; }
Source:
private void retryIfAllowed ( int failedConnections ) { if ( failedConnections < ( ( maxTries ) - 1 ) ) { com.ericsson.gerrit.plugins.eventslog.sql.SQLStore.log.info ( "Retrying store event" ) ; try { java.lang.Thread.sleep ( waitTime ) ; } catch ( java.lang.InterruptedException e1 ) { return ; } } else { com.ericsson.gerrit.plugins.eventslog.sql.SQLStore.log.error ( ( ( "Failed to store event " + ( maxTries ) ) + " times" ) ) ; setOnline ( false ) ; } }

Target:
private void retryIfAllowed ( int failedConnections ) throws java.lang.InterruptedException { if ( failedConnections < ( ( maxTries ) - 1 ) ) { com.ericsson.gerrit.plugins.eventslog.sql.SQLStore.log.info ( "Retrying store event" ) ; java.lang.Thread.sleep ( waitTime ) ; } else { com.ericsson.gerrit.plugins.eventslog.sql.SQLStore.log.error ( ( ( "Failed to store event " + ( maxTries ) ) + " times" ) ) ; setOnline ( false ) ; } }
Source:
protected boolean isVisibleTo ( final com.google.gerrit.reviewdb.client.Account.Id to ) throws com.google.gwtorm.server.OrmException { return ( ( ( projectState ) == null ) || ( ( change ) == null ) ) || ( projectState.controlFor ( args.identifiedUserFactory.create ( to ) ) . controlFor ( change ) . isVisible ( args.db.get ( ) ) ) ; }

Target:
protected boolean isVisibleTo ( final com.google.gerrit.reviewdb.client.Account.Id to ) throws com.google.gwtorm.server.OrmException { return ( ( projectState ) == null ) || ( projectState.controlFor ( args.identifiedUserFactory.create ( to ) ) . controlFor ( change ) . isVisible ( args.db.get ( ) ) ) ; }
Source:
public static boolean isRefsEditOf ( java.lang.String ref , com.google.gerrit.reviewdb.client.Account.Id accountId ) { java.lang.String prefix = new java.lang.StringBuilder ( com.google.gerrit.reviewdb.client.RefNames.refsUsers ( accountId ) ) . append ( '/' ) . append ( com.google.gerrit.reviewdb.client.RefNames.EDIT_PREFIX ) . toString ( ) ; return ref.startsWith ( prefix ) ; }

Target:
public static boolean isRefsEditOf ( java.lang.String ref , com.google.gerrit.reviewdb.client.Account.Id accountId ) { if ( accountId == null ) { return false ; } java.lang.String prefix = new java.lang.StringBuilder ( com.google.gerrit.reviewdb.client.RefNames.refsUsers ( accountId ) ) . append ( '/' ) . append ( com.google.gerrit.reviewdb.client.RefNames.EDIT_PREFIX ) . toString ( ) ; return ref.startsWith ( prefix ) ; }
Source:
private void newDraft ( net.codemirror.lib.CodeMirror cm ) { int cmLine = cm.getLineNumber ( cm.extras ( ) . activeLine ( ) ) ; com.google.gerrit.client.diff.UnifiedChunkManager.LineSidePair pair = host.getLineSidePairFromCmLine ( cmLine ) ; com.google.gerrit.client.diff.DisplaySide side = pair.getSide ( ) ; if ( cm.somethingSelected ( ) ) { } else { insertNewDraft ( side , cmLine ) ; } }

Target:
private void newDraft ( net.codemirror.lib.CodeMirror cm ) { int cmLine = cm.getLineNumber ( cm.extras ( ) . activeLine ( ) ) ; com.google.gerrit.client.diff.UnifiedChunkManager.LineSidePair pair = host.getLineSidePairFromCmLine ( cmLine ) ; com.google.gerrit.client.diff.DisplaySide side = pair.getSide ( ) ; if ( cm.somethingSelected ( ) ) { } else { insertNewDraft ( side , ( cmLine + 1 ) ) ; } }
Source:
public void delete ( com.google.gerrit.server.query.change.ChangeData cd ) throws java.io.IOException { org.apache.lucene.index.Term id = com.google.gerrit.lucene.QueryBuilder.idTerm ( cd ) ; try { com.google.common.util.concurrent.Futures.allAsList ( openIndex.delete ( id ) , closedIndex.delete ( id ) ) . get ( ) ; } catch ( java.util.concurrent.ExecutionException e ) { throw new java.io.IOException ( e ) ; } catch ( java.lang.InterruptedException e ) { throw new java.io.IOException ( e ) ; } }

Target:
public void delete ( com.google.gerrit.server.query.change.ChangeData cd ) throws java.io.IOException { org.apache.lucene.index.Term id = com.google.gerrit.lucene.QueryBuilder.idTerm ( cd ) ; try { com.google.common.util.concurrent.Futures.allAsList ( openIndex.delete ( id ) , closedIndex.delete ( id ) ) . get ( ) ; } catch ( java.util.concurrent.ExecutionException | java.lang.InterruptedException e ) { throw new java.io.IOException ( e ) ; } }
Source:
public java.lang.String getComment ( ) { final java.lang.String s = getSshPublicKey ( ) ; if ( ( s == null ) || ( ( s.length ( ) ) == 0 ) ) { return "" ; } final java.lang.String [ ] parts = s.split ( " " ) ; if ( ( parts.length ) < 3 ) { return "" ; } return parts [ 2 ] ; }

Target:
public java.lang.String getComment ( ) { final java.lang.String s = getSshPublicKey ( ) ; if ( ( s == null ) || ( ( s.length ( ) ) == 0 ) ) { return "" ; } final java.lang.String [ ] parts = s.split ( " " , 3 ) ; if ( ( parts.length ) < 3 ) { return "" ; } return parts [ 2 ] ; }
Source:
protected void configure ( ) { factory ( ChangeProjectAccess.Factory.class ) ; factory ( ReviewProjectAccess.Factory.class ) ; factory ( ChangeProjectSettings.Factory.class ) ; factory ( ListBranches.Factory.class ) ; factory ( VisibleProjectDetails.Factory.class ) ; factory ( ProjectAccessFactory.Factory.class ) ; factory ( ProjectDetailFactory.Factory.class ) ; }

Target:
protected void configure ( ) { factory ( ChangeProjectAccess.Factory.class ) ; factory ( ReviewProjectAccess.Factory.class ) ; factory ( ChangeProjectSettings.Factory.class ) ; factory ( VisibleProjectDetails.Factory.class ) ; factory ( ProjectAccessFactory.Factory.class ) ; factory ( ProjectDetailFactory.Factory.class ) ; }
Source:
public void onFailure ( java.lang.Throwable err ) { com.google.gerrit.client.change.ChangeActions.setEnabled ( true , draftButtons ) ; if ( com.google.gerrit.client.change.SubmitFailureDialog.isConflict ( err ) ) { new com.google.gerrit.client.change.SubmitFailureDialog ( err.getMessage ( ) ) . center ( ) ; com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( id ) ) ; } else { super . onFailure ( err ) ; } }

Target:
public void onFailure ( java.lang.Throwable err ) { com.google.gerrit.client.change.ChangeActions.setEnabled ( true , draftButtons ) ; if ( com.google.gerrit.client.change.SubmitFailureDialog.isConflict ( err ) ) { new com.google.gerrit.client.change.SubmitFailureDialog ( err.getMessage ( ) ) . center ( ) ; com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( project , id ) ) ; } else { super . onFailure ( err ) ; } }
Source:
public boolean unify ( com.googlecode.prolog_cafe.lang.Term t , com.googlecode.prolog_cafe.lang.Trail trail ) { if ( t.isVariable ( ) ) return ( ( com.googlecode.prolog_cafe.lang.VariableTerm ) ( t ) ) . unify ( this , trail ) ; if ( ! ( t.isDouble ( ) ) ) return false ; return ( this . val ) == ( ( ( com.googlecode.prolog_cafe.lang.DoubleTerm ) ( t ) ) . value ( ) ) ; }

Target:
public boolean unify ( com.googlecode.prolog_cafe.lang.Term t , com.googlecode.prolog_cafe.lang.Trail trail ) { if ( t instanceof com.googlecode.prolog_cafe.lang.VariableTerm ) return ( ( com.googlecode.prolog_cafe.lang.VariableTerm ) ( t ) ) . unify ( this , trail ) ; if ( ! ( t instanceof com.googlecode.prolog_cafe.lang.DoubleTerm ) ) return false ; return ( this . val ) == ( ( ( com.googlecode.prolog_cafe.lang.DoubleTerm ) ( t ) ) . value ( ) ) ; }
Source:
protected void setUseContentMerge ( ) throws java.io.IOException { com.google.gerrit.server.project.PutConfig.Input in = new com.google.gerrit.server.project.PutConfig.Input ( ) ; in.useContentMerge = com.google.gerrit.extensions.common.InheritableBoolean.TRUE ; com.google.gerrit.acceptance.RestResponse r = adminSession.put ( ( ( "/projects/" + ( project.get ( ) ) ) + "/config" ) , in ) ; org.junit.Assert.assertEquals ( HttpStatus.SC_OK , r.getStatusCode ( ) ) ; r.consume ( ) ; }

Target:
protected void setUseContentMerge ( ) throws java.io.IOException { com.google.gerrit.server.project.PutConfig.Input in = new com.google.gerrit.server.project.PutConfig.Input ( ) ; in.useContentMerge = com.google.gerrit.extensions.common.InheritableBoolean.TRUE ; com.google.gerrit.acceptance.RestResponse r = adminSession.put ( ( ( "/projects/" + ( project.get ( ) ) ) + "/config" ) , in ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( HttpStatus.SC_OK ) ; r.consume ( ) ; }
Source:
public Response.Redirect apply ( com.google.gerrit.server.account.AccountResource rsrc ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException { com.google.gerrit.server.avatar.AvatarProvider impl = avatarProvider.get ( ) ; if ( impl == null ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( ) ; } java.lang.String url = impl.getUrl ( rsrc.getUser ( ) . getAccount ( ) , size ) ; if ( com.google.common.base.Strings.isNullOrEmpty ( url ) ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( ) ; } else { return com.google.gerrit.extensions.restapi.Response.redirect ( url ) ; } }

Target:
public Response.Redirect apply ( com.google.gerrit.server.account.AccountResource rsrc ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException { com.google.gerrit.server.avatar.AvatarProvider impl = avatarProvider.get ( ) ; if ( impl == null ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( ) ; } java.lang.String url = impl.getUrl ( rsrc.getUser ( ) , size ) ; if ( com.google.common.base.Strings.isNullOrEmpty ( url ) ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( ) ; } else { return com.google.gerrit.extensions.restapi.Response.redirect ( url ) ; } }
Source:
public void addPatchSetFileNames ( com.google.gerrit.server.events.PatchSetAttribute patchSetAttribute , com.google.gerrit.reviewdb.Change change , com.google.gerrit.reviewdb.PatchSet patchSet ) { com.google.gerrit.server.patch.PatchList patchList = patchListCache.get ( change , patchSet ) ; for ( com.google.gerrit.server.patch.PatchListEntry patch : patchList.getPatches ( ) ) { if ( ( patchSetAttribute.files ) == null ) { patchSetAttribute.files = new java.util.ArrayList < com.google.gerrit.server.events.PatchAttribute > ( ) ; } com.google.gerrit.server.events.PatchAttribute p = new com.google.gerrit.server.events.PatchAttribute ( ) ; p.file = patch.getNewName ( ) ; p.type = patch.getChangeType ( ) ; patchSetAttribute.files.add ( p ) ; } }

Target:
public void addPatchSetFileNames ( com.google.gerrit.server.events.PatchSetAttribute patchSetAttribute , com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.reviewdb.client.PatchSet patchSet ) { com.google.gerrit.server.patch.PatchList patchList = patchListCache.get ( change , patchSet ) ; for ( com.google.gerrit.server.patch.PatchListEntry patch : patchList.getPatches ( ) ) { if ( ( patchSetAttribute.files ) == null ) { patchSetAttribute.files = new java.util.ArrayList < com.google.gerrit.server.events.PatchAttribute > ( ) ; } com.google.gerrit.server.events.PatchAttribute p = new com.google.gerrit.server.events.PatchAttribute ( ) ; p.file = patch.getNewName ( ) ; p.type = patch.getChangeType ( ) ; patchSetAttribute.files.add ( p ) ; } }
Source:
public void submitWithFastForward ( ) throws java.lang.Exception { org.eclipse.jgit.api.Git git = createProject ( ) ; org.eclipse.jgit.revwalk.RevCommit oldHead = getRemoteHead ( ) ; com.google.gerrit.acceptance.PushOneCommit.Result change = createChange ( git ) ; submit ( change.getChangeId ( ) ) ; org.eclipse.jgit.revwalk.RevCommit head = getRemoteHead ( ) ; org.junit.Assert.assertEquals ( change.getCommitId ( ) , head.getId ( ) ) ; org.junit.Assert.assertEquals ( oldHead , head.getParent ( 0 ) ) ; assertSubmitter ( change.getChangeId ( ) , 1 ) ; }

Target:
public void submitWithFastForward ( ) throws java.lang.Exception { org.eclipse.jgit.api.Git git = createProject ( ) ; org.eclipse.jgit.revwalk.RevCommit oldHead = getRemoteHead ( ) ; com.google.gerrit.acceptance.PushOneCommit.Result change = createChange ( git ) ; submit ( change.getChangeId ( ) ) ; org.eclipse.jgit.revwalk.RevCommit head = getRemoteHead ( ) ; com.google.common.truth.Truth.assertThat ( head.getId ( ) ) . isEqualTo ( change.getCommitId ( ) ) ; com.google.common.truth.Truth.assertThat ( head.getParent ( 0 ) ) . isEqualTo ( oldHead ) ; assertSubmitter ( change.getChangeId ( ) , 1 ) ; }
Source:
public boolean match ( final com.google.gerrit.server.query.change.ChangeData object ) throws com.google.gwtorm.server.OrmException { for ( com.google.gerrit.reviewdb.client.PatchSet p : object.patches ( ) ) { if ( ( ( p.getRevision ( ) ) != null ) && ( ( p.getRevision ( ) . get ( ) ) != null ) ) { final org.eclipse.jgit.lib.ObjectId id = org.eclipse.jgit.lib.ObjectId.fromString ( p.getRevision ( ) . get ( ) ) ; if ( ( abbrevId.prefixCompare ( id ) ) == 0 ) { return true ; } } } return false ; }

Target:
public boolean match ( final com.google.gerrit.server.query.change.ChangeData object ) throws com.google.gwtorm.server.OrmException { for ( com.google.gerrit.reviewdb.client.PatchSet p : object.patchSets ( ) ) { if ( ( ( p.getRevision ( ) ) != null ) && ( ( p.getRevision ( ) . get ( ) ) != null ) ) { final org.eclipse.jgit.lib.ObjectId id = org.eclipse.jgit.lib.ObjectId.fromString ( p.getRevision ( ) . get ( ) ) ; if ( ( abbrevId.prefixCompare ( id ) ) == 0 ) { return true ; } } } return false ; }
Source:
private static org.eclipse.jgit.dircache.DirCache readTree ( final org.eclipse.jgit.lib.Ref branch , org.eclipse.jgit.revwalk.RevWalk rw ) throws java.io.IOException , org.eclipse.jgit.errors.IncorrectObjectTypeException , org.eclipse.jgit.errors.MissingObjectException { final org.eclipse.jgit.dircache.DirCache dc = org.eclipse.jgit.dircache.DirCache.newInCore ( ) ; final org.eclipse.jgit.dircache.DirCacheBuilder b = dc.builder ( ) ; b.addTree ( new byte [ 0 ] , DirCacheEntry.STAGE_0 , rw.getObjectReader ( ) , rw.parseTree ( branch.getObjectId ( ) ) ) ; b.finish ( ) ; return dc ; }

Target:
private static org.eclipse.jgit.dircache.DirCache readTree ( org.eclipse.jgit.revwalk.RevWalk rw , org.eclipse.jgit.lib.ObjectId base ) throws java.io.IOException { final org.eclipse.jgit.dircache.DirCache dc = org.eclipse.jgit.dircache.DirCache.newInCore ( ) ; final org.eclipse.jgit.dircache.DirCacheBuilder b = dc.builder ( ) ; b.addTree ( new byte [ 0 ] , DirCacheEntry.STAGE_0 , rw.getObjectReader ( ) , rw.parseTree ( base ) ) ; b.finish ( ) ; return dc ; }
Source:
public void stop ( ) { running = false ; int discarded = 0 ; for ( com.googlesource.gerrit.plugins.replication.Destination cfg : config.getDestinations ( ) ) { discarded += cfg.shutdown ( ) ; } if ( discarded > 0 ) { com.googlesource.gerrit.plugins.replication.ReplicationQueue.log.warn ( java.lang.String.format ( "Cancelled %d replication events during shutdown" , discarded ) ) ; } }

Target:
public void stop ( ) { running = false ; int discarded = config.shutdown ( ) ; if ( discarded > 0 ) { com.googlesource.gerrit.plugins.replication.ReplicationQueue.log.warn ( java.lang.String.format ( "Cancelled %d replication events during shutdown" , discarded ) ) ; } }
Source:
private void initApprovals ( final com.google.gerrit.client.changes.PatchSetPublishDetail r , final com.google.gwt.user.client.ui.Panel body ) { for ( final com.google.gerrit.client.data.ApprovalType ct : com.google.gerrit.client.rpc.Common.getGerritConfig ( ) . getApprovalTypes ( ) ) { if ( r.isAllowed ( ct.getCategory ( ) . getId ( ) ) ) { initApprovalType ( r , body , ct ) ; } } }

Target:
private void initApprovals ( final com.google.gerrit.client.changes.PatchSetPublishDetail r , final com.google.gwt.user.client.ui.Panel body ) { for ( final com.google.gerrit.client.data.ApprovalType ct : com.google.gerrit.client.rpc.Common.getGerritConfig ( ) . getApprovalTypes ( ) . getApprovalTypes ( ) ) { if ( r.isAllowed ( ct.getCategory ( ) . getId ( ) ) ) { initApprovalType ( r , body , ct ) ; } } }
Source:
public void onClick ( final com.google.gwt.event.dom.client.ClickEvent event ) { b.setEnabled ( false ) ; Util.MANAGE_SVC.patchSetAction ( max.getId ( ) , patchSet.getId ( ) , new com.google.gerrit.client.rpc.GerritCallback < com.google.gwtjsonrpc.client.VoidResult > ( ) { public void onSuccess ( com.google.gwtjsonrpc.client.VoidResult result ) { actionsPanel.remove ( b ) ; fireOnSuggestRefresh ( ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { b.setEnabled ( true ) ; super . onFailure ( caught ) ; } } ) ; }

Target:
public void onSuccess ( com.google.gwtjsonrpc.client.VoidResult result ) { actionsPanel.remove ( b ) ; fireOnSuggestRefresh ( ) ; }
Source:
public boolean dryRun ( final com.google.gerrit.server.git.CodeReviewCommit mergeTip , final com.google.gerrit.server.git.CodeReviewCommit toMerge ) throws com.google.gerrit.server.git.MergeException { return ( args.mergeUtil.canFastForward ( args.mergeSorter , mergeTip , args.rw , toMerge ) ) || ( args.mergeUtil.canMerge ( args.mergeSorter , args.repo , mergeTip , toMerge ) ) ; }

Target:
public boolean dryRun ( com.google.gerrit.server.git.CodeReviewCommit mergeTip , com.google.gerrit.server.git.CodeReviewCommit toMerge ) throws com.google.gerrit.server.git.MergeException { return ( args.mergeUtil.canFastForward ( args.mergeSorter , mergeTip , args.rw , toMerge ) ) || ( args.mergeUtil.canMerge ( args.mergeSorter , args.repo , mergeTip , toMerge ) ) ; }
Source:
public void addMembers ( java.lang.String ... members ) throws com.google.gerrit.extensions.restapi.RestApiException { try { addMembers.apply ( rsrc , AddMembers.Input.fromMembers ( java.util.Arrays.asList ( members ) ) ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot add group members" , e ) ; } }

Target:
public void addMembers ( java.lang.String ... members ) throws com.google.gerrit.extensions.restapi.RestApiException { try { addMembers.apply ( rsrc , AddMembers.Input.fromMembers ( java.util.Arrays.asList ( members ) ) ) ; } catch ( com.google.gwtorm.server.OrmException | java.io.IOException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot add group members" , e ) ; } }
Source:
private void createBatchUsersGroup ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.Sequences seqs , org.eclipse.jgit.lib.Repository allUsersRepo , com.google.gerrit.common.data.GroupReference groupReference , com.google.gerrit.reviewdb.client.AccountGroup.UUID adminsGroupUuid ) throws com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { com.google.gerrit.server.group.db.InternalGroupCreation groupCreation = getGroupCreation ( seqs , groupReference ) ; com.google.gerrit.server.group.db.InternalGroupUpdate groupUpdate = com.google.gerrit.server.group.db.InternalGroupUpdate.builder ( ) . setDescription ( "Users who perform batch actions on Gerrit" ) . setOwnerGroupUUID ( adminsGroupUuid ) . build ( ) ; createGroup ( db , allUsersRepo , groupCreation , groupUpdate ) ; }

Target:
private void createBatchUsersGroup ( com.google.gerrit.server.Sequences seqs , org.eclipse.jgit.lib.Repository allUsersRepo , com.google.gerrit.common.data.GroupReference groupReference , com.google.gerrit.reviewdb.client.AccountGroup.UUID adminsGroupUuid ) throws com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { com.google.gerrit.server.group.db.InternalGroupCreation groupCreation = getGroupCreation ( seqs , groupReference ) ; com.google.gerrit.server.group.db.InternalGroupUpdate groupUpdate = com.google.gerrit.server.group.db.InternalGroupUpdate.builder ( ) . setDescription ( "Users who perform batch actions on Gerrit" ) . setOwnerGroupUUID ( adminsGroupUuid ) . build ( ) ; createGroup ( allUsersRepo , groupCreation , groupUpdate ) ; }
Source:
static com.google.gerrit.acceptance.GerritServer.Description forTestClass ( com.google.gerrit.acceptance.Description testDesc , java.lang.String configName ) { return new com.google.gerrit.acceptance.AutoValue_GerritServer_Description ( configName , true , ( ! ( com.google.gerrit.acceptance.GerritServer.Description.has ( com.google.gerrit.acceptance.NoHttpd.class , testDesc.getTestClass ( ) ) ) ) , com.google.gerrit.acceptance.GerritServer.Description.has ( com.google.gerrit.acceptance.Sandboxed.class , testDesc.getTestClass ( ) ) , com.google.gerrit.acceptance.GerritServer.Description.has ( com.google.gerrit.acceptance.UseSsh.class , testDesc.getTestClass ( ) ) , null , null ) ; }

Target:
static com.google.gerrit.acceptance.GerritServer.Description forTestClass ( com.google.gerrit.acceptance.Description testDesc , java.lang.String configName ) { return new com.google.gerrit.acceptance.AutoValue_GerritServer_Description ( testDesc , configName , true , ( ! ( com.google.gerrit.acceptance.GerritServer.Description.has ( com.google.gerrit.acceptance.NoHttpd.class , testDesc.getTestClass ( ) ) ) ) , com.google.gerrit.acceptance.GerritServer.Description.has ( com.google.gerrit.acceptance.Sandboxed.class , testDesc.getTestClass ( ) ) , com.google.gerrit.acceptance.GerritServer.Description.has ( com.google.gerrit.acceptance.UseSsh.class , testDesc.getTestClass ( ) ) , null , null ) ; }
Source:
public void send ( com.google.gerrit.server.mail.Address from , java.util.Collection < com.google.gerrit.server.mail.Address > rcpt , java.util.Map < java.lang.String , com.google.gerrit.server.mail.send.EmailHeader > headers , java.lang.String body , java.lang.String htmlBody ) throws com.google.gerrit.common.errors.EmailException { messages.add ( com.google.gerrit.testutil.FakeEmailSender.Message.create ( from , rcpt , headers , body , htmlBody ) ) ; }

Target:
public void send ( com.google.gerrit.server.mail.Address from , java.util.Collection < com.google.gerrit.server.mail.Address > rcpt , java.util.Map < java.lang.String , com.google.gerrit.server.mail.send.EmailHeader > headers , java.lang.String body ) throws com.google.gerrit.common.errors.EmailException { messages.add ( com.google.gerrit.testutil.FakeEmailSender.Message.create ( from , rcpt , headers , body ) ) ; }
Source:
public static void next ( java.lang.String query , int limit , java.lang.String sortkey , com.google.gwtjsonrpc.common.AsyncCallback < com.google.gerrit.client.changes.ChangeList > callback ) { com.google.gerrit.client.rpc.RestApi call = com.google.gerrit.client.changes.ChangeList.newQuery ( query ) ; if ( limit > 0 ) { call.addParameter ( "n" , limit ) ; } com.google.gerrit.client.changes.ChangeList.addOptions ( call , ListChangesOption.LABELS ) ; if ( ! ( PagedSingleListScreen.MAX_SORTKEY.equals ( sortkey ) ) ) { call.addParameter ( "N" , sortkey ) ; } call.send ( callback ) ; }

Target:
public static void next ( java.lang.String query , int limit , java.lang.String sortkey , com.google.gwtjsonrpc.common.AsyncCallback < com.google.gerrit.client.changes.ChangeList > callback ) { com.google.gerrit.client.rpc.RestApi call = com.google.gerrit.client.changes.ChangeList.newQuery ( query ) ; if ( limit > 0 ) { call.addParameter ( "n" , limit ) ; } com.google.gerrit.client.changes.ChangeList.addOptions ( call , ListChangesOption.LABELS ) ; if ( ! ( PagedSingleListScreen.MAX_SORTKEY.equals ( sortkey ) ) ) { call.addParameter ( "N" , sortkey ) ; } call.get ( callback ) ; }
Source:
public void addApprovals ( com.google.gerrit.server.events.PatchSetAttribute p , java.util.Collection < com.google.gerrit.reviewdb.PatchSetApproval > list ) { if ( ! ( list.isEmpty ( ) ) ) { p.approvals = new java.util.ArrayList < com.google.gerrit.server.events.ApprovalAttribute > ( list.size ( ) ) ; for ( com.google.gerrit.reviewdb.PatchSetApproval a : list ) { if ( ( a.getValue ( ) ) != 0 ) { p.approvals.add ( asApprovalAttribute ( a ) ) ; } } if ( p.approvals.isEmpty ( ) ) { p.approvals = null ; } } }

Target:
public void addApprovals ( com.google.gerrit.server.events.PatchSetAttribute p , java.util.Collection < com.google.gerrit.reviewdb.client.PatchSetApproval > list ) { if ( ! ( list.isEmpty ( ) ) ) { p.approvals = new java.util.ArrayList < com.google.gerrit.server.events.ApprovalAttribute > ( list.size ( ) ) ; for ( com.google.gerrit.reviewdb.client.PatchSetApproval a : list ) { if ( ( a.getValue ( ) ) != 0 ) { p.approvals.add ( asApprovalAttribute ( a ) ) ; } } if ( p.approvals.isEmpty ( ) ) { p.approvals = null ; } } }
Source:
public void run ( ) throws java.lang.Exception { parseCommandLine ( ) ; final com.google.gerrit.sshd.commands.QueryShell shell = factory.create ( in , out ) ; shell.setOutputFormat ( format ) ; if ( ( query ) != null ) { shell.execute ( query ) ; } else { shell.run ( ) ; } }

Target:
protected void run ( ) { final com.google.gerrit.sshd.commands.QueryShell shell = factory.create ( in , out ) ; shell.setOutputFormat ( format ) ; if ( ( query ) != null ) { shell.execute ( query ) ; } else { shell.run ( ) ; } }
Source:
public void testUnblockInLocal_Fails ( ) { com.google.gerrit.server.project.Util.grant ( util.getParentConfig ( ) , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.ANONYMOUS , "refs/heads/*" ) . setBlock ( ) ; com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.PUSH , fixers , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl f = util.user ( local , fixers ) ; assertFalse ( "u can't push" , f.controlForRef ( "refs/heads/master" ) . canUpdate ( ) ) ; }

Target:
public void testUnblockInLocal_Fails ( ) { com.google.gerrit.server.project.Util.grant ( util.getParentConfig ( ) , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.ANONYMOUS , "refs/heads/*" ) . setBlock ( ) ; com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.PUSH , fixers , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl f = util.user ( local , fixers ) ; org.junit.Assert.assertFalse ( "u can't push" , f.controlForRef ( "refs/heads/master" ) . canUpdate ( ) ) ; }
Source:
private boolean canPushRef ( java.lang.String ref , boolean noPerms ) { HEAD ( 6.01E8 ) ; com.googlesource.gerrit.plugins.replication.Correct misspelled ; com.googlesource.gerrit.plugins.replication.method name ; return ( ! ( noPerms && ( RefNames.REFS_CONFIG.equals ( ref ) ) ) ) && ( ! ( ref.startsWith ( RefNames.REFS_CACHE_AUTOMERGE ) ) ) ; return ( ! ( noPerms && ( GitRepositoryManager.REF_CONFIG.equals ( ref ) ) ) ) && ( ! ( ref.startsWith ( GitRepositoryManager.REFS_CACHE_AUTOMERGE ) ) ) ; BRANCH ( d23c2e ) ; com.googlesource.gerrit.plugins.replication.Never replicate = ( automerge ) - ( cache ( commits ) ) ; }

Target:
private boolean canPushRef ( java.lang.String ref , boolean noPerms ) { return ( ! ( noPerms && ( RefNames.REFS_CONFIG.equals ( ref ) ) ) ) && ( ! ( ref.startsWith ( RefNames.REFS_CACHE_AUTOMERGE ) ) ) ; }
Source:
public static void topic ( int id , java.lang.String topic , com.google.gwt.user.client.rpc.AsyncCallback < java.lang.String > cb ) { com.google.gerrit.client.rpc.RestApi call = com.google.gerrit.client.changes.ChangeApi.call ( id , "topic" ) ; topic = com.google.gerrit.client.changes.ChangeApi.emptyToNull ( topic ) ; if ( topic != null ) { com.google.gerrit.client.changes.ChangeApi.TopicInput input = com.google.gerrit.client.changes.ChangeApi.TopicInput.create ( ) ; input.topic ( topic ) ; call.put ( input , com.google.gerrit.client.rpc.NativeString.unwrap ( cb ) ) ; } else { call.delete ( com.google.gerrit.client.rpc.NativeString.unwrap ( cb ) ) ; } }

Target:
public static void topic ( @ com.google.gerrit.common.Nullable java.lang.String project , int id , java.lang.String topic , com.google.gwt.user.client.rpc.AsyncCallback < java.lang.String > cb ) { com.google.gerrit.client.rpc.RestApi call = com.google.gerrit.client.changes.ChangeApi.call ( project , id , "topic" ) ; topic = com.google.gerrit.client.changes.ChangeApi.emptyToNull ( topic ) ; if ( topic != null ) { com.google.gerrit.client.changes.ChangeApi.TopicInput input = com.google.gerrit.client.changes.ChangeApi.TopicInput.create ( ) ; input.topic ( topic ) ; call.put ( input , com.google.gerrit.client.rpc.NativeString.unwrap ( cb ) ) ; } else { call.delete ( com.google.gerrit.client.rpc.NativeString.unwrap ( cb ) ) ; } }
Source:
public void testUrlEncoding ( ) { assertEquals ( "foo/bar/thing" , com.googlesource.gerrit.plugins.replication.Destination.encode ( "foo/bar/thing" ) ) ; assertEquals ( "--%20All%20Projects%20--" , com.googlesource.gerrit.plugins.replication.Destination.encode ( "-- All Projects --" ) ) ; assertEquals ( "name/with%20a%20space" , com.googlesource.gerrit.plugins.replication.Destination.encode ( "name/with a space" ) ) ; assertEquals ( "name%0Awith-LF" , com.googlesource.gerrit.plugins.replication.Destination.encode ( "name\nwith-LF" ) ) ; }

Target:
public void testUrlEncoding ( ) { com.google.common.truth.Truth.assertThat ( com.googlesource.gerrit.plugins.replication.Destination.encode ( "foo/bar/thing" ) ) . isEqualTo ( "foo/bar/thing" ) ; com.google.common.truth.Truth.assertThat ( com.googlesource.gerrit.plugins.replication.Destination.encode ( "-- All Projects --" ) ) . isEqualTo ( "--%20All%20Projects%20--" ) ; com.google.common.truth.Truth.assertThat ( com.googlesource.gerrit.plugins.replication.Destination.encode ( "name/with a space" ) ) . isEqualTo ( "name/with%20a%20space" ) ; com.google.common.truth.Truth.assertThat ( com.googlesource.gerrit.plugins.replication.Destination.encode ( "name\nwith-LF" ) ) . isEqualTo ( "name%0Awith-LF" ) ; }
Source:
protected byte [ ] readFile ( java.lang.String fileName ) throws java.io.IOException { if ( ( revision ) == null ) { return new byte [ ] { } ; } org.eclipse.jgit.treewalk.TreeWalk tw = org.eclipse.jgit.treewalk.TreeWalk.forPath ( reader , fileName , revision.getTree ( ) ) ; if ( tw != null ) { org.eclipse.jgit.lib.ObjectLoader obj = reader.open ( tw.getObjectId ( 0 ) , Constants.OBJ_BLOB ) ; return obj.getCachedBytes ( java.lang.Integer.MAX_VALUE ) ; } else { return new byte [ ] { } ; } }

Target:
protected byte [ ] readFile ( java.lang.String fileName ) throws java.io.IOException { if ( ( revision ) == null ) { return new byte [ ] { } ; } org.eclipse.jgit.treewalk.TreeWalk tw = org.eclipse.jgit.treewalk.TreeWalk.forPath ( reader , fileName , revision.getTree ( ) ) ; if ( tw != null ) { org.eclipse.jgit.lib.ObjectLoader obj = reader.open ( tw.getObjectId ( 0 ) , Constants.OBJ_BLOB ) ; return obj.getCachedBytes ( java.lang.Integer.MAX_VALUE ) ; } return new byte [ ] { } ; }
Source:
public void hashtagsWithAccentedCharacters ( ) throws java.lang.Exception { java.lang.String commitMessage = "Jag #måste #öva på min #Svenska!\n\n" + "Jag behöver en #läkare." ; com.google.common.truth.Truth.assertThat ( ( ( java.lang.Iterable < ? > ) ( com.google.gerrit.server.change.HashtagsUtil.extractTags ( commitMessage ) ) ) ) . containsExactlyElementsIn ( com.google.common.collect.Sets.newHashSet ( "måste" , "öva" , "Svenska" , "läkare" ) ) ; }

Target:
public void hashtagsWithAccentedCharacters ( ) throws java.lang.Exception { java.lang.String commitMessage = "Jag #måste #öva på min #Svenska!\n\n" + "Jag behöver en #läkare." ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.server.change.HashtagsUtil.extractTags ( commitMessage ) ) . containsExactlyElementsIn ( com.google.common.collect.Sets.newHashSet ( "måste" , "öva" , "Svenska" , "läkare" ) ) ; }
Source:
public java.util.List < com.google.gerrit.reviewdb.client.PatchLineComment > getForB ( final int lineNbr ) { if ( lineNbr == 0 ) { return java.util.Collections.emptyList ( ) ; } if ( ( forB ) == null ) { forB = index ( b ) ; } return com.google.gerrit.common.data.CommentDetail.get ( forB , lineNbr ) ; }

Target:
public java.util.List < com.google.gerrit.reviewdb.client.PatchLineComment > getForB ( final int lineNbr ) { if ( ( forB ) == null ) { forB = index ( b ) ; } return com.google.gerrit.common.data.CommentDetail.get ( forB , lineNbr ) ; }
Source:
protected static final com.google.gerrit.server.schema.ScriptRunner getScriptRunner ( java.lang.String path ) throws java.io.IOException { if ( path == null ) { return ScriptRunner.NOOP ; } java.io.InputStream in = com.google.gerrit.reviewdb.server.ReviewDb.class . getResourceAsStream ( path ) ; if ( in == null ) { throw new java.lang.IllegalStateException ( ( ( "SQL script " + path ) + " not found" ) ) ; } com.google.gerrit.server.schema.ScriptRunner runner ; try { runner = new com.google.gerrit.server.schema.ScriptRunner ( path , in ) ; } finally { in.close ( ) ; } return runner ; }

Target:
protected static final com.google.gerrit.server.schema.ScriptRunner getScriptRunner ( java.lang.String path ) throws java.io.IOException { if ( path == null ) { return ScriptRunner.NOOP ; } com.google.gerrit.server.schema.ScriptRunner runner ; try ( java.io.InputStream in = com.google.gerrit.reviewdb.server.ReviewDb.class . getResourceAsStream ( path ) ) { if ( in == null ) { throw new java.lang.IllegalStateException ( ( ( "SQL script " + path ) + " not found" ) ) ; } runner = new com.google.gerrit.server.schema.ScriptRunner ( path , in ) ; } return runner ; }
Source:
private static void docSearch ( final java.lang.String token ) { com.google.gwt.core.client.GWT.runAsync ( new com.google.gerrit.client.Dispatcher.AsyncSplit ( token ) { @ java.lang.Override public void onSuccess ( ) { com.google.gerrit.client.Gerrit.display ( this . token , new com.google.gerrit.client.documentation.DocScreen ( com.google.gerrit.client.Dispatcher.skip ( this . token ) ) ) ; } } ) ; }

Target:
private static void docSearch ( final java.lang.String token ) { com.google.gwt.core.client.GWT.runAsync ( new com.google.gerrit.client.Dispatcher.AsyncSplit ( token ) { @ java.lang.Override public void onSuccess ( ) { com.google.gerrit.client.Gerrit.display ( token , new com.google.gerrit.client.documentation.DocScreen ( com.google.gerrit.client.Dispatcher.skip ( token ) ) ) ; } } ) ; }
Source:
public synchronized void addSecureCredentials ( java.lang.String organisation , java.lang.String authUsername , java.lang.String authToken ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { secureConf.load ( ) ; secureConf.setString ( "remote" , organisation , "username" , authUsername ) ; secureConf.setString ( "remote" , organisation , "password" , authToken ) ; secureConf.save ( ) ; }

Target:
public synchronized void addSecureCredentials ( java.lang.String authUsername , java.lang.String authToken ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { secureConf.load ( ) ; secureConf.setString ( "remote" , authUsername , "username" , authUsername ) ; secureConf.setString ( "remote" , authUsername , "password" , authToken ) ; secureConf.save ( ) ; }