auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void updatePatchSet ( ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.Change.Status changeStatus = parentChange.getStatus ( ) ; switch ( changeStatus ) { case NEW : setPatchSetAsDraft ( ) ; updateChange ( ) ; break ; default : sendUserInfo ( ( "Unable to set patch set as draft, change is " + ( getStatusName ( changeStatus ) ) ) ) ; break ; } }

Target:
private void updatePatchSet ( ) throws com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.reviewdb.client.Change.Status changeStatus = parentChange.getStatus ( ) ; switch ( changeStatus ) { case NEW : setPatchSetAsDraft ( ) ; changeIndexer.index ( dbProvider.get ( ) , updateChange ( ) ) ; break ; default : sendUserInfo ( ( "Unable to set patch set as draft, change is " + ( getStatusName ( changeStatus ) ) ) ) ; break ; } }
Source:
private PushOneCommit.Result createChangeWithTopic ( org.eclipse.jgit.junit.TestRepository < org.eclipse.jgit.internal.storage.dfs.InMemoryRepository > repo , java.lang.String topic , java.lang.String commitMsg , java.lang.String fileName , java.lang.String content ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , admin.getIdent ( ) , repo , commitMsg , fileName , content ) ; com.google.common.truth.Truth.assertThat ( topic ) . isNotEmpty ( ) ; return push.to ( ( "refs/for/master/" + ( name ( topic ) ) ) ) ; }

Target:
private PushOneCommit.Result createChangeWithTopic ( org.eclipse.jgit.junit.TestRepository < org.eclipse.jgit.internal.storage.dfs.InMemoryRepository > repo , java.lang.String topic , java.lang.String commitMsg , java.lang.String fileName , java.lang.String content ) throws java.lang.Exception { com.google.common.truth.Truth.assertThat ( topic ) . isNotEmpty ( ) ; return createCommitAndPush ( repo , ( "refs/for/master/" + ( name ( topic ) ) ) , commitMsg , fileName , content ) ; }
Source:
private com.google.common.collect.SetMultimap < org.eclipse.jgit.lib.ObjectId , org.eclipse.jgit.lib.Ref > changeRefsById ( ) throws java.io.IOException { if ( ( refsById ) == null ) { refsById = com.google.common.collect.HashMultimap.create ( ) ; for ( org.eclipse.jgit.lib.Ref r : repo.getRefDatabase ( ) . getRefs ( com.google.gerrit.reviewdb.client.RefNames.REFS_CHANGES ) . values ( ) ) { if ( com.google.gerrit.reviewdb.client.PatchSet.isRef ( r.getName ( ) ) ) { refsById.put ( r.getObjectId ( ) , r ) ; } } } return refsById ; }

Target:
private com.google.common.collect.ListMultimap < com.google.gerrit.reviewdb.client.Change.Id , org.eclipse.jgit.lib.Ref > refsByChange ( ) { initChangeRefMaps ( ) ; return refsByChange ; }
Source:
private void notifyDraftDelta ( final int delta ) { com.google.gwt.user.client.ui.Widget p = getParent ( ) ; if ( p != null ) { p = p.getParent ( ) ; if ( p != null ) { ( ( com.google.gerrit.client.patches.AbstractPatchContentTable ) ( p ) ) . notifyDraftDelta ( delta ) ; } } }

Target:
private com.google.gerrit.client.patches.CommentEditorContainer getContainer ( ) { com.google.gwt.user.client.ui.Widget p = getParent ( ) ; while ( p != null ) { if ( p instanceof com.google.gerrit.client.patches.CommentEditorContainer ) { return ( ( com.google.gerrit.client.patches.CommentEditorContainer ) ( p ) ) ; } p = p.getParent ( ) ; } return null ; }
Source:
private void recomputeColumnNames ( ) { for ( final com.google.gwtorm.schema.ColumnModel c : nestedColumns ) { c.parent = this ; if ( ( nestedColumns.size ( ) ) == 1 ) { c.columnName = columnName ; } else { c.columnName = ( ( columnName ) + "_" ) + ( c.origName ) ; } c.recomputeColumnNames ( ) ; } }

Target:
private void recomputeColumnNames ( ) { final boolean thisHasName = ! ( columnName.equals ( Column.NONE ) ) ; for ( final com.google.gwtorm.schema.ColumnModel c : nestedColumns ) { c.parent = this ; if ( ( nestedColumns.size ( ) ) == 1 ) { c.columnName = ( thisHasName ) ? columnName : c.origName ; } else { if ( thisHasName ) { c.columnName = ( ( columnName ) + "_" ) + ( c.origName ) ; } else { c.columnName = c.origName ; } } c.recomputeColumnNames ( ) ; } }
Source:
public boolean deleteChangeFromIndex ( int changeId ) { try { com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpResponseHandler.HttpResult result = httpSession.delete ( buildEndpoint ( changeId ) ) ; if ( result.isSuccessful ( ) ) { return true ; } com.ericsson.gerrit.plugins.highavailability.forwarder.rest.RestForwarder.log.error ( "Unable to delete from index change {}. Cause: {}" , changeId , result.getMessage ( ) ) ; } catch ( java.io.IOException e ) { com.ericsson.gerrit.plugins.highavailability.forwarder.rest.RestForwarder.log.error ( ( "Error trying to delete from index change " + changeId ) , e ) ; } return false ; }

Target:
public boolean deleteChangeFromIndex ( int changeId ) { try { com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpResponseHandler.HttpResult result = httpSession.delete ( buildIndexEndpoint ( changeId ) ) ; if ( result.isSuccessful ( ) ) { return true ; } com.ericsson.gerrit.plugins.highavailability.forwarder.rest.RestForwarder.log.error ( "Unable to delete from index change {}. Cause: {}" , changeId , result.getMessage ( ) ) ; } catch ( java.io.IOException e ) { com.ericsson.gerrit.plugins.highavailability.forwarder.rest.RestForwarder.log.error ( ( "Error trying to delete from index change " + changeId ) , e ) ; } return false ; }
Source:
public com.google.gerrit.reviewdb.server.ReviewDb open ( ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.server.ReviewDb db = delegate.open ( ) ; if ( ! ( migration.readChanges ( ) ) ) { return db ; } return new com.google.gerrit.reviewdb.server.DisabledChangesReviewDbWrapper ( db ) ; }

Target:
public com.google.gerrit.reviewdb.server.ReviewDb open ( ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.server.ReviewDb db = delegate.open ( ) ; if ( ! ( migration.readChanges ( ) ) ) { return db ; } if ( migration.disableChangeReviewDb ( ) ) { db = new com.google.gerrit.server.schema.NoChangesReviewDbWrapper ( db ) ; } return new com.google.gerrit.reviewdb.server.DisallowReadFromChangesReviewDbWrapper ( db ) ; }
Source:
public boolean canRebase ( ) throws com.google.gerrit.extensions.restapi.RestApiException { try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( revision.getProject ( ) ) ; org.eclipse.jgit.revwalk.RevWalk rw = new org.eclipse.jgit.revwalk.RevWalk ( repo ) ) { return rebaseUtil.canRebase ( revision.getPatchSet ( ) , revision.getChange ( ) . getDest ( ) , repo , rw ) ; } catch ( java.io.IOException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot check if rebase is possible" , e ) ; } }

Target:
public boolean canRebase ( ) throws com.google.gerrit.extensions.restapi.RestApiException { try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( revision.getProject ( ) ) ; org.eclipse.jgit.revwalk.RevWalk rw = new org.eclipse.jgit.revwalk.RevWalk ( repo ) ) { return rebaseUtil.canRebase ( revision.getPatchSet ( ) , revision.getChange ( ) . getDest ( ) , repo , rw ) ; } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( "Cannot check if rebase is possible" , e ) ; } }
Source:
private void fMilliseconds ( final java.lang.String name , final float ms ) { p.println ( java.lang.String.format ( " %1$-12s: %2$6.2f ms" , name , ms ) ) ; }

Target:
private java.lang.String percent ( final long value , final long total ) { if ( total <= 0 ) { return "" ; } final long pcent = ( 100 * value ) / total ; return java.lang.String.format ( "%3d%%" , ( ( int ) ( pcent ) ) ) ; }
Source:
public void fire ( com.google.gerrit.reviewdb.client.Project.NameKey project , org.eclipse.jgit.transport.ReceiveCommand cmd ) { fire ( project , cmd.getRefName ( ) , cmd.getOldId ( ) , cmd.getNewId ( ) , cmd.getType ( ) ) ; }

Target:
public void fire ( com.google.gerrit.reviewdb.client.Project.NameKey project , org.eclipse.jgit.transport.ReceiveCommand cmd , com.google.gerrit.reviewdb.client.Account updater ) { fire ( project , cmd.getRefName ( ) , cmd.getOldId ( ) , cmd.getNewId ( ) , cmd.getType ( ) , util.accountInfo ( updater ) ) ; }
Source:
private void addMergedMessage ( com.google.gerrit.reviewdb.client.PatchSetApproval submitter , com.google.gerrit.reviewdb.client.ChangeMessage msg ) throws com.google.gwtorm.server.OrmException { if ( msg != null ) { if ( ( submitter != null ) && ( ( msg.getAuthor ( ) ) == null ) ) { msg.setAuthor ( submitter.getAccountId ( ) ) ; } db.changeMessages ( ) . insert ( java.util.Collections.singleton ( msg ) ) ; } }

Target:
private void logDebug ( java.lang.String msg , java.lang.Object ... args ) { if ( com.google.gerrit.server.git.MergeOp.log.isDebugEnabled ( ) ) { com.google.gerrit.server.git.MergeOp.log.debug ( ( ( logPrefix ) + msg ) , args ) ; } }
Source:
public void onRevisionCreated ( com.google.gerrit.extensions.events.RevisionCreatedListener.Event ev ) { try { hooks.doPatchsetCreatedHook ( getChange ( ev.getChange ( ) ) , getPatchSet ( ev.getRevision ( ) ) , db.get ( ) ) ; } catch ( com.google.gwtorm.server.OrmException e ) { } }

Target:
public void onRevisionCreated ( com.google.gerrit.extensions.events.RevisionCreatedListener.Event ev ) { try { com.google.gerrit.server.notedb.ChangeNotes notes = getNotes ( ev.getChange ( ) ) ; hooks.doPatchsetCreatedHook ( notes.getChange ( ) , getPatchSet ( notes , ev.getRevision ( ) ) , db.get ( ) ) ; } catch ( com.google.gwtorm.server.OrmException e ) { com.google.gerrit.common.ChangeHookApiListener.log.error ( ( "PatchsetCreated hook failed to run " + ( ev.getChange ( ) . _number ) ) , e ) ; } }
Source:
private void banner ( ) { java.lang.System.err.format ( "Gerrit Code Review %s - Interactive Prolog Shell" , com.google.gerrit.common.Version.getVersion ( ) ) ; java.lang.System.err.println ( ) ; java.lang.System.err.println ( ( "based on " + ( com.googlecode.prolog_cafe.lang.PrologMain.VERSION ) ) ) ; java.lang.System.err.println ( ( " " + ( com.googlecode.prolog_cafe.lang.PrologMain.COPYRIGHT ) ) ) ; java.lang.System.err.println ( ( "(type Ctrl-D or \"halt.\" to exit," + " \"[\'path/to/file.pl\'].\" to load a file)" ) ) ; java.lang.System.err.println ( ) ; java.lang.System.err.flush ( ) ; }

Target:
private void banner ( ) { java.lang.System.err.format ( "Gerrit Code Review %s - Interactive Prolog Shell" , com.google.gerrit.common.Version.getVersion ( ) ) ; java.lang.System.err.println ( ) ; java.lang.System.err.println ( ( "based on " + ( com.googlecode.prolog_cafe.repl.PrologMain.VERSION ) ) ) ; java.lang.System.err.println ( ( " " + ( com.googlecode.prolog_cafe.repl.PrologMain.COPYRIGHT ) ) ) ; java.lang.System.err.println ( ( "(type Ctrl-D or \"halt.\" to exit," + " \"[\'path/to/file.pl\'].\" to load a file)" ) ) ; java.lang.System.err.println ( ) ; java.lang.System.err.flush ( ) ; }
Source:
public void start ( final org.apache.sshd.server.Environment env ) throws java.io.IOException { try { parseCommandLine ( ) ; } catch ( com.google.gerrit.sshd.commands.UnloggedFailure e ) { java.lang.String msg = e.getMessage ( ) ; if ( ! ( msg.endsWith ( "\n" ) ) ) { msg += "\n" ; } err.write ( msg.getBytes ( "UTF-8" ) ) ; err.flush ( ) ; onExit ( 1 ) ; return ; } stdout = toPrintWriter ( out ) ; hooks.addChangeListener ( listener , currentUser ) ; }

Target:
public void start ( final org.apache.sshd.server.Environment env ) throws java.io.IOException { try { parseCommandLine ( ) ; } catch ( com.google.gerrit.sshd.commands.UnloggedFailure e ) { java.lang.String msg = e.getMessage ( ) ; if ( ! ( msg.endsWith ( "\n" ) ) ) { msg += "\n" ; } err.write ( msg.getBytes ( "UTF-8" ) ) ; err.flush ( ) ; onExit ( 1 ) ; return ; } stdout = toPrintWriter ( out ) ; hooks.addEventListener ( listener , currentUser ) ; }
Source:
protected void configure ( ) { if ( ( gerritConfig.getString ( BugzillaItsFacade.ITS_NAME_BUGZILLA , null , "url" ) ) != null ) { com.googlesource.gerrit.plugins.hooks.bz.BugzillaModule.log.info ( "Bugzilla is configured as ITS" ) ; bind ( com.googlesource.gerrit.plugins.hooks.its.ItsFacade.class ) . toInstance ( new com.googlesource.gerrit.plugins.hooks.bz.BugzillaItsFacade ( gerritConfig ) ) ; install ( new com.googlesource.gerrit.plugins.hooks.ItsHookModule ( BugzillaItsFacade.ITS_NAME_BUGZILLA ) ) ; } }

Target:
protected void configure ( ) { if ( ( gerritConfig.getString ( pluginName , null , "url" ) ) != null ) { com.googlesource.gerrit.plugins.hooks.bz.BugzillaModule.log.info ( "Bugzilla is configured as ITS" ) ; bind ( com.googlesource.gerrit.plugins.hooks.its.ItsFacade.class ) . toInstance ( new com.googlesource.gerrit.plugins.hooks.bz.BugzillaItsFacade ( pluginName , gerritConfig ) ) ; install ( new com.googlesource.gerrit.plugins.hooks.ItsHookModule ( ) ) ; } }
Source:
public void updateExisting ( ) throws java.lang.Exception { com.google.gerrit.gpg.testutil.TestKey key5 = com.google.gerrit.gpg.testutil.TestKeys.validKeyWithSecondUserId ( ) ; org.bouncycastle.openpgp.PGPPublicKeyRing keyRing = key5.getPublicKeyRing ( ) ; org.bouncycastle.openpgp.PGPPublicKey key = keyRing.getPublicKey ( ) ; store.add ( keyRing ) ; org.junit.Assert.assertEquals ( RefUpdate.Result.NEW , store.save ( newCommitBuilder ( ) ) ) ; assertUserIds ( store.get ( key5.getKeyId ( ) ) . iterator ( ) . next ( ) , "Testuser Five <test5@example.com>" , "foo:myId" ) ; keyRing = org.bouncycastle.openpgp.PGPPublicKeyRing.removePublicKey ( keyRing , key ) ; key = org.bouncycastle.openpgp.PGPPublicKey.removeCertification ( key , "foo:myId" ) ; keyRing = org.bouncycastle.openpgp.PGPPublicKeyRing.insertPublicKey ( keyRing , key ) ; store.add ( keyRing ) ; org.junit.Assert.assertEquals ( RefUpdate.Result.FAST_FORWARD , store.save ( newCommitBuilder ( ) ) ) ; java.util.Iterator < org.bouncycastle.openpgp.PGPPublicKeyRing > keyRings = store.get ( key.getKeyID ( ) ) . iterator ( ) ; keyRing = keyRings.next ( ) ; org.junit.Assert.assertFalse ( keyRings.hasNext ( ) ) ; assertUserIds ( keyRing , "Testuser Five <test5@example.com>" ) ; }

Target:
public void updateExisting ( ) throws java.lang.Exception { com.google.gerrit.gpg.testing.TestKey key5 = com.google.gerrit.gpg.testing.TestKeys.validKeyWithSecondUserId ( ) ; org.bouncycastle.openpgp.PGPPublicKeyRing keyRing = key5.getPublicKeyRing ( ) ; org.bouncycastle.openpgp.PGPPublicKey key = keyRing.getPublicKey ( ) ; store.add ( keyRing ) ; org.junit.Assert.assertEquals ( RefUpdate.Result.NEW , store.save ( newCommitBuilder ( ) ) ) ; assertUserIds ( store.get ( key5.getKeyId ( ) ) . iterator ( ) . next ( ) , "Testuser Five <test5@example.com>" , "foo:myId" ) ; keyRing = org.bouncycastle.openpgp.PGPPublicKeyRing.removePublicKey ( keyRing , key ) ; key = org.bouncycastle.openpgp.PGPPublicKey.removeCertification ( key , "foo:myId" ) ; keyRing = org.bouncycastle.openpgp.PGPPublicKeyRing.insertPublicKey ( keyRing , key ) ; store.add ( keyRing ) ; org.junit.Assert.assertEquals ( RefUpdate.Result.FAST_FORWARD , store.save ( newCommitBuilder ( ) ) ) ; java.util.Iterator < org.bouncycastle.openpgp.PGPPublicKeyRing > keyRings = store.get ( key.getKeyID ( ) ) . iterator ( ) ; keyRing = keyRings.next ( ) ; org.junit.Assert.assertFalse ( keyRings.hasNext ( ) ) ; assertUserIds ( keyRing , "Testuser Five <test5@example.com>" ) ; }
Source:
java.lang.Iterable < com.google.gerrit.reviewdb.client.PatchSetApproval > getForPatchSet ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.project.ChangeControl ctl , com.google.gerrit.reviewdb.client.PatchSet.Id psId , java.lang.Iterable < com.google.gerrit.reviewdb.client.PatchSetApproval > dontCopy ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.PatchSet ps = psUtil.get ( db , ctl.getNotes ( ) , psId ) ; if ( ps == null ) { return java.util.Collections.emptyList ( ) ; } return getForPatchSet ( db , ctl , ps , dontCopy ) ; }

Target:
java.lang.Iterable < com.google.gerrit.reviewdb.client.PatchSetApproval > getForPatchSet ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.project.ChangeControl ctl , com.google.gerrit.reviewdb.client.PatchSet.Id psId , @ com.google.gerrit.common.Nullable org.eclipse.jgit.revwalk.RevWalk rw , @ com.google.gerrit.common.Nullable org.eclipse.jgit.lib.Config repoConfig , java.lang.Iterable < com.google.gerrit.reviewdb.client.PatchSetApproval > dontCopy ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.PatchSet ps = psUtil.get ( db , ctl.getNotes ( ) , psId ) ; if ( ps == null ) { return java.util.Collections.emptyList ( ) ; } return getForPatchSet ( db , ctl , ps , rw , repoConfig , dontCopy ) ; }
Source:
protected com.google.gerrit.extensions.common.ChangeInfo get ( java.lang.String id , com.google.gerrit.extensions.client.ListChangesOption ... options ) throws com.google.gerrit.extensions.restapi.RestApiException { java.util.EnumSet < com.google.gerrit.extensions.client.ListChangesOption > s = java.util.EnumSet.noneOf ( com.google.gerrit.extensions.client.ListChangesOption.class ) ; s.addAll ( java.util.Arrays.asList ( options ) ) ; return gApi.changes ( ) . id ( id ) . get ( s ) ; }

Target:
protected com.google.gerrit.extensions.common.ChangeInfo get ( java.lang.String id , com.google.gerrit.extensions.client.ListChangesOption ... options ) throws com.google.gerrit.extensions.restapi.RestApiException { return gApi.changes ( ) . id ( id ) . get ( com.google.common.collect.Sets.newEnumSet ( java.util.Arrays.asList ( options ) , com.google.gerrit.extensions.client.ListChangesOption.class ) ) ; }
Source:
private java.util.List < com.google.gerrit.server.query.change.ChangeData > queryChangesForSha1 ( java.lang.String pullRequestSha1 ) { com.google.gerrit.server.query.change.QueryResult results ; try { results = qp.queryChanges ( changeQuery.commit ( pullRequestSha1 ) ) ; return results.changes ( ) ; } catch ( com.google.gwtorm.server.OrmException | com.google.gerrit.server.query.QueryParseException e ) { com.googlesource.gerrit.plugins.github.git.PullRequestCreateChange.LOG.error ( ( ( "Invalid SHA1 " + pullRequestSha1 ) + ": cannot query changes for this pull request" ) , e ) ; return java.util.Collections.emptyList ( ) ; } }

Target:
private java.util.List < com.google.gerrit.server.query.change.ChangeData > queryChangesForSha1 ( java.lang.String pullRequestSha1 ) { com.google.gerrit.server.query.QueryResult < com.google.gerrit.server.query.change.ChangeData > results ; try { results = qp.query ( changeQuery.commit ( pullRequestSha1 ) ) ; return results.entities ( ) ; } catch ( com.google.gwtorm.server.OrmException | com.google.gerrit.server.query.QueryParseException e ) { com.googlesource.gerrit.plugins.github.git.PullRequestCreateChange.LOG.error ( ( ( "Invalid SHA1 " + pullRequestSha1 ) + ": cannot query changes for this pull request" ) , e ) ; return java.util.Collections.emptyList ( ) ; } }
Source:
private void assertNoProblems ( com.google.gerrit.server.notedb.ChangeNotes notes , @ com.google.gerrit.common.Nullable com.google.gerrit.extensions.api.changes.FixInput fix ) throws java.lang.Exception { com.google.common.truth.Truth.assertThat ( checker.check ( controlForNotes ( notes ) , fix ) . problems ( ) ) . isEmpty ( ) ; }

Target:
private void assertProblems ( com.google.gerrit.server.notedb.ChangeNotes notes , @ com.google.gerrit.common.Nullable com.google.gerrit.extensions.api.changes.FixInput fix , com.google.gerrit.extensions.common.ProblemInfo first , com.google.gerrit.extensions.common.ProblemInfo ... rest ) throws java.lang.Exception { java.util.List < com.google.gerrit.extensions.common.ProblemInfo > expected = new java.util.ArrayList ( ( 1 + ( rest.length ) ) ) ; expected.add ( first ) ; expected.addAll ( java.util.Arrays.asList ( rest ) ) ; com.google.common.truth.Truth.assertThat ( checker.check ( notes , fix ) . problems ( ) ) . containsExactlyElementsIn ( expected ) . inOrder ( ) ; }
Source:
public void setPatchLineComments ( final java.util.List < com.google.gerrit.reviewdb.PatchLineComment > plc ) { inlineComments = plc ; java.util.Set < java.lang.String > paths = new java.util.HashSet < java.lang.String > ( ) ; for ( com.google.gerrit.reviewdb.PatchLineComment c : plc ) { com.google.gerrit.reviewdb.Patch.Key p = c.getKey ( ) . getParentKey ( ) ; paths.add ( p.getFileName ( ) ) ; } changeData.setCurrentFilePaths ( paths ) ; }

Target:
public void setPatchLineComments ( final java.util.List < com.google.gerrit.reviewdb.PatchLineComment > plc ) { inlineComments = plc ; java.util.Set < java.lang.String > paths = new java.util.HashSet < java.lang.String > ( ) ; for ( com.google.gerrit.reviewdb.PatchLineComment c : plc ) { com.google.gerrit.reviewdb.Patch.Key p = c.getKey ( ) . getParentKey ( ) ; if ( ! ( Patch.COMMIT_MSG.equals ( p.getFileName ( ) ) ) ) { paths.add ( p.getFileName ( ) ) ; } } changeData.setCurrentFilePaths ( paths ) ; }
Source:
public com.googlesource.gerrit.plugins.imagare.ImageResource parse ( com.google.gerrit.server.project.ProjectResource parent , com.google.gerrit.extensions.restapi.IdString id ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException { com.google.gerrit.server.project.RefControl refControl = parent.getControl ( ) . controlForRef ( new com.google.gerrit.reviewdb.client.Branch.NameKey ( parent.getNameKey ( ) , id.get ( ) ) ) ; if ( refControl.canRead ( ) ) { return new com.googlesource.gerrit.plugins.imagare.ImageResource ( refControl ) ; } else { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( id ) ; } }

Target:
public com.googlesource.gerrit.plugins.imagare.ImageResource parse ( com.google.gerrit.server.project.ProjectResource parent , com.google.gerrit.extensions.restapi.IdString id ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException { com.google.gerrit.reviewdb.client.Branch.NameKey branchName = new com.google.gerrit.reviewdb.client.Branch.NameKey ( parent.getNameKey ( ) , id.get ( ) ) ; if ( permissionBackend.user ( parent.getControl ( ) . getUser ( ) ) . ref ( branchName ) . testOrFalse ( RefPermission.READ ) ) { return new com.googlesource.gerrit.plugins.imagare.ImageResource ( parent.getControl ( ) . controlForRef ( branchName ) ) ; } throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( id ) ; }
Source:
public static org.eclipse.jgit.lib.ObjectInserter createDryRunInserter ( ) { return new org.eclipse.jgit.lib.ObjectInserter ( ) { @ java.lang.Override public org.eclipse.jgit.lib.ObjectId insert ( int objectType , long length , java.io.InputStream in ) throws java.io.IOException { return idFor ( objectType , length , in ) ; } @ java.lang.Override public org.eclipse.jgit.transport.PackParser newPackParser ( java.io.InputStream in ) throws java.io.IOException { throw new java.lang.UnsupportedOperationException ( ) ; } @ java.lang.Override public void flush ( ) throws java.io.IOException { } @ java.lang.Override public void release ( ) { } } ; }

Target:
public static org.eclipse.jgit.lib.ObjectInserter createDryRunInserter ( org.eclipse.jgit.lib.Repository db ) { final org.eclipse.jgit.lib.ObjectInserter delegate = db.newObjectInserter ( ) ; return new org.eclipse.jgit.lib.ObjectInserter.Filter ( ) { @ java.lang.Override protected org.eclipse.jgit.lib.ObjectInserter delegate ( ) { return delegate ; } @ java.lang.Override public org.eclipse.jgit.transport.PackParser newPackParser ( java.io.InputStream in ) throws java.io.IOException { throw new java.lang.UnsupportedOperationException ( ) ; } @ java.lang.Override public void flush ( ) throws java.io.IOException { } } ; }
Source:
public org.parboiled.Rule note ( ) { org.parboiled.support.StringBuilderVar body = new org.parboiled.support.StringBuilderVar ( ) ; return NodeSequence ( string ( "***" ) , Sp ( ) , typeOfNote ( ) , Newline ( ) , oneOrMore ( testNot ( string ( "***" ) , Newline ( ) ) , Line ( body ) ) , string ( "***" ) , Newline ( ) , push ( new com.google.gitiles.doc.DivNode ( popAsString ( ) , parse ( body ) ) ) ) ; }

Target:
public org.parboiled.Rule cols ( ) { org.parboiled.support.StringBuilderVar body = new org.parboiled.support.StringBuilderVar ( ) ; return NodeSequence ( colsTag ( ) , columnWidths ( ) , Newline ( ) , oneOrMore ( testNot ( colsTag ( ) , Newline ( ) ) , Line ( body ) ) , colsTag ( ) , Newline ( ) , push ( new com.google.gitiles.doc.ColsNode ( ( ( java.util.List < com.google.gitiles.doc.ColsNode.Column > ) ( pop ( ) ) ) , com.google.gitiles.doc.GitilesMarkdown.parse ( body ) ) ) ) ; }
Source:
public void testPushForMasterAsDraft ( ) throws com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { com.google.gerrit.acceptance.git.PushOneCommit.Result r = pushTo ( "refs/drafts/master" ) ; r.assertOkStatus ( ) ; r.assertChange ( Change.Status.DRAFT , null ) ; r = pushTo ( "refs/for/master%draft" ) ; r.assertOkStatus ( ) ; r.assertChange ( Change.Status.DRAFT , null ) ; }

Target:
private void testPushForMasterAsDraft ( com.google.gerrit.acceptance.git.PushForReviewIT.Protocol p ) throws com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { selectProtocol ( p ) ; com.google.gerrit.acceptance.git.PushOneCommit.Result r = pushTo ( "refs/drafts/master" ) ; r.assertOkStatus ( ) ; r.assertChange ( Change.Status.DRAFT , null ) ; r = pushTo ( "refs/for/master%draft" ) ; r.assertOkStatus ( ) ; r.assertChange ( Change.Status.DRAFT , null ) ; }
Source:
public com.google.gerrit.server.notedb.BatchMetaDataUpdate openUpdate ( com.google.gerrit.server.git.MetaDataUpdate update ) throws java.io.IOException { if ( migration.write ( ) ) { return super . openUpdate ( update ) ; } return new com.google.gerrit.server.notedb.BatchMetaDataUpdate ( ) { @ java.lang.Override public void write ( org.eclipse.jgit.lib.CommitBuilder commit ) { } @ java.lang.Override public void write ( com.google.gerrit.server.git.VersionedMetaData config , org.eclipse.jgit.lib.CommitBuilder commit ) { } @ java.lang.Override public org.eclipse.jgit.revwalk.RevCommit createRef ( java.lang.String refName ) { return null ; } @ java.lang.Override public org.eclipse.jgit.revwalk.RevCommit commit ( ) { return null ; } @ java.lang.Override public org.eclipse.jgit.revwalk.RevCommit commitAt ( org.eclipse.jgit.lib.ObjectId revision ) { return null ; } @ java.lang.Override public void close ( ) { } } ; }

Target:
public com.google.gerrit.server.notedb.BatchMetaDataUpdate openUpdate ( com.google.gerrit.server.git.MetaDataUpdate update ) throws java.io.IOException { throw new java.lang.UnsupportedOperationException ( "use openUpdate()" ) ; }
Source:
public void modifyCommitMessage ( java.lang.String newCommitMessage ) throws com.google.gerrit.extensions.restapi.RestApiException { com.google.gerrit.server.change.ChangeEdits.EditMessage.Input input = new com.google.gerrit.server.change.ChangeEdits.EditMessage.Input ( ) ; input.message = newCommitMessage ; try { modifyChangeEditCommitMessage.apply ( changeResource , input ) ; } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( "Cannot modify commit message of change edit" , e ) ; } }

Target:
public void modifyCommitMessage ( java.lang.String newCommitMessage ) throws com.google.gerrit.extensions.restapi.RestApiException { com.google.gerrit.server.restapi.change.ChangeEdits.EditMessage.Input input = new com.google.gerrit.server.restapi.change.ChangeEdits.EditMessage.Input ( ) ; input.message = newCommitMessage ; try { modifyChangeEditCommitMessage.apply ( changeResource , input ) ; } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( "Cannot modify commit message of change edit" , e ) ; } }
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 testAppend_int ( ) { final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder b = new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) ; org.junit.Assert.assertSame ( b , b.append ( 4 ) ) ; org.junit.Assert.assertSame ( b , b.append ( 2 ) ) ; org.junit.Assert.assertSame ( b , b.append ( ( - 100 ) ) ) ; org.junit.Assert.assertEquals ( "42-100" , b.asString ( ) ) ; }
Source:
private void assertAmGroupOwner ( final com.google.gerrit.reviewdb.ReviewDb db , final com.google.gerrit.reviewdb.AccountGroup group ) throws com.google.gerrit.httpd.rpc.account.Failure { try { if ( ! ( groupControlFactory.controlFor ( group.getId ( ) ) . isOwner ( ) ) ) { throw new com.google.gerrit.httpd.rpc.account.Failure ( new com.google.gerrit.server.account.NoSuchGroupException ( group.getId ( ) ) ) ; } } catch ( com.google.gerrit.server.account.NoSuchGroupException e ) { throw new com.google.gerrit.httpd.rpc.account.Failure ( new com.google.gerrit.server.account.NoSuchGroupException ( group.getId ( ) ) ) ; } }

Target:
private void assertAmGroupOwner ( final com.google.gerrit.reviewdb.ReviewDb db , final com.google.gerrit.reviewdb.AccountGroup group ) throws com.google.gerrit.httpd.rpc.account.Failure { try { if ( ! ( groupControlFactory.controlFor ( group.getId ( ) ) . isOwner ( ) ) ) { throw new com.google.gerrit.httpd.rpc.account.Failure ( new com.google.gerrit.common.errors.NoSuchGroupException ( group.getId ( ) ) ) ; } } catch ( com.google.gerrit.common.errors.NoSuchGroupException e ) { throw new com.google.gerrit.httpd.rpc.account.Failure ( new com.google.gerrit.common.errors.NoSuchGroupException ( group.getId ( ) ) ) ; } }
Source:
public void onResize ( com.google.gwt.event.logical.shared.ResizeEvent event ) { resizeCodeMirror ( ) ; }

Target:
public void run ( ) { int height = ( com.google.gwt.user.client.Window.getClientHeight ( ) ) - ( ( com.google.gerrit.client.Gerrit.getHeaderFooterHeight ( ) ) + 18 ) ; cmA.setHeight ( height ) ; cmB.setHeight ( height ) ; render ( diff ) ; commentManager.render ( comments , prefs.expandAllComments ( ) ) ; skipManager.render ( prefs.context ( ) , diff ) ; }
Source:
public org.eclipse.jgit.lib.BatchRefUpdate getBatchRefUpdate ( ) throws java.io.IOException { initRepository ( ) ; if ( ( batchRefUpdate ) == null ) { batchRefUpdate = repo.getRefDatabase ( ) . newBatchUpdate ( ) ; } return batchRefUpdate ; }

Target:
public com.google.gerrit.server.notedb.ChangeUpdate getUpdate ( com.google.gerrit.reviewdb.client.PatchSet.Id psId ) { com.google.gerrit.server.notedb.ChangeUpdate u = updates.get ( psId ) ; if ( u == null ) { u = changeUpdateFactory.create ( ctl , when ) ; if ( newChanges.containsKey ( ctl.getId ( ) ) ) { u.setAllowWriteToNewRef ( true ) ; } u.setPatchSetId ( psId ) ; updates.put ( psId , u ) ; } return u ; }
Source:
public java.util.List < java.lang.String > getReviewerNames ( ) { if ( reviewers.isEmpty ( ) ) { return null ; } java.util.List < java.lang.String > names = new java.util.ArrayList < > ( ) ; for ( com.google.gerrit.reviewdb.client.Account.Id id : reviewers ) { names.add ( getNameFor ( id ) ) ; } return names ; }

Target:
public java.util.List < java.lang.String > getReviewerNames ( ) { java.util.List < java.lang.String > names = new java.util.ArrayList < > ( ) ; for ( com.google.gerrit.reviewdb.client.Account.Id id : reviewers ) { if ( id.equals ( fromId ) ) { continue ; } names.add ( getNameFor ( id ) ) ; } if ( names.isEmpty ( ) ) { return null ; } return names ; }
Source:
private com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.common.data.ChangeDetail > createCommentedCallback ( final com.google.gwt.user.client.ui.Button b ) { return new com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.common.data.ChangeDetail > ( ) { public void onSuccess ( com.google.gerrit.common.data.ChangeDetail result ) { changeScreen.update ( result ) ; } public void onFailure ( java.lang.Throwable caught ) { b.setEnabled ( true ) ; } } ; }

Target:
public void onSuccess ( com.google.gerrit.common.data.ChangeDetail result ) { if ( redirect ) { com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( result.getChange ( ) . getId ( ) ) ) ; } else { changeScreen.update ( result ) ; } }
Source:
private com.google.gwtorm.jdbc.JdbcAccess < com.google.gwtorm.jdbc.TestJdbcAccess.Data , com.google.gwtorm.jdbc.TestJdbcAccess.Data.DataKey > createClassUnderTest ( ) { return createJdbcAccess ( com.google.gwtorm.jdbc.TestJdbcAccess.DIALECT ) ; }

Target:
protected static void assertUsedBatchingOnly ( java.sql.PreparedStatement ps , int ... ids ) throws java.sql.SQLException { org.mockito.Mockito.verify ( ps , org.mockito.Mockito.times ( ids.length ) ) . addBatch ( ) ; org.mockito.Mockito.verify ( ps ) . executeBatch ( ) ; org.mockito.Mockito.verify ( ps , org.mockito.Mockito.never ( ) ) . executeUpdate ( ) ; com.google.gwtorm.jdbc.AbstractTestJdbcAccess.assertExpectedIdsUsed ( ps , ids ) ; }
Source:
public com.google.gerrit.server.project.ProjectResource parse ( com.google.gerrit.extensions.restapi.TopLevelResource parent , java.lang.String id ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException { com.google.gerrit.server.project.ProjectControl ctl ; try { ctl = controlFactory.controlFor ( com.google.gerrit.server.project.ProjectsCollection.decode ( id ) , user.get ( ) ) ; } catch ( com.google.gerrit.server.project.NoSuchProjectException e ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( id ) ; } if ( ( ! ( ctl.isVisible ( ) ) ) && ( ! ( ctl.isOwner ( ) ) ) ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( id ) ; } return new com.google.gerrit.server.project.ProjectResource ( ctl ) ; }

Target:
public com.google.gerrit.server.project.ProjectResource parse ( com.google.gerrit.extensions.restapi.TopLevelResource parent , java.lang.String id ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException { com.google.gerrit.server.project.ProjectControl ctl ; try { ctl = controlFactory.controlFor ( new com.google.gerrit.reviewdb.client.Project.NameKey ( com.google.gerrit.server.util.Url.decode ( id ) ) , user.get ( ) ) ; } catch ( com.google.gerrit.server.project.NoSuchProjectException e ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( id ) ; } if ( ( ! ( ctl.isVisible ( ) ) ) && ( ! ( ctl.isOwner ( ) ) ) ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( id ) ; } return new com.google.gerrit.server.project.ProjectResource ( ctl ) ; }
Source:
public java.lang.String healthCheck ( com.googlesource.gerrit.plugins.its.jira.Check check ) throws java.io.IOException { return execute ( ( ) -> { if ( check.equals ( Check.ACCESS ) ) { return client ( ) . healthCheckAccess ( ) ; } return client ( ) . healthCheckSysinfo ( ) ; } ) ; }

Target:
public java.lang.String healthCheck ( com.googlesource.gerrit.plugins.its.jira.Check check ) throws java.io.IOException { return execute ( ( ) -> { if ( check.equals ( Check.ACCESS ) ) { return jiraClient.healthCheckAccess ( ) ; } return jiraClient.healthCheckSysinfo ( ) ; } ) ; }
Source:
public boolean equals ( java.lang.Object other ) { if ( other == null ) { return false ; } return ( ( getClass ( ) ) == ( other.getClass ( ) ) ) && ( getChildren ( ) . equals ( ( ( com.google.gerrit.server.query.Predicate < ? > ) ( other ) ) . getChildren ( ) ) ) ; }

Target:
public boolean equals ( java.lang.Object other ) { if ( other == null ) { return false ; } return ( ( getClass ( ) ) == ( other.getClass ( ) ) ) && ( getChildren ( ) . equals ( ( ( com.google.gerrit.index.query.Predicate < ? > ) ( other ) ) . getChildren ( ) ) ) ; }
Source:
private com.google.gerrit.extensions.common.SubmitType getSubmitType ( com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.server.query.change.ChangeData cd ) throws com.google.gwtorm.server.OrmException { try { final com.google.gerrit.common.data.SubmitTypeRecord r = args.changeControlGenericFactory.controlFor ( change , args.userFactory.create ( change.getOwner ( ) ) ) . getSubmitTypeRecord ( db.get ( ) , cd.currentPatchSet ( ) , cd ) ; if ( ( r.status ) != ( SubmitTypeRecord.Status.OK ) ) { return null ; } return r.type ; } catch ( com.google.gerrit.server.project.NoSuchChangeException e ) { return null ; } }

Target:
private com.google.gerrit.extensions.common.SubmitType getSubmitType ( com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.server.query.change.ChangeData cd ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.common.data.SubmitTypeRecord r = new com.google.gerrit.server.project.SubmitRuleEvaluator ( cd ) . getSubmitType ( ) ; if ( ( r.status ) != ( SubmitTypeRecord.Status.OK ) ) { return null ; } return r.type ; }
Source:
private void enableForm ( final boolean canModifyAgreements , final boolean canModifyDescription , final boolean canModifyMergeType , final boolean canModifyState ) { submitType.setEnabled ( canModifyMergeType ) ; state.setEnabled ( canModifyState ) ; contentMerge.setEnabled ( canModifyMergeType ) ; descTxt.setEnabled ( canModifyDescription ) ; contributorAgreements.setEnabled ( canModifyAgreements ) ; signedOffBy.setEnabled ( canModifyAgreements ) ; requireChangeID.setEnabled ( canModifyMergeType ) ; }

Target:
private void enableForm ( final boolean canModifyAgreements , final boolean canModifyDescription , final boolean canModifyMergeType , final boolean canModifyState , final boolean canModifyMaxObjectSizeLimit ) { submitType.setEnabled ( canModifyMergeType ) ; state.setEnabled ( canModifyState ) ; contentMerge.setEnabled ( canModifyMergeType ) ; descTxt.setEnabled ( canModifyDescription ) ; contributorAgreements.setEnabled ( canModifyAgreements ) ; signedOffBy.setEnabled ( canModifyAgreements ) ; requireChangeID.setEnabled ( canModifyMergeType ) ; maxObjectSizeLimit.setEnabled ( canModifyMaxObjectSizeLimit ) ; }
Source:
public java.lang.Object apply ( com.google.gerrit.server.group.GroupResource resource ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException { com.google.gerrit.reviewdb.client.AccountGroup group = resource.toAccountGroup ( ) ; if ( group == null ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( ) ; } try { com.google.gerrit.server.account.GroupControl c = controlFactory.validateFor ( group.getOwnerGroupUUID ( ) ) ; return new com.google.gerrit.server.group.GroupInfo ( c.getGroup ( ) ) ; } catch ( com.google.gerrit.common.errors.NoSuchGroupException e ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( ) ; } }

Target:
public com.google.gerrit.server.group.GroupJson.GroupInfo apply ( com.google.gerrit.server.group.GroupResource resource ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException { com.google.gerrit.reviewdb.client.AccountGroup group = resource.toAccountGroup ( ) ; if ( group == null ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( ) ; } try { com.google.gerrit.server.account.GroupControl c = controlFactory.validateFor ( group.getOwnerGroupUUID ( ) ) ; return json.format ( c.getGroup ( ) ) ; } catch ( com.google.gerrit.common.errors.NoSuchGroupException e ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( ) ; } }
Source:
private PatchSet.Id parsePatchSetId ( org.eclipse.jgit.revwalk.RevCommit commit ) throws org.eclipse.jgit.errors.ConfigInvalidException { java.lang.String psIdLine = parseExactlyOneFooter ( commit , com.google.gerrit.server.notedb.ChangeNoteUtil.FOOTER_PATCH_SET ) ; int s = psIdLine.indexOf ( ' ' ) ; java.lang.String psIdStr = ( s < 0 ) ? psIdLine : psIdLine.substring ( 0 , s ) ; java.lang.Integer psId = com.google.common.primitives.Ints.tryParse ( psIdStr ) ; if ( psId == null ) { throw invalidFooter ( com.google.gerrit.server.notedb.ChangeNoteUtil.FOOTER_PATCH_SET , psIdStr ) ; } return new com.google.gerrit.reviewdb.client.PatchSet.Id ( id , psId ) ; }

Target:
private PatchSet.Id parsePatchSetId ( com.google.gerrit.server.notedb.ChangeNotesCommit commit ) throws org.eclipse.jgit.errors.ConfigInvalidException { java.lang.String psIdLine = parseExactlyOneFooter ( commit , com.google.gerrit.server.notedb.ChangeNoteUtil.FOOTER_PATCH_SET ) ; int s = psIdLine.indexOf ( ' ' ) ; java.lang.String psIdStr = ( s < 0 ) ? psIdLine : psIdLine.substring ( 0 , s ) ; java.lang.Integer psId = com.google.common.primitives.Ints.tryParse ( psIdStr ) ; if ( psId == null ) { throw invalidFooter ( com.google.gerrit.server.notedb.ChangeNoteUtil.FOOTER_PATCH_SET , psIdStr ) ; } return new com.google.gerrit.reviewdb.client.PatchSet.Id ( id , psId ) ; }
Source:
protected void onLoad ( ) { super . onLoad ( ) ; com.google.gerrit.client.rpc.CallbackGroup cbs = new com.google.gerrit.client.rpc.CallbackGroup ( ) ; Util.DETAIL_SVC.patchSetPublishDetail ( patchSetId , cbs.addGwtjsonrpc ( new com.google.gerrit.client.rpc.ScreenLoadCallback < com.google.gerrit.common.data.PatchSetPublishDetail > ( this ) { @ java.lang.Override protected void preDisplay ( final com.google.gerrit.common.data.PatchSetPublishDetail result ) { send.setEnabled ( true ) ; display ( result ) ; } @ java.lang.Override protected void postDisplay ( ) { message.setFocus ( true ) ; } } ) ) ; }

Target:
public void onSuccess ( com.google.gerrit.client.changes.ChangeInfo result ) { result.init ( ) ; change = result ; }
Source:
public void normalize ( final com.google.gerrit.client.reviewdb.Project.Id projectId , final java.util.Collection < com.google.gerrit.client.reviewdb.ChangeApproval > approvals , final com.google.gwtorm.client.Transaction txn ) throws com.google.gwtorm.client.OrmException { final java.util.Map < com.google.gerrit.client.reviewdb.ApprovalCategory.Id , java.util.Collection < com.google.gerrit.client.reviewdb.ProjectRight > > rights ; rights = loadRights ( projectId ) ; for ( final com.google.gerrit.client.reviewdb.ChangeApproval a : approvals ) { if ( normalize ( rights , a ) ) { db.changeApprovals ( ) . update ( java.util.Collections.singleton ( a ) , txn ) ; } } }

Target:
public void normalize ( final com.google.gerrit.client.data.ProjectCache.Entry project , final java.util.Collection < com.google.gerrit.client.reviewdb.ChangeApproval > approvals , final com.google.gwtorm.client.Transaction txn ) throws com.google.gwtorm.client.OrmException { final java.util.Map < com.google.gerrit.client.reviewdb.ApprovalCategory.Id , java.util.Collection < com.google.gerrit.client.reviewdb.ProjectRight > > rights ; rights = loadRights ( project ) ; for ( final com.google.gerrit.client.reviewdb.ChangeApproval a : approvals ) { if ( normalize ( rights , a ) ) { db.changeApprovals ( ) . update ( java.util.Collections.singleton ( a ) , txn ) ; } } }
Source:
public void testGcWithoutCapability_Error ( ) throws java.lang.Exception { com.google.gerrit.acceptance.SshSession s = new com.google.gerrit.acceptance.SshSession ( server , user ) ; s.exec ( "gerrit gc --all" ) ; assertError ( ( "One of the following capabilities is required to access this" + " resource: [runGC, maintainServer]" ) , s.getError ( ) ) ; s.close ( ) ; }

Target:
public void testGcWithoutCapability_Error ( ) throws java.lang.Exception { com.google.gerrit.acceptance.SshSession s = new com.google.gerrit.acceptance.SshSession ( server , user ) ; s.exec ( "gerrit gc --all" ) ; com.google.common.truth.Truth.assertThat ( s.hasError ( ) ) . isTrue ( ) ; java.lang.String error = s.getError ( ) ; com.google.common.truth.Truth.assertThat ( error ) . isNotNull ( ) ; assertError ( ( "One of the following capabilities is required to access this" + " resource: [runGC, maintainServer]" ) , error ) ; s.close ( ) ; }
Source:
void setLineLength ( int columns ) { columnMarginA.getStyle ( ) . setMarginLeft ( ( ( columns * ( cmA.defaultCharWidth ( ) ) ) + ( cmA.getGutterElement ( ) . getOffsetWidth ( ) ) ) , Unit.PX ) ; columnMarginB.getStyle ( ) . setMarginLeft ( ( ( columns * ( cmB.defaultCharWidth ( ) ) ) + ( cmB.getGutterElement ( ) . getOffsetWidth ( ) ) ) , Unit.PX ) ; }

Target:
void syncScroll ( com.google.gerrit.client.diff.DisplaySide masterSide ) { if ( ( scrollSynchronizer ) != null ) { scrollSynchronizer.syncScroll ( masterSide ) ; } }
Source:
public static void display ( final com.google.gerrit.client.ui.Screen view ) { if ( ( view.isRequiresSignIn ( ) ) && ( ! ( com.google.gerrit.client.Gerrit.isSignedIn ( ) ) ) ) { com.google.gerrit.client.Gerrit.doSignIn ( ) ; } else { com.google.gerrit.client.Gerrit.body.setView ( view ) ; } }

Target:
public static void display ( final java.lang.String token , final com.google.gerrit.client.ui.Screen view ) { if ( ( view.isRequiresSignIn ( ) ) && ( ! ( com.google.gerrit.client.Gerrit.isSignedIn ( ) ) ) ) { com.google.gerrit.client.Gerrit.doSignIn ( token ) ; } else { view.setToken ( token ) ; com.google.gerrit.client.Gerrit.body.setView ( view ) ; } }
Source:
public java.lang.String apply ( com.google.gerrit.server.project.ProjectResource rsrc , com.googlesource.gerrit.plugins.cookbook.HelloProjectAction.Input input ) { final java.lang.String greeting = ( input.french ) ? "Bonjour" : "Hello" ; return java.lang.String.format ( "%s %s from project %s!" , greeting , ( com.google.common.base.Strings.isNullOrEmpty ( input.message ) ? com.google.common.base.Objects.firstNonNull ( user.get ( ) . getUserName ( ) , "world" ) : input.message ) , rsrc.getName ( ) ) ; }

Target:
public java.lang.String apply ( com.google.gerrit.server.project.ProjectResource rsrc , com.googlesource.gerrit.plugins.cookbook.HelloProjectAction.Input input ) { final java.lang.String greeting = ( input.french ) ? "Bonjour" : "Hello" ; return java.lang.String.format ( "%s %s from project %s!" , greeting , ( com.google.common.base.Strings.isNullOrEmpty ( input.message ) ? com.google.common.base.MoreObjects.firstNonNull ( user.get ( ) . getUserName ( ) , "world" ) : input.message ) , rsrc.getName ( ) ) ; }
Source:
public void run ( ) { if ( cm.hasVimSearchHighlight ( ) ) { net.codemirror.lib.CodeMirror.handleVimKey ( cm , "n" ) ; } else { diffChunkNav ( cm , false ) . run ( ) ; } }

Target:
public void run ( ) { if ( ( cm.hasActiveLine ( ) ) && ( ( toLeft && ( cm == ( cmB ) ) ) || ( ( ! toLeft ) && ( cm == ( cmA ) ) ) ) ) { net.codemirror.lib.CodeMirror other = otherCm ( cm ) ; other.setCursor ( net.codemirror.lib.LineCharacter.create ( mapper.lineOnOther ( getSideFromCm ( cm ) , cm.getLineNumber ( cm.getActiveLine ( ) ) ) . getLine ( ) ) ) ; other.focus ( ) ; } }
Source:
private static java.lang.String getDriverFromUrl ( java.lang.String url ) { if ( url.contains ( com.google.gerrit.server.schema.JdbcAccountPatchReviewStore.POSTGRESQL ) ) { return "org.postgresql.Driver" ; } if ( url.contains ( com.google.gerrit.server.schema.JdbcAccountPatchReviewStore.MYSQL ) ) { return "com.mysql.cj.jdbc.Driver" ; } if ( url.contains ( com.google.gerrit.server.schema.JdbcAccountPatchReviewStore.MARIADB ) ) { return "org.mariadb.jdbc.Driver" ; } return "org.h2.Driver" ; }

Target:
private static java.lang.String getDriverFromUrl ( java.lang.String url ) { if ( url.contains ( com.google.gerrit.server.schema.JdbcAccountPatchReviewStore.POSTGRESQL ) ) { return "org.postgresql.Driver" ; } if ( url.contains ( com.google.gerrit.server.schema.JdbcAccountPatchReviewStore.MYSQL ) ) { return "com.mysql.jdbc.Driver" ; } if ( url.contains ( com.google.gerrit.server.schema.JdbcAccountPatchReviewStore.MARIADB ) ) { return "org.mariadb.jdbc.Driver" ; } return "org.h2.Driver" ; }
Source:
protected void onLoad ( ) { super . onLoad ( ) ; Util.ACCOUNT_SVC.myAccount ( new com.google.gerrit.client.rpc.ScreenLoadCallback < com.google.gerrit.reviewdb.client.Account > ( this ) { public void preDisplay ( final com.google.gerrit.reviewdb.client.Account result ) { display ( result.getGeneralPreferences ( ) ) ; } } ) ; }

Target:
protected void onLoad ( ) { super . onLoad ( ) ; com.google.gerrit.client.account.AccountApi.self ( ) . view ( "preferences" ) . get ( new com.google.gerrit.client.rpc.ScreenLoadCallback < com.google.gerrit.client.account.Preferences > ( this ) { @ java.lang.Override public void preDisplay ( com.google.gerrit.client.account.Preferences prefs ) { display ( prefs ) ; } } ) ; }