auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private static < T extends com.google.gwt.core.client.JavaScriptObject > T parseJson ( com.google.gwt.http.client.Response res ) throws com.google.gwt.json.client.JSONException { java.lang.String json = res.getText ( ) ; if ( json.startsWith ( com.google.gerrit.client.rpc.RestApi.JSON_MAGIC ) ) { json = json.substring ( com.google.gerrit.client.rpc.RestApi.JSON_MAGIC.length ( ) ) ; } if ( json.isEmpty ( ) ) { throw new com.google.gwt.json.client.JSONException ( "response was empty" ) ; } return com.google.gerrit.client.rpc.RestApi.cast ( com.google.gwt.json.client.JSONParser.parseStrict ( json ) ) ; }

Target:
private static com.google.gwt.json.client.JSONValue parseJson ( com.google.gwt.http.client.Response res ) throws com.google.gwt.json.client.JSONException { java.lang.String json = com.google.gerrit.client.rpc.RestApi.trimJsonMagic ( res.getText ( ) ) ; if ( json.isEmpty ( ) ) { throw new com.google.gwt.json.client.JSONException ( "response was empty" ) ; } return com.google.gwt.json.client.JSONParser.parseStrict ( json ) ; }
Source:
void loadRevisionInfo ( ) { com.google.gerrit.client.rpc.RestApi call = com.google.gerrit.client.changes.ChangeApi.actions ( changeId.get ( ) , revision ) ; call.background ( ) ; call.get ( new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.rpc.NativeMap < com.google.gerrit.client.actions.ActionInfo > > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.rpc.NativeMap < com.google.gerrit.client.actions.ActionInfo > actionMap ) { actionMap.copyKeysIntoChildren ( "id" ) ; renderRevisionInfo ( changeInfo , actionMap ) ; } } ) ; }

Target:
void loadRevisionInfo ( ) { com.google.gerrit.client.rpc.RestApi call = com.google.gerrit.client.changes.ChangeApi.actions ( changeId.get ( ) , revision ) ; call.background ( ) ; call.get ( new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.rpc.NativeMap < com.google.gerrit.client.info.ActionInfo > > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.rpc.NativeMap < com.google.gerrit.client.info.ActionInfo > actionMap ) { actionMap.copyKeysIntoChildren ( "id" ) ; renderRevisionInfo ( changeInfo , actionMap ) ; } } ) ; }
Source:
public void testIndexAndNonIndexPredicates ( ) throws java.lang.Exception { com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > in = parse ( "status:new bar:p file:a" ) ; 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.AndSource.class , out.getClass ( ) ) ; org.junit.Assert.assertEquals ( com.google.common.collect.ImmutableList.of ( query ( com.google.gerrit.server.query.Predicate.and ( in.getChild ( 0 ) , in.getChild ( 2 ) ) ) , in.getChild ( 1 ) ) , out.getChildren ( ) ) ; }

Target:
public void testIndexAndNonIndexPredicates ( ) throws java.lang.Exception { com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > in = parse ( "status:new bar:p file:a" ) ; com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > out = rewrite ( in ) ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.server.query.change.AndSource.class ) . isSameAs ( out.getClass ( ) ) ; com.google.common.truth.Truth.assertThat ( out.getChildren ( ) ) . containsExactly ( query ( com.google.gerrit.server.query.Predicate.and ( in.getChild ( 0 ) , in.getChild ( 2 ) ) ) , in.getChild ( 1 ) ) . inOrder ( ) ; }
Source:
public void setupLogging ( ) { captor = new org.easymock.Capture < org.apache.log4j.spi.LoggingEvent > ( ) ; appender = createMock ( org.apache.log4j.Appender.class ) ; appender.doAppend ( capture ( captor ) ) ; expectLastCall ( ) . anyTimes ( ) ; org.apache.log4j.Logger.getRootLogger ( ) . addAppender ( appender ) ; }

Target:
public void setupLogging ( ) { captor = org.easymock.EasyMock.EasyMock.newCapture ( ) ; appender = createMock ( org.apache.log4j.Appender.class ) ; appender.doAppend ( capture ( captor ) ) ; expectLastCall ( ) . anyTimes ( ) ; org.apache.log4j.Logger.getRootLogger ( ) . addAppender ( appender ) ; }
Source:
void play ( ) throws java.io.IOException { if ( ( status ) != 0 ) { com.google.gerrit.httpd.HttpServletResponseRecorder.log.debug ( "Replaying {}" , status , statusMsg ) ; if ( ( status ) == ( SC_MOVED_TEMPORARILY ) ) { super . sendRedirect ( getHeader ( "Location" ) ) ; } else { super . sendError ( status , statusMsg ) ; } } }

Target:
public void setHeader ( java.lang.String name , java.lang.String value ) { super . setHeader ( name , value ) ; headers.put ( name , value ) ; }
Source:
public void changeFields ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; com.google.gerrit.reviewdb.client.Change.Id id = r.getPatchSetId ( ) . getParentKey ( ) ; gApi.changes ( ) . id ( id.get ( ) ) . topic ( name ( "a-topic" ) ) ; checker.checkChanges ( id ) ; }

Target:
public void changeFields ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; com.google.gerrit.reviewdb.client.Change.Id id = r.getPatchSetId ( ) . getParentKey ( ) ; gApi.changes ( ) . id ( id.get ( ) ) . topic ( name ( "a-topic" ) ) ; checker.rebuildAndCheckChanges ( id ) ; }
Source:
protected void configure ( ) { bind ( com.googlesource.gerrit.plugins.replication.Destination.class ) . toInstance ( this ) ; bind ( org.eclipse.jgit.transport.RemoteConfig.class ) . toInstance ( remote ) ; install ( new com.google.inject.assistedinject.FactoryModuleBuilder ( ) . build ( PushOne.Factory.class ) ) ; }

Target:
protected void configure ( ) { bindScope ( com.google.inject.servlet.RequestScoped.class , PerThreadRequestScope.REQUEST ) ; bind ( PerThreadRequestScope.Propagator.class ) ; bind ( com.google.gerrit.server.project.PerRequestProjectControlCache.class ) . in ( com.google.inject.servlet.RequestScoped.class ) ; bind ( com.googlesource.gerrit.plugins.replication.Destination.class ) . toInstance ( this ) ; bind ( org.eclipse.jgit.transport.RemoteConfig.class ) . toInstance ( remote ) ; install ( new com.google.inject.assistedinject.FactoryModuleBuilder ( ) . build ( PushOne.Factory.class ) ) ; }
Source:
public void testOneIndexPredicate ( ) throws java.lang.Exception { com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > in = parse ( "foo:a file:b" ) ; 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.AndSource.class , out.getClass ( ) ) ; org.junit.Assert.assertEquals ( com.google.common.collect.ImmutableList.of ( query ( in.getChild ( 1 ) ) , in.getChild ( 0 ) ) , out.getChildren ( ) ) ; }

Target:
public void testOneIndexPredicate ( ) throws java.lang.Exception { com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > in = parse ( "foo:a file:b" ) ; com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > out = rewrite ( in ) ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.server.query.change.AndSource.class ) . isSameAs ( out.getClass ( ) ) ; com.google.common.truth.Truth.assertThat ( out.getChildren ( ) ) . containsExactly ( query ( in.getChild ( 1 ) ) , in.getChild ( 0 ) ) . inOrder ( ) ; }
Source:
void updateRenderEntireFile ( ) { cmA.removeKeyMap ( com.google.gerrit.client.diff.SideBySide.RENDER_ENTIRE_FILE_KEYMAP ) ; cmB.removeKeyMap ( com.google.gerrit.client.diff.SideBySide.RENDER_ENTIRE_FILE_KEYMAP ) ; if ( prefs.renderEntireFile ( ) ) { cmA.addKeyMap ( com.google.gerrit.client.diff.SideBySide.RENDER_ENTIRE_FILE_KEYMAP ) ; cmB.addKeyMap ( com.google.gerrit.client.diff.SideBySide.RENDER_ENTIRE_FILE_KEYMAP ) ; } cmA.setOption ( "viewportMargin" , ( prefs.renderEntireFile ( ) ? java.lang.Double.POSITIVE_INFINITY : 10 ) ) ; cmB.setOption ( "viewportMargin" , ( prefs.renderEntireFile ( ) ? java.lang.Double.POSITIVE_INFINITY : 10 ) ) ; }

Target:
void updateRenderEntireFile ( ) { cmA.removeKeyMap ( com.google.gerrit.client.diff.SideBySide.RENDER_ENTIRE_FILE_KEYMAP ) ; cmB.removeKeyMap ( com.google.gerrit.client.diff.SideBySide.RENDER_ENTIRE_FILE_KEYMAP ) ; boolean entireFile = renderEntireFile ( ) ; if ( entireFile ) { cmA.addKeyMap ( com.google.gerrit.client.diff.SideBySide.RENDER_ENTIRE_FILE_KEYMAP ) ; cmB.addKeyMap ( com.google.gerrit.client.diff.SideBySide.RENDER_ENTIRE_FILE_KEYMAP ) ; } cmA.setOption ( "viewportMargin" , ( entireFile ? java.lang.Double.POSITIVE_INFINITY : 10 ) ) ; cmB.setOption ( "viewportMargin" , ( entireFile ? java.lang.Double.POSITIVE_INFINITY : 10 ) ) ; }
Source:
private java.lang.String command ( com.google.gerrit.acceptance.PushOneCommit.Result r , java.lang.String abbreviated ) { java.lang.String c = ( ( ( ( ( "-f=zip " + ( "-9 " + "--prefix=" ) ) + abbreviated ) + "/ " ) + ( r.getCommit ( ) . name ( ) ) ) + " " ) + ( com.google.gerrit.acceptance.PushOneCommit.FILE_NAME ) ; return c ; }

Target:
private java.lang.String command ( com.google.gerrit.acceptance.PushOneCommit.Result r , java.lang.String format , java.lang.String abbreviated ) { java.lang.String c = java.lang.String.format ( "-f=%s --prefix=%s/ %s %s" , format , abbreviated , r.getCommit ( ) . name ( ) , PushOneCommit.FILE_NAME ) ; return c ; }
Source:
public void onValueChange ( final com.google.gwt.event.logical.shared.ValueChangeEvent < java.lang.String > event ) { final java.lang.String token = event.getValue ( ) ; com.google.gerrit.client.ui.Screen s ; try { s = select ( token ) ; } catch ( java.lang.RuntimeException err ) { com.google.gwt.core.client.GWT.log ( ( "Error parsing history token: " + token ) , err ) ; s = null ; } if ( s != null ) { com.google.gerrit.client.Gerrit.display ( s ) ; } else { com.google.gerrit.client.Gerrit.display ( new com.google.gerrit.client.NotFoundScreen ( ) ) ; } }

Target:
public void onValueChange ( final com.google.gwt.event.logical.shared.ValueChangeEvent < java.lang.String > event ) { final java.lang.String token = event.getValue ( ) ; try { com.google.gerrit.client.HistoryHandler.select ( token ) ; } catch ( java.lang.RuntimeException err ) { com.google.gwt.core.client.GWT.log ( ( "Error parsing history token: " + token ) , err ) ; com.google.gerrit.client.Gerrit.display ( new com.google.gerrit.client.NotFoundScreen ( ) ) ; } }
Source:
public void doFilter ( com.google.gerrit.server.events.ChangeMergedEvent hook ) throws java.io.IOException { java.lang.String comment = getComment ( hook ) ; addComment ( hook.change , comment ) ; }

Target:
public void doFilter ( com.google.gerrit.server.events.CommentAddedEvent hook ) throws java.io.IOException { if ( ! ( gerritConfig.getBoolean ( its.name ( ) , null , "commentOnCommentAdded" , true ) ) ) { return ; } java.lang.String comment = getComment ( hook ) ; addComment ( hook.change , comment ) ; }
Source:
public static synchronized void setClockStep ( long clockStep , java.util.concurrent.TimeUnit clockStepUnit ) { com.google.common.base.Preconditions.checkState ( ( ( com.google.gerrit.testutil.TestTimeUtil.clockMs ) != null ) , "call resetWithClockStep first" ) ; com.google.gerrit.testutil.TestTimeUtil.clockStepMs = java.util.concurrent.TimeUnit.MILLISECONDS.convert ( clockStep , clockStepUnit ) ; HEAD ( ( 6899000.0 - 2.14 ) ) ; org.joda.time.DateTimeUtils.setCurrentMillisProvider ( new org.joda.time.DateTimeUtils.MillisProvider ( ) { @ java.lang.Override public long getMillis ( ) { return com.google.gerrit.testutil.TestTimeUtil.clockMs.getAndAdd ( com.google.gerrit.testutil.TestTimeUtil.clockStepMs ) ; } } ) ; }

Target:
public java.lang.String getHostname ( ) { return defaultReader.getHostname ( ) ; }
Source:
private static void quote ( Type.Type type , org.commonmark.node.Text opener , org.commonmark.node.Text closer ) { com.google.gitiles.doc.SmartQuoted quote = new com.google.gitiles.doc.SmartQuoted ( ) ; quote.setType ( type ) ; for ( org.commonmark.node.Node t = opener.getNext ( ) ; ( t != null ) && ( t != closer ) ; ) { org.commonmark.node.Node next = t.getNext ( ) ; quote.appendChild ( t ) ; t = next ; } opener.insertAfter ( quote ) ; }

Target:
private static void quote ( com.google.gitiles.doc.SmartQuoted.Type type , org.commonmark.node.Text opener , org.commonmark.node.Text closer ) { com.google.gitiles.doc.SmartQuoted quote = new com.google.gitiles.doc.SmartQuoted ( ) ; quote.setType ( type ) ; for ( org.commonmark.node.Node t = opener.getNext ( ) ; ( t != null ) && ( t != closer ) ; ) { org.commonmark.node.Node next = t.getNext ( ) ; quote.appendChild ( t ) ; t = next ; } opener.insertAfter ( quote ) ; }
Source:
protected void onInitUI ( ) { super . onInitUI ( ) ; saveProject = new com.google.gwt.user.client.ui.Button ( Util.C.buttonSaveChanges ( ) ) ; saveProject.addClickHandler ( new com.google.gwt.event.dom.client.ClickHandler ( ) { @ java.lang.Override public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { doSave ( ) ; } } ) ; initDescription ( ) ; initProjectOptions ( ) ; initAgreements ( ) ; add ( saveProject ) ; }

Target:
protected void onInitUI ( ) { super . onInitUI ( ) ; saveProject = new com.google.gwt.user.client.ui.Button ( Util.C.buttonSaveChanges ( ) ) ; saveProject.addClickHandler ( new com.google.gwt.event.dom.client.ClickHandler ( ) { @ java.lang.Override public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { doSave ( ) ; } } ) ; add ( new com.google.gerrit.client.admin.ProjectInfoScreen.ProjectDownloadPanel ( projectName , true ) ) ; initDescription ( ) ; initProjectOptions ( ) ; initAgreements ( ) ; add ( saveProject ) ; }
Source:
private com.google.gerrit.reviewdb.client.PatchSet insertMissingPatchSet ( com.google.gerrit.reviewdb.client.Change c , java.lang.String id ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.PatchSet ps = com.google.gerrit.testutil.TestChanges.newPatchSet ( c.currentPatchSetId ( ) , org.eclipse.jgit.lib.ObjectId.fromString ( id ) , userId ) ; db.patchSets ( ) . insert ( java.util.Collections.singleton ( ps ) ) ; return ps ; }

Target:
private com.google.gerrit.reviewdb.client.PatchSet insertMissingPatchSet ( com.google.gerrit.reviewdb.client.Change c , java.lang.String id ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.PatchSet ps = com.google.gerrit.testutil.TestChanges.newPatchSet ( c.currentPatchSetId ( ) , org.eclipse.jgit.lib.ObjectId.fromString ( id ) , adminId ) ; db.patchSets ( ) . insert ( java.util.Collections.singleton ( ps ) ) ; return ps ; }
Source:
public void advertiseRefs ( org.eclipse.jgit.transport.BaseReceivePack rp ) throws org.eclipse.jgit.transport.ServiceMayNotContinueException { allRefs = rp.getAdvertisedRefs ( ) ; if ( ( allRefs ) == null ) { try { allRefs = rp.getRepository ( ) . getRefDatabase ( ) . getRefs ( RefDatabase.ALL ) ; } catch ( org.eclipse.jgit.transport.ServiceMayNotContinueException e ) { throw e ; } catch ( java.io.IOException e ) { org.eclipse.jgit.transport.ServiceMayNotContinueException ex = new org.eclipse.jgit.transport.ServiceMayNotContinueException ( ) ; ex.initCause ( e ) ; throw ex ; } } rp.setAdvertisedRefs ( allRefs , rp.getAdvertisedObjects ( ) ) ; }

Target:
public void advertiseRefs ( org.eclipse.jgit.transport.BaseReceivePack rp ) throws org.eclipse.jgit.transport.ServiceMayNotContinueException { allRefs = com.google.gerrit.server.git.receive.HookUtil.ensureAllRefsAdvertised ( rp ) ; }
Source:
public java.util.Collection < com.google.gerrit.reviewdb.client.PatchSetApproval > approvals ( com.google.inject.Provider < com.google.gerrit.reviewdb.server.ReviewDb > db ) throws com.google.gwtorm.server.OrmException { if ( ( approvals ) == null ) { approvals = db.get ( ) . patchSetApprovals ( ) . byChange ( legacyId ) . toList ( ) ; } return approvals ; }

Target:
public java.util.Collection < com.google.gerrit.reviewdb.client.PatchSetApproval > approvals ( com.google.inject.Provider < com.google.gerrit.reviewdb.server.ReviewDb > db ) throws com.google.gwtorm.server.OrmException { return approvalsMap ( db ) . values ( ) ; }
Source:
public void defineClass ( ) throws com.google.gwtorm.client.OrmException { defineRelationClasses ( ) ; init ( ) ; implementRelationFields ( ) ; implementConstructor ( ) ; implementSequenceMethods ( ) ; implementRelationMethods ( ) ; cw.visitEnd ( ) ; classLoader.defineClass ( getImplClassName ( ) , cw.toByteArray ( ) ) ; }

Target:
public java.lang.Class < com.google.gwtorm.client.Schema > create ( ) throws com.google.gwtorm.client.OrmException { defineRelationClasses ( ) ; init ( ) ; implementRelationFields ( ) ; implementConstructor ( ) ; implementSequenceMethods ( ) ; implementRelationMethods ( ) ; cw.visitEnd ( ) ; classLoader.defineClass ( getImplClassName ( ) , cw.toByteArray ( ) ) ; return loadClass ( ) ; }
Source:
public void start ( ) { new java.lang.Thread ( ( ( ( ( "Execute " + ( getName ( ) ) ) + " [" ) + ( session.getUsername ( ) ) ) + "]" ) ) { @ java.lang.Override public void run ( ) { runImp ( ) ; } } . start ( ) ; }

Target:
public void start ( ) { final java.lang.String who = ( ( session.getUsername ( ) ) + "," ) + ( getAccountId ( ) ) ; new java.lang.Thread ( ( ( ( ( "Execute " + ( getName ( ) ) ) + " [" ) + who ) + "]" ) ) { @ java.lang.Override public void run ( ) { runImp ( ) ; } } . start ( ) ; }
Source:
static void affixManifest ( com.google.gerrit.server.git.GitRepositoryManager gitRepoManager , com.amd.gerrit.plugins.manifestsubscription.manifest.Manifest manifest , com.google.common.collect.Table < java.lang.String , java.lang.String , java.lang.String > lookup ) { if ( lookup == null ) { lookup = com.google.common.collect.HashBasedTable.create ( ) ; } java.lang.String defaultRef = null ; if ( ( manifest.getDefault ( ) ) != null ) { defaultRef = manifest.getDefault ( ) . getRevision ( ) ; } com.amd.gerrit.plugins.manifestsubscription.VersionedManifests.affixManifest ( gitRepoManager , manifest.getProject ( ) , defaultRef , lookup ) ; }

Target:
public boolean apply ( com.google.gerrit.reviewdb.client.Project project , java.lang.String hash , java.lang.String name , com.google.gerrit.server.git.GitRepositoryManager gitRepoManager ) { project.setRevision ( hash ) ; project.setUpstream ( name ) ; return true ; }
Source:
void setValue ( com.google.gerrit.client.rpc.NativeMap < com.google.gerrit.client.diff.FileInfo > fileMap , java.sql.Timestamp myLastReply , @ com.google.gerrit.common.Nullable com.google.gerrit.client.rpc.NativeMap < com.google.gwt.core.client.JsArray < com.google.gerrit.client.changes.CommentInfo > > comments , @ com.google.gerrit.common.Nullable com.google.gerrit.client.rpc.NativeMap < com.google.gwt.core.client.JsArray < com.google.gerrit.client.changes.CommentInfo > > drafts ) { com.google.gwt.core.client.JsArray < com.google.gerrit.client.diff.FileInfo > list = fileMap.values ( ) ; com.google.gerrit.client.diff.FileInfo.sortFileInfoByPath ( list ) ; com.google.gerrit.client.change.FileTable.DisplayCommand cmd = new com.google.gerrit.client.change.FileTable.DisplayCommand ( fileMap , list , myLastReply , comments , drafts ) ; if ( cmd.execute ( ) ) { cmd.showProgressBar ( ) ; com.google.gwt.core.client.Scheduler.get ( ) . scheduleIncremental ( cmd ) ; } }

Target:
void setValue ( com.google.gerrit.client.rpc.NativeMap < com.google.gerrit.client.info.FileInfo > fileMap , java.sql.Timestamp myLastReply , @ com.google.gerrit.common.Nullable com.google.gerrit.client.rpc.NativeMap < com.google.gwt.core.client.JsArray < com.google.gerrit.client.changes.CommentInfo > > comments , @ com.google.gerrit.common.Nullable com.google.gerrit.client.rpc.NativeMap < com.google.gwt.core.client.JsArray < com.google.gerrit.client.changes.CommentInfo > > drafts ) { com.google.gwt.core.client.JsArray < com.google.gerrit.client.info.FileInfo > list = fileMap.values ( ) ; com.google.gerrit.client.info.FileInfo.sortFileInfoByPath ( list ) ; com.google.gerrit.client.change.FileTable.DisplayCommand cmd = new com.google.gerrit.client.change.FileTable.DisplayCommand ( fileMap , list , myLastReply , comments , drafts ) ; if ( cmd.execute ( ) ) { cmd.showProgressBar ( ) ; com.google.gwt.core.client.Scheduler.get ( ) . scheduleIncremental ( cmd ) ; } }
Source:
private void readObject ( java.io.ObjectInputStream in ) throws java.io.IOException { oldId = org.eclipse.jgit.lib.ObjectIdSerialization.readCanBeNull ( in ) ; int n = in.readInt ( ) ; parentNum = ( n == 0 ) ? null : java.lang.Integer.valueOf ( n ) ; newId = org.eclipse.jgit.lib.ObjectIdSerialization.readNotNull ( in ) ; char t = in.readChar ( ) ; whitespace = PatchListKey.WHITESPACE_TYPES.inverse ( ) . get ( t ) ; if ( ( whitespace ) == null ) { throw new java.io.IOException ( ( "Invalid whitespace type code: " + t ) ) ; } }

Target:
private void readObject ( java.io.ObjectInputStream in ) throws java.io.IOException { oldId = org.eclipse.jgit.lib.ObjectIdSerializer.read ( in ) ; int n = in.readInt ( ) ; parentNum = ( n == 0 ) ? null : java.lang.Integer.valueOf ( n ) ; newId = org.eclipse.jgit.lib.ObjectIdSerializer.readWithoutMarker ( in ) ; char t = in.readChar ( ) ; whitespace = PatchListKey.WHITESPACE_TYPES.inverse ( ) . get ( t ) ; if ( ( whitespace ) == null ) { throw new java.io.IOException ( ( "Invalid whitespace type code: " + t ) ) ; } }
Source:
private Account.Id toAccountId ( final java.lang.String nameOrEmail ) throws com.google.gwtorm.client.OrmException , javax.security.auth.login.AccountNotFoundException { final com.google.gerrit.client.reviewdb.Account a = accountResolver.find ( nameOrEmail ) ; if ( a == null ) { throw new javax.security.auth.login.AccountNotFoundException ( ( ( "\"" + nameOrEmail ) + "\" is not registered" ) ) ; } return a.getId ( ) ; }

Target:
private Account.Id toAccountId ( final java.lang.String nameOrEmail ) throws com.google.gerrit.client.rpc.NoSuchAccountException , com.google.gwtorm.client.OrmException { final com.google.gerrit.client.reviewdb.Account a = accountResolver.find ( nameOrEmail ) ; if ( a == null ) { throw new com.google.gerrit.client.rpc.NoSuchAccountException ( ( ( "\"" + nameOrEmail ) + "\" is not registered" ) ) ; } return a.getId ( ) ; }
Source:
public void onFailure ( final java.lang.Throwable caught ) { super . onFailure ( caught ) ; c.setStarred ( prior ) ; setStar ( row , c ) ; }

Target:
protected void onStarClick ( final int row ) { final com.google.gerrit.common.data.ChangeInfo c = getRowItem ( row ) ; if ( ( c != null ) && ( com.google.gerrit.client.Gerrit.isSignedIn ( ) ) ) { com.google.gerrit.client.changes.ChangeCache.get ( c.getId ( ) ) . getStarCache ( ) . toggleStar ( ) ; } }
Source:
private com.google.gerrit.reviewdb.client.Change newChange ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = com.google.gerrit.testutil.TestChanges.newChange ( project , changeOwner.getAccountId ( ) ) ; com.google.gerrit.server.notedb.ChangeUpdate u = newUpdate ( c , changeOwner ) ; u.setBranch ( c.getDest ( ) . get ( ) ) ; u.commit ( ) ; return c ; }

Target:
private com.google.gerrit.reviewdb.client.Change newChange ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = com.google.gerrit.testutil.TestChanges.newChange ( project , changeOwner.getAccountId ( ) ) ; com.google.gerrit.server.notedb.ChangeUpdate u = newUpdate ( c , changeOwner ) ; u.setSubject ( c.getSubject ( ) ) ; u.setBranch ( c.getDest ( ) . get ( ) ) ; u.commit ( ) ; return c ; }
Source:
public boolean isReviewer ( com.google.gerrit.reviewdb.ReviewDb db ) throws com.google.gwtorm.client.OrmException { if ( ( getCurrentUser ( ) ) instanceof com.google.gerrit.server.IdentifiedUser ) { final com.google.gerrit.server.IdentifiedUser user = ( ( com.google.gerrit.server.IdentifiedUser ) ( getCurrentUser ( ) ) ) ; com.google.gwtorm.client.ResultSet < com.google.gerrit.reviewdb.PatchSetApproval > results = db.patchSetApprovals ( ) . byChange ( change.getId ( ) ) ; for ( com.google.gerrit.reviewdb.PatchSetApproval approval : results ) { if ( user.getAccountId ( ) . equals ( approval.getAccountId ( ) ) ) { return true ; } } } return false ; }

Target:
public boolean isReviewer ( com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { if ( ( getCurrentUser ( ) ) instanceof com.google.gerrit.server.IdentifiedUser ) { final com.google.gerrit.server.IdentifiedUser user = ( ( com.google.gerrit.server.IdentifiedUser ) ( getCurrentUser ( ) ) ) ; com.google.gwtorm.server.ResultSet < com.google.gerrit.reviewdb.client.PatchSetApproval > results = db.patchSetApprovals ( ) . byChange ( change.getId ( ) ) ; for ( com.google.gerrit.reviewdb.client.PatchSetApproval approval : results ) { if ( user.getAccountId ( ) . equals ( approval.getAccountId ( ) ) ) { return true ; } } } return false ; }
Source:
private boolean isVisibleTo ( com.google.gerrit.reviewdb.client.Branch.NameKey branchName , com.google.gerrit.server.IdentifiedUser user ) { final com.google.gerrit.server.project.ProjectState pe = projectCache.get ( branchName.getParentKey ( ) ) ; if ( pe == null ) { return false ; } final com.google.gerrit.server.project.ProjectControl pc = pe.controlFor ( user ) ; return pc.controlForRef ( branchName ) . isVisible ( ) ; }

Target:
private boolean isVisibleTo ( com.google.gerrit.reviewdb.client.Branch.NameKey branchName , com.google.gerrit.server.CurrentUser user ) { final com.google.gerrit.server.project.ProjectState pe = projectCache.get ( branchName.getParentKey ( ) ) ; if ( pe == null ) { return false ; } final com.google.gerrit.server.project.ProjectControl pc = pe.controlFor ( user ) ; return pc.controlForRef ( branchName ) . isVisible ( ) ; }
Source:
private void addDiffChunk ( com.google.gerrit.client.diff.DisplaySide side , int chunkEnd , int chunkSize , int cmLine , boolean edit ) { chunks.add ( new com.google.gerrit.client.diff.UnifiedDiffChunkInfo ( side , ( ( chunkEnd - chunkSize ) + 1 ) , chunkEnd , cmLine , edit ) ) ; }

Target:
private void addDiffChunk ( com.google.gerrit.client.diff.DisplaySide side , int chunkEnd , int otherChunkEnd , int chunkSize , int cmLine , boolean edit ) { chunks.add ( new com.google.gerrit.client.diff.UnifiedDiffChunkInfo ( side , ( ( chunkEnd - chunkSize ) + 1 ) , ( ( otherChunkEnd - chunkSize ) + 1 ) , chunkEnd , cmLine , edit ) ) ; }
Source:
public void deleteVoteFromReviewableChangeNotifyOwnerWithSelfCc ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; selfCc ( ) ; deleteVote ( sc , voter , NotifyHandling.OWNER ) ; assertThat ( sender ) . sent ( "deleteVote" , sc ) . to ( sc.owner ) . cc ( voter ) . notTo ( sc.reviewer , sc.ccer ) . notTo ( sc.reviewerByEmail , sc.ccerByEmail ) . notTo ( sc.starrer ) . notTo ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; }

Target:
public void deleteVoteFromReviewableWipChange ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableWipChange ( ) ; deleteVote ( sc , voter ) ; assertThat ( sender ) . sent ( "deleteVote" , sc ) . to ( sc.owner ) . cc ( sc.reviewer , sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) . noOneElse ( ) ; }
Source:
private void checkUserSession ( javax.servlet.http.HttpServletRequest req ) throws com.google.gerrit.extensions.restapi.AuthException { com.google.gerrit.server.CurrentUser user = globals.currentUser.get ( ) ; if ( com.google.gerrit.httpd.restapi.RestApiServlet.isStateChange ( req ) ) { if ( user instanceof com.google.gerrit.server.AnonymousUser ) { throw new com.google.gerrit.extensions.restapi.AuthException ( "Authentication required" ) ; } else if ( ! ( globals.webSession.get ( ) . isAccessPathOk ( AccessPath.REST_API ) ) ) { throw new com.google.gerrit.extensions.restapi.AuthException ( "Invalid authentication method. In order to authenticate, prefix the REST endpoint URL with /a/ (e.g. http://example.com/a/projects/)." ) ; } } user.setAccessPath ( AccessPath.REST_API ) ; }

Target:
private void checkUserSession ( javax.servlet.http.HttpServletRequest req ) throws com.google.gerrit.extensions.restapi.AuthException { com.google.gerrit.server.CurrentUser user = globals.currentUser.get ( ) ; if ( com.google.gerrit.httpd.restapi.RestApiServlet.isStateChange ( req ) ) { if ( user instanceof com.google.gerrit.server.AnonymousUser ) { throw new com.google.gerrit.extensions.restapi.AuthException ( "Authentication required" ) ; } else if ( ! ( globals.webSession.get ( ) . isAccessPathOk ( AccessPath.REST_API ) ) ) { throw new com.google.gerrit.extensions.restapi.AuthException ( ( "Invalid authentication method. In order to authenticate, " + "prefix the REST endpoint URL with /a/ (e.g. http://example.com/a/projects/)." ) ) ; } } user.setAccessPath ( AccessPath.REST_API ) ; }
Source:
public void testlinkifyMessageChangeId ( ) throws java.lang.Exception { com.google.gitiles.Linkifier l = new com.google.gitiles.Linkifier ( TestGitilesUrls.URLS ) ; assertEquals ( com.google.common.collect.ImmutableList.of ( com.google.common.collect.ImmutableMap.of ( "text" , "I0123456789" , "url" , "http://test-host-review/foo/#/q/I0123456789,n,z" ) ) , l.linkify ( com.google.gitiles.LinkifierTest.REQ , "I0123456789" ) ) ; assertEquals ( com.google.common.collect.ImmutableList.of ( com.google.common.collect.ImmutableMap.of ( "text" , "Change-Id: " ) , com.google.common.collect.ImmutableMap.of ( "text" , "I0123456789" , "url" , "http://test-host-review/foo/#/q/I0123456789,n,z" ) ) , l.linkify ( com.google.gitiles.LinkifierTest.REQ , "Change-Id: I0123456789" ) ) ; assertEquals ( com.google.common.collect.ImmutableList.of ( com.google.common.collect.ImmutableMap.of ( "text" , "Change-Id: " ) , com.google.common.collect.ImmutableMap.of ( "text" , "I0123456789" , "url" , "http://test-host-review/foo/#/q/I0123456789,n,z" ) , com.google.common.collect.ImmutableMap.of ( "text" , " exists" ) ) , l.linkify ( com.google.gitiles.LinkifierTest.REQ , "Change-Id: I0123456789 exists" ) ) ; }

Target:
public void linkifyMessageChangeId ( ) throws java.lang.Exception { com.google.gitiles.Linkifier l = new com.google.gitiles.Linkifier ( TestGitilesUrls.URLS ) ; org.junit.Assert.assertEquals ( com.google.common.collect.ImmutableList.of ( com.google.common.collect.ImmutableMap.of ( "text" , "I0123456789" , "url" , "http://test-host-review/foo/#/q/I0123456789,n,z" ) ) , l.linkify ( com.google.gitiles.LinkifierTest.REQ , "I0123456789" ) ) ; org.junit.Assert.assertEquals ( com.google.common.collect.ImmutableList.of ( com.google.common.collect.ImmutableMap.of ( "text" , "Change-Id: " ) , com.google.common.collect.ImmutableMap.of ( "text" , "I0123456789" , "url" , "http://test-host-review/foo/#/q/I0123456789,n,z" ) ) , l.linkify ( com.google.gitiles.LinkifierTest.REQ , "Change-Id: I0123456789" ) ) ; org.junit.Assert.assertEquals ( com.google.common.collect.ImmutableList.of ( com.google.common.collect.ImmutableMap.of ( "text" , "Change-Id: " ) , com.google.common.collect.ImmutableMap.of ( "text" , "I0123456789" , "url" , "http://test-host-review/foo/#/q/I0123456789,n,z" ) , com.google.common.collect.ImmutableMap.of ( "text" , " exists" ) ) , l.linkify ( com.google.gitiles.LinkifierTest.REQ , "Change-Id: I0123456789 exists" ) ) ; }
Source:
private static java.lang.String guessName ( com.google.gerrit.client.changes.ChangeList list ) { for ( com.google.gerrit.client.changes.ChangeInfo change : com.google.gerrit.client.rpc.Natives.asList ( list ) ) { if ( ( ( change.owner ( ) ) != null ) && ( ( change.owner ( ) . name ( ) ) != null ) ) { return change.owner ( ) . name ( ) ; } } return null ; }

Target:
private static java.lang.String guessName ( com.google.gerrit.client.changes.ChangeList list ) { for ( com.google.gerrit.client.info.ChangeInfo change : com.google.gerrit.client.rpc.Natives.asList ( list ) ) { if ( ( ( change.owner ( ) ) != null ) && ( ( change.owner ( ) . name ( ) ) != null ) ) { return change.owner ( ) . name ( ) ; } } return null ; }
Source:
public void newCommitIsNotCreatedWhenCommittingGroupCreationTwice ( ) throws java.lang.Exception { com.google.gerrit.server.group.db.GroupNameNotes groupNameNotes = com.google.gerrit.server.group.db.GroupNameNotes.loadForNewGroup ( repo , groupUuid , groupName ) ; commit ( groupNameNotes ) ; com.google.common.collect.ImmutableList < com.google.gerrit.extensions.common.CommitInfo > commitsAfterFirstCommit = log ( ) ; commit ( groupNameNotes ) ; com.google.common.collect.ImmutableList < com.google.gerrit.extensions.common.CommitInfo > commitsAfterSecondCommit = log ( ) ; com.google.gerrit.server.group.db.GroupNameNotesTest.assertThatCommits ( commitsAfterSecondCommit ) . isEqualTo ( commitsAfterFirstCommit ) ; }

Target:
public void newCommitIsNotCreatedWhenCommittingGroupCreationTwice ( ) throws java.lang.Exception { com.google.gerrit.server.group.db.GroupNameNotes groupNameNotes = com.google.gerrit.server.group.db.GroupNameNotes.forNewGroup ( repo , groupUuid , groupName ) ; commit ( groupNameNotes ) ; com.google.common.collect.ImmutableList < com.google.gerrit.extensions.common.CommitInfo > commitsAfterFirstCommit = log ( ) ; commit ( groupNameNotes ) ; com.google.common.collect.ImmutableList < com.google.gerrit.extensions.common.CommitInfo > commitsAfterSecondCommit = log ( ) ; com.google.gerrit.server.group.db.GroupNameNotesTest.assertThatCommits ( commitsAfterSecondCommit ) . isEqualTo ( commitsAfterFirstCommit ) ; }
Source:
protected PushOneCommit.Result createChange ( org.eclipse.jgit.api.Git git , java.lang.String subject , java.lang.String fileName , java.lang.String content ) throws java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { com.google.gerrit.acceptance.git.PushOneCommit push = new com.google.gerrit.acceptance.git.PushOneCommit ( db , admin.getIdent ( ) , subject , fileName , content ) ; return push.to ( git , "refs/for/master" ) ; }

Target:
protected PushOneCommit.Result createChange ( org.eclipse.jgit.api.Git git , java.lang.String subject , java.lang.String fileName , java.lang.String content ) throws java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , admin.getIdent ( ) , subject , fileName , content ) ; return push.to ( git , "refs/for/master" ) ; }
Source:
public void versionNumber ( ) { com.google.common.truth.TruthJUnit.assume ( ) . that ( com.google.gerrit.testutil.IndexVersionsTest.SCHEMA_DEF.getPrevious ( ) ) . isNotNull ( ) ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.testutil.IndexVersionsTest.get ( java.lang.Integer.toString ( com.google.gerrit.testutil.IndexVersionsTest.SCHEMA_DEF.getPrevious ( ) . getVersion ( ) ) ) ) . containsExactly ( com.google.gerrit.testutil.IndexVersionsTest.SCHEMA_DEF.getPrevious ( ) . getVersion ( ) ) ; }

Target:
public void versionNumber ( ) { com.google.common.truth.TruthJUnit.assume ( ) . that ( com.google.gerrit.testing.IndexVersionsTest.SCHEMA_DEF.getPrevious ( ) ) . isNotNull ( ) ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.testing.IndexVersionsTest.get ( java.lang.Integer.toString ( com.google.gerrit.testing.IndexVersionsTest.SCHEMA_DEF.getPrevious ( ) . getVersion ( ) ) ) ) . containsExactly ( com.google.gerrit.testing.IndexVersionsTest.SCHEMA_DEF.getPrevious ( ) . getVersion ( ) ) ; }
Source:
public org.eclipse.jgit.lib.ObjectLoader open ( org.eclipse.jgit.lib.AnyObjectId objectId , int typeHint ) throws java.io.IOException { com.google.gerrit.server.notedb.InsertedObject obj = inserted.get ( objectId ) ; if ( obj == null ) { return reader.open ( objectId , typeHint ) ; } if ( ( typeHint != ( OBJ_ANY ) ) && ( ( obj.type ( ) ) != typeHint ) ) { throw new org.eclipse.jgit.errors.IncorrectObjectTypeException ( objectId.copy ( ) , typeHint ) ; } return obj.newLoader ( ) ; }

Target:
public org.eclipse.jgit.lib.ObjectLoader open ( org.eclipse.jgit.lib.AnyObjectId objectId , int typeHint ) throws java.io.IOException { com.google.gerrit.server.git.InsertedObject obj = inserted.get ( objectId ) ; if ( obj == null ) { return reader.open ( objectId , typeHint ) ; } if ( ( typeHint != ( OBJ_ANY ) ) && ( ( obj.type ( ) ) != typeHint ) ) { throw new org.eclipse.jgit.errors.IncorrectObjectTypeException ( objectId.copy ( ) , typeHint ) ; } return obj.newLoader ( ) ; }
Source:
public java.lang.String apply ( com.google.gerrit.server.change.ChangeResource rsrc ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.server.project.InvalidChangeOperationException , com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException , java.io.IOException { com.google.common.base.Optional < com.google.gerrit.server.edit.ChangeEdit > edit = editUtil.byChange ( rsrc.getChange ( ) ) ; java.lang.String m = ( edit.isPresent ( ) ) ? edit.get ( ) . getEditCommit ( ) . getFullMessage ( ) : changeUtil.getMessage ( rsrc.getChange ( ) ) ; return org.eclipse.jgit.util.Base64.encodeBytes ( m.getBytes ( java.nio.charset.StandardCharsets.UTF_8 ) ) ; }

Target:
public com.google.gerrit.extensions.restapi.BinaryResult apply ( com.google.gerrit.server.change.ChangeResource rsrc ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException , java.io.IOException { com.google.common.base.Optional < com.google.gerrit.server.edit.ChangeEdit > edit = editUtil.byChange ( rsrc.getChange ( ) ) ; java.lang.String m = ( edit.isPresent ( ) ) ? edit.get ( ) . getEditCommit ( ) . getFullMessage ( ) : changeUtil.getMessage ( rsrc.getChange ( ) ) ; return com.google.gerrit.extensions.restapi.BinaryResult.create ( m ) . base64 ( ) ; }
Source:
public void listBranchesOfEmptyProject ( ) throws java.lang.Exception { com.google.gerrit.acceptance.RestResponse r = adminSession.get ( ( ( "/projects/" + ( project ) ) + "/branches" ) ) ; java.util.List < com.google.gerrit.server.project.ListBranches.BranchInfo > expected = com.google.common.collect.Lists.asList ( new com.google.gerrit.server.project.ListBranches.BranchInfo ( "refs/meta/config" , null , false ) , new com.google.gerrit.server.project.ListBranches.BranchInfo [ ] { new com.google.gerrit.server.project.ListBranches.BranchInfo ( "HEAD" , null , false ) } ) ; com.google.gerrit.acceptance.rest.project.BranchAssert.assertBranches ( expected , com.google.gerrit.acceptance.rest.project.ListBranchesIT.toBranchInfoList ( r ) ) ; }

Target:
public void listBranchesOfEmptyProject ( ) throws java.lang.Exception { com.google.gerrit.acceptance.rest.project.BranchAssert.assertBranches ( com.google.common.collect.ImmutableList.of ( com.google.gerrit.acceptance.rest.project.ListBranchesIT.branch ( "HEAD" , null , false ) , com.google.gerrit.acceptance.rest.project.ListBranchesIT.branch ( "refs/meta/config" , null , false ) ) , list ( ) . get ( ) ) ; }
Source:
public com.google.gerrit.server.query.Predicate < com.google.gerrit.server.account.AccountState > rewrite ( com.google.gerrit.server.query.Predicate < com.google.gerrit.server.account.AccountState > in , com.google.gerrit.server.index.QueryOptions opts ) throws com.google.gerrit.server.query.QueryParseException { com.google.gerrit.server.index.account.AccountIndex index = indexes.getSearchIndex ( ) ; com.google.common.base.Preconditions.checkNotNull ( index , "no active search index configured for accounts" ) ; return new com.google.gerrit.server.index.account.IndexedAccountQuery ( index , in , opts ) ; }

Target:
public com.google.gerrit.server.query.Predicate < com.google.gerrit.server.account.AccountState > rewrite ( com.google.gerrit.server.query.Predicate < com.google.gerrit.server.account.AccountState > in , com.google.gerrit.server.index.QueryOptions opts ) throws com.google.gerrit.server.query.QueryParseException { if ( ! ( com.google.gerrit.server.query.account.AccountPredicates.hasActive ( in ) ) ) { in = com.google.gerrit.server.query.Predicate.and ( in , com.google.gerrit.server.query.account.AccountPredicates.isActive ( ) ) ; } com.google.gerrit.server.index.account.AccountIndex index = indexes.getSearchIndex ( ) ; com.google.common.base.Preconditions.checkNotNull ( index , "no active search index configured for accounts" ) ; return new com.google.gerrit.server.index.account.IndexedAccountQuery ( index , in , opts ) ; }
Source:
public com.google.gerrit.server.notedb.NoteDbUpdateManager.Result rebuild ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Change.Id changeId ) throws com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException , java.io.IOException { if ( failNextUpdate.getAndSet ( false ) ) { throw new java.io.IOException ( "Update failed" ) ; } com.google.gerrit.server.notedb.NoteDbUpdateManager.Result result = delegate.rebuild ( db , changeId ) ; if ( stealNextUpdate.getAndSet ( false ) ) { throw new java.io.IOException ( "Update stolen" ) ; } return result ; }

Target:
private com.google.gerrit.server.notedb.NoteDbUpdateManager.Result rebuild ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Change.Id changeId , boolean checkReadOnly ) throws com.google.gwtorm.server.OrmException , java.io.IOException { if ( failNextUpdate.getAndSet ( false ) ) { throw new java.io.IOException ( "Update failed" ) ; } com.google.gerrit.server.notedb.NoteDbUpdateManager.Result result = ( checkReadOnly ) ? delegate.rebuild ( db , changeId ) : delegate.rebuildEvenIfReadOnly ( db , changeId ) ; if ( stealNextUpdate.getAndSet ( false ) ) { throw new java.io.IOException ( "Update stolen" ) ; } return result ; }
Source:
private java.util.Collection < org.eclipse.jgit.lib.ObjectId > existingObjects ( ) { if ( ( existingObjects ) == null ) { java.util.Map < java.lang.String , org.eclipse.jgit.lib.Ref > refs = repo.getAllRefs ( ) ; existingObjects = new java.util.ArrayList < org.eclipse.jgit.lib.ObjectId > ( refs.size ( ) ) ; for ( org.eclipse.jgit.lib.Ref r : refs.values ( ) ) { existingObjects.add ( r.getObjectId ( ) ) ; } } return existingObjects ; }

Target:
private java.util.Collection < org.eclipse.jgit.lib.ObjectId > existingObjects ( ) { if ( ( existingObjects ) == null ) { existingObjects = new java.util.ArrayList < org.eclipse.jgit.lib.ObjectId > ( allRefs.size ( ) ) ; for ( org.eclipse.jgit.lib.Ref r : allRefs.values ( ) ) { existingObjects.add ( r.getObjectId ( ) ) ; } } return existingObjects ; }
Source:
public void onSuccess ( java.lang.Void result ) { if ( prefs.syntaxHighlighting ( ) ) { cmA.setOption ( "mode" , getContentType ( diff.meta_a ( ) ) ) ; cmB.setOption ( "mode" , getContentType ( diff.meta_b ( ) ) ) ; } }

Target:
public void run ( ) { renderSkips ( context ) ; }
Source:
protected java.util.List < org.eclipse.jgit.revwalk.RevCommit > getRemoteLog ( ) throws java.io.IOException { try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( project ) ; org.eclipse.jgit.revwalk.RevWalk rw = new org.eclipse.jgit.revwalk.RevWalk ( repo ) ) { rw.markStart ( rw.parseCommit ( repo.getRef ( "refs/heads/master" ) . getObjectId ( ) ) ) ; return com.google.common.collect.Lists.newArrayList ( rw ) ; } }

Target:
protected java.util.List < org.eclipse.jgit.revwalk.RevCommit > getRemoteLog ( com.google.gerrit.reviewdb.client.Project.NameKey project , java.lang.String branch ) throws java.io.IOException { try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( project ) ; org.eclipse.jgit.revwalk.RevWalk rw = new org.eclipse.jgit.revwalk.RevWalk ( repo ) ) { rw.markStart ( rw.parseCommit ( repo.getRef ( ( "refs/heads/" + branch ) ) . getObjectId ( ) ) ) ; return com.google.common.collect.Lists.newArrayList ( rw ) ; } }
Source:
private com.google.gerrit.reviewdb.client.Account findAccount ( java.lang.String nameOrEmail ) throws com.google.gwtorm.server.OrmException { try { return accounts.get ( ) . parse ( nameOrEmail ) . getAccount ( ) ; } catch ( com.google.gerrit.extensions.restapi.AuthException e ) { return null ; } catch ( com.google.gerrit.extensions.restapi.ResourceNotFoundException e ) { switch ( authType ) { case HTTP_LDAP : case CLIENT_SSL_CERT_LDAP : case LDAP : if ( ( accountResolver.find ( nameOrEmail ) ) == null ) { return createAccountByLdap ( nameOrEmail ) ; } break ; default : } return null ; } }

Target:
private com.google.gerrit.reviewdb.client.Account findAccount ( java.lang.String nameOrEmail ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.UnprocessableEntityException , com.google.gwtorm.server.OrmException { try { return accounts.get ( ) . parse ( nameOrEmail ) . getAccount ( ) ; } catch ( com.google.gerrit.extensions.restapi.UnprocessableEntityException e ) { switch ( authType ) { case HTTP_LDAP : case CLIENT_SSL_CERT_LDAP : case LDAP : if ( ( accountResolver.find ( nameOrEmail ) ) == null ) { return createAccountByLdap ( nameOrEmail ) ; } break ; default : } throw e ; } }
Source:
private void set ( com.google.gerrit.reviewdb.client.AccountGroup d ) { description = com.google.common.base.Strings.emptyToNull ( d.getDescription ( ) ) ; groupId = d.getId ( ) . get ( ) ; ownerId = ( ( d.getOwnerGroupUUID ( ) ) != null ) ? com.google.gerrit.server.util.Url.encode ( d.getOwnerGroupUUID ( ) . get ( ) ) : null ; }

Target:
private void set ( com.google.gerrit.reviewdb.client.AccountGroup d ) { description = com.google.common.base.Strings.emptyToNull ( d.getDescription ( ) ) ; groupId = d.getId ( ) . get ( ) ; ownerId = ( ( d.getOwnerGroupUUID ( ) ) != null ) ? com.google.gerrit.extensions.restapi.Url.encode ( d.getOwnerGroupUUID ( ) . get ( ) ) : null ; }
Source:
static void configureHttpProxy ( ) throws java.net.MalformedURLException { final java.lang.String s = java.lang.System.getenv ( "http_proxy" ) ; if ( ( s == null ) || ( s.equals ( "" ) ) ) { return ; } final java.net.URL u = new java.net.URL ( ( ! ( s.contains ( "://" ) ) ? "http://" + s : s ) ) ; if ( ! ( "http" . equals ( u.getProtocol ( ) ) ) ) { throw new java.net.MalformedURLException ( ( ( "Invalid http_proxy: " + s ) + ": Only http supported." ) ) ; } final java.lang.String proxyHost = u.getHost ( ) ; final int proxyPort = u.getPort ( ) ; java.lang.System.setProperty ( "http.proxyHost" , proxyHost ) ; if ( proxyPort > 0 ) { java.lang.System.setProperty ( "http.proxyPort" , java.lang.String.valueOf ( proxyPort ) ) ; } final java.lang.String userpass = u.getUserInfo ( ) ; if ( ( userpass != null ) && ( userpass.contains ( ":" ) ) ) { final int c = userpass.indexOf ( ':' ) ; final java.lang.String user = userpass.substring ( 0 , c ) ; final java.lang.String pass = userpass.substring ( ( c + 1 ) ) ; org.eclipse.jgit.util.CachedAuthenticator.add ( new org.eclipse.jgit.util.CachedAuthenticator.CachedAuthentication ( proxyHost , proxyPort , user , pass ) ) ; } }

Target:
static void configureHttpProxy ( ) throws java.net.MalformedURLException { final java.lang.String s = java.lang.System.getenv ( "http_proxy" ) ; if ( com.google.common.base.Strings.isNullOrEmpty ( s ) ) { return ; } final java.net.URL u = new java.net.URL ( ( ! ( s.contains ( "://" ) ) ? "http://" + s : s ) ) ; if ( ! ( "http" . equals ( u.getProtocol ( ) ) ) ) { throw new java.net.MalformedURLException ( ( ( "Invalid http_proxy: " + s ) + ": Only http supported." ) ) ; } final java.lang.String proxyHost = u.getHost ( ) ; final int proxyPort = u.getPort ( ) ; java.lang.System.setProperty ( "http.proxyHost" , proxyHost ) ; if ( proxyPort > 0 ) { java.lang.System.setProperty ( "http.proxyPort" , java.lang.String.valueOf ( proxyPort ) ) ; } final java.lang.String userpass = u.getUserInfo ( ) ; if ( ( userpass != null ) && ( userpass.contains ( ":" ) ) ) { final int c = userpass.indexOf ( ':' ) ; final java.lang.String user = userpass.substring ( 0 , c ) ; final java.lang.String pass = userpass.substring ( ( c + 1 ) ) ; org.eclipse.jgit.util.CachedAuthenticator.add ( new org.eclipse.jgit.util.CachedAuthenticator.CachedAuthentication ( proxyHost , proxyPort , user , pass ) ) ; } }