auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void configure ( ) { install ( new com.google.inject.assistedinject.FactoryModuleBuilder ( ) . implement ( com.googlesrouce.gerrit.plugins.github.git.GitClone.class , com.googlesrouce.gerrit.plugins.github.git.GitClone.class ) . build ( GitClone.Factory.class ) ) ; bind ( org.apache.velocity.runtime.RuntimeInstance.class ) . annotatedWith ( com.google.inject.name.Names.named ( "PluginRuntimeInstance" ) ) . toProvider ( com.googlesource.gerrit.plugins.github.velocity.PluginVelocityRuntimeProvider.class ) ; }

Target:
protected void configure ( ) { install ( new com.google.inject.assistedinject.FactoryModuleBuilder ( ) . implement ( com.googlesrouce.gerrit.plugins.github.git.GitCloneStep.class , com.googlesrouce.gerrit.plugins.github.git.GitCloneStep.class ) . build ( GitCloneStep.Factory.class ) ) ; install ( new com.google.inject.assistedinject.FactoryModuleBuilder ( ) . implement ( com.googlesrouce.gerrit.plugins.github.git.CreateProjectStep.class , com.googlesrouce.gerrit.plugins.github.git.CreateProjectStep.class ) . build ( CreateProjectStep.Factory.class ) ) ; bind ( org.apache.velocity.runtime.RuntimeInstance.class ) . annotatedWith ( com.google.inject.name.Names.named ( "PluginRuntimeInstance" ) ) . toProvider ( com.googlesource.gerrit.plugins.github.velocity.PluginVelocityRuntimeProvider.class ) ; }
Source:
public java.util.Optional < com.google.gerrit.reviewdb.client.AccountGroup > load ( java.lang.String name ) throws java.lang.Exception { try ( com.google.gerrit.reviewdb.server.ReviewDb db = schema.open ( ) ) { com.google.gerrit.reviewdb.client.AccountGroup.NameKey key = new com.google.gerrit.reviewdb.client.AccountGroup.NameKey ( name ) ; com.google.gerrit.reviewdb.client.AccountGroupName r = db.accountGroupNames ( ) . get ( key ) ; if ( r != null ) { return java.util.Optional.ofNullable ( db.accountGroups ( ) . get ( r.getId ( ) ) ) ; } return java.util.Optional.empty ( ) ; } }

Target:
public java.util.Optional < com.google.gerrit.reviewdb.client.AccountGroup > load ( java.lang.String name ) throws java.lang.Exception { try ( com.google.gerrit.reviewdb.server.ReviewDb db = schema.open ( ) ) { return groups.get ( db , new com.google.gerrit.reviewdb.client.AccountGroup.NameKey ( name ) ) ; } }
Source:
private void defineRelationClasses ( ) throws com.google.gwtorm.client.OrmException { relations = new java.util.ArrayList < com.google.gwtorm.server.SchemaGen < S > . RelationGen > ( ) ; for ( final com.google.gwtorm.schema.RelationModel rel : schema.getRelations ( ) ) { final java.lang.Class < ? > a = accessGen.create ( classLoader , rel ) ; relations.add ( new RelationGen ( rel , a ) ) ; } }

Target:
public int compare ( com.google.gwtorm.server.SchemaGen < S > . RelationGen a , com.google.gwtorm.server.SchemaGen < S > . RelationGen b ) { int cmp = ( a.model.getRelationID ( ) ) - ( b.model.getRelationID ( ) ) ; if ( cmp == 0 ) { cmp = a.model.getRelationName ( ) . compareTo ( b.model.getRelationName ( ) ) ; } return cmp ; }
Source:
public void patchSetObjectMissing ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = com.google.gerrit.testutil.TestChanges.newChange ( project , userId ) ; db.changes ( ) . insert ( java.util.Collections.singleton ( c ) ) ; com.google.gerrit.reviewdb.client.PatchSet ps = com.google.gerrit.testutil.TestChanges.newPatchSet ( c.currentPatchSetId ( ) , org.eclipse.jgit.lib.ObjectId.fromString ( "deadbeefdeadbeefdeadbeefdeadbeefdeadbeef" ) , userId ) ; db.patchSets ( ) . insert ( java.util.Collections.singleton ( ps ) ) ; assertProblems ( c , "Object missing: patch set 1: deadbeefdeadbeefdeadbeefdeadbeefdeadbeef" ) ; }

Target:
public void patchSetObjectAndRefMissing ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = insertChange ( ) ; com.google.gerrit.reviewdb.client.PatchSet ps = com.google.gerrit.testutil.TestChanges.newPatchSet ( c.currentPatchSetId ( ) , org.eclipse.jgit.lib.ObjectId.fromString ( "deadbeefdeadbeefdeadbeefdeadbeefdeadbeef" ) , userId ) ; db.patchSets ( ) . insert ( java.util.Collections.singleton ( ps ) ) ; assertProblems ( c , ( "Ref missing: " + ( ps.getId ( ) . toRefName ( ) ) ) , "Object missing: patch set 1: deadbeefdeadbeefdeadbeefdeadbeefdeadbeef" ) ; }
Source:
void loadChangeInfo ( boolean fg , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.info.ChangeInfo > cb ) { com.google.gerrit.client.rpc.RestApi call = com.google.gerrit.client.changes.ChangeApi.detail ( changeId.get ( ) ) ; java.util.EnumSet < com.google.gerrit.extensions.client.ListChangesOption > opts = java.util.EnumSet.of ( ListChangesOption.ALL_REVISIONS , ListChangesOption.CHANGE_ACTIONS ) ; if ( enableSignedPush ( ) ) { opts.add ( ListChangesOption.PUSH_CERTIFICATES ) ; } com.google.gerrit.client.changes.ChangeList.addOptions ( call , opts ) ; if ( ! fg ) { call.background ( ) ; } call.get ( cb ) ; }

Target:
void loadChangeInfo ( boolean fg , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.info.ChangeInfo > cb ) { com.google.gerrit.client.rpc.RestApi call = com.google.gerrit.client.changes.ChangeApi.detail ( Project.NameKey.asStringOrNull ( project ) , changeId.get ( ) ) ; java.util.EnumSet < com.google.gerrit.extensions.client.ListChangesOption > opts = java.util.EnumSet.of ( ListChangesOption.ALL_REVISIONS , ListChangesOption.CHANGE_ACTIONS ) ; if ( enableSignedPush ( ) ) { opts.add ( ListChangesOption.PUSH_CERTIFICATES ) ; } com.google.gerrit.client.changes.ChangeList.addOptions ( call , opts ) ; if ( ! fg ) { call.background ( ) ; } call.get ( cb ) ; }
Source:
protected final com.google.gerrit.server.mail.ProjectWatch.Watchers getWatchers ( com.google.gerrit.reviewdb.client.AccountProjectWatch.NotifyType type ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.server.mail.ProjectWatch watch = new com.google.gerrit.server.mail.ProjectWatch ( args , branch.getParentKey ( ) , projectState , changeData ) ; return watch.getWatchers ( type ) ; }

Target:
protected final com.google.gerrit.server.mail.ProjectWatch.Watchers getWatchers ( com.google.gerrit.reviewdb.client.AccountProjectWatch.NotifyType type ) throws com.google.gwtorm.server.OrmException { if ( ! ( NotifyHandling.ALL.equals ( notify ) ) ) { return new com.google.gerrit.server.mail.ProjectWatch.Watchers ( ) ; } com.google.gerrit.server.mail.ProjectWatch watch = new com.google.gerrit.server.mail.ProjectWatch ( args , branch.getParentKey ( ) , projectState , changeData ) ; return watch.getWatchers ( type ) ; }
Source:
public com.google.gerrit.acceptance.RestResponse getWithHeader ( java.lang.String endPoint , org.apache.http.Header header ) throws java.io.IOException { org.apache.http.client.fluent.Request get = org.apache.http.client.fluent.Request.Get ( ( ( ( url ) + "/a" ) + endPoint ) ) ; if ( header != null ) { get.addHeader ( header ) ; } return execute ( get ) ; }

Target:
public com.google.gerrit.acceptance.RestResponse getWithHeader ( java.lang.String endPoint , org.apache.http.Header header ) throws java.io.IOException { org.apache.http.client.fluent.Request get = org.apache.http.client.fluent.Request.Get ( getUrl ( endPoint ) ) ; if ( header != null ) { get.addHeader ( header ) ; } return execute ( get ) ; }
Source:
private void renameGroup ( com.google.gerrit.reviewdb.client.AccountGroup group , java.lang.String newName ) throws com.google.gerrit.extensions.restapi.ResourceConflictException , com.google.gerrit.extensions.restapi.ResourceNotFoundException , com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.reviewdb.client.AccountGroup.UUID groupUuid = group.getGroupUUID ( ) ; try { groupsUpdateProvider.get ( ) . renameGroup ( db.get ( ) , groupUuid , new com.google.gerrit.reviewdb.client.AccountGroup.NameKey ( newName ) ) ; } catch ( com.google.gerrit.common.errors.NoSuchGroupException e ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( java.lang.String.format ( "Group %s not found" , groupUuid ) ) ; } catch ( com.google.gerrit.common.errors.NameAlreadyUsedException e ) { throw new com.google.gerrit.extensions.restapi.ResourceConflictException ( ( ( "group with name " + newName ) + " already exists" ) ) ; } }

Target:
private void renameGroup ( com.google.gerrit.common.data.GroupDescription.Internal group , java.lang.String newName ) throws com.google.gerrit.extensions.restapi.ResourceConflictException , com.google.gerrit.extensions.restapi.ResourceNotFoundException , com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.reviewdb.client.AccountGroup.UUID groupUuid = group.getGroupUUID ( ) ; try { groupsUpdateProvider.get ( ) . renameGroup ( db.get ( ) , groupUuid , new com.google.gerrit.reviewdb.client.AccountGroup.NameKey ( newName ) ) ; } catch ( com.google.gerrit.common.errors.NoSuchGroupException e ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( java.lang.String.format ( "Group %s not found" , groupUuid ) ) ; } catch ( com.google.gerrit.common.errors.NameAlreadyUsedException e ) { throw new com.google.gerrit.extensions.restapi.ResourceConflictException ( ( ( "group with name " + newName ) + " already exists" ) ) ; } }
Source:
private void setUpClientMock ( ) { eventsDb = easyMock.createNiceMock ( com.ericsson.gerrit.plugins.eventslog.SQLClient.class ) ; localEventsDb = easyMock.createNiceMock ( com.ericsson.gerrit.plugins.eventslog.SQLClient.class ) ; easyMock.resetAll ( ) ; }

Target:
private void setUpClientMock ( boolean reset ) throws java.sql.SQLException { eventsDb = easyMock.createNiceMock ( com.ericsson.gerrit.plugins.eventslog.SQLClient.class ) ; localEventsDb = easyMock.createNiceMock ( com.ericsson.gerrit.plugins.eventslog.SQLClient.class ) ; org.easymock.EasyMock.expect ( localEventsDb.dbExists ( ) ) . andReturn ( true ) . anyTimes ( ) ; if ( reset ) { easyMock.resetAll ( ) ; } }
Source:
protected void setupVelocityContext ( ) { super . setupVelocityContext ( ) ; velocityContext.put ( "change" , change ) ; velocityContext.put ( "changeId" , change.getKey ( ) ) ; velocityContext.put ( "coverLetter" , getCoverLetter ( ) ) ; velocityContext.put ( "fromName" , getNameFor ( fromId ) ) ; velocityContext.put ( "patchSet" , patchSet ) ; velocityContext.put ( "patchSetInfo" , patchSetInfo ) ; }

Target:
public java.lang.String getChangeMessageThreadId ( ) { return ( ( ( ( ( "<gerrit." + ( change.getCreatedOn ( ) . getTime ( ) ) ) + "." ) + ( change.getKey ( ) . get ( ) ) ) + "@" ) + ( this . getGerritHost ( ) ) ) + ">" ; }
Source:
public com.google.gerrit.extensions.client.GeneralPreferencesInfo apply ( com.google.gerrit.server.config.ConfigResource rsrc ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { try ( org.eclipse.jgit.lib.Repository git = gitMgr.openRepository ( allUsersName ) ) { com.google.gerrit.server.account.VersionedAccountPreferences p = com.google.gerrit.server.account.VersionedAccountPreferences.forDefault ( ) ; p.load ( git ) ; com.google.gerrit.extensions.client.GeneralPreferencesInfo a = new com.google.gerrit.extensions.client.GeneralPreferencesInfo ( ) ; return loader.loadFromAllUsers ( a , p , git ) ; } }

Target:
static com.google.gerrit.extensions.client.GeneralPreferencesInfo readFromGit ( com.google.gerrit.server.git.GitRepositoryManager gitMgr , com.google.gerrit.server.account.GeneralPreferencesLoader loader , com.google.gerrit.server.config.AllUsersName allUsersName , com.google.gerrit.extensions.client.GeneralPreferencesInfo in ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException , org.eclipse.jgit.errors.RepositoryNotFoundException { try ( org.eclipse.jgit.lib.Repository git = gitMgr.openRepository ( allUsersName ) ) { com.google.gerrit.server.account.VersionedAccountPreferences p = com.google.gerrit.server.account.VersionedAccountPreferences.forDefault ( ) ; p.load ( git ) ; com.google.gerrit.extensions.client.GeneralPreferencesInfo r = com.google.gerrit.server.config.ConfigUtil.loadSection ( p.getConfig ( ) , UserConfigSections.GENERAL , null , new com.google.gerrit.extensions.client.GeneralPreferencesInfo ( ) , com.google.gerrit.extensions.client.GeneralPreferencesInfo.defaults ( ) , in ) ; return loader.loadMyMenusAndUrlAliases ( r , p , null ) ; } }
Source:
public void testAppend_long ( ) { final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder b = new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) ; assertSame ( b , b.append ( 4L ) ) ; assertSame ( b , b.append ( 2L ) ) ; assertEquals ( "42" , b.asString ( ) ) ; }

Target:
public void testAppend_float ( ) { final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder b = new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) ; org.junit.Assert.assertSame ( b , b.append ( 0.0F ) ) ; org.junit.Assert.assertEquals ( "0.0" , b.asString ( ) ) ; }
Source:
public int compare ( com.googlesource.gerrit.plugins.supermanifest.JiriProjects.Project a , com.googlesource.gerrit.plugins.supermanifest.JiriProjects.Project b ) { java.lang.String p1 = com.googlesource.gerrit.plugins.supermanifest.StringUtil.stripAndaddCharsAtEnd ( a.getPath ( ) , "/" ) ; java.lang.String p2 = com.googlesource.gerrit.plugins.supermanifest.StringUtil.stripAndaddCharsAtEnd ( b.getPath ( ) , "/" ) ; return p1.compareTo ( p2 ) ; }

Target:
public int compare ( com.googlesource.gerrit.plugins.supermanifest.JiriProjects.Project a , com.googlesource.gerrit.plugins.supermanifest.JiriProjects.Project b ) { java.lang.String p1 = com.googlesource.gerrit.plugins.supermanifest.StringUtil.stripAndAddCharsAtEnd ( a.getPath ( ) , "/" ) ; java.lang.String p2 = com.googlesource.gerrit.plugins.supermanifest.StringUtil.stripAndAddCharsAtEnd ( b.getPath ( ) , "/" ) ; return p1.compareTo ( p2 ) ; }
Source:
public void setExisting_Conflict ( ) throws java.lang.Exception { com.google.gerrit.server.account.PutUsername.Input in = new com.google.gerrit.server.account.PutUsername.Input ( ) ; in.username = admin.username ; com.google.gerrit.acceptance.RestResponse r = adminSession.put ( ( ( "/accounts/" + ( createUser ( ) . get ( ) ) ) + "/username" ) , in ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( HttpStatus.SC_CONFLICT ) ; }

Target:
public void setExisting_Conflict ( ) throws java.lang.Exception { com.google.gerrit.server.account.PutUsername.Input in = new com.google.gerrit.server.account.PutUsername.Input ( ) ; in.username = admin.username ; adminSession.put ( ( ( "/accounts/" + ( createUser ( ) . get ( ) ) ) + "/username" ) , in ) . assertConflict ( ) ; }
Source:
public AccountGroup.Id call ( ) throws com.google.gerrit.common.errors.NameAlreadyUsedException , com.google.gerrit.common.errors.PermissionDeniedException , com.google.gwtorm.server.OrmException { final com.google.gerrit.server.account.PerformCreateGroup performCreateGroup = performCreateGroupFactory.create ( ) ; final com.google.gerrit.reviewdb.client.Account.Id me = user.getAccountId ( ) ; return performCreateGroup.createGroup ( groupName , null , false , null , java.util.Collections.singleton ( me ) , null ) ; }

Target:
public AccountGroup.Id call ( ) throws com.google.gerrit.common.errors.NameAlreadyUsedException , com.google.gerrit.common.errors.PermissionDeniedException , com.google.gwtorm.server.OrmException { final com.google.gerrit.server.account.PerformCreateGroup performCreateGroup = performCreateGroupFactory.create ( ) ; final com.google.gerrit.reviewdb.client.Account.Id me = user.getAccountId ( ) ; return performCreateGroup.createGroup ( groupName , null , visibleToAll , null , java.util.Collections.singleton ( me ) , null ) ; }
Source:
public synchronized < T > T get ( com.google.gerrit.server.PropertyKey < T > key ) { if ( ( properties ) != null ) { @ java.lang.SuppressWarnings ( value = "unchecked" ) T value = ( ( T ) ( properties.get ( key ) ) ) ; return value ; } return null ; }

Target:
public synchronized < T > java.util.Optional < T > get ( com.google.gerrit.server.PropertyKey < T > key ) { if ( ( properties ) != null ) { @ java.lang.SuppressWarnings ( value = "unchecked" ) T value = ( ( T ) ( properties.get ( key ) ) ) ; return java.util.Optional.ofNullable ( value ) ; } return java.util.Optional.empty ( ) ; }
Source:
public void getDiffPreferences ( ) throws java.lang.Exception { com.google.gerrit.extensions.client.DiffPreferencesInfo d = com.google.gerrit.extensions.client.DiffPreferencesInfo.defaults ( ) ; com.google.gerrit.extensions.client.DiffPreferencesInfo o = gApi.accounts ( ) . id ( admin.getId ( ) . toString ( ) ) . getDiffPreferences ( ) ; com.google.gerrit.acceptance.api.accounts.DiffPreferencesIT.assertPrefs ( o , d ) ; }

Target:
public void getDiffPreferences ( ) throws java.lang.Exception { com.google.gerrit.extensions.client.DiffPreferencesInfo d = com.google.gerrit.extensions.client.DiffPreferencesInfo.defaults ( ) ; com.google.gerrit.extensions.client.DiffPreferencesInfo o = gApi.accounts ( ) . id ( admin.getId ( ) . toString ( ) ) . getDiffPreferences ( ) ; com.google.gerrit.acceptance.AssertUtil.assertPrefs ( o , d ) ; }
Source:
public void execute ( ) { if ( ( cmA ) != null ) { cmA.setOption ( "viewportMargin" , 10 ) ; } if ( ( cmB ) != null ) { cmB.setOption ( "viewportMargin" , 10 ) ; } }

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:
private static java.lang.Integer intKey ( com.google.gwtorm.client.IntKey < ? > k ) { return k != null ? k.get ( ) : null ; }

Target:
private static < T > void diffColumns ( java.util.List < java.lang.String > diffs , java.lang.Class < T > clazz , java.lang.String desc , com.google.gerrit.server.notedb.ChangeBundle bundleA , T a , com.google.gerrit.server.notedb.ChangeBundle bundleB , T b ) { com.google.gerrit.server.notedb.ChangeBundle.diffColumnsExcluding ( diffs , clazz , desc , bundleA , a , bundleB , b ) ; }
Source:
public org.eclipse.jgit.lib.Repository openRepository ( java.lang.String name ) throws org.eclipse.jgit.errors.RepositoryNotFoundException { if ( isUnreasonableName ( name ) ) { throw new org.eclipse.jgit.errors.RepositoryNotFoundException ( ( "Invalid name: " + name ) ) ; } try { final org.eclipse.jgit.lib.RepositoryCache.FileKey loc = org.eclipse.jgit.lib.RepositoryCache.FileKey.lenient ( new java.io.File ( basePath , name ) , FS.DETECTED ) ; return org.eclipse.jgit.lib.RepositoryCache.open ( loc ) ; } catch ( java.io.IOException e1 ) { final org.eclipse.jgit.errors.RepositoryNotFoundException e2 ; e2 = new org.eclipse.jgit.errors.RepositoryNotFoundException ( ( "Cannot open repository " + name ) ) ; e2.initCause ( e1 ) ; throw e2 ; } }

Target:
private java.io.File gitDirOf ( com.google.gerrit.reviewdb.Project.NameKey name ) { return new java.io.File ( getBasePath ( ) , name.get ( ) ) ; }
Source:
public static void createTableIfNotExists ( java.lang.String url ) throws com.google.gwtorm.server.OrmException { java.sql.Connection con = java.sql.DriverManager.getConnection ( url ) ; java.sql.Statement stmt = con.createStatement ( ) ; HEAD ( 242129 ) ; AbstractSubmit : Format ( ( ( ( google ) - ( java ) ) - ( format ) ) ) ; stmt.executeUpdate ( ( "CREATE TABLE IF NOT EXISTS ACCOUNT_PATCH_REVIEWS (" + ( ( ( ( ( ( "ACCOUNT_ID INTEGER DEFAULT 0 NOT NULL, " + "CHANGE_ID INTEGER DEFAULT 0 NOT NULL, " ) + "PATCH_SET_ID INTEGER DEFAULT 0 NOT NULL, " ) + "FILE_NAME VARCHAR(255) DEFAULT '' NOT NULL, " ) + "CONSTRAINT PRIMARY_KEY_ACCOUNT_PATCH_REVIEWS " ) + "PRIMARY KEY (ACCOUNT_ID, CHANGE_ID, PATCH_SET_ID, FILE_NAME)" ) + ")" ) ) ) ; }

Target:
public static void createTableIfNotExists ( java.lang.String url ) throws com.google.gwtorm.server.OrmException { try ( java.sql.Connection con = java.sql.DriverManager.getConnection ( url ) ; java.sql.Statement stmt = con.createStatement ( ) ) { com.google.gerrit.server.schema.H2AccountPatchReviewStore.doCreateTable ( stmt ) ; } catch ( java.sql.SQLException e ) { throw com.google.gerrit.server.schema.H2AccountPatchReviewStore.convertError ( "create" , e ) ; } }
Source:
public com.google.gerrit.metrics.dropwizard.MetricResource parse ( com.google.gerrit.server.config.ConfigResource parent , com.google.gerrit.extensions.restapi.IdString id ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.ResourceNotFoundException { if ( ! ( user.get ( ) . getCapabilities ( ) . canViewCaches ( ) ) ) { throw new com.google.gerrit.extensions.restapi.AuthException ( "restricted to viewCaches" ) ; } com.codahale.metrics.Metric metric = metrics.getMetric ( id.get ( ) ) ; if ( metric == null ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( id.get ( ) ) ; } return new com.google.gerrit.metrics.dropwizard.MetricResource ( id.get ( ) , metric ) ; }

Target:
public com.google.gerrit.metrics.dropwizard.MetricResource parse ( com.google.gerrit.server.config.ConfigResource parent , com.google.gerrit.extensions.restapi.IdString id ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.ResourceNotFoundException , com.google.gerrit.server.permissions.PermissionBackendException { permissionBackend.user ( user ) . check ( GlobalPermission.VIEW_CACHES ) ; com.codahale.metrics.Metric metric = metrics.getMetric ( id.get ( ) ) ; if ( metric == null ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( id.get ( ) ) ; } return new com.google.gerrit.metrics.dropwizard.MetricResource ( id.get ( ) , metric ) ; }
Source:
public void updateRepo ( com.google.gerrit.server.git.BatchUpdate.RepoContext ctx ) throws com.google.gerrit.extensions.restapi.ResourceConflictException , java.io.IOException { validate ( ctx ) ; if ( ! ( updateRef ) ) { return ; } ctx.addRefUpdate ( new org.eclipse.jgit.transport.ReceiveCommand ( org.eclipse.jgit.lib.ObjectId.zeroId ( ) , commit , patchSet.getRefName ( ) ) ) ; }

Target:
public com.google.gerrit.reviewdb.client.PatchSet getPatchSet ( ) { com.google.common.base.Preconditions.checkState ( ( ( patchSet ) != null ) , "getPatchSet() only valid after creating change" ) ; return patchSet ; }
Source:
private void append ( final java.lang.StringBuilder sb , final org.eclipse.jgit.diff.Edit o ) { sb.append ( o.getBeginA ( ) ) ; sb.append ( ',' ) ; sb.append ( o.getEndA ( ) ) ; sb.append ( ',' ) ; sb.append ( o.getBeginB ( ) ) ; sb.append ( ',' ) ; sb.append ( o.getEndB ( ) ) ; }

Target:
private void append ( final java.lang.StringBuilder sb , final com.google.gerrit.prettify.common.BaseEdit o ) { sb.append ( o.getBeginA ( ) ) ; sb.append ( ',' ) ; sb.append ( o.getEndA ( ) ) ; sb.append ( ',' ) ; sb.append ( o.getBeginB ( ) ) ; sb.append ( ',' ) ; sb.append ( o.getEndB ( ) ) ; }
Source:
public com.google.gerrit.server.group.GroupResource parse ( com.google.gerrit.extensions.restapi.TopLevelResource parent , java.lang.String id ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException , java.lang.Exception { final com.google.gerrit.server.CurrentUser user = self.get ( ) ; if ( user instanceof com.google.gerrit.server.AnonymousUser ) { throw new com.google.gerrit.extensions.restapi.AuthException ( "Authentication required" ) ; } else if ( ! ( user instanceof com.google.gerrit.server.IdentifiedUser ) ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( id ) ; } return parse ( id ) ; }

Target:
private static com.google.gerrit.server.group.GroupResource check ( java.lang.String id , com.google.gerrit.server.account.GroupControl ctl ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException { if ( ctl.isVisible ( ) ) { return new com.google.gerrit.server.group.GroupResource ( ctl ) ; } throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( id ) ; }
Source:
public void rescheduleOnRecoverableException ( ) throws java.io.IOException { org.mockito.Mockito.when ( session.post ( com.googlesource.gerrit.plugins.webhooks.PostTaskTest.WEBHOOK_URL , com.googlesource.gerrit.plugins.webhooks.PostTaskTest.BODY ) ) . thenThrow ( java.io.IOException.class ) ; task.run ( ) ; org.mockito.Mockito.verify ( executor , org.mockito.Mockito.times ( 1 ) ) . schedule ( task , com.googlesource.gerrit.plugins.webhooks.PostTaskTest.RETRY_INTERVAL , java.util.concurrent.TimeUnit.MILLISECONDS ) ; }

Target:
public void noRescheduleOnNonRecoverableException ( ) throws java.io.IOException { org.mockito.Mockito.when ( session.post ( org.mockito.ArgumentMatchers.eq ( com.googlesource.gerrit.plugins.webhooks.PostTaskTest.WEBHOOK_URL ) , org.mockito.ArgumentMatchers.eq ( content ) ) ) . thenThrow ( javax.net.ssl.SSLException.class ) ; task.run ( ) ; org.mockito.Mockito.verifyZeroInteractions ( executor ) ; }
Source:
private com.google.gerrit.server.account.AccountState missing ( com.google.gerrit.reviewdb.client.Account.Id accountId ) { com.google.gerrit.reviewdb.client.Account account = new com.google.gerrit.reviewdb.client.Account ( accountId , com.google.gerrit.common.TimeUtil.nowTs ( ) ) ; account.setActive ( false ) ; return new com.google.gerrit.server.account.AccountState ( allUsersName , account , com.google.common.collect.ImmutableSet.of ( ) , com.google.common.collect.ImmutableMap.of ( ) , com.google.gerrit.extensions.client.GeneralPreferencesInfo.defaults ( ) ) ; }

Target:
private com.google.gerrit.server.account.AccountState missing ( com.google.gerrit.reviewdb.client.Account.Id accountId ) { com.google.gerrit.reviewdb.client.Account account = new com.google.gerrit.reviewdb.client.Account ( accountId , com.google.gerrit.common.TimeUtil.nowTs ( ) ) ; account.setActive ( false ) ; return com.google.gerrit.server.account.AccountState.forAccount ( allUsersName , account ) ; }
Source:
public com.google.gerrit.client.diff.DiffApi ignoreWhitespace ( com.google.gerrit.reviewdb.client.AccountDiffPreference.Whitespace w ) { switch ( w ) { default : case IGNORE_NONE : return ignoreWhitespace ( com.google.gerrit.client.diff.DiffApi.IgnoreWhitespace.NONE ) ; case IGNORE_SPACE_AT_EOL : return ignoreWhitespace ( com.google.gerrit.client.diff.DiffApi.IgnoreWhitespace.TRAILING ) ; case IGNORE_SPACE_CHANGE : return ignoreWhitespace ( com.google.gerrit.client.diff.DiffApi.IgnoreWhitespace.CHANGED ) ; case IGNORE_ALL_SPACE : return ignoreWhitespace ( com.google.gerrit.client.diff.DiffApi.IgnoreWhitespace.ALL ) ; } }

Target:
public com.google.gerrit.client.diff.DiffApi ignoreWhitespace ( com.google.gerrit.reviewdb.client.AccountDiffPreference.Whitespace w ) { switch ( w ) { default : case IGNORE_NONE : return ignoreWhitespace ( com.google.gerrit.client.diff.DiffApi.IgnoreWhitespace.NONE ) ; case IGNORE_TRAILING : return ignoreWhitespace ( com.google.gerrit.client.diff.DiffApi.IgnoreWhitespace.TRAILING ) ; case IGNORE_LEADING_AND_TRAILING : return ignoreWhitespace ( com.google.gerrit.client.diff.DiffApi.IgnoreWhitespace.CHANGED ) ; case IGNORE_ALL : return ignoreWhitespace ( com.google.gerrit.client.diff.DiffApi.IgnoreWhitespace.ALL ) ; } }
Source:
public void onDialogVisible ( com.google.gwtexpui.user.client.DialogVisibleEvent event ) { swf.getStyle ( ) . setVisibility ( ( event.isVisible ( ) ? Style.Visibility.HIDDEN : Style.Visibility.VISIBLE ) ) ; }

Target:
public void onDialogVisible ( com.google.gwtexpui.user.client.DialogVisibleEvent event ) { if ( event.contains ( this ) ) { if ( event.isVisible ( ) ) { swf.getStyle ( ) . setVisibility ( com.google.gwt.dom.client.Style.Visibility.VISIBLE ) ; } } else { swf.getStyle ( ) . setVisibility ( ( event.isVisible ( ) ? com.google.gwt.dom.client.Style.Visibility.HIDDEN : com.google.gwt.dom.client.Style.Visibility.VISIBLE ) ) ; } }
Source:
public void handle ( final net.codemirror.lib.CodeMirror instance , final net.codemirror.lib.CodeMirror.LineHandle handle , com.google.gwt.dom.client.Element element ) { if ( linePaddingOnOtherSideMap.containsKey ( handle ) ) { com.google.gwt.core.client.Scheduler.get ( ) . scheduleDeferred ( new com.google.gwt.core.client.Scheduler.ScheduledCommand ( ) { @ java.lang.Override public void execute ( ) { resizePaddingOnOtherSide ( side , instance.getLineNumber ( handle ) ) ; } } ) ; } }

Target:
public void handle ( final net.codemirror.lib.CodeMirror instance , final net.codemirror.lib.CodeMirror.LineHandle handle , com.google.gwt.dom.client.Element element ) { if ( lineActiveBoxMap.containsKey ( handle ) ) { lineActiveBoxMap.get ( handle ) . resizePaddingWidget ( ) ; } if ( linePaddingOnOtherSideMap.containsKey ( handle ) ) { com.google.gwt.core.client.Scheduler.get ( ) . scheduleDeferred ( new com.google.gwt.core.client.Scheduler.ScheduledCommand ( ) { @ java.lang.Override public void execute ( ) { resizePaddingOnOtherSide ( side , instance.getLineNumber ( handle ) ) ; } } ) ; } }
Source:
public static com.google.gwt.event.shared.HandlerRegistration addApplication ( final com.google.gwtexpui.globalkey.client.KeyCommand key ) { com.google.gwtexpui.globalkey.client.GlobalKey.init ( ) ; com.google.gwtexpui.globalkey.client.GlobalKey.keys.add ( key ) ; com.google.gwtexpui.globalkey.client.GlobalKey.keyApplication.add ( key ) ; return new com.google.gwt.event.shared.HandlerRegistration ( ) { @ java.lang.Override public void removeHandler ( ) { com.google.gwtexpui.globalkey.client.GlobalKey.keys.remove ( key ) ; com.google.gwtexpui.globalkey.client.GlobalKey.keyApplication.remove ( key ) ; } } ; }

Target:
public static com.google.gwt.event.shared.HandlerRegistration addApplication ( final com.google.gwt.user.client.ui.Widget widget , final com.google.gwtexpui.globalkey.client.KeyCommand appKey ) { com.google.gwtexpui.globalkey.client.GlobalKey.initEvents ( ) ; final com.google.gwtexpui.globalkey.client.GlobalKey.State state = com.google.gwtexpui.globalkey.client.GlobalKey.stateFor ( widget ) ; state.add ( appKey ) ; return new com.google.gwt.event.shared.HandlerRegistration ( ) { @ java.lang.Override public void removeHandler ( ) { state.remove ( appKey ) ; } } ; }
Source:
public static org.eclipse.jgit.lib.Config newDefaultConfig ( ) { org.eclipse.jgit.lib.Config cfg = new org.eclipse.jgit.lib.Config ( ) ; cfg.setEnum ( "auth" , null , "type" , AuthType.DEVELOPMENT_BECOME_ANY_ACCOUNT ) ; cfg.setString ( "gerrit" , null , "basePath" , "git" ) ; cfg.setString ( "gerrit" , null , "allProjects" , "Test-Projects" ) ; cfg.setString ( "user" , null , "name" , "Gerrit Code Review" ) ; cfg.setString ( "user" , null , "email" , "gerrit@localhost" ) ; cfg.setBoolean ( "sendemail" , null , "enable" , false ) ; cfg.setString ( "cache" , null , "directory" , null ) ; cfg.setString ( "index" , null , "type" , "lucene" ) ; cfg.setBoolean ( "index" , "lucene" , "testInmemory" , true ) ; cfg.setInt ( "index" , "lucene" , "testVersion" , com.google.gerrit.server.index.ChangeSchemas.getLatest ( ) . getVersion ( ) ) ; return cfg ; }

Target:
public static org.eclipse.jgit.lib.Config newDefaultConfig ( ) { org.eclipse.jgit.lib.Config cfg = new org.eclipse.jgit.lib.Config ( ) ; com.google.gerrit.testutil.InMemoryModule.setDefaults ( cfg ) ; return cfg ; }
Source:
public void listCacheNames ( ) throws java.lang.Exception { com.google.gerrit.acceptance.RestResponse r = adminSession.get ( "/config/server/caches/?format=LIST" ) ; r.assertOK ( ) ; java.util.List < java.lang.String > result = newGson ( ) . fromJson ( r.getReader ( ) , new com.google.gson.reflect.TypeToken < java.util.List < java.lang.String > > ( ) { } . getType ( ) ) ; com.google.common.truth.Truth.assertThat ( result ) . contains ( "accounts" ) ; com.google.common.truth.Truth.assertThat ( result ) . contains ( "projects" ) ; com.google.common.truth.Truth.assertThat ( com.google.common.collect.Ordering.natural ( ) . isOrdered ( result ) ) . isTrue ( ) ; }

Target:
public void listCacheNames ( ) throws java.lang.Exception { com.google.gerrit.acceptance.RestResponse r = adminRestSession.get ( "/config/server/caches/?format=LIST" ) ; r.assertOK ( ) ; java.util.List < java.lang.String > result = newGson ( ) . fromJson ( r.getReader ( ) , new com.google.gson.reflect.TypeToken < java.util.List < java.lang.String > > ( ) { } . getType ( ) ) ; com.google.common.truth.Truth.assertThat ( result ) . contains ( "accounts" ) ; com.google.common.truth.Truth.assertThat ( result ) . contains ( "projects" ) ; com.google.common.truth.Truth.assertThat ( com.google.common.collect.Ordering.natural ( ) . isOrdered ( result ) ) . isTrue ( ) ; }
Source:
public boolean hasEmailAddress ( com.google.gerrit.server.IdentifiedUser user , java.lang.String email ) { for ( com.google.gerrit.server.account.ExternalId ext : user.state ( ) . getExternalIds ( ) ) { if ( ( email != null ) && ( email.equalsIgnoreCase ( ext.email ( ) ) ) ) { return true ; } } return false ; }

Target:
public boolean hasEmailAddress ( com.google.gerrit.server.IdentifiedUser user , java.lang.String email ) { for ( com.google.gerrit.server.account.externalids.ExternalId ext : user.state ( ) . getExternalIds ( ) ) { if ( ( email != null ) && ( email.equalsIgnoreCase ( ext.email ( ) ) ) ) { return true ; } } return false ; }
Source:
private static boolean isBodyJson ( final com.google.gwtjsonrpc.server.ActiveCall call ) { java.lang.String type = call.httpRequest.getContentType ( ) ; if ( type == null ) { return false ; } int semi = type.indexOf ( ';' ) ; if ( semi >= 0 ) { type = type.substring ( 0 , semi ) . trim ( ) ; } return JsonUtil.JSON_TYPE.equals ( type ) ; }

Target:
private static boolean isBodyJson ( final com.google.gwtjsonrpc.server.ActiveCall call ) { java.lang.String type = call.httpRequest.getContentType ( ) ; if ( type == null ) { return false ; } int semi = type.indexOf ( ';' ) ; if ( semi >= 0 ) { type = type.substring ( 0 , semi ) . trim ( ) ; } return JsonConstants.JSON_TYPE.equals ( type ) ; }
Source:
private void refreshObjectIds ( ) { if ( ( ( oldId ) == null ) && ( ( oldIdName ) != null ) ) { oldId = org.eclipse.jgit.lib.ObjectId.fromString ( oldIdName ) ; } if ( ( newId ) == null ) { newId = org.eclipse.jgit.lib.ObjectId.fromString ( newIdName ) ; } }

Target:
public org.eclipse.jgit.lib.ObjectId getOldId ( ) { if ( ( ( oldId ) == null ) && ( ( oldIdName ) != null ) ) { oldId = org.eclipse.jgit.lib.ObjectId.fromString ( oldIdName ) ; } return oldId ; }
Source:
public final com.google.gerrit.gpg.CheckResult check ( org.bouncycastle.openpgp.PGPPublicKey key ) { if ( ( ( store ) == null ) && ( ( trusted ) != null ) ) { throw new java.lang.IllegalStateException ( "PublicKeyStore is required" ) ; } else if ( ( ( store ) != null ) && ( ( trusted ) == null ) ) { throw new java.lang.IllegalStateException ( "at least one trusted key is required" ) ; } return check ( key , 0 , true , ( ( store ) != null ? new java.util.HashSet < com.google.gerrit.gpg.Fingerprint > ( ) : null ) ) ; }

Target:
private static org.bouncycastle.bcpg.sig.RevocationReason getRevocationReason ( org.bouncycastle.openpgp.PGPSignature sig ) { if ( ( sig.getSignatureType ( ) ) != ( org.bouncycastle.openpgp.PGPSignature.KEY_REVOCATION ) ) { throw new java.lang.IllegalArgumentException ( ( "Expected KEY_REVOCATION signature, got " + ( sig.getSignatureType ( ) ) ) ) ; } org.bouncycastle.bcpg.SignatureSubpacket sub = sig.getHashedSubPackets ( ) . getSubpacket ( org.bouncycastle.bcpg.SignatureSubpacketTags.REVOCATION_REASON ) ; if ( sub == null ) { return null ; } return new org.bouncycastle.bcpg.sig.RevocationReason ( sub.isCritical ( ) , sub.getData ( ) ) ; }
Source:
public void removeWriteIndex ( int version ) { writeIndexes.remove ( version ) ; }

Target:
public synchronized void removeWriteIndex ( int version ) { int removeIndex = - 1 ; for ( int i = 0 ; i < ( writeIndexes.size ( ) ) ; i ++ ) { if ( ( writeIndexes.get ( i ) . getSchema ( ) . getVersion ( ) ) == version ) { removeIndex = i ; break ; } } if ( removeIndex >= 0 ) { writeIndexes.remove ( removeIndex ) ; } }
Source:
public boolean canUploadToAtLeastOneRef ( ) { return canPerformOnAnyRef ( ApprovalCategory.READ , ( ( short ) ( 2 ) ) ) ; }

Target:
public boolean canPushToAtLeastOneRef ( ) { return ( ( canPerformOnAnyRef ( ApprovalCategory.READ , ( ( short ) ( 2 ) ) ) ) || ( canPerformOnAnyRef ( ApprovalCategory.PUSH_HEAD , ( ( short ) ( 1 ) ) ) ) ) || ( canPerformOnAnyRef ( ApprovalCategory.PUSH_TAG , ( ( short ) ( 1 ) ) ) ) ; }
Source:
public void run ( ) { for ( final com.google.gerrit.reviewdb.client.Project.NameKey name : cache.all ( ) ) { pool.execute ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { cache.get ( name ) ; } } ) ; } pool.shutdown ( ) ; }

Target:
public void run ( ) { for ( final com.google.gerrit.reviewdb.client.Project.NameKey name : cache.all ( ) ) { pool.execute ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { cache.get ( name ) ; } } ) ; } pool.shutdown ( ) ; try { pool.awaitTermination ( java.lang.Long.MAX_VALUE , java.util.concurrent.TimeUnit.MILLISECONDS ) ; com.google.gerrit.server.project.ProjectCacheWarmer.log.info ( "Finished loading project cache" ) ; } catch ( java.lang.InterruptedException e ) { com.google.gerrit.server.project.ProjectCacheWarmer.log.warn ( "Interrupted while waiting for project cache to load" ) ; } }
Source:
private static void publish ( java.lang.String token ) { new com.google.gerrit.client.Dispatcher.AsyncSplit ( token ) { public void onSuccess ( ) { com.google.gerrit.client.Gerrit.display ( token , select ( ) ) ; } private com.google.gerrit.client.ui.Screen select ( ) { java.lang.String p = "change,publish," ; if ( token.startsWith ( p ) ) return new com.google.gerrit.client.changes.PublishCommentScreen ( PatchSet.Id.parse ( com.google.gerrit.client.Dispatcher.skip ( p , token ) ) ) ; return new com.google.gerrit.client.NotFoundScreen ( ) ; } } . onSuccess ( ) ; }

Target:
private static void publish ( final com.google.gerrit.reviewdb.PatchSet.Id ps ) { java.lang.String token = com.google.gerrit.client.Dispatcher.toPublish ( ps ) ; new com.google.gerrit.client.Dispatcher.AsyncSplit ( token ) { public void onSuccess ( ) { com.google.gerrit.client.Gerrit.display ( token , select ( ) ) ; } private com.google.gerrit.client.ui.Screen select ( ) { return new com.google.gerrit.client.changes.PublishCommentScreen ( ps ) ; } } . onSuccess ( ) ; }
Source:
public void testBlockRule_ParentBlocksChild ( ) { com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/tags/*" ) ; com.google.gerrit.server.project.Util.grant ( util.getParentConfig ( ) , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/tags/*" ) . setBlock ( ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; org.junit.Assert.assertFalse ( "u can't force update tag" , u.controlForRef ( "refs/tags/V10" ) . canForceUpdate ( ) ) ; }

Target:
public void testBlockRule_ParentBlocksChild ( ) { com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/tags/*" ) ; com.google.gerrit.server.project.Util.grant ( util.getParentConfig ( ) , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/tags/*" ) . setBlock ( ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; org.junit.Assert.assertFalse ( "u can't update tag" , u.controlForRef ( "refs/tags/V10" ) . canUpdate ( ) ) ; }
Source:
public void setUp ( ) { java.lang.String tz = "US/Eastern" ; systemTimeZoneProperty = java.lang.System.setProperty ( "user.timezone" , tz ) ; systemTimeZone = java.util.TimeZone.getDefault ( ) ; java.util.TimeZone.setDefault ( java.util.TimeZone.getTimeZone ( tz ) ) ; long maxMs = ChangeRebuilderImpl.MAX_WINDOW_MS ; com.google.common.truth.Truth.assertThat ( maxMs ) . isGreaterThan ( 1000L ) ; com.google.gerrit.testutil.TestTimeUtil.resetWithClockStep ( ( maxMs * 2 ) , java.util.concurrent.TimeUnit.MILLISECONDS ) ; project = new com.google.gerrit.reviewdb.client.Project.NameKey ( "project" ) ; accountId = new com.google.gerrit.reviewdb.client.Account.Id ( 100 ) ; }

Target:
public void setUp ( ) { java.lang.String tz = "US/Eastern" ; systemTimeZoneProperty = java.lang.System.setProperty ( "user.timezone" , tz ) ; systemTimeZone = java.util.TimeZone.getDefault ( ) ; java.util.TimeZone.setDefault ( java.util.TimeZone.getTimeZone ( tz ) ) ; long maxMs = com.google.gerrit.server.notedb.rebuild.ChangeRebuilderImpl.MAX_WINDOW_MS ; com.google.common.truth.Truth.assertThat ( maxMs ) . isGreaterThan ( 1000L ) ; com.google.gerrit.testutil.TestTimeUtil.resetWithClockStep ( ( maxMs * 2 ) , java.util.concurrent.TimeUnit.MILLISECONDS ) ; project = new com.google.gerrit.reviewdb.client.Project.NameKey ( "project" ) ; accountId = new com.google.gerrit.reviewdb.client.Account.Id ( 100 ) ; }
Source:
public void onScreenLoad ( com.google.gerrit.client.ui.ScreenLoadEvent event ) { com.google.gerrit.client.ui.Screen screen = event.getScreen ( ) ; com.google.gerrit.reviewdb.client.Project.NameKey projectKey ; if ( screen instanceof com.google.gerrit.client.admin.ProjectScreen ) { projectKey = ( ( com.google.gerrit.client.admin.ProjectScreen ) ( screen ) ) . getProjectKey ( ) ; } else { projectKey = com.google.gerrit.client.admin.ProjectScreen.getSavedKey ( ) ; } if ( projectKey != null ) { setVisible ( true ) ; setTargetHistoryToken ( com.google.gerrit.client.Dispatcher.toProjectAdmin ( projectKey , panel ) ) ; } else { setVisible ( false ) ; } super . onScreenLoad ( event ) ; }

Target:
public void go ( ) { if ( ( com.google.gerrit.client.Gerrit.patchScreen ) != null ) { com.google.gerrit.client.Gerrit.patchScreen.setTopView ( tv ) ; } com.google.gwt.dom.client.AnchorElement.as ( getElement ( ) ) . blur ( ) ; }
Source:
private static boolean onOpen ( com.google.gwt.dom.client.NativeEvent e , int idx ) { if ( com.google.gerrit.client.change.RelatedChangesTab.link.handleAsClick ( e.< com.google.gwt.user.client.Event > cast ( ) ) ) { com.google.gerrit.client.change.RelatedChangesTab.MyTable t = com.google.gerrit.client.change.RelatedChangesTab.getMyTable ( e ) ; if ( t != null ) { t.onOpenRow ( idx ) ; e.preventDefault ( ) ; return false ; } } return true ; }

Target:
private static boolean onOpen ( com.google.gwt.dom.client.NativeEvent evt , com.google.gwt.user.client.Element e ) { if ( com.google.gerrit.client.change.RelatedChangesTab.LINK.handleAsClick ( evt.< com.google.gwt.user.client.Event > cast ( ) ) ) { com.google.gerrit.client.Gerrit.display ( e.getAttribute ( "href" ) . substring ( 1 ) ) ; evt.preventDefault ( ) ; return false ; } return true ; }
Source:
private void verifyComment ( com.google.gerrit.reviewdb.client.PatchLineComment c ) { com.google.common.base.Preconditions.checkArgument ( ( ( c.getRevId ( ) ) != null ) ) ; com.google.common.base.Preconditions.checkArgument ( ( ( c.getStatus ( ) ) == ( PatchLineComment.Status.PUBLISHED ) ) , ( "Cannot add a draft comment to a ChangeUpdate. Use a ChangeDraftUpdate" + " for draft comments" ) ) ; com.google.common.base.Preconditions.checkArgument ( c.getAuthor ( ) . equals ( getUser ( ) . getAccountId ( ) ) , ( "The author for the following comment does not match the author of" + " this ChangeDraftUpdate (%s): %s" ) , getUser ( ) . getAccountId ( ) , c ) ; }

Target:
public void deleteComment ( com.google.gerrit.reviewdb.client.PatchLineComment c ) { verifyComment ( c ) ; if ( ( c.getStatus ( ) ) == ( PatchLineComment.Status.DRAFT ) ) { createDraftUpdateIfNull ( ) . deleteComment ( c ) ; } else { throw new java.lang.IllegalArgumentException ( ( "Cannot delete published comment " + c ) ) ; } }
Source:
public void testUpsertTwoNotExistingZeroLengthArray ( ) throws com.google.gwtorm.client.OrmException , java.sql.SQLException { java.sql.PreparedStatement update = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.AbstractTestJdbcAccess.UPDATE ) ; java.sql.PreparedStatement insert = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.AbstractTestJdbcAccess.INSERT , 1 , 1 ) ; classUnderTest.upsert ( twoRows ) ; assertCorrectUpdating ( update , 1 , 2 ) ; assertCorrectUpdating ( insert , 1 , 2 ) ; }

Target:
public void testUpsertTwoNotExistingZeroLengthArray ( ) throws com.google.gwtorm.server.OrmException , java.sql.SQLException { java.sql.PreparedStatement update = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.AbstractTestJdbcAccess.UPDATE ) ; java.sql.PreparedStatement insert = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.AbstractTestJdbcAccess.INSERT , 1 , 1 ) ; classUnderTest.upsert ( twoRows ) ; assertCorrectAttempting ( update , 1 , 2 ) ; assertCorrectUpdating ( insert , 1 , 2 ) ; }
Source:
public final void onSuccess ( com.google.gerrit.client.changes.ChangeList result ) { if ( isAttached ( ) ) { if ( ( ( result.length ( ) ) == 1 ) && ( com.google.gerrit.client.changes.QueryScreen.isSingleQuery ( query ) ) ) { com.google.gerrit.client.changes.ChangeInfo c = result.get ( 0 ) ; com.google.gerrit.reviewdb.client.Change.Id id = c.legacyId ( ) ; com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( id ) ) ; } else { display ( result ) ; this . display ( ) ; } } }

Target:
public final void onSuccess ( com.google.gerrit.client.changes.ChangeList result ) { if ( isAttached ( ) ) { if ( ( ( result.length ( ) ) == 1 ) && ( com.google.gerrit.client.changes.QueryScreen.isSingleQuery ( query ) ) ) { com.google.gerrit.client.info.ChangeInfo c = result.get ( 0 ) ; com.google.gerrit.reviewdb.client.Change.Id id = c.legacyId ( ) ; com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( id ) ) ; } else { display ( result ) ; this . display ( ) ; } } }
Source:
public void newPatchSetByOtherOnReviewableChangeNotifyOwnerInReviewDb ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isFalse ( ) ; com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) ; pushTo ( sc , "refs/for/master%notify=OWNER" , other ) ; assertThat ( sender ) . sent ( "newpatchset" , sc ) . to ( sc.reviewer , sc.ccer ) . notTo ( sc.owner , sc.starrer , other ) . notTo ( sc.reviewerByEmail , sc.ccerByEmail ) . notTo ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) ; }

Target:
public void newPatchSetOnWipChangeAddingReviewer ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageWipChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) ; com.google.gerrit.acceptance.TestAccount newReviewer = sc.testAccount ( "newReviewer" ) ; pushTo ( sc , ( "refs/for/master%r=" + ( newReviewer.username ) ) , sc.owner ) ; assertThat ( sender ) . notSent ( ) ; }
Source:
private void replyGenericError ( javax.servlet.http.HttpServletResponse res ) throws java.io.IOException { if ( ! ( res.isCommitted ( ) ) ) { res.reset ( ) ; res.setStatus ( javax.servlet.http.HttpServletResponse.SC_INTERNAL_SERVER_ERROR ) ; res.setHeader ( HttpHeaders.CONTENT_TYPE , "text/plain; charset=ISO-8859-1" ) ; res.setContentLength ( com.google.gerrit.pgm.http.jetty.HiddenErrorHandler.MSG.length ) ; try { com.google.gwtexpui.server.CacheHeaders.setNotCacheable ( res ) ; } finally { javax.servlet.ServletOutputStream out = res.getOutputStream ( ) ; try { out.write ( com.google.gerrit.pgm.http.jetty.HiddenErrorHandler.MSG ) ; } finally { out.close ( ) ; } } } }

Target:
private void reply ( org.eclipse.jetty.server.AbstractHttpConnection conn , javax.servlet.http.HttpServletResponse res ) throws java.io.IOException { byte [ ] msg = com.google.gerrit.pgm.http.jetty.HiddenErrorHandler.message ( conn ) ; res.setHeader ( HttpHeaders.CONTENT_TYPE , "text/plain; charset=ISO-8859-1" ) ; res.setContentLength ( msg.length ) ; try { com.google.gwtexpui.server.CacheHeaders.setNotCacheable ( res ) ; } finally { javax.servlet.ServletOutputStream out = res.getOutputStream ( ) ; try { out.write ( msg ) ; } finally { out.close ( ) ; } } }