auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void configure ( ) { org.eclipse.jgit.lib.Config cfg = new org.eclipse.jgit.lib.Config ( ) ; cfg.setInt ( "rules" , null , "reductionLimit" , 1300 ) ; cfg.setInt ( "rules" , null , "compileReductionLimit" , ( ( int ) ( 1000000.0 ) ) ) ; bind ( PrologEnvironment.Args.class ) . toInstance ( new com.google.gerrit.rules.PrologEnvironment.Args ( null , null , null , null , null , null , cfg ) ) ; }

Target:
protected void configure ( ) { org.eclipse.jgit.lib.Config cfg = new org.eclipse.jgit.lib.Config ( ) ; cfg.setInt ( "rules" , null , "reductionLimit" , 1300 ) ; cfg.setInt ( "rules" , null , "compileReductionLimit" , ( ( int ) ( 1000000.0 ) ) ) ; bind ( PrologEnvironment.Args.class ) . toInstance ( new com.google.gerrit.rules.PrologEnvironment.Args ( null , null , null , null , null , null , null , cfg ) ) ; }
Source:
protected void fireEvent ( com.google.gerrit.server.events.Event event , com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { for ( com.google.gerrit.common.UserScopedEventListener listener : listeners ) { if ( isVisibleTo ( event , listener.getUser ( ) , db ) ) { listener.onEvent ( event ) ; } } fireEventForUnrestrictedListeners ( event ) ; }

Target:
protected void fireEvent ( com.google.gerrit.server.events.Event event ) throws com.google.gwtorm.server.OrmException { for ( com.google.gerrit.common.UserScopedEventListener listener : listeners ) { if ( isVisibleTo ( event , listener.getUser ( ) ) ) { listener.onEvent ( event ) ; } } fireEventForUnrestrictedListeners ( event ) ; }
Source:
public com.googlesource.gerrit.plugins.its.phabricator.conduit.results.ManiphestInfo maniphestInfo ( int taskId ) throws com.googlesource.gerrit.plugins.its.phabricator.conduit.ConduitException { java.util.Map < java.lang.String , java.lang.Object > params = new java.util.HashMap < > ( ) ; fillInSession ( params ) ; params.put ( "task_id" , taskId ) ; com.google.gson.JsonElement callResult = conduitConnection.call ( "maniphest.info" , params ) ; com.googlesource.gerrit.plugins.its.phabricator.conduit.results.ManiphestInfo result = gson.fromJson ( callResult , com.googlesource.gerrit.plugins.its.phabricator.conduit.results.ManiphestInfo.class ) ; return result ; }

Target:
public com.googlesource.gerrit.plugins.its.phabricator.conduit.results.ManiphestInfo maniphestInfo ( int taskId ) throws com.googlesource.gerrit.plugins.its.phabricator.conduit.ConduitException { java.util.Map < java.lang.String , java.lang.Object > params = new java.util.HashMap < > ( ) ; params.put ( "task_id" , taskId ) ; com.google.gson.JsonElement callResult = conduitConnection.call ( "maniphest.info" , params , token ) ; com.googlesource.gerrit.plugins.its.phabricator.conduit.results.ManiphestInfo result = gson.fromJson ( callResult , com.googlesource.gerrit.plugins.its.phabricator.conduit.results.ManiphestInfo.class ) ; return result ; }
Source:
static com.google.gerrit.server.permissions.PermissionCollection.SeenRule create ( com.google.gerrit.common.data.AccessSection section , com.google.gerrit.common.data.Permission permission , @ com.google.gerrit.common.Nullable com.google.gerrit.common.data.PermissionRule rule ) { com.google.gerrit.reviewdb.client.AccountGroup.UUID group = ( ( rule != null ) && ( ( rule.getGroup ( ) ) != null ) ) ? rule.getGroup ( ) . getUUID ( ) : null ; return new com.google.gerrit.server.permissions.AutoValue_PermissionCollection_SeenRule ( section.getName ( ) , permission.getName ( ) , group ) ; }

Target:
static com.google.gerrit.server.permissions.PermissionCollection.SeenRule create ( com.google.gerrit.common.data.AccessSection section , @ com.google.gerrit.common.Nullable com.google.gerrit.common.data.PermissionRule rule ) { com.google.gerrit.reviewdb.client.AccountGroup.UUID group = ( ( rule != null ) && ( ( rule.getGroup ( ) ) != null ) ) ? rule.getGroup ( ) . getUUID ( ) : null ; return new com.google.gerrit.server.permissions.AutoValue_PermissionCollection_SeenRule ( section.getName ( ) , group ) ; }
Source:
private com.google.inject.Injector createSshInjector ( ) { final java.util.List < com.google.inject.Module > modules = new java.util.ArrayList < com.google.inject.Module > ( ) ; modules.add ( new com.google.gerrit.sshd.SshModule ( ) ) ; modules.add ( new com.google.gerrit.sshd.commands.MasterCommandModule ( ) ) ; modules.add ( cfgInjector.getInstance ( com.google.gerrit.sshd.commands.MasterPluginsModule.class ) ) ; return sysInjector.createChildInjector ( modules ) ; }

Target:
private com.google.inject.Injector createSshInjector ( ) { final java.util.List < com.google.inject.Module > modules = new java.util.ArrayList < com.google.inject.Module > ( ) ; modules.add ( new com.google.gerrit.sshd.SshModule ( ) ) ; modules.add ( new com.google.gerrit.sshd.commands.MasterCommandModule ( ) ) ; return sysInjector.createChildInjector ( modules ) ; }
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.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 ( ) ) { new java.lang.Thread ( tt , tt.toString ( ) ) . start ( ) ; } else { task.set ( executor.submit ( tt ) ) ; } }
Source:
protected void assertApproved ( java.lang.String changeId ) throws java.io.IOException { com.google.gerrit.extensions.common.ChangeInfo c = getChange ( changeId , com.google.gerrit.extensions.client.ListChangesOption.DETAILED_LABELS ) ; com.google.gerrit.extensions.common.LabelInfo cr = c.labels.get ( "Code-Review" ) ; com.google.common.truth.Truth.assertThat ( cr.all ) . hasSize ( 1 ) ; com.google.common.truth.Truth.assertThat ( cr.all.get ( 0 ) . value ) . isEqualTo ( 2 ) ; com.google.common.truth.Truth.assertThat ( new com.google.gerrit.reviewdb.client.Account.Id ( cr.all.get ( 0 ) . _accountId ) ) . isEqualTo ( admin.getId ( ) ) ; }

Target:
protected void assertApproved ( java.lang.String changeId ) throws java.lang.Exception { com.google.gerrit.extensions.common.ChangeInfo c = get ( changeId , com.google.gerrit.extensions.client.ListChangesOption.DETAILED_LABELS ) ; com.google.gerrit.extensions.common.LabelInfo cr = c.labels.get ( "Code-Review" ) ; com.google.common.truth.Truth.assertThat ( cr.all ) . hasSize ( 1 ) ; com.google.common.truth.Truth.assertThat ( cr.all.get ( 0 ) . value ) . isEqualTo ( 2 ) ; com.google.common.truth.Truth.assertThat ( new com.google.gerrit.reviewdb.client.Account.Id ( cr.all.get ( 0 ) . _accountId ) ) . isEqualTo ( admin.getId ( ) ) ; }
Source:
private java.lang.String replaceInUrl ( java.lang.String placeholder , java.lang.String url , java.lang.String replacement ) { if ( ! ( url.contains ( placeholder ) ) ) { return url ; } return url.replace ( placeholder , com.google.gerrit.extensions.restapi.Url.encode ( replacement ) ) ; }

Target:
private java.lang.String replaceInUrl ( java.lang.String placeholder , java.lang.String url , java.lang.String replacement ) { if ( ( url == null ) || ( ! ( url.contains ( placeholder ) ) ) ) { return url ; } return url.replace ( placeholder , com.google.gerrit.extensions.restapi.Url.encode ( replacement ) ) ; }
Source:
public void testChildren ( ) { final com.google.gerrit.server.query.NotPredicateTest.TestPredicate p = com.google.gerrit.server.query.NotPredicateTest.f ( "author" , "bob" ) ; final com.google.gerrit.server.query.Predicate < java.lang.String > n = com.google.gerrit.server.query.Predicate.not ( p ) ; assertEquals ( 1 , n.getChildCount ( ) ) ; assertSame ( p , n.getChild ( 0 ) ) ; }

Target:
public void testChildren ( ) { final com.google.gerrit.server.query.NotPredicateTest.TestPredicate p = com.google.gerrit.server.query.NotPredicateTest.f ( "author" , "bob" ) ; final com.google.gerrit.server.query.Predicate < java.lang.String > n = com.google.gerrit.server.query.Predicate.not ( p ) ; org.junit.Assert.assertEquals ( 1 , n.getChildCount ( ) ) ; org.junit.Assert.assertSame ( p , n.getChild ( 0 ) ) ; }
Source:
public void execute ( ) throws com.google.gwtorm.server.OrmException , java.io.IOException { if ( migration.failChangeWrites ( ) ) { throw new com.google.gwtorm.server.OrmException ( com.google.gerrit.server.notedb.NoteDbUpdateManager.CHANGES_READ_ONLY ) ; } if ( isEmpty ( ) ) { return ; } try ( com.google.gerrit.metrics.Timer1.Context timer = metrics.updateLatency.start ( com.google.gerrit.server.notedb.NoteDbTable.CHANGES ) ) { stage ( ) ; com.google.gerrit.server.notedb.NoteDbUpdateManager.execute ( changeRepo ) ; com.google.gerrit.server.notedb.NoteDbUpdateManager.execute ( allUsersRepo ) ; } finally { close ( ) ; } }

Target:
public void execute ( ) throws com.google.gwtorm.server.OrmException , java.io.IOException { if ( migration.failChangeWrites ( ) ) { throw new com.google.gwtorm.server.OrmException ( com.google.gerrit.server.notedb.NoteDbUpdateManager.CHANGES_READ_ONLY ) ; } if ( isEmpty ( ) ) { return ; } try ( com.google.gerrit.metrics.Timer1.Context timer = metrics.updateLatency.start ( com.google.gerrit.server.notedb.NoteDbTable.CHANGES ) ) { stage ( ) ; execute ( changeRepo ) ; execute ( allUsersRepo ) ; } finally { close ( ) ; } }
Source:
private static void assertCommentInfo ( com.google.gerrit.extensions.client.Comment expected , com.google.gerrit.extensions.common.CommentInfo actual ) { com.google.common.truth.Truth.assertThat ( actual.line ) . isEqualTo ( expected.line ) ; com.google.common.truth.Truth.assertThat ( actual.message ) . isEqualTo ( expected.message ) ; com.google.common.truth.Truth.assertThat ( actual.inReplyTo ) . isEqualTo ( expected.inReplyTo ) ; com.google.gerrit.acceptance.server.change.CommentsIT.assertCommentRange ( expected.range , actual.range ) ; if ( ( actual.side ) == null ) { com.google.common.truth.Truth.assertThat ( Side.REVISION ) . isEqualTo ( expected.side ) ; } }

Target:
private static void assertCommentInfo ( com.google.gerrit.extensions.client.Comment expected , com.google.gerrit.extensions.common.CommentInfo actual ) { com.google.common.truth.Truth.assertThat ( actual.line ) . isEqualTo ( expected.line ) ; com.google.common.truth.Truth.assertThat ( actual.message ) . isEqualTo ( expected.message ) ; com.google.common.truth.Truth.assertThat ( actual.inReplyTo ) . isEqualTo ( expected.inReplyTo ) ; com.google.gerrit.acceptance.server.change.CommentsIT.assertCommentRange ( expected.range , actual.range ) ; if ( ( ( actual.side ) == null ) && ( ( expected.side ) != null ) ) { com.google.common.truth.Truth.assertThat ( Side.REVISION ) . isEqualTo ( expected.side ) ; } }
Source:
private java.util.List < com.google.gerrit.server.change.RevisionResource > byLegacyPatchSetId ( com.google.gerrit.server.change.ChangeResource change , java.lang.String id ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.PatchSet ps = dbProvider.get ( ) . patchSets ( ) . get ( new com.google.gerrit.reviewdb.client.PatchSet.Id ( change.getChange ( ) . getId ( ) , java.lang.Integer.parseInt ( id ) ) ) ; if ( ps != null ) { return java.util.Collections.singletonList ( new com.google.gerrit.server.change.RevisionResource ( change , ps ) ) ; } return java.util.Collections.emptyList ( ) ; }

Target:
private java.util.List < com.google.gerrit.server.change.RevisionResource > byLegacyPatchSetId ( com.google.gerrit.server.change.ChangeResource change , java.lang.String id ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.PatchSet ps = dbProvider.get ( ) . patchSets ( ) . get ( new com.google.gerrit.reviewdb.client.PatchSet.Id ( change.getId ( ) , java.lang.Integer.parseInt ( id ) ) ) ; if ( ps != null ) { return java.util.Collections.singletonList ( new com.google.gerrit.server.change.RevisionResource ( change , ps ) ) ; } return java.util.Collections.emptyList ( ) ; }
Source:
public com.google.gerrit.extensions.api.changes.ChangeApi rebase ( ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return changes.id ( rebase.get ( ) . apply ( revision , null ) . _number ) ; } catch ( com.google.gwtorm.server.OrmException | com.google.gerrit.common.errors.EmailException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot rebase ps" , e ) ; } }

Target:
public com.google.gerrit.extensions.api.changes.ChangeApi rebase ( ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return changes.id ( rebase.apply ( revision , null ) . _number ) ; } catch ( com.google.gwtorm.server.OrmException | com.google.gerrit.common.errors.EmailException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot rebase ps" , e ) ; } }
Source:
private void checkUserSession ( javax.servlet.http.HttpServletRequest req ) throws com.google.gerrit.extensions.restapi.AuthException { com.google.gerrit.server.CurrentUser user = globals.currentUser.get ( ) ; if ( com.google.gerrit.httpd.restapi.RestApiServlet.isStateChange ( req ) ) { if ( user instanceof com.google.gerrit.server.AnonymousUser ) { throw new com.google.gerrit.extensions.restapi.AuthException ( "Authentication required" ) ; } else if ( ! ( globals.webSession.get ( ) . isAccessPathOk ( AccessPath.REST_API ) ) ) { throw new com.google.gerrit.extensions.restapi.AuthException ( "Invalid authentication method" ) ; } } user.setAccessPath ( AccessPath.REST_API ) ; }

Target:
private void checkUserSession ( javax.servlet.http.HttpServletRequest req ) throws com.google.gerrit.extensions.restapi.AuthException { com.google.gerrit.server.CurrentUser user = globals.currentUser.get ( ) ; if ( com.google.gerrit.httpd.restapi.RestApiServlet.isStateChange ( req ) ) { if ( user instanceof com.google.gerrit.server.AnonymousUser ) { throw new com.google.gerrit.extensions.restapi.AuthException ( "Authentication required" ) ; } else if ( ! ( globals.webSession.get ( ) . isAccessPathOk ( AccessPath.REST_API ) ) ) { throw new com.google.gerrit.extensions.restapi.AuthException ( "Invalid authentication method. In order to authenticate, prefix the REST endpoint URL with /a/ (e.g. http://example.com/a/projects/)." ) ; } } user.setAccessPath ( AccessPath.REST_API ) ; }
Source:
private void onCreateProject ( final com.google.gerrit.reviewdb.client.Project.NameKey newProjectName ) { namesUpdateLock.lock ( ) ; try { java.util.SortedSet < com.google.gerrit.reviewdb.client.Project.NameKey > n = new java.util.TreeSet < com.google.gerrit.reviewdb.client.Project.NameKey > ( names ) ; n.add ( newProjectName ) ; names = java.util.Collections.unmodifiableSortedSet ( n ) ; } finally { namesUpdateLock.unlock ( ) ; } }

Target:
private void onCreateProject ( final com.google.gerrit.reviewdb.client.Project.NameKey newProjectName ) { namesUpdateLock.lock ( ) ; try { java.util.SortedSet < com.google.gerrit.reviewdb.client.Project.NameKey > n = new java.util.TreeSet ( names ) ; n.add ( newProjectName ) ; names = java.util.Collections.unmodifiableSortedSet ( n ) ; } finally { namesUpdateLock.unlock ( ) ; } }
Source:
private com.google.gerrit.server.notedb.NoteDbUpdateManager.Result rebuild ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Change.Id changeId , boolean checkReadOnly ) throws com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException , java.io.IOException { if ( failNextUpdate.getAndSet ( false ) ) { throw new java.io.IOException ( "Update failed" ) ; } com.google.gerrit.server.notedb.NoteDbUpdateManager.Result result = ( checkReadOnly ) ? delegate.rebuild ( db , changeId ) : delegate.rebuildEvenIfReadOnly ( db , changeId ) ; if ( stealNextUpdate.getAndSet ( false ) ) { throw new java.io.IOException ( "Update stolen" ) ; } return result ; }

Target:
private com.google.gerrit.server.notedb.NoteDbUpdateManager.Result rebuild ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Change.Id changeId , boolean checkReadOnly ) throws com.google.gwtorm.server.OrmException , java.io.IOException { if ( failNextUpdate.getAndSet ( false ) ) { throw new java.io.IOException ( "Update failed" ) ; } com.google.gerrit.server.notedb.NoteDbUpdateManager.Result result = ( checkReadOnly ) ? delegate.rebuild ( db , changeId ) : delegate.rebuildEvenIfReadOnly ( db , changeId ) ; if ( stealNextUpdate.getAndSet ( false ) ) { throw new java.io.IOException ( "Update stolen" ) ; } return result ; }
Source:
public void mergeByOwner ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS , com.google.gerrit.server.account.WatchConfig.NotifyType.SUBMITTED_CHANGES ) ; merge ( sc.changeId , sc.owner ) ; assertThat ( sender ) . sent ( "merged" , sc ) . notTo ( sc.owner ) . to ( sc.reviewerByEmail ) . cc ( sc.reviewer , sc.ccer ) . cc ( sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS , com.google.gerrit.server.account.WatchConfig.NotifyType.SUBMITTED_CHANGES ) ; }

Target:
public void mergeByOwner ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS , com.google.gerrit.server.account.WatchConfig.NotifyType.SUBMITTED_CHANGES ) ; merge ( sc.changeId , sc.owner ) ; assertThat ( sender ) . sent ( "merged" , sc ) . notTo ( sc.owner ) . cc ( sc.reviewer , sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS , com.google.gerrit.server.account.WatchConfig.NotifyType.SUBMITTED_CHANGES ) ; }
Source:
protected void onRequestSuggestions ( com.google.gerrit.client.ui.Request request , com.google.gerrit.client.ui.Callback done ) { java.util.LinkedList < com.google.gerrit.client.ui.CherryPickDialog.BranchSuggestion > suggestions = new java.util.LinkedList < > ( ) ; for ( final com.google.gerrit.client.projects.BranchInfo b : branches ) { if ( b.ref ( ) . contains ( request.getQuery ( ) ) ) { suggestions.add ( new com.google.gerrit.client.ui.CherryPickDialog.BranchSuggestion ( b ) ) ; } } done.onSuggestionsReady ( request , new com.google.gerrit.client.ui.Response ( suggestions ) ) ; }

Target:
protected void onRequestSuggestions ( com.google.gerrit.client.ui.Request request , com.google.gerrit.client.ui.Callback done ) { java.util.List < com.google.gerrit.client.ui.CherryPickDialog.BranchSuggestion > suggestions = new java.util.ArrayList < > ( ) ; for ( final com.google.gerrit.client.projects.BranchInfo b : branches ) { if ( b.ref ( ) . contains ( request.getQuery ( ) ) ) { suggestions.add ( new com.google.gerrit.client.ui.CherryPickDialog.BranchSuggestion ( b ) ) ; } } done.onSuggestionsReady ( request , new com.google.gerrit.client.ui.Response ( suggestions ) ) ; }
Source:
public void run ( ) { try { final com.google.gerrit.server.mail.CreateChangeSender cm ; cm = createChangeSenderFactory.create ( change ) ; cm.setFrom ( me ) ; cm.setPatchSet ( ps , info ) ; cm.addReviewers ( reviewers ) ; cm.addExtraCC ( cc ) ; cm.send ( ) ; } catch ( java.lang.Exception e ) { com.google.gerrit.server.git.ReceiveCommits.log.error ( ( "Cannot send email for new change " + ( change.getId ( ) ) ) , e ) ; } }

Target:
public void run ( ) { try { com.google.gerrit.server.mail.CreateChangeSender cm = createChangeSenderFactory.create ( change ) ; cm.setFrom ( me ) ; cm.setPatchSet ( ps , info ) ; cm.addReviewers ( reviewers ) ; cm.addExtraCC ( cc ) ; cm.send ( ) ; } catch ( java.lang.Exception e ) { com.google.gerrit.server.git.ReceiveCommits.log.error ( ( "Cannot send email for new change " + ( change.getId ( ) ) ) , e ) ; } }
Source:
public com.google.gerrit.server.account.GroupControl controlFor ( final com.google.gerrit.reviewdb.client.AccountGroup.UUID 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 new com.google.gerrit.server.account.GroupControl ( groupCache , user.get ( ) , group ) ; }

Target:
public com.google.gerrit.server.account.GroupControl controlFor ( final com.google.gerrit.reviewdb.client.AccountGroup.UUID 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 new com.google.gerrit.server.account.GroupControl ( user.get ( ) , group ) ; }
Source:
public void configure ( ) { listener ( ) . to ( com.google.gerrit.lucene.LuceneIndexModule.SingleVersionListener.class ) ; bind ( new com.google.inject.TypeLiteral < java.util.Map < java.lang.String , java.lang.Integer > > ( ) { } ) . annotatedWith ( com.google.inject.name.Names.named ( com.google.gerrit.lucene.LuceneIndexModule.SINGLE_VERSIONS ) ) . toInstance ( this . singleVersions ) ; }

Target:
public void configure ( ) { listener ( ) . to ( com.google.gerrit.lucene.LuceneIndexModule.SingleVersionListener.class ) ; bind ( new com.google.inject.TypeLiteral < java.util.Map < java.lang.String , java.lang.Integer > > ( ) { } ) . annotatedWith ( com.google.inject.name.Names.named ( com.google.gerrit.lucene.LuceneIndexModule.SINGLE_VERSIONS ) ) . toInstance ( singleVersions ) ; }
Source:
private static com.google.gerrit.testutil.FakeEmailSender.Message create ( com.google.gerrit.server.mail.Address from , java.util.Collection < com.google.gerrit.server.mail.Address > rcpt , java.util.Map < java.lang.String , com.google.gerrit.server.mail.send.EmailHeader > headers , java.lang.String body , java.lang.String htmlBody ) { return new com.google.gerrit.testutil.AutoValue_FakeEmailSender_Message ( from , com.google.common.collect.ImmutableList.copyOf ( rcpt ) , com.google.common.collect.ImmutableMap.copyOf ( headers ) , body , htmlBody ) ; }

Target:
private static com.google.gerrit.testutil.FakeEmailSender.Message create ( com.google.gerrit.server.mail.Address from , java.util.Collection < com.google.gerrit.server.mail.Address > rcpt , java.util.Map < java.lang.String , com.google.gerrit.server.mail.send.EmailHeader > headers , java.lang.String body ) { return new com.google.gerrit.testutil.AutoValue_FakeEmailSender_Message ( from , com.google.common.collect.ImmutableList.copyOf ( rcpt ) , com.google.common.collect.ImmutableMap.copyOf ( headers ) , body ) ; }
Source:
private static boolean valid ( final com.google.gerrit.client.data.ApprovalType at , final com.google.gerrit.server.workflow.FunctionState state ) { if ( ( state.getChange ( ) . getStatus ( ) ) != ( Change.Status.NEW ) ) { return false ; } for ( final com.google.gerrit.client.data.ApprovalType t : com.google.gerrit.client.rpc.Common.getGerritConfig ( ) . getApprovalTypes ( ) ) { if ( ! ( state.isValid ( t ) ) ) { return false ; } } return true ; }

Target:
private static boolean valid ( final com.google.gerrit.client.data.ApprovalType at , final com.google.gerrit.server.workflow.FunctionState state ) { if ( ( state.getChange ( ) . getStatus ( ) ) != ( Change.Status.NEW ) ) { return false ; } for ( final com.google.gerrit.client.data.ApprovalType t : com.google.gerrit.client.rpc.Common.getGerritConfig ( ) . getApprovalTypes ( ) . getApprovalTypes ( ) ) { if ( ! ( state.isValid ( t ) ) ) { return false ; } } return true ; }
Source:
private void plugins ( java.io.StringWriter w ) { java.util.List < java.lang.String > urls = com.google.common.collect.Lists.newArrayList ( ) ; for ( com.google.gerrit.extensions.webui.WebUiPlugin u : plugins ) { urls.add ( java.lang.String.format ( "plugins/%s/%s" , u.getPluginName ( ) , u.getJavaScriptResourcePath ( ) ) ) ; } if ( ! ( urls.isEmpty ( ) ) ) { w.write ( ( ( com.google.gerrit.httpd.raw.HostPageServlet.HPD_ID ) + ".plugins=" ) ) ; json ( urls , w ) ; w.write ( ";" ) ; } }

Target:
private void plugins ( java.io.StringWriter w ) { java.util.List < java.lang.String > urls = new java.util.ArrayList < > ( ) ; for ( com.google.gerrit.extensions.webui.WebUiPlugin u : plugins ) { urls.add ( java.lang.String.format ( "plugins/%s/%s" , u.getPluginName ( ) , u.getJavaScriptResourcePath ( ) ) ) ; } if ( ! ( urls.isEmpty ( ) ) ) { w.write ( ( ( com.google.gerrit.httpd.raw.HostPageServlet.HPD_ID ) + ".plugins=" ) ) ; json ( urls , w ) ; w.write ( ";" ) ; } }
Source:
public com.google.gerrit.server.query.Predicate < T > copy ( final java.util.Collection < ? extends com.google.gerrit.server.query.Predicate < T > > children ) { if ( ( children.size ( ) ) != 1 ) { throw new java.lang.IllegalArgumentException ( "Expected exactly one child" ) ; } return new com.google.gerrit.server.query.NotPredicate < T > ( children.iterator ( ) . next ( ) ) ; }

Target:
public com.google.gerrit.server.query.Predicate < T > copy ( final java.util.Collection < ? extends com.google.gerrit.server.query.Predicate < T > > children ) { if ( ( children.size ( ) ) != 1 ) { throw new java.lang.IllegalArgumentException ( "Expected exactly one child" ) ; } return new com.google.gerrit.server.query.NotPredicate ( children.iterator ( ) . next ( ) ) ; }
Source:
public void restore ( ) throws com.google.gerrit.extensions.restapi.RestApiException , java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; gApi.changes ( ) . id ( ( "p~master~" + ( r.getChangeId ( ) ) ) ) . abandon ( ) ; gApi.changes ( ) . id ( ( "p~master~" + ( r.getChangeId ( ) ) ) ) . restore ( ) ; }

Target:
public void restore ( ) throws com.google.gerrit.extensions.restapi.RestApiException , java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; gApi.changes ( ) . id ( r.getChangeId ( ) ) . abandon ( ) ; gApi.changes ( ) . id ( r.getChangeId ( ) ) . restore ( ) ; }
Source:
private static org.apache.lucene.store.Directory dir ( com.google.gerrit.server.index.Schema < com.google.gerrit.reviewdb.client.AccountGroup > schema , org.eclipse.jgit.lib.Config cfg , com.google.gerrit.server.config.SitePaths sitePaths ) throws java.io.IOException { if ( com.google.gerrit.lucene.LuceneIndexModule.isInMemoryTest ( cfg ) ) { return new org.apache.lucene.store.RAMDirectory ( ) ; } java.nio.file.Path indexDir = com.google.gerrit.lucene.LuceneVersionManager.getDir ( sitePaths , ( ( com.google.gerrit.lucene.LuceneGroupIndex.GROUPS ) + "_" ) , schema ) ; return org.apache.lucene.store.FSDirectory.open ( indexDir ) ; }

Target:
private static org.apache.lucene.store.Directory dir ( com.google.gerrit.server.index.Schema < com.google.gerrit.reviewdb.client.AccountGroup > schema , org.eclipse.jgit.lib.Config cfg , com.google.gerrit.server.config.SitePaths sitePaths ) throws java.io.IOException { if ( com.google.gerrit.lucene.LuceneIndexModule.isInMemoryTest ( cfg ) ) { return new org.apache.lucene.store.RAMDirectory ( ) ; } java.nio.file.Path indexDir = com.google.gerrit.lucene.LuceneVersionManager.getDir ( sitePaths , com.google.gerrit.lucene.LuceneGroupIndex.GROUPS , schema ) ; return org.apache.lucene.store.FSDirectory.open ( indexDir ) ; }
Source:
public com.google.gwtorm.server.ResultSet < com.google.gerrit.server.query.change.ChangeData > read ( ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.Change c = args.db.get ( ) . changes ( ) . get ( id ) ; if ( c != null ) { return new com.google.gwtorm.server.ListResultSet < com.google.gerrit.server.query.change.ChangeData > ( java.util.Collections.singletonList ( args.changeDataFactory.create ( args.db.get ( ) , c ) ) ) ; } else { return new com.google.gwtorm.server.ListResultSet < com.google.gerrit.server.query.change.ChangeData > ( java.util.Collections.< com.google.gerrit.server.query.change.ChangeData > emptyList ( ) ) ; } }

Target:
public com.google.gwtorm.server.ResultSet < com.google.gerrit.server.query.change.ChangeData > read ( ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.Change c = args.db.get ( ) . changes ( ) . get ( id ) ; if ( c != null ) { return new com.google.gwtorm.server.ListResultSet ( java.util.Collections.singletonList ( args.changeDataFactory.create ( args.db.get ( ) , c ) ) ) ; } else { return new com.google.gwtorm.server.ListResultSet ( java.util.Collections.< com.google.gerrit.server.query.change.ChangeData > emptyList ( ) ) ; } }
Source:
private static java.lang.String getVersion ( final java.io.File me ) { if ( me == null ) { return "" ; } try { final java.util.jar.JarFile jar = new java.util.jar.JarFile ( me ) ; try { java.util.jar.Manifest mf = jar.getManifest ( ) ; java.util.jar.Attributes att = mf.getMainAttributes ( ) ; java.lang.String val = att.getValue ( java.util.jar.Attributes.Name.IMPLEMENTATION_VERSION ) ; return val != null ? val : "" ; } finally { jar.close ( ) ; } } catch ( java.io.IOException e ) { return "" ; } }

Target:
private static java.lang.String getVersion ( final java.io.File me ) { if ( me == null ) { return "" ; } try ( java.util.jar.JarFile jar = new java.util.jar.JarFile ( me ) ) { java.util.jar.Manifest mf = jar.getManifest ( ) ; java.util.jar.Attributes att = mf.getMainAttributes ( ) ; java.lang.String val = att.getValue ( java.util.jar.Attributes.Name.IMPLEMENTATION_VERSION ) ; return val != null ? val : "" ; } catch ( java.io.IOException e ) { return "" ; } }
Source:
private static java.lang.String describe ( com.google.gerrit.server.CurrentUser user ) { if ( user.isIdentifiedUser ( ) ) { return ( ( com.google.gerrit.server.IdentifiedUser ) ( user ) ) . getAccountId ( ) . toString ( ) ; } if ( user instanceof com.google.gerrit.server.query.change.SingleGroupUser ) { return "group:" + ( user.getEffectiveGroups ( ) . getKnownGroups ( ) . iterator ( ) . next ( ) . toString ( ) ) ; } return user.toString ( ) ; }

Target:
private static java.lang.String describe ( com.google.gerrit.server.CurrentUser user ) { if ( user.isIdentifiedUser ( ) ) { return user.getAccountId ( ) . toString ( ) ; } if ( user instanceof com.google.gerrit.server.query.change.SingleGroupUser ) { return "group:" + ( user.getEffectiveGroups ( ) . getKnownGroups ( ) . iterator ( ) . next ( ) . toString ( ) ) ; } return user.toString ( ) ; }
Source:
public void createEmptyChange ( ) throws java.lang.Exception { com.google.gerrit.extensions.common.ChangeInfo in = new com.google.gerrit.extensions.common.ChangeInfo ( ) ; in.branch = org.eclipse.jgit.lib.Constants.MASTER ; in.subject = "Create a change from the API" ; in.project = project.get ( ) ; com.google.gerrit.extensions.common.ChangeInfo info = gApi.changes ( ) . create ( in ) . get ( ) ; org.junit.Assert.assertEquals ( in.project , info.project ) ; org.junit.Assert.assertEquals ( in.branch , info.branch ) ; org.junit.Assert.assertEquals ( in.subject , info.subject ) ; }

Target:
public void createEmptyChange ( ) throws java.lang.Exception { com.google.gerrit.extensions.common.ChangeInfo in = new com.google.gerrit.extensions.common.ChangeInfo ( ) ; in.branch = org.eclipse.jgit.lib.Constants.MASTER ; in.subject = "Create a change from the API" ; in.project = project.get ( ) ; com.google.gerrit.extensions.common.ChangeInfo info = gApi.changes ( ) . create ( in ) . get ( ) ; com.google.common.truth.Truth.assertThat ( info.project ) . isEqualTo ( in.project ) ; com.google.common.truth.Truth.assertThat ( info.branch ) . isEqualTo ( in.branch ) ; com.google.common.truth.Truth.assertThat ( info.subject ) . isEqualTo ( in.subject ) ; }
Source:
public boolean equals ( final java.lang.Object obj ) { if ( ( ! ( super . equals ( obj ) ) ) || ( ! ( obj instanceof com.google.gerrit.common.data.AccessSection ) ) ) { return false ; } return new java.util.HashSet < com.google.gerrit.common.data.Permission > ( getPermissions ( ) ) . equals ( new java.util.HashSet ( ( ( com.google.gerrit.common.data.AccessSection ) ( obj ) ) . getPermissions ( ) ) ) ; }

Target:
public boolean equals ( final java.lang.Object obj ) { if ( ( ! ( super . equals ( obj ) ) ) || ( ! ( obj instanceof com.google.gerrit.common.data.AccessSection ) ) ) { return false ; } return new java.util.HashSet ( getPermissions ( ) ) . equals ( new java.util.HashSet ( ( ( com.google.gerrit.common.data.AccessSection ) ( obj ) ) . getPermissions ( ) ) ) ; }
Source:
public com.google.gerrit.client.ui.InlineHyperlink getNextPatchLink ( int index , com.google.gerrit.client.patches.PatchScreen.Type patchType ) { int nextPatchIndex = getNextPatch ( index , false , PREFERENCE_VALIDATOR ) ; if ( nextPatchIndex < 0 ) { return null ; } com.google.gerrit.client.ui.InlineHyperlink link = createLink ( nextPatchIndex , patchType , null , com.google.gwtexpui.safehtml.client.SafeHtml.asis ( Util.C.nextPatchLinkIcon ( ) ) ) ; return link ; }

Target:
public com.google.gerrit.client.ui.InlineHyperlink getNextPatchLink ( int index , com.google.gerrit.client.patches.PatchScreen.Type patchType ) { int nextPatchIndex = getNextPatch ( index , false , PREFERENCE_VALIDATOR ) ; if ( nextPatchIndex < 0 ) { return null ; } return createLink ( nextPatchIndex , patchType , null , com.google.gwtexpui.safehtml.client.SafeHtml.asis ( Util.C.nextPatchLinkIcon ( ) ) ) ; }
Source:
public void onSuccess ( final java.util.List < com.google.gerrit.common.data.GroupReference > result ) { priorResults.clear ( ) ; final java.util.ArrayList < com.google.gerrit.client.ui.AccountGroupSuggestOracle.AccountGroupSuggestion > r = new java.util.ArrayList < com.google.gerrit.client.ui.AccountGroupSuggestOracle.AccountGroupSuggestion > ( result.size ( ) ) ; for ( final com.google.gerrit.common.data.GroupReference p : result ) { r.add ( new com.google.gerrit.client.ui.AccountGroupSuggestOracle.AccountGroupSuggestion ( p ) ) ; priorResults.put ( p.getName ( ) , p.getUUID ( ) ) ; } callback.onSuggestionsReady ( req , new com.google.gerrit.client.ui.Response ( r ) ) ; }

Target:
public void onSuccess ( final java.util.List < com.google.gerrit.common.data.GroupReference > result ) { priorResults.clear ( ) ; final java.util.ArrayList < com.google.gerrit.client.ui.AccountGroupSuggestOracle.AccountGroupSuggestion > r = new java.util.ArrayList ( result.size ( ) ) ; for ( final com.google.gerrit.common.data.GroupReference p : result ) { r.add ( new com.google.gerrit.client.ui.AccountGroupSuggestOracle.AccountGroupSuggestion ( p ) ) ; priorResults.put ( p.getName ( ) , p.getUUID ( ) ) ; } callback.onSuggestionsReady ( req , new com.google.gerrit.client.ui.Response ( r ) ) ; }
Source:
private void export ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Project.NameKey project , java.util.List < com.google.gerrit.reviewdb.client.Change > changes ) throws com.google.gerrit.server.git.CodeReviewNoteCreationException , com.google.gwtorm.server.OrmException , java.io.IOException , java.lang.InterruptedException { final org.eclipse.jgit.lib.Repository git ; try { git = gitManager.openRepository ( project ) ; } catch ( org.eclipse.jgit.errors.RepositoryNotFoundException e ) { return ; } try { com.google.gerrit.server.git.CreateCodeReviewNotes notes = codeReviewNotesFactory.create ( db , git ) ; notes.create ( changes , null , "Exported prior reviews from Gerrit Code Review\n" , monitor ) ; } finally { git.close ( ) ; } }

Target:
private void export ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Project.NameKey project , java.util.List < com.google.gerrit.reviewdb.client.Change > changes ) throws com.google.gerrit.server.git.CodeReviewNoteCreationException , com.google.gwtorm.server.OrmException , java.io.IOException , java.lang.InterruptedException { final org.eclipse.jgit.lib.Repository git ; try { git = gitManager.openRepository ( project ) ; } catch ( org.eclipse.jgit.errors.RepositoryNotFoundException e ) { return ; } try { com.google.gerrit.server.git.CreateCodeReviewNotes notes = codeReviewNotesFactory.create ( db , project , git ) ; notes.create ( changes , null , "Exported prior reviews from Gerrit Code Review\n" , monitor ) ; } finally { git.close ( ) ; } }
Source:
private static java.util.Map < com.google.gerrit.reviewdb.client.PatchSet.Id , com.google.gerrit.reviewdb.client.PatchSet > patchSetMap ( java.lang.Iterable < com.google.gerrit.reviewdb.client.PatchSet > in ) { java.util.Map < com.google.gerrit.reviewdb.client.PatchSet.Id , com.google.gerrit.reviewdb.client.PatchSet > out = new java.util.TreeMap ( new java.util.Comparator < com.google.gerrit.reviewdb.client.PatchSet.Id > ( ) { @ java.lang.Override public int compare ( com.google.gerrit.reviewdb.client.PatchSet.Id a , com.google.gerrit.reviewdb.client.PatchSet.Id b ) { return com.google.gerrit.server.notedb.ChangeBundle.patchSetIdChain ( a , b ) . result ( ) ; } } ) ; for ( com.google.gerrit.reviewdb.client.PatchSet ps : in ) { out.put ( ps.getId ( ) , ps ) ; } return out ; }

Target:
private static java.util.TreeMap < com.google.gerrit.reviewdb.client.PatchSet.Id , com.google.gerrit.reviewdb.client.PatchSet > patchSetMap ( java.lang.Iterable < com.google.gerrit.reviewdb.client.PatchSet > in ) { java.util.TreeMap < com.google.gerrit.reviewdb.client.PatchSet.Id , com.google.gerrit.reviewdb.client.PatchSet > out = new java.util.TreeMap ( new java.util.Comparator < com.google.gerrit.reviewdb.client.PatchSet.Id > ( ) { @ java.lang.Override public int compare ( com.google.gerrit.reviewdb.client.PatchSet.Id a , com.google.gerrit.reviewdb.client.PatchSet.Id b ) { return com.google.gerrit.server.notedb.ChangeBundle.patchSetIdChain ( a , b ) . result ( ) ; } } ) ; for ( com.google.gerrit.reviewdb.client.PatchSet ps : in ) { out.put ( ps.getId ( ) , ps ) ; } return out ; }
Source:
public void rootJson ( ) throws java.lang.Exception { java.lang.String name = repo.getRepository ( ) . getDescription ( ) . getRepositoryName ( ) ; java.util.Map < java.lang.String , com.google.gitiles.RepositoryDescription > res = buildJson ( "/" , com.google.gitiles.HostIndexServletTest.REPOS ) ; com.google.common.truth.Truth.assertThat ( res ) . hasSize ( 1 ) ; com.google.common.truth.Truth.assertThat ( res ) . containsKey ( name ) ; com.google.gitiles.RepositoryDescription d = res.get ( name ) ; com.google.common.truth.Truth.assertThat ( d.name ) . isEqualTo ( name ) ; }

Target:
public void rootJson ( ) throws java.lang.Exception { java.lang.String name = repo.getRepository ( ) . getDescription ( ) . getRepositoryName ( ) ; java.util.Map < java.lang.String , com.google.gitiles.RepositoryDescription > res = buildJson ( com.google.gitiles.HostIndexServletTest.REPOS , "/" ) ; com.google.common.truth.Truth.assertThat ( res ) . hasSize ( 1 ) ; com.google.common.truth.Truth.assertThat ( res ) . containsKey ( name ) ; com.google.gitiles.RepositoryDescription d = res.get ( name ) ; com.google.common.truth.Truth.assertThat ( d.name ) . isEqualTo ( name ) ; }
Source:
private static void codemirror ( final java.lang.String token , final com.google.gerrit.reviewdb.client.PatchSet.Id baseId , final com.google.gerrit.reviewdb.client.Patch.Key id , final com.google.gerrit.client.diff.DisplaySide side , final int line , final boolean edit ) { 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.Gerrit.display ( token , ( edit ? new com.google.gerrit.client.editor.EditScreen ( baseId , id , line ) : new com.google.gerrit.client.diff.SideBySide ( baseId , id.getParentKey ( ) , id.get ( ) , side , line ) ) ) ; } } ) ; }

Target:
private static void codemirror ( final java.lang.String token , final com.google.gerrit.reviewdb.client.PatchSet.Id baseId , final com.google.gerrit.reviewdb.client.Patch.Key id , final com.google.gerrit.client.diff.DisplaySide side , final int line ) { 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.Gerrit.display ( token , new com.google.gerrit.client.diff.SideBySide ( baseId , id.getParentKey ( ) , id.get ( ) , side , line ) ) ; } } ) ; }
Source:
public < V > void newCallbackMetric ( java.lang.String name , java.lang.Class < V > valueClass , com.google.gerrit.metrics.Description desc , com.google.common.base.Supplier < V > trigger ) { com.google.gerrit.metrics.CallbackMetric0 < V > metric = newCallbackMetric ( name , valueClass , desc ) ; newTrigger ( metric , ( ) -> { metric.set ( trigger.get ( ) ) ; } ) ; }

Target:
public < V > void newCallbackMetric ( java.lang.String name , java.lang.Class < V > valueClass , com.google.gerrit.metrics.Description desc , com.google.common.base.Supplier < V > trigger ) { com.google.gerrit.metrics.CallbackMetric0 < V > metric = newCallbackMetric ( name , valueClass , desc ) ; newTrigger ( metric , ( ) -> metric.set ( trigger.get ( ) ) ) ; }
Source:
static void publish ( com.google.gerrit.reviewdb.client.Change.Id id , java.lang.String revision , com.google.gwt.user.client.ui.Button ... draftButtons ) { com.google.gerrit.client.changes.ChangeApi.publish ( id.get ( ) , revision , com.google.gerrit.client.change.ChangeActions.cs ( id , draftButtons ) ) ; }

Target:
static void publish ( com.google.gerrit.reviewdb.client.Project.NameKey project , com.google.gerrit.reviewdb.client.Change.Id id , java.lang.String revision , com.google.gwt.user.client.ui.Button ... draftButtons ) { com.google.gerrit.client.changes.ChangeApi.publish ( project.get ( ) , id.get ( ) , revision , com.google.gerrit.client.change.ChangeActions.cs ( project , id , draftButtons ) ) ; }
Source:
public void onMouseOut ( com.google.gwt.event.dom.client.MouseOutEvent event ) { com.google.gerrit.client.change.ReplyBox.LabelRadioButton b = group.selected ; java.lang.String s = ( ( b != null ) && ( ( b.value ) != 0 ) ) ? b.text : "" ; labelsTable.setText ( group.row , labelHelpColumn , s ) ; }

Target:
public void onMouseOut ( com.google.gwt.event.dom.client.MouseOutEvent event ) { com.google.gerrit.client.change.ReplyBox.LabelRadioButton b = group.selected ; java.lang.String s = ( b != null ) ? b.text : "" ; labelsTable.setText ( group.row , labelHelpColumn , s ) ; }
Source:
private int safePageSize ( final int pageSize ) throws com.google.gerrit.common.errors.InvalidQueryException { int maxLimit = currentUser.get ( ) . getCapabilities ( ) . getRange ( GlobalCapability.QUERY_LIMIT ) . getMax ( ) ; if ( maxLimit == 0 ) { throw new com.google.gerrit.common.errors.InvalidQueryException ( "Search Disabled" ) ; } return ( 0 < pageSize ) && ( pageSize <= maxLimit ) ? pageSize : maxLimit ; }

Target:
private int safePageSize ( final int pageSize ) throws com.google.gerrit.common.errors.InvalidQueryException { int maxLimit = currentUser.get ( ) . getCapabilities ( ) . getRange ( GlobalCapability.QUERY_LIMIT ) . getMax ( ) ; if ( maxLimit <= 0 ) { throw new com.google.gerrit.common.errors.InvalidQueryException ( "Search Disabled" ) ; } return ( 0 < pageSize ) && ( pageSize <= maxLimit ) ? pageSize : maxLimit ; }
Source:
public java.lang.String call ( ) throws java.lang.Exception { java.lang.String actionName = actionString.substring ( 0 , ( ( actionString.indexOf ( " " ) ) - 1 ) ) ; java.lang.String actionValue = actionString.substring ( actionString.indexOf ( " " ) ) ; doPerformAction ( bugId , actionName , actionValue ) ; return bugId ; }

Target:
public java.lang.String call ( ) throws java.lang.Exception { java.lang.String actionName = actionString.substring ( 0 , actionString.indexOf ( " " ) ) ; java.lang.String actionValue = actionString.substring ( ( ( actionString.indexOf ( " " ) ) + 1 ) ) ; doPerformAction ( bugId , actionName , actionValue ) ; return bugId ; }
Source:
public void testChildString ( ) { final com.google.gwtorm.client.IntKeyTestCase.Child c1 = new com.google.gwtorm.client.IntKeyTestCase.Child ( new com.google.gwtorm.client.IntKeyTestCase.Parent ( 1 ) , 2 ) ; assertEquals ( "1,2" , c1.toString ( ) ) ; final com.google.gwtorm.client.IntKeyTestCase.Child c2 = new com.google.gwtorm.client.IntKeyTestCase.Child ( new com.google.gwtorm.client.IntKeyTestCase.Parent ( 0 ) , 0 ) ; c2.fromString ( c1.toString ( ) ) ; assertEquals ( c1 , c2 ) ; }

Target:
public void testChildString ( ) { final com.google.gwtorm.client.IntKeyTestCase.Child c1 = new com.google.gwtorm.client.IntKeyTestCase.Child ( new com.google.gwtorm.client.IntKeyTestCase.Parent ( 1 ) , 2 ) ; org.junit.Assert.assertEquals ( "1,2" , c1.toString ( ) ) ; final com.google.gwtorm.client.IntKeyTestCase.Child c2 = new com.google.gwtorm.client.IntKeyTestCase.Child ( new com.google.gwtorm.client.IntKeyTestCase.Parent ( 0 ) , 0 ) ; c2.fromString ( c1.toString ( ) ) ; org.junit.Assert.assertEquals ( c1 , c2 ) ; }
Source:
public static void publish ( int id , java.lang.String commit , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gwt.core.client.JavaScriptObject > cb ) { com.google.gwt.core.client.JavaScriptObject in = com.google.gwt.core.client.JavaScriptObject.createObject ( ) ; com.google.gerrit.client.changes.ChangeApi.call ( id , commit , "publish" ) . post ( in , cb ) ; }

Target:
public static void publish ( @ com.google.gerrit.common.Nullable java.lang.String project , int id , java.lang.String commit , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gwt.core.client.JavaScriptObject > cb ) { com.google.gwt.core.client.JavaScriptObject in = com.google.gwt.core.client.JavaScriptObject.createObject ( ) ; com.google.gerrit.client.changes.ChangeApi.call ( project , id , commit , "publish" ) . post ( in , cb ) ; }
Source:
public static void recursivelyDelete ( java.io.File dir ) throws java.io.IOException { if ( ! ( dir.getPath ( ) . equals ( dir.getCanonicalPath ( ) ) ) ) { return ; } java.io.File [ ] contents = dir.listFiles ( ) ; if ( contents != null ) { for ( java.io.File d : contents ) { if ( d.isDirectory ( ) ) { com.google.gerrit.acceptance.TempFileUtil.recursivelyDelete ( d ) ; } else { com.google.gerrit.acceptance.TempFileUtil.deleteNowOrOnExit ( d ) ; } } } com.google.gerrit.acceptance.TempFileUtil.deleteNowOrOnExit ( dir ) ; }

Target:
private static void recursivelyDelete ( java.io.File dir ) throws java.io.IOException { if ( ! ( dir.getPath ( ) . equals ( dir.getCanonicalPath ( ) ) ) ) { return ; } java.io.File [ ] contents = dir.listFiles ( ) ; if ( contents != null ) { for ( java.io.File d : contents ) { if ( d.isDirectory ( ) ) { com.google.gerrit.acceptance.TempFileUtil.recursivelyDelete ( d ) ; } else { com.google.gerrit.acceptance.TempFileUtil.deleteNowOrOnExit ( d ) ; } } } com.google.gerrit.acceptance.TempFileUtil.deleteNowOrOnExit ( dir ) ; }
Source:
public com.google.gerrit.reviewdb.client.PatchSet currentPatchSet ( ) throws com.google.gwtorm.server.OrmException { if ( ( currentPatchSet ) == null ) { com.google.gerrit.reviewdb.client.Change c = change ( ) ; if ( c == null ) { return null ; } for ( com.google.gerrit.reviewdb.client.PatchSet p : patches ( ) ) { if ( p.getId ( ) . equals ( c.currentPatchSetId ( ) ) ) { currentPatchSet = p ; return p ; } } } return currentPatchSet ; }

Target:
public com.google.gerrit.reviewdb.client.PatchSet currentPatchSet ( ) throws com.google.gwtorm.server.OrmException { if ( ( currentPatchSet ) == null ) { com.google.gerrit.reviewdb.client.Change c = change ( ) ; if ( c == null ) { return null ; } for ( com.google.gerrit.reviewdb.client.PatchSet p : patchSets ( ) ) { if ( p.getId ( ) . equals ( c.currentPatchSetId ( ) ) ) { currentPatchSet = p ; return p ; } } } return currentPatchSet ; }