auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
void onRefReplicatedToOneNode ( java.lang.String project , java.lang.String ref , org.eclipse.jgit.transport.URIish uri , com.googlesource.gerrit.plugins.replication.ReplicationState.RefPushResult status , org.eclipse.jgit.transport.RemoteRefUpdate.Status refStatus ) { com.googlesource.gerrit.plugins.replication.RefReplicatedEvent event = new com.googlesource.gerrit.plugins.replication.RefReplicatedEvent ( project , ref , com.googlesource.gerrit.plugins.replication.PushResultProcessing.resolveNodeName ( uri ) , status , refStatus ) ; postEvent ( project , event ) ; }

Target:
void onRefReplicatedToOneNode ( java.lang.String project , java.lang.String ref , org.eclipse.jgit.transport.URIish uri , com.googlesource.gerrit.plugins.replication.ReplicationState.RefPushResult status , org.eclipse.jgit.transport.RemoteRefUpdate.Status refStatus ) { com.googlesource.gerrit.plugins.replication.RefReplicatedEvent event = new com.googlesource.gerrit.plugins.replication.RefReplicatedEvent ( project , ref , com.googlesource.gerrit.plugins.replication.PushResultProcessing.resolveNodeName ( uri ) , status , refStatus ) ; postEvent ( project , ref , event ) ; }
Source:
public void evaluate ( ) throws java.lang.Throwable { boolean mem = ( description.getAnnotation ( com.google.gerrit.acceptance.UseLocalDisk.class ) ) == null ; boolean enableHttpd = ( ( description.getAnnotation ( com.google.gerrit.acceptance.NoHttpd.class ) ) == null ) && ( ( description.getTestClass ( ) . getAnnotation ( com.google.gerrit.acceptance.NoHttpd.class ) ) == null ) ; beforeTest ( config ( description ) , mem , enableHttpd ) ; base.evaluate ( ) ; afterTest ( ) ; }

Target:
public void evaluate ( ) throws java.lang.Throwable { boolean mem = ( description.getAnnotation ( com.google.gerrit.acceptance.UseLocalDisk.class ) ) == null ; boolean enableHttpd = ( ( description.getAnnotation ( com.google.gerrit.acceptance.NoHttpd.class ) ) == null ) && ( ( description.getTestClass ( ) . getAnnotation ( com.google.gerrit.acceptance.NoHttpd.class ) ) == null ) ; beforeTest ( description , mem , enableHttpd ) ; base.evaluate ( ) ; afterTest ( ) ; }
Source:
public void testStyleName ( ) { final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder b = new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) ; assertSame ( b , b.openSpan ( ) ) ; assertSame ( b , b.setStyleName ( "foo" ) ) ; assertSame ( b , b.addStyleName ( "bar" ) ) ; assertSame ( b , b.append ( "d<a>ta" ) ) ; assertSame ( b , b.closeSpan ( ) ) ; assertEquals ( "<span class=\"foo bar\">d&lt;a&gt;ta</span>" , b.asString ( ) ) ; }

Target:
public void testStyleName ( ) { final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder b = new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) ; org.junit.Assert.assertSame ( b , b.openSpan ( ) ) ; org.junit.Assert.assertSame ( b , b.setStyleName ( "foo" ) ) ; org.junit.Assert.assertSame ( b , b.addStyleName ( "bar" ) ) ; org.junit.Assert.assertSame ( b , b.append ( "d<a>ta" ) ) ; org.junit.Assert.assertSame ( b , b.closeSpan ( ) ) ; org.junit.Assert.assertEquals ( "<span class=\"foo bar\">d&lt;a&gt;ta</span>" , b.asString ( ) ) ; }
Source:
private void runImpl ( ) throws java.io.IOException { org.eclipse.jgit.transport.Transport tn = org.eclipse.jgit.transport.Transport.open ( git , uri ) ; org.eclipse.jgit.transport.PushResult res ; try { res = pushVia ( tn ) ; } finally { try { tn.close ( ) ; } catch ( java.lang.Throwable e2 ) { com.googlesource.gerrit.plugins.replication.ReplicationQueue.repLog.warn ( ( "Unexpected error while closing " + ( uri ) ) , e2 ) ; } } updateStates ( res.getRemoteUpdates ( ) ) ; }

Target:
private void runImpl ( ) throws java.io.IOException { org.eclipse.jgit.transport.PushResult res ; try ( org.eclipse.jgit.transport.Transport tn = org.eclipse.jgit.transport.Transport.open ( git , uri ) ) { res = pushVia ( tn ) ; } updateStates ( res.getRemoteUpdates ( ) ) ; }
Source:
public java.util.Map < java.lang.String , com.google.gerrit.extensions.common.FileInfo > files ( ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return ( ( java.util.Map < java.lang.String , com.google.gerrit.extensions.common.FileInfo > ) ( listFiles.get ( ) . apply ( revision ) . value ( ) ) ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot retrieve files" , e ) ; } }

Target:
public java.util.Map < java.lang.String , com.google.gerrit.extensions.common.FileInfo > files ( ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return ( ( java.util.Map < java.lang.String , com.google.gerrit.extensions.common.FileInfo > ) ( listFiles.get ( ) . apply ( revision ) . value ( ) ) ) ; } catch ( com.google.gwtorm.server.OrmException | java.io.IOException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot retrieve files" , e ) ; } }
Source:
private com.google.gerrit.server.project.ProjectControl user ( com.google.gerrit.server.git.ProjectConfig local , java.lang.String name , com.google.gerrit.reviewdb.client.AccountGroup ... memberOf ) { return new com.google.gerrit.server.project.ProjectControl ( java.util.Collections.< com.google.gerrit.reviewdb.client.AccountGroup.UUID > emptySet ( ) , java.util.Collections.< com.google.gerrit.reviewdb.client.AccountGroup.UUID > emptySet ( ) , sectionSorter , null , changeControlFactory , permissionBackend , new com.google.gerrit.server.project.RefControlTest.MockUser ( name , memberOf ) , newProjectState ( local ) ) ; }

Target:
private com.google.gerrit.server.project.ProjectControl user ( com.google.gerrit.server.git.ProjectConfig local , java.lang.String name , com.google.gerrit.reviewdb.client.AccountGroup ... memberOf ) { return new com.google.gerrit.server.project.ProjectControl ( java.util.Collections.< com.google.gerrit.reviewdb.client.AccountGroup.UUID > emptySet ( ) , java.util.Collections.< com.google.gerrit.reviewdb.client.AccountGroup.UUID > emptySet ( ) , sectionSorter , changeControlFactory , permissionBackend , new com.google.gerrit.server.project.RefControlTest.MockUser ( name , memberOf ) , newProjectState ( local ) ) ; }
Source:
public void testCreateChildProject ( ) throws java.lang.Exception { final java.lang.String parentName = "parent" ; com.google.gerrit.acceptance.RestResponse r = adminSession.put ( ( "/projects/" + parentName ) ) ; r.consume ( ) ; final java.lang.String childName = "child" ; com.google.gerrit.extensions.api.projects.ProjectInput in = new com.google.gerrit.extensions.api.projects.ProjectInput ( ) ; in.parent = parentName ; r = adminSession.put ( ( "/projects/" + childName ) , in ) ; com.google.gerrit.reviewdb.client.Project project = projectCache.get ( new com.google.gerrit.reviewdb.client.Project.NameKey ( childName ) ) . getProject ( ) ; org.junit.Assert.assertEquals ( in.parent , project.getParentName ( ) ) ; }

Target:
public void testCreateChildProject ( ) throws java.lang.Exception { final java.lang.String parentName = "parent" ; com.google.gerrit.acceptance.RestResponse r = adminSession.put ( ( "/projects/" + parentName ) ) ; r.consume ( ) ; final java.lang.String childName = "child" ; com.google.gerrit.extensions.api.projects.ProjectInput in = new com.google.gerrit.extensions.api.projects.ProjectInput ( ) ; in.parent = parentName ; r = adminSession.put ( ( "/projects/" + childName ) , in ) ; com.google.gerrit.reviewdb.client.Project project = projectCache.get ( new com.google.gerrit.reviewdb.client.Project.NameKey ( childName ) ) . getProject ( ) ; com.google.common.truth.Truth.assertThat ( project.getParentName ( ) ) . isEqualTo ( in.parent ) ; }
Source:
private static boolean isUnifiedPatchLink ( final com.google.gerrit.reviewdb.client.Patch patch , final com.google.gerrit.client.patches.PatchScreen.Type screenType ) { if ( com.google.gerrit.client.Dispatcher.isChangeScreen2 ( ) ) { return ( patch.getPatchType ( ) . equals ( PatchType.BINARY ) ) || ( com.google.gerrit.client.Gerrit.getUserAccount ( ) . getGeneralPreferences ( ) . getDiffView ( ) . equals ( DiffView.UNIFIED_DIFF ) ) ; } return screenType == ( PatchScreen.Type.UNIFIED ) ; }

Target:
private static boolean isUnifiedPatchLink ( final com.google.gerrit.reviewdb.client.Patch patch ) { return ( patch.getPatchType ( ) . equals ( PatchType.BINARY ) ) || ( com.google.gerrit.client.Gerrit.getUserAccount ( ) . getGeneralPreferences ( ) . getDiffView ( ) . equals ( DiffView.UNIFIED_DIFF ) ) ; }
Source:
public void testFileExtension_Constant ( ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.server.query.change.RegexFilePredicate p = com.google.gerrit.server.query.change.RegexFilePredicateTest.predicate ( "^.*\\.res" ) ; assertTrue ( p.match ( com.google.gerrit.server.query.change.RegexFilePredicateTest.change ( "test.res" ) ) ) ; assertTrue ( p.match ( com.google.gerrit.server.query.change.RegexFilePredicateTest.change ( "foo/bar/test.res" ) ) ) ; assertFalse ( p.match ( com.google.gerrit.server.query.change.RegexFilePredicateTest.change ( "test.res.bar" ) ) ) ; }

Target:
public void testFileExtension_Constant ( ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.server.query.change.RegexFilePredicate p = com.google.gerrit.server.query.change.RegexFilePredicateTest.predicate ( "^.*\\.res" ) ; org.junit.Assert.assertTrue ( p.match ( com.google.gerrit.server.query.change.RegexFilePredicateTest.change ( "test.res" ) ) ) ; org.junit.Assert.assertTrue ( p.match ( com.google.gerrit.server.query.change.RegexFilePredicateTest.change ( "foo/bar/test.res" ) ) ) ; org.junit.Assert.assertFalse ( p.match ( com.google.gerrit.server.query.change.RegexFilePredicateTest.change ( "test.res.bar" ) ) ) ; }
Source:
public com.google.gitiles.doc.html.HtmlBuilder close ( java.lang.String tag ) { com.google.common.base.Preconditions.checkArgument ( ( ( com.google.gitiles.doc.html.HtmlBuilder.ALLOWED_TAGS.contains ( tag ) ) && ( ! ( com.google.gitiles.doc.html.HtmlBuilder.SELF_CLOSING_TAGS.equals ( tag ) ) ) ) , "invalid HTML tag %s" , tag ) ; finishActiveTag ( ) ; htmlBuf.append ( "</" ) . append ( tag ) . append ( '>' ) ; return this ; }

Target:
public com.google.gitiles.doc.html.HtmlBuilder close ( java.lang.String tag ) { com.google.common.base.Preconditions.checkArgument ( ( ( com.google.gitiles.doc.html.HtmlBuilder.ALLOWED_TAGS.contains ( tag ) ) && ( ! ( com.google.gitiles.doc.html.HtmlBuilder.SELF_CLOSING_TAGS.contains ( tag ) ) ) ) , "invalid HTML tag %s" , tag ) ; finishActiveTag ( ) ; htmlBuf.append ( "</" ) . append ( tag ) . append ( '>' ) ; return this ; }
Source:
public void run ( ) { int line = ( cm.extras ( ) . hasActiveLine ( ) ) ? cm.getLineNumber ( cm.extras ( ) . activeLine ( ) ) : 0 ; int res = java.util.Collections.binarySearch ( chunks , new com.google.gerrit.client.diff.DiffChunkInfo ( cm.side ( ) , line , 0 , false ) , getDiffChunkComparator ( ) ) ; diffChunkNavHelper ( chunks , host , res , dir ) ; }

Target:
public void run ( ) { int line = ( cm.extras ( ) . hasActiveLine ( ) ) ? cm.getLineNumber ( cm.extras ( ) . activeLine ( ) ) : 0 ; int res = java.util.Collections.binarySearch ( chunks , new com.google.gerrit.client.diff.DiffChunkInfo ( cm.side ( ) , line , 0 , 0 , false ) ) ; diffChunkNavHelper ( chunks , host , res , dir ) ; }
Source:
private < T > com.google.gerrit.client.rpc.CallbackGroup.Callback < T > handleAdd ( com.google.gwt.user.client.rpc.AsyncCallback < T > cb ) { if ( failed ) { cb.onFailure ( failedThrowable ) ; return com.google.gerrit.client.rpc.CallbackGroup.emptyCallback ( ) ; } com.google.gerrit.client.rpc.CallbackGroup.CallbackImpl < T > wrapper = new com.google.gerrit.client.rpc.CallbackGroup.CallbackImpl < T > ( cb ) ; callbacks.add ( wrapper ) ; remaining.add ( wrapper ) ; return wrapper ; }

Target:
private < T > com.google.gerrit.client.rpc.CallbackGroup.Callback < T > handleAdd ( com.google.gwt.user.client.rpc.AsyncCallback < T > cb ) { if ( failed ) { cb.onFailure ( failedThrowable ) ; return com.google.gerrit.client.rpc.CallbackGroup.emptyCallback ( ) ; } com.google.gerrit.client.rpc.CallbackGroup.CallbackImpl < T > wrapper = new com.google.gerrit.client.rpc.CallbackGroup.CallbackImpl ( cb ) ; callbacks.add ( wrapper ) ; remaining.add ( wrapper ) ; return wrapper ; }
Source:
public com.google.gerrit.server.project.ChangeControl validateFor ( com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.server.CurrentUser user ) throws com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException { com.google.gerrit.server.project.ChangeControl c = controlFor ( change , user ) ; if ( ! ( c.isVisible ( db.get ( ) ) ) ) { throw new com.google.gerrit.server.project.NoSuchChangeException ( c.getChange ( ) . getId ( ) ) ; } return c ; }

Target:
public com.google.gerrit.server.project.ChangeControl validateFor ( com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.server.CurrentUser user ) throws com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException { com.google.gerrit.server.project.ChangeControl c = controlFor ( change , user ) ; if ( ! ( c.isVisible ( db.get ( ) ) ) ) { throw new com.google.gerrit.server.project.NoSuchChangeException ( c.getId ( ) ) ; } return c ; }
Source:
public com.google.gerrit.client.ui.InlineHyperlink getPreviousPatchLink ( int index , com.google.gerrit.client.patches.PatchScreen.Type patchType ) { int previousPatchIndex = getPreviousPatch ( index , PREFERENCE_VALIDATOR ) ; if ( previousPatchIndex < 0 ) { return null ; } com.google.gerrit.client.ui.InlineHyperlink link = createLink ( previousPatchIndex , patchType , com.google.gwtexpui.safehtml.client.SafeHtml.asis ( Util.C.prevPatchLinkIcon ( ) ) , null ) ; return link ; }

Target:
public com.google.gerrit.client.ui.InlineHyperlink getPreviousPatchLink ( int index , com.google.gerrit.client.patches.PatchScreen.Type patchType ) { int previousPatchIndex = getPreviousPatch ( index , PREFERENCE_VALIDATOR ) ; if ( previousPatchIndex < 0 ) { return null ; } return createLink ( previousPatchIndex , patchType , com.google.gwtexpui.safehtml.client.SafeHtml.asis ( Util.C.prevPatchLinkIcon ( ) ) , null ) ; }
Source:
public void uploadPackSubsetOfBranchesVisibleIncludingHead ( ) throws java.lang.Exception { allow ( Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/master" ) ; deny ( Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/branch" ) ; setApiUser ( user ) ; assertUploadPackRefs ( "HEAD" , ( ( r1 ) + "1" ) , ( ( r1 ) + "meta" ) , ( ( r3 ) + "1" ) , ( ( r3 ) + "meta" ) , "refs/heads/master" , "refs/tags/master-tag" ) ; }

Target:
public void uploadPackSubsetOfBranchesVisibleIncludingHead ( ) throws java.lang.Exception { allow ( Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/master" ) ; deny ( "refs/heads/branch" , Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS ) ; setApiUser ( user ) ; assertUploadPackRefs ( "HEAD" , ( ( r1 ) + "1" ) , ( ( r1 ) + "meta" ) , ( ( r3 ) + "1" ) , ( ( r3 ) + "meta" ) , "refs/heads/master" , "refs/tags/master-tag" ) ; }
Source:
void setHeaderVisible ( boolean show ) { headerVisible = show ; com.google.gerrit.client.Gerrit.setHeaderVisible ( ( show && ( ! ( parent.getPrefs ( ) . hideTopMenu ( ) ) ) ) ) ; com.google.gwt.user.client.ui.UIObject.setVisible ( patchSetNavRow , show ) ; if ( show ) { parent.header.removeStyleName ( com.google.gerrit.client.diff.DiffTable.style.fullscreen ( ) ) ; } else { parent.header.addStyleName ( com.google.gerrit.client.diff.DiffTable.style.fullscreen ( ) ) ; } parent.resizeCodeMirror ( ) ; }

Target:
void setHeaderVisible ( boolean show ) { headerVisible = show ; com.google.gwt.user.client.ui.UIObject.setVisible ( patchSetNavRow , show ) ; if ( show ) { parent.header.removeStyleName ( com.google.gerrit.client.diff.DiffTable.style.fullscreen ( ) ) ; } else { parent.header.addStyleName ( com.google.gerrit.client.diff.DiffTable.style.fullscreen ( ) ) ; } parent.resizeCodeMirror ( ) ; }
Source:
private java.util.Set < java.lang.Integer > removableReviewers ( com.google.gerrit.client.changes.ChangeInfo change ) { java.util.Set < java.lang.Integer > result = new java.util.HashSet < java.lang.Integer > ( change.removable_reviewers ( ) . length ( ) ) ; for ( int i = 0 ; i < ( change.removable_reviewers ( ) . length ( ) ) ; i ++ ) { result.add ( change.removable_reviewers ( ) . get ( i ) . _account_id ( ) ) ; } return result ; }

Target:
private java.util.Set < java.lang.Integer > removableReviewers ( com.google.gerrit.client.changes.ChangeInfo change ) { java.util.Set < java.lang.Integer > result = new java.util.HashSet ( change.removable_reviewers ( ) . length ( ) ) ; for ( int i = 0 ; i < ( change.removable_reviewers ( ) . length ( ) ) ; i ++ ) { result.add ( change.removable_reviewers ( ) . get ( i ) . _account_id ( ) ) ; } return result ; }
Source:
private java.lang.String getLatestRemoteDiff ( ) throws java.io.IOException { org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( project ) ; try { org.eclipse.jgit.revwalk.RevWalk rw = new org.eclipse.jgit.revwalk.RevWalk ( repo ) ; try { org.eclipse.jgit.lib.ObjectId oldTreeId = repo.resolve ( "refs/heads/master~1^{tree}" ) ; org.eclipse.jgit.lib.ObjectId newTreeId = repo.resolve ( "refs/heads/master^{tree}" ) ; return getLatestDiff ( repo , oldTreeId , newTreeId ) ; } finally { rw.release ( ) ; } } finally { repo.close ( ) ; } }

Target:
private java.lang.String getLatestRemoteDiff ( ) 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 ) ) { org.eclipse.jgit.lib.ObjectId oldTreeId = repo.resolve ( "refs/heads/master~1^{tree}" ) ; org.eclipse.jgit.lib.ObjectId newTreeId = repo.resolve ( "refs/heads/master^{tree}" ) ; return getLatestDiff ( repo , oldTreeId , newTreeId ) ; } }
Source:
void addChange ( java.lang.String token ) { try { changeArgumentParser.addChange ( token , changes , projectState ) ; } catch ( com.google.gerrit.sshd.commands.UnloggedFailure e ) { throw new java.lang.IllegalArgumentException ( e.getMessage ( ) , e ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new java.lang.IllegalArgumentException ( "database is down" , e ) ; } catch ( com.google.gerrit.server.permissions.PermissionBackendException e ) { throw new java.lang.IllegalArgumentException ( "can't check permissions" , e ) ; } }

Target:
void addChange ( java.lang.String token ) { try { changeArgumentParser.addChange ( token , changes , projectState ) ; } catch ( java.io.IOException | com.google.gerrit.sshd.commands.UnloggedFailure e ) { throw new java.lang.IllegalArgumentException ( e.getMessage ( ) , e ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new java.lang.IllegalArgumentException ( "database is down" , e ) ; } catch ( com.google.gerrit.server.permissions.PermissionBackendException e ) { throw new java.lang.IllegalArgumentException ( "can't check permissions" , e ) ; } }
Source:
protected void bccStarredBy ( ) { try { for ( com.google.gerrit.reviewdb.StarredChange w : args.db.get ( ) . starredChanges ( ) . byChange ( change.getId ( ) ) ) { add ( RecipientType.BCC , w.getAccountId ( ) ) ; } } catch ( com.google.gwtorm.client.OrmException err ) { } }

Target:
protected void bccStarredBy ( ) { try { for ( com.google.gerrit.reviewdb.StarredChange w : args.db.get ( ) . starredChanges ( ) . byChange ( change.getId ( ) ) ) { super . add ( RecipientType.BCC , w.getAccountId ( ) ) ; } } catch ( com.google.gwtorm.client.OrmException err ) { } }
Source:
public void onLoad ( ) { super . onLoad ( ) ; Util.ACCOUNT_SVC.myProjectWatch ( new com.google.gerrit.client.rpc.GerritCallback < java.util.List < com.google.gerrit.client.account.AccountProjectWatchInfo > > ( ) { public void onSuccess ( final java.util.List < com.google.gerrit.client.account.AccountProjectWatchInfo > result ) { watches.display ( result ) ; } } ) ; }

Target:
protected void onLoad ( ) { super . onLoad ( ) ; Util.ACCOUNT_SVC.myProjectWatch ( new com.google.gerrit.client.rpc.GerritCallback < java.util.List < com.google.gerrit.client.account.AccountProjectWatchInfo > > ( ) { public void onSuccess ( final java.util.List < com.google.gerrit.client.account.AccountProjectWatchInfo > result ) { watches.display ( result ) ; } } ) ; }
Source:
private GitilesView.Builder parseAutoCommand ( javax.servlet.http.HttpServletRequest req , java.lang.String repoName , java.lang.String path ) throws java.io.IOException { if ( path.isEmpty ( ) ) { return null ; } path = com.google.gitiles.ViewFilter.trimLeadingSlash ( path ) ; com.google.gitiles.RevisionParser.Result result = parseRevision ( req , path ) ; if ( result == null ) { return null ; } if ( ( result.getOldRevision ( ) ) != null ) { return parseDiffCommand ( repoName , result , path ) ; } else { return parseShowCommand ( repoName , result , path ) ; } }

Target:
private GitilesView.Builder parseAutoCommand ( javax.servlet.http.HttpServletRequest req , java.lang.String repoName , java.lang.String path ) throws java.io.IOException { if ( path.isEmpty ( ) ) { return null ; } com.google.gitiles.RevisionParser.Result result = parseRevision ( req , path ) ; if ( result == null ) { return null ; } if ( ( result.getOldRevision ( ) ) != null ) { return parseDiffCommand ( repoName , result ) ; } else { return parseShowCommand ( repoName , result ) ; } }
Source:
public void commentOnReviewableChangeByReviewer ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; review ( sc.reviewer , sc.changeId , com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy.ENABLED ) ; assertThat ( sender ) . sent ( "comment" , sc ) . notTo ( sc.reviewer ) . to ( sc.owner ) . to ( sc.reviewerByEmail ) . cc ( sc.ccer ) . cc ( sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; }

Target:
public void commentOnReviewableChangeByReviewer ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; review ( sc.reviewer , sc.changeId , com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy.ENABLED ) ; assertThat ( sender ) . sent ( "comment" , sc ) . notTo ( sc.reviewer ) . to ( sc.owner ) . cc ( sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; }
Source:
public java.util.Map < java.lang.String , com.google.gerrit.extensions.common.FileInfo > files ( ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return ( ( java.util.Map < java.lang.String , com.google.gerrit.extensions.common.FileInfo > ) ( listFiles.get ( ) . apply ( revision ) . value ( ) ) ) ; } catch ( com.google.gwtorm.server.OrmException | java.io.IOException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot retrieve files" , e ) ; } }

Target:
public java.util.Map < java.lang.String , com.google.gerrit.extensions.common.FileInfo > files ( ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return ( ( java.util.Map < java.lang.String , com.google.gerrit.extensions.common.FileInfo > ) ( listFiles.apply ( revision ) . value ( ) ) ) ; } catch ( com.google.gwtorm.server.OrmException | java.io.IOException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot retrieve files" , e ) ; } }
Source:
public void index ( com.google.gerrit.reviewdb.client.AccountGroup.UUID uuid ) throws java.io.IOException { for ( com.google.gerrit.index.Index < com.google.gerrit.reviewdb.client.AccountGroup.UUID , com.google.gerrit.server.group.InternalGroup > i : getWriteIndexes ( ) ) { groupCache.evict ( uuid ) ; java.util.Optional < com.google.gerrit.server.group.InternalGroup > internalGroup = groupCache.get ( uuid ) ; if ( internalGroup.isPresent ( ) ) { i.replace ( internalGroup.get ( ) ) ; } else { i.delete ( uuid ) ; } } fireGroupIndexedEvent ( uuid.get ( ) ) ; com.google.gerrit.server.index.group.GroupIndexerImpl.autoReindexIfStale ( uuid ) ; }

Target:
public void index ( com.google.gerrit.reviewdb.client.AccountGroup.UUID uuid ) throws java.io.IOException { for ( com.google.gerrit.index.Index < com.google.gerrit.reviewdb.client.AccountGroup.UUID , com.google.gerrit.server.group.InternalGroup > i : getWriteIndexes ( ) ) { groupCache.evict ( uuid ) ; java.util.Optional < com.google.gerrit.server.group.InternalGroup > internalGroup = groupCache.get ( uuid ) ; if ( internalGroup.isPresent ( ) ) { i.replace ( internalGroup.get ( ) ) ; } else { i.delete ( uuid ) ; } } fireGroupIndexedEvent ( uuid.get ( ) ) ; }
Source:
public void testReplaceEmpty ( ) { com.google.gwtexpui.safehtml.client.SafeHtml o = com.google.gwtexpui.safehtml.client.SafeHtml_ReplaceTest.html ( "A\nissue42\nB" ) ; assertSame ( o , o.replaceAll ( null ) ) ; assertSame ( o , o.replaceAll ( java.util.Collections.< com.google.gwtexpui.safehtml.client.FindReplace > emptyList ( ) ) ) ; }

Target:
public void testReplaceEmpty ( ) { com.google.gwtexpui.safehtml.client.SafeHtml o = com.google.gwtexpui.safehtml.client.SafeHtml_ReplaceTest.html ( "A\nissue42\nB" ) ; org.junit.Assert.assertSame ( o , o.replaceAll ( null ) ) ; org.junit.Assert.assertSame ( o , o.replaceAll ( java.util.Collections.< com.google.gwtexpui.safehtml.client.FindReplace > emptyList ( ) ) ) ; }
Source:
private java.util.List < java.lang.String > cacheNames ( ) throws com.google.gerrit.sshd.commands.UnloggedFailure { try { return ( ( java.util.List < java.lang.String > ) ( listCaches.get ( ) . setFormat ( OutputFormat.LIST ) . apply ( new com.google.gerrit.server.config.ConfigResource ( ) ) ) ) ; } catch ( com.google.gerrit.extensions.restapi.BadRequestException e ) { throw die ( e.getMessage ( ) ) ; } }

Target:
private java.util.List < java.lang.String > cacheNames ( ) { return ( ( java.util.List < java.lang.String > ) ( listCaches.get ( ) . setFormat ( OutputFormat.LIST ) . apply ( new com.google.gerrit.server.config.ConfigResource ( ) ) ) ) ; }
Source:
private boolean isOwnerOfProjectOrBranch ( com.google.gerrit.reviewdb.client.Account.Id user ) { return ( ( ( projectState ) != null ) && ( ( change ) != null ) ) && ( projectState.controlFor ( args.identifiedUserFactory.create ( user ) ) . controlForRef ( change.getDest ( ) ) . isOwner ( ) ) ; }

Target:
private boolean isOwnerOfProjectOrBranch ( com.google.gerrit.reviewdb.client.Account.Id user ) { return ( ( projectState ) != null ) && ( projectState.controlFor ( args.identifiedUserFactory.create ( user ) ) . controlForRef ( change.getDest ( ) ) . isOwner ( ) ) ; }
Source:
private java.util.Map < java.lang.String , com.google.gerrit.reviewdb.client.PatchLineComment > scanDraftComments ( 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 : db.patchComments ( ) . draftByPatchSetAuthor ( rsrc.getPatchSet ( ) . getId ( ) , rsrc.getAccountId ( ) ) ) { drafts.put ( c.getKey ( ) . get ( ) , c ) ; } return drafts ; }

Target:
private java.util.Map < java.lang.String , com.google.gerrit.reviewdb.client.PatchLineComment > scanDraftComments ( 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 : db.get ( ) . patchComments ( ) . draftByPatchSetAuthor ( rsrc.getPatchSet ( ) . getId ( ) , rsrc.getAccountId ( ) ) ) { drafts.put ( c.getKey ( ) . get ( ) , c ) ; } return drafts ; }
Source:
private void sendCreateChange ( com.google.gerrit.server.git.BatchUpdate.Context ctx ) throws com.google.gerrit.common.errors.EmailException { com.google.gerrit.server.mail.CreateChangeSender cm = createChangeSenderFactory.create ( ctx.getProject ( ) , change.getId ( ) ) ; cm.setFrom ( ctx.getUser ( ) . getAccountId ( ) ) ; cm.setPatchSet ( patchSet , patchSetInfo ) ; cm.addReviewers ( recipients.getReviewers ( ) ) ; cm.addExtraCC ( recipients.getCcOnly ( ) ) ; cm.send ( ) ; }

Target:
private void sendCreateChange ( com.google.gerrit.server.git.BatchUpdate.Context ctx ) throws com.google.gerrit.common.errors.EmailException { com.google.gerrit.server.mail.CreateChangeSender cm = createChangeSenderFactory.create ( ctx.getProject ( ) , change.getId ( ) ) ; cm.setFrom ( ctx.getAccountId ( ) ) ; cm.setPatchSet ( patchSet , patchSetInfo ) ; cm.addReviewers ( recipients.getReviewers ( ) ) ; cm.addExtraCC ( recipients.getCcOnly ( ) ) ; cm.send ( ) ; }
Source:
public void login ( final com.google.gerrit.server.account.AuthResult res , final boolean rememberMe ) { final com.google.gerrit.reviewdb.client.Account.Id id = res.getAccountId ( ) ; final com.google.gerrit.reviewdb.client.AccountExternalId.Key identity = res.getExternalId ( ) ; if ( ( val ) != null ) { manager.destroy ( key ) ; } key = manager.createKey ( id ) ; val = manager.createVal ( key , id , rememberMe , identity , null ) ; saveCookie ( ) ; }

Target:
public void login ( final com.google.gerrit.server.account.AuthResult res , final boolean rememberMe ) { final com.google.gerrit.reviewdb.client.Account.Id id = res.getAccountId ( ) ; final com.google.gerrit.reviewdb.client.AccountExternalId.Key identity = res.getExternalId ( ) ; if ( ( val ) != null ) { manager.destroy ( key ) ; } key = manager.createKey ( id ) ; val = manager.createVal ( key , id , rememberMe , identity , null , null ) ; saveCookie ( ) ; }
Source:
public void submitWithCherryPickIfFastForwardPossible ( ) throws java.lang.Exception { org.eclipse.jgit.api.Git git = createProject ( ) ; com.google.gerrit.acceptance.PushOneCommit.Result change = createChange ( git ) ; submit ( change.getChangeId ( ) ) ; assertCherryPick ( git , false ) ; org.junit.Assert.assertEquals ( change.getCommit ( ) . getParent ( 0 ) , getRemoteHead ( ) . getParent ( 0 ) ) ; }

Target:
public void submitWithCherryPickIfFastForwardPossible ( ) throws java.lang.Exception { org.eclipse.jgit.api.Git git = createProject ( ) ; com.google.gerrit.acceptance.PushOneCommit.Result change = createChange ( git ) ; submit ( change.getChangeId ( ) ) ; assertCherryPick ( git , false ) ; com.google.common.truth.Truth.assertThat ( getRemoteHead ( ) . getParent ( 0 ) ) . isEqualTo ( change.getCommit ( ) . getParent ( 0 ) ) ; }
Source:
private void loadCommit ( final com.google.gerrit.client.info.ChangeInfo.RevisionInfo rev , com.google.gerrit.client.rpc.CallbackGroup group ) { if ( rev.isEdit ( ) ) { return ; } com.google.gerrit.client.changes.ChangeApi.commitWithLinks ( changeId.get ( ) , rev.name ( ) , group.add ( new com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.info.ChangeInfo.CommitInfo > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.info.ChangeInfo.CommitInfo info ) { rev.setCommit ( info ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { } } ) ) ; }

Target:
private void loadCommit ( final com.google.gerrit.client.info.ChangeInfo.RevisionInfo rev , com.google.gerrit.client.rpc.CallbackGroup group ) { if ( ( rev.isEdit ( ) ) || ( ( rev.commit ( ) ) != null ) ) { return ; } com.google.gerrit.client.changes.ChangeApi.commitWithLinks ( changeId.get ( ) , rev.name ( ) , group.add ( new com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.info.ChangeInfo.CommitInfo > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.info.ChangeInfo.CommitInfo info ) { rev.setCommit ( info ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { } } ) ) ; }
Source:
private static javax.xml.parsers.DocumentBuilder newBuilder ( ) throws javax.xml.parsers.ParserConfigurationException { final javax.xml.parsers.DocumentBuilderFactory factory = javax.xml.parsers.DocumentBuilderFactory.newInstance ( ) ; factory.setValidating ( false ) ; factory.setExpandEntityReferences ( false ) ; factory.setIgnoringComments ( true ) ; factory.setCoalescing ( true ) ; final javax.xml.parsers.DocumentBuilder parser = factory.newDocumentBuilder ( ) ; return parser ; }

Target:
private static javax.xml.parsers.DocumentBuilder newBuilder ( ) throws javax.xml.parsers.ParserConfigurationException { final javax.xml.parsers.DocumentBuilderFactory factory = javax.xml.parsers.DocumentBuilderFactory.newInstance ( ) ; factory.setValidating ( false ) ; factory.setExpandEntityReferences ( false ) ; factory.setIgnoringComments ( true ) ; factory.setCoalescing ( true ) ; return factory.newDocumentBuilder ( ) ; }
Source:
public static void setAssignee ( int id , java.lang.String user , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.info.AccountInfo > cb ) { com.google.gerrit.client.changes.ChangeApi.AssigneeInput input = com.google.gerrit.client.changes.ChangeApi.AssigneeInput.create ( ) ; input.assignee ( user ) ; com.google.gerrit.client.changes.ChangeApi.change ( id ) . view ( "assignee" ) . put ( user , cb ) ; }

Target:
public static void setAssignee ( int id , java.lang.String user , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.info.AccountInfo > cb ) { com.google.gerrit.client.changes.ChangeApi.AssigneeInput input = com.google.gerrit.client.changes.ChangeApi.AssigneeInput.create ( ) ; input.assignee ( user ) ; com.google.gerrit.client.changes.ChangeApi.change ( id ) . view ( "assignee" ) . put ( input , cb ) ; }
Source:
public void testListSequences ( ) throws com.google.gwtorm.client.OrmException , java.sql.SQLException { assertTrue ( dialect.listSequences ( db ) . isEmpty ( ) ) ; execute ( "CREATE TABLE cnt (s SERIAL)" ) ; execute ( "CREATE TABLE foo (cnt INT)" ) ; java.util.Set < java.lang.String > s = dialect.listSequences ( db ) ; assertEquals ( 1 , s.size ( ) ) ; assertTrue ( s.contains ( "cnt" ) ) ; assertFalse ( s.contains ( "foo" ) ) ; }

Target:
public void testListSequences ( ) throws com.google.gwtorm.server.OrmException , java.sql.SQLException { org.junit.Assert.assertTrue ( dialect.listSequences ( db ) . isEmpty ( ) ) ; execute ( "CREATE TABLE cnt (s SERIAL)" ) ; execute ( "CREATE TABLE foo (cnt INT)" ) ; java.util.Set < java.lang.String > s = dialect.listSequences ( db ) ; org.junit.Assert.assertEquals ( 1 , s.size ( ) ) ; org.junit.Assert.assertTrue ( s.contains ( "cnt" ) ) ; org.junit.Assert.assertFalse ( s.contains ( "foo" ) ) ; }
Source:
private void assertChangeSetMergeable ( com.google.gerrit.server.query.change.ChangeData change , boolean expected ) throws com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.errors.IncorrectObjectTypeException , org.eclipse.jgit.errors.MissingObjectException { com.google.gerrit.server.git.ChangeSet cs = mergeSuperSet.completeChangeSet ( db , change.change ( ) ) ; if ( expected ) { com.google.common.truth.Truth.assertThat ( submit.unmergeableChanges ( cs ) ) . isEmpty ( ) ; } else { com.google.common.truth.Truth.assertThat ( submit.unmergeableChanges ( cs ) ) . isNotEmpty ( ) ; } BRANCH ( ( ( 79.0 / ( meta ) ) / ( chan ) ) ) ; }

Target:
private void assertChangeSetMergeable ( com.google.gerrit.server.query.change.ChangeData change , boolean expected ) throws com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.errors.IncorrectObjectTypeException , org.eclipse.jgit.errors.MissingObjectException { com.google.gerrit.server.git.ChangeSet cs = mergeSuperSet.completeChangeSet ( db , change.change ( ) , user ( admin ) ) ; com.google.common.truth.Truth.assertThat ( submit.unmergeableChanges ( cs ) . isEmpty ( ) ) . isEqualTo ( expected ) ; }
Source:
public void testEscapeString ( ) { final java.lang.String [ ] testPairs = new java.lang.String [ ] { "" , "" , "plain string" , "plain string" , "string with \"quotes\"" , "string with \"quotes\"" , "string with 'quotes'" , "string with 'quotes'" , "string with 'quotes'" , "string with 'quotes'" , "C:\\Program Files\\MyProgram" , "C:\\\\Program Files\\\\MyProgram" , "string\nwith\nnewlines" , "string\\nwith\\nnewlines" , "string\twith\ttabs" , "string\\twith\\ttabs" } ; for ( int i = 0 ; i < ( testPairs.length ) ; i += 2 ) { assertEquals ( com.google.gerrit.server.StringUtil.escapeString ( testPairs [ i ] ) , testPairs [ ( i + 1 ) ] ) ; } }

Target:
public void testEscapeString ( ) { final java.lang.String [ ] testPairs = new java.lang.String [ ] { "" , "" , "plain string" , "plain string" , "string with \"quotes\"" , "string with \"quotes\"" , "string with 'quotes'" , "string with 'quotes'" , "string with 'quotes'" , "string with 'quotes'" , "C:\\Program Files\\MyProgram" , "C:\\\\Program Files\\\\MyProgram" , "string\nwith\nnewlines" , "string\\nwith\\nnewlines" , "string\twith\ttabs" , "string\\twith\\ttabs" } ; for ( int i = 0 ; i < ( testPairs.length ) ; i += 2 ) { org.junit.Assert.assertEquals ( com.google.gerrit.server.StringUtil.escapeString ( testPairs [ i ] ) , testPairs [ ( i + 1 ) ] ) ; } }
Source:
private com.google.gerrit.reviewdb.client.PatchSetApproval dummyApproval ( com.google.gerrit.server.project.ChangeControl ctl , com.google.gerrit.reviewdb.client.PatchSet.Id patchSetId , com.google.gerrit.reviewdb.client.Account.Id reviewerId ) { com.google.gerrit.reviewdb.client.PatchSetApproval.LabelId id = com.google.common.collect.Iterables.getLast ( ctl.getLabelTypes ( ) . getLabelTypes ( ) ) . getLabelId ( ) ; com.google.gerrit.reviewdb.client.PatchSetApproval dummyApproval = new com.google.gerrit.reviewdb.client.PatchSetApproval ( new com.google.gerrit.reviewdb.client.PatchSetApproval.Key ( patchSetId , reviewerId , id ) , ( ( short ) ( 0 ) ) , com.google.gerrit.server.util.TimeUtil.nowTs ( ) ) ; dummyApproval.cache ( ctl.getChange ( ) ) ; return dummyApproval ; }

Target:
private com.google.gerrit.reviewdb.client.PatchSetApproval dummyApproval ( com.google.gerrit.server.project.ChangeControl ctl , com.google.gerrit.reviewdb.client.PatchSet.Id patchSetId , com.google.gerrit.reviewdb.client.Account.Id reviewerId ) { com.google.gerrit.reviewdb.client.PatchSetApproval.LabelId id = com.google.common.collect.Iterables.getLast ( ctl.getLabelTypes ( ) . getLabelTypes ( ) ) . getLabelId ( ) ; return new com.google.gerrit.reviewdb.client.PatchSetApproval ( new com.google.gerrit.reviewdb.client.PatchSetApproval.Key ( patchSetId , reviewerId , id ) , ( ( short ) ( 0 ) ) , com.google.gerrit.server.util.TimeUtil.nowTs ( ) ) ; }
Source:
void send ( java.lang.String message ) { com.google.gerrit.client.changes.ChangeApi.createChange ( project , branch , null , message , base , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.changes.ChangeInfo > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.changes.ChangeInfo result ) { com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( result.legacyId ( ) ) ) ; hide ( ) ; } } ) ; }

Target:
void send ( java.lang.String message ) { com.google.gerrit.client.changes.ChangeApi.createChange ( project , branch , topic , message , base , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.changes.ChangeInfo > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.changes.ChangeInfo result ) { com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( result.legacyId ( ) ) ) ; hide ( ) ; } } ) ; }
Source:
public void getRelatedNoResult ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , admin.getIdent ( ) ) ; com.google.gerrit.reviewdb.client.PatchSet.Id ps = push.to ( git , "refs/for/master" ) . getPatchSetId ( ) ; java.util.List < com.google.gerrit.server.change.GetRelated.ChangeAndCommit > related = getRelated ( ps ) ; com.google.common.truth.Truth.assertThat ( related ) . isEmpty ( ) ; }

Target:
public void getRelatedNoResult ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , admin.getIdent ( ) , git ) ; com.google.gerrit.reviewdb.client.PatchSet.Id ps = push.to ( "refs/for/master" ) . getPatchSetId ( ) ; java.util.List < com.google.gerrit.server.change.GetRelated.ChangeAndCommit > related = getRelated ( ps ) ; com.google.common.truth.Truth.assertThat ( related ) . isEmpty ( ) ; }
Source:
private boolean canRebase ( com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { return ( ( ( ( isOwner ( ) ) || ( getRefControl ( ) . canSubmit ( isOwner ( ) ) ) ) || ( getRefControl ( ) . canRebase ( ) ) ) && ( refControl.asForRef ( ) . testOrFalse ( RefPermission.CREATE_CHANGE ) ) ) && ( ! ( isPatchSetLocked ( db ) ) ) ; }

Target:
private boolean canRebase ( com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { return ( ( ( ( isOwner ( ) ) || ( refControl.canSubmit ( isOwner ( ) ) ) ) || ( refControl.canRebase ( ) ) ) && ( refControl.asForRef ( ) . testOrFalse ( RefPermission.CREATE_CHANGE ) ) ) && ( ! ( isPatchSetLocked ( db ) ) ) ; }
Source:
protected void configure ( ) { install ( new com.google.gerrit.server.schema.SchemaVersion.Module ( ) ) ; bind ( new com.google.inject.TypeLiteral < com.google.gwtorm.client.SchemaFactory < com.google.gerrit.reviewdb.ReviewDb > > ( ) { } ) . to ( new com.google.inject.TypeLiteral < com.google.gwtorm.jdbc.Database < com.google.gerrit.reviewdb.ReviewDb > > ( ) { } ) . in ( com.google.inject.Scopes.SINGLETON ) ; bind ( new com.google.inject.TypeLiteral < com.google.gwtorm.jdbc.Database < com.google.gerrit.reviewdb.ReviewDb > > ( ) { } ) . toProvider ( com.google.gerrit.server.schema.ReviewDbDatabaseProvider.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; }

Target:
protected void configure ( ) { bind ( new com.google.inject.TypeLiteral < com.google.gwtorm.client.SchemaFactory < com.google.gerrit.reviewdb.ReviewDb > > ( ) { } ) . to ( new com.google.inject.TypeLiteral < com.google.gwtorm.jdbc.Database < com.google.gerrit.reviewdb.ReviewDb > > ( ) { } ) . in ( com.google.inject.Scopes.SINGLETON ) ; bind ( new com.google.inject.TypeLiteral < com.google.gwtorm.jdbc.Database < com.google.gerrit.reviewdb.ReviewDb > > ( ) { } ) . toProvider ( com.google.gerrit.server.schema.ReviewDbDatabaseProvider.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; }
Source:
public void onSuccess ( com.google.gerrit.client.diff.DiffInfo diffInfo ) { diff = diffInfo ; if ( prefs.syntaxHighlighting ( ) ) { fileSize = com.google.gerrit.client.diff.SideBySide2.bucketFileSize ( diffInfo ) ; if ( ( fileSize.compareTo ( com.google.gerrit.client.diff.SideBySide2.FileSize.SMALL ) ) > 0 ) { modeInjectorCb.onSuccess ( null ) ; } else { injectMode ( diffInfo , modeInjectorCb ) ; } } else { modeInjectorCb.onSuccess ( null ) ; } }

Target:
public void onSuccess ( com.google.gerrit.client.diff.DiffInfo diffInfo ) { diff = diffInfo ; fileSize = com.google.gerrit.client.diff.SideBySide2.bucketFileSize ( diffInfo ) ; if ( prefs.syntaxHighlighting ( ) ) { if ( ( fileSize.compareTo ( com.google.gerrit.client.diff.SideBySide2.FileSize.SMALL ) ) > 0 ) { modeInjectorCb.onSuccess ( null ) ; } else { injectMode ( diffInfo , modeInjectorCb ) ; } } else { modeInjectorCb.onSuccess ( null ) ; } }
Source:
private void logError ( java.lang.String msg , java.lang.Throwable t ) { if ( com.google.gerrit.server.git.MergeOp.log.isErrorEnabled ( ) ) { com.google.gerrit.server.git.MergeOp.log.error ( ( ( logPrefix ) + msg ) , t ) ; } }

Target:
private void logError ( java.lang.String msg , java.lang.Throwable t ) { if ( com.google.gerrit.server.git.MergeOp.log.isErrorEnabled ( ) ) { if ( t != null ) { com.google.gerrit.server.git.MergeOp.log.error ( ( ( logPrefix ) + msg ) , t ) ; } else { com.google.gerrit.server.git.MergeOp.log.error ( ( ( logPrefix ) + msg ) ) ; } } }
Source:
private void loadDefaults ( ) { approvals = com.google.common.collect.ImmutableListMultimap.of ( ) ; reviewers = com.google.common.collect.ImmutableSetMultimap.of ( ) ; submitRecords = com.google.common.collect.ImmutableList.of ( ) ; changeMessages = com.google.common.collect.ImmutableListMultimap.of ( ) ; commentsForBase = com.google.common.collect.ImmutableListMultimap.of ( ) ; commentsForPS = com.google.common.collect.ImmutableListMultimap.of ( ) ; }

Target:
protected void loadDefaults ( ) { approvals = com.google.common.collect.ImmutableListMultimap.of ( ) ; reviewers = com.google.common.collect.ImmutableSetMultimap.of ( ) ; submitRecords = com.google.common.collect.ImmutableList.of ( ) ; changeMessages = com.google.common.collect.ImmutableListMultimap.of ( ) ; commentsForBase = com.google.common.collect.ImmutableListMultimap.of ( ) ; commentsForPS = com.google.common.collect.ImmutableListMultimap.of ( ) ; }
Source:
public void unstarChange ( java.lang.String id ) throws com.google.gerrit.extensions.restapi.RestApiException { try { com.google.gerrit.server.change.ChangeResource rsrc = changes.parse ( TopLevelResource.INSTANCE , com.google.gerrit.extensions.restapi.IdString.fromUrl ( id ) ) ; com.google.gerrit.server.account.AccountResource.StarredChange starredChange = new com.google.gerrit.server.account.AccountResource.StarredChange ( account.getUser ( ) , rsrc ) ; starredChangesDelete.apply ( starredChange , new com.google.gerrit.server.account.StarredChanges.EmptyInput ( ) ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot unstar change" , e ) ; } }

Target:
public void unstarChange ( java.lang.String id ) throws com.google.gerrit.extensions.restapi.RestApiException { try { com.google.gerrit.server.change.ChangeResource rsrc = changes.parse ( TopLevelResource.INSTANCE , com.google.gerrit.extensions.restapi.IdString.fromUrl ( id ) ) ; com.google.gerrit.server.account.AccountResource.StarredChange starredChange = new com.google.gerrit.server.account.AccountResource.StarredChange ( account.getUser ( ) , rsrc ) ; starredChangesDelete.apply ( starredChange , new com.google.gerrit.server.account.StarredChanges.EmptyInput ( ) ) ; } catch ( com.google.gwtorm.server.OrmException | java.io.IOException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot unstar change" , e ) ; } }
Source:
protected void preUpdateSchema ( com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException , java.sql.SQLException { final com.google.gwtorm.jdbc.JdbcSchema s = ( ( com.google.gwtorm.jdbc.JdbcSchema ) ( db ) ) ; final com.google.gwtorm.jdbc.JdbcExecutor e = new com.google.gwtorm.jdbc.JdbcExecutor ( s ) ; renameTables ( db , s , e ) ; renameColumn ( db , s , e ) ; renameIndexes ( db ) ; }

Target:
protected void preUpdateSchema ( com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException , java.sql.SQLException { com.google.gwtorm.jdbc.JdbcSchema s = ( ( com.google.gwtorm.jdbc.JdbcSchema ) ( db ) ) ; try ( com.google.gwtorm.jdbc.JdbcExecutor e = new com.google.gwtorm.jdbc.JdbcExecutor ( s ) ) { renameTables ( db , s , e ) ; renameColumn ( db , s , e ) ; } renameIndexes ( db ) ; }
Source:
public void testRepositoryIndex ( ) throws java.lang.Exception { assertGone ( com.google.gitiles.GitwebRedirectFilterTest.newRequest ( "a=summary" ) ) ; assertRedirectsTo ( com.google.gitiles.GitilesView.repositoryIndex ( ) . setHostName ( com.google.gitiles.TestGitilesUrls.HOST_NAME ) . setServletPath ( com.google.gitiles.FakeHttpServletRequest.SERVLET_PATH ) . setRepositoryName ( "test" ) . toUrl ( ) , com.google.gitiles.GitwebRedirectFilterTest.newRequest ( "a=summary;p=test" ) ) ; }

Target:
public void repositoryIndex ( ) throws java.lang.Exception { assertGone ( com.google.gitiles.GitwebRedirectFilterTest.newRequest ( "a=summary" ) ) ; assertRedirectsTo ( com.google.gitiles.GitilesView.repositoryIndex ( ) . setHostName ( com.google.gitiles.TestGitilesUrls.HOST_NAME ) . setServletPath ( com.google.gitiles.FakeHttpServletRequest.SERVLET_PATH ) . setRepositoryName ( "test" ) . toUrl ( ) , com.google.gitiles.GitwebRedirectFilterTest.newRequest ( "a=summary;p=test" ) ) ; }