auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void formatYearsMonths ( ) { com.google.gerrit.client.RelativeDateFormatterTest.assertFormat ( 366 , com.google.gerrit.client.RelativeDateFormatter.DAY_IN_MILLIS , "1 year ago" ) ; com.google.gerrit.client.RelativeDateFormatterTest.assertFormat ( 380 , com.google.gerrit.client.RelativeDateFormatter.DAY_IN_MILLIS , "1 year, 1 month ago" ) ; com.google.gerrit.client.RelativeDateFormatterTest.assertFormat ( 410 , com.google.gerrit.client.RelativeDateFormatter.DAY_IN_MILLIS , "1 year, 2 months ago" ) ; com.google.gerrit.client.RelativeDateFormatterTest.assertFormat ( 2 , com.google.gerrit.client.RelativeDateFormatter.YEAR_IN_MILLIS , "2 years ago" ) ; com.google.gerrit.client.RelativeDateFormatterTest.assertFormat ( 1824 , com.google.gerrit.client.RelativeDateFormatter.DAY_IN_MILLIS , "4 years, 12 months ago" ) ; }

Target:
public void formatYearsMonths ( ) { com.google.gerrit.client.RelativeDateFormatterTest.assertFormat ( 366 , com.google.gerrit.client.RelativeDateFormatter.DAY_IN_MILLIS , "1 year ago" ) ; com.google.gerrit.client.RelativeDateFormatterTest.assertFormat ( 380 , com.google.gerrit.client.RelativeDateFormatter.DAY_IN_MILLIS , "1 year, 1 month ago" ) ; com.google.gerrit.client.RelativeDateFormatterTest.assertFormat ( 410 , com.google.gerrit.client.RelativeDateFormatter.DAY_IN_MILLIS , "1 year, 2 months ago" ) ; com.google.gerrit.client.RelativeDateFormatterTest.assertFormat ( 2 , com.google.gerrit.client.RelativeDateFormatter.YEAR_IN_MILLIS , "2 years ago" ) ; com.google.gerrit.client.RelativeDateFormatterTest.assertFormat ( 1824 , com.google.gerrit.client.RelativeDateFormatter.DAY_IN_MILLIS , "5 years ago" ) ; }
Source:
public com.google.gerrit.server.ContactStore get ( ) { try { return new com.google.gerrit.server.EncryptedContactStore ( server , schema ) ; } catch ( final com.google.gerrit.client.rpc.ContactInformationStoreException initError ) { return new com.google.gerrit.server.ContactStore ( ) { @ java.lang.Override public void store ( com.google.gerrit.client.reviewdb.Account account , com.google.gerrit.client.reviewdb.ContactInformation info ) throws com.google.gerrit.client.rpc.ContactInformationStoreException { throw initError ; } } ; } }

Target:
public com.google.gerrit.server.ContactStore get ( ) { try { return new com.google.gerrit.server.EncryptedContactStore ( server , sitePath , schema ) ; } catch ( final com.google.gerrit.client.rpc.ContactInformationStoreException initError ) { return new com.google.gerrit.server.ContactStore ( ) { @ java.lang.Override public void store ( com.google.gerrit.client.reviewdb.Account account , com.google.gerrit.client.reviewdb.ContactInformation info ) throws com.google.gerrit.client.rpc.ContactInformationStoreException { throw initError ; } } ; } }
Source:
public void createChangeWithPrivateByDefaultEnabled ( ) throws java.lang.Exception { com.google.gerrit.extensions.common.ChangeInput input = new com.google.gerrit.extensions.common.ChangeInput ( project.get ( ) , "master" , "empty change" ) ; com.google.common.truth.Truth.assertThat ( gApi.changes ( ) . create ( input ) . get ( ) . isPrivate ) . isEqualTo ( true ) ; }

Target:
public void createChangeWithPrivateByDefaultEnabled ( ) throws java.lang.Exception { setPrivateByDefault ( project2 , InheritableBoolean.TRUE ) ; com.google.gerrit.extensions.common.ChangeInput input = new com.google.gerrit.extensions.common.ChangeInput ( project2.get ( ) , "master" , "empty change" ) ; com.google.common.truth.Truth.assertThat ( gApi.changes ( ) . create ( input ) . get ( ) . isPrivate ) . isEqualTo ( true ) ; }
Source:
public void uploadPackSubsetOfBranchesVisibleNotIncludingHead ( ) throws java.lang.Exception { deny ( Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/master" ) ; allow ( Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/branch" ) ; setApiUser ( user ) ; assertUploadPackRefs ( ( ( r2 ) + "1" ) , ( ( r2 ) + "meta" ) , "refs/heads/branch" , "refs/tags/branch-tag" , "refs/tags/master-tag" ) ; }

Target:
public void uploadPackSubsetOfBranchesVisibleNotIncludingHead ( ) throws java.lang.Exception { deny ( Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/master" ) ; allow ( Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/branch" ) ; setApiUser ( user ) ; assertUploadPackRefs ( ( ( r2 ) + "1" ) , ( ( r2 ) + "meta" ) , ( ( r4 ) + "1" ) , ( ( r4 ) + "meta" ) , "refs/heads/branch" , "refs/tags/branch-tag" , "refs/tags/master-tag" ) ; }
Source:
public void revokedKeyDueToNoLongerBeingUsedDoesNotRevokeKeyRetroactively ( ) throws java.lang.Exception { com.google.gerrit.gpg.testutil.TestKey k = add ( com.google.gerrit.gpg.testutil.TestKeys.revokedNoLongerUsedKey ( ) ) ; add ( com.google.gerrit.gpg.testutil.TestKeys.validKeyWithoutExpiration ( ) ) ; save ( ) ; assertProblems ( k , "Key is revoked (retired and no longer valid): test7 not used" ) ; com.google.gerrit.gpg.PublicKeyChecker checker = new com.google.gerrit.gpg.PublicKeyChecker ( ) . setStore ( store ) . setEffectiveTime ( com.google.gerrit.gpg.PublicKeyCheckerTest.parseDate ( "2010-01-01 12:00:00 -0400" ) ) ; assertProblems ( checker , k ) ; }

Target:
public void revokedKeyDueToNoLongerBeingUsedDoesNotRevokeKeyRetroactively ( ) throws java.lang.Exception { com.google.gerrit.gpg.testutil.TestKey k = add ( com.google.gerrit.gpg.testutil.TestKeys.revokedNoLongerUsedKey ( ) ) ; add ( com.google.gerrit.gpg.testutil.TestKeys.validKeyWithoutExpiration ( ) ) ; save ( ) ; assertProblems ( k , "Key is revoked (retired and no longer valid): test7 not used" ) ; com.google.gerrit.gpg.PublicKeyChecker checker = new com.google.gerrit.gpg.PublicKeyChecker ( ) . setStore ( store ) . setEffectiveTime ( com.google.gerrit.gpg.PublicKeyCheckerTest.parseDate ( "2010-01-01 12:00:00 -0400" ) ) ; assertNoProblems ( checker , k ) ; }
Source:
public void updateParentAsUser ( ) throws java.lang.Exception { java.lang.String newParentProjectName = createProject ( ( ( PROJECT_NAME ) + "PA" ) ) . get ( ) ; com.google.gerrit.extensions.api.access.ProjectAccessInput accessInput = newProjectAccessInput ( ) ; accessInput.parent = newParentProjectName ; setApiUser ( user ) ; exception.expect ( com.google.gerrit.extensions.restapi.AuthException.class ) ; exception.expectMessage ( "not administrator" ) ; gApi.projects ( ) . name ( newProjectName ) . access ( accessInput ) ; }

Target:
public void updateParentAsUser ( ) throws java.lang.Exception { java.lang.String newParentProjectName = createProject ( ( ( PROJECT_NAME ) + "PA" ) ) . get ( ) ; com.google.gerrit.extensions.api.access.ProjectAccessInput accessInput = newProjectAccessInput ( ) ; accessInput.parent = newParentProjectName ; setApiUser ( user ) ; exception.expect ( com.google.gerrit.extensions.restapi.AuthException.class ) ; exception.expectMessage ( "administrate server not permitted" ) ; gApi.projects ( ) . name ( newProjectName ) . access ( accessInput ) ; }
Source:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { com.google.gwt.user.client.Element row = getRow ( event.getNativeEvent ( ) . getEventTarget ( ) . < com.google.gwt.user.client.Element > cast ( ) ) ; if ( row != null ) { movePointerTo ( ( ( startRow ) + ( com.google.gwt.user.client.DOM.getChildIndex ( body , row ) ) ) , false ) ; event.stopPropagation ( ) ; } }

Target:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { com.google.gwt.dom.client.Element row = getRow ( event.getNativeEvent ( ) . getEventTarget ( ) . < com.google.gwt.dom.client.Element > cast ( ) ) ; if ( row != null ) { movePointerTo ( ( ( startRow ) + ( com.google.gwt.user.client.DOM.getChildIndex ( body , row ) ) ) , false ) ; event.stopPropagation ( ) ; } }
Source:
public void start ( ) { org.apache.log4j.Logger replicationLogger = org.apache.log4j.LogManager.getLogger ( ReplicationQueue.REPLICATION_LOG_NAME ) ; replicationLogger.removeAllAppenders ( ) ; replicationLogger.addAppender ( systemLog.createAsyncAppender ( replicationLogger.getName ( ) , new org.apache.log4j.PatternLayout ( ( ( "[%d] [%X{" + ( PushOne.ID_MDC_KEY ) ) + "}] %m%n" ) ) ) ) ; replicationLogger.setAdditivity ( false ) ; }

Target:
public void start ( ) { if ( ! ( com.googlesource.gerrit.plugins.replication.ReplicationLogFile.started ) ) { org.apache.log4j.Logger replicationLogger = org.apache.log4j.LogManager.getLogger ( ReplicationQueue.REPLICATION_LOG_NAME ) ; replicationLogger.removeAllAppenders ( ) ; replicationLogger.addAppender ( systemLog.createAsyncAppender ( replicationLogger.getName ( ) , new org.apache.log4j.PatternLayout ( ( ( "[%d] [%X{" + ( PushOne.ID_MDC_KEY ) ) + "}] %m%n" ) ) ) ) ; replicationLogger.setAdditivity ( false ) ; com.googlesource.gerrit.plugins.replication.ReplicationLogFile.started = true ; } }
Source:
public void approvalTombstoneCommitFormat ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = newChange ( ) ; com.google.gerrit.server.notedb.ChangeUpdate update = newUpdate ( c , changeOwner ) ; update.removeApproval ( "Code-Review" ) ; update.commit ( ) ; assertBodyEquals ( ( "Update patch set 1\n" + ( ( "\n" + "Patch-set: 1\n" ) + "Label: -Code-Review\n" ) ) , update.getRevision ( ) ) ; }

Target:
public void approvalTombstoneCommitFormat ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = newChange ( ) ; com.google.gerrit.server.notedb.ChangeUpdate update = newUpdate ( c , changeOwner ) ; update.removeApproval ( "Code-Review" ) ; update.commit ( ) ; assertBodyEquals ( ( "Update patch set 1\n" + ( ( "\n" + "Patch-set: 1\n" ) + "Label: -Code-Review\n" ) ) , update.getResult ( ) ) ; }
Source:
public void usernamePatternCanUploadToAnyRef ( ) { com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/users/${username}/*" ) ; com.google.gerrit.server.project.ProjectControl u = user ( local , "a-registered-user" ) ; assertCanUpload ( u ) ; }

Target:
public void usernamePatternNonRegex ( ) { com.google.gerrit.server.project.testing.Util.allow ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.project.testing.Util.DEVS , "refs/sb/${username}/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = user ( local , "u" , com.google.gerrit.server.project.testing.Util.DEVS ) ; com.google.gerrit.server.project.ProjectControl d = user ( local , "d" , com.google.gerrit.server.project.testing.Util.DEVS ) ; assertCannotRead ( "refs/sb/d/heads/foobar" , u ) ; assertCanRead ( "refs/sb/d/heads/foobar" , d ) ; }
Source:
public void currentRevision ( ) throws java.lang.Exception { com.google.gerrit.server.change.ChangeJson.ChangeInfo c = getChange ( changeId , com.google.gerrit.extensions.common.ListChangesOption.CURRENT_REVISION ) ; org.junit.Assert.assertEquals ( commitId ( 2 ) , c.current_revision ) ; org.junit.Assert.assertEquals ( com.google.common.collect.ImmutableSet.of ( commitId ( 2 ) ) , c.revisions.keySet ( ) ) ; org.junit.Assert.assertEquals ( 3 , c.revisions.get ( commitId ( 2 ) ) . _number ) ; }

Target:
public void currentRevision ( ) throws java.lang.Exception { com.google.gerrit.server.change.ChangeJson.ChangeInfo c = getChange ( changeId , com.google.gerrit.extensions.common.ListChangesOption.CURRENT_REVISION ) ; org.junit.Assert.assertEquals ( commitId ( 2 ) , c.currentRevision ) ; org.junit.Assert.assertEquals ( com.google.common.collect.ImmutableSet.of ( commitId ( 2 ) ) , c.revisions.keySet ( ) ) ; org.junit.Assert.assertEquals ( 3 , c.revisions.get ( commitId ( 2 ) ) . _number ) ; }
Source:
private static int append ( byte [ ] src , final byte [ ] dst , int p ) { java.lang.System.arraycopy ( src , 0 , dst , p , src.length ) ; return p + ( src.length ) ; }

Target:
private void plugins ( java.io.StringWriter w ) { java.util.List < java.lang.String > urls = com.google.common.collect.Lists.newArrayList ( ) ; for ( com.google.gerrit.extensions.webui.WebUiPlugin u : plugins ) { urls.add ( java.lang.String.format ( "plugins/%s/%s" , u.getPluginName ( ) , u.getJavaScriptResourcePath ( ) ) ) ; } if ( ! ( urls.isEmpty ( ) ) ) { w.write ( ( ( com.google.gerrit.httpd.raw.HostPageServlet.HPD_ID ) + ".plugins=" ) ) ; json ( urls , w ) ; w.write ( ";" ) ; } }
Source:
private void authenticate ( java.lang.String dn , java.lang.String password ) throws com.google.gerrit.server.account.AccountException { final java.util.Properties env = createContextProperties ( ) ; env.put ( javax.naming.Context.SECURITY_AUTHENTICATION , "simple" ) ; env.put ( javax.naming.Context.SECURITY_PRINCIPAL , dn ) ; env.put ( javax.naming.Context.SECURITY_CREDENTIALS , ( password != null ? password : "" ) ) ; try { new javax.naming.directory.InitialDirContext ( env ) . close ( ) ; } catch ( javax.naming.NamingException e ) { throw new com.google.gerrit.server.account.AccountException ( "Incorrect username or password" , e ) ; } }

Target:
private javax.naming.directory.DirContext authenticate ( java.lang.String dn , java.lang.String password ) throws com.google.gerrit.server.account.AccountException { final java.util.Properties env = createContextProperties ( ) ; env.put ( javax.naming.Context.SECURITY_AUTHENTICATION , "simple" ) ; env.put ( javax.naming.Context.SECURITY_PRINCIPAL , dn ) ; env.put ( javax.naming.Context.SECURITY_CREDENTIALS , ( password != null ? password : "" ) ) ; try { return new javax.naming.directory.InitialDirContext ( env ) ; } catch ( javax.naming.NamingException e ) { throw new com.google.gerrit.server.account.AccountException ( "Incorrect username or password" , e ) ; } }
Source:
public void configure ( ) { factory ( ChangeUpdate.Factory.class ) ; factory ( ChangeDraftUpdate.Factory.class ) ; factory ( DraftCommentNotes.Factory.class ) ; factory ( NoteDbUpdateManager.Factory.class ) ; if ( ! ( useTestBindings ) ) { bind ( com.google.gerrit.server.notedb.ChangeRebuilder.class ) . to ( com.google.gerrit.server.notedb.ChangeRebuilderImpl.class ) ; } else { bind ( com.google.gerrit.server.notedb.ChangeRebuilder.class ) . toInstance ( new com.google.gerrit.server.notedb.ChangeRebuilder ( null ) { @ java.lang.Override public com.google.gerrit.server.notedb.NoteDbChangeState rebuild ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Change.Id changeId ) throws com.google.gwtorm.server.OrmException { return null ; } } ) ; } }

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 { return null ; }
Source:
public static void setChangeDetail ( com.google.gerrit.common.data.ChangeDetail detail ) { com.google.gerrit.reviewdb.client.Change.Id chgId = detail.getChange ( ) . getId ( ) ; com.google.gerrit.client.changes.ChangeCache.get ( chgId ) . getChangeDetailCache ( ) . set ( detail ) ; }

Target:
public static void setChangeDetail ( com.google.gerrit.common.data.ChangeDetail detail ) { com.google.gerrit.reviewdb.client.Change.Id chgId = detail.getChange ( ) . getId ( ) ; com.google.gerrit.client.changes.ChangeCache.get ( chgId ) . getChangeDetailCache ( ) . set ( detail ) ; com.google.gerrit.client.changes.StarredChanges.fireChangeStarEvent ( chgId , detail.isStarred ( ) ) ; }
Source:
private java.util.Set < com.google.gerrit.reviewdb.client.Change.Id > visibleChanges ( ) { if ( ! ( showMetadata ) ) { return java.util.Collections.emptySet ( ) ; } else if ( ( changeCache ) == null ) { return visibleChangesByScan ( ) ; } return visibleChangesBySearch ( ) ; }

Target:
private boolean visible ( com.google.gerrit.reviewdb.client.Change.Id changeId ) { if ( ( visibleChanges ) == null ) { if ( ( changeCache ) == null ) { visibleChanges = visibleChangesByScan ( ) ; } else { visibleChanges = visibleChangesBySearch ( ) ; } } return visibleChanges.contains ( changeId ) ; }
Source:
public com.google.gwtjsonrpc.client.VoidResult run ( final com.google.gerrit.client.reviewdb.ReviewDb db ) throws com.google.gwtorm.client.OrmException { final com.google.gerrit.client.reviewdb.Account a = db.accounts ( ) . get ( com.google.gerrit.client.rpc.Common.getAccountId ( ) ) ; a.setDefaultContext ( newSetting ) ; db.accounts ( ) . update ( java.util.Collections.singleton ( a ) ) ; return com.google.gwtjsonrpc.client.VoidResult.INSTANCE ; }

Target:
public com.google.gwtjsonrpc.client.VoidResult run ( final com.google.gerrit.client.reviewdb.ReviewDb db ) throws com.google.gwtorm.client.OrmException { final com.google.gerrit.client.reviewdb.Account a = db.accounts ( ) . get ( com.google.gerrit.client.rpc.Common.getAccountId ( ) ) ; a.setDefaultContext ( newSetting ) ; db.accounts ( ) . update ( java.util.Collections.singleton ( a ) ) ; com.google.gerrit.client.rpc.Common.getAccountCache ( ) . invalidate ( a.getId ( ) ) ; return com.google.gwtjsonrpc.client.VoidResult.INSTANCE ; }
Source:
public void testVerifyAgainstMissingToken ( ) throws java.lang.Exception { com.google.common.truth.Truth.assertThat ( auth.verifyAgainstToken ( "" , "o" , org.eclipse.jgit.lfs.lib.LongObjectId.zeroId ( ) ) ) . isFalse ( ) ; com.google.common.truth.Truth.assertThat ( auth.verifyAgainstToken ( null , "o" , org.eclipse.jgit.lfs.lib.LongObjectId.zeroId ( ) ) ) . isFalse ( ) ; }

Target:
public void testVerifyAuthInfo ( ) throws java.lang.Exception { com.googlesource.gerrit.plugins.lfs.fs.LfsFsRequestAuthorizer.AuthInfo info = auth.generateAuthInfo ( "o" , org.eclipse.jgit.lfs.lib.LongObjectId.zeroId ( ) , 1 ) ; com.google.common.truth.Truth.assertThat ( auth.verifyAuthInfo ( info.authToken , "o" , org.eclipse.jgit.lfs.lib.LongObjectId.zeroId ( ) ) ) . isTrue ( ) ; }
Source:
private com.google.gerrit.server.notedb.NoteDbUpdateManager.OpenRepo openRepo ( com.google.gerrit.reviewdb.client.Project.NameKey p ) throws java.io.IOException { org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( p ) ; org.eclipse.jgit.lib.ObjectInserter ins = repo.newObjectInserter ( ) ; return new com.google.gerrit.server.notedb.NoteDbUpdateManager.OpenRepo ( repo , new org.eclipse.jgit.revwalk.RevWalk ( ins.newReader ( ) ) , ins , new com.google.gerrit.server.git.ChainedReceiveCommands ( repo ) , true ) ; }

Target:
private com.google.gerrit.server.notedb.NoteDbUpdateManager.OpenRepo openRepo ( com.google.gerrit.reviewdb.client.Project.NameKey p ) throws java.io.IOException { org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( p ) ; org.eclipse.jgit.lib.ObjectInserter ins = repo.newObjectInserter ( ) ; return new com.google.gerrit.server.notedb.NoteDbUpdateManager.OpenRepo ( repo , new org.eclipse.jgit.revwalk.RevWalk ( ins.newReader ( ) ) , ins , new com.google.gerrit.server.update.ChainedReceiveCommands ( repo ) , true ) ; }
Source:
public static java.lang.String toChangeQuery ( java.lang.String query , java.lang.String page ) { return ( ( "/q/" + ( com.google.gwtorm.client.KeyUtil.encode ( query ) ) ) + "," ) + page ; }

Target:
public static java.lang.String toChangeQuery ( java.lang.String query , java.lang.String start ) { int s = java.lang.Integer.parseInt ( start ) ; return ( ( com.google.gerrit.common.PageLinks.QUERY ) + ( com.google.gwtorm.client.KeyUtil.encode ( query ) ) ) + ( s > 0 ? "," + s : "" ) ; }
Source:
private void statesCleanUp ( ) { if ( ( ! ( stateMap.isEmpty ( ) ) ) && ( ! ( isRetrying ( ) ) ) ) { for ( java.util.Map.Entry < java.lang.String , com.googlesource.gerrit.plugins.replication.ReplicationState > entry : stateMap.entries ( ) ) { entry.getValue ( ) . notifyRefReplicated ( projectName.get ( ) , entry.getKey ( ) , uri , RefPushResult.FAILED , null ) ; } } }

Target:
com.googlesource.gerrit.plugins.replication.ReplicationState [ ] getStatesAsArray ( ) { java.util.Set < com.googlesource.gerrit.plugins.replication.ReplicationState > statesSet = new java.util.HashSet < > ( ) ; statesSet.addAll ( stateMap.values ( ) ) ; return statesSet.toArray ( new com.googlesource.gerrit.plugins.replication.ReplicationState [ statesSet.size ( ) ] ) ; }
Source:
public static void patch ( java.lang.String token , final com.google.gerrit.reviewdb.Patch.Key id , final int patchIndex , final com.google.gerrit.common.data.PatchSetDetail patchSetDetail , final com.google.gerrit.client.changes.PatchTable patchTable , final java.lang.String panelType ) { com.google.gerrit.client.Dispatcher.patch ( token , id , patchIndex , patchSetDetail , patchTable , null , panelType ) ; }

Target:
public static void patch ( java.lang.String token , com.google.gerrit.reviewdb.PatchSet.Id base , com.google.gerrit.reviewdb.Patch.Key id , int patchIndex , com.google.gerrit.common.data.PatchSetDetail patchSetDetail , com.google.gerrit.client.changes.PatchTable patchTable , com.google.gerrit.client.patches.PatchScreen.TopView topView ) { com.google.gerrit.client.Dispatcher.patch ( token , base , id , patchIndex , patchSetDetail , patchTable , topView , null ) ; }
Source:
private static org.apache.lucene.search.Query timestampQuery ( com.google.gerrit.server.index.IndexPredicate < com.google.gerrit.server.query.change.ChangeData > p ) throws com.google.gerrit.server.query.QueryParseException { if ( p instanceof com.google.gerrit.server.index.TimestampRangePredicate ) { com.google.gerrit.server.index.TimestampRangePredicate < com.google.gerrit.server.query.change.ChangeData > r = ( ( com.google.gerrit.server.index.TimestampRangePredicate < com.google.gerrit.server.query.change.ChangeData > ) ( p ) ) ; return org.apache.lucene.search.NumericRangeQuery.newIntRange ( r.getField ( ) . getName ( ) , com.google.gerrit.lucene.LuceneChangeIndex.toIndexTime ( r.getMinTimestamp ( ) ) , com.google.gerrit.lucene.LuceneChangeIndex.toIndexTime ( r.getMaxTimestamp ( ) ) , true , true ) ; } throw new com.google.gerrit.server.query.QueryParseException ( ( "not a timestamp: " + p ) ) ; }

Target:
public void markReady ( ) throws java.io.IOException { try { org.eclipse.jgit.storage.file.FileBasedConfig cfg = com.google.gerrit.lucene.LuceneVersionManager.loadGerritIndexConfig ( sitePaths ) ; cfg.setBoolean ( "index" , java.lang.Integer.toString ( schema.getVersion ( ) ) , "ready" , true ) ; cfg.save ( ) ; } catch ( org.eclipse.jgit.errors.ConfigInvalidException e ) { throw new java.io.IOException ( e ) ; } }
Source:
private com.google.gerrit.server.notedb.ChangeUpdate newUpdate ( com.google.gerrit.reviewdb.client.Change c , com.google.gerrit.reviewdb.client.Account.Id owner ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { return new com.google.gerrit.server.notedb.ChangeUpdate ( repo , LABEL_TYPES , c , owner , null ) ; }

Target:
public void multipleReviewers ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = newChange ( ) ; com.google.gerrit.server.notedb.ChangeUpdate update = newUpdate ( c , com.google.gerrit.server.notedb.ChangeNotesTest.CHANGE_OWNER ) ; update.putReviewer ( com.google.gerrit.server.notedb.ChangeNotesTest.CHANGE_OWNER.getId ( ) , ReviewerState.REVIEWER ) ; update.putReviewer ( com.google.gerrit.server.notedb.ChangeNotesTest.OTHER_ACCOUNT.getId ( ) , ReviewerState.REVIEWER ) ; commit ( update ) ; com.google.gerrit.server.notedb.ChangeNotes notes = newNotes ( c ) ; org.junit.Assert.assertEquals ( com.google.common.collect.ImmutableSetMultimap.of ( ReviewerState.REVIEWER , new com.google.gerrit.reviewdb.client.Account.Id ( 1 ) , ReviewerState.REVIEWER , new com.google.gerrit.reviewdb.client.Account.Id ( 2 ) ) , notes.getReviewers ( ) ) ; }
Source:
private void parsePostRequest ( final com.google.gwtjsonrpc.server.ActiveCall call , final java.io.Reader in ) { final com.google.gson.GsonBuilder gb = createGsonBuilder ( ) ; gb.registerTypeAdapter ( com.google.gwtjsonrpc.server.ActiveCall.class , new com.google.gwtjsonrpc.server.CallDeserializer ( call , this ) ) ; gb.create ( ) . fromJson ( in , com.google.gwtjsonrpc.server.ActiveCall.class ) ; }

Target:
private void parsePostRequest ( final CallType call , final java.io.Reader in ) { final com.google.gson.GsonBuilder gb = createGsonBuilder ( ) ; gb.registerTypeAdapter ( com.google.gwtjsonrpc.server.ActiveCall.class , new com.google.gwtjsonrpc.server.CallDeserializer < CallType > ( call , this ) ) ; gb.create ( ) . fromJson ( in , com.google.gwtjsonrpc.server.ActiveCall.class ) ; }
Source:
private static java.lang.String owner ( com.google.gerrit.client.changes.ChangeInfo.GitPerson person ) { if ( ( person.email ( ) ) != null ) { return person.email ( ) ; } else if ( ( person.name ( ) ) != null ) { return person.name ( ) ; } else { return "" ; } }

Target:
private static java.lang.String owner ( com.google.gerrit.client.info.ChangeInfo.GitPerson person ) { if ( ( person.email ( ) ) != null ) { return person.email ( ) ; } else if ( ( person.name ( ) ) != null ) { return person.name ( ) ; } else { return "" ; } }
Source:
public static void setDefaults ( org.eclipse.jgit.lib.Config cfg ) { cfg.setEnum ( "auth" , null , "type" , AuthType.DEVELOPMENT_BECOME_ANY_ACCOUNT ) ; cfg.setString ( "gerrit" , null , "basePath" , "git" ) ; cfg.setString ( "gerrit" , null , "allProjects" , "Test-Projects" ) ; cfg.setString ( "user" , null , "name" , "Gerrit Code Review" ) ; cfg.setString ( "user" , null , "email" , "gerrit@localhost" ) ; cfg.setString ( "cache" , null , "directory" , null ) ; cfg.setString ( "index" , null , "type" , "lucene" ) ; cfg.setBoolean ( "index" , "lucene" , "testInmemory" , true ) ; cfg.setInt ( "index" , "lucene" , "testVersion" , com.google.gerrit.server.index.ChangeSchemas.getLatest ( ) . getVersion ( ) ) ; }

Target:
public static void setDefaults ( org.eclipse.jgit.lib.Config cfg ) { cfg.setEnum ( "auth" , null , "type" , AuthType.DEVELOPMENT_BECOME_ANY_ACCOUNT ) ; cfg.setString ( "gerrit" , null , "basePath" , "git" ) ; cfg.setString ( "gerrit" , null , "allProjects" , "Test-Projects" ) ; cfg.setString ( "user" , null , "name" , "Gerrit Code Review" ) ; cfg.setString ( "user" , null , "email" , "gerrit@localhost" ) ; cfg.setString ( "cache" , null , "directory" , null ) ; cfg.setString ( "index" , null , "type" , "lucene" ) ; cfg.setBoolean ( "index" , "lucene" , "testInmemory" , true ) ; cfg.setInt ( "index" , "lucene" , "testVersion" , com.google.gerrit.server.index.ChangeSchemas.getLatest ( ) . getVersion ( ) ) ; cfg.setInt ( "sendemail" , null , "threadPoolSize" , 0 ) ; }
Source:
private java.util.Map < java.lang.String , com.google.gerrit.extensions.common.ActionInfo > getActions ( java.lang.String changeId ) throws java.io.IOException { return newGson ( ) . fromJson ( adminSession.get ( ( ( "/changes/" + changeId ) + "/revisions/1/actions" ) ) . getReader ( ) , new com.google.gson.reflect.TypeToken < java.util.Map < java.lang.String , com.google.gerrit.extensions.common.ActionInfo > > ( ) { } . getType ( ) ) ; }

Target:
static java.util.Map < java.lang.String , com.google.gerrit.extensions.common.ActionInfo > getActions ( com.google.gerrit.acceptance.RestSession adminSession , java.lang.String changeId ) throws java.io.IOException { return newGson ( ) . fromJson ( adminSession.get ( ( ( "/changes/" + changeId ) + "/revisions/1/actions" ) ) . getReader ( ) , new com.google.gson.reflect.TypeToken < java.util.Map < java.lang.String , com.google.gerrit.extensions.common.ActionInfo > > ( ) { } . getType ( ) ) ; }
Source:
void swap ( int row1 , int row2 ) { java.util.List < java.lang.String > value = getRowItem ( row1 ) ; java.util.List < java.lang.String > nextValue = getRowItem ( row2 ) ; populate ( row1 , nextValue , false ) ; populate ( row2 , value , ( row2 == ( ( table.getRowCount ( ) ) - 1 ) ) ) ; widget.setEnabled ( true ) ; }

Target:
void swap ( int row1 , int row2 ) { java.util.List < java.lang.String > value = getRowItem ( row1 ) ; java.util.List < java.lang.String > nextValue = getRowItem ( row2 ) ; populate ( row1 , nextValue ) ; populate ( row2 , value ) ; updateNavigationLinks ( ) ; widget.setEnabled ( true ) ; }
Source:
private static java.util.Properties loadBuckProperties ( java.io.File gen ) throws java.io.FileNotFoundException , java.io.IOException { java.util.Properties properties = new java.util.Properties ( ) ; try ( java.io.InputStream in = new java.io.FileInputStream ( new java.io.File ( new java.io.File ( gen , "tools" ) , "buck.properties" ) ) ) { properties.load ( in ) ; } return properties ; }

Target:
private static java.util.Properties loadBuckProperties ( java.nio.file.Path gen ) throws java.io.FileNotFoundException , java.io.IOException { java.util.Properties properties = new java.util.Properties ( ) ; try ( java.io.InputStream in = new java.io.FileInputStream ( gen.resolve ( java.nio.file.Paths.get ( "tools/buck/buck.properties" ) ) . toFile ( ) ) ) { properties.load ( in ) ; } return properties ; }
Source:
public void markAsReviewed ( boolean reviewed ) throws com.google.gerrit.extensions.restapi.RestApiException { try { if ( reviewed ) { markAsReviewed.apply ( change , new com.google.gerrit.server.change.MarkAsReviewed.Input ( ) ) ; } else { markAsUnreviewed.apply ( change , new com.google.gerrit.server.change.MarkAsUnreviewed.Input ( ) ) ; } } catch ( com.google.gwtorm.server.OrmException | com.google.gerrit.server.StarredChangesUtil.IllegalLabelException e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( ( "Cannot mark change as " + ( reviewed ? "reviewed" : "unreviewed" ) ) , e ) ; } }

Target:
public void markAsReviewed ( boolean reviewed ) throws com.google.gerrit.extensions.restapi.RestApiException { try { if ( reviewed ) { markAsReviewed.apply ( change , new com.google.gerrit.extensions.common.Input ( ) ) ; } else { markAsUnreviewed.apply ( change , new com.google.gerrit.extensions.common.Input ( ) ) ; } } catch ( com.google.gwtorm.server.OrmException | com.google.gerrit.server.StarredChangesUtil.IllegalLabelException e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( ( "Cannot mark change as " + ( reviewed ? "reviewed" : "unreviewed" ) ) , e ) ; } }
Source:
public com.google.gerrit.acceptance.RestResponse put ( java.lang.String endPoint , java.lang.Object content ) throws java.io.IOException { org.apache.http.client.methods.HttpPut put = new org.apache.http.client.methods.HttpPut ( ( "http://localhost:8080/a" + endPoint ) ) ; if ( content != null ) { put.addHeader ( new org.apache.http.message.BasicHeader ( "Content-Type" , "application/json" ) ) ; put.setEntity ( new org.apache.http.entity.StringEntity ( new com.google.gson.Gson ( ) . toJson ( content ) , com.google.common.base.Charsets.UTF_8.name ( ) ) ) ; } return new com.google.gerrit.acceptance.RestResponse ( getClient ( ) . execute ( put ) ) ; }

Target:
public com.google.gerrit.acceptance.RestResponse put ( java.lang.String endPoint , java.lang.Object content ) throws java.io.IOException { org.apache.http.client.methods.HttpPut put = new org.apache.http.client.methods.HttpPut ( ( ( ( url ) + "/a" ) + endPoint ) ) ; if ( content != null ) { put.addHeader ( new org.apache.http.message.BasicHeader ( "Content-Type" , "application/json" ) ) ; put.setEntity ( new org.apache.http.entity.StringEntity ( new com.google.gson.Gson ( ) . toJson ( content ) , com.google.common.base.Charsets.UTF_8.name ( ) ) ) ; } return new com.google.gerrit.acceptance.RestResponse ( getClient ( ) . execute ( put ) ) ; }
Source:
protected com.google.gwt.user.client.Element getParentCell ( final com.google.gwt.user.client.Element target ) { final com.google.gwt.user.client.Element body = com.google.gerrit.client.ui.FancyFlexTableImpl.getBodyElement ( table ) ; for ( com.google.gwt.user.client.Element td = target ; ( td != null ) && ( td != body ) ; td = com.google.gwt.user.client.DOM.getParent ( td ) ) { if ( "td" . equalsIgnoreCase ( td.getTagName ( ) ) ) { com.google.gwt.user.client.Element tr = com.google.gwt.user.client.DOM.getParent ( td ) ; if ( ( com.google.gwt.user.client.DOM.getParent ( tr ) ) == body ) { return td ; } } } return null ; }

Target:
protected com.google.gwt.dom.client.Element getParentCell ( final com.google.gwt.dom.client.Element target ) { final com.google.gwt.dom.client.Element body = com.google.gerrit.client.ui.FancyFlexTableImpl.getBodyElement ( table ) ; for ( com.google.gwt.dom.client.Element td = target ; ( td != null ) && ( td != body ) ; td = com.google.gwt.user.client.DOM.getParent ( td ) ) { if ( "td" . equalsIgnoreCase ( td.getTagName ( ) ) ) { com.google.gwt.dom.client.Element tr = com.google.gwt.user.client.DOM.getParent ( td ) ; if ( ( com.google.gwt.user.client.DOM.getParent ( tr ) ) == body ) { return td ; } } } return null ; }
Source:
private AccountGroup.Id owner ( com.google.gerrit.server.group.CreateGroup.Input input ) throws com.google.gerrit.extensions.restapi.BadRequestException { if ( ( input.ownerId ) != null ) { try { com.google.gerrit.server.group.GroupResource rsrc = groups.parse ( com.google.gerrit.extensions.restapi.Url.decode ( input.ownerId ) ) ; com.google.gerrit.reviewdb.client.AccountGroup owner = com.google.gerrit.common.data.GroupDescriptions.toAccountGroup ( rsrc.getGroup ( ) ) ; if ( owner == null ) { throw new com.google.gerrit.extensions.restapi.BadRequestException ( "ownerId must be internal group" ) ; } return owner.getId ( ) ; } catch ( com.google.gerrit.extensions.restapi.ResourceNotFoundException e ) { throw new com.google.gerrit.extensions.restapi.BadRequestException ( "ownerId cannot be resolved" ) ; } } return null ; }

Target:
private AccountGroup.Id owner ( com.google.gerrit.server.group.CreateGroup.Input input ) throws com.google.gerrit.extensions.restapi.BadRequestException { if ( ( input.ownerId ) != null ) { try { com.google.gerrit.common.data.GroupDescription.Basic d = groups.parse ( com.google.gerrit.extensions.restapi.Url.decode ( input.ownerId ) ) ; com.google.gerrit.reviewdb.client.AccountGroup owner = com.google.gerrit.common.data.GroupDescriptions.toAccountGroup ( d ) ; if ( owner == null ) { throw new com.google.gerrit.extensions.restapi.BadRequestException ( "ownerId must be internal group" ) ; } return owner.getId ( ) ; } catch ( com.google.gerrit.extensions.restapi.ResourceNotFoundException e ) { throw new com.google.gerrit.extensions.restapi.BadRequestException ( "ownerId cannot be resolved" ) ; } } return null ; }
Source:
protected void onLoad ( ) { super . onLoad ( ) ; Util.PROJECT_SVC.visibleProjects ( new com.google.gerrit.client.rpc.ScreenLoadCallback < com.google.gerrit.common.data.ProjectList > ( this ) { @ java.lang.Override protected void preDisplay ( final com.google.gerrit.common.data.ProjectList result ) { createProjectLinkPanel.setVisible ( result.canCreateProject ( ) ) ; projects.display ( result.getProjects ( ) ) ; projects.finishDisplay ( ) ; } } ) ; }

Target:
protected void onLoad ( ) { super . onLoad ( ) ; createProjectLinkPanel.setVisible ( false ) ; com.google.gerrit.client.account.AccountCapabilities.all ( new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.account.AccountCapabilities > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.account.AccountCapabilities ac ) { createProjectLinkPanel.setVisible ( ac.canPerform ( com.google.gerrit.common.data.GlobalCapability.CREATE_PROJECT ) ) ; } } , com.google.gerrit.common.data.GlobalCapability.CREATE_PROJECT ) ; com.google.gerrit.client.projects.ProjectMap.all ( new com.google.gerrit.client.rpc.ScreenLoadCallback < com.google.gerrit.client.projects.ProjectMap > ( this ) { @ java.lang.Override protected void preDisplay ( final com.google.gerrit.client.projects.ProjectMap result ) { projects.display ( result ) ; projects.finishDisplay ( ) ; } } ) ; }
Source:
public int compareTo ( com.google.gerrit.server.change.SuggestReviewers.SuggestedReviewerInfo o ) { return getSortValue ( ) . compareTo ( o.getSortValue ( ) ) ; }

Target:
private boolean addSuggestion ( java.util.Map < com.google.gerrit.reviewdb.client.Account.Id , com.google.gerrit.extensions.common.AccountInfo > map , com.google.gerrit.reviewdb.client.Account.Id account , com.google.gerrit.server.change.SuggestReviewers.VisibilityControl visibilityControl ) throws com.google.gwtorm.server.OrmException { if ( ( ( ! ( map.containsKey ( account ) ) ) && ( visibilityControl.isVisibleTo ( account ) ) ) && ( accountControl.canSee ( account ) ) ) { map.put ( account , accountLoader.get ( account ) ) ; return true ; } return false ; }
Source:
protected void setUp ( ) throws java.lang.Exception { repo = new org.eclipse.jgit.junit.TestRepository < org.eclipse.jgit.internal.storage.dfs.DfsRepository > ( new org.eclipse.jgit.internal.storage.dfs.InMemoryRepository ( new org.eclipse.jgit.internal.storage.dfs.DfsRepositoryDescription ( "test" ) ) ) ; servlet = new com.google.gitiles.RepositoryIndexServlet ( new com.google.gitiles.TestGitilesAccess ( repo.getRepository ( ) ) , new com.google.gitiles.DefaultRenderer ( ) , new com.google.gitiles.TimeCache ( ) ) ; }

Target:
protected void setUp ( ) throws java.lang.Exception { repo = new org.eclipse.jgit.junit.TestRepository < org.eclipse.jgit.internal.storage.dfs.DfsRepository > ( new org.eclipse.jgit.internal.storage.dfs.InMemoryRepository ( new org.eclipse.jgit.internal.storage.dfs.DfsRepositoryDescription ( "test" ) ) ) ; servlet = new com.google.gitiles.RepositoryIndexServlet ( new com.google.gitiles.TestGitilesAccess ( repo.getRepository ( ) ) , new com.google.gitiles.DefaultRenderer ( ) , new com.google.gitiles.DateFormatterBuilder ( ) , new com.google.gitiles.TimeCache ( ) ) ; }
Source:
private static void addFileToCommit ( java.lang.String newFile , org.eclipse.jgit.dircache.DirCacheEditor dce , org.eclipse.jgit.treewalk.TreeWalk tw ) { final org.eclipse.jgit.lib.FileMode mode = tw.getFileMode ( 0 ) ; final org.eclipse.jgit.lib.ObjectId oid = tw.getObjectId ( 0 ) ; dce.add ( new org.eclipse.jgit.dircache.DirCacheEditor.PathEdit ( newFile ) { @ java.lang.Override public void apply ( org.eclipse.jgit.dircache.DirCacheEntry ent ) { ent.setFileMode ( mode ) ; ent.setObjectId ( oid ) ; } } ) ; }

Target:
public org.eclipse.jgit.lib.RefUpdate.Result restoreFile ( com.google.gerrit.server.edit.ChangeEdit edit , java.lang.String file ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.server.project.InvalidChangeOperationException , java.io.IOException { org.eclipse.jgit.revwalk.RevCommit editCommit = edit.getEditCommit ( ) ; return modify ( edit , new com.google.gerrit.server.edit.tree.RestoreFileModification ( editCommit , file ) ) ; }
Source:
protected com.google.gerrit.server.account.AccountState missing ( final com.google.gerrit.reviewdb.Account.Id key ) { return missingAccount ( key ) ; }

Target:
public com.google.gerrit.server.account.AccountState createEntry ( final com.google.gerrit.reviewdb.Account.Id key ) throws java.lang.Exception { final com.google.gerrit.reviewdb.ReviewDb db = schema.open ( ) ; try { final com.google.gerrit.server.account.AccountState state = load ( db , key ) ; if ( ( state.getUserName ( ) ) != null ) { byName.put ( state.getUserName ( ) , state.getAccount ( ) . getId ( ) ) ; } return state ; } finally { db.close ( ) ; } }
Source:
private java.util.Map < java.lang.String , com.google.gerrit.reviewdb.client.PatchLineComment > patchSetDrafts ( com.google.gerrit.server.change.RevisionResource rsrc ) 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.draftByPatchSetAuthor ( db.get ( ) , rsrc.getPatchSet ( ) . getId ( ) , rsrc.getAccountId ( ) , rsrc.getNotes ( ) ) ) { drafts.put ( c.getKey ( ) . get ( ) , c ) ; } return drafts ; }

Target:
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 ; }
Source:
private void upsertPublishedComment ( com.google.gerrit.reviewdb.client.PatchLineComment c ) { verifyComment ( c ) ; if ( ( c.getSide ( ) ) == 0 ) { commentsForBase.add ( c ) ; } else { commentsForPs.add ( c ) ; } }

Target:
private void updatePublishedComment ( com.google.gerrit.reviewdb.client.PatchLineComment c ) throws com.google.gwtorm.server.OrmException { verifyComment ( c ) ; if ( ( notes ) == null ) { notes = getChangeNotes ( ) . load ( ) ; } if ( migration.readComments ( ) ) { com.google.common.base.Preconditions.checkArgument ( ( ! ( notes.containsCommentPublished ( c ) ) ) , "Cannot update a comment that has already been published and saved" ) ; } if ( ( c.getSide ( ) ) == 0 ) { commentsForBase.add ( c ) ; } else { commentsForPs.add ( c ) ; } }
Source:
public java.lang.String resourcePath ( ) { return java.lang.String.format ( "/projects/%s/+changes/%s" , getProjectControl ( ) . getProjectState ( ) . getName ( ) , changeData ( ) . getId ( ) . get ( ) ) ; }

Target:
public java.lang.String resourcePath ( ) { if ( ( resourcePath ) == null ) { resourcePath = java.lang.String.format ( "/projects/%s/+changes/%s" , getProjectControl ( ) . getProjectState ( ) . getName ( ) , changeData ( ) . getId ( ) . get ( ) ) ; } return resourcePath ; }
Source:
public int run ( ) throws java.lang.Exception { org.eclipse.jgit.storage.file.LockFile lf = new org.eclipse.jgit.storage.file.LockFile ( file.getAbsoluteFile ( ) , org.eclipse.jgit.util.FS.DETECTED ) ; if ( ! ( lf.lock ( ) ) ) { throw die ( ( "Cannot lock " + ( file ) ) ) ; } try { com.google.gwtorm.schema.java.JavaSchemaModel jsm = new com.google.gwtorm.schema.java.JavaSchemaModel ( com.google.gerrit.reviewdb.ReviewDb.class ) ; java.io.PrintWriter out = new java.io.PrintWriter ( new java.io.BufferedWriter ( new java.io.OutputStreamWriter ( lf.getOutputStream ( ) , "UTF-8" ) ) ) ; try { out.println ( ( ( "// Gerrit Code Review (version " + ( com.google.gerrit.common.Version.getVersion ( ) ) ) + ")" ) ) ; out.println ( ) ; jsm.generateProto ( out ) ; out.flush ( ) ; } finally { out.close ( ) ; } if ( ! ( lf.commit ( ) ) ) { throw die ( ( "Could not write to " + ( file ) ) ) ; } } finally { lf.unlock ( ) ; } return 0 ; }

Target:
public int run ( ) throws java.lang.Exception { org.eclipse.jgit.storage.file.LockFile lf = new org.eclipse.jgit.storage.file.LockFile ( file.getAbsoluteFile ( ) , org.eclipse.jgit.util.FS.DETECTED ) ; if ( ! ( lf.lock ( ) ) ) { throw die ( ( "Cannot lock " + ( file ) ) ) ; } try { com.google.gwtorm.schema.java.JavaSchemaModel jsm = new com.google.gwtorm.schema.java.JavaSchemaModel ( com.google.gerrit.reviewdb.ReviewDb.class ) ; java.io.PrintWriter out = new java.io.PrintWriter ( new java.io.BufferedWriter ( new java.io.OutputStreamWriter ( lf.getOutputStream ( ) , "UTF-8" ) ) ) ; try { out.println ( ( ( "// Gerrit Code Review (version " + ( com.google.gerrit.common.Version.getVersion ( ) ) ) + ")" ) ) ; out.println ( ) ; out.println ( "package gerritcodereview;\n" ) ; out.println ( ) ; jsm.generateProto ( out ) ; out.flush ( ) ; } finally { out.close ( ) ; } if ( ! ( lf.commit ( ) ) ) { throw die ( ( "Could not write to " + ( file ) ) ) ; } } finally { lf.unlock ( ) ; } return 0 ; }
Source:
public void display ( com.google.gerrit.common.data.PatchSetDetail detail ) { this . detail = detail ; this . patchList = detail.getPatches ( ) ; myTable = null ; final com.google.gerrit.client.changes.PatchTable.DisplayCommand cmd = new com.google.gerrit.client.changes.PatchTable.DisplayCommand ( patchList ) ; if ( cmd.execute ( ) ) { cmd.initMeter ( ) ; com.google.gwt.user.client.DeferredCommand.addCommand ( cmd ) ; } else { cmd.showTable ( ) ; } }

Target:
public void display ( com.google.gerrit.common.data.PatchSetDetail detail ) { this . detail = detail ; this . patchList = detail.getPatches ( ) ; myTable = null ; final com.google.gerrit.client.changes.PatchTable.DisplayCommand cmd = new com.google.gerrit.client.changes.PatchTable.DisplayCommand ( patchList , patchSetIdToCompareWith ) ; if ( cmd.execute ( ) ) { cmd.initMeter ( ) ; com.google.gwt.core.client.Scheduler.get ( ) . scheduleIncremental ( cmd ) ; } else { cmd.showTable ( ) ; } }
Source:
protected void assertSubmitter ( java.lang.String changeId , int psId ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.server.notedb.ChangeNotes cn = notesFactory.create ( com.google.common.collect.Iterables.getOnlyElement ( db.changes ( ) . byKey ( new com.google.gerrit.reviewdb.client.Change.Key ( changeId ) ) ) ) ; com.google.gerrit.reviewdb.client.PatchSetApproval submitter = approvalsUtil.getSubmitter ( db , cn , new com.google.gerrit.reviewdb.client.PatchSet.Id ( cn.getChangeId ( ) , psId ) ) ; org.junit.Assert.assertTrue ( submitter.isSubmit ( ) ) ; org.junit.Assert.assertEquals ( admin.getId ( ) , submitter.getAccountId ( ) ) ; }

Target:
protected void assertSubmitter ( java.lang.String changeId , int psId ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.server.notedb.ChangeNotes cn = notesFactory.create ( com.google.common.collect.Iterables.getOnlyElement ( queryProvider.get ( ) . byKeyPrefix ( changeId ) ) . change ( ) ) ; com.google.gerrit.reviewdb.client.PatchSetApproval submitter = approvalsUtil.getSubmitter ( db , cn , new com.google.gerrit.reviewdb.client.PatchSet.Id ( cn.getChangeId ( ) , psId ) ) ; com.google.common.truth.Truth.assertThat ( submitter.isSubmit ( ) ) . isTrue ( ) ; com.google.common.truth.Truth.assertThat ( submitter.getAccountId ( ) ) . isEqualTo ( admin.getId ( ) ) ; }
Source:
private GitilesView.Builder parseDiffCommand ( javax.servlet.http.HttpServletRequest req , java.lang.String repoName , java.lang.String path ) throws java.io.IOException { path = com.google.gitiles.ViewFilter.trimLeadingSlash ( path ) ; com.google.gitiles.RevisionParser.Result result = parseRevision ( req , path ) ; if ( result == null ) { return null ; } return parseDiffCommand ( repoName , result , path ) ; }

Target:
private GitilesView.Builder parseDiffCommand ( java.lang.String repoName , com.google.gitiles.RevisionParser.Result result ) { if ( result == null ) { return null ; } return com.google.gitiles.GitilesView.diff ( ) . setRepositoryName ( repoName ) . setRevision ( result.getRevision ( ) ) . setOldRevision ( result.getOldRevision ( ) ) . setPathPart ( result.getPath ( ) ) ; }
Source:
protected java.lang.String getNameFor ( final com.google.gerrit.reviewdb.Account.Id accountId ) { if ( accountId == null ) { return "Anonymous Coward" ; } final com.google.gerrit.reviewdb.Account userAccount = args.accountCache.get ( accountId ) . getAccount ( ) ; java.lang.String name = userAccount.getFullName ( ) ; if ( name == null ) { name = userAccount.getPreferredEmail ( ) ; } if ( name == null ) { name = "Anonymous Coward #" + accountId ; } return name ; }

Target:
protected java.lang.String getNameFor ( final com.google.gerrit.reviewdb.Account.Id accountId ) { if ( accountId == null ) { return anonymousCowardName ; } final com.google.gerrit.reviewdb.Account userAccount = args.accountCache.get ( accountId ) . getAccount ( ) ; java.lang.String name = userAccount.getFullName ( ) ; if ( name == null ) { name = userAccount.getPreferredEmail ( ) ; } if ( name == null ) { name = ( ( anonymousCowardName ) + " #" ) + accountId ; } return name ; }
Source:
public void onCellClicked ( com.google.gwt.user.client.ui.SourcesTableEvents sender , int row , int cell ) { if ( row > 0 ) { movePointerTo ( row ) ; } }

Target:
public void onClick ( final com.google.gwt.event.dom.client.ClickEvent event ) { final com.google.gwt.user.client.ui.HTMLTable.Cell cell = table.getCellForEvent ( event ) ; if ( ( cell != null ) && ( ( cell.getRowIndex ( ) ) > 0 ) ) { movePointerTo ( cell.getRowIndex ( ) ) ; } }