auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public com.google.gerrit.extensions.restapi.Response < java.lang.String > apply ( com.google.gerrit.server.change.ChangeResource rsrc , com.google.gerrit.server.change.Unmute.Input input ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.StarredChangesUtil.IllegalLabelException , com.google.gwtorm.server.OrmException { if ( ( rsrc.isUserOwner ( ) ) || ( ! ( isMuted ( rsrc.getChange ( ) ) ) ) ) { return com.google.gerrit.extensions.restapi.Response.ok ( "" ) ; } stars.unmute ( self.get ( ) . getAccountId ( ) , rsrc.getProject ( ) , rsrc.getChange ( ) ) ; return com.google.gerrit.extensions.restapi.Response.ok ( "" ) ; }

Target:
public com.google.gerrit.extensions.restapi.Response < java.lang.String > apply ( com.google.gerrit.server.change.ChangeResource rsrc , com.google.gerrit.server.change.Unmute.Input input ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.StarredChangesUtil.IllegalLabelException , com.google.gwtorm.server.OrmException { if ( ( rsrc.isUserOwner ( ) ) || ( ! ( isMuted ( rsrc.getChange ( ) ) ) ) ) { return com.google.gerrit.extensions.restapi.Response.ok ( "" ) ; } stars.unmute ( rsrc ) ; return com.google.gerrit.extensions.restapi.Response.ok ( "" ) ; }
Source:
public com.google.gwtjsonrpc.client.VoidResult run ( final com.google.gerrit.client.reviewdb.ReviewDb db ) throws com.google.gerrit.server.rpc.account.Failure , com.google.gwtorm.client.OrmException { final com.google.gerrit.client.reviewdb.AccountGroup group = db.accountGroups ( ) . get ( groupId ) ; assertAmGroupOwner ( db , group ) ; group.setDescription ( description ) ; db.accountGroups ( ) . update ( java.util.Collections.singleton ( group ) ) ; groupCache.evict ( groupId ) ; return com.google.gwtjsonrpc.client.VoidResult.INSTANCE ; }

Target:
public com.google.gwtjsonrpc.client.VoidResult run ( final com.google.gerrit.client.reviewdb.ReviewDb db ) throws com.google.gerrit.server.rpc.account.Failure , com.google.gwtorm.client.OrmException { final com.google.gerrit.client.reviewdb.AccountGroup group = db.accountGroups ( ) . get ( groupId ) ; assertAmGroupOwner ( db , group ) ; group.setDescription ( description ) ; db.accountGroups ( ) . update ( java.util.Collections.singleton ( group ) ) ; groupCache.evict ( group ) ; return com.google.gwtjsonrpc.client.VoidResult.INSTANCE ; }
Source:
public void index ( com.google.gerrit.reviewdb.client.AccountGroup.UUID uuid ) throws java.io.IOException { for ( com.google.gerrit.index.Index < com.google.gerrit.reviewdb.client.AccountGroup.UUID , com.google.gerrit.server.group.InternalGroup > i : getWriteIndexes ( ) ) { java.util.Optional < com.google.gerrit.server.group.InternalGroup > internalGroup = groupCache.getInternalGroup ( uuid ) ; if ( internalGroup.isPresent ( ) ) { i.replace ( internalGroup.get ( ) ) ; } else { i.delete ( uuid ) ; } } fireGroupIndexedEvent ( uuid.get ( ) ) ; }

Target:
public void index ( com.google.gerrit.reviewdb.client.AccountGroup.UUID uuid ) throws java.io.IOException { for ( com.google.gerrit.index.Index < com.google.gerrit.reviewdb.client.AccountGroup.UUID , com.google.gerrit.server.group.InternalGroup > i : getWriteIndexes ( ) ) { java.util.Optional < com.google.gerrit.server.group.InternalGroup > internalGroup = groupCache.get ( uuid ) ; if ( internalGroup.isPresent ( ) ) { i.replace ( internalGroup.get ( ) ) ; } else { i.delete ( uuid ) ; } } fireGroupIndexedEvent ( uuid.get ( ) ) ; }
Source:
public com.google.common.base.Optional < com.google.gerrit.reviewdb.client.Account.Id > load ( java.lang.String username ) throws java.lang.Exception { final com.google.gerrit.reviewdb.server.ReviewDb db = schema.open ( ) ; try { final com.google.gerrit.reviewdb.client.AccountExternalId extId = db.accountExternalIds ( ) . get ( new com.google.gerrit.reviewdb.client.AccountExternalId.Key ( com.google.gerrit.reviewdb.client.AccountExternalId.SCHEME_GERRIT , username ) ) ; if ( extId != null ) { return com.google.common.base.Optional.of ( extId.getAccountId ( ) ) ; } return com.google.common.base.Optional.absent ( ) ; } finally { db.close ( ) ; } }

Target:
public com.google.common.base.Optional < com.google.gerrit.reviewdb.client.Account.Id > load ( java.lang.String username ) throws java.lang.Exception { try ( com.google.gerrit.reviewdb.server.ReviewDb db = schema.open ( ) ) { final com.google.gerrit.reviewdb.client.AccountExternalId extId = db.accountExternalIds ( ) . get ( new com.google.gerrit.reviewdb.client.AccountExternalId.Key ( com.google.gerrit.reviewdb.client.AccountExternalId.SCHEME_GERRIT , username ) ) ; if ( extId != null ) { return com.google.common.base.Optional.of ( extId.getAccountId ( ) ) ; } return com.google.common.base.Optional.absent ( ) ; } }
Source:
public void onLoad ( ) { if ( ( tabs ) == null ) { initUI ( ) ; } super . onLoad ( ) ; tabs.selectTab ( tabTokens.indexOf ( initialTabToken ) ) ; Util.PROJECT_SVC.projectDetail ( projectId , new com.google.gerrit.client.rpc.ScreenLoadCallback < com.google.gerrit.client.admin.ProjectDetail > ( this ) { @ java.lang.Override protected void preDisplay ( final com.google.gerrit.client.admin.ProjectDetail result ) { display ( result ) ; } } ) ; }

Target:
protected void preDisplay ( final com.google.gerrit.client.admin.ProjectDetail result ) { display ( result ) ; tabs.selectTab ( tabTokens.indexOf ( initialTabToken ) ) ; }
Source:
public void start ( ) { if ( ! ( com.googlesource.gerrit.plugins.replication.ReplicationLogFile.started ) ) { org.apache.log4j.Logger replicationLogger = org.apache.log4j.LogManager.getLogger ( ReplicationQueue.REPLICATION_LOG_NAME ) ; java.lang.String loggerName = replicationLogger.getName ( ) ; org.apache.log4j.AsyncAppender asyncAppender = systemLog.createAsyncAppender ( loggerName , new org.apache.log4j.PatternLayout ( ( ( "[%d] [%X{" + ( PushOne.ID_MDC_KEY ) ) + "}] %m%n" ) ) ) ; replicationLogger.removeAppender ( loggerName ) ; replicationLogger.addAppender ( asyncAppender ) ; replicationLogger.setAdditivity ( false ) ; com.googlesource.gerrit.plugins.replication.ReplicationLogFile.started = true ; } }

Target:
public void start ( ) { org.apache.log4j.Logger replicationLogger = org.apache.log4j.LogManager.getLogger ( ReplicationQueue.REPLICATION_LOG_NAME ) ; java.lang.String loggerName = replicationLogger.getName ( ) ; org.apache.log4j.AsyncAppender asyncAppender = systemLog.createAsyncAppender ( loggerName , new org.apache.log4j.PatternLayout ( ( ( "[%d] [%X{" + ( PushOne.ID_MDC_KEY ) ) + "}] %m%n" ) ) ) ; replicationLogger.removeAppender ( loggerName ) ; replicationLogger.addAppender ( asyncAppender ) ; replicationLogger.setAdditivity ( false ) ; }
Source:
public static void message ( int id , java.lang.String commit , java.lang.String message , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gwt.core.client.JavaScriptObject > cb ) { com.google.gerrit.client.changes.ChangeApi.CherryPickInput input = com.google.gerrit.client.changes.ChangeApi.CherryPickInput.create ( ) ; input.setMessage ( message ) ; com.google.gerrit.client.changes.ChangeApi.call ( id , commit , "message" ) . post ( input , cb ) ; }

Target:
public static void message ( @ com.google.gerrit.common.Nullable java.lang.String project , int id , java.lang.String commit , java.lang.String message , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gwt.core.client.JavaScriptObject > cb ) { com.google.gerrit.client.changes.ChangeApi.CherryPickInput input = com.google.gerrit.client.changes.ChangeApi.CherryPickInput.create ( ) ; input.setMessage ( message ) ; com.google.gerrit.client.changes.ChangeApi.call ( project , id , commit , "message" ) . post ( input , cb ) ; }
Source:
public void onLoad ( ) { super . onLoad ( ) ; Util.PROJECT_SVC.projectDetail ( projectId , new com.google.gerrit.client.rpc.ScreenLoadCallback < com.google.gerrit.client.admin.ProjectDetail > ( this ) { @ java.lang.Override protected void preDisplay ( final com.google.gerrit.client.admin.ProjectDetail result ) { display ( result ) ; tabs.selectTab ( tabTokens.indexOf ( initialTabToken ) ) ; } } ) ; }

Target:
protected void onLoad ( ) { super . onLoad ( ) ; Util.PROJECT_SVC.projectDetail ( projectId , new com.google.gerrit.client.rpc.ScreenLoadCallback < com.google.gerrit.client.admin.ProjectDetail > ( this ) { @ java.lang.Override protected void preDisplay ( final com.google.gerrit.client.admin.ProjectDetail result ) { display ( result ) ; tabs.selectTab ( tabTokens.indexOf ( initialTabToken ) ) ; } } ) ; }
Source:
private org.eclipse.jgit.lib.ObjectId createNoteContent ( org.eclipse.jgit.revwalk.RevCommit c ) throws com.google.gwtorm.server.OrmException , java.io.IOException { com.googlesource.gerrit.plugins.reviewnotes.HeaderFormatter fmt = new com.googlesource.gerrit.plugins.reviewnotes.HeaderFormatter ( gerritServerIdent.getTimeZone ( ) , anonymousCowardName ) ; com.google.gerrit.reviewdb.client.PatchSet ps = loadPatchSet ( c ) ; if ( ps != null ) { try { createCodeReviewNote ( ps , fmt ) ; return getInserter ( ) . insert ( Constants.OBJ_BLOB , fmt.toString ( ) . getBytes ( "UTF-8" ) ) ; } catch ( com.google.gerrit.server.project.NoSuchChangeException e ) { throw new java.io.IOException ( e ) ; } } return null ; }

Target:
private org.eclipse.jgit.lib.ObjectId createNoteContent ( com.google.gerrit.reviewdb.client.PatchSet ps ) throws com.google.gwtorm.server.OrmException , java.io.IOException { com.googlesource.gerrit.plugins.reviewnotes.HeaderFormatter fmt = new com.googlesource.gerrit.plugins.reviewnotes.HeaderFormatter ( gerritServerIdent.getTimeZone ( ) , anonymousCowardName ) ; if ( ps != null ) { try { createCodeReviewNote ( ps , fmt ) ; return getInserter ( ) . insert ( Constants.OBJ_BLOB , fmt.toString ( ) . getBytes ( "UTF-8" ) ) ; } catch ( com.google.gerrit.server.project.NoSuchChangeException e ) { throw new java.io.IOException ( e ) ; } } return null ; }
Source:
public boolean match ( com.google.gerrit.server.query.change.ChangeData object ) throws com.google.gwtorm.server.OrmException { try { for ( com.google.gerrit.server.query.change.ChangeData cData : index.getSource ( com.google.gerrit.server.query.Predicate.and ( new com.google.gerrit.server.query.change.LegacyChangeIdPredicate ( args , object.getId ( ) ) , this ) , 1 ) . read ( ) ) { if ( cData.getId ( ) . equals ( object.getId ( ) ) ) { return true ; } } } catch ( com.google.gerrit.server.query.QueryParseException e ) { throw new com.google.gwtorm.server.OrmException ( e ) ; } return false ; }

Target:
public boolean match ( com.google.gerrit.server.query.change.ChangeData object ) throws com.google.gwtorm.server.OrmException { try { for ( com.google.gerrit.server.query.change.ChangeData cData : index.getSource ( com.google.gerrit.server.query.Predicate.and ( new com.google.gerrit.server.query.change.LegacyChangeIdPredicate ( args , object.getId ( ) ) , this ) , 0 , 1 ) . read ( ) ) { if ( cData.getId ( ) . equals ( object.getId ( ) ) ) { return true ; } } } catch ( com.google.gerrit.server.query.QueryParseException e ) { throw new com.google.gwtorm.server.OrmException ( e ) ; } return false ; }
Source:
public com.google.common.collect.SetMultimap < com.google.gerrit.reviewdb.client.Project.NameKey , com.google.gerrit.reviewdb.client.Branch.NameKey > branchesByProject ( ) throws com.google.gwtorm.server.OrmException { com.google.common.collect.SetMultimap < com.google.gerrit.reviewdb.client.Project.NameKey , com.google.gerrit.reviewdb.client.Branch.NameKey > ret = com.google.common.collect.HashMultimap.create ( ) ; for ( com.google.gerrit.server.query.change.ChangeData cd : changeData ) { ret.put ( cd.change ( ) . getProject ( ) , cd.change ( ) . getDest ( ) ) ; } return ret ; }

Target:
public com.google.common.collect.SetMultimap < com.google.gerrit.reviewdb.client.Project.NameKey , com.google.gerrit.reviewdb.client.Branch.NameKey > branchesByProject ( ) throws com.google.gwtorm.server.OrmException { com.google.common.collect.SetMultimap < com.google.gerrit.reviewdb.client.Project.NameKey , com.google.gerrit.reviewdb.client.Branch.NameKey > ret = com.google.common.collect.HashMultimap.create ( ) ; for ( com.google.gerrit.server.query.change.ChangeData cd : changeData.values ( ) ) { ret.put ( cd.change ( ) . getProject ( ) , cd.change ( ) . getDest ( ) ) ; } return ret ; }
Source:
private static java.lang.String legacyAll ( final java.lang.String token ) { if ( com.google.gerrit.client.Dispatcher.matchPrefix ( "all,abandoned," , token ) ) { return com.google.gerrit.common.PageLinks.toChangeQuery ( "status:abandoned" , com.google.gerrit.client.Dispatcher.skip ( token ) ) ; } if ( com.google.gerrit.client.Dispatcher.matchPrefix ( "all,merged," , token ) ) { return com.google.gerrit.common.PageLinks.toChangeQuery ( "status:merged" , com.google.gerrit.client.Dispatcher.skip ( token ) ) ; } if ( com.google.gerrit.client.Dispatcher.matchPrefix ( "all,open," , token ) ) { return com.google.gerrit.common.PageLinks.toChangeQuery ( "status:open" , com.google.gerrit.client.Dispatcher.skip ( token ) ) ; } return null ; }

Target:
private static java.lang.String legacyAll ( final java.lang.String token ) { if ( com.google.gerrit.client.Dispatcher.matchPrefix ( "all,abandoned," , token ) ) { return com.google.gerrit.common.PageLinks.toChangeQuery ( "status:abandoned" ) ; } if ( com.google.gerrit.client.Dispatcher.matchPrefix ( "all,merged," , token ) ) { return com.google.gerrit.common.PageLinks.toChangeQuery ( "status:merged" ) ; } if ( com.google.gerrit.client.Dispatcher.matchPrefix ( "all,open," , token ) ) { return com.google.gerrit.common.PageLinks.toChangeQuery ( "status:open" ) ; } return null ; }
Source:
public static void projectDefault ( com.google.gerrit.reviewdb.client.Project.NameKey project , boolean mine , com.google.gwtjsonrpc.common.AsyncCallback < com.google.gerrit.client.dashboards.DashboardMap > callback ) { new com.google.gerrit.client.rpc.RestApi ( ( "/dashboards/project/" + ( com.google.gwt.http.client.URL.encode ( project.get ( ) ) . replaceAll ( "[?]" , "%3F" ) ) ) ) . addParameterTrue ( "default" ) . send ( com.google.gerrit.client.rpc.NativeMap.copyKeysIntoChildren ( callback ) ) ; }

Target:
public static void projectDefault ( com.google.gerrit.reviewdb.client.Project.NameKey project , com.google.gwtjsonrpc.common.AsyncCallback < com.google.gerrit.client.dashboards.DashboardMap > callback ) { new com.google.gerrit.client.rpc.RestApi ( ( "/dashboards/project/" + ( com.google.gwt.http.client.URL.encode ( project.get ( ) ) . replaceAll ( "[?]" , "%3F" ) ) ) ) . addParameterTrue ( "default" ) . send ( com.google.gerrit.client.rpc.NativeMap.copyKeysIntoChildren ( callback ) ) ; }
Source:
protected void renderJson ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse res , java.lang.Object src , java.lang.reflect.Type typeOfSrc ) throws java.io.IOException { setApiHeaders ( req , res , com.google.gitiles.FormatType.JSON ) ; res.setStatus ( javax.servlet.http.HttpServletResponse.SC_OK ) ; java.io.PrintWriter writer = res.getWriter ( ) ; new com.google.gson.GsonBuilder ( ) . setFieldNamingPolicy ( com.google.gson.FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES ) . setPrettyPrinting ( ) . generateNonExecutableJson ( ) . create ( ) . toJson ( src , typeOfSrc , writer ) ; writer.print ( '\n' ) ; writer.close ( ) ; }

Target:
protected void renderJson ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse res , java.lang.Object src , java.lang.reflect.Type typeOfSrc ) throws java.io.IOException { setApiHeaders ( res , com.google.gitiles.FormatType.JSON ) ; res.setStatus ( javax.servlet.http.HttpServletResponse.SC_OK ) ; java.io.PrintWriter writer = res.getWriter ( ) ; new com.google.gson.GsonBuilder ( ) . setFieldNamingPolicy ( com.google.gson.FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES ) . setPrettyPrinting ( ) . generateNonExecutableJson ( ) . create ( ) . toJson ( src , typeOfSrc , writer ) ; writer.print ( '\n' ) ; writer.close ( ) ; }
Source:
public com.google.gerrit.server.change.PatchSetInserter setMessage ( java.lang.String message ) throws com.google.gwtorm.server.OrmException , java.io.IOException { init ( ) ; changeMessage = new com.google.gerrit.reviewdb.client.ChangeMessage ( new com.google.gerrit.reviewdb.client.ChangeMessage.Key ( ctl.getChange ( ) . getId ( ) , com.google.gerrit.server.ChangeUtil.messageUUID ( db ) ) , user.getAccountId ( ) , com.google.gerrit.common.TimeUtil.nowTs ( ) , patchSet.getId ( ) ) ; changeMessage.setMessage ( message ) ; return this ; }

Target:
public com.google.gerrit.server.change.PatchSetInserter setMessage ( java.lang.String message ) { this . message = message ; return this ; }
Source:
public static com.google.gerrit.server.util.LabelVote parseWithEquals ( java.lang.String text ) { com.google.common.base.Preconditions.checkArgument ( ( ! ( com.google.common.base.Strings.isNullOrEmpty ( text ) ) ) , "Empty label vote" ) ; int e = text.lastIndexOf ( '=' ) ; com.google.common.base.Preconditions.checkArgument ( ( e >= 0 ) , "Label vote missing '=': %s" , text ) ; return com.google.gerrit.server.util.LabelVote.create ( text.substring ( 0 , e ) , java.lang.Short.parseShort ( text.substring ( ( e + 1 ) ) , text.length ( ) ) ) ; }

Target:
public static com.google.gerrit.server.util.LabelVote parseWithEquals ( java.lang.String text ) { com.google.common.base.Preconditions.checkArgument ( ( ! ( com.google.common.base.Strings.isNullOrEmpty ( text ) ) ) , "Empty label vote" ) ; int e = text.lastIndexOf ( '=' ) ; com.google.common.base.Preconditions.checkArgument ( ( e >= 0 ) , "Label vote missing '=': %s" , text ) ; return com.google.gerrit.server.util.LabelVote.create ( text.substring ( 0 , e ) , java.lang.Short.parseShort ( text.substring ( ( e + 1 ) ) ) ) ; }
Source:
protected com.google.gitiles.FakeHttpServletResponse buildResponse ( java.lang.String path , java.lang.String queryString , int expectedStatus ) throws java.lang.Exception { com.google.gitiles.FakeHttpServletRequest req = com.google.gitiles.FakeHttpServletRequest.newRequest ( ) ; req.setPathInfo ( path ) ; if ( queryString != null ) { req.setQueryString ( queryString ) ; } com.google.gitiles.FakeHttpServletResponse res = new com.google.gitiles.FakeHttpServletResponse ( ) ; servlet.service ( req , res ) ; org.junit.Assert.assertEquals ( expectedStatus , res.getStatus ( ) ) ; return res ; }

Target:
protected com.google.gitiles.FakeHttpServletResponse buildResponse ( java.lang.String path , java.lang.String queryString , int expectedStatus ) throws java.lang.Exception { com.google.gitiles.FakeHttpServletRequest req = com.google.gitiles.FakeHttpServletRequest.newRequest ( ) ; req.setPathInfo ( path ) ; if ( queryString != null ) { req.setQueryString ( queryString ) ; } com.google.gitiles.FakeHttpServletResponse res = new com.google.gitiles.FakeHttpServletResponse ( ) ; servlet.service ( req , res ) ; com.google.common.truth.Truth.assertThat ( res.getStatus ( ) ) . isEqualTo ( expectedStatus ) ; return res ; }
Source:
protected void setPageTitle ( final java.lang.String text ) { final java.lang.String old = headerText.getText ( ) ; if ( text.isEmpty ( ) ) { header.setVisible ( false ) ; } else { headerText.setText ( text ) ; header.setVisible ( true ) ; } if ( ( ( windowTitle ) == null ) || ( ( windowTitle ) == old ) ) { setWindowTitle ( text ) ; } }

Target:
protected void setPageTitle ( final java.lang.String text ) { final java.lang.String old = headerText.getText ( ) ; if ( text.isEmpty ( ) ) { header.setVisible ( false ) ; } else { headerText.setText ( text ) ; header.setVisible ( true ) ; } if ( ( ( windowTitle ) == null ) || ( windowTitle.equals ( old ) ) ) { setWindowTitle ( text ) ; } }
Source:
private static com.google.common.collect.Multimap < java.lang.String , java.io.File > asMultimap ( java.util.List < java.io.File > plugins ) throws java.io.IOException { com.google.common.collect.Multimap < java.lang.String , java.io.File > map = com.google.common.collect.LinkedHashMultimap.create ( ) ; for ( java.io.File srcFile : plugins ) { map.put ( com.google.gerrit.server.plugins.PluginLoader.getPluginName ( srcFile ) , srcFile ) ; } return map ; }

Target:
private com.google.common.collect.Multimap < java.lang.String , java.io.File > asMultimap ( java.util.List < java.io.File > plugins ) throws java.io.IOException { com.google.common.collect.Multimap < java.lang.String , java.io.File > map = com.google.common.collect.LinkedHashMultimap.create ( ) ; for ( java.io.File srcFile : plugins ) { map.put ( getPluginName ( srcFile ) , srcFile ) ; } return map ; }
Source:
private java.util.Date parseDate ( java.lang.String date ) throws java.text.ParseException { java.util.Date parsedDate ; try { parsedDate = com.ericsson.gerrit.plugins.eventslog.sql.SQLQueryMaker.DATE_TIME_FORMAT.parse ( date ) ; } catch ( java.text.ParseException e ) { parsedDate = com.ericsson.gerrit.plugins.eventslog.sql.SQLQueryMaker.DATE_ONLY_FORMAT.parse ( date ) ; } return parsedDate ; }

Target:
private java.util.Date parseDate ( java.lang.String date ) throws java.text.ParseException { java.util.Date parsedDate ; try { parsedDate = com.ericsson.gerrit.plugins.eventslog.sql.SQLQueryMaker.DATE_TIME_FORMAT.get ( ) . parse ( date ) ; } catch ( java.text.ParseException e ) { parsedDate = com.ericsson.gerrit.plugins.eventslog.sql.SQLQueryMaker.DATE_ONLY_FORMAT.get ( ) . parse ( date ) ; } return parsedDate ; }
Source:
public void revisionActionsOneChangePerTopic ( ) throws java.lang.Exception { java.lang.String changeId = createChangeWithTopic ( name ( "foo1" ) ) . getChangeId ( ) ; approve ( changeId ) ; java.util.Map < java.lang.String , com.google.gerrit.extensions.common.ActionInfo > actions = getActions ( changeId ) ; commonActionsAssertions ( actions ) ; noSubmitWholeTopicAssertions ( actions ) ; }

Target:
public void revisionActionsOneChangePerTopic ( ) throws java.lang.Exception { java.lang.String changeId = createChangeWithTopic ( ) . getChangeId ( ) ; approve ( changeId ) ; java.util.Map < java.lang.String , com.google.gerrit.extensions.common.ActionInfo > actions = getActions ( changeId ) ; commonActionsAssertions ( actions ) ; noSubmitWholeTopicAssertions ( actions ) ; }
Source:
private com.google.gerrit.server.account.AccountState makeUser ( java.lang.String name , java.lang.String email ) { final com.google.gerrit.reviewdb.client.Account.Id userId = new com.google.gerrit.reviewdb.client.Account.Id ( 42 ) ; final com.google.gerrit.reviewdb.client.Account account = new com.google.gerrit.reviewdb.client.Account ( userId , com.google.gerrit.common.TimeUtil.nowTs ( ) ) ; account.setFullName ( name ) ; account.setPreferredEmail ( email ) ; return new com.google.gerrit.server.account.AccountState ( new com.google.gerrit.server.config.AllUsersName ( com.google.gerrit.server.config.AllUsersNameProvider.DEFAULT ) , account , java.util.Collections.emptySet ( ) , java.util.Collections.emptySet ( ) , new java.util.HashMap < > ( ) ) ; }

Target:
private com.google.gerrit.server.account.AccountState makeUser ( java.lang.String name , java.lang.String email ) { final com.google.gerrit.reviewdb.client.Account.Id userId = new com.google.gerrit.reviewdb.client.Account.Id ( 42 ) ; final com.google.gerrit.reviewdb.client.Account account = new com.google.gerrit.reviewdb.client.Account ( userId , com.google.gerrit.common.TimeUtil.nowTs ( ) ) ; account.setFullName ( name ) ; account.setPreferredEmail ( email ) ; return new com.google.gerrit.server.account.AccountState ( new com.google.gerrit.server.config.AllUsersName ( com.google.gerrit.server.config.AllUsersNameProvider.DEFAULT ) , account , java.util.Collections.emptySet ( ) , new java.util.HashMap < > ( ) ) ; }
Source:
protected PushOneCommit.Result amendChange ( java.lang.String changeId , java.lang.String ref ) throws java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { java.util.Collections.shuffle ( com.google.gerrit.acceptance.AbstractDaemonTest.RANDOM ) ; com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , admin.getIdent ( ) , PushOneCommit.SUBJECT , PushOneCommit.FILE_NAME , new java.lang.String ( com.google.common.primitives.Chars.toArray ( com.google.gerrit.acceptance.AbstractDaemonTest.RANDOM ) ) , changeId ) ; return push.to ( git , ref ) ; }

Target:
protected PushOneCommit.Result amendChange ( java.lang.String changeId , java.lang.String ref ) throws java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { java.util.Collections.shuffle ( com.google.gerrit.acceptance.AbstractDaemonTest.RANDOM ) ; com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , admin.getIdent ( ) , git , PushOneCommit.SUBJECT , PushOneCommit.FILE_NAME , new java.lang.String ( com.google.common.primitives.Chars.toArray ( com.google.gerrit.acceptance.AbstractDaemonTest.RANDOM ) ) , changeId ) ; return push.to ( ref ) ; }
Source:
private java.util.List < com.google.gerrit.reviewdb.client.Change > allChanges ( ) { com.google.gerrit.reviewdb.server.ReviewDb db = null ; try { db = database.open ( ) ; return db.changes ( ) . all ( ) . toList ( ) ; } catch ( com.google.gwtorm.server.OrmException e ) { stderr.println ( ( "Cannot read changes from database " + ( e.getMessage ( ) ) ) ) ; return java.util.Collections.emptyList ( ) ; } finally { if ( db != null ) { db.close ( ) ; } } }

Target:
private java.util.List < com.google.gerrit.reviewdb.client.Change > allChanges ( ) { try ( com.google.gerrit.reviewdb.server.ReviewDb db = database.open ( ) ) { return db.changes ( ) . all ( ) . toList ( ) ; } catch ( com.google.gwtorm.server.OrmException e ) { stderr.println ( ( "Cannot read changes from database " + ( e.getMessage ( ) ) ) ) ; return java.util.Collections.emptyList ( ) ; } }
Source:
private java.util.List < com.google.gerrit.extensions.common.SuggestedReviewerInfo > suggestReviewers ( com.google.gerrit.server.api.changes.SuggestedReviewersRequest r ) throws com.google.gerrit.extensions.restapi.RestApiException { try { com.google.gerrit.server.change.SuggestChangeReviewers mySuggestReviewers = suggestReviewers.get ( ) ; mySuggestReviewers.setQuery ( r.getQuery ( ) ) ; mySuggestReviewers.setLimit ( r.getLimit ( ) ) ; return mySuggestReviewers.apply ( change ) ; } catch ( com.google.gwtorm.server.OrmException | java.io.IOException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot retrieve suggested reviewers" , e ) ; } }

Target:
private java.util.List < com.google.gerrit.extensions.common.SuggestedReviewerInfo > suggestReviewers ( com.google.gerrit.server.api.changes.SuggestedReviewersRequest r ) throws com.google.gerrit.extensions.restapi.RestApiException { try { suggestReviewers.setQuery ( r.getQuery ( ) ) ; suggestReviewers.setLimit ( r.getLimit ( ) ) ; return suggestReviewers.apply ( change ) ; } catch ( com.google.gwtorm.server.OrmException | java.io.IOException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot retrieve suggested reviewers" , e ) ; } }
Source:
public void testPattern ( ) { com.googlesource.gerrit.plugins.hooks.its.ItsConfig itsConfig = createItsConfig ( ) ; org.easymock.EasyMock.expect ( serverConfig.getString ( "commentlink" , "ItsTestName" , "match" ) ) . andReturn ( "TestPattern" ) . atLeastOnce ( ) ; replayMocks ( ) ; assertEquals ( "Expected and generated pattern are not equal" , "TestPattern" , itsConfig.getIssuePattern ( ) . pattern ( ) ) ; }

Target:
public void testPattern ( ) { com.googlesource.gerrit.plugins.hooks.its.ItsConfig itsConfig = createItsConfig ( ) ; org.easymock.EasyMock.expect ( serverConfig.getString ( "ItsTestName" , null , "commentlink" ) ) . andReturn ( null ) . atLeastOnce ( ) ; org.easymock.EasyMock.expect ( serverConfig.getString ( "commentlink" , "ItsTestName" , "match" ) ) . andReturn ( "TestPattern" ) . atLeastOnce ( ) ; replayMocks ( ) ; assertEquals ( "Expected and generated pattern are not equal" , "TestPattern" , itsConfig.getIssuePattern ( ) . pattern ( ) ) ; }
Source:
public com.google.gerrit.extensions.common.RevisionInfo getRevisionInfo ( com.google.gerrit.server.project.ChangeControl ctl , com.google.gerrit.reviewdb.client.PatchSet in ) throws com.google.gerrit.server.GpgException , com.google.gerrit.server.patch.PatchListNotAvailableException , com.google.gwtorm.server.OrmException , java.io.IOException { accountLoader = accountLoaderFactory.create ( has ( com.google.gerrit.extensions.client.ListChangesOption.DETAILED_ACCOUNTS ) ) ; try ( org.eclipse.jgit.lib.Repository repo = openRepoIfNecessary ( ctl ) ) { com.google.gerrit.extensions.common.RevisionInfo rev = toRevisionInfo ( ctl , changeDataFactory.create ( db.get ( ) , ctl ) , in , repo , true ) ; accountLoader.fill ( ) ; return rev ; } }

Target:
public com.google.gerrit.extensions.common.RevisionInfo getRevisionInfo ( com.google.gerrit.server.project.ChangeControl ctl , com.google.gerrit.reviewdb.client.PatchSet in ) throws com.google.gerrit.server.GpgException , com.google.gerrit.server.patch.PatchListNotAvailableException , com.google.gwtorm.server.OrmException , java.io.IOException { accountLoader = accountLoaderFactory.create ( has ( com.google.gerrit.extensions.client.ListChangesOption.DETAILED_ACCOUNTS ) ) ; try ( org.eclipse.jgit.lib.Repository repo = openRepoIfNecessary ( ctl ) ) { com.google.gerrit.extensions.common.RevisionInfo rev = toRevisionInfo ( ctl , changeDataFactory.create ( db.get ( ) , ctl ) , in , repo , true , null ) ; accountLoader.fill ( ) ; return rev ; } }
Source:
private void save ( com.google.gerrit.server.git.ProjectConfig pc ) throws java.lang.Exception { com.google.gerrit.server.git.MetaDataUpdate md = metaDataUpdateFactory.create ( pc.getProject ( ) . getNameKey ( ) , user ) ; pc.commit ( md ) ; projectCache.evict ( pc.getProject ( ) . getNameKey ( ) ) ; }

Target:
private void save ( com.google.gerrit.server.git.ProjectConfig pc ) throws java.lang.Exception { try ( com.google.gerrit.server.git.MetaDataUpdate md = metaDataUpdateFactory.create ( pc.getProject ( ) . getNameKey ( ) , user ) ) { pc.commit ( md ) ; projectCache.evict ( pc.getProject ( ) . getNameKey ( ) ) ; } }
Source:
public void update ( ) throws com.google.gerrit.server.git.SubmoduleException { try { schema = schemaFactory.open ( ) ; updateSubmoduleSubscriptions ( ) ; updateSuperProjects ( destBranch , rw , mergeTip.getId ( ) . toObjectId ( ) , null ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new com.google.gerrit.server.git.SubmoduleException ( "Cannot open database" , e ) ; } finally { if ( ( schema ) != null ) { schema.close ( ) ; schema = null ; } } }

Target:
public void update ( ) throws com.google.gerrit.server.git.SubmoduleException { try { schema = schemaFactory.open ( ) ; updateSubmoduleSubscriptions ( ) ; updateSuperProjects ( destBranch , rw , mergeTip.getId ( ) . toObjectId ( ) , null ) ; } catch ( com.google.gwtorm.server.OrmException | java.io.IOException e ) { throw new com.google.gerrit.server.git.SubmoduleException ( "Cannot open database" , e ) ; } finally { if ( ( schema ) != null ) { schema.close ( ) ; schema = null ; } } }
Source:
protected void startThread ( final com.google.gerrit.sshd.BaseCommand.CommandRunnable thunk ) { final com.google.gerrit.sshd.BaseCommand.TaskThunk tt = new com.google.gerrit.sshd.BaseCommand.TaskThunk ( thunk ) ; if ( ( isAdminHighPriorityCommand ( ) ) && ( user.get ( ) . getCapabilities ( ) . canAdministrateServer ( ) ) ) { new java.lang.Thread ( tt , tt.toString ( ) ) . start ( ) ; } else { task.set ( executor.submit ( tt ) ) ; } }

Target:
protected void startThread ( final com.google.gerrit.sshd.BaseCommand.CommandRunnable thunk ) { final com.google.gerrit.sshd.BaseCommand.TaskThunk tt = new com.google.gerrit.sshd.BaseCommand.TaskThunk ( thunk ) ; if ( ( isAdminHighPriorityCommand ( ) ) && ( user.getCapabilities ( ) . canAdministrateServer ( ) ) ) { new java.lang.Thread ( tt , tt.toString ( ) ) . start ( ) ; } else { task.set ( executor.submit ( tt ) ) ; } }
Source:
public com.google.gerrit.common.data.Capable canPushToAtLeastOneRef ( ) { if ( ( ! ( canPerformOnAnyRef ( Permission.PUSH ) ) ) && ( ! ( canPerformOnAnyRef ( Permission.PUSH_TAG ) ) ) ) { java.lang.String pName = state.getProject ( ) . getName ( ) ; return new com.google.gerrit.common.data.Capable ( ( ( "Upload denied for project '" + pName ) + "'" ) ) ; } com.google.gerrit.reviewdb.client.Project project = state.getProject ( ) ; if ( project.isUseContributorAgreements ( ) ) { return verifyActiveContributorAgreement ( ) ; } return com.google.gerrit.common.data.Capable.OK ; }

Target:
public com.google.gerrit.common.data.Capable canPushToAtLeastOneRef ( ) { if ( ( ! ( canPerformOnAnyRef ( Permission.PUSH ) ) ) && ( ! ( canPerformOnAnyRef ( Permission.PUSH_TAG ) ) ) ) { java.lang.String pName = state.getProject ( ) . getName ( ) ; return new com.google.gerrit.common.data.Capable ( ( ( "Upload denied for project '" + pName ) + "'" ) ) ; } if ( state.isUseContributorAgreements ( ) ) { return verifyActiveContributorAgreement ( ) ; } return com.google.gerrit.common.data.Capable.OK ; }
Source:
public static com.google.gerrit.client.changes.AccountInfo asInfo ( com.google.gerrit.client.changes.AccountInfo acct ) { return com.google.gerrit.client.changes.AccountInfo.create ( acct.getId ( ) . get ( ) , acct.getFullName ( ) , acct.getPreferredEmail ( ) ) ; }

Target:
public static com.google.gerrit.client.changes.AccountInfo asInfo ( com.google.gerrit.client.changes.AccountInfo acct ) { if ( acct == null ) { return com.google.gerrit.client.changes.AccountInfo.create ( 0 , null , null ) ; } return com.google.gerrit.client.changes.AccountInfo.create ( ( ( acct.getId ( ) ) != null ? acct.getId ( ) . get ( ) : 0 ) , acct.getFullName ( ) , acct.getPreferredEmail ( ) ) ; }
Source:
public void onShowView ( ) { if ( ( windowTitle ) != null ) { com.google.gerrit.client.Gerrit.setWindowTitle ( this , windowTitle ) ; } com.google.gerrit.client.Gerrit.updateMenus ( this ) ; Gerrit.EVENT_BUS.fireEvent ( new com.google.gerrit.client.ui.ScreenLoadEvent ( this ) ) ; com.google.gerrit.client.Gerrit.setQueryString ( null ) ; registerKeys ( ) ; if ( ( theme ) != null ) { Gerrit.THEMER.set ( theme ) ; setTheme = true ; } else { Gerrit.THEMER.clear ( ) ; } }

Target:
public void onShowView ( ) { if ( ( windowTitle ) != null ) { com.google.gerrit.client.Gerrit.setWindowTitle ( this , windowTitle ) ; } Gerrit.EVENT_BUS.fireEvent ( new com.google.gerrit.client.ui.ScreenLoadEvent ( this ) ) ; com.google.gerrit.client.Gerrit.setQueryString ( null ) ; registerKeys ( ) ; if ( ( theme ) != null ) { Gerrit.THEMER.set ( theme ) ; setTheme = true ; } else { Gerrit.THEMER.clear ( ) ; } }
Source:
public void byId ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < com.google.gerrit.testutil.InMemoryRepositoryManager.Repo > repo = createProject ( "repo" ) ; com.google.gerrit.reviewdb.client.Change change1 = insert ( newChange ( repo ) ) ; com.google.gerrit.reviewdb.client.Change change2 = insert ( newChange ( repo ) ) ; assertQuery ( "12345" ) ; assertQuery ( change1.getId ( ) . get ( ) , change1 ) ; assertQuery ( change2.getId ( ) . get ( ) , change2 ) ; }

Target:
public void byId ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < com.google.gerrit.testutil.InMemoryRepositoryManager.Repo > repo = createProject ( "repo" ) ; com.google.gerrit.reviewdb.client.Change change1 = insert ( repo , newChange ( repo ) ) ; com.google.gerrit.reviewdb.client.Change change2 = insert ( repo , newChange ( repo ) ) ; assertQuery ( "12345" ) ; assertQuery ( change1.getId ( ) . get ( ) , change1 ) ; assertQuery ( change2.getId ( ) . get ( ) , change2 ) ; }
Source:
private static boolean includeJar ( java.net.URL u ) { java.lang.String path = u.getPath ( ) ; return ( ( path.endsWith ( ".jar" ) ) && ( ! ( path.endsWith ( "-src.jar" ) ) ) ) && ( ! ( path.contains ( "/buck-out/gen/lib/gwt/" ) ) ) ; }

Target:
private static boolean includeJar ( java.net.URL u ) { java.lang.String path = u.getPath ( ) ; return ( path.endsWith ( ".jar" ) ) && ( ! ( path.endsWith ( "-src.jar" ) ) ) ; }
Source:
public void createNewChangeSignedOffByFooter ( ) throws java.lang.Exception { setSignedOffByFooter ( ) ; com.google.gerrit.extensions.common.ChangeInfo info = assertCreateSucceeds ( newChangeInput ( ChangeStatus.NEW ) ) ; java.lang.String message = info.revisions.get ( info.currentRevision ) . commit.message ; com.google.common.truth.Truth.assertThat ( message ) . contains ( java.lang.String.format ( "%sAdministrator <%s>" , org.eclipse.jgit.lib.Constants.SIGNED_OFF_BY_TAG , admin.getIdent ( ) . getEmailAddress ( ) ) ) ; }

Target:
public void createNewChangeSignedOffByFooter ( ) throws java.lang.Exception { setSignedOffByFooter ( true ) ; try { com.google.gerrit.extensions.common.ChangeInfo info = assertCreateSucceeds ( newChangeInput ( ChangeStatus.NEW ) ) ; java.lang.String message = info.revisions.get ( info.currentRevision ) . commit.message ; com.google.common.truth.Truth.assertThat ( message ) . contains ( java.lang.String.format ( "%sAdministrator <%s>" , org.eclipse.jgit.lib.Constants.SIGNED_OFF_BY_TAG , admin.getIdent ( ) . getEmailAddress ( ) ) ) ; } finally { setSignedOffByFooter ( false ) ; } }
Source:
public void setUpInjector ( ) throws java.lang.Exception { com.google.inject.Injector injector = com.google.inject.Guice.createInjector ( new com.google.gerrit.testutil.InMemoryModule ( ) ) ; injector.injectMembers ( this ) ; lifecycle = new com.google.gerrit.lifecycle.LifecycleManager ( ) ; lifecycle.add ( injector ) ; lifecycle.start ( ) ; db = schemaFactory.open ( ) ; schemaCreator.create ( db ) ; userId = accountManager.authenticate ( com.google.gerrit.server.account.AuthRequest.forUser ( "user" ) ) . getAccountId ( ) ; user = userFactory.create ( userId ) ; configureProject ( ) ; setUpChange ( ) ; }

Target:
public void setUpInjector ( ) throws java.lang.Exception { lifecycle = new com.google.gerrit.lifecycle.LifecycleManager ( ) ; com.google.inject.Injector injector = com.google.gerrit.testutil.InMemoryModule.createInjector ( lifecycle ) ; injector.injectMembers ( this ) ; lifecycle.start ( ) ; db = schemaFactory.open ( ) ; schemaCreator.create ( db ) ; userId = accountManager.authenticate ( com.google.gerrit.server.account.AuthRequest.forUser ( "user" ) ) . getAccountId ( ) ; user = userFactory.create ( userId ) ; configureProject ( ) ; setUpChange ( ) ; }
Source:
public boolean canAbandon ( ) { return ( ( ( isOwner ( ) ) || ( getRefControl ( ) . isOwner ( ) ) ) || ( getProjectControl ( ) . isOwner ( ) ) ) || ( getCurrentUser ( ) . getCapabilities ( ) . canAdministrateServer ( ) ) ; }

Target:
public boolean canAbandon ( ) { return ( ( ( ( isOwner ( ) ) || ( getRefControl ( ) . isOwner ( ) ) ) || ( getProjectControl ( ) . isOwner ( ) ) ) || ( getCurrentUser ( ) . getCapabilities ( ) . canAdministrateServer ( ) ) ) || ( getRefControl ( ) . canAbandon ( ) ) ; }
Source:
public void testUpdateOneException ( ) throws java.sql.SQLException { sqlException = new java.sql.BatchUpdateException ( ) ; java.sql.PreparedStatement update = stubStatementThrowExceptionOnExecute ( com.google.gwtorm.jdbc.AbstractTestJdbcAccess.UPDATE , sqlException ) ; try { classUnderTest.update ( oneRow ) ; org.junit.Assert.fail ( "missingException" ) ; } catch ( com.google.gwtorm.client.OrmException e ) { org.junit.Assert.assertSame ( e.getCause ( ) , sqlException ) ; } assertCorrectUpdating ( update , 1 ) ; }

Target:
public void testUpdateOneException ( ) throws java.sql.SQLException { sqlException = new java.sql.BatchUpdateException ( ) ; java.sql.PreparedStatement update = stubStatementThrowExceptionOnExecute ( com.google.gwtorm.jdbc.AbstractTestJdbcAccess.UPDATE , sqlException ) ; try { classUnderTest.update ( oneRow ) ; org.junit.Assert.fail ( "missingException" ) ; } catch ( com.google.gwtorm.server.OrmException e ) { org.junit.Assert.assertSame ( e.getCause ( ) , sqlException ) ; } assertCorrectUpdating ( update , 1 ) ; }
Source:
public void deleteBranchesForbidden ( ) throws java.lang.Exception { com.google.gerrit.extensions.api.projects.DeleteBranchesInput input = new com.google.gerrit.extensions.api.projects.DeleteBranchesInput ( ) ; input.branches = com.google.gerrit.acceptance.rest.project.DeleteBranchesIT.BRANCHES ; setApiUser ( user ) ; try { project ( ) . deleteBranches ( input ) ; org.junit.Assert.fail ( "Expected ResourceConflictException" ) ; } catch ( com.google.gerrit.extensions.restapi.ResourceConflictException e ) { com.google.common.truth.Truth.assertThat ( e ) . hasMessageThat ( ) . isEqualTo ( errorMessageForBranches ( com.google.gerrit.acceptance.rest.project.DeleteBranchesIT.BRANCHES ) ) ; } setApiUser ( admin ) ; assertBranches ( com.google.gerrit.acceptance.rest.project.DeleteBranchesIT.BRANCHES ) ; }

Target:
public void deleteBranchesForbidden ( ) throws java.lang.Exception { com.google.gerrit.extensions.api.projects.DeleteBranchesInput input = new com.google.gerrit.extensions.api.projects.DeleteBranchesInput ( ) ; input.branches = com.google.gerrit.acceptance.rest.project.DeleteBranchesIT.BRANCHES ; setApiUser ( user ) ; try { project ( ) . deleteBranches ( input ) ; fail ( "Expected ResourceConflictException" ) ; } catch ( com.google.gerrit.extensions.restapi.ResourceConflictException e ) { com.google.common.truth.Truth.assertThat ( e ) . hasMessageThat ( ) . isEqualTo ( errorMessageForBranches ( com.google.gerrit.acceptance.rest.project.DeleteBranchesIT.BRANCHES ) ) ; } setApiUser ( admin ) ; assertBranches ( com.google.gerrit.acceptance.rest.project.DeleteBranchesIT.BRANCHES ) ; }
Source:
public static void createGroup ( java.lang.String groupName , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.groups.GroupInfo > cb ) { com.google.gwt.core.client.JavaScriptObject in = com.google.gwt.core.client.JavaScriptObject.createObject ( ) ; java.lang.String n = com.google.gwt.http.client.URL.encodePathSegment ( groupName ) ; new com.google.gerrit.client.rpc.RestApi ( ( "/groups/" + n ) ) . ifNoneMatch ( ) . data ( in ) . put ( cb ) ; }

Target:
public static void createGroup ( java.lang.String groupName , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.groups.GroupInfo > cb ) { com.google.gwt.core.client.JavaScriptObject in = com.google.gwt.core.client.JavaScriptObject.createObject ( ) ; new com.google.gerrit.client.rpc.RestApi ( "/groups/" ) . id ( groupName ) . ifNoneMatch ( ) . data ( in ) . put ( cb ) ; }
Source:
private static com.google.gerrit.client.ui.Screen mine ( final java.lang.String token ) { if ( com.google.gerrit.client.Gerrit.isSignedIn ( ) ) { return new com.google.gerrit.client.changes.AccountDashboardScreen ( com.google.gerrit.client.Gerrit.getUserAccount ( ) . getId ( ) ) ; } else { com.google.gerrit.client.ui.Screen r = new com.google.gerrit.client.changes.AccountDashboardScreen ( null ) ; r.setRequiresSignIn ( true ) ; return r ; } }

Target:
private static com.google.gerrit.client.ui.Screen mine ( ) { if ( com.google.gerrit.client.Gerrit.isSignedIn ( ) ) { return new com.google.gerrit.client.changes.AccountDashboardScreen ( com.google.gerrit.client.Gerrit.getUserAccount ( ) . getId ( ) ) ; } else { com.google.gerrit.client.ui.Screen r = new com.google.gerrit.client.changes.AccountDashboardScreen ( null ) ; r.setRequiresSignIn ( true ) ; return r ; } }
Source:
private org.kohsuke.github.PagedIterable < org.kohsuke.github.GHRepository > getRepositories ( com.googlesource.gerrit.plugins.github.oauth.GitHubLogin hubLogin , java.lang.String organisation ) throws java.io.IOException { if ( organisation.equals ( hubLogin.getMyself ( ) . getLogin ( ) ) ) { return hubLogin.getMyself ( ) . listRepositories ( config.repositoryListPageSize , RepositoryListFilter.OWNER ) ; } org.kohsuke.github.GHOrganization ghOrganisation = hubLogin.getMyself ( ) . getAllOrganizations ( ) . byLogin ( organisation ) ; return ghOrganisation.listRepositories ( config.repositoryListPageSize ) ; }

Target:
private org.kohsuke.github.PagedIterable < org.kohsuke.github.GHRepository > getRepositories ( com.googlesource.gerrit.plugins.github.oauth.GitHubLogin hubLogin , java.lang.String organisation ) throws java.io.IOException { if ( organisation.equals ( hubLogin.getMyself ( ) . getLogin ( ) ) ) { return hubLogin.getMyself ( ) . listRepositories ( config.repositoryListPageSize , RepositoryListFilter.OWNER ) ; } else { org.kohsuke.github.GHOrganization ghOrganisation = hubLogin.getMyself ( ) . getAllOrganizations ( ) . byLogin ( organisation ) ; return ghOrganisation.listRepositories ( config.repositoryListPageSize ) ; } }
Source:
public int weigh ( com.google.gerrit.server.patch.DiffSummaryKey key , com.google.gerrit.server.patch.DiffSummary value ) { int size = ( 16 + ( 4 * 8 ) ) + ( 2 * 36 ) ; for ( java.lang.String p : value.getPaths ( ) ) { size += p.length ( ) ; } size += ( value.getPaths ( ) . size ( ) ) - 1 ; return size ; }

Target:
public int weigh ( com.google.gerrit.server.patch.DiffSummaryKey key , com.google.gerrit.server.patch.DiffSummary value ) { int size = ( ( ( ( ( 16 + ( 4 * 8 ) ) + ( 2 * 36 ) ) + 16 ) + 8 ) + 16 ) + 8 ; for ( java.lang.String p : value.getPaths ( ) ) { size += ( ( ( ( 16 + 8 ) + ( 4 * 4 ) ) + 16 ) + 8 ) + ( ( p.length ( ) ) * 2 ) ; } return size ; }
Source:
private void setEnabledForUseContentMerge ( ) { if ( SubmitType.FAST_FORWARD_ONLY.equals ( Project.SubmitType.valueOf ( submitType.getValue ( submitType.getSelectedIndex ( ) ) ) ) ) { contentMerge.setEnabled ( false ) ; final com.google.gerrit.reviewdb.client.InheritedBoolean inheritedBoolean = new com.google.gerrit.reviewdb.client.InheritedBoolean ( ) ; inheritedBoolean.setValue ( InheritableBoolean.FALSE ) ; com.google.gerrit.client.admin.ProjectInfoScreen.setBool ( contentMerge , inheritedBoolean ) ; } else { contentMerge.setEnabled ( submitType.isEnabled ( ) ) ; } }

Target:
private void setEnabledForUseContentMerge ( ) { if ( SubmitType.FAST_FORWARD_ONLY.equals ( Project.SubmitType.valueOf ( submitType.getValue ( submitType.getSelectedIndex ( ) ) ) ) ) { contentMerge.setEnabled ( false ) ; final com.google.gerrit.reviewdb.client.InheritedBoolean inheritedBoolean = new com.google.gerrit.reviewdb.client.InheritedBoolean ( ) ; inheritedBoolean.setValue ( InheritableBoolean.FALSE ) ; setBool ( contentMerge , inheritedBoolean ) ; } else { contentMerge.setEnabled ( submitType.isEnabled ( ) ) ; } }
Source:
private com.google.gerrit.server.events.ApprovalAttribute getApprovalAttribute ( java.util.Map.Entry < com.google.gerrit.reviewdb.ApprovalCategory.Id , com.google.gerrit.reviewdb.ApprovalCategoryValue.Id > approval ) { com.google.gerrit.server.events.ApprovalAttribute a = new com.google.gerrit.server.events.ApprovalAttribute ( ) ; a.type = approval.getKey ( ) . get ( ) ; final com.google.gerrit.common.data.ApprovalType at = approvalTypes.byId ( approval.getKey ( ) ) ; a.description = at.getCategory ( ) . getName ( ) ; a.value = java.lang.Short.toString ( approval.getValue ( ) . get ( ) ) ; return a ; }

Target:
private com.google.gerrit.server.events.ApprovalAttribute getApprovalAttribute ( java.util.Map.Entry < com.google.gerrit.reviewdb.ApprovalCategory.Id , com.google.gerrit.reviewdb.ApprovalCategoryValue.Id > approval ) { com.google.gerrit.server.events.ApprovalAttribute a = new com.google.gerrit.server.events.ApprovalAttribute ( ) ; a.type = approval.getKey ( ) . get ( ) ; com.google.gerrit.common.data.ApprovalType at = approvalTypes.byId ( approval.getKey ( ) ) ; if ( at != null ) { a.description = at.getCategory ( ) . getName ( ) ; } a.value = java.lang.Short.toString ( approval.getValue ( ) . get ( ) ) ; return a ; }
Source:
public void updateRepo ( com.google.gerrit.server.update.RepoContext ctx ) throws java.io.IOException { if ( ( deleteChangeOp ) != null ) { deleteChangeOp.updateRepo ( ctx ) ; return ; } ctx.addRefUpdate ( new org.eclipse.jgit.transport.ReceiveCommand ( org.eclipse.jgit.lib.ObjectId.fromString ( patchSet.getRevision ( ) . get ( ) ) , org.eclipse.jgit.lib.ObjectId.zeroId ( ) , patchSet.getRefName ( ) ) ) ; }

Target:
public void updateRepo ( com.google.gerrit.server.update.RepoContext ctx ) throws java.io.IOException { if ( ( deleteChangeOp ) != null ) { deleteChangeOp.updateRepo ( ctx ) ; return ; } ctx.addRefUpdate ( org.eclipse.jgit.lib.ObjectId.fromString ( patchSet.getRevision ( ) . get ( ) ) , org.eclipse.jgit.lib.ObjectId.zeroId ( ) , patchSet.getRefName ( ) ) ; }