auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testUnblockNoForce ( ) { com.google.gerrit.server.project.Util.block ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; org.junit.Assert.assertTrue ( "u can push" , u.controlForRef ( "refs/heads/master" ) . canUpdate ( ) ) ; }

Target:
public void testBlockRule_ParentBlocksChild ( ) { com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/tags/*" ) ; com.google.gerrit.server.project.Util.block ( parent , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/tags/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; assertCannotUpdate ( "refs/tags/V10" , u ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { java.lang.Class.forName ( com.mysql.jdbc.Driver.class . getName ( ) ) ; final java.lang.String host = "localhost" ; final java.lang.String database = "gwtorm" ; final java.lang.String user = "gwtorm" ; final java.lang.String pass = "gwtorm" ; final java.lang.String url = ( ( "jdbc:mysql://" + host ) + "/" ) + database ; try { db = java.sql.DriverManager.getConnection ( url , user , pass ) ; } catch ( java.lang.Throwable t ) { org.junit.Assume.assumeNoException ( t ) ; } executor = new com.google.gwtorm.jdbc.JdbcExecutor ( db ) ; dialect = new com.google.gwtorm.schema.sql.DialectMySQL ( ) . refine ( db ) ; final java.util.Properties p = new java.util.Properties ( ) ; p.setProperty ( "driver" , com.mysql.jdbc.Driver.class . getName ( ) ) ; p.setProperty ( "url" , db.getMetaData ( ) . getURL ( ) ) ; p.setProperty ( "user" , user ) ; p.setProperty ( "password" , pass ) ; phoneBook = new com.google.gwtorm.jdbc.Database < com.google.gwtorm.data.PhoneBookDb > ( new com.google.gwtorm.jdbc.SimpleDataSource ( p ) , com.google.gwtorm.data.PhoneBookDb.class ) ; phoneBook2 = new com.google.gwtorm.jdbc.Database < com.google.gwtorm.data.PhoneBookDb2 > ( new com.google.gwtorm.jdbc.SimpleDataSource ( p ) , com.google.gwtorm.data.PhoneBookDb2.class ) ; drop ( "TABLE address_id" ) ; drop ( "TABLE addresses" ) ; drop ( "TABLE cnt" ) ; drop ( "TABLE foo" ) ; drop ( "TABLE people" ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { java.lang.Class.forName ( com.mysql.jdbc.Driver.class . getName ( ) ) ; final java.lang.String host = "localhost" ; final java.lang.String database = "gwtorm" ; final java.lang.String user = "gwtorm" ; final java.lang.String pass = "gwtorm" ; final java.lang.String url = ( ( "jdbc:mysql://" + host ) + "/" ) + database ; try { db = java.sql.DriverManager.getConnection ( url , user , pass ) ; } catch ( java.lang.Throwable t ) { org.junit.Assume.assumeNoException ( t ) ; } executor = new com.google.gwtorm.jdbc.JdbcExecutor ( db ) ; dialect = new com.google.gwtorm.schema.sql.DialectMySQL ( ) . refine ( db ) ; final java.util.Properties p = new java.util.Properties ( ) ; p.setProperty ( "driver" , com.mysql.jdbc.Driver.class . getName ( ) ) ; p.setProperty ( "url" , db.getMetaData ( ) . getURL ( ) ) ; p.setProperty ( "user" , user ) ; p.setProperty ( "password" , pass ) ; phoneBook = new com.google.gwtorm.jdbc.Database < com.google.gwtorm.data.PhoneBookDb > ( new com.google.gwtorm.jdbc.SimpleDataSource ( p ) , com.google.gwtorm.data.PhoneBookDb.class ) ; phoneBook2 = new com.google.gwtorm.jdbc.Database < com.google.gwtorm.data.PhoneBookDb2 > ( new com.google.gwtorm.jdbc.SimpleDataSource ( p ) , com.google.gwtorm.data.PhoneBookDb2.class ) ; drop ( "TABLE address_id" ) ; drop ( "TABLE addresses" ) ; drop ( "TABLE cnt" ) ; drop ( "TABLE bar" ) ; drop ( "TABLE foo" ) ; drop ( "TABLE people" ) ; }
Source:
public void onSuccess ( com.google.gerrit.client.dashboards.DashboardInfo result ) { if ( com.google.gerrit.client.Dispatcher.matchPrefix ( "/dashboard/" , result.url ( ) ) ) { java.lang.String params = com.google.gerrit.client.Dispatcher.skip ( result.url ( ) ) . substring ( 1 ) ; com.google.gerrit.client.changes.CustomDashboardScreen dash = new com.google.gerrit.client.changes.CustomDashboardScreen ( params ) ; dash.setTitle ( new com.google.gerrit.client.ui.InlineHyperlink ( dash.getTitle ( ) , com.google.gerrit.common.PageLinks.toCustomDashboard ( params ) ) ) ; com.google.gerrit.client.Gerrit.display ( token , dash ) ; } }

Target:
public void onSuccess ( com.google.gerrit.client.dashboards.DashboardInfo result ) { if ( com.google.gerrit.client.Dispatcher.matchPrefix ( "/dashboard/" , result.url ( ) ) ) { java.lang.String params = com.google.gerrit.client.Dispatcher.skip ( result.url ( ) ) . substring ( 1 ) ; com.google.gerrit.client.changes.ProjectDashboardScreen dash = new com.google.gerrit.client.changes.ProjectDashboardScreen ( new com.google.gerrit.reviewdb.client.Project.NameKey ( project ) , params ) ; com.google.gerrit.client.Gerrit.display ( token , dash ) ; } }
Source:
public void revokedKeyDueToCompromiseRevokesKeyRetroactively ( ) throws java.lang.Exception { com.google.gerrit.gpg.testutil.TestKey k = add ( com.google.gerrit.gpg.testutil.TestKeys.revokedCompromisedKey ( ) ) ; add ( com.google.gerrit.gpg.testutil.TestKeys.validKeyWithoutExpiration ( ) ) ; save ( ) ; java.lang.String problem = "Key is revoked (key material has been compromised): test6 compromised" ; assertProblems ( k , problem ) ; java.text.SimpleDateFormat df = new java.text.SimpleDateFormat ( "yyyy-MM-dd HH:mm:ss" ) ; com.google.gerrit.gpg.PublicKeyChecker checker = new com.google.gerrit.gpg.PublicKeyChecker ( ) . setStore ( store ) . setEffectiveTime ( df.parse ( "2010-01-01 12:00:00" ) ) ; assertProblems ( checker , k , problem ) ; }

Target:
public void revokedKeyDueToCompromiseRevokesKeyRetroactively ( ) throws java.lang.Exception { com.google.gerrit.gpg.testing.TestKey k = add ( com.google.gerrit.gpg.testing.TestKeys.revokedCompromisedKey ( ) ) ; add ( com.google.gerrit.gpg.testing.TestKeys.validKeyWithoutExpiration ( ) ) ; save ( ) ; java.lang.String problem = "Key is revoked (key material has been compromised): test6 compromised" ; assertProblems ( k , problem ) ; java.text.SimpleDateFormat df = new java.text.SimpleDateFormat ( "yyyy-MM-dd HH:mm:ss" ) ; com.google.gerrit.gpg.PublicKeyChecker checker = new com.google.gerrit.gpg.PublicKeyChecker ( ) . setStore ( store ) . setEffectiveTime ( df.parse ( "2010-01-01 12:00:00" ) ) ; assertProblems ( checker , k , problem ) ; }
Source:
public T call ( ) throws java.lang.Exception { if ( ( threadLocal.get ( ) ) != null ) { throw new java.lang.IllegalStateException ( ( "Cannot continue request, " + ( "thread already has request in progress. A new thread must " + "be used to propagate the request scope context." ) ) ) ; } threadLocal.set ( ctx ) ; try { return callable.call ( ) ; } finally { threadLocal.remove ( ) ; } }

Target:
public T call ( ) throws java.lang.Exception { C old = threadLocal.get ( ) ; threadLocal.set ( ctx ) ; try { return callable.call ( ) ; } finally { if ( old != null ) { threadLocal.set ( old ) ; } else { threadLocal.remove ( ) ; } } }
Source:
private void insertDummyApproval ( final com.google.gerrit.reviewdb.Change change , final com.google.gerrit.reviewdb.PatchSet.Id psId , 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 { final com.google.gerrit.reviewdb.PatchSetApproval ca = new com.google.gerrit.reviewdb.PatchSetApproval ( new com.google.gerrit.reviewdb.PatchSetApproval.Key ( psId , forAccount , catId ) , ( ( short ) ( 0 ) ) ) ; ca.cache ( change ) ; db.patchSetApprovals ( ) . insert ( java.util.Collections.singleton ( ca ) ) ; }

Target:
private void insertDummyApproval ( final com.google.gerrit.reviewdb.client.Change change , final com.google.gerrit.reviewdb.client.PatchSet.Id psId , final com.google.gerrit.reviewdb.client.Account.Id forAccount , final com.google.gerrit.reviewdb.client.ApprovalCategory.Id catId , final com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { final com.google.gerrit.reviewdb.client.PatchSetApproval ca = new com.google.gerrit.reviewdb.client.PatchSetApproval ( new com.google.gerrit.reviewdb.client.PatchSetApproval.Key ( psId , forAccount , catId ) , ( ( short ) ( 0 ) ) ) ; ca.cache ( change ) ; db.patchSetApprovals ( ) . insert ( java.util.Collections.singleton ( ca ) ) ; }
Source:
private void appendQuotedParent ( java.lang.StringBuilder out , com.google.gerrit.reviewdb.client.Comment child ) { com.google.common.base.Optional < com.google.gerrit.reviewdb.client.Comment > parent = getParent ( child ) ; if ( parent.isPresent ( ) ) { out.append ( "> " ) . append ( getShortenedCommentMessage ( parent.get ( ) ) ) . append ( '\n' ) ; } }

Target:
private void appendQuotedParent ( java.lang.StringBuilder out , com.google.gerrit.reviewdb.client.Comment child ) { java.util.Optional < com.google.gerrit.reviewdb.client.Comment > parent = getParent ( child ) ; if ( parent.isPresent ( ) ) { out.append ( "> " ) . append ( getShortenedCommentMessage ( parent.get ( ) ) ) . append ( '\n' ) ; } }
Source:
private boolean canPerformOnAnyRef ( com.google.gerrit.reviewdb.ApprovalCategory.Id actionId , short requireValue ) { final java.util.Set < com.google.gerrit.reviewdb.AccountGroup.Id > groups = user.getEffectiveGroups ( ) ; for ( final com.google.gerrit.reviewdb.RefRight pr : state.getAllRights ( actionId , true ) ) { if ( ( groups.contains ( pr.getAccountGroupId ( ) ) ) && ( ( pr.getMaxValue ( ) ) >= requireValue ) ) { return true ; } } return false ; }

Target:
private java.util.Set < com.google.gerrit.reviewdb.AccountGroup.Id > getEffectiveUserGroups ( ) { final java.util.Set < com.google.gerrit.reviewdb.AccountGroup.Id > userGroups = user.getEffectiveGroups ( ) ; if ( isOwner ( ) ) { final java.util.Set < com.google.gerrit.reviewdb.AccountGroup.Id > userGroupsOnProject = new java.util.HashSet < com.google.gerrit.reviewdb.AccountGroup.Id > ( ( ( userGroups.size ( ) ) + 1 ) ) ; userGroupsOnProject.addAll ( userGroups ) ; userGroupsOnProject.add ( systemConfig.ownerGroupId ) ; return java.util.Collections.unmodifiableSet ( userGroupsOnProject ) ; } else { return userGroups ; } }
Source:
public java.util.Collection < com.google.gerrit.reviewdb.client.PatchSetApproval > currentApprovals ( com.google.inject.Provider < com.google.gerrit.reviewdb.server.ReviewDb > db ) throws com.google.gwtorm.server.OrmException { if ( ( currentApprovals ) == null ) { com.google.gerrit.reviewdb.client.Change c = change ( db ) ; if ( c == null ) { currentApprovals = java.util.Collections.emptyList ( ) ; } else { currentApprovals = approvalsFor ( db , c.currentPatchSetId ( ) ) ; } } return currentApprovals ; }

Target:
public com.google.gerrit.reviewdb.client.PatchSet currentPatchSet ( com.google.inject.Provider < com.google.gerrit.reviewdb.server.ReviewDb > db ) throws com.google.gwtorm.server.OrmException { if ( ( currentPatchSet ) == null ) { com.google.gerrit.reviewdb.client.Change c = change ( db ) ; if ( c == null ) { return null ; } for ( com.google.gerrit.reviewdb.client.PatchSet p : patches ( db ) ) { if ( p.getId ( ) . equals ( c.currentPatchSetId ( ) ) ) { currentPatchSet = p ; return p ; } } } return currentPatchSet ; }
Source:
public com.google.gitiles.GitilesView.Builder setPathPart ( java.lang.String path ) { switch ( type ) { case PATH : case DIFF : com.google.common.base.Preconditions.checkState ( ( path != null ) , "cannot set null path on %s view" , type ) ; break ; case DESCRIBE : case REFS : case LOG : break ; default : com.google.common.base.Preconditions.checkState ( ( path == null ) , "cannot set path on %s view" , type ) ; break ; } this . path = ( path != null ) ? com.google.gitiles.GitilesView.maybeTrimLeadingAndTrailingSlash ( path ) : null ; return this ; }

Target:
public com.google.gitiles.GitilesView.Builder setPathPart ( java.lang.String path ) { switch ( type ) { case PATH : case DIFF : com.google.common.base.Preconditions.checkState ( ( path != null ) , "cannot set null path on %s view" , type ) ; break ; case ARCHIVE : case DESCRIBE : case REFS : case LOG : break ; default : com.google.common.base.Preconditions.checkState ( ( path == null ) , "cannot set path on %s view" , type ) ; break ; } this . path = ( path != null ) ? com.google.gitiles.GitilesView.maybeTrimLeadingAndTrailingSlash ( path ) : null ; return this ; }
Source:
private java.util.List < com.google.gerrit.server.change.SuggestReviewers.SuggestedReviewerInfo > suggestReviewers ( com.google.gerrit.acceptance.RestSession session , java.lang.String changeId , java.lang.String query , int n ) throws java.io.IOException { return newGson ( ) . fromJson ( session.get ( ( ( ( ( ( "/changes/" + changeId ) + "/suggest_reviewers?q=" ) + query ) + "&n=" ) + n ) ) . getReader ( ) , new com.google.gson.reflect.TypeToken < java.util.List < com.google.gerrit.server.change.SuggestReviewers.SuggestedReviewerInfo > > ( ) { } . getType ( ) ) ; }

Target:
public void suggestReviewersWithoutLimitOptionSpecified ( ) throws java.lang.Exception { java.lang.String changeId = createChange ( ) . getChangeId ( ) ; java.lang.String query = "users3" ; java.util.List < com.google.gerrit.extensions.common.SuggestedReviewerInfo > suggestedReviewerInfos = newGson ( ) . fromJson ( adminSession.get ( ( ( ( "/changes/" + changeId ) + "/suggest_reviewers?q=" ) + query ) ) . getReader ( ) , new com.google.gson.reflect.TypeToken < java.util.List < com.google.gerrit.extensions.common.SuggestedReviewerInfo > > ( ) { } . getType ( ) ) ; com.google.common.truth.Truth.assertThat ( suggestedReviewerInfos ) . hasSize ( 1 ) ; }
Source:
protected void configure ( ) { bind ( java.io.File.class ) . annotatedWith ( com.google.gerrit.server.config.SitePath.class ) . toInstance ( getSitePath ( ) ) ; bind ( com.google.gerrit.pgm.init.Browser.class ) ; bind ( java.lang.String.class ) . annotatedWith ( com.google.gerrit.server.securestore.SecureStoreClassName.class ) . toProvider ( com.google.inject.util.Providers.of ( getConfiguredSecureStoreClass ( ) ) ) ; }

Target:
protected void configure ( ) { bind ( java.nio.file.Path.class ) . annotatedWith ( com.google.gerrit.server.config.SitePath.class ) . toInstance ( getSitePath ( ) ) ; bind ( com.google.gerrit.pgm.init.Browser.class ) ; bind ( java.lang.String.class ) . annotatedWith ( com.google.gerrit.server.securestore.SecureStoreClassName.class ) . toProvider ( com.google.inject.util.Providers.of ( getConfiguredSecureStoreClass ( ) ) ) ; }
Source:
public java.util.List < com.google.gerrit.extensions.common.ChangeInfo > submittedTogether ( ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return ( ( java.util.List < com.google.gerrit.extensions.common.ChangeInfo > ) ( submittedTogether.apply ( change ) ) ) ; } catch ( java.io.IOException | com.google.gwtorm.server.OrmException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot query submittedTogether" , e ) ; } }

Target:
public java.util.List < com.google.gerrit.extensions.common.ChangeInfo > submittedTogether ( ) throws com.google.gerrit.extensions.restapi.RestApiException { com.google.gerrit.extensions.api.changes.SubmittedTogetherInfo info = submittedTogether ( java.util.EnumSet.noneOf ( com.google.gerrit.extensions.client.ListChangesOption.class ) , java.util.EnumSet.noneOf ( com.google.gerrit.extensions.api.changes.SubmittedTogetherOption.class ) ) ; return info.changes ; }
Source:
public com.google.gerrit.extensions.api.changes.RevisionApi revision ( java.lang.String id ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return revisionApi.create ( revisions.parse ( change , com.google.gerrit.extensions.restapi.IdString.fromDecoded ( id ) ) ) ; } catch ( com.google.gwtorm.server.OrmException | java.io.IOException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot parse revision" , e ) ; } }

Target:
public com.google.gerrit.extensions.api.changes.RevisionApi revision ( java.lang.String id ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return revisionApi.create ( revisions.parse ( change , com.google.gerrit.extensions.restapi.IdString.fromDecoded ( id ) ) ) ; } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( "Cannot parse revision" , e ) ; } }
Source:
public java.lang.String createLinkForWebui ( java.lang.String url , java.lang.String text ) { java.lang.String ret = "[" + url ; if ( ( ( text != null ) && ( ! ( text.isEmpty ( ) ) ) ) && ( ! ( text.equals ( url ) ) ) ) { ret += "|" + text ; } ret += "]" ; return ret ; }

Target:
public java.lang.String createLinkForWebui ( java.lang.String url , java.lang.String text ) { if ( ( ( text != null ) && ( ! ( text.isEmpty ( ) ) ) ) && ( ! ( text.equals ( url ) ) ) ) { return ( ( ( ( "[" + text ) + "]" ) + "(" ) + url ) + ")" ; } return url ; }
Source:
void display ( com.google.gerrit.client.changes.ChangeInfo info , java.lang.String revision ) { this . revision = revision ; boolean hasUser = com.google.gerrit.client.Gerrit.isSignedIn ( ) ; com.google.gerrit.client.changes.ChangeInfo.RevisionInfo revInfo = info.revision ( revision ) ; com.google.gerrit.client.changes.ChangeInfo.CommitInfo commit = revInfo.commit ( ) ; changeId = info.legacy_id ( ) ; project = info.project ( ) ; subject = commit.subject ( ) ; message = commit.message ( ) ; initChangeActions ( info , hasUser ) ; initRevisionActions ( info , revInfo , hasUser ) ; }

Target:
void display ( com.google.gerrit.client.changes.ChangeInfo info , java.lang.String revision ) { this . revision = revision ; boolean hasUser = com.google.gerrit.client.Gerrit.isSignedIn ( ) ; com.google.gerrit.client.changes.ChangeInfo.RevisionInfo revInfo = info.revision ( revision ) ; com.google.gerrit.client.changes.ChangeInfo.CommitInfo commit = revInfo.commit ( ) ; changeId = info.legacy_id ( ) ; project = info.project ( ) ; subject = commit.subject ( ) ; message = commit.message ( ) ; changeInfo = info ; initChangeActions ( info , hasUser ) ; initRevisionActions ( info , revInfo , hasUser ) ; }
Source:
public void onFailure ( java.lang.Throwable caught ) { if ( ( ! ( isNoSuchEntity ( caught ) ) ) && ( ( rpcSequence ) == rpcseq ) ) { super . onFailure ( caught ) ; } }

Target:
public void onFailure ( final java.lang.Throwable caught ) { if ( ( rpcSequence ) == rpcseq ) { if ( ( isNoDifferences ( caught ) ) && ( ! isFirst ) ) { historyTable.enableAll ( true ) ; showPatch ( false ) ; } else { super . onFailure ( caught ) ; } } }
Source:
public void run ( ) { net.codemirror.lib.CodeMirror.FromTo fromTo = cm.getViewport ( ) ; int size = ( ( fromTo.getTo ( ) ) - ( fromTo.getFrom ( ) ) ) + 1 ; if ( ( cm.getOldViewportSize ( ) ) == size ) { return ; } cm.setOldViewportSize ( size ) ; diffTable.sidePanel.adjustGutters ( cmB ) ; }

Target:
void resizeCodeMirror ( ) { if ( ( cmA ) == null ) { return ; } int h = ( ( ( com.google.gerrit.client.Gerrit.getHeaderFooterHeight ( ) ) + ( reviewed.getOffsetHeight ( ) ) ) + ( diffTable.getHeaderHeight ( ) ) ) + 10 ; cmA.setHeight ( ( ( com.google.gwt.user.client.Window.getClientHeight ( ) ) - h ) ) ; cmA.refresh ( ) ; cmB.setHeight ( ( ( com.google.gwt.user.client.Window.getClientHeight ( ) ) - h ) ) ; cmB.refresh ( ) ; }
Source:
private java.util.Map < java.lang.String , com.google.gerrit.reviewdb.client.PatchLineComment > changeDrafts ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx ) throws com.google.gwtorm.server.OrmException { java.util.Map < java.lang.String , com.google.gerrit.reviewdb.client.PatchLineComment > drafts = com.google.common.collect.Maps.newHashMap ( ) ; for ( com.google.gerrit.reviewdb.client.PatchLineComment c : plcUtil.draftByChangeAuthor ( ctx.getDb ( ) , ctx.getChangeNotes ( ) , user.getAccountId ( ) ) ) { drafts.put ( c.getKey ( ) . get ( ) , c ) ; } return drafts ; }

Target:
private java.util.Set < com.google.gerrit.server.change.PostReview.CommentSetEntry > readExistingComments ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx ) throws com.google.gwtorm.server.OrmException { java.util.Set < com.google.gerrit.server.change.PostReview.CommentSetEntry > r = new java.util.HashSet < > ( ) ; for ( com.google.gerrit.reviewdb.client.PatchLineComment c : plcUtil.publishedByChange ( ctx.getDb ( ) , ctx.getNotes ( ) ) ) { r.add ( com.google.gerrit.server.change.PostReview.CommentSetEntry.create ( c ) ) ; } return r ; }
Source:
static void initialize ( org.eclipse.jgit.lib.Config cfg ) { cfg.setString ( com.googlesource.gerrit.plugins.xdocs.XDocGlobalConfig.SECTION_FORMATTER , AsciidoctorFormatter.NAME , com.googlesource.gerrit.plugins.xdocs.XDocGlobalConfig.KEY_EXT , "adoc" ) ; cfg.setString ( com.googlesource.gerrit.plugins.xdocs.XDocGlobalConfig.SECTION_FORMATTER , MarkdownFormatter.NAME , com.googlesource.gerrit.plugins.xdocs.XDocGlobalConfig.KEY_MIME_TYPE , "text/x-markdown" ) ; cfg.setString ( com.googlesource.gerrit.plugins.xdocs.XDocGlobalConfig.SECTION_FORMATTER , PlainTextFormatter.NAME , com.googlesource.gerrit.plugins.xdocs.XDocGlobalConfig.KEY_MIME_TYPE , "text/plain" ) ; }

Target:
static void initialize ( org.eclipse.jgit.lib.Config cfg ) { cfg.setString ( com.googlesource.gerrit.plugins.xdocs.XDocGlobalConfig.SECTION_FORMATTER , AsciidoctorFormatter.NAME , com.googlesource.gerrit.plugins.xdocs.XDocGlobalConfig.KEY_EXT , "adoc" ) ; cfg.setStringList ( com.googlesource.gerrit.plugins.xdocs.XDocGlobalConfig.SECTION_FORMATTER , DocxFormatter.NAME , com.googlesource.gerrit.plugins.xdocs.XDocGlobalConfig.KEY_EXT , java.util.Arrays.asList ( "docx" , "pptx" , "xlsx" ) ) ; cfg.setString ( com.googlesource.gerrit.plugins.xdocs.XDocGlobalConfig.SECTION_FORMATTER , MarkdownFormatter.NAME , com.googlesource.gerrit.plugins.xdocs.XDocGlobalConfig.KEY_MIME_TYPE , "text/x-markdown" ) ; cfg.setString ( com.googlesource.gerrit.plugins.xdocs.XDocGlobalConfig.SECTION_FORMATTER , PlainTextFormatter.NAME , com.googlesource.gerrit.plugins.xdocs.XDocGlobalConfig.KEY_MIME_TYPE , "text/plain" ) ; cfg.setStringList ( com.googlesource.gerrit.plugins.xdocs.XDocGlobalConfig.SECTION_FORMATTER , ZipFormatter.NAME , com.googlesource.gerrit.plugins.xdocs.XDocGlobalConfig.KEY_EXT , java.util.Arrays.asList ( "jar" , "war" , "zip" ) ) ; }
Source:
public static com.google.inject.Injector createInjector ( ) { return com.google.gerrit.server.config.GerritGlobalModule.createInjector ( com.google.inject.Guice.createInjector ( com.google.inject.Stage.PRODUCTION , new com.google.gerrit.server.config.DatabaseModule ( ) ) ) ; }

Target:
public static com.google.inject.Injector createInjector ( ) { final com.google.inject.Injector db = com.google.inject.Guice.createInjector ( com.google.inject.Stage.PRODUCTION , new com.google.gerrit.server.config.DatabaseModule ( ) ) ; final com.google.gerrit.server.config.CanonicalWebUrlModule canonicalWebUrl = new com.google.gerrit.server.config.CanonicalWebUrlModule ( ) { @ java.lang.Override protected java.lang.Class < ? extends com.google.inject.Provider < java.lang.String > > provider ( ) { return com.google.gerrit.server.config.CanonicalWebUrlProvider.class ; } } ; return com.google.gerrit.server.config.GerritGlobalModule.createInjector ( db , canonicalWebUrl ) ; }
Source:
public java.util.Set < com.google.gerrit.reviewdb.client.Change.Id > getStarredChanges ( ) { if ( ( starredChanges ) == null ) { checkRequestScope ( ) ; try { starredChanges = com.google.gerrit.server.IdentifiedUser.starredChangeIds ( ( ( starredQuery ) != null ? starredQuery : starredQuery ( ) ) ) ; } catch ( com.google.gwtorm.server.OrmException | java.lang.RuntimeException e ) { com.google.gerrit.server.IdentifiedUser.log.warn ( "Cannot query starred changes" , e ) ; starredChanges = java.util.Collections.emptySet ( ) ; } finally { starredQuery = null ; } } return starredChanges ; }

Target:
public java.util.Set < com.google.gerrit.reviewdb.client.Change.Id > getStarredChanges ( ) { if ( ( starredChanges ) == null ) { if ( ( starredChangesUtil ) == null ) { throw new java.lang.IllegalStateException ( "StarredChangesUtil is missing" ) ; } try { starredChanges = com.google.common.collect.FluentIterable.from ( ( ( starredQuery ) != null ? starredQuery : starredChangesUtil.query ( accountId ) ) ) . toSet ( ) ; } finally { starredQuery = null ; } } return starredChanges ; }
Source:
public void onSuccess ( com.google.gerrit.client.diff.DiffInfo info ) { new net.codemirror.lib.ModeInjector ( ) . add ( getContentType ( info.meta_a ( ) ) ) . add ( getContentType ( info.meta_b ( ) ) ) . inject ( com.google.gerrit.client.rpc.CallbackGroup.< java.lang.Void > emptyCallback ( ) ) ; }

Target:
public void onSuccess ( com.google.gerrit.client.diff.DiffInfo diffInfo ) { if ( ( id == ( reloadVersionId ) ) && ( isAttached ( ) ) ) { diff = diffInfo ; operation ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { skipManager.removeAll ( ) ; chunkManager.reset ( ) ; diffTable.overview.clearDiffMarkers ( ) ; setShowIntraline ( prefs.intralineDifference ( ) ) ; render ( diff ) ; skipManager.render ( prefs.context ( ) , diff ) ; } } ) ; } }
Source:
private static java.lang.String addKey ( java.util.List < java.util.Optional < com.google.gerrit.reviewdb.client.AccountSshKey > > keys , java.lang.String pub ) { com.google.gerrit.reviewdb.client.AccountSshKey.Id keyId = new com.google.gerrit.reviewdb.client.AccountSshKey.Id ( new com.google.gerrit.reviewdb.client.Account.Id ( 1 ) , ( ( keys.size ( ) ) + 1 ) ) ; com.google.gerrit.reviewdb.client.AccountSshKey key = new com.google.gerrit.reviewdb.client.AccountSshKey ( keyId , pub ) ; keys.add ( java.util.Optional.of ( key ) ) ; return ( key.getSshPublicKey ( ) ) + "\n" ; }

Target:
private static java.lang.String addKey ( java.util.List < java.util.Optional < com.google.gerrit.server.account.AccountSshKey > > keys , java.lang.String pub ) { com.google.gerrit.server.account.AccountSshKey.Id keyId = new com.google.gerrit.server.account.AccountSshKey.Id ( new com.google.gerrit.reviewdb.client.Account.Id ( 1 ) , ( ( keys.size ( ) ) + 1 ) ) ; com.google.gerrit.server.account.AccountSshKey key = new com.google.gerrit.server.account.AccountSshKey ( keyId , pub ) ; keys.add ( java.util.Optional.of ( key ) ) ; return ( key.getSshPublicKey ( ) ) + "\n" ; }
Source:
protected void setupSoyContext ( ) { soyContext = new java.util.LinkedHashMap < > ( ) ; }

Target:
protected void setupSoyContext ( ) { soyContext = new java.util.HashMap < > ( ) ; soyContext.put ( "messageClass" , messageClass ) ; soyContextEmailData = new java.util.HashMap < > ( ) ; soyContextEmailData.put ( "settingsUrl" , getSettingsUrl ( ) ) ; soyContextEmailData.put ( "gerritHost" , getGerritHost ( ) ) ; soyContextEmailData.put ( "gerritUrl" , getGerritUrl ( ) ) ; soyContext.put ( "email" , soyContextEmailData ) ; }
Source:
public void onSuccess ( T result ) { com.google.gwt.core.client.JsArray < com.google.gerrit.client.change.RelatedChanges.ChangeAndCommit > changes = convert ( result ) ; if ( ( changes.length ( ) ) > 0 ) { setTabTitle ( tabInfo , tabInfo.getTitle ( changes.length ( ) ) ) ; getTab ( tabInfo ) . setChanges ( project , revision , changes ) ; } onDone ( ( ( changes.length ( ) ) > 0 ) ) ; }

Target:
public void onSuccess ( T result ) { if ( com.google.gerrit.client.change.RelatedChanges.TabCallback.isAttached ( ) ) { com.google.gwt.core.client.JsArray < com.google.gerrit.client.change.RelatedChanges.ChangeAndCommit > changes = convert ( result ) ; if ( ( changes.length ( ) ) > 0 ) { setTabTitle ( tabInfo , tabInfo.getTitle ( changes.length ( ) ) ) ; getTab ( tabInfo ) . setChanges ( project , revision , changes ) ; } onDone ( ( ( changes.length ( ) ) > 0 ) ) ; } }
Source:
protected boolean canDelete ( com.google.gerrit.server.project.ProjectResource rsrc ) { com.google.gerrit.server.permissions.PermissionBackend.WithUser userPermission = permissionBackend.user ( userProvider ) ; return ( ( userPermission.testOrFalse ( GlobalPermission.ADMINISTRATE_SERVER ) ) || ( userPermission.testOrFalse ( new com.google.gerrit.extensions.api.access.PluginPermission ( pluginName , com.googlesource.gerrit.plugins.deleteproject.DeleteProjectCapability.DELETE_PROJECT ) ) ) ) || ( ( userPermission.testOrFalse ( new com.google.gerrit.extensions.api.access.PluginPermission ( pluginName , com.googlesource.gerrit.plugins.deleteproject.DeleteOwnProjectCapability.DELETE_OWN_PROJECT ) ) ) && ( rsrc.getControl ( ) . isOwner ( ) ) ) ; }

Target:
protected boolean canDelete ( com.google.gerrit.server.project.ProjectResource rsrc ) { com.google.gerrit.server.permissions.PermissionBackend.WithUser userPermission = permissionBackend.user ( userProvider ) ; com.google.gerrit.server.permissions.PermissionBackend.ForProject projectPermission = userPermission.project ( rsrc.getNameKey ( ) ) ; return ( ( userPermission.testOrFalse ( GlobalPermission.ADMINISTRATE_SERVER ) ) || ( userPermission.testOrFalse ( new com.google.gerrit.extensions.api.access.PluginPermission ( pluginName , com.googlesource.gerrit.plugins.deleteproject.DeleteProjectCapability.DELETE_PROJECT ) ) ) ) || ( ( userPermission.testOrFalse ( new com.google.gerrit.extensions.api.access.PluginPermission ( pluginName , com.googlesource.gerrit.plugins.deleteproject.DeleteOwnProjectCapability.DELETE_OWN_PROJECT ) ) ) && ( projectPermission.testOrFalse ( ProjectPermission.WRITE_CONFIG ) ) ) ; }
Source:
public void fire ( com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.reviewdb.client.PatchSet patchSet , com.google.gerrit.reviewdb.client.Account.Id accountId ) { try { fire ( util.changeInfo ( change ) , util.revisionInfo ( change.getProject ( ) , patchSet ) , util.accountInfo ( accountId ) ) ; } catch ( com.google.gerrit.server.patch.PatchListNotAvailableException | com.google.gerrit.server.GpgException | java.io.IOException | com.google.gwtorm.server.OrmException e ) { com.google.gerrit.server.extensions.events.DraftPublished.log.error ( "Couldn't fire event" , e ) ; } }

Target:
public void fire ( com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.reviewdb.client.PatchSet patchSet , com.google.gerrit.reviewdb.client.Account.Id accountId , java.sql.Timestamp when ) { try { fire ( util.changeInfo ( change ) , util.revisionInfo ( change.getProject ( ) , patchSet ) , util.accountInfo ( accountId ) , when ) ; } catch ( com.google.gerrit.server.patch.PatchListNotAvailableException | com.google.gerrit.server.GpgException | java.io.IOException | com.google.gwtorm.server.OrmException e ) { com.google.gerrit.server.extensions.events.DraftPublished.log.error ( "Couldn't fire event" , e ) ; } }
Source:
public void upsertProjectWatches ( com.google.gerrit.reviewdb.client.Account.Id accountId , java.util.Map < com.google.gerrit.server.account.WatchConfig.ProjectWatchKey , java.util.Collection < com.google.gerrit.reviewdb.client.AccountProjectWatch.NotifyType > > newProjectWatches ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { try ( com.google.gerrit.server.account.WatchConfig watchConfig = open ( accountId ) ) { java.util.Map < com.google.gerrit.server.account.WatchConfig.ProjectWatchKey , java.util.Collection < com.google.gerrit.reviewdb.client.AccountProjectWatch.NotifyType > > projectWatches = watchConfig.getProjectWatches ( ) ; projectWatches.putAll ( newProjectWatches ) ; commit ( watchConfig ) ; } }

Target:
public synchronized void upsertProjectWatches ( com.google.gerrit.reviewdb.client.Account.Id accountId , java.util.Map < com.google.gerrit.server.account.WatchConfig.ProjectWatchKey , java.util.Set < com.google.gerrit.server.account.WatchConfig.NotifyType > > newProjectWatches ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { com.google.gerrit.server.account.WatchConfig watchConfig = read ( accountId ) ; java.util.Map < com.google.gerrit.server.account.WatchConfig.ProjectWatchKey , java.util.Set < com.google.gerrit.server.account.WatchConfig.NotifyType > > projectWatches = watchConfig.getProjectWatches ( ) ; projectWatches.putAll ( newProjectWatches ) ; commit ( watchConfig ) ; }
Source:
private com.google.inject.Key < javax.servlet.http.HttpServlet > changeQuery ( ) { return key ( new javax.servlet.http.HttpServlet ( ) { @ java.lang.Override protected void doGet ( final javax.servlet.http.HttpServletRequest req , final javax.servlet.http.HttpServletResponse rsp ) throws java.io.IOException { toGerrit ( com.google.gerrit.common.PageLinks.toChangeQuery ( req.getPathInfo ( ) ) , req , rsp ) ; } } ) ; }

Target:
private com.google.inject.Key < javax.servlet.http.HttpServlet > changeQuery ( ) { return key ( new javax.servlet.http.HttpServlet ( ) { private static final long serialVersionUID = 1L ; @ java.lang.Override protected void doGet ( final javax.servlet.http.HttpServletRequest req , final javax.servlet.http.HttpServletResponse rsp ) throws java.io.IOException { toGerrit ( com.google.gerrit.common.PageLinks.toChangeQuery ( req.getPathInfo ( ) ) , req , rsp ) ; } } ) ; }
Source:
public void testAppend_int ( ) { final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder b = new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) ; org.junit.Assert.assertSame ( b , b.append ( 4 ) ) ; org.junit.Assert.assertSame ( b , b.append ( 2 ) ) ; org.junit.Assert.assertSame ( b , b.append ( ( - 100 ) ) ) ; org.junit.Assert.assertEquals ( "42-100" , b.asString ( ) ) ; }

Target:
public void testAppend_int ( ) { final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder b = new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) ; com.google.common.truth.Truth.assertThat ( b ) . isSameAs ( b.append ( 4 ) ) ; com.google.common.truth.Truth.assertThat ( b ) . isSameAs ( b.append ( 2 ) ) ; com.google.common.truth.Truth.assertThat ( b ) . isSameAs ( b.append ( ( - 100 ) ) ) ; com.google.common.truth.Truth.assertThat ( b.asString ( ) ) . isEqualTo ( "42-100" ) ; }
Source:
private void merge ( com.google.gerrit.acceptance.PushOneCommit.Result r ) throws java.lang.Exception { review ( r , 2 ) ; revision ( r ) . submit ( ) ; org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( project ) ; try { org.junit.Assert.assertEquals ( r.getCommitId ( ) , repo.getRef ( "refs/heads/master" ) . getObjectId ( ) ) ; } finally { repo.close ( ) ; } }

Target:
private void merge ( com.google.gerrit.acceptance.PushOneCommit.Result r ) throws java.lang.Exception { revision ( r ) . review ( com.google.gerrit.extensions.api.changes.ReviewInput.approve ( ) ) ; revision ( r ) . submit ( ) ; org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( project ) ; try { org.junit.Assert.assertEquals ( r.getCommitId ( ) , repo.getRef ( "refs/heads/master" ) . getObjectId ( ) ) ; } finally { repo.close ( ) ; } }
Source:
protected com.google.gerrit.server.account.AccountState fromDocument ( com.google.gson.JsonObject json , java.util.Set < java.lang.String > fields ) { com.google.gson.JsonElement source = json.get ( "_source" ) ; if ( source == null ) { source = json.getAsJsonObject ( ) . get ( "fields" ) ; } com.google.gerrit.reviewdb.client.Account.Id id = new com.google.gerrit.reviewdb.client.Account.Id ( source.getAsJsonObject ( ) . get ( com.google.gerrit.server.index.account.AccountField.ID.getName ( ) ) . getAsInt ( ) ) ; return accountCache.get ( ) . get ( id ) ; }

Target:
protected com.google.gerrit.server.account.AccountState fromDocument ( com.google.gson.JsonObject json , java.util.Set < java.lang.String > fields ) { com.google.gson.JsonElement source = json.get ( "_source" ) ; if ( source == null ) { source = json.getAsJsonObject ( ) . get ( "fields" ) ; } com.google.gerrit.reviewdb.client.Account.Id id = new com.google.gerrit.reviewdb.client.Account.Id ( source.getAsJsonObject ( ) . get ( com.google.gerrit.server.index.account.AccountField.ID.getName ( ) ) . getAsInt ( ) ) ; return accountCache.get ( ) . getEvenIfMissing ( id ) ; }
Source:
public void indexerThrowsNestedNoSuchChangeExceptionTryingToPostChange ( ) throws java.lang.Exception { com.google.gwtorm.server.OrmException e = new com.google.gwtorm.server.OrmException ( "test" , new com.google.gerrit.server.project.NoSuchChangeException ( id ) ) ; org.mockito.Mockito.doThrow ( e ) . when ( schemaFactory ) . open ( ) ; indexRestApiServlet.doPost ( req , rsp ) ; org.mockito.Mockito.verify ( rsp ) . setStatus ( javax.servlet.http.HttpServletResponse.SC_NO_CONTENT ) ; }

Target:
public void indexerThrowsNestedNoSuchChangeExceptionTryingToPostChange ( ) throws java.lang.Exception { com.google.gwtorm.server.OrmException e = new com.google.gwtorm.server.OrmException ( "test" , new com.google.gerrit.server.project.NoSuchChangeException ( id ) ) ; org.mockito.Mockito.doThrow ( e ) . when ( schemaFactory ) . open ( ) ; indexRestApiServlet.doPost ( req , rsp ) ; org.mockito.Mockito.verify ( indexer , org.mockito.Mockito.times ( 1 ) ) . delete ( id ) ; org.mockito.Mockito.verify ( rsp ) . setStatus ( javax.servlet.http.HttpServletResponse.SC_NO_CONTENT ) ; }
Source:
private void deleteRemoteSsh ( org.eclipse.jgit.transport.CredentialsProvider credsProvider , org.eclipse.jgit.transport.URIish uri ) { java.lang.String quotedPath = QuotedString.BOURNE.quote ( uri.getPath ( ) ) ; java.lang.String cmd = "rm -rf " + quotedPath ; java.io.OutputStream errStream = com.googlesource.gerrit.plugins.replication.ReplicationQueue.newErrorBufferStream ( ) ; try { executeRemoteSsh ( credsProvider , uri , cmd , errStream ) ; } catch ( java.io.IOException e ) { com.googlesource.gerrit.plugins.replication.ReplicationQueue.repLog.error ( java.lang.String.format ( ( "Error deleting remote repository at %s:\n" + ( ( " Exception: %s\n" + " Command: %s\n" ) + " Output: %s" ) ) , uri , e , cmd , errStream ) , e ) ; } }

Target:
private void deleteRemoteSsh ( org.eclipse.jgit.transport.URIish uri ) { java.lang.String quotedPath = QuotedString.BOURNE.quote ( uri.getPath ( ) ) ; java.lang.String cmd = "rm -rf " + quotedPath ; java.io.OutputStream errStream = sshHelper.newErrorBufferStream ( ) ; try { sshHelper.executeRemoteSsh ( uri , cmd , errStream ) ; } catch ( java.io.IOException e ) { com.googlesource.gerrit.plugins.replication.ReplicationQueue.repLog.error ( java.lang.String.format ( ( "Error deleting remote repository at %s:\n" + ( ( " Exception: %s\n" + " Command: %s\n" ) + " Output: %s" ) ) , uri , e , cmd , errStream ) , e ) ; } }
Source:
public void commentOnWipChangeByOwnerNotifyAll ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageWipChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; review ( sc.owner , sc.changeId , com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy.ENABLED , com.google.gerrit.extensions.api.changes.NotifyHandling.ALL ) ; assertThat ( sender ) . sent ( "comment" , sc ) . notTo ( 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 ) ; }

Target:
public void commentOnWipChangeByOwnerNotifyAll ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageWipChange ( ) ; review ( sc.owner , sc.changeId , com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy.ENABLED , com.google.gerrit.extensions.api.changes.NotifyHandling.ALL ) ; assertThat ( sender ) . sent ( "comment" , sc ) . cc ( sc.reviewer , sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) . noOneElse ( ) ; }
Source:
public java.lang.Void call ( ) throws com.google.gerrit.extensions.restapi.ResourceConflictException , com.google.gwtorm.server.OrmException , java.io.IOException { if ( caller == ( java.lang.Thread.currentThread ( ) ) ) { insertChange ( db ) ; } else { try ( com.google.gerrit.reviewdb.server.ReviewDb db = schemaFactory.open ( ) ) { insertChange ( db ) ; } } synchronized ( newProgress ) { newProgress.update ( 1 ) ; } return null ; }

Target:
public java.lang.Void call ( ) throws com.google.gerrit.extensions.restapi.ResourceConflictException , com.google.gwtorm.server.OrmException , java.io.IOException { insertChangeImpl ( ) ; synchronized ( newProgress ) { newProgress.update ( 1 ) ; } return null ; }
Source:
public boolean isAdmin ( ) { return getUser ( ) . getCapabilities ( ) . canAdministrateServer ( ) ; }

Target:
public boolean isPrivateVisible ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.query.change.ChangeData cd ) throws com.google.gwtorm.server.OrmException { return ( ( ( isOwner ( ) ) || ( isReviewer ( db , cd ) ) ) || ( getRefControl ( ) . canViewPrivateChanges ( ) ) ) || ( getUser ( ) . isInternalUser ( ) ) ; }
Source:
private com.google.gitiles.GitilesView getView ( java.lang.String pathAndQuery ) throws java.io.IOException , javax.servlet.ServletException { java.util.concurrent.atomic.AtomicReference < com.google.gitiles.GitilesView > view = com.google.common.util.concurrent.Atomics.newReference ( ) ; com.google.gitiles.FakeHttpServletResponse res = new com.google.gitiles.FakeHttpServletResponse ( ) ; service ( pathAndQuery , view , res ) ; org.junit.Assert.assertTrue ( ( "expected non-redirect status, got " + ( res.getStatus ( ) ) ) , ( ( ( res.getStatus ( ) ) < 300 ) || ( ( res.getStatus ( ) ) >= 400 ) ) ) ; return view.get ( ) ; }

Target:
private com.google.gitiles.GitilesView getView ( java.lang.String pathAndQuery ) throws java.io.IOException , javax.servlet.ServletException { com.google.gitiles.TestViewFilter.Result result = com.google.gitiles.TestViewFilter.service ( repo , pathAndQuery ) ; com.google.gitiles.FakeHttpServletResponse resp = result.getResponse ( ) ; org.junit.Assert.assertTrue ( ( "expected non-redirect status, got " + ( resp.getStatus ( ) ) ) , ( ( ( resp.getStatus ( ) ) < 300 ) || ( ( resp.getStatus ( ) ) >= 400 ) ) ) ; return result.getView ( ) ; }
Source:
public void parseApproval ( ) throws java.lang.Exception { assertParseSucceeds ( ( "Update change\n" + ( ( ( ( ( "\n" + "Patch-Set: 1\n" ) + "Label: Label1=+1\n" ) + "Label: Label2=1\n" ) + "Label: Label3=0\n" ) + "Label: Label4=-1\n" ) ) ) ; assertParseFails ( ( "Update change\n" + ( ( "\n" + "Patch-Set: 1\n" ) + "Label: Label1=X\n" ) ) ) ; assertParseFails ( ( "Update change\n" + ( ( "\n" + "Patch-Set: 1\n" ) + "Label: Label1 = 1\n" ) ) ) ; assertParseFails ( ( "Update change\n" + ( ( "\n" + "Patch-Set: 1\n" ) + "Label: X+Y\n" ) ) ) ; }

Target:
public void parsePatchSetId ( ) throws java.lang.Exception { assertParseSucceeds ( ( "Update change\n" + ( ( ( "\n" + "Branch: refs/heads/master\n" ) + "Patch-Set: 1\n" ) + "Subject: This is a test change\n" ) ) ) ; assertParseFails ( ( "Update change\n" + "\n" ) ) ; assertParseFails ( ( "Update change\n" + ( ( "\n" + "Patch-Set: 1\n" ) + "Patch-Set: 1\n" ) ) ) ; assertParseSucceeds ( ( "Update change\n" + ( ( ( "\n" + "Branch: refs/heads/master\n" ) + "Patch-Set: 1\n" ) + "Subject: This is a test change\n" ) ) ) ; assertParseFails ( ( "Update change\n" + ( "\n" + "Patch-Set: x\n" ) ) ) ; }
Source:
public void patchSetObjectAndRefMissingWithFix ( ) throws java.lang.Exception { java.lang.String rev = "deadbeefdeadbeefdeadbeefdeadbeefdeadbeef" ; com.google.gerrit.server.project.ChangeControl ctl = insertChange ( ) ; com.google.gerrit.reviewdb.client.PatchSet ps = insertMissingPatchSet ( ctl , rev ) ; ctl = reload ( ctl ) ; java.lang.String refName = ps.getId ( ) . toRefName ( ) ; assertProblems ( ctl , new com.google.gerrit.extensions.api.changes.FixInput ( ) , com.google.gerrit.acceptance.server.change.ConsistencyCheckerIT.problem ( ( "Ref missing: " + refName ) ) , com.google.gerrit.acceptance.server.change.ConsistencyCheckerIT.problem ( ( "Object missing: patch set 2: " + rev ) ) ) ; }

Target:
public void patchSetObjectAndRefMissingWithFix ( ) throws java.lang.Exception { java.lang.String rev = "deadbeefdeadbeefdeadbeefdeadbeefdeadbeef" ; com.google.gerrit.server.notedb.ChangeNotes notes = insertChange ( ) ; com.google.gerrit.reviewdb.client.PatchSet ps = insertMissingPatchSet ( notes , rev ) ; notes = reload ( notes ) ; java.lang.String refName = ps.getId ( ) . toRefName ( ) ; assertProblems ( notes , new com.google.gerrit.extensions.api.changes.FixInput ( ) , com.google.gerrit.acceptance.server.change.ConsistencyCheckerIT.problem ( ( "Ref missing: " + refName ) ) , com.google.gerrit.acceptance.server.change.ConsistencyCheckerIT.problem ( ( "Object missing: patch set 2: " + rev ) ) ) ; }
Source:
protected void configure ( ) { final java.lang.String cacheName = WebSessionManager.CACHE_NAME ; final com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < com.google.gerrit.server.http.WebSessionManager.Key , com.google.gerrit.server.http.WebSessionManager.Val > > type = new com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < com.google.gerrit.server.http.WebSessionManager.Key , com.google.gerrit.server.http.WebSessionManager.Val > > ( ) { } ; disk ( type , cacheName ) . memoryLimit ( 1024 ) . timeToIdle ( 12 , java.util.concurrent.TimeUnit.HOURS ) . timeToLive ( com.google.gerrit.server.cache.NamedCacheBinding.INFINITE_TIME , java.util.concurrent.TimeUnit.HOURS ) . evictionPolicy ( EvictionPolicy.LRU ) ; bind ( com.google.gerrit.server.http.WebSessionManager.class ) ; bind ( com.google.gerrit.server.http.WebSession.class ) . in ( com.google.inject.servlet.RequestScoped.class ) ; }

Target:
protected void configure ( ) { final java.lang.String cacheName = WebSessionManager.CACHE_NAME ; final com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < com.google.gerrit.server.http.WebSessionManager.Key , com.google.gerrit.server.http.WebSessionManager.Val > > type = new com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < com.google.gerrit.server.http.WebSessionManager.Key , com.google.gerrit.server.http.WebSessionManager.Val > > ( ) { } ; disk ( type , cacheName ) . memoryLimit ( 1024 ) . maxAge ( 12 , java.util.concurrent.TimeUnit.HOURS ) . evictionPolicy ( EvictionPolicy.LRU ) ; bind ( com.google.gerrit.server.http.WebSessionManager.class ) ; bind ( com.google.gerrit.server.http.WebSession.class ) . in ( com.google.inject.servlet.RequestScoped.class ) ; }
Source:
void insertMember ( final com.google.gerrit.reviewdb.AccountGroupMember k ) { final int row = table.getRowCount ( ) ; table.insertRow ( row ) ; applyDataRowStyle ( row ) ; populate ( row , k ) ; }

Target:
void display ( final java.util.List < com.google.gerrit.reviewdb.AccountGroupInclude > result ) { while ( 1 < ( table.getRowCount ( ) ) ) table.removeRow ( ( ( table.getRowCount ( ) ) - 1 ) ) ; for ( final com.google.gerrit.reviewdb.AccountGroupInclude k : result ) { final int row = table.getRowCount ( ) ; table.insertRow ( row ) ; applyDataRowStyle ( row ) ; populate ( row , k ) ; } }
Source:
public org.eclipse.jgit.transport.PushResult to ( java.lang.String ref ) throws java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { com.google.gerrit.acceptance.git.ssh.GitUtil.add ( git , com.google.gerrit.acceptance.git.ssh.PushForReviewIT.PushOneCommit.FILE_NAME , com.google.gerrit.acceptance.git.ssh.PushForReviewIT.PushOneCommit.FILE_CONTENT ) ; changeId = com.google.gerrit.acceptance.git.ssh.GitUtil.createCommit ( git , admin.getIdent ( ) , com.google.gerrit.acceptance.git.ssh.PushForReviewIT.PushOneCommit.SUBJECT ) ; return com.google.gerrit.acceptance.git.ssh.GitUtil.pushHead ( git , ref ) ; }

Target:
public org.eclipse.jgit.transport.PushResult to ( java.lang.String ref ) throws java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { com.google.gerrit.acceptance.git.GitUtil.add ( git , com.google.gerrit.acceptance.git.PushForReviewIT.PushOneCommit.FILE_NAME , com.google.gerrit.acceptance.git.PushForReviewIT.PushOneCommit.FILE_CONTENT ) ; changeId = com.google.gerrit.acceptance.git.GitUtil.createCommit ( git , admin.getIdent ( ) , com.google.gerrit.acceptance.git.PushForReviewIT.PushOneCommit.SUBJECT ) ; return com.google.gerrit.acceptance.git.GitUtil.pushHead ( git , ref ) ; }