auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void assertIsNotAllProjects ( com.google.gerrit.server.project.ProjectResource rsrc ) throws com.googlesource.gerrit.plugins.deleteproject.CannotDeleteProjectException { com.google.gerrit.reviewdb.client.Project project = rsrc.getControl ( ) . getProject ( ) ; if ( project.getNameKey ( ) . equals ( allProjectsName ) ) { throw new com.googlesource.gerrit.plugins.deleteproject.CannotDeleteProjectException ( ( "Perhaps you meant to rm -fR " + ( site.site_path ) ) ) ; } }

Target:
private void assertIsNotAllProjects ( com.google.gerrit.server.project.ProjectResource rsrc ) throws com.googlesource.gerrit.plugins.deleteproject.CannotDeleteProjectException { com.google.gerrit.reviewdb.client.Project project = rsrc.getProjectState ( ) . getProject ( ) ; if ( project.getNameKey ( ) . equals ( allProjectsName ) ) { throw new com.googlesource.gerrit.plugins.deleteproject.CannotDeleteProjectException ( ( "Perhaps you meant to rm -fR " + ( site.site_path ) ) ) ; } }
Source:
public void testIsEnabledChangeAbandonedEvent ( ) { java.lang.String [ ] branches = new java.lang.String [ ] { } ; setupIsEnabled ( "true" , null , branches ) ; com.google.gerrit.server.events.ChangeAbandonedEvent event = new com.google.gerrit.server.events.ChangeAbandonedEvent ( ) ; event.change = new com.google.gerrit.server.data.ChangeAttribute ( ) ; event.change.project = "testProject" ; event.change.branch = "testBranch" ; com.googlesource.gerrit.plugins.its.base.its.ItsConfig itsConfig = createItsConfig ( ) ; replayMocks ( ) ; assertTrue ( itsConfig.isEnabled ( event ) ) ; }

Target:
public void testIsEnabledEventDisabled ( ) { java.lang.String [ ] branches = new java.lang.String [ ] { "^refs/heads/testBranch" } ; setupIsEnabled ( "false" , null , branches ) ; com.google.gerrit.server.events.PatchSetCreatedEvent event = new com.google.gerrit.server.events.PatchSetCreatedEvent ( ) ; com.google.gerrit.server.data.ChangeAttribute changeAttribute = new com.google.gerrit.server.data.ChangeAttribute ( ) ; changeAttribute.project = "testProject" ; changeAttribute.branch = "testBranch" ; event.change = com.google.common.base.Suppliers.ofInstance ( changeAttribute ) ; com.googlesource.gerrit.plugins.its.base.its.ItsConfig itsConfig = createItsConfig ( ) ; replayMocks ( ) ; assertFalse ( itsConfig.isEnabled ( event ) ) ; }
Source:
private com.google.common.collect.ImmutableSet < com.google.gerrit.reviewdb.client.AccountGroup.UUID > loadIncludes ( ) throws com.google.gwtorm.server.OrmException { if ( ! ( control.canSeeGroup ( ) ) ) { return com.google.common.collect.ImmutableSet.of ( ) ; } return groups.getIncludes ( db , groupUuid ) . collect ( com.google.common.collect.ImmutableSet.toImmutableSet ( ) ) ; }

Target:
private com.google.common.collect.ImmutableSet < com.google.gerrit.reviewdb.client.AccountGroup.UUID > loadIncludes ( ) { if ( ! ( control.canSeeGroup ( ) ) ) { return com.google.common.collect.ImmutableSet.of ( ) ; } return com.google.common.collect.ImmutableSet.copyOf ( groupIncludeCache.subgroupsOf ( groupUuid ) ) ; }
Source:
public static com.google.gerrit.server.group.db.GroupNameNotes loadForNewGroup ( org.eclipse.jgit.lib.Repository repository , com.google.gerrit.reviewdb.client.AccountGroup.UUID groupUuid , com.google.gerrit.reviewdb.client.AccountGroup.NameKey groupName ) throws com.google.gwtorm.server.OrmDuplicateKeyException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { com.google.gerrit.server.group.db.GroupNameNotes groupNameNotes = new com.google.gerrit.server.group.db.GroupNameNotes ( groupUuid , null , groupName ) ; groupNameNotes.load ( repository ) ; groupNameNotes.ensureNewNameIsNotUsed ( ) ; return groupNameNotes ; }

Target:
public static com.google.gerrit.server.group.db.GroupNameNotes loadForNewGroup ( org.eclipse.jgit.lib.Repository repository , com.google.gerrit.reviewdb.client.AccountGroup.UUID groupUuid , com.google.gerrit.reviewdb.client.AccountGroup.NameKey groupName ) throws com.google.gwtorm.server.OrmDuplicateKeyException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { com.google.common.base.Preconditions.checkNotNull ( groupName ) ; com.google.gerrit.server.group.db.GroupNameNotes groupNameNotes = new com.google.gerrit.server.group.db.GroupNameNotes ( groupUuid , null , groupName ) ; groupNameNotes.load ( repository ) ; groupNameNotes.ensureNewNameIsNotUsed ( ) ; return groupNameNotes ; }
Source:
private java.util.Map < com.google.gerrit.reviewdb.client.Change.Key , com.google.gerrit.reviewdb.client.Change > openChangesByBranch ( com.google.gerrit.reviewdb.client.Branch.NameKey branch ) throws com.google.gwtorm.server.OrmException { final java.util.Map < com.google.gerrit.reviewdb.client.Change.Key , com.google.gerrit.reviewdb.client.Change > r = new java.util.HashMap < > ( ) ; for ( com.google.gerrit.server.query.change.ChangeData cd : queryProvider.get ( ) . byBranchOpen ( branch ) ) { r.put ( cd.change ( ) . getKey ( ) , cd.change ( ) ) ; } return r ; }

Target:
private java.util.Map < com.google.gerrit.reviewdb.client.Change.Key , com.google.gerrit.server.notedb.ChangeNotes > openChangesByBranch ( com.google.gerrit.reviewdb.client.Branch.NameKey branch ) throws com.google.gwtorm.server.OrmException { java.util.Map < com.google.gerrit.reviewdb.client.Change.Key , com.google.gerrit.server.notedb.ChangeNotes > r = new java.util.HashMap < > ( ) ; for ( com.google.gerrit.server.query.change.ChangeData cd : queryProvider.get ( ) . byBranchOpen ( branch ) ) { r.put ( cd.change ( ) . getKey ( ) , cd.notes ( ) ) ; } return r ; }
Source:
public void run ( ) { if ( cmSrc.hasActiveLine ( ) ) { cmDst.setCursor ( net.codemirror.lib.Pos.create ( lineOnOther ( sideSrc , cmSrc.getLineNumber ( cmSrc.activeLine ( ) ) ) . getLine ( ) ) ) ; } cmDst.focus ( ) ; }

Target:
public void run ( ) { if ( cmSrc.extras ( ) . hasActiveLine ( ) ) { cmDst.setCursor ( net.codemirror.lib.Pos.create ( lineOnOther ( sideSrc , cmSrc.getLineNumber ( cmSrc.extras ( ) . activeLine ( ) ) ) . getLine ( ) ) ) ; } cmDst.focus ( ) ; }
Source:
private static int index ( com.google.gerrit.common.data.Permission a ) { if ( a.isLabel ( ) ) { return com.google.gerrit.common.data.Permission.labelIndex ; } int index = com.google.gerrit.common.data.Permission.NAMES_LC.indexOf ( a.getName ( ) . toLowerCase ( ) ) ; return 0 <= index ? index : com.google.gerrit.common.data.Permission.NAMES_LC.size ( ) ; }

Target:
private static int index ( com.google.gerrit.common.data.Permission a ) { if ( com.google.gerrit.common.data.Permission.isLabel ( a.getName ( ) ) ) { return com.google.gerrit.common.data.Permission.labelIndex ; } else if ( com.google.gerrit.common.data.Permission.isLabelAs ( a.getName ( ) ) ) { return com.google.gerrit.common.data.Permission.labelAsIndex ; } int index = com.google.gerrit.common.data.Permission.NAMES_LC.indexOf ( a.getName ( ) . toLowerCase ( ) ) ; return 0 <= index ? index : com.google.gerrit.common.data.Permission.NAMES_LC.size ( ) ; }
Source:
public com.google.gerrit.server.project.ProjectJson.ProjectInfo format ( com.google.gerrit.reviewdb.client.Project p ) { com.google.gerrit.server.project.ProjectJson.ProjectInfo info = new com.google.gerrit.server.project.ProjectJson.ProjectInfo ( ) ; info.name = p.getName ( ) ; com.google.gerrit.reviewdb.client.Project.NameKey parentName = p.getParent ( allProjects ) ; info.parent = ( parentName != null ) ? parentName.get ( ) : null ; info.description = com.google.common.base.Strings.emptyToNull ( p.getDescription ( ) ) ; info.state = p.getState ( ) ; info.finish ( ) ; return info ; }

Target:
public com.google.gerrit.extensions.common.ProjectInfo format ( com.google.gerrit.reviewdb.client.Project p ) { com.google.gerrit.extensions.common.ProjectInfo info = new com.google.gerrit.extensions.common.ProjectInfo ( ) ; info.name = p.getName ( ) ; com.google.gerrit.reviewdb.client.Project.NameKey parentName = p.getParent ( allProjects ) ; info.parent = ( parentName != null ) ? parentName.get ( ) : null ; info.description = com.google.common.base.Strings.emptyToNull ( p.getDescription ( ) ) ; info.state = p.getState ( ) ; info.id = com.google.gerrit.extensions.restapi.Url.encode ( info.name ) ; return info ; }
Source:
void onEditMessage ( int idx ) { com.google.gerrit.client.changes.ChangeFileApi.getMessage ( curr , new com.google.gerrit.client.rpc.GerritCallback < java.lang.String > ( ) { @ java.lang.Override public void onSuccess ( java.lang.String r ) { com.google.gerrit.client.change.EditFileAction edit = new com.google.gerrit.client.change.EditFileAction ( curr , r , com.google.gerrit.reviewdb.client.Patch.COMMIT_MSG , style , editButton , replyButton ) ; edit.onEdit ( ) ; } } ) ; }

Target:
void onDelete ( int idx ) { java.lang.String path = list.get ( idx ) . path ( ) ; com.google.gerrit.client.changes.ChangeFileApi.deleteContent ( curr , path , new com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.VoidResult > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.VoidResult result ) { com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChangeInEditMode ( curr.getParentKey ( ) ) ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { } } ) ; }
Source:
protected void initName ( final java.lang.String method , final com.google.gwtorm.client.Relation rel ) throws com.google.gwtorm.client.OrmException { if ( rel == null ) { throw new com.google.gwtorm.client.OrmException ( ( ( ( ( "Method " + method ) + " is missing " ) + ( com.google.gwtorm.client.Relation.class . getName ( ) ) ) + " annotation" ) ) ; } relation = rel ; methodName = method ; relationName = com.google.gwtorm.schema.Util.any ( relation.name ( ) , com.google.gwtorm.schema.Util.makeSqlFriendly ( methodName ) ) ; }

Target:
protected void initName ( final java.lang.String method , final com.google.gwtorm.server.Relation rel ) throws com.google.gwtorm.server.OrmException { if ( rel == null ) { throw new com.google.gwtorm.server.OrmException ( ( ( ( ( "Method " + method ) + " is missing " ) + ( com.google.gwtorm.server.Relation.class . getName ( ) ) ) + " annotation" ) ) ; } relation = rel ; methodName = method ; relationName = com.google.gwtorm.schema.Util.any ( relation.name ( ) , com.google.gwtorm.schema.Util.makeSqlFriendly ( methodName ) ) ; }
Source:
public com.google.gerrit.extensions.api.accounts.AccountApi id ( java.lang.String id ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return api.create ( accounts.parse ( TopLevelResource.INSTANCE , com.google.gerrit.extensions.restapi.IdString.fromDecoded ( id ) ) ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot parse change" , e ) ; } }

Target:
public com.google.gerrit.extensions.api.accounts.AccountApi id ( java.lang.String id ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return api.create ( accounts.parse ( TopLevelResource.INSTANCE , com.google.gerrit.extensions.restapi.IdString.fromDecoded ( id ) ) ) ; } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( "Cannot parse change" , e ) ; } }
Source:
private static void unified1 ( final java.lang.String token , final com.google.gerrit.reviewdb.client.PatchSet.Id baseId , final com.google.gerrit.reviewdb.client.Patch.Key id ) { com.google.gwt.core.client.GWT.runAsync ( new com.google.gerrit.client.Dispatcher.AsyncSplit ( token ) { @ java.lang.Override public void onSuccess ( ) { com.google.gerrit.client.patches.UnifiedPatchScreen.TopView top = com.google.gerrit.client.Gerrit.getPatchScreenTopView ( ) ; com.google.gerrit.client.Gerrit.display ( token , new com.google.gerrit.client.patches.UnifiedPatchScreen ( id , top , baseId ) ) ; } } ) ; }

Target:
private static void unified ( final java.lang.String token , final com.google.gerrit.reviewdb.client.PatchSet.Id baseId , final com.google.gerrit.reviewdb.client.Patch.Key id ) { com.google.gwt.core.client.GWT.runAsync ( new com.google.gerrit.client.Dispatcher.AsyncSplit ( token ) { @ java.lang.Override public void onSuccess ( ) { com.google.gerrit.client.patches.UnifiedPatchScreen.TopView top = com.google.gerrit.client.Gerrit.getPatchScreenTopView ( ) ; com.google.gerrit.client.Gerrit.display ( token , new com.google.gerrit.client.patches.UnifiedPatchScreen ( id , top , baseId ) ) ; } } ) ; }
Source:
private static java.lang.String addKey ( java.util.List < java.util.Optional < com.google.gerrit.server.account.AccountSshKey > > keys , java.lang.String pub ) { com.google.gerrit.server.account.AccountSshKey.Id keyId = new com.google.gerrit.server.account.AccountSshKey.Id ( new com.google.gerrit.reviewdb.client.Account.Id ( 1 ) , ( ( keys.size ( ) ) + 1 ) ) ; com.google.gerrit.server.account.AccountSshKey key = new com.google.gerrit.server.account.AccountSshKey ( keyId , pub ) ; keys.add ( java.util.Optional.of ( key ) ) ; return ( key.getSshPublicKey ( ) ) + "\n" ; }

Target:
private static java.lang.String addKey ( java.util.List < java.util.Optional < com.google.gerrit.server.account.AccountSshKey > > keys , java.lang.String pub ) { com.google.gerrit.server.account.AccountSshKey key = com.google.gerrit.server.account.AccountSshKey.create ( new com.google.gerrit.reviewdb.client.Account.Id ( 1 ) , ( ( keys.size ( ) ) + 1 ) , pub ) ; keys.add ( java.util.Optional.of ( key ) ) ; return ( key.sshPublicKey ( ) ) + "\n" ; }
Source:
public void listNoChildren ( ) throws java.io.IOException { com.google.gerrit.acceptance.RestResponse r = GET ( ( ( "/projects/" + ( allProjects.get ( ) ) ) + "/children/" ) ) ; org.junit.Assert.assertEquals ( HttpStatus.SC_OK , r.getStatusCode ( ) ) ; java.util.List < com.google.gerrit.acceptance.rest.project.ProjectInfo > children = new com.google.gson.Gson ( ) . fromJson ( r.getReader ( ) , new com.google.gson.reflect.TypeToken < java.util.List < com.google.gerrit.acceptance.rest.project.ProjectInfo > > ( ) { } . getType ( ) ) ; org.junit.Assert.assertTrue ( children.isEmpty ( ) ) ; }

Target:
public void listNoChildren ( ) throws java.io.IOException { com.google.gerrit.acceptance.RestResponse r = GET ( ( ( "/projects/" + ( allProjects.get ( ) ) ) + "/children/" ) ) ; org.junit.Assert.assertEquals ( HttpStatus.SC_OK , r.getStatusCode ( ) ) ; org.junit.Assert.assertTrue ( com.google.gerrit.acceptance.rest.project.ListChildProjectsIT.toProjectInfoList ( r ) . isEmpty ( ) ) ; }
Source:
protected byte [ ] indexRowData ( T obj ) { final long now = java.lang.System.currentTimeMillis ( ) ; final com.google.gwtorm.nosql.IndexKeyBuilder b = new com.google.gwtorm.nosql.IndexKeyBuilder ( ) ; com.google.gwtorm.nosql.generic.GenericAccess.getKeyIndex ( ) . encode ( b , obj ) ; final byte [ ] key = b.toByteArray ( ) ; return IndexRow.CODEC.encode ( com.google.gwtorm.nosql.IndexRow.forKey ( now , key ) ) . toByteArray ( ) ; }

Target:
protected byte [ ] indexRowData ( T obj ) { final long now = java.lang.System.currentTimeMillis ( ) ; final com.google.gwtorm.nosql.IndexKeyBuilder b = new com.google.gwtorm.nosql.IndexKeyBuilder ( ) ; encodePrimaryKey ( b , com.google.gwtorm.nosql.generic.GenericAccess.primaryKey ( obj ) ) ; final byte [ ] key = b.toByteArray ( ) ; return IndexRow.CODEC.encode ( com.google.gwtorm.nosql.IndexRow.forKey ( now , key ) ) . toByteArray ( ) ; }
Source:
public com.google.gerrit.server.account.GroupControl controlFor ( com.google.gerrit.reviewdb.client.AccountGroup.Id groupId ) throws com.google.gerrit.common.errors.NoSuchGroupException { final com.google.gerrit.reviewdb.client.AccountGroup group = groupCache.get ( groupId ) ; if ( group == null ) { throw new com.google.gerrit.common.errors.NoSuchGroupException ( groupId ) ; } return controlFor ( com.google.gerrit.common.data.GroupDescriptions.forAccountGroup ( group ) ) ; }

Target:
public com.google.gerrit.server.account.GroupControl controlFor ( com.google.gerrit.reviewdb.client.AccountGroup.Id groupId ) throws com.google.gerrit.common.errors.NoSuchGroupException { java.util.Optional < com.google.gerrit.server.group.InternalGroup > group = groupCache.get ( groupId ) ; return group.map ( InternalGroupDescription :: new ) . map ( this :: controlFor ) . orElseThrow ( ( ) -> new com.google.gerrit.common.errors.NoSuchGroupException ( groupId ) ) ; }
Source:
private static java.lang.StringBuilder buildRefsPrefix ( java.lang.String prefix , int id ) { java.lang.StringBuilder r = new java.lang.StringBuilder ( ) ; r.append ( prefix ) ; int n = id % 100 ; if ( n < 10 ) { r.append ( '0' ) ; } r.append ( n ) ; r.append ( '/' ) ; r.append ( id ) ; r.append ( '/' ) ; return r ; }

Target:
public static java.lang.String shard ( int id ) { if ( id < 0 ) { return null ; } java.lang.StringBuilder r = new java.lang.StringBuilder ( ) ; int n = id % 100 ; if ( n < 10 ) { r.append ( '0' ) ; } r.append ( n ) ; r.append ( '/' ) ; r.append ( id ) ; return r.toString ( ) ; }
Source:
private java.lang.String varNameOf ( java.lang.String id ) { com.google.gerrit.reviewdb.ApprovalCategory category = categoryMap.get ( new com.google.gerrit.reviewdb.ApprovalCategory.Id ( id ) ) ; if ( category == null ) { category = new com.google.gerrit.reviewdb.ApprovalCategory ( new com.google.gerrit.reviewdb.ApprovalCategory.Id ( id ) , id ) ; } return category.getLabelName ( ) ; }

Target:
private java.lang.String varNameOf ( java.lang.String id ) { com.google.gerrit.reviewdb.client.ApprovalCategory category = categoryMap.get ( new com.google.gerrit.reviewdb.client.ApprovalCategory.Id ( id ) ) ; if ( category == null ) { category = new com.google.gerrit.reviewdb.client.ApprovalCategory ( new com.google.gerrit.reviewdb.client.ApprovalCategory.Id ( id ) , id ) ; } return category.getLabelName ( ) ; }
Source:
protected void doDelete ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse rsp ) { this . healthy = false ; rsp.setStatus ( javax.servlet.http.HttpServletResponse.SC_NO_CONTENT ) ; }

Target:
protected void doPost ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse rsp ) { if ( ! ( currentUserProvider.get ( ) . getCapabilities ( ) . canAdministrateServer ( ) ) ) { sendError ( rsp , javax.servlet.http.HttpServletResponse.SC_FORBIDDEN ) ; return ; } try { setHealthy ( ) ; rsp.setStatus ( javax.servlet.http.HttpServletResponse.SC_NO_CONTENT ) ; } catch ( java.io.IOException e ) { com.ericsson.gerrit.plugins.highavailability.health.HealthServlet.log.error ( "Failed to set healthy" , e ) ; sendError ( rsp , javax.servlet.http.HttpServletResponse.SC_INTERNAL_SERVER_ERROR ) ; } }
Source:
public com.google.gerrit.reviewdb.Change update ( com.google.gerrit.reviewdb.Change c ) { c.setStatus ( Change.Status.MERGED ) ; if ( ! ( merged.equals ( c.currentPatchSetId ( ) ) ) ) { try { c.setCurrentPatchSet ( patchSetInfoFactory.get ( merged ) ) ; } catch ( com.google.gerrit.server.patch.PatchSetInfoNotAvailableException e1 ) { com.google.gerrit.server.git.MergeOp.log.error ( ( "Cannot read merged patch set " + merged ) , e1 ) ; } } com.google.gerrit.server.ChangeUtil.updated ( c ) ; return c ; }

Target:
public com.google.gerrit.reviewdb.Change update ( com.google.gerrit.reviewdb.Change c ) { c.setStatus ( Change.Status.MERGED ) ; c.setMergeable ( true ) ; if ( ! ( merged.equals ( c.currentPatchSetId ( ) ) ) ) { try { c.setCurrentPatchSet ( patchSetInfoFactory.get ( merged ) ) ; } catch ( com.google.gerrit.server.patch.PatchSetInfoNotAvailableException e1 ) { com.google.gerrit.server.git.MergeOp.log.error ( ( "Cannot read merged patch set " + merged ) , e1 ) ; } } com.google.gerrit.server.ChangeUtil.updated ( c ) ; return c ; }
Source:
private void logError ( java.lang.String msg , java.lang.Throwable t ) { if ( com.google.gerrit.server.git.MergeOp.log.isErrorEnabled ( ) ) { if ( t != null ) { com.google.gerrit.server.git.MergeOp.log.error ( ( ( ( "[" + ( submissionId ) ) + "]" ) + msg ) , t ) ; } else { com.google.gerrit.server.git.MergeOp.log.error ( ( ( ( "[" + ( submissionId ) ) + "]" ) + msg ) ) ; } } }

Target:
private void logWarn ( java.lang.String msg ) { if ( com.google.gerrit.server.git.MergeOp.log.isWarnEnabled ( ) ) { com.google.gerrit.server.git.MergeOp.log.warn ( ( ( submissionId ) + msg ) ) ; } }
Source:
public void validNewChange ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = insertChange ( ) ; insertPatchSet ( c ) ; incrementPatchSet ( c ) ; insertPatchSet ( c ) ; assertProblems ( c ) ; }

Target:
public void patchSetObjectAndRefMissingWithFix ( ) throws java.lang.Exception { java.lang.String rev = "deadbeefdeadbeefdeadbeefdeadbeefdeadbeef" ; com.google.gerrit.server.project.ChangeControl ctl = insertChange ( ) ; com.google.gerrit.reviewdb.client.PatchSet ps = insertMissingPatchSet ( ctl , rev ) ; ctl = reload ( ctl ) ; java.lang.String refName = ps.getId ( ) . toRefName ( ) ; assertProblems ( ctl , new com.google.gerrit.extensions.api.changes.FixInput ( ) , com.google.gerrit.acceptance.server.change.ConsistencyCheckerIT.problem ( ( "Ref missing: " + refName ) ) , com.google.gerrit.acceptance.server.change.ConsistencyCheckerIT.problem ( ( "Object missing: patch set 2: " + rev ) ) ) ; }
Source:
public com.google.gwtorm.client.OrmException convertError ( final java.lang.String op , final java.lang.String entity , final java.sql.SQLException err ) { switch ( getSQLStateInt ( err ) ) { case 23505 : return new com.google.gwtorm.client.OrmDuplicateKeyException ( entity , err ) ; case 23514 : case 23503 : case 23502 : case 23001 : default : return super . convertError ( op , entity , err ) ; } }

Target:
public com.google.gwtorm.server.OrmException convertError ( final java.lang.String op , final java.lang.String entity , final java.sql.SQLException err ) { switch ( getSQLStateInt ( err ) ) { case 23505 : return new com.google.gwtorm.server.OrmDuplicateKeyException ( entity , err ) ; case 23514 : case 23503 : case 23502 : case 23001 : default : return super . convertError ( op , entity , err ) ; } }
Source:
private org.asciidoctor.Options createOptions ( java.io.File tmpFile ) { org.asciidoctor.OptionsBuilder optionsBuilder = org.asciidoctor.OptionsBuilder.options ( ) ; optionsBuilder.backend ( backend ) . docType ( AsciiDoctor.DOCTYPE ) . eruby ( AsciiDoctor.ERUBY ) ; optionsBuilder.toFile ( tmpFile ) ; org.asciidoctor.AttributesBuilder attributesBuilder = org.asciidoctor.AttributesBuilder.attributes ( ) ; attributesBuilder.attributes ( getAttributes ( ) ) ; optionsBuilder.attributes ( attributesBuilder.get ( ) ) ; return optionsBuilder.get ( ) ; }

Target:
private org.asciidoctor.Options createOptions ( java.io.File outputFile ) { org.asciidoctor.OptionsBuilder optionsBuilder = org.asciidoctor.OptionsBuilder.options ( ) ; optionsBuilder.backend ( backend ) . docType ( AsciiDoctor.DOCTYPE ) . eruby ( AsciiDoctor.ERUBY ) . safe ( SafeMode.UNSAFE ) ; optionsBuilder.toFile ( outputFile ) ; org.asciidoctor.AttributesBuilder attributesBuilder = org.asciidoctor.AttributesBuilder.attributes ( ) ; attributesBuilder.attributes ( getAttributes ( ) ) ; optionsBuilder.attributes ( attributesBuilder.get ( ) ) ; return optionsBuilder.get ( ) ; }
Source:
private boolean isLive ( final java.io.File entry ) { final java.lang.String name = entry.getName ( ) ; return ( ( ( ( ( ErrorLogFile.LOG_NAME.equals ( name ) ) || ( GarbageCollection.LOG_NAME.equals ( name ) ) ) || ( "sshd_log" . equals ( name ) ) ) || ( "httpd_log" . equals ( name ) ) ) || ( "gerrit.run" . equals ( name ) ) ) || ( name.endsWith ( ".pid" ) ) ; }

Target:
private boolean isLive ( final java.io.File entry ) { final java.lang.String name = entry.getName ( ) ; return ( ( ( name.endsWith ( "_log" ) ) || ( name.endsWith ( ".log" ) ) ) || ( name.endsWith ( ".run" ) ) ) || ( name.endsWith ( ".pid" ) ) ; }
Source:
public T call ( ) throws java.lang.Exception { com.google.gerrit.server.util.RequestContext old = local.setContext ( new com.google.gerrit.server.util.RequestContext ( ) { @ java.lang.Override public com.google.gerrit.server.CurrentUser getUser ( ) { return context.getUser ( ) ; } @ java.lang.Override public com.google.inject.Provider < com.google.gerrit.reviewdb.server.ReviewDb > getReviewDbProvider ( ) { return dbProviderProvider.get ( ) ; } } ) ; try { return callable.call ( ) ; } finally { local.setContext ( old ) ; } }

Target:
protected < T > java.util.concurrent.Callable < T > context ( final com.google.gerrit.server.util.RequestContext context , final java.util.concurrent.Callable < T > callable ) { return ( ) -> { com.google.gerrit.server.util.RequestContext old = local.setContext ( new com.google.gerrit.server.util.RequestContext ( ) { @ java.lang.Override public com.google.gerrit.server.CurrentUser getUser ( ) { return context.getUser ( ) ; } @ java.lang.Override public com.google.inject.Provider < com.google.gerrit.reviewdb.server.ReviewDb > getReviewDbProvider ( ) { return dbProviderProvider.get ( ) ; } } ) ; try { return callable.call ( ) ; } finally { local.setContext ( old ) ; } } ; }
Source:
private GitilesView.Builder parseNoCommand ( java.lang.String repoName ) { return com.google.gitiles.GitilesView.repositoryIndex ( ) . setRepositoryName ( repoName ) ; }

Target:
private GitilesView.Builder parseNoCommand ( javax.servlet.http.HttpServletRequest req , java.lang.String repoName ) { if ( ( req.getAttribute ( org.eclipse.jgit.http.server.ServletUtils.ATTRIBUTE_REPOSITORY ) ) == null ) { return com.google.gitiles.GitilesView.hostIndex ( ) . setRepositoryPrefix ( repoName ) ; } return com.google.gitiles.GitilesView.repositoryIndex ( ) . setRepositoryName ( repoName ) ; }
Source:
public void isEnabledForRegexRef ( ) throws java.lang.Exception { com.googlesource.gerrit.plugins.uploadvalidator.ValidatorConfig config = getConfig ( ( "[plugin \"uploadvalidator\"]\n" + ( " ref = ^refs/heads/mybranch.*\n" + " blockedFileExtension = jar" ) ) ) ; com.google.common.truth.Truth.assertThat ( config.isEnabledForRef ( projectName , "refs/heads/anotherref" , "blockedFileExtension" ) ) . isFalse ( ) ; com.google.common.truth.Truth.assertThat ( config.isEnabledForRef ( projectName , "refs/heads/mybranch123" , "blockedFileExtension" ) ) . isTrue ( ) ; }

Target:
public void isDisabledForInvalidRef ( ) throws java.lang.Exception { com.googlesource.gerrit.plugins.uploadvalidator.ValidatorConfig config = getConfig ( ( "[plugin \"uploadvalidator\"]\n" + ( " ref = anInvalidRef\n" + " blockedFileExtension = jar" ) ) ) ; com.google.common.truth.Truth.assertThat ( config.isEnabledForRef ( anyUser , projectName , "refs/heads/anyref" , "blockedFileExtension" ) ) . isFalse ( ) ; }
Source:
private void preDisplay ( final com.google.gerrit.common.data.PatchSetPublishDetail pubDetail , final com.google.gerrit.client.rpc.ScreenLoadCallback < com.google.gerrit.common.data.PatchSetPublishDetail > origCb ) { com.google.gerrit.client.projects.ConfigInfoCache.get ( pubDetail.getChange ( ) . getProject ( ) , new com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.projects.ConfigInfoCache.Entry > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.projects.ConfigInfoCache.Entry result ) { commentLinkProcessor = result.getCommentLinkProcessor ( ) ; setTheme ( result.getTheme ( ) ) ; display ( pubDetail ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { origCb.onFailure ( caught ) ; } } ) ; }

Target:
private void preDisplay ( final com.google.gerrit.client.changes.ChangeInfo info ) { com.google.gerrit.client.projects.ConfigInfoCache.get ( info.project_name_key ( ) , new com.google.gerrit.client.rpc.ScreenLoadCallback < com.google.gerrit.client.projects.ConfigInfoCache.Entry > ( this ) { @ java.lang.Override protected void preDisplay ( com.google.gerrit.client.projects.ConfigInfoCache.Entry result ) { send.setEnabled ( true ) ; commentLinkProcessor = result.getCommentLinkProcessor ( ) ; setTheme ( result.getTheme ( ) ) ; displayScreen ( ) ; } @ java.lang.Override protected void postDisplay ( ) { message.setFocus ( true ) ; } } ) ; }
Source:
public com.google.gerrit.server.query.DataSource < com.google.gerrit.reviewdb.client.AccountGroup > getSource ( com.google.gerrit.server.query.Predicate < com.google.gerrit.reviewdb.client.AccountGroup > p , com.google.gerrit.server.index.QueryOptions opts ) throws com.google.gerrit.index.query.QueryParseException { return new com.google.gerrit.lucene.LuceneGroupIndex.QuerySource ( opts , queryBuilder.toQuery ( p ) , new org.apache.lucene.search.Sort ( new org.apache.lucene.search.SortField ( com.google.gerrit.lucene.LuceneGroupIndex.UUID_SORT_FIELD , SortField.Type.STRING , false ) ) ) ; }

Target:
public com.google.gerrit.index.query.DataSource < com.google.gerrit.reviewdb.client.AccountGroup > getSource ( com.google.gerrit.index.query.Predicate < com.google.gerrit.reviewdb.client.AccountGroup > p , com.google.gerrit.index.QueryOptions opts ) throws com.google.gerrit.index.query.QueryParseException { return new com.google.gerrit.lucene.LuceneGroupIndex.QuerySource ( opts , queryBuilder.toQuery ( p ) , new org.apache.lucene.search.Sort ( new org.apache.lucene.search.SortField ( com.google.gerrit.lucene.LuceneGroupIndex.UUID_SORT_FIELD , SortField.Type.STRING , false ) ) ) ; }
Source:
public void changeProjectAccess ( com.google.gerrit.reviewdb.Project.NameKey projectName , java.lang.String baseRevision , java.lang.String msg , java.util.List < com.google.gerrit.common.data.AccessSection > sections , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.common.data.ProjectAccess > cb ) { org.eclipse.jgit.lib.ObjectId base ; if ( ( baseRevision != null ) && ( ! ( baseRevision.isEmpty ( ) ) ) ) { base = org.eclipse.jgit.lib.ObjectId.fromString ( baseRevision ) ; } else { base = null ; } changeProjectAccessFactory.create ( projectName , base , sections , msg ) . to ( cb ) ; }

Target:
private static org.eclipse.jgit.lib.ObjectId getBase ( final java.lang.String baseRevision ) { if ( ( baseRevision != null ) && ( ! ( baseRevision.isEmpty ( ) ) ) ) { return org.eclipse.jgit.lib.ObjectId.fromString ( baseRevision ) ; } return null ; }
Source:
public void invalidKey ( ) throws java.lang.Exception { com.google.gerrit.gpg.testutil.TestKey key3 = com.google.gerrit.gpg.testutil.TestKeys.key3 ( ) ; org.eclipse.jgit.transport.PushCertificate cert = newSignedCert ( validNonce ( ) , key3 ) ; assertProblems ( cert , ( ( "Invalid public key " + ( com.google.gerrit.gpg.PublicKeyStore.keyToString ( key3.getPublicKey ( ) ) ) ) + ":\n Key is expired" ) ) ; }

Target:
public void invalidKey ( ) throws java.lang.Exception { com.google.gerrit.gpg.testutil.TestKey key3 = com.google.gerrit.gpg.testutil.TestKeys.expiredKey ( ) ; org.eclipse.jgit.transport.PushCertificate cert = newSignedCert ( validNonce ( ) , key3 ) ; assertProblems ( cert , ( ( "Invalid public key " + ( com.google.gerrit.gpg.PublicKeyStore.keyToString ( key3.getPublicKey ( ) ) ) ) + ":\n Key is expired" ) ) ; }
Source:
protected void configure ( ) { bind ( org.eclipse.jgit.lib.Config.class ) . annotatedWith ( com.google.gerrit.server.config.GerritServerConfig.class ) . toInstance ( new org.eclipse.jgit.lib.Config ( ) ) ; bind ( com.google.gerrit.reviewdb.SystemConfig.class ) . toInstance ( systemConfig ) ; bind ( com.google.gerrit.server.config.AuthConfig.class ) ; }

Target:
protected void configure ( ) { bind ( org.eclipse.jgit.lib.Config.class ) . annotatedWith ( com.google.gerrit.server.config.GerritServerConfig.class ) . toInstance ( new org.eclipse.jgit.lib.Config ( ) ) ; bind ( CapabilityControl.Factory.class ) . toProvider ( com.google.inject.assistedinject.FactoryProvider.newFactory ( CapabilityControl.Factory.class , com.google.gerrit.server.account.CapabilityControl.class ) ) ; bind ( com.google.gerrit.server.project.ProjectCache.class ) . toInstance ( projectCache ) ; bind ( com.google.gerrit.reviewdb.SystemConfig.class ) . toInstance ( systemConfig ) ; bind ( com.google.gerrit.server.config.AuthConfig.class ) ; }
Source:
public void listenTo ( final com.google.gwt.user.client.ui.TextBoxBase tb ) { strings.put ( tb , tb.getText ( ) ) ; tb.addKeyPressHandler ( this ) ; tb.addMouseUpHandler ( this ) ; tb.addFocusHandler ( new com.google.gwt.event.dom.client.FocusHandler ( ) { @ java.lang.Override public void onFocus ( com.google.gwt.event.dom.client.FocusEvent event ) { strings.put ( tb , tb.getText ( ) ) ; } } ) ; tb.addKeyDownHandler ( this ) ; }

Target:
public void listenTo ( final com.google.gwt.user.client.ui.TextBoxBase tb ) { strings.put ( tb , tb.getText ( ) . trim ( ) ) ; tb.addKeyPressHandler ( this ) ; tb.addMouseUpHandler ( this ) ; tb.addFocusHandler ( new com.google.gwt.event.dom.client.FocusHandler ( ) { @ java.lang.Override public void onFocus ( com.google.gwt.event.dom.client.FocusEvent event ) { strings.put ( tb , tb.getText ( ) . trim ( ) ) ; } } ) ; tb.addKeyDownHandler ( this ) ; }
Source:
public static com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > create ( java.util.Collection < com.google.gerrit.reviewdb.client.Account.Id > ids ) { java.util.List < com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > > predicates = new java.util.ArrayList ( ids.size ( ) ) ; for ( com.google.gerrit.reviewdb.client.Account.Id id : ids ) { predicates.add ( new com.google.gerrit.server.query.change.IsReviewedPredicate ( id ) ) ; } return com.google.gerrit.server.query.Predicate.or ( predicates ) ; }

Target:
public static com.google.gerrit.index.query.Predicate < com.google.gerrit.server.query.change.ChangeData > create ( java.util.Collection < com.google.gerrit.reviewdb.client.Account.Id > ids ) { java.util.List < com.google.gerrit.index.query.Predicate < com.google.gerrit.server.query.change.ChangeData > > predicates = new java.util.ArrayList ( ids.size ( ) ) ; for ( com.google.gerrit.reviewdb.client.Account.Id id : ids ) { predicates.add ( new com.google.gerrit.server.query.change.IsReviewedPredicate ( id ) ) ; } return com.google.gerrit.index.query.Predicate.or ( predicates ) ; }
Source:
public void onBeginNegotiateRound ( org.eclipse.jgit.transport.UploadPack up , java.util.Collection < ? extends org.eclipse.jgit.lib.ObjectId > wants , int cntOffered ) throws org.eclipse.jgit.transport.ServiceMayNotContinueException { }

Target:
public void onBeginNegotiateRound ( org.eclipse.jgit.transport.UploadPack up , java.util.Collection < ? extends org.eclipse.jgit.lib.ObjectId > wants , int cntOffered ) throws org.eclipse.jgit.transport.ServiceMayNotContinueException { for ( com.google.gerrit.server.git.validators.UploadValidationListener validator : uploadValidationListeners ) { try { validator.onBeginNegotiate ( repository , project , remoteHost , up , wants , cntOffered ) ; } catch ( com.google.gerrit.server.validators.ValidationException e ) { throw new com.google.gerrit.server.git.validators.UploadValidationException ( e.getMessage ( ) ) ; } } }
Source:
public int compare ( com.google.gerrit.common.data.ApprovalDetail o1 , com.google.gerrit.common.data.ApprovalDetail o2 ) { return ( o1.hasNonZero ) - ( o2.hasNonZero ) ; }

Target:
public int compare ( com.google.gerrit.common.data.ApprovalDetail o1 , com.google.gerrit.common.data.ApprovalDetail o2 ) { int byOwner = ( ( o2.account.get ( ) ) == owner ? 1 : 0 ) - ( ( o1.account.get ( ) ) == owner ? 1 : 0 ) ; return byOwner != 0 ? byOwner : ( o1.hasNonZero ) - ( o2.hasNonZero ) ; }
Source:
private void init ( final java.lang.reflect.Field field , final org.eclipse.jgit.lib.Config cfg ) throws java.lang.IllegalAccessException , java.lang.IllegalArgumentException { final java.lang.String n = field.getName ( ) ; final com.google.gerrit.pgm.util.LibraryDownloader dl = new com.google.gerrit.pgm.util.LibraryDownloader ( ui , sitePath ) ; dl.setName ( com.google.gerrit.pgm.util.Libraries.get ( cfg , n , "name" ) ) ; dl.setJarUrl ( com.google.gerrit.pgm.util.Libraries.get ( cfg , n , "url" ) ) ; dl.setSHA1 ( com.google.gerrit.pgm.util.Libraries.get ( cfg , n , "sha1" ) ) ; field.set ( this , dl ) ; }

Target:
private void init ( final java.lang.reflect.Field field , final org.eclipse.jgit.lib.Config cfg ) throws java.lang.IllegalAccessException , java.lang.IllegalArgumentException { final java.lang.String n = field.getName ( ) ; final com.google.gerrit.pgm.init.LibraryDownloader dl = downloadProvider.get ( ) ; dl.setName ( com.google.gerrit.pgm.init.Libraries.get ( cfg , n , "name" ) ) ; dl.setJarUrl ( com.google.gerrit.pgm.init.Libraries.get ( cfg , n , "url" ) ) ; dl.setSHA1 ( com.google.gerrit.pgm.init.Libraries.get ( cfg , n , "sha1" ) ) ; field.set ( this , dl ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { try { java.lang.Class.forName ( com.google.gwtorm.schema.sql.DialectOracleSQLTest.ORACLE_DRIVER ) ; } catch ( java.lang.Exception e ) { org.junit.Assume.assumeNoException ( e ) ; } final java.lang.String sid = "xe" ; final java.lang.String user = "gwtorm" ; final java.lang.String pass = "gwtorm" ; db = java.sql.DriverManager.getConnection ( ( "jdbc:oracle:thin:@localhost:1521:" + sid ) , user , pass ) ; executor = new com.google.gwtorm.jdbc.JdbcExecutor ( db ) ; dialect = new com.google.gwtorm.schema.sql.DialectOracle ( ) . refine ( db ) ; final java.util.Properties p = new java.util.Properties ( ) ; p.setProperty ( "driver" , com.google.gwtorm.schema.sql.DialectOracleSQLTest.ORACLE_DRIVER ) ; p.setProperty ( "url" , db.getMetaData ( ) . getURL ( ) ) ; p.setProperty ( "user" , user ) ; p.setProperty ( "password" , pass ) ; phoneBook = new com.google.gwtorm.jdbc.Database < com.google.gwtorm.data.PhoneBookDb > ( new com.google.gwtorm.jdbc.SimpleDataSource ( p ) , com.google.gwtorm.data.PhoneBookDb.class ) ; phoneBook2 = new com.google.gwtorm.jdbc.Database < com.google.gwtorm.data.PhoneBookDb2 > ( new com.google.gwtorm.jdbc.SimpleDataSource ( p ) , com.google.gwtorm.data.PhoneBookDb2.class ) ; drop ( "SEQUENCE address_id" ) ; drop ( "SEQUENCE cnt" ) ; drop ( "TABLE addresses" ) ; drop ( "TABLE foo" ) ; drop ( "TABLE bar" ) ; drop ( "TABLE people" ) ; }

Target:
public void tearDown ( ) { drop ( "SEQUENCE address_id" ) ; drop ( "SEQUENCE cnt" ) ; drop ( "TABLE addresses" ) ; drop ( "TABLE foo" ) ; drop ( "TABLE bar" ) ; drop ( "TABLE people" ) ; if ( ( executor ) != null ) { executor.close ( ) ; } executor = null ; if ( ( db ) != null ) { try { db.close ( ) ; } catch ( java.sql.SQLException e ) { throw new java.lang.RuntimeException ( "Cannot close database" , e ) ; } } db = null ; }
Source:
public void onKeyPress ( final com.google.gwt.event.dom.client.KeyPressEvent event ) { onStarClick ( getCurrentRow ( ) ) ; }

Target:
public void onKeyPress ( final com.google.gwt.event.dom.client.KeyPressEvent event ) { int row = getCurrentRow ( ) ; com.google.gerrit.client.changes.ChangeInfo c = getRowItem ( row ) ; if ( ( c != null ) && ( com.google.gerrit.client.Gerrit.isSignedIn ( ) ) ) { ( ( com.google.gerrit.client.changes.StarredChanges.Icon ) ( table.getWidget ( row , com.google.gerrit.client.changes.ChangeTable2.C_STAR ) ) ) . toggleStar ( ) ; } }
Source:
private com.google.gerrit.server.data.PatchSetAttribute asPatchSetAttribute ( com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.reviewdb.client.PatchSet patchSet , com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( change.getProject ( ) ) ; org.eclipse.jgit.revwalk.RevWalk revWalk = new org.eclipse.jgit.revwalk.RevWalk ( repo ) ) { return eventFactory.asPatchSetAttribute ( db , revWalk , patchSet ) ; } catch ( java.io.IOException e ) { throw new com.google.gwtorm.server.OrmException ( e ) ; } }

Target:
public com.google.gerrit.server.data.PatchSetAttribute get ( ) { try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( change.getProject ( ) ) ; org.eclipse.jgit.revwalk.RevWalk revWalk = new org.eclipse.jgit.revwalk.RevWalk ( repo ) ) { return eventFactory.asPatchSetAttribute ( revWalk , patchSet ) ; } catch ( java.io.IOException e ) { throw com.google.common.base.Throwables.propagate ( e ) ; } }
Source:
public boolean canDelete ( ) { switch ( getCurrentUser ( ) . getAccessPath ( ) ) { case WEB : return ( isOwner ( ) ) || ( canPerform ( com.google.gerrit.reviewdb.ApprovalCategory.PUSH_HEAD , com.google.gerrit.reviewdb.ApprovalCategory.PUSH_HEAD_REPLACE ) ) ; case SSH : return canPerform ( com.google.gerrit.reviewdb.ApprovalCategory.PUSH_HEAD , com.google.gerrit.reviewdb.ApprovalCategory.PUSH_HEAD_REPLACE ) ; default : return false ; } }

Target:
public boolean canDelete ( ) { switch ( getCurrentUser ( ) . getAccessPath ( ) ) { case WEB_UI : return ( isOwner ( ) ) || ( canPerform ( com.google.gerrit.reviewdb.ApprovalCategory.PUSH_HEAD , com.google.gerrit.reviewdb.ApprovalCategory.PUSH_HEAD_REPLACE ) ) ; case GIT : return canPerform ( com.google.gerrit.reviewdb.ApprovalCategory.PUSH_HEAD , com.google.gerrit.reviewdb.ApprovalCategory.PUSH_HEAD_REPLACE ) ; default : return false ; } }
Source:
private javax.naming.directory.DirContext open ( ) throws javax.naming.NamingException { final java.util.Properties env = createContextProperties ( ) ; if ( ( username ) != null ) { env.put ( javax.naming.Context.SECURITY_AUTHENTICATION , "simple" ) ; env.put ( javax.naming.Context.SECURITY_PRINCIPAL , username ) ; env.put ( javax.naming.Context.SECURITY_CREDENTIALS , ( ( password ) != null ? password : "" ) ) ; } return new javax.naming.directory.InitialDirContext ( env ) ; }

Target:
private javax.naming.directory.DirContext open ( ) throws javax.naming.NamingException { final java.util.Properties env = createContextProperties ( ) ; if ( ( username ) != null ) { env.put ( javax.naming.Context.SECURITY_AUTHENTICATION , "simple" ) ; env.put ( javax.naming.Context.SECURITY_PRINCIPAL , username ) ; env.put ( javax.naming.Context.SECURITY_CREDENTIALS , ( ( password ) != null ? password : "" ) ) ; env.put ( javax.naming.Context.REFERRAL , ( ( referral ) != null ? referral : "ignore" ) ) ; } return new javax.naming.directory.InitialDirContext ( env ) ; }
Source:
void onOpenForm ( ) { com.google.gwt.user.client.ui.UIObject.setVisible ( form , true ) ; com.google.gwt.user.client.ui.UIObject.setVisible ( show , false ) ; com.google.gwt.user.client.ui.UIObject.setVisible ( error , false ) ; editAssigneeIcon.setVisible ( false ) ; suggestBox.setFocus ( true ) ; if ( ( currentAssignee ) != null ) { suggestBox.setText ( com.google.gerrit.client.FormatUtil.nameEmail ( currentAssignee ) ) ; suggestBox.selectAll ( ) ; } }

Target:
void onOpenForm ( ) { com.google.gwt.user.client.ui.UIObject.setVisible ( form , true ) ; com.google.gwt.user.client.ui.UIObject.setVisible ( show , false ) ; com.google.gwt.user.client.ui.UIObject.setVisible ( error , false ) ; editAssigneeIcon.setVisible ( false ) ; suggestBox.setFocus ( true ) ; if ( ( currentAssignee ) != null ) { suggestBox.setText ( com.google.gerrit.client.FormatUtil.nameEmail ( currentAssignee ) ) ; suggestBox.selectAll ( ) ; } else { suggestBox.setText ( "" ) ; } }
Source:
protected void onLoad ( ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { org.eclipse.jgit.lib.ObjectId rev = getRevision ( ) ; if ( rev == null ) { return ; } org.eclipse.jgit.revwalk.RevWalk walk = new org.eclipse.jgit.revwalk.RevWalk ( reader ) ; try ( com.google.gerrit.server.notedb.DraftCommentNotes.Parser parser = new com.google.gerrit.server.notedb.DraftCommentNotes.Parser ( getChangeId ( ) , walk , rev , repoManager , draftsProject , author ) ) { parser.parseDraftComments ( ) ; buildCommentTable ( draftBaseComments , parser.draftBaseComments ) ; buildCommentTable ( draftPsComments , parser.draftPsComments ) ; noteMap = parser.noteMap ; } finally { walk.release ( ) ; } }

Target:
protected void onLoad ( ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { org.eclipse.jgit.lib.ObjectId rev = getRevision ( ) ; if ( rev == null ) { return ; } org.eclipse.jgit.revwalk.RevWalk walk = new org.eclipse.jgit.revwalk.RevWalk ( reader ) ; try ( com.google.gerrit.server.notedb.DraftCommentNotesParser parser = new com.google.gerrit.server.notedb.DraftCommentNotesParser ( getChangeId ( ) , walk , rev , repoManager , draftsProject , author ) ) { parser.parseDraftComments ( ) ; buildCommentTable ( draftBaseComments , parser.draftBaseComments ) ; buildCommentTable ( draftPsComments , parser.draftPsComments ) ; noteMap = parser.noteMap ; } finally { walk.release ( ) ; } }
Source:
public void onClick ( com.google.gwt.user.client.ui.Widget sender ) { final boolean oldValue = k.isGroupOwner ( ) ; final boolean newValue = owner.isChecked ( ) ; Util.ADMIN_SVC.changeGroupOwner ( k.getKey ( ) , newValue , new com.google.gerrit.client.rpc.GerritCallback < com.google.gwtjsonrpc.client.VoidResult > ( ) { public void onSuccess ( final com.google.gwtjsonrpc.client.VoidResult result ) { k.setGroupOwner ( newValue ) ; } @ java.lang.Override public void onFailure ( final java.lang.Throwable caught ) { owner.setChecked ( oldValue ) ; k.setGroupOwner ( oldValue ) ; super . onFailure ( caught ) ; } } ) ; }

Target:
public void onClick ( com.google.gwt.user.client.ui.Widget sender ) { final boolean oldValue = k.isGroupOwner ( ) ; final boolean newValue = owner.isChecked ( ) ; Util.GROUP_SVC.changeGroupOwner ( k.getKey ( ) , newValue , new com.google.gerrit.client.rpc.GerritCallback < com.google.gwtjsonrpc.client.VoidResult > ( ) { public void onSuccess ( final com.google.gwtjsonrpc.client.VoidResult result ) { k.setGroupOwner ( newValue ) ; } @ java.lang.Override public void onFailure ( final java.lang.Throwable caught ) { owner.setChecked ( oldValue ) ; k.setGroupOwner ( oldValue ) ; super . onFailure ( caught ) ; } } ) ; }
Source:
private void replace ( com.google.gerrit.server.git.ProjectConfig config , java.util.Set < java.lang.String > toDelete , com.google.gerrit.common.data.AccessSection section ) throws com.google.gerrit.common.errors.NoSuchGroupException { for ( com.google.gerrit.common.data.Permission permission : section.getPermissions ( ) ) { for ( com.google.gerrit.common.data.PermissionRule rule : permission.getRules ( ) ) { lookupGroup ( rule ) ; } } config.replace ( section ) ; toDelete.remove ( section.getName ( ) ) ; }

Target:
private boolean replace ( com.google.gerrit.server.git.ProjectConfig config , java.util.Set < java.lang.String > toDelete , com.google.gerrit.common.data.AccessSection section ) throws com.google.gerrit.common.errors.NoSuchGroupException { for ( com.google.gerrit.common.data.Permission permission : section.getPermissions ( ) ) { for ( com.google.gerrit.common.data.PermissionRule rule : permission.getRules ( ) ) { lookupGroup ( rule ) ; } } boolean differs = ! ( section.equals ( config.getAccessSection ( section.getName ( ) ) ) ) ; config.replace ( section ) ; toDelete.remove ( section.getName ( ) ) ; return differs ; }
Source:
public java.sql.Timestamp deserialize ( final com.google.gson.JsonElement json , final java.lang.reflect.Type typeOfT , final com.google.gson.JsonDeserializationContext context ) throws com.google.gson.JsonParseException { if ( json.isJsonNull ( ) ) { return null ; } if ( ! ( json.isJsonPrimitive ( ) ) ) { throw new com.google.gson.JsonParseException ( "Expected string for timestamp type" ) ; } final com.google.gson.JsonPrimitive p = ( ( com.google.gson.JsonPrimitive ) ( json ) ) ; if ( ! ( p.isString ( ) ) ) { throw new com.google.gson.JsonParseException ( "Expected string for timestamp type" ) ; } return com.google.gwtjsonrpc.client.impl.ser.JavaSqlTimestamp_JsonSerializer.parseTimestamp ( p.getAsString ( ) ) ; }

Target:
public java.sql.Timestamp deserialize ( final com.google.gson.JsonElement json , final java.lang.reflect.Type typeOfT , final com.google.gson.JsonDeserializationContext context ) throws com.google.gson.JsonParseException { if ( json.isJsonNull ( ) ) { return null ; } if ( ! ( json.isJsonPrimitive ( ) ) ) { throw new com.google.gson.JsonParseException ( "Expected string for timestamp type" ) ; } final com.google.gson.JsonPrimitive p = ( ( com.google.gson.JsonPrimitive ) ( json ) ) ; if ( ! ( p.isString ( ) ) ) { throw new com.google.gson.JsonParseException ( "Expected string for timestamp type" ) ; } return com.google.gwtjsonrpc.common.JavaSqlTimestampHelper.parseTimestamp ( p.getAsString ( ) ) ; }