auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void testPushWithoutChangeId ( ) throws java.lang.Exception { org.eclipse.jgit.revwalk.RevCommit c = com.google.gerrit.acceptance.git.AbstractPushForReview.createCommit ( testRepo , "Message without Change-Id" ) ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.acceptance.GitUtil.getChangeId ( testRepo , c ) . isPresent ( ) ) . isFalse ( ) ; com.google.gerrit.acceptance.git.AbstractPushForReview.pushForReviewRejected ( testRepo , "missing Change-Id in commit message footer" ) ; com.google.gerrit.server.git.ProjectConfig config = projectCache.checkedGet ( project ) . getConfig ( ) ; config.getProject ( ) . setRequireChangeID ( InheritableBoolean.FALSE ) ; saveProjectConfig ( project , config ) ; com.google.gerrit.acceptance.git.AbstractPushForReview.pushForReviewOk ( testRepo ) ; }

Target:
private void testPushWithoutChangeId ( ) throws java.lang.Exception { org.eclipse.jgit.revwalk.RevCommit c = com.google.gerrit.acceptance.git.AbstractPushForReview.createCommit ( testRepo , "Message without Change-Id" ) ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.acceptance.GitUtil.getChangeId ( testRepo , c ) . isPresent ( ) ) . isFalse ( ) ; com.google.gerrit.acceptance.git.AbstractPushForReview.pushForReviewRejected ( testRepo , "missing Change-Id in commit message footer" ) ; setRequireChangeId ( InheritableBoolean.FALSE ) ; com.google.gerrit.acceptance.git.AbstractPushForReview.pushForReviewOk ( testRepo ) ; }
Source:
protected void configure ( ) { cache ( com.googlesource.gerrit.plugins.uploadvalidator.BlockedKeywordValidator.CACHE_NAME , java.lang.String.class , java.util.regex.Pattern.class ) . loader ( com.googlesource.gerrit.plugins.uploadvalidator.BlockedKeywordValidator.Loader.class ) ; }

Target:
protected void configure ( ) { com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.server.git.validators.CommitValidationListener.class ) . to ( com.googlesource.gerrit.plugins.uploadvalidator.BlockedKeywordValidator.class ) ; bind ( com.google.gerrit.server.config.ProjectConfigEntry.class ) . annotatedWith ( com.google.gerrit.extensions.annotations.Exports.named ( com.googlesource.gerrit.plugins.uploadvalidator.BlockedKeywordValidator.KEY_CHECK_BLOCKED_KEYWORD_PATTERN ) ) . toInstance ( new com.google.gerrit.server.config.ProjectConfigEntry ( "Blocked Keyword Pattern" , null , ProjectConfigEntry.Type.ARRAY , null , false , ( "Pushes of commits that contain files with blocked keywords " + "will be rejected." ) ) ) ; }
Source:
public void index ( com.google.gerrit.server.query.change.ChangeData cd ) throws java.io.IOException { try { indexTask ( cd ) . call ( ) ; } catch ( java.lang.RuntimeException e ) { throw e ; } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.index.ChangeIndexer.MAPPER.apply ( e ) ; } }

Target:
public void delete ( com.google.gerrit.server.query.change.ChangeData cd ) throws java.io.IOException { try { new com.google.gerrit.server.index.ChangeIndexer.Task ( cd , true ) . call ( ) ; } catch ( java.lang.RuntimeException e ) { throw e ; } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.index.ChangeIndexer.MAPPER.apply ( e ) ; } }
Source:
private com.google.gerrit.server.git.strategy.SubmitStrategy createStrategy ( com.google.gerrit.server.git.MergeOpRepoManager.OpenRepo or , com.google.gerrit.server.git.MergeTip mergeTip , com.google.gerrit.reviewdb.client.Branch.NameKey destBranch , com.google.gerrit.extensions.client.SubmitType submitType , com.google.gerrit.server.git.CodeReviewCommit branchTip ) throws com.google.gerrit.server.git.IntegrationException { return submitStrategyFactory.create ( submitType , db , or.repo , or.rw , or.ins , or.canMergeFlag , getAlreadyAccepted ( or , branchTip ) , destBranch , caller , mergeTip , commits , submissionId , submitInput.notify ) ; }

Target:
private com.google.gerrit.server.git.strategy.SubmitStrategy createStrategy ( com.google.gerrit.server.git.MergeOpRepoManager.OpenRepo or , com.google.gerrit.server.git.MergeTip mergeTip , com.google.gerrit.reviewdb.client.Branch.NameKey destBranch , com.google.gerrit.extensions.client.SubmitType submitType , com.google.gerrit.server.git.CodeReviewCommit branchTip , com.google.gerrit.server.git.SubmoduleOp submoduleOp ) throws com.google.gerrit.server.git.IntegrationException { return submitStrategyFactory.create ( submitType , db , or.repo , or.rw , or.ins , or.canMergeFlag , getAlreadyAccepted ( or , branchTip ) , destBranch , caller , mergeTip , commits , submissionId , submitInput.notify , submoduleOp ) ; }
Source:
public com.google.gerrit.server.notedb.ChangeNotes create ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Project.NameKey project , com.google.gerrit.reviewdb.client.Change.Id changeId ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.Change change = com.google.gerrit.server.notedb.ChangeNotes.unwrap ( db ) . changes ( ) . get ( changeId ) ; com.google.common.base.Preconditions.checkNotNull ( change , "change %s not found in ReviewDb" , changeId ) ; com.google.common.base.Preconditions.checkArgument ( change.getProject ( ) . equals ( project ) , ( "passed project %s when creating ChangeNotes for %s, but actual" + " project is %s" ) , project , changeId , change.getProject ( ) ) ; return new com.google.gerrit.server.notedb.ChangeNotes ( args , change ) . load ( ) ; }

Target:
public com.google.gerrit.server.notedb.ChangeNotes create ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Project.NameKey project , com.google.gerrit.reviewdb.client.Change.Id changeId ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.Change change = com.google.gerrit.reviewdb.server.ReviewDbUtil.unwrapDb ( db ) . changes ( ) . get ( changeId ) ; com.google.common.base.Preconditions.checkNotNull ( change , "change %s not found in ReviewDb" , changeId ) ; com.google.common.base.Preconditions.checkArgument ( change.getProject ( ) . equals ( project ) , ( "passed project %s when creating ChangeNotes for %s, but actual" + " project is %s" ) , project , changeId , change.getProject ( ) ) ; return new com.google.gerrit.server.notedb.ChangeNotes ( args , change ) . load ( ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { com.google.gerrit.server.git.ProjectConfig cfg = projectCache.checkedGet ( allProjects ) . getConfig ( ) ; codeReview = com.google.common.base.Preconditions.checkNotNull ( cfg.getLabelSections ( ) . get ( "Code-Review" ) ) ; codeReview.setDefaultValue ( ( ( short ) ( - 1 ) ) ) ; saveProjectConfig ( cfg ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { com.google.gerrit.server.git.ProjectConfig cfg = projectCache.checkedGet ( project ) . getConfig ( ) ; codeReview = com.google.gerrit.server.project.Util.codeReview ( ) ; codeReview.setDefaultValue ( ( ( short ) ( - 1 ) ) ) ; cfg.getLabelSections ( ) . put ( codeReview.getName ( ) , codeReview ) ; saveProjectConfig ( cfg ) ; }
Source:
public com.google.gerrit.server.git.BatchUpdate insertChange ( com.google.gerrit.server.git.BatchUpdate.InsertChangeOp op ) { com.google.gerrit.reviewdb.client.Change c = op.getChange ( ) ; com.google.common.base.Preconditions.checkArgument ( ( ! ( newChanges.containsKey ( c.getId ( ) ) ) ) , "only one op allowed to create change %s" , c.getId ( ) ) ; newChanges.put ( c.getId ( ) , c ) ; ops.get ( c.getId ( ) ) . add ( 0 , op ) ; return this ; }

Target:
public com.google.gerrit.server.git.BatchUpdate insertChange ( com.google.gerrit.server.git.BatchUpdate.InsertChangeOp op ) { com.google.gerrit.server.git.BatchUpdate.Context ctx = new com.google.gerrit.server.git.BatchUpdate.Context ( ) ; com.google.gerrit.reviewdb.client.Change c = op.createChange ( ctx ) ; com.google.common.base.Preconditions.checkArgument ( ( ! ( newChanges.containsKey ( c.getId ( ) ) ) ) , "only one op allowed to create change %s" , c.getId ( ) ) ; newChanges.put ( c.getId ( ) , c ) ; ops.get ( c.getId ( ) ) . add ( 0 , op ) ; return this ; }
Source:
public java.util.Map < java.lang.String , com.google.gerrit.extensions.common.ActionInfo > format ( com.google.gerrit.server.change.RevisionResource rsrc ) { return toActionMap ( rsrc ) ; }

Target:
public java.util.Map < java.lang.String , com.google.gerrit.extensions.common.ActionInfo > format ( com.google.gerrit.server.change.RevisionResource rsrc ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.extensions.common.ChangeInfo changeInfo = null ; com.google.gerrit.extensions.common.RevisionInfo revisionInfo = null ; java.util.List < com.google.gerrit.extensions.api.changes.ActionVisitor > visitors = visitors ( ) ; if ( ! ( visitors.isEmpty ( ) ) ) { changeInfo = changeJson ( ) . format ( rsrc ) ; revisionInfo = com.google.common.base.Preconditions.checkNotNull ( com.google.common.collect.Iterables.getOnlyElement ( changeInfo.revisions.values ( ) ) ) ; changeInfo.revisions = null ; } return toActionMap ( rsrc , visitors , changeInfo , revisionInfo ) ; }
Source:
private static byte [ ] message ( org.eclipse.jetty.server.AbstractHttpConnection conn ) { java.lang.String msg = conn.getResponse ( ) . getReason ( ) ; if ( msg == null ) { msg = org.eclipse.jetty.http.HttpStatus.getMessage ( conn.getResponse ( ) . getStatus ( ) ) ; } return msg.getBytes ( com.google.common.base.Charsets.ISO_8859_1 ) ; }

Target:
private static byte [ ] message ( org.eclipse.jetty.server.HttpConnection conn ) { java.lang.String msg = conn.getHttpChannel ( ) . getResponse ( ) . getReason ( ) ; if ( msg == null ) { msg = org.eclipse.jetty.http.HttpStatus.getMessage ( conn.getHttpChannel ( ) . getResponse ( ) . getStatus ( ) ) ; } return msg.getBytes ( com.google.common.base.Charsets.ISO_8859_1 ) ; }
Source:
void display ( java.lang.String token ) { assert token != null ; try { try { if ( token.startsWith ( com.google.gerrit.client.Dispatcher.RELOAD_UI ) ) { com.google.gerrit.client.Dispatcher.wasStartedByReloadUI = true ; token = com.google.gerrit.client.Dispatcher.skip ( com.google.gerrit.client.Dispatcher.RELOAD_UI , token ) ; } com.google.gerrit.client.Dispatcher.select ( token ) ; } finally { com.google.gerrit.client.Dispatcher.wasStartedByReloadUI = false ; } } catch ( java.lang.RuntimeException err ) { com.google.gwt.core.client.GWT.log ( ( "Error parsing history token: " + token ) , err ) ; com.google.gerrit.client.Gerrit.display ( token , new com.google.gerrit.client.NotFoundScreen ( ) ) ; } }

Target:
void display ( java.lang.String token ) { assert token != null ; try { try { if ( com.google.gerrit.client.Dispatcher.matchPrefix ( com.google.gerrit.client.Dispatcher.RELOAD_UI , token ) ) { com.google.gerrit.client.Dispatcher.wasStartedByReloadUI = true ; token = com.google.gerrit.client.Dispatcher.skip ( token ) ; } com.google.gerrit.client.Dispatcher.select ( token ) ; } finally { com.google.gerrit.client.Dispatcher.wasStartedByReloadUI = false ; } } catch ( java.lang.RuntimeException err ) { com.google.gwt.core.client.GWT.log ( ( "Error parsing history token: " + token ) , err ) ; com.google.gerrit.client.Gerrit.display ( token , new com.google.gerrit.client.NotFoundScreen ( ) ) ; } }
Source:
protected boolean shouldSendMessage ( ) { if ( ( body.length ( ) ) == 0 ) { return false ; } if ( rcptTo.isEmpty ( ) ) { return false ; } if ( ( ( rcptTo.size ( ) ) == 1 ) && ( rcptTo.contains ( fromId ) ) ) { return false ; } return true ; }

Target:
protected boolean shouldSendMessage ( ) { if ( ( body.length ( ) ) == 0 ) { return false ; } if ( smtpRcptTo.isEmpty ( ) ) { return false ; } if ( ( ( rcptTo.size ( ) ) == 1 ) && ( rcptTo.contains ( fromId ) ) ) { return false ; } return true ; }
Source:
private void onSuccess ( final com.google.gerrit.client.account.SignInResult result ) { com.google.gerrit.client.Gerrit.postSignIn ( result.getAccount ( ) ) ; hide ( ) ; final com.google.gwt.user.client.rpc.AsyncCallback < ? > ac = appCallback ; if ( ac != null ) { com.google.gwt.user.client.DeferredCommand.addCommand ( new com.google.gwt.user.client.Command ( ) { public void execute ( ) { ac.onSuccess ( null ) ; } } ) ; } }

Target:
public void onFailure ( final java.lang.Throwable caught ) { hide ( ) ; super . onFailure ( caught ) ; }
Source:
public com.google.gerrit.reviewdb.client.Change update ( com.google.gerrit.reviewdb.client.Change change ) { java.lang.String currNoteDbState = change.getNoteDbState ( ) ; if ( java.util.Objects.equals ( currNoteDbState , newNoteDbState ) ) { throw new com.google.gerrit.server.notedb.rebuild.ChangeRebuilderImpl.AbortUpdateException ( ) ; } else if ( ! ( java.util.Objects.equals ( oldNoteDbState , currNoteDbState ) ) ) { throw new com.google.gerrit.server.notedb.rebuild.ChangeRebuilderImpl.ConflictingUpdateException ( change , oldNoteDbState ) ; } change.setNoteDbState ( newNoteDbState ) ; return change ; }

Target:
public com.google.gerrit.reviewdb.client.Change update ( com.google.gerrit.reviewdb.client.Change change ) { java.lang.String currNoteDbState = change.getNoteDbState ( ) ; if ( java.util.Objects.equals ( currNoteDbState , newNoteDbState ) ) { throw new com.google.gerrit.server.notedb.rebuild.AbortUpdateException ( ) ; } else if ( ! ( java.util.Objects.equals ( oldNoteDbState , currNoteDbState ) ) ) { throw new com.google.gerrit.server.notedb.rebuild.ConflictingUpdateException ( change , oldNoteDbState ) ; } change.setNoteDbState ( newNoteDbState ) ; return change ; }
Source:
public void onSuccess ( com.googlesource.gerrit.plugins.serviceuser.client.MessagesInfo info ) { onSuccessMessage = info.getOnSuccessMessage ( ) ; java.lang.String infoMessage = info.getInfoMessage ( ) ; if ( ( infoMessage != null ) && ( ! ( "" . equals ( infoMessage ) ) ) ) { insert ( new com.google.gwt.user.client.ui.HTML ( infoMessage ) , 0 ) ; } }

Target:
public void execute ( ) { if ( ( getValue ( ) . trim ( ) . length ( ) ) != 0 ) { setEnabled ( true ) ; } }
Source:
public void addGroupMember ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.AccountGroup.NameKey groupName , com.google.gerrit.reviewdb.client.Account.Id accountId ) throws com.google.gwtorm.server.OrmException , java.io.IOException { java.util.Optional < com.google.gerrit.reviewdb.client.AccountGroup > foundGroup = groups.get ( db , groupName ) ; if ( ! ( foundGroup.isPresent ( ) ) ) { return ; } com.google.gerrit.reviewdb.client.AccountGroup group = foundGroup.get ( ) ; addGroupMembers ( db , group , com.google.common.collect.ImmutableSet.of ( accountId ) ) ; }

Target:
public void setCurrentUser ( @ com.google.gerrit.common.Nullable com.google.gerrit.server.IdentifiedUser currentUser ) { this . currentUser = currentUser ; setCommitterIdent ( currentUser ) ; }
Source:
private boolean canAbandon ( com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { return ( ( ( ( ( isOwner ( ) ) || ( getRefControl ( ) . isOwner ( ) ) ) || ( getProjectControl ( ) . isOwner ( ) ) ) || ( getUser ( ) . getCapabilities ( ) . isAdmin_DoNotUse ( ) ) ) || ( getRefControl ( ) . canAbandon ( ) ) ) && ( ! ( isPatchSetLocked ( db ) ) ) ; }

Target:
private boolean canAbandon ( com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { return ( ( ( ( ( isOwner ( ) ) || ( getRefControl ( ) . isOwner ( ) ) ) || ( getProjectControl ( ) . isOwner ( ) ) ) || ( getRefControl ( ) . canAbandon ( ) ) ) || ( getProjectControl ( ) . isAdmin ( ) ) ) && ( ! ( isPatchSetLocked ( db ) ) ) ; }
Source:
private com.google.gerrit.server.change.GetRelated.ChangeAndCommit changeAndCommit ( com.google.gerrit.reviewdb.client.PatchSet.Id psId , org.eclipse.jgit.lib.ObjectId commitId , int currentRevisionNum ) { com.google.gerrit.server.change.GetRelated.ChangeAndCommit result = new com.google.gerrit.server.change.GetRelated.ChangeAndCommit ( ) ; result.project = project.get ( ) ; result._changeNumber = psId.getParentKey ( ) . get ( ) ; result.commit = new com.google.gerrit.extensions.common.CommitInfo ( ) ; result.commit.commit = commitId.name ( ) ; result._revisionNumber = psId.get ( ) ; result._currentRevisionNumber = currentRevisionNum ; result.status = "NEW" ; return result ; }

Target:
private com.google.gerrit.server.restapi.change.GetRelated.ChangeAndCommit changeAndCommit ( com.google.gerrit.reviewdb.client.PatchSet.Id psId , org.eclipse.jgit.lib.ObjectId commitId , int currentRevisionNum ) { com.google.gerrit.server.restapi.change.GetRelated.ChangeAndCommit result = new com.google.gerrit.server.restapi.change.GetRelated.ChangeAndCommit ( ) ; result.project = project.get ( ) ; result._changeNumber = psId.getParentKey ( ) . get ( ) ; result.commit = new com.google.gerrit.extensions.common.CommitInfo ( ) ; result.commit.commit = commitId.name ( ) ; result._revisionNumber = psId.get ( ) ; result._currentRevisionNumber = currentRevisionNum ; result.status = "NEW" ; return result ; }
Source:
private void initDatabase ( ) throws com.google.gwtorm.server.OrmException { try { javax.sql.DataSource dataSource = com.google.gerrit.testutil.InMemoryDatabase.newDataSource ( ) ; openHandle = dataSource.getConnection ( ) ; database = new com.google.gwtorm.jdbc.Database ( dataSource , com.google.gerrit.reviewdb.server.ReviewDb.class ) ; } catch ( java.sql.SQLException e ) { throw new com.google.gwtorm.server.OrmException ( e ) ; } }

Target:
private void initDatabase ( ) throws com.google.gwtorm.server.OrmException { try { javax.sql.DataSource dataSource = com.google.gerrit.testing.InMemoryDatabase.newDataSource ( ) ; openHandle = dataSource.getConnection ( ) ; database = new com.google.gwtorm.jdbc.Database ( dataSource , com.google.gerrit.reviewdb.server.ReviewDb.class ) ; } catch ( java.sql.SQLException e ) { throw new com.google.gwtorm.server.OrmException ( e ) ; } }
Source:
public com.google.gerrit.server.change.Description getDescription ( com.google.gerrit.server.change.ChangeResource rsrc ) { return new com.google.gerrit.extensions.webui.UiAction.Description ( ) . setLabel ( "Mute" ) . setTitle ( "Mute the change to unhighlight it in the dashboard" ) . setVisible ( ( ( ! ( rsrc.isUserOwner ( ) ) ) && ( isMuteable ( rsrc ) ) ) ) ; }

Target:
private boolean isMuteable ( com.google.gerrit.server.change.ChangeResource rsrc ) { try { return ( ( ! ( rsrc.isUserOwner ( ) ) ) && ( ! ( isMuted ( rsrc ) ) ) ) && ( ! ( stars.isIgnored ( rsrc ) ) ) ; } catch ( com.google.gwtorm.server.OrmException e ) { com.google.gerrit.server.change.Mute.log.error ( "failed to check ignored star" , e ) ; } return false ; }
Source:
void onEdit ( com.google.gwt.dom.client.InputElement checkbox , int idx ) { com.google.gerrit.client.changes.ChangeFileApi.getContent ( curr , list.get ( idx ) . path ( ) , new com.google.gerrit.client.rpc.GerritCallback < java.lang.String > ( ) { @ java.lang.Override public void onSuccess ( java.lang.String result ) { com.google.gwt.user.client.Window.alert ( result ) ; } } ) ; }

Target:
void onEdit ( int idx ) { final java.lang.String path = list.get ( idx ) . path ( ) ; com.google.gerrit.client.changes.ChangeFileApi.getContent ( curr , path , new com.google.gerrit.client.rpc.GerritCallback < java.lang.String > ( ) { @ java.lang.Override public void onSuccess ( java.lang.String result ) { com.google.gerrit.client.change.EditFileAction edit = new com.google.gerrit.client.change.EditFileAction ( curr , result , path , style , editButton , replyButton ) ; edit.onEdit ( ) ; } } ) ; }
Source:
public void evictAfterRename ( final com.google.gerrit.reviewdb.client.AccountGroup.NameKey oldName , final com.google.gerrit.reviewdb.client.AccountGroup.NameKey newName ) { byName.remove ( oldName ) ; updateGroupList ( oldName , newName ) ; }

Target:
public void evictAfterRename ( final com.google.gerrit.reviewdb.client.AccountGroup.NameKey oldName , final com.google.gerrit.reviewdb.client.AccountGroup.NameKey newName ) { if ( oldName != null ) { byName.invalidate ( oldName.get ( ) ) ; } if ( newName != null ) { byName.invalidate ( newName.get ( ) ) ; } }
Source:
public void lastInGroup ( ) { if ( ! ( getItems ( ) . isEmpty ( ) ) ) { final com.google.gwt.user.client.ui.MenuItem i = getItems ( ) . get ( ( ( getItems ( ) . size ( ) ) - 1 ) ) ; i.removeStyleDependentName ( "NormalItem" ) ; i.addStyleDependentName ( "LastItem" ) ; } }

Target:
public void addItem ( final com.google.gerrit.client.ui.CommandMenuItem i ) { add ( i ) ; }
Source:
public void testInsertManyPeople ( ) throws java.lang.Exception { final com.google.gwtorm.data.PhoneBookDb schema = open ( ) ; final java.util.ArrayList < com.google.gwtorm.data.TestPerson > all = new java.util.ArrayList < com.google.gwtorm.data.TestPerson > ( ) ; all.add ( new com.google.gwtorm.data.TestPerson ( new com.google.gwtorm.data.TestPerson.Key ( "Bob" ) , 18 ) ) ; all.add ( new com.google.gwtorm.data.TestPerson ( new com.google.gwtorm.data.TestPerson.Key ( "Mary" ) , 22 ) ) ; all.add ( new com.google.gwtorm.data.TestPerson ( new com.google.gwtorm.data.TestPerson.Key ( "Zak" ) , 33 ) ) ; schema.people ( ) . insert ( all ) ; }

Target:
public void testInsertManyPeople ( ) throws java.lang.Exception { final com.google.gwtorm.data.PhoneBookDb schema = open ( ) ; final java.util.ArrayList < com.google.gwtorm.data.Person > all = new java.util.ArrayList < com.google.gwtorm.data.Person > ( ) ; all.add ( new com.google.gwtorm.data.Person ( new com.google.gwtorm.data.Person.Key ( "Bob" ) , 18 ) ) ; all.add ( new com.google.gwtorm.data.Person ( new com.google.gwtorm.data.Person.Key ( "Mary" ) , 22 ) ) ; all.add ( new com.google.gwtorm.data.Person ( new com.google.gwtorm.data.Person.Key ( "Zak" ) , 33 ) ) ; schema.people ( ) . insert ( all ) ; }
Source:
public UiAction.Description getDescription ( com.google.gerrit.server.change.ChangeResource resource ) { return new com.google.gerrit.extensions.webui.UiAction.Description ( ) . setLabel ( "Restore" ) . setTitle ( "Restore the change" ) . setVisible ( ( ( ( resource.getChange ( ) . getStatus ( ) ) == ( com.google.gerrit.reviewdb.client.Change.Status.ABANDONED ) ) && ( resource.getControl ( ) . canRestore ( ) ) ) ) ; }

Target:
public UiAction.Description getDescription ( com.google.gerrit.server.change.ChangeResource resource ) { boolean canRestore = false ; try { canRestore = resource.getControl ( ) . canRestore ( dbProvider.get ( ) ) ; } catch ( com.google.gwtorm.server.OrmException e ) { com.google.gerrit.server.change.Restore.log.error ( "Cannot check canRestore status. Assuming false." , e ) ; } return new com.google.gerrit.extensions.webui.UiAction.Description ( ) . setLabel ( "Restore" ) . setTitle ( "Restore the change" ) . setVisible ( ( ( ( resource.getChange ( ) . getStatus ( ) ) == ( com.google.gerrit.reviewdb.client.Change.Status.ABANDONED ) ) && canRestore ) ) ; }
Source:
public void setReviewed ( java.lang.String path , boolean reviewed ) throws com.google.gerrit.extensions.restapi.RestApiException { try { com.google.gerrit.extensions.restapi.RestModifyView < com.google.gerrit.server.change.FileResource , com.google.gerrit.server.change.Reviewed.Input > view ; if ( reviewed ) { view = putReviewed ; } else { view = deleteReviewed ; } view.apply ( files.parse ( revision , com.google.gerrit.extensions.restapi.IdString.fromDecoded ( path ) ) , new com.google.gerrit.server.change.Reviewed.Input ( ) ) ; } catch ( java.lang.Exception e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot update reviewed flag" , e ) ; } }

Target:
public void setReviewed ( java.lang.String path , boolean reviewed ) throws com.google.gerrit.extensions.restapi.RestApiException { try { com.google.gerrit.extensions.restapi.RestModifyView < com.google.gerrit.server.change.FileResource , com.google.gerrit.server.change.Reviewed.Input > view ; if ( reviewed ) { view = putReviewed ; } else { view = deleteReviewed ; } view.apply ( files.parse ( revision , com.google.gerrit.extensions.restapi.IdString.fromDecoded ( path ) ) , new com.google.gerrit.server.change.Reviewed.Input ( ) ) ; } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( "Cannot update reviewed flag" , e ) ; } }
Source:
public com.googlesource.gerrit.plugins.verifystatus.server.GetConfig.ConfigInfo apply ( com.google.gerrit.server.config.ConfigResource resource ) { com.googlesource.gerrit.plugins.verifystatus.server.GetConfig.ConfigInfo info = new com.googlesource.gerrit.plugins.verifystatus.server.GetConfig.ConfigInfo ( ) ; info.showJobsPanel = cfg.getBoolean ( "showJobsPanel" , true ) ; info.showJobsDropDownPanel = cfg.getBoolean ( "showJobsDropDownPanel" , true ) ; info.showJobsSummaryPanel = cfg.getBoolean ( "showJobsSummaryPanel" , true ) ; info.sortJobsPanel = cfg.getEnum ( com.googlesource.gerrit.plugins.verifystatus.server.JobsSorting.values ( ) , "sortJobsPanel" , JobsSorting.REPORTER ) ; info.sortJobsDropDownPanel = cfg.getEnum ( com.googlesource.gerrit.plugins.verifystatus.server.JobsSorting.values ( ) , "sortJobsDropDownPanel" , JobsSorting.REPORTER ) ; return info ; }

Target:
public com.googlesource.gerrit.plugins.verifystatus.server.GetConfig.ConfigInfo apply ( com.google.gerrit.server.config.ConfigResource resource ) { com.googlesource.gerrit.plugins.verifystatus.server.GetConfig.ConfigInfo info = new com.googlesource.gerrit.plugins.verifystatus.server.GetConfig.ConfigInfo ( ) ; info.showJobsPanel = cfg.getBoolean ( "showJobsPanel" , true ) ; info.showJobsDropDownPanel = cfg.getBoolean ( "showJobsDropDownPanel" , true ) ; info.showJobsSummaryPanel = cfg.getBoolean ( "showJobsSummaryPanel" , true ) ; info.showJobsBelowRelatedInfoBlock = cfg.getBoolean ( "showJobsBelowRelatedInfoBlock" , false ) ; info.sortJobsPanel = cfg.getEnum ( com.googlesource.gerrit.plugins.verifystatus.server.JobsSorting.values ( ) , "sortJobsPanel" , JobsSorting.REPORTER ) ; info.sortJobsDropDownPanel = cfg.getEnum ( com.googlesource.gerrit.plugins.verifystatus.server.JobsSorting.values ( ) , "sortJobsDropDownPanel" , JobsSorting.REPORTER ) ; return info ; }
Source:
public com.google.gerrit.reviewdb.client.AccountGroup createEntry ( final com.google.gerrit.reviewdb.client.AccountGroup.Id key ) throws java.lang.Exception { final com.google.gerrit.reviewdb.server.ReviewDb db = schema.open ( ) ; try { final com.google.gerrit.reviewdb.client.AccountGroup group = db.accountGroups ( ) . get ( key ) ; if ( group != null ) { return group ; } else { return missing ( key ) ; } } finally { db.close ( ) ; } }

Target:
public com.google.common.base.Optional < com.google.gerrit.reviewdb.client.AccountGroup > load ( final com.google.gerrit.reviewdb.client.AccountGroup.Id key ) throws java.lang.Exception { final com.google.gerrit.reviewdb.server.ReviewDb db = schema.open ( ) ; try { return com.google.common.base.Optional.fromNullable ( db.accountGroups ( ) . get ( key ) ) ; } finally { db.close ( ) ; } }
Source:
public void rebaseUpToDateChange ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; gApi.changes ( ) . id ( r.getChangeId ( ) ) . revision ( r.getCommit ( ) . name ( ) ) . rebase ( ) ; }

Target:
public void rebaseUpToDateChange ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; exception.equals ( com.google.gerrit.extensions.restapi.ResourceConflictException.class ) ; exception.expectMessage ( "Change is already up to date" ) ; gApi.changes ( ) . id ( r.getChangeId ( ) ) . revision ( r.getCommit ( ) . name ( ) ) . rebase ( ) ; }
Source:
public void requestReceived ( com.github.tomakehurst.wiremock.http.Request request , com.github.tomakehurst.wiremock.http.Response response ) { if ( request.getAbsoluteUrl ( ) . contains ( expectedRequest ) ) { try { checkPoint.await ( ) ; } catch ( java.lang.InterruptedException | java.util.concurrent.BrokenBarrierException e ) { org.junit.Assert.fail ( ) ; } } }

Target:
public java.lang.String getExpectedRequest ( ) { return "/plugins/high-availability/index/change/" + ( changeId ) ; }
Source:
public java.lang.String apply ( com.google.gerrit.server.change.ChangeResource rsrc ) { com.google.gerrit.server.config.PluginConfig cfg = cfgFactory.getFromProjectConfigWithInheritance ( rsrc.getControl ( ) . getProjectControl ( ) . getProjectState ( ) , pluginName ) ; BRANCH ( c3d228 ) ; com.googlesource.gerrit.plugins.changemessage.rest.Add CSS ; to ( message ) ; return cfg.getString ( "changeInfo" ) ; }

Target:
public java.lang.String apply ( com.google.gerrit.server.change.ChangeResource rsrc ) throws com.google.gerrit.server.project.NoSuchProjectException { com.google.gerrit.server.config.PluginConfig cfg = cfgFactory.getFromProjectConfigWithInheritance ( rsrc.getProject ( ) , pluginName ) ; return cfg.getString ( "changeInfo" ) ; }
Source:
private static synchronized java.util.concurrent.ScheduledThreadPoolExecutor shutdown ( ) { final java.util.concurrent.ScheduledThreadPoolExecutor p = com.google.gerrit.git.WorkQueue.pool ; if ( p != null ) { p.shutdown ( ) ; com.google.gerrit.git.WorkQueue.pool = null ; return p ; } return null ; }

Target:
public static void terminate ( ) { for ( final com.google.gerrit.git.WorkQueue.Executor p : com.google.gerrit.git.WorkQueue.queues ) { p.shutdown ( ) ; boolean isTerminated ; do { try { isTerminated = p.awaitTermination ( 10 , java.util.concurrent.TimeUnit.SECONDS ) ; } catch ( java.lang.InterruptedException ie ) { isTerminated = false ; } } while ( ! isTerminated ) ; } com.google.gerrit.git.WorkQueue.queues.clear ( ) ; }
Source:
public com.google.common.collect.Multimap < com.google.gerrit.reviewdb.client.Branch.NameKey , com.google.gerrit.server.query.change.ChangeData > changesByBranch ( ) throws com.google.gwtorm.server.OrmException { com.google.common.collect.ListMultimap < com.google.gerrit.reviewdb.client.Branch.NameKey , com.google.gerrit.server.query.change.ChangeData > ret = com.google.common.collect.ArrayListMultimap.create ( ) ; for ( com.google.gerrit.server.query.change.ChangeData cd : changeData.values ( ) ) { ret.put ( cd.change ( ) . getDest ( ) , cd ) ; } return ret ; }

Target:
public com.google.common.collect.Multimap < com.google.gerrit.reviewdb.client.Branch.NameKey , com.google.gerrit.server.query.change.ChangeData > changesByBranch ( ) throws com.google.gwtorm.server.OrmException { com.google.common.collect.ListMultimap < com.google.gerrit.reviewdb.client.Branch.NameKey , com.google.gerrit.server.query.change.ChangeData > ret = com.google.common.collect.MultimapBuilder.hashKeys ( ) . arrayListValues ( ) . build ( ) ; for ( com.google.gerrit.server.query.change.ChangeData cd : changeData.values ( ) ) { ret.put ( cd.change ( ) . getDest ( ) , cd ) ; } return ret ; }
Source:
public com.google.gson.JsonElement serialize ( final org.eclipse.jgit.diff.Edit src , final java.lang.reflect.Type typeOfSrc , final com.google.gson.JsonSerializationContext context ) { if ( src == null ) { return new com.google.gson.JsonNull ( ) ; } final com.google.gson.JsonArray a = new com.google.gson.JsonArray ( ) ; add ( a , src ) ; if ( src instanceof org.eclipse.jgit.diff.ReplaceEdit ) { for ( org.eclipse.jgit.diff.Edit e : ( ( org.eclipse.jgit.diff.ReplaceEdit ) ( src ) ) . getInternalEdits ( ) ) { add ( a , e ) ; } } return a ; }

Target:
public com.google.gson.JsonElement serialize ( final org.eclipse.jgit.diff.Edit src , final java.lang.reflect.Type typeOfSrc , final com.google.gson.JsonSerializationContext context ) { if ( src == null ) { return com.google.gson.JsonNull.INSTANCE ; } final com.google.gson.JsonArray a = new com.google.gson.JsonArray ( ) ; add ( a , src ) ; if ( src instanceof org.eclipse.jgit.diff.ReplaceEdit ) { for ( org.eclipse.jgit.diff.Edit e : ( ( org.eclipse.jgit.diff.ReplaceEdit ) ( src ) ) . getInternalEdits ( ) ) { add ( a , e ) ; } } return a ; }
Source:
private java.lang.String changeUrl ( ) { final java.lang.StringBuilder r = new java.lang.StringBuilder ( ) ; if ( ( server.getCanonicalURL ( ) ) != null ) { r.append ( server.getCanonicalURL ( ) ) ; } else { r.append ( myUrl ) ; } r.append ( change.getChangeId ( ) ) ; return r.toString ( ) ; }

Target:
private java.lang.String changeUrl ( ) { if ( ( gerritUrl ( ) ) != null ) { final java.lang.StringBuilder r = new java.lang.StringBuilder ( ) ; r.append ( gerritUrl ( ) ) ; r.append ( change.getChangeId ( ) ) ; return r.toString ( ) ; } return null ; }
Source:
protected int getInt ( com.google.gerrit.server.config.PluginConfig cfg , java.lang.String name , int defaultValue ) { try { return cfg.getInt ( name , defaultValue ) ; } catch ( java.lang.IllegalArgumentException e ) { com.googlesource.gerrit.plugins.webhooks.Configuration.log.error ( java.lang.String.format ( "invalid value for %s; using default value %d" , name , defaultValue ) ) ; com.googlesource.gerrit.plugins.webhooks.Configuration.log.debug ( ( "Failed retrieve integer value: " + ( e.getMessage ( ) ) ) , e ) ; return defaultValue ; } }

Target:
protected int getInt ( com.google.gerrit.server.config.PluginConfig cfg , java.lang.String name , int defaultValue ) { try { return cfg.getInt ( name , defaultValue ) ; } catch ( java.lang.IllegalArgumentException e ) { logError ( name , "integer" , defaultValue , e ) ; return defaultValue ; } }
Source:
public void checkRemoveReviewer ( com.google.gerrit.server.notedb.ChangeNotes notes , com.google.gerrit.server.CurrentUser currentUser , com.google.gerrit.reviewdb.client.PatchSetApproval approval ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.server.permissions.PermissionBackendException , com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException { if ( canRemoveReviewerWithoutPermissionCheck ( notes.getChange ( ) , currentUser , approval.getAccountId ( ) , approval.getValue ( ) ) ) { return ; } permissionBackend.user ( currentUser ) . change ( notes ) . database ( dbProvider ) . check ( ChangePermission.REMOVE_REVIEWER ) ; }

Target:
private void checkRemoveReviewer ( com.google.gerrit.server.notedb.ChangeNotes notes , com.google.gerrit.server.CurrentUser currentUser , com.google.gerrit.reviewdb.client.Account.Id reviewer , int val ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.server.permissions.PermissionBackendException , com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException { if ( canRemoveReviewerWithoutPermissionCheck ( notes.getChange ( ) , currentUser , reviewer , val ) ) { return ; } permissionBackend.user ( currentUser ) . change ( notes ) . database ( dbProvider ) . check ( ChangePermission.REMOVE_REVIEWER ) ; }
Source:
protected void configure ( ) { com.google.gerrit.server.config.PluginConfig cfg = cfgFactory.getFromGerritConfig ( pluginName ) ; if ( ( cfg.getString ( InitOAuthConfig.CLIENT_ID ) ) != null ) { bind ( com.google.gerrit.extensions.auth.oauth.OAuthLoginProvider.class ) . annotatedWith ( com.google.gerrit.extensions.annotations.Exports.named ( pluginName ) ) . to ( com.googlesource.gerrit.plugins.cfoauth.CFOAuthService.class ) ; } }

Target:
protected void configure ( ) { com.google.gerrit.server.config.PluginConfig cfg = cfgFactory.getFromGerritConfig ( pluginName ) ; if ( ( cfg.getString ( InitOAuthConfig.CLIENT_ID ) ) != null ) { bind ( com.google.gerrit.extensions.auth.oauth.OAuthLoginProvider.class ) . annotatedWith ( com.google.gerrit.extensions.annotations.Exports.named ( com.googlesource.gerrit.plugins.cfoauth.OAuthModule.EXPORT_ID ) ) . to ( com.googlesource.gerrit.plugins.cfoauth.CFOAuthService.class ) ; } }
Source:
public com.google.gerrit.extensions.restapi.Response < java.lang.String > apply ( com.google.gerrit.server.change.ChangeResource rsrc , com.google.gerrit.server.change.Ignore.Input input ) throws com.google.gerrit.extensions.restapi.RestApiException { try { if ( canIgnore ( rsrc ) ) { stars.ignore ( rsrc ) ; } return com.google.gerrit.extensions.restapi.Response.ok ( "" ) ; } catch ( com.google.gerrit.server.StarredChangesUtil.MutuallyExclusiveLabelsException e ) { throw new com.google.gerrit.extensions.restapi.ResourceConflictException ( e.getMessage ( ) ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "failed to ignore change" , e ) ; } }

Target:
public com.google.gerrit.extensions.restapi.Response < java.lang.String > apply ( com.google.gerrit.server.change.ChangeResource rsrc , com.google.gerrit.server.change.Ignore.Input input ) throws com.google.gerrit.extensions.restapi.RestApiException { try { if ( rsrc.isUserOwner ( ) ) { throw new com.google.gerrit.extensions.restapi.BadRequestException ( "cannot ignore own change" ) ; } if ( ! ( isIgnored ( rsrc ) ) ) { stars.ignore ( rsrc ) ; } return com.google.gerrit.extensions.restapi.Response.ok ( "" ) ; } catch ( com.google.gerrit.server.StarredChangesUtil.MutuallyExclusiveLabelsException e ) { throw new com.google.gerrit.extensions.restapi.ResourceConflictException ( e.getMessage ( ) ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "failed to ignore change" , e ) ; } }
Source:
protected void run ( ) { loader.rescan ( true ) ; }

Target:
protected void run ( ) throws com.google.gerrit.sshd.commands.UnloggedFailure { if ( ( ( names ) == null ) || ( names.isEmpty ( ) ) ) { loader.rescan ( true ) ; } else { try { loader.reload ( names ) ; } catch ( com.google.gerrit.server.plugins.InvalidPluginException e ) { throw die ( e.getMessage ( ) ) ; } catch ( com.google.gerrit.server.plugins.PluginInstallException e ) { throw die ( e.getMessage ( ) ) ; } } }
Source:
private void parseUpdate ( final org.eclipse.jgit.transport.ReceiveCommand cmd ) { com.google.gerrit.server.project.RefControl ctl = projectControl.controlForRef ( cmd.getRefName ( ) ) ; if ( ctl.canUpdate ( ) ) { validateNewCommits ( ctl , cmd ) ; } else { com.google.gerrit.server.git.ReceiveCommits.reject ( cmd ) ; } }

Target:
private void parseUpdate ( final org.eclipse.jgit.transport.ReceiveCommand cmd ) { com.google.gerrit.server.project.RefControl ctl = projectControl.controlForRef ( cmd.getRefName ( ) ) ; if ( ctl.canUpdate ( ) ) { if ( ( com.google.gerrit.server.git.ReceiveCommits.isHead ( cmd ) ) && ( ! ( isCommit ( cmd ) ) ) ) { return ; } validateNewCommits ( ctl , cmd ) ; } else { com.google.gerrit.server.git.ReceiveCommits.reject ( cmd ) ; } }
Source:
protected void onUnload ( ) { super . onUnload ( ) ; removeKeyHandlerRegs ( ) ; if ( ( resizeHandler ) != null ) { resizeHandler.removeHandler ( ) ; resizeHandler = null ; } if ( ( cmA ) != null ) { cmA.getWrapperElement ( ) . removeFromParent ( ) ; cmA = null ; } if ( ( cmB ) != null ) { cmB.getWrapperElement ( ) . removeFromParent ( ) ; cmB = null ; } com.google.gwt.user.client.Window.enableScrolling ( true ) ; com.google.gerrit.client.Gerrit.setHeaderVisible ( true ) ; }

Target:
public void onShowView ( ) { super . onShowView ( ) ; handlers.add ( com.google.gwtexpui.user.client.UserAgent.addDialogVisibleHandler ( new com.google.gwtexpui.user.client.DialogVisibleHandler ( ) { @ java.lang.Override public void onDialogVisible ( com.google.gwtexpui.user.client.DialogVisibleEvent event ) { diffTable.getElement ( ) . getStyle ( ) . setVisibility ( ( event.isVisible ( ) ? Style.Visibility.HIDDEN : Style.Visibility.VISIBLE ) ) ; } } ) ) ; resizeCodeMirror ( ) ; com.google.gwt.user.client.Window.enableScrolling ( false ) ; cmA.setOption ( "viewportMargin" , 10 ) ; cmB.setOption ( "viewportMargin" , 10 ) ; cmB.focus ( ) ; }
Source:
public static void match ( java.lang.String match , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.groups.GroupMap > cb ) { if ( ( match == null ) || ( "" . equals ( match ) ) ) { com.google.gerrit.client.groups.GroupMap.all ( cb ) ; } else { com.google.gerrit.client.groups.GroupMap.groups ( ) . addParameter ( "m" , match ) . get ( com.google.gerrit.client.rpc.NativeMap.copyKeysIntoChildren ( cb ) ) ; } }

Target:
public static void match ( java.lang.String match , int limit , int start , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.groups.GroupMap > cb ) { com.google.gerrit.client.rpc.RestApi call = com.google.gerrit.client.groups.GroupMap.groups ( ) ; if ( match != null ) { call.addParameter ( "m" , match ) ; } if ( limit > 0 ) { call.addParameter ( "n" , limit ) ; } if ( start > 0 ) { call.addParameter ( "S" , start ) ; } call.get ( com.google.gerrit.client.rpc.NativeMap.copyKeysIntoChildren ( cb ) ) ; }
Source:
public static com.google.gerrit.client.changes.CommentInfo create ( java.lang.String path , com.google.gerrit.extensions.client.Side side , int line , com.google.gerrit.client.diff.CommentRange range ) { com.google.gerrit.client.changes.CommentInfo n = createObject ( ) . cast ( ) ; n.path ( path ) ; n.side ( side ) ; if ( range != null ) { n.line ( range.endLine ( ) ) ; n.range ( range ) ; } else if ( line > 0 ) { n.line ( line ) ; } return n ; }

Target:
public static com.google.gerrit.client.changes.CommentInfo create ( java.lang.String path , com.google.gerrit.extensions.client.Side side , int parent , int line , com.google.gerrit.client.diff.CommentRange range ) { com.google.gerrit.client.changes.CommentInfo n = createObject ( ) . cast ( ) ; n.path ( path ) ; n.side ( side ) ; n.parent ( parent ) ; if ( range != null ) { n.line ( range.endLine ( ) ) ; n.range ( range ) ; } else if ( line > 0 ) { n.line ( line ) ; } return n ; }
Source:
public boolean accept ( java.nio.file.Path entry ) throws java.io.IOException { java.lang.String name = entry.getFileName ( ) . toString ( ) ; return ( ( ( name.endsWith ( ".jar" ) ) && ( ! ( name.startsWith ( ".last_" ) ) ) ) && ( ! ( name.startsWith ( ".next_" ) ) ) ) && ( java.nio.file.Files.isRegularFile ( entry ) ) ; }

Target:
private java.util.List < java.nio.file.Path > scanJarsInPluginsDirectory ( ) { try { return com.google.gerrit.server.plugins.PluginLoader.listPlugins ( pluginsDir , ".jar" ) ; } catch ( java.io.IOException e ) { ui.message ( "WARN: Cannot list %s: %s" , pluginsDir.toAbsolutePath ( ) , e.getMessage ( ) ) ; return com.google.common.collect.ImmutableList.of ( ) ; } }
Source:
private java.lang.Object logo ( ) { if ( ( logoUrl ) == null ) { return null ; } java.lang.String url = fmt.image ( logoUrl ) ; if ( com.google.gitiles.doc.html.HtmlBuilder.isValidHttpUri ( url ) ) { return url ; } else if ( com.google.gitiles.doc.html.HtmlBuilder.isImageDataUri ( url ) ) { return com.google.template.soy.shared.restricted.Sanitizers.filterImageDataUri ( url ) ; } else { return FilterImageDataUri.INSTANCE.getInnocuousOutput ( ) ; } }

Target:
private java.lang.Object logo ( ) { if ( ( logoUrl ) == null ) { return null ; } java.lang.String url = fmt.image ( logoUrl ) ; if ( com.google.gitiles.doc.html.HtmlBuilder.isValidHttpUri ( url ) ) { return url ; } else if ( com.google.gitiles.doc.html.HtmlBuilder.isImageDataUri ( url ) ) { return com.google.template.soy.shared.restricted.Sanitizers.filterImageDataUri ( url ) ; } else { return SoyConstants.IMAGE_URI_INNOCUOUS_OUTPUT ; } }
Source:
public void testCreate_NotDirectory ( ) throws java.io.IOException { final java.io.File root = random ( ) ; try { assertTrue ( root.createNewFile ( ) ) ; try { new com.google.gerrit.server.config.SitePaths ( root ) ; fail ( "Did not throw exception" ) ; } catch ( java.io.FileNotFoundException e ) { assertEquals ( ( "Not a directory: " + ( root.getPath ( ) ) ) , e.getMessage ( ) ) ; } } finally { root.delete ( ) ; } }

Target:
public void testCreate_NotDirectory ( ) throws java.io.IOException { final java.io.File root = com.google.gerrit.server.config.SitePathsTest.random ( ) ; try { assertTrue ( root.createNewFile ( ) ) ; try { new com.google.gerrit.server.config.SitePaths ( root ) ; fail ( "Did not throw exception" ) ; } catch ( java.io.FileNotFoundException e ) { assertEquals ( ( "Not a directory: " + ( root.getPath ( ) ) ) , e.getMessage ( ) ) ; } } finally { root.delete ( ) ; } }
Source:
public static com.google.gerrit.server.notedb.ChangeBundle fromNotes ( com.google.gerrit.server.PatchLineCommentsUtil plcUtil , com.google.gerrit.server.notedb.ChangeNotes notes ) throws com.google.gwtorm.server.OrmException { return new com.google.gerrit.server.notedb.ChangeBundle ( notes.getChange ( ) , notes.getChangeMessages ( ) , notes.getPatchSets ( ) . values ( ) , notes.getApprovals ( ) . values ( ) , com.google.common.collect.Iterables.concat ( plcUtil.draftByChange ( null , notes ) , plcUtil.publishedByChange ( null , notes ) ) , com.google.gerrit.server.notedb.ChangeBundle.Source.NOTE_DB ) ; }

Target:
public static com.google.gerrit.server.notedb.ChangeBundle fromNotes ( com.google.gerrit.server.PatchLineCommentsUtil plcUtil , com.google.gerrit.server.notedb.ChangeNotes notes ) throws com.google.gwtorm.server.OrmException { return new com.google.gerrit.server.notedb.ChangeBundle ( notes.getChange ( ) , notes.getChangeMessages ( ) , notes.getPatchSets ( ) . values ( ) , notes.getApprovals ( ) . values ( ) , com.google.common.collect.Iterables.concat ( plcUtil.draftByChange ( null , notes ) , plcUtil.publishedByChange ( null , notes ) ) , notes.getReviewers ( ) , com.google.gerrit.server.notedb.ChangeBundle.Source.NOTE_DB ) ; }
Source:
protected void configureServlets ( ) { rpc ( com.google.gerrit.server.rpc.AccountServiceImpl.class ) ; rpc ( com.google.gerrit.server.rpc.AccountSecurityImpl.class ) ; rpc ( com.google.gerrit.server.rpc.GroupAdminServiceImpl.class ) ; rpc ( com.google.gerrit.server.rpc.ChangeListServiceImpl.class ) ; rpc ( com.google.gerrit.server.rpc.SuggestServiceImpl.class ) ; rpc ( com.google.gerrit.server.rpc.SystemInfoServiceImpl.class ) ; install ( new com.google.gerrit.server.rpc.changedetail.ChangeDetailModule ( ) ) ; install ( new com.google.gerrit.server.patch.PatchModule ( ) ) ; install ( new com.google.gerrit.server.rpc.project.ProjectModule ( ) ) ; }

Target:
protected void configureServlets ( ) { rpc ( com.google.gerrit.server.rpc.AccountServiceImpl.class ) ; rpc ( com.google.gerrit.server.rpc.AccountSecurityImpl.class ) ; rpc ( com.google.gerrit.server.rpc.GroupAdminServiceImpl.class ) ; rpc ( com.google.gerrit.server.rpc.ChangeListServiceImpl.class ) ; rpc ( com.google.gerrit.server.rpc.SuggestServiceImpl.class ) ; rpc ( com.google.gerrit.server.rpc.SystemInfoServiceImpl.class ) ; install ( new com.google.gerrit.server.rpc.changedetail.ChangeModule ( ) ) ; install ( new com.google.gerrit.server.patch.PatchModule ( ) ) ; install ( new com.google.gerrit.server.rpc.project.ProjectModule ( ) ) ; }
Source:
public void diff ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; com.google.gerrit.extensions.common.DiffInfo diff = gApi.changes ( ) . id ( r.getChangeId ( ) ) . revision ( r.getCommit ( ) . name ( ) ) . file ( com.google.gerrit.acceptance.PushOneCommit.FILE_NAME ) . diff ( ) ; com.google.common.truth.Truth.assertThat ( diff.metaA ) . isNull ( ) ; com.google.common.truth.Truth.assertThat ( diff.metaB.lines ) . isEqualTo ( 1 ) ; }

Target:
public void diff ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; assertDiffForNewFile ( r , com.google.gerrit.acceptance.PushOneCommit.FILE_NAME , com.google.gerrit.acceptance.PushOneCommit.FILE_CONTENT ) ; assertDiffForNewFile ( r , com.google.gerrit.reviewdb.client.Patch.COMMIT_MSG , r.getCommit ( ) . getFullMessage ( ) ) ; }
Source:
private com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.rpc.NativeMap < com.google.gwt.core.client.JsArray < com.google.gerrit.client.changes.CommentInfo > > > draftsBase ( ) { return new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.rpc.NativeMap < com.google.gwt.core.client.JsArray < com.google.gerrit.client.changes.CommentInfo > > > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.rpc.NativeMap < com.google.gwt.core.client.JsArray < com.google.gerrit.client.changes.CommentInfo > > result ) { draftsBase = sort ( result.get ( path ) ) ; } } ; }

Target:
public void onFailure ( java.lang.Throwable caught ) { }