auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testMultipleIndexPredicates ( ) throws java.lang.Exception { com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > in = parse ( "file:a OR foo:b OR file:c OR foo:d" ) ; com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > out = rewrite ( in ) ; assertSame ( com.google.gerrit.server.query.change.OrSource.class , out.getClass ( ) ) ; assertEquals ( com.google.common.collect.ImmutableList.of ( query ( com.google.gerrit.server.query.Predicate.or ( in.getChild ( 0 ) , in.getChild ( 2 ) ) ) , in.getChild ( 1 ) , in.getChild ( 3 ) ) , out.getChildren ( ) ) ; }

Target:
public void testMultipleIndexPredicates ( ) throws java.lang.Exception { com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > in = parse ( "file:a OR foo:b OR file:c OR foo:d" ) ; com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > out = rewrite ( in ) ; org.junit.Assert.assertSame ( com.google.gerrit.server.query.change.OrSource.class , out.getClass ( ) ) ; org.junit.Assert.assertEquals ( com.google.common.collect.ImmutableList.of ( query ( com.google.gerrit.server.query.Predicate.or ( in.getChild ( 0 ) , in.getChild ( 2 ) ) ) , in.getChild ( 1 ) , in.getChild ( 3 ) ) , out.getChildren ( ) ) ; }
Source:
private static void markUninteresting ( org.eclipse.jgit.revwalk.RevWalk walk , org.eclipse.jgit.lib.ObjectId id ) throws java.io.IOException { if ( id == null ) { return ; } try { walk.markUninteresting ( walk.parseCommit ( id ) ) ; } catch ( org.eclipse.jgit.errors.IncorrectObjectTypeException e ) { } catch ( org.eclipse.jgit.errors.MissingObjectException e ) { } }

Target:
private static void markUninteresting ( org.eclipse.jgit.revwalk.RevWalk walk , org.eclipse.jgit.lib.ObjectId id ) throws java.io.IOException { if ( id == null ) { return ; } try { walk.markUninteresting ( walk.parseCommit ( id ) ) ; } catch ( org.eclipse.jgit.errors.IncorrectObjectTypeException | org.eclipse.jgit.errors.MissingObjectException e ) { } }
Source:
public void onSuccess ( com.google.gerrit.client.changes.CommentInfo result ) { done.setEnabled ( true ) ; setOpen ( false ) ; com.google.gerrit.client.diff.DraftBox box = getCommentManager ( ) . addDraftBox ( result , getCm ( ) . side ( ) ) ; registerReplyBox ( box ) ; if ( ! ( getCommentInfo ( ) . has_line ( ) ) ) { getCommentManager ( ) . addFileCommentBox ( box ) ; } }

Target:
public void onSuccess ( com.google.gerrit.client.changes.CommentInfo result ) { done.setEnabled ( true ) ; setOpen ( false ) ; getCommentManager ( ) . addDraftBox ( getCm ( ) . side ( ) , result ) ; }
Source:
private void logout ( javax.servlet.ServletRequest request , javax.servlet.ServletResponse response , javax.servlet.FilterChain chain , javax.servlet.http.HttpServletRequest httpRequest ) throws java.io.IOException , javax.servlet.ServletException { getGitHubLogin ( request ) . logout ( ) ; com.googlesource.gerrit.plugins.github.oauth.GitHubLogoutServletResponse bufferedResponse = new com.googlesource.gerrit.plugins.github.oauth.GitHubLogoutServletResponse ( ( ( javax.servlet.http.HttpServletResponse ) ( response ) ) , config.logoutRedirectUrl ) ; chain.doFilter ( httpRequest , bufferedResponse ) ; }

Target:
private javax.servlet.ServletResponse logout ( javax.servlet.ServletRequest request , javax.servlet.ServletResponse response , javax.servlet.FilterChain chain , javax.servlet.http.HttpServletRequest httpRequest ) throws java.io.IOException , javax.servlet.ServletException { getGitHubLogin ( request ) . logout ( ) ; return new com.googlesource.gerrit.plugins.github.oauth.GitHubLogoutServletResponse ( ( ( javax.servlet.http.HttpServletResponse ) ( response ) ) , config.logoutRedirectUrl ) ; }
Source:
public void deleteBranchByProjectOwnerForcePushBlocked_Forbidden ( ) throws java.lang.Exception { grantOwner ( ) ; blockForcePush ( ) ; com.google.gerrit.acceptance.RestResponse r = userSession.delete ( ( ( ( "/projects/" + ( project.get ( ) ) ) + "/branches/" ) + ( branch.getShortName ( ) ) ) ) ; org.junit.Assert.assertEquals ( HttpStatus.SC_FORBIDDEN , r.getStatusCode ( ) ) ; r.consume ( ) ; }

Target:
public void deleteBranchByProjectOwnerForcePushBlocked_Forbidden ( ) throws java.lang.Exception { grantOwner ( ) ; blockForcePush ( ) ; com.google.gerrit.acceptance.RestResponse r = userSession.delete ( ( ( ( "/projects/" + ( project.get ( ) ) ) + "/branches/" ) + ( branch.getShortName ( ) ) ) ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( HttpStatus.SC_FORBIDDEN ) ; r.consume ( ) ; }
Source:
public com.google.gerrit.server.notedb.NoteDbChangeState rebuild ( com.google.gerrit.server.notedb.NoteDbUpdateManager manager , com.google.gerrit.server.notedb.ChangeBundle bundle ) throws com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { com.google.gerrit.reviewdb.client.Change change = new com.google.gerrit.reviewdb.client.Change ( bundle.getChange ( ) ) ; buildUpdates ( manager , bundle ) ; return com.google.gerrit.server.notedb.NoteDbChangeState.applyDelta ( change , manager.stage ( ) . get ( change.getId ( ) ) ) ; }

Target:
public com.google.gerrit.server.notedb.NoteDbChangeState rebuild ( com.google.gerrit.server.notedb.NoteDbUpdateManager manager , com.google.gerrit.server.notedb.ChangeBundle bundle ) throws com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { com.google.gerrit.reviewdb.client.Change change = new com.google.gerrit.reviewdb.client.Change ( bundle.getChange ( ) ) ; buildUpdates ( manager , bundle ) ; return com.google.gerrit.server.notedb.NoteDbChangeState.applyDelta ( change , manager.stage ( ) ) ; }
Source:
private void setSubmitType ( com.google.gerrit.extensions.common.SubmitType submitType ) throws java.io.IOException { com.google.gerrit.server.project.PutConfig.Input in = new com.google.gerrit.server.project.PutConfig.Input ( ) ; in.submitType = submitType ; in.useContentMerge = com.google.gerrit.extensions.common.InheritableBoolean.FALSE ; 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:
private void setSubmitType ( com.google.gerrit.extensions.common.SubmitType submitType ) throws java.io.IOException { com.google.gerrit.server.project.PutConfig.Input in = new com.google.gerrit.server.project.PutConfig.Input ( ) ; in.submitType = submitType ; in.useContentMerge = com.google.gerrit.extensions.common.InheritableBoolean.FALSE ; 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:
private void streamRequestToFile ( javax.servlet.http.HttpServletRequest req , java.io.File file ) throws java.io.FileNotFoundException , java.io.IOException { java.io.InputStream in = req.getInputStream ( ) ; java.io.OutputStream out = new java.io.FileOutputStream ( file ) ; try { com.google.common.io.ByteStreams.copy ( in , out ) ; } finally { out.close ( ) ; } }

Target:
private void streamRequestToFile ( javax.servlet.http.HttpServletRequest req , java.io.File file ) throws java.io.FileNotFoundException , java.io.IOException { java.io.InputStream in = req.getInputStream ( ) ; try ( java.io.OutputStream out = new java.io.FileOutputStream ( file ) ) { com.google.common.io.ByteStreams.copy ( in , out ) ; } }
Source:
protected void configure ( ) { factory ( AddBranch.Factory.class ) ; factory ( ChangeProjectAccess.Factory.class ) ; factory ( CreateProjectHandler.Factory.class ) ; factory ( ChangeProjectSettings.Factory.class ) ; factory ( DeleteBranches.Factory.class ) ; factory ( ListBranches.Factory.class ) ; factory ( VisibleProjects.Factory.class ) ; factory ( VisibleProjectDetails.Factory.class ) ; factory ( ProjectAccessFactory.Factory.class ) ; factory ( ProjectDetailFactory.Factory.class ) ; factory ( SuggestParentCandidatesHandler.Factory.class ) ; }

Target:
protected void configure ( ) { factory ( AddBranch.Factory.class ) ; factory ( ChangeProjectAccess.Factory.class ) ; factory ( CreateProjectHandler.Factory.class ) ; factory ( ChangeProjectSettings.Factory.class ) ; factory ( DeleteBranches.Factory.class ) ; factory ( ListBranches.Factory.class ) ; factory ( VisibleProjectDetails.Factory.class ) ; factory ( ProjectAccessFactory.Factory.class ) ; factory ( ProjectDetailFactory.Factory.class ) ; }
Source:
public void index ( com.google.gerrit.reviewdb.client.Account.Id id ) throws java.io.IOException { for ( com.google.gerrit.index.Index < com.google.gerrit.reviewdb.client.Account.Id , com.google.gerrit.server.account.AccountState > i : getWriteIndexes ( ) ) { byIdCache.evict ( id ) ; java.util.Optional < com.google.gerrit.server.account.AccountState > accountState = byIdCache.get ( id ) ; if ( accountState.isPresent ( ) ) { i.replace ( accountState.get ( ) ) ; } else { i.delete ( id ) ; } } fireAccountIndexedEvent ( id.get ( ) ) ; com.google.gerrit.server.index.account.AccountIndexerImpl.autoReindexIfStale ( id ) ; }

Target:
public void index ( com.google.gerrit.reviewdb.client.Account.Id id ) throws java.io.IOException { for ( com.google.gerrit.index.Index < com.google.gerrit.reviewdb.client.Account.Id , com.google.gerrit.server.account.AccountState > i : getWriteIndexes ( ) ) { byIdCache.evict ( id ) ; java.util.Optional < com.google.gerrit.server.account.AccountState > accountState = byIdCache.get ( id ) ; if ( accountState.isPresent ( ) ) { i.replace ( accountState.get ( ) ) ; } else { i.delete ( id ) ; } } fireAccountIndexedEvent ( id.get ( ) ) ; }
Source:
void onKeyMap ( @ java.lang.SuppressWarnings ( value = "unused" ) com.google.gwt.event.dom.client.ChangeEvent e ) { com.google.gerrit.extensions.client.KeyMapType keyMapType = com.google.gerrit.extensions.client.KeyMapType.valueOf ( keyMap.getValue ( keyMap.getSelectedIndex ( ) ) ) ; prefs.keyMapType ( keyMapType ) ; view.getEditor ( ) . setOption ( "keyMap" , keyMapType.name ( ) . toLowerCase ( ) ) ; }

Target:
void onKeyMap ( @ java.lang.SuppressWarnings ( value = "unused" ) com.google.gwt.event.dom.client.ChangeEvent e ) { com.google.gerrit.extensions.client.KeyMapType keyMapType = com.google.gerrit.extensions.client.KeyMapType.valueOf ( keyMap.getValue ( keyMap.getSelectedIndex ( ) ) ) ; prefs.keyMapType ( keyMapType ) ; if ( ( view ) != null ) { view.getEditor ( ) . setOption ( "keyMap" , keyMapType.name ( ) . toLowerCase ( ) ) ; } }
Source:
public void testSkipSubTreesWithImproperPrefix ( ) throws java.lang.Exception { changedPaths = com.google.common.collect.Sets.newHashSet ( "f1/A" ) ; runCheck ( com.googlesource.gerrit.plugins.uploadvalidator.DuplicatePathnameValidatorTest.INITIAL_PATHNAMES , changedPaths , messages , vistedPaths ) ; com.google.common.truth.Truth.assertThat ( com.googlesource.gerrit.plugins.uploadvalidator.TestUtils.transformMessages ( messages ) ) . containsExactly ( com.googlesource.gerrit.plugins.uploadvalidator.TestUtils.transformMessage ( com.googlesource.gerrit.plugins.uploadvalidator.DuplicatePathnameValidator.conflict ( "f1/A" , "f1/a" ) ) ) ; com.google.common.truth.Truth.assertThat ( vistedPaths ) . containsExactlyElementsIn ( com.google.common.collect.ImmutableList.of ( "a" , "ab" , "f1" , "f1/a" , "f1/ab" , "f2" ) ) ; }

Target:
public void testSkipSubTreesWithImproperPrefix ( ) throws java.lang.Exception { changedPaths = com.google.common.collect.Sets.newHashSet ( "f1/A" ) ; runCheck ( com.googlesource.gerrit.plugins.uploadvalidator.DuplicatePathnameValidatorTest.INITIAL_PATHNAMES , changedPaths , messages , vistedPaths ) ; com.google.common.truth.Truth.assertThat ( com.googlesource.gerrit.plugins.uploadvalidator.TestUtils.transformMessages ( messages ) ) . containsExactly ( com.googlesource.gerrit.plugins.uploadvalidator.TestUtils.transformMessage ( com.googlesource.gerrit.plugins.uploadvalidator.DuplicatePathnameValidator.conflict ( "f1/A" , "f1/a" ) ) ) ; com.google.common.truth.Truth.assertThat ( vistedPaths ) . containsExactly ( "a" , "ab" , "f1" , "f1/a" , "f1/ab" , "f2" ) ; }
Source:
public RefUpdate.Result call ( ) throws java.lang.Exception { org.eclipse.jgit.lib.Ref ref = repo.exactRef ( refName ) ; afterReadRef.run ( ) ; org.eclipse.jgit.lib.ObjectId oldId ; if ( ref == null ) { oldId = org.eclipse.jgit.lib.ObjectId.zeroId ( ) ; next = seed.get ( ) ; } else { oldId = ref.getObjectId ( ) ; next = parse ( oldId ) ; } return store ( repo , rw , oldId , ( ( next ) + ( count ) ) ) ; }

Target:
public RefUpdate.Result call ( ) throws java.lang.Exception { org.eclipse.jgit.lib.Ref ref = repo.exactRef ( refName ) ; afterReadRef.run ( ) ; org.eclipse.jgit.lib.ObjectId oldId ; if ( ref == null ) { oldId = org.eclipse.jgit.lib.ObjectId.zeroId ( ) ; next = seed.get ( ) ; } else { oldId = ref.getObjectId ( ) ; next = parse ( rw , oldId ) ; } return store ( repo , rw , oldId , ( ( next ) + ( count ) ) ) ; }
Source:
public static java.lang.String addTab ( java.lang.String str ) { java.lang.StringBuffer buf = new java.lang.StringBuffer ( "" ) ; java.lang.String [ ] arr = str.split ( "\n" ) ; for ( java.lang.String s : arr ) { if ( ! ( s.trim ( ) . isEmpty ( ) ) ) { buf.append ( ( ( "\t" + s ) + " \n" ) ) ; } } return buf.toString ( ) ; }

Target:
public static java.lang.String addTab ( java.lang.String str ) { java.lang.StringBuffer buf = new java.lang.StringBuffer ( "" ) ; for ( java.lang.String s : str.split ( "\n" ) ) { if ( ! ( s.trim ( ) . isEmpty ( ) ) ) { buf.append ( ( ( "\t" + s ) + " \n" ) ) ; } } return buf.toString ( ) ; }
Source:
public com.google.gerrit.reviewdb.client.Change abandon ( com.google.gerrit.server.project.ChangeControl control , java.lang.String msgTxt , com.google.gerrit.extensions.api.changes.NotifyHandling notifyHandling ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.git.UpdateException { com.google.gerrit.server.change.Abandon.Op op = new com.google.gerrit.server.change.Abandon.Op ( control.getUser ( ) , msgTxt , notifyHandling ) ; try ( com.google.gerrit.server.git.BatchUpdate u = batchUpdateFactory.create ( dbProvider.get ( ) , control.getProject ( ) . getNameKey ( ) , control.getUser ( ) , com.google.gerrit.common.TimeUtil.nowTs ( ) ) ) { u.addOp ( control.getId ( ) , op ) . execute ( ) ; } return op.change ; }

Target:
public com.google.gerrit.reviewdb.client.Change abandon ( com.google.gerrit.server.project.ChangeControl control , java.lang.String msgTxt , com.google.gerrit.extensions.api.changes.NotifyHandling notifyHandling ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.git.UpdateException { com.google.gerrit.server.change.Abandon.Op op = new com.google.gerrit.server.change.Abandon.Op ( msgTxt , notifyHandling ) ; try ( com.google.gerrit.server.git.BatchUpdate u = batchUpdateFactory.create ( dbProvider.get ( ) , control.getProject ( ) . getNameKey ( ) , control.getUser ( ) , com.google.gerrit.common.TimeUtil.nowTs ( ) ) ) { u.addOp ( control.getId ( ) , op ) . execute ( ) ; } return op.change ; }
Source:
public void testDashList2 ( ) { final com.google.gwtexpui.safehtml.client.SafeHtml o = com.google.gwtexpui.safehtml.client.SafeHtml_WikifyListTest.html ( "A\n\n- line 1\n- 2nd line\n\nB" ) ; final com.google.gwtexpui.safehtml.client.SafeHtml n = o.wikify ( ) ; assertNotSame ( o , n ) ; assertEquals ( ( ( ( ( ( "<p>A</p>" + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyListTest.BEGIN_LIST ) ) + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyListTest.item ( "line 1" ) ) ) + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyListTest.item ( "2nd line" ) ) ) + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyListTest.END_LIST ) ) + "<p>B</p>" ) , n.asString ( ) ) ; }

Target:
public void testDashList2 ( ) { final com.google.gwtexpui.safehtml.client.SafeHtml o = com.google.gwtexpui.safehtml.client.SafeHtml_WikifyListTest.html ( "A\n\n- line 1\n- 2nd line\n\nB" ) ; final com.google.gwtexpui.safehtml.client.SafeHtml n = o.wikify ( ) ; org.junit.Assert.assertNotSame ( o , n ) ; org.junit.Assert.assertEquals ( ( ( ( ( ( "<p>A</p>" + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyListTest.BEGIN_LIST ) ) + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyListTest.item ( "line 1" ) ) ) + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyListTest.item ( "2nd line" ) ) ) + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyListTest.END_LIST ) ) + "<p>B</p>" ) , n.asString ( ) ) ; }
Source:
private void assertSubmitApproval ( com.google.gerrit.reviewdb.client.PatchSet.Id patchSetId ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.Change c = db.changes ( ) . get ( patchSetId.getParentKey ( ) ) ; com.google.gerrit.server.notedb.ChangeNotes notes = changeNotesFactory.create ( c ) . load ( ) ; com.google.gerrit.reviewdb.client.PatchSetApproval a = approvalsUtil.getSubmitter ( db , notes , patchSetId ) ; org.junit.Assert.assertTrue ( a.isSubmit ( ) ) ; org.junit.Assert.assertEquals ( 1 , a.getValue ( ) ) ; org.junit.Assert.assertEquals ( admin.id , a.getAccountId ( ) ) ; }

Target:
private com.google.gerrit.reviewdb.client.PatchSetApproval getSubmitter ( com.google.gerrit.reviewdb.client.PatchSet.Id patchSetId ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.Change c = db.changes ( ) . get ( patchSetId.getParentKey ( ) ) ; com.google.gerrit.server.notedb.ChangeNotes notes = changeNotesFactory.create ( c ) . load ( ) ; return approvalsUtil.getSubmitter ( db , notes , patchSetId ) ; }
Source:
private org.eclipse.jgit.dircache.DirCacheEntry file ( final java.lang.String name ) throws java.io.IOException { final org.eclipse.jgit.lib.ObjectInserter oi = repository.newObjectInserter ( ) ; try { final org.eclipse.jgit.dircache.DirCacheEntry e = new org.eclipse.jgit.dircache.DirCacheEntry ( name ) ; e.setFileMode ( FileMode.REGULAR_FILE ) ; e.setObjectId ( oi.insert ( Constants.OBJ_BLOB , org.eclipse.jgit.lib.Constants.encode ( name ) ) ) ; oi.flush ( ) ; return e ; } finally { oi.release ( ) ; } }

Target:
private org.eclipse.jgit.dircache.DirCacheEntry file ( final java.lang.String name ) throws java.io.IOException { try ( org.eclipse.jgit.lib.ObjectInserter oi = repository.newObjectInserter ( ) ) { final org.eclipse.jgit.dircache.DirCacheEntry e = new org.eclipse.jgit.dircache.DirCacheEntry ( name ) ; e.setFileMode ( FileMode.REGULAR_FILE ) ; e.setObjectId ( oi.insert ( Constants.OBJ_BLOB , org.eclipse.jgit.lib.Constants.encode ( name ) ) ) ; oi.flush ( ) ; return e ; } }
Source:
public void run ( ) throws java.lang.Exception { parseCommandLine ( impl ) ; if ( ( ( impl.getUser ( ) ) != null ) && ( ! ( impl.getProjects ( ) . isEmpty ( ) ) ) ) { throw new com.google.gerrit.sshd.commands.UnloggedFailure ( 1 , "fatal: --user and --project options are not compatible." ) ; } final java.io.PrintWriter stdout = toPrintWriter ( out ) ; try { impl.display ( stdout ) ; } finally { stdout.flush ( ) ; } }

Target:
protected void parseCommandLine ( ) throws com.google.gerrit.sshd.commands.UnloggedFailure { parseCommandLine ( impl ) ; }
Source:
public final int parseArguments ( final org.kohsuke.args4j.spi.Parameters params ) throws org.kohsuke.args4j.CmdLineException { final java.lang.String n = params.getParameter ( 0 ) ; final com.google.gerrit.reviewdb.AccountGroup group = groupCache.get ( new com.google.gerrit.reviewdb.AccountGroup.NameKey ( n ) ) ; if ( group == null ) { throw new org.kohsuke.args4j.CmdLineException ( owner , ( ( "Group \"" + n ) + "\" does not exist" ) ) ; } setter.addValue ( group.getId ( ) ) ; return 1 ; }

Target:
public final int parseArguments ( final org.kohsuke.args4j.spi.Parameters params ) throws org.kohsuke.args4j.CmdLineException { final java.lang.String n = params.getParameter ( 0 ) ; final com.google.gerrit.reviewdb.AccountGroup group = get ( n ) ; if ( group == null ) { throw new org.kohsuke.args4j.CmdLineException ( owner , ( ( "Group \"" + n ) + "\" does not exist" ) ) ; } setter.addValue ( group.getId ( ) ) ; return 1 ; }
Source:
public void submit ( com.google.gerrit.extensions.api.changes.SubmitInput in ) throws com.google.gerrit.extensions.restapi.RestApiException { try { submit.get ( ) . apply ( revision , in ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot submit change" , e ) ; } catch ( java.io.IOException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot submit change" , e ) ; } }

Target:
public void submit ( com.google.gerrit.extensions.api.changes.SubmitInput in ) throws com.google.gerrit.extensions.restapi.RestApiException { try { submit.get ( ) . apply ( revision , in ) ; } catch ( com.google.gwtorm.server.OrmException | java.io.IOException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot submit change" , e ) ; } }
Source:
public com.google.gerrit.server.account.AccountState load ( com.google.gerrit.reviewdb.client.Account.Id key ) throws java.lang.Exception { final com.google.gerrit.reviewdb.server.ReviewDb db = schema.open ( ) ; try { final com.google.gerrit.server.account.AccountState state = load ( db , key ) ; java.lang.String user = state.getUserName ( ) ; if ( user != null ) { byName.put ( user , com.google.common.base.Optional.of ( state.getAccount ( ) . getId ( ) ) ) ; } return state ; } finally { db.close ( ) ; } }

Target:
public com.google.gerrit.server.account.AccountState load ( com.google.gerrit.reviewdb.client.Account.Id key ) throws java.lang.Exception { try ( com.google.gerrit.reviewdb.server.ReviewDb db = schema.open ( ) ) { final com.google.gerrit.server.account.AccountState state = load ( db , key ) ; java.lang.String user = state.getUserName ( ) ; if ( user != null ) { byName.put ( user , com.google.common.base.Optional.of ( state.getAccount ( ) . getId ( ) ) ) ; } return state ; } }
Source:
public void uploadPackSubsetOfBranchesVisibleIncludingHead ( ) throws java.lang.Exception { allow ( Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/master" ) ; deny ( Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/branch" ) ; setApiUser ( user ) ; assertUploadPackRefs ( "HEAD" , ( ( r1 ) + "1" ) , ( ( r1 ) + "meta" ) , ( ( r3 ) + "1" ) , ( ( r3 ) + "meta" ) , "refs/heads/master" , "refs/tags/master-tag" ) ; }

Target:
public void uploadPackSubsetOfBranchesVisibleIncludingHead ( ) throws java.lang.Exception { allow ( "refs/heads/master" , Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS ) ; deny ( "refs/heads/branch" , Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS ) ; setApiUser ( user ) ; assertUploadPackRefs ( "HEAD" , ( ( r1 ) + "1" ) , ( ( r1 ) + "meta" ) , ( ( r3 ) + "1" ) , ( ( r3 ) + "meta" ) , "refs/heads/master" , "refs/tags/master-tag" ) ; }
Source:
private com.google.gerrit.reviewdb.client.Change insertChange ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = com.google.gerrit.testutil.TestChanges.newChange ( project , adminId ) ; db.changes ( ) . insert ( java.util.Collections.singleton ( c ) ) ; com.google.gerrit.server.notedb.ChangeUpdate u = changeUpdateFactory.create ( changeControlFactory.controlFor ( c , userFactory.create ( adminId ) ) ) ; u.setSubject ( c.getSubject ( ) ) ; u.setBranch ( c.getDest ( ) . get ( ) ) ; u.commit ( ) ; return c ; }

Target:
private com.google.gerrit.reviewdb.client.Change insertChange ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = com.google.gerrit.testutil.TestChanges.newChange ( project , adminId ) ; db.changes ( ) . insert ( java.util.Collections.singleton ( c ) ) ; com.google.gerrit.server.notedb.ChangeUpdate u = changeUpdateFactory.create ( changeControlFactory.controlFor ( c , userFactory.create ( adminId ) ) ) ; u.setBranch ( c.getDest ( ) . get ( ) ) ; u.commit ( ) ; return c ; }
Source:
public java.lang.String toString ( ) { final java.lang.String val = getValue ( ) ; if ( com.google.gerrit.server.query.QueryParser.isSingleWord ( val ) ) { return ( ( getOperator ( ) ) + ":" ) + val ; } else { return ( ( ( getOperator ( ) ) + ":\"" ) + val ) + "\"" ; } }

Target:
public java.lang.String toString ( ) { final java.lang.String val = getValue ( ) ; if ( com.google.gerrit.server.query.QueryParser.isSingleWord ( val ) ) { return ( ( getOperator ( ) ) + ":" ) + val ; } return ( ( ( getOperator ( ) ) + ":\"" ) + val ) + "\"" ; }
Source:
void onSave ( @ java.lang.SuppressWarnings ( value = "unused" ) com.google.gwt.event.dom.client.ClickEvent e ) { com.google.gerrit.client.account.AccountApi.putDiffPreferences ( prefs , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.account.DiffPreferences > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.account.DiffPreferences result ) { com.google.gerrit.extensions.client.DiffPreferencesInfo p = com.google.gerrit.client.Gerrit.getDiffPreferences ( ) ; result.copyTo ( p ) ; com.google.gerrit.client.Gerrit.setDiffPreferences ( p ) ; } } ) ; close ( ) ; }

Target:
void onSave ( @ java.lang.SuppressWarnings ( value = "unused" ) com.google.gwt.event.dom.client.ClickEvent e ) { com.google.gerrit.client.account.AccountApi.putDiffPreferences ( prefs , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.account.DiffPreferences > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.account.DiffPreferences result ) { com.google.gerrit.extensions.client.DiffPreferencesInfo p = new com.google.gerrit.extensions.client.DiffPreferencesInfo ( ) ; result.copyTo ( p ) ; com.google.gerrit.client.Gerrit.setDiffPreferences ( p ) ; } } ) ; if ( ( view ) != null ) { close ( ) ; } }
Source:
private boolean isMergeable ( com.google.gerrit.reviewdb.Change c ) throws com.google.gwtorm.client.OrmException { final com.google.gerrit.server.git.CodeReviewCommit commit = commits.get ( c.getId ( ) ) ; final com.google.gerrit.server.git.CommitMergeStatus s = ( commit != null ) ? commit.statusCode : null ; boolean isMergeable = false ; if ( ( s != null ) && ( ( ( s.equals ( CommitMergeStatus.CLEAN_MERGE ) ) || ( s.equals ( CommitMergeStatus.CLEAN_PICK ) ) ) || ( s.equals ( CommitMergeStatus.ALREADY_MERGED ) ) ) ) { isMergeable = true ; } return isMergeable ; }

Target:
private boolean isMergeable ( com.google.gerrit.reviewdb.client.Change c ) { final com.google.gerrit.server.git.CodeReviewCommit commit = commits.get ( c.getId ( ) ) ; final com.google.gerrit.server.git.CommitMergeStatus s = ( commit != null ) ? commit.statusCode : null ; boolean isMergeable = false ; if ( ( s != null ) && ( ( ( s.equals ( CommitMergeStatus.CLEAN_MERGE ) ) || ( s.equals ( CommitMergeStatus.CLEAN_PICK ) ) ) || ( s.equals ( CommitMergeStatus.ALREADY_MERGED ) ) ) ) { isMergeable = true ; } return isMergeable ; }
Source:
void onLineLength ( com.google.gwt.event.logical.shared.ValueChangeEvent < java.lang.String > e ) { java.lang.String v = e.getValue ( ) ; if ( ( v != null ) && ( ( v.length ( ) ) > 0 ) ) { prefs.lineLength ( java.lang.Math.max ( 1 , java.lang.Integer.parseInt ( v ) ) ) ; view.setLineLength ( prefs.lineLength ( ) ) ; } }

Target:
void onLineLength ( com.google.gwt.event.logical.shared.ValueChangeEvent < java.lang.String > e ) { java.lang.String v = e.getValue ( ) ; if ( ( v != null ) && ( ( v.length ( ) ) > 0 ) ) { prefs.lineLength ( java.lang.Math.max ( 1 , java.lang.Integer.parseInt ( v ) ) ) ; if ( ( view ) != null ) { view.setLineLength ( prefs.lineLength ( ) ) ; } } }
Source:
private static void codemirrorForEdit ( final java.lang.String token , final com.google.gerrit.reviewdb.client.Patch.Key id , final int line ) { 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.editor.EditScreen ( id , line ) ) ; } } ) ; }

Target:
private static void codemirrorForEdit ( final java.lang.String token , @ com.google.gerrit.common.Nullable final com.google.gerrit.reviewdb.client.Project.NameKey project , final com.google.gerrit.reviewdb.client.Patch.Key id , final int line ) { 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.editor.EditScreen ( project , id , line ) ) ; } } ) ; }
Source:
public java.util.Set < java.lang.String > listSequences ( java.sql.Connection db ) throws java.sql.SQLException { java.sql.Statement s = db.createStatement ( ) ; try { java.sql.ResultSet rs = s.executeQuery ( "SELECT sequence_name FROM user_sequences" ) ; try { java.util.HashSet < java.lang.String > sequences = new java.util.HashSet < java.lang.String > ( ) ; while ( rs.next ( ) ) { sequences.add ( rs.getString ( 1 ) . toLowerCase ( ) ) ; } return sequences ; } finally { rs.close ( ) ; } } finally { s.close ( ) ; } }

Target:
public java.util.Set < java.lang.String > listSequences ( java.sql.Connection db ) throws java.sql.SQLException { java.sql.Statement s = db.createStatement ( ) ; try { java.sql.ResultSet rs = s.executeQuery ( "SELECT sequence_name FROM user_sequences" ) ; try { java.util.Set < java.lang.String > sequences = new java.util.HashSet < java.lang.String > ( ) ; while ( rs.next ( ) ) { sequences.add ( rs.getString ( 1 ) . toLowerCase ( ) ) ; } return sequences ; } finally { rs.close ( ) ; } } finally { s.close ( ) ; } }
Source:
private org.eclipse.jgit.revwalk.RevCommit makeCommit ( ) throws java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { java.util.Set < java.io.File > files = new java.util.HashSet < > ( ) ; for ( java.lang.String filenames : com.googlesource.gerrit.plugins.uploadvalidator.InvalidFilenameValidatorTest.getInvalidFilenames ( ) ) { files.add ( new java.io.File ( repo.getDirectory ( ) . getParent ( ) , filenames ) ) ; } files.add ( new java.io.File ( repo.getDirectory ( ) . getParent ( ) , "test" ) ) ; return com.googlesource.gerrit.plugins.uploadvalidator.TestUtils.makeCommit ( repo , "Commit with empty test files." , files ) ; }

Target:
private org.eclipse.jgit.revwalk.RevCommit makeCommit ( org.eclipse.jgit.revwalk.RevWalk rw ) throws java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { java.util.Set < java.io.File > files = new java.util.HashSet < > ( ) ; for ( java.lang.String filenames : com.googlesource.gerrit.plugins.uploadvalidator.InvalidFilenameValidatorTest.getInvalidFilenames ( ) ) { files.add ( new java.io.File ( repo.getDirectory ( ) . getParent ( ) , filenames ) ) ; } files.add ( new java.io.File ( repo.getDirectory ( ) . getParent ( ) , "test" ) ) ; return com.googlesource.gerrit.plugins.uploadvalidator.TestUtils.makeCommit ( rw , repo , "Commit with empty test files." , files ) ; }
Source:
public java.util.List < com.google.gerrit.server.git.validators.CommitValidationMessage > onCommitReceived ( com.google.gerrit.server.events.CommitReceivedEvent receiveEvent ) throws com.google.gerrit.server.git.validators.CommitValidationException { if ( itsConfig.isEnabled ( receiveEvent.getProjectNameKey ( ) , receiveEvent.getRefName ( ) ) ) { return validCommit ( receiveEvent.commit ) ; } else { return java.util.Collections.emptyList ( ) ; } }

Target:
public java.util.List < com.google.gerrit.server.git.validators.CommitValidationMessage > onCommitReceived ( com.google.gerrit.server.events.CommitReceivedEvent receiveEvent ) throws com.google.gerrit.server.git.validators.CommitValidationException { if ( itsConfig.isEnabled ( receiveEvent.getProjectNameKey ( ) , receiveEvent.getRefName ( ) ) ) { return validCommit ( receiveEvent.commit ) ; } return java.util.Collections.emptyList ( ) ; }
Source:
public void revisionActionsOneChangePerTopic ( ) throws java.lang.Exception { java.lang.String changeId = createChangeWithTopic ( "foo1" ) . getChangeId ( ) ; approve ( changeId ) ; java.util.Map < java.lang.String , com.google.gerrit.extensions.common.ActionInfo > actions = getActions ( changeId ) ; commonActionsAssertions ( actions ) ; noSubmitWholeTopicAssertions ( actions ) ; }

Target:
public void revisionActionsOneChangePerTopic ( ) throws java.lang.Exception { java.lang.String changeId = createChangeWithTopic ( name ( "foo1" ) ) . getChangeId ( ) ; approve ( changeId ) ; java.util.Map < java.lang.String , com.google.gerrit.extensions.common.ActionInfo > actions = getActions ( changeId ) ; commonActionsAssertions ( actions ) ; noSubmitWholeTopicAssertions ( actions ) ; }
Source:
private void mergeImpl ( final com.google.gerrit.client.reviewdb.Branch.NameKey branch ) { try { new com.google.gerrit.git.MergeOp ( server , replication , branch ) . merge ( ) ; } catch ( java.lang.Throwable e ) { com.google.gerrit.git.ChangeMergeQueue.log.error ( ( ( "Merge attempt for " + branch ) + " failed" ) , e ) ; } }

Target:
private void mergeImpl ( final com.google.gerrit.client.reviewdb.Branch.NameKey branch ) { try { new com.google.gerrit.git.MergeOp ( server , schema , replication , branch ) . merge ( ) ; } catch ( java.lang.Throwable e ) { com.google.gerrit.git.ChangeMergeQueue.log.error ( ( ( "Merge attempt for " + branch ) + " failed" ) , e ) ; } }
Source:
java.util.List < com.google.gerrit.server.project.SectionMatcher > getAllSections ( ) { if ( isAllProjects ) { return getLocalAccessSections ( ) ; } java.util.List < com.google.gerrit.server.project.SectionMatcher > all = com.google.common.collect.Lists.newArrayList ( ) ; for ( com.google.gerrit.server.project.ProjectState s : tree ( ) ) { all.addAll ( s.getLocalAccessSections ( ) ) ; } return all ; }

Target:
java.util.List < com.google.gerrit.server.project.SectionMatcher > getAllSections ( ) { if ( isAllProjects ) { return getLocalAccessSections ( ) ; } java.util.List < com.google.gerrit.server.project.SectionMatcher > all = new java.util.ArrayList < > ( ) ; for ( com.google.gerrit.server.project.ProjectState s : tree ( ) ) { all.addAll ( s.getLocalAccessSections ( ) ) ; } return all ; }
Source:
, @ com.google.gerrit.acceptance.GerritConfig ( name = "suggest.from" , value = "1" ) , @ com.google.gerrit.acceptance.GerritConfig ( name = "accounts.visibility" , value = "NONE" ) } ) public void suggestReviewersNoResult2 ( ) throws java.io.IOException , java.lang.Exception , org.eclipse.jgit.api.errors.GitAPIException { java.lang.String changeId = createChange ( admin ) ; java.util.List < com.google.gerrit.server.change.SuggestReviewers.SuggestedReviewerInfo > reviewers = suggestReviewers ( changeId , "u" , 6 ) ; org.junit.Assert.assertEquals ( reviewers.size ( ) , 0 ) ; }

Target:
, @ com.google.gerrit.acceptance.GerritConfig ( name = "suggest.from" , value = "1" ) , @ com.google.gerrit.acceptance.GerritConfig ( name = "accounts.visibility" , value = "NONE" ) } ) public void suggestReviewersNoResult2 ( ) throws java.io.IOException , java.lang.Exception , org.eclipse.jgit.api.errors.GitAPIException { java.lang.String changeId = createChange ( ) . getChangeId ( ) ; java.util.List < com.google.gerrit.server.change.SuggestReviewers.SuggestedReviewerInfo > reviewers = suggestReviewers ( changeId , "u" , 6 ) ; org.junit.Assert.assertEquals ( reviewers.size ( ) , 0 ) ; }
Source:
private void assertHasNoTags ( com.google.gerrit.server.project.ProjectResource rsrc ) throws com.googlesource.gerrit.plugins.deleteproject.CannotDeleteProjectException { try { org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( rsrc.getNameKey ( ) ) ; try { if ( ! ( repo.getRefDatabase ( ) . getRefs ( Constants.R_TAGS ) . isEmpty ( ) ) ) { throw new com.googlesource.gerrit.plugins.deleteproject.CannotDeleteProjectException ( java.lang.String.format ( "Project %s has tags" , rsrc.getName ( ) ) ) ; } } finally { repo.close ( ) ; } } catch ( java.io.IOException e ) { throw new com.googlesource.gerrit.plugins.deleteproject.CannotDeleteProjectException ( e ) ; } }

Target:
private void assertHasNoTags ( com.google.gerrit.server.project.ProjectResource rsrc ) throws com.googlesource.gerrit.plugins.deleteproject.CannotDeleteProjectException { try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( rsrc.getNameKey ( ) ) ) { if ( ! ( repo.getRefDatabase ( ) . getRefs ( Constants.R_TAGS ) . isEmpty ( ) ) ) { throw new com.googlesource.gerrit.plugins.deleteproject.CannotDeleteProjectException ( java.lang.String.format ( "Project %s has tags" , rsrc.getName ( ) ) ) ; } } catch ( java.io.IOException e ) { throw new com.googlesource.gerrit.plugins.deleteproject.CannotDeleteProjectException ( e ) ; } }
Source:
public void testEvictGroupsByIncludeOK ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.AccountGroup.UUID key = AccountGroup.UUID.parse ( "90b3042d9094a37985f3f9281391dbbe9a5addad" ) ; java.lang.String keyJson = new com.google.gson.GsonBuilder ( ) . create ( ) . toJson ( key ) ; org.mockito.Mockito.when ( httpSessionMock.post ( buildCacheEndpoint ( Constants.GROUPS_BYINCLUDE ) , keyJson ) ) . thenReturn ( new com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpResponseHandler.HttpResult ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.RestForwarderTest.SUCCESSFUL , com.ericsson.gerrit.plugins.highavailability.forwarder.rest.RestForwarderTest.EMPTY_MSG ) ) ; com.google.common.truth.Truth.assertThat ( forwarder.evict ( Constants.GROUPS_BYINCLUDE , key ) ) . isTrue ( ) ; }

Target:
public void testEvictGroupsByIncludeOK ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.AccountGroup.UUID key = new com.google.gerrit.reviewdb.client.AccountGroup.UUID ( "90b3042d9094a37985f3f9281391dbbe9a5addad" ) ; java.lang.String keyJson = new com.google.gson.GsonBuilder ( ) . create ( ) . toJson ( key ) ; org.mockito.Mockito.when ( httpSessionMock.post ( buildCacheEndpoint ( Constants.GROUPS_BYINCLUDE ) , keyJson ) ) . thenReturn ( new com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpResponseHandler.HttpResult ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.RestForwarderTest.SUCCESSFUL , com.ericsson.gerrit.plugins.highavailability.forwarder.rest.RestForwarderTest.EMPTY_MSG ) ) ; com.google.common.truth.Truth.assertThat ( forwarder.evict ( Constants.GROUPS_BYINCLUDE , key ) ) . isTrue ( ) ; }
Source:
private java.lang.String getLatestDiff ( org.eclipse.jgit.lib.Repository repo , org.eclipse.jgit.lib.ObjectId oldTreeId , org.eclipse.jgit.lib.ObjectId newTreeId ) throws java.io.IOException { java.io.ByteArrayOutputStream out = new java.io.ByteArrayOutputStream ( ) ; org.eclipse.jgit.diff.DiffFormatter fmt = new org.eclipse.jgit.diff.DiffFormatter ( out ) ; fmt.setRepository ( repo ) ; fmt.format ( oldTreeId , newTreeId ) ; fmt.flush ( ) ; return out.toString ( ) ; }

Target:
private java.lang.String getLatestDiff ( org.eclipse.jgit.lib.Repository repo , org.eclipse.jgit.lib.ObjectId oldTreeId , org.eclipse.jgit.lib.ObjectId newTreeId ) throws java.io.IOException { java.io.ByteArrayOutputStream out = new java.io.ByteArrayOutputStream ( ) ; try ( org.eclipse.jgit.diff.DiffFormatter fmt = new org.eclipse.jgit.diff.DiffFormatter ( out ) ) { fmt.setRepository ( repo ) ; fmt.format ( oldTreeId , newTreeId ) ; fmt.flush ( ) ; return out.toString ( ) ; } }
Source:
private java.lang.String extractWhat ( com.google.gerrit.sshd.DispatchCommand dcmd ) { java.lang.String commandName = dcmd.getCommandName ( ) ; for ( java.lang.String arg : dcmd.getArguments ( ) ) { commandName = ( commandName + "." ) + arg ; } return commandName ; }

Target:
private java.lang.String extractWhat ( com.google.gerrit.sshd.DispatchCommand dcmd ) { java.lang.String commandName = dcmd.getCommandName ( ) ; java.lang.String [ ] args = dcmd.getArguments ( ) ; for ( int i = 1 ; i < ( args.length ) ; i ++ ) { commandName = ( commandName + "." ) + ( args [ i ] ) ; } return commandName ; }
Source:
public void printJson ( final java.lang.StringBuffer sb , final java.util.Set < T > o ) { if ( o != null ) { sb.append ( '[' ) ; boolean first = true ; for ( final T item : o ) { if ( first ) { first = false ; } else { sb.append ( ',' ) ; } serializer.printJson ( sb , item ) ; } sb.append ( ']' ) ; } else { sb.append ( com.google.gwtjsonrpc.client.JS_NULL ) ; } }

Target:
public void printJson ( final java.lang.StringBuffer sb , final java.util.Set < T > o ) { sb.append ( '[' ) ; boolean first = true ; for ( final T item : o ) { if ( first ) { first = false ; } else { sb.append ( ',' ) ; } if ( item != null ) { serializer.printJson ( sb , item ) ; } else { sb.append ( com.google.gwtjsonrpc.client.JS_NULL ) ; } } sb.append ( ']' ) ; }
Source:
private static void codemirror ( final java.lang.String token , final com.google.gerrit.client.DiffObject base , final com.google.gerrit.reviewdb.client.Patch.Key id , final com.google.gerrit.client.diff.DisplaySide side , final int line ) { 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.diff.SideBySide ( base , com.google.gerrit.client.DiffObject.patchSet ( id.getParentKey ( ) ) , id.get ( ) , side , line ) ) ; } } ) ; }

Target:
private static void codemirror ( final java.lang.String token , final com.google.gerrit.client.DiffObject base , @ com.google.gerrit.common.Nullable final com.google.gerrit.reviewdb.client.Project.NameKey project , final com.google.gerrit.reviewdb.client.Patch.Key id , final com.google.gerrit.client.diff.DisplaySide side , final int line ) { 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.diff.SideBySide ( project , base , com.google.gerrit.client.DiffObject.patchSet ( id.getParentKey ( ) ) , id.get ( ) , side , line ) ) ; } } ) ; }
Source:
private java.lang.String getToken ( final javax.servlet.http.HttpServletRequest req ) { java.lang.String token = req.getPathInfo ( ) ; if ( ( token != null ) && ( token.startsWith ( "/" ) ) ) { token = token.substring ( 1 ) ; } if ( ( token == null ) || ( token.isEmpty ( ) ) ) { token = com.google.gerrit.common.PageLinks.MINE ; } return token ; }

Target:
private java.lang.String getToken ( final javax.servlet.http.HttpServletRequest req ) { java.lang.String token = req.getPathInfo ( ) ; if ( ( token == null ) || ( token.isEmpty ( ) ) ) { token = com.google.gerrit.common.PageLinks.MINE ; } return token ; }
Source:
private static void export ( org.spearce.jgit.lib.RepositoryConfig config , java.sql.ResultSet rs ) throws java.sql.SQLException { com.google.gerrit.pgm.ConvertSystemConfig.sshd ( config , rs ) ; com.google.gerrit.pgm.ConvertSystemConfig.contactstore ( config , rs ) ; com.google.gerrit.pgm.ConvertSystemConfig.user ( config , rs ) ; com.google.gerrit.pgm.ConvertSystemConfig.auth ( config , rs ) ; com.google.gerrit.pgm.ConvertSystemConfig.gitweb ( config , rs ) ; }

Target:
private static void export ( org.spearce.jgit.lib.RepositoryConfig config , java.sql.ResultSet rs ) throws java.sql.SQLException { com.google.gerrit.pgm.ConvertSystemConfig.sshd ( config , rs ) ; com.google.gerrit.pgm.ConvertSystemConfig.contactstore ( config , rs ) ; com.google.gerrit.pgm.ConvertSystemConfig.user ( config , rs ) ; com.google.gerrit.pgm.ConvertSystemConfig.auth ( config , rs ) ; com.google.gerrit.pgm.ConvertSystemConfig.gitweb ( config , rs ) ; com.google.gerrit.pgm.ConvertSystemConfig.repo ( config , rs ) ; }
Source:
private static 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 = com.googlesource.gerrit.plugins.replication.ReplicationQueue.newErrorBufferStream ( ) ; try { com.googlesource.gerrit.plugins.replication.ReplicationQueue.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 ) ; } }

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 = com.googlesource.gerrit.plugins.replication.ReplicationQueue.newErrorBufferStream ( ) ; try { 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 doFilter ( javax.servlet.ServletRequest request , javax.servlet.ServletResponse response , javax.servlet.FilterChain chain ) throws java.io.IOException , javax.servlet.ServletException { javax.servlet.http.HttpServletRequest req = ( ( javax.servlet.http.HttpServletRequest ) ( request ) ) ; if ( ! ( org.eclipse.jgit.http.server.GitSmartHttpTools.isGitClient ( req ) ) ) { chain.doFilter ( request , response ) ; return ; } javax.servlet.http.HttpServletResponseWrapper rsp = new javax.servlet.http.HttpServletResponseWrapper ( ( ( javax.servlet.http.HttpServletResponse ) ( response ) ) ) ; if ( verify ( req , rsp ) ) { chain.doFilter ( req , response ) ; } }

Target:
public void doFilter ( javax.servlet.ServletRequest request , javax.servlet.ServletResponse response , javax.servlet.FilterChain chain ) throws java.io.IOException , javax.servlet.ServletException { javax.servlet.http.HttpServletRequest req = ( ( javax.servlet.http.HttpServletRequest ) ( request ) ) ; javax.servlet.http.HttpServletResponse rsp = ( ( javax.servlet.http.HttpServletResponse ) ( response ) ) ; if ( verify ( req , rsp ) ) { chain.doFilter ( req , response ) ; } }
Source:
public void display ( final java.util.List < com.google.gerrit.common.data.GroupDetail > result ) { while ( 1 < ( table.getRowCount ( ) ) ) table.removeRow ( ( ( table.getRowCount ( ) ) - 1 ) ) ; for ( com.google.gerrit.common.data.GroupDetail detail : result ) { final int row = table.getRowCount ( ) ; table.insertRow ( row ) ; applyDataRowStyle ( row ) ; populate ( row , detail ) ; } }

Target:
public void display ( final java.util.List < com.google.gerrit.reviewdb.client.AccountGroup > result ) { while ( 1 < ( table.getRowCount ( ) ) ) table.removeRow ( ( ( table.getRowCount ( ) ) - 1 ) ) ; for ( com.google.gerrit.reviewdb.client.AccountGroup group : result ) { final int row = table.getRowCount ( ) ; table.insertRow ( row ) ; applyDataRowStyle ( row ) ; populate ( row , group ) ; } }
Source:
public com.google.gerrit.reviewdb.client.Change update ( com.google.gerrit.reviewdb.client.Change change ) { if ( ( ( change.getStatus ( ) ) == ( Change.Status.ABANDONED ) ) && ( change.currentPatchSetId ( ) . equals ( patchSetId ) ) ) { change.setStatus ( Change.Status.NEW ) ; com.google.gerrit.server.ChangeUtil.updated ( change ) ; return change ; } else { return null ; } }

Target:
public com.google.gerrit.reviewdb.client.Change update ( com.google.gerrit.reviewdb.client.Change change ) { if ( ( change.getStatus ( ) ) == ( Change.Status.ABANDONED ) ) { change.setStatus ( Change.Status.NEW ) ; com.google.gerrit.server.ChangeUtil.updated ( change ) ; return change ; } else { return null ; } }