auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private java.lang.Iterable < com.google.gerrit.reviewdb.client.PatchSetApproval > approvals ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.change.ReviewerResource rsrc ) throws com.google.gwtorm.server.OrmException { final com.google.gerrit.reviewdb.client.Account.Id user = rsrc.getUser ( ) . getAccountId ( ) ; return com.google.common.collect.Iterables.filter ( approvalsUtil.byChange ( db , rsrc.getNotes ( ) ) . values ( ) , new com.google.common.base.Predicate < com.google.gerrit.reviewdb.client.PatchSetApproval > ( ) { @ java.lang.Override public boolean apply ( com.google.gerrit.reviewdb.client.PatchSetApproval input ) { return user.equals ( input.getAccountId ( ) ) ; } } ) ; }

Target:
private java.lang.Iterable < com.google.gerrit.reviewdb.client.PatchSetApproval > approvals ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.change.ReviewerResource rsrc ) throws com.google.gwtorm.server.OrmException { final com.google.gerrit.reviewdb.client.Account.Id user = rsrc.getReviewerUser ( ) . getAccountId ( ) ; return com.google.common.collect.Iterables.filter ( approvalsUtil.byChange ( db , rsrc.getNotes ( ) ) . values ( ) , new com.google.common.base.Predicate < com.google.gerrit.reviewdb.client.PatchSetApproval > ( ) { @ java.lang.Override public boolean apply ( com.google.gerrit.reviewdb.client.PatchSetApproval input ) { return user.equals ( input.getAccountId ( ) ) ; } } ) ; }
Source:
public void display ( final com.google.gerrit.client.reviewdb.PatchSet.Id id , final java.util.List < com.google.gerrit.client.reviewdb.Patch > list ) { psid = id ; final com.google.gerrit.client.changes.PatchTable.DisplayCommand cmd = new com.google.gerrit.client.changes.PatchTable.DisplayCommand ( list ) ; if ( cmd.execute ( ) ) { cmd.initMeter ( ) ; com.google.gwt.user.client.DeferredCommand.addCommand ( cmd ) ; } else { cmd.showTable ( ) ; } }

Target:
public void display ( final com.google.gerrit.client.reviewdb.PatchSet.Id id , final java.util.List < com.google.gerrit.client.reviewdb.Patch > list ) { psid = id ; myTable = null ; final com.google.gerrit.client.changes.PatchTable.DisplayCommand cmd = new com.google.gerrit.client.changes.PatchTable.DisplayCommand ( list ) ; if ( cmd.execute ( ) ) { cmd.initMeter ( ) ; com.google.gwt.user.client.DeferredCommand.addCommand ( cmd ) ; } else { cmd.showTable ( ) ; } }
Source:
private void initChangeRepo ( ) throws java.io.IOException { if ( ( changeRepo ) == null ) { com.google.common.base.Preconditions.checkState ( ( ! ( changeUpdates.isEmpty ( ) ) ) ) ; changeRepo = openRepo ( changeUpdates.values ( ) . iterator ( ) . next ( ) . getProjectName ( ) ) ; } }

Target:
com.google.gerrit.server.git.ChainedReceiveCommands getChangeCommands ( ) throws java.io.IOException { initChangeRepo ( ) ; return changeRepo.cmds ; }
Source:
public void execute ( ) { assert ( selfWidgetWrapper ) != null ; selfWidgetWrapper.getWidget ( ) . changed ( ) ; if ( ( diffChunkInfo ) != null ) { parent.resizePaddingOnOtherSide ( getCommentInfo ( ) . side ( ) , diffChunkInfo.getEnd ( ) ) ; } else { assert ( widgetManager ) != null ; widgetManager.resizePaddingWidget ( ) ; } }

Target:
public void execute ( ) { assert ( selfWidgetWrapper ) != null ; selfWidgetWrapper.getWidget ( ) . changed ( ) ; if ( ( diffChunkInfo ) != null ) { parent.resizePaddingOnOtherSide ( side , diffChunkInfo.getEnd ( ) ) ; } else { assert ( widgetManager ) != null ; widgetManager.resizePaddingWidget ( ) ; } }
Source:
public void topic ( java.lang.String topic ) throws com.google.gerrit.extensions.restapi.RestApiException { com.google.gerrit.server.change.PutTopic.Input in = new com.google.gerrit.server.change.PutTopic.Input ( ) ; in.topic = topic ; try { putTopic.apply ( change , in ) ; } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( "Cannot set topic" , e ) ; } }

Target:
public void topic ( java.lang.String topic ) throws com.google.gerrit.extensions.restapi.RestApiException { com.google.gerrit.extensions.common.TopicInput in = new com.google.gerrit.extensions.common.TopicInput ( ) ; in.topic = topic ; try { putTopic.apply ( change , in ) ; } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( "Cannot set topic" , e ) ; } }
Source:
public com.google.gerrit.reviewdb.client.AccountGroup createEntry ( final com.google.gerrit.reviewdb.client.AccountGroup.UUID uuid ) throws java.lang.Exception { final com.google.gerrit.reviewdb.server.ReviewDb db = schema.open ( ) ; try { java.util.List < com.google.gerrit.reviewdb.client.AccountGroup > r = db.accountGroups ( ) . byUUID ( uuid ) . toList ( ) ; if ( ( r.size ( ) ) == 1 ) { return r.get ( 0 ) ; } else { return null ; } } finally { db.close ( ) ; } }

Target:
public com.google.gerrit.reviewdb.client.AccountGroup get ( com.google.gerrit.reviewdb.client.AccountGroup.NameKey name ) { if ( name == null ) { return null ; } try { return byName.get ( name.get ( ) ) . orNull ( ) ; } catch ( java.util.concurrent.ExecutionException e ) { com.google.gerrit.server.account.GroupCacheImpl.log.warn ( java.lang.String.format ( "Cannot lookup group %s by name" , name.get ( ) ) , e ) ; return null ; } }
Source:
public static com.google.gerrit.extensions.client.GeneralPreferencesInfo defaults ( ) { com.google.gerrit.extensions.client.GeneralPreferencesInfo p = new com.google.gerrit.extensions.client.GeneralPreferencesInfo ( ) ; p.changesPerPage = com.google.gerrit.extensions.client.GeneralPreferencesInfo.DEFAULT_PAGESIZE ; p.showSiteHeader = true ; p.useFlashClipboard = true ; p.emailStrategy = com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy.ENABLED ; p.reviewCategoryStrategy = com.google.gerrit.extensions.client.GeneralPreferencesInfo.ReviewCategoryStrategy.NONE ; p.downloadScheme = null ; p.downloadCommand = com.google.gerrit.extensions.client.GeneralPreferencesInfo.DownloadCommand.CHECKOUT ; p.dateFormat = com.google.gerrit.extensions.client.GeneralPreferencesInfo.DateFormat.STD ; p.timeFormat = com.google.gerrit.extensions.client.GeneralPreferencesInfo.TimeFormat.HHMM_12 ; p.expandInlineDiffs = false ; p.highlightAssigneeInChangeTable = true ; p.relativeDateInChangeTable = false ; p.diffView = com.google.gerrit.extensions.client.GeneralPreferencesInfo.DiffView.SIDE_BY_SIDE ; p.sizeBarInChangeTable = true ; p.legacycidInChangeTable = false ; p.muteCommonPathPrefixes = true ; p.signedOffBy = false ; p.defaultBaseForMerges = com.google.gerrit.extensions.client.GeneralPreferencesInfo.DefaultBase.FIRST_PARENT ; return p ; }

Target:
public static com.google.gerrit.extensions.client.GeneralPreferencesInfo defaults ( ) { com.google.gerrit.extensions.client.GeneralPreferencesInfo p = new com.google.gerrit.extensions.client.GeneralPreferencesInfo ( ) ; p.changesPerPage = com.google.gerrit.extensions.client.GeneralPreferencesInfo.DEFAULT_PAGESIZE ; p.showSiteHeader = true ; p.useFlashClipboard = true ; p.emailStrategy = com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy.ENABLED ; p.emailFormat = com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailFormat.HTML_PLAINTEXT ; p.reviewCategoryStrategy = com.google.gerrit.extensions.client.GeneralPreferencesInfo.ReviewCategoryStrategy.NONE ; p.downloadScheme = null ; p.downloadCommand = com.google.gerrit.extensions.client.GeneralPreferencesInfo.DownloadCommand.CHECKOUT ; p.dateFormat = com.google.gerrit.extensions.client.GeneralPreferencesInfo.DateFormat.STD ; p.timeFormat = com.google.gerrit.extensions.client.GeneralPreferencesInfo.TimeFormat.HHMM_12 ; p.expandInlineDiffs = false ; p.highlightAssigneeInChangeTable = true ; p.relativeDateInChangeTable = false ; p.diffView = com.google.gerrit.extensions.client.GeneralPreferencesInfo.DiffView.SIDE_BY_SIDE ; p.sizeBarInChangeTable = true ; p.legacycidInChangeTable = false ; p.muteCommonPathPrefixes = true ; p.signedOffBy = false ; p.defaultBaseForMerges = com.google.gerrit.extensions.client.GeneralPreferencesInfo.DefaultBase.FIRST_PARENT ; return p ; }
Source:
private void checkResult ( org.eclipse.jgit.lib.RefUpdate.Result result ) throws com.google.gwtorm.server.OrmException { if ( ( result != ( RefUpdate.Result.NEW ) ) && ( result != ( RefUpdate.Result.FORCED ) ) ) { throw new com.google.gwtorm.server.OrmException ( ( ( ( "failed to update " + ( refName ) ) + ": " ) + result ) ) ; } }

Target:
private boolean refUpdated ( org.eclipse.jgit.lib.RefUpdate.Result result ) { return ( result == ( RefUpdate.Result.NEW ) ) || ( result == ( RefUpdate.Result.FORCED ) ) ; }
Source:
public java.lang.String getRequestURI ( ) { return ( ( contextPath ) + ( servletPath ) ) + ( path ) ; }

Target:
public java.lang.String getRequestURI ( ) { java.lang.String uri = ( ( contextPath ) + ( servletPath ) ) + ( path ) ; if ( ! ( parameters.isEmpty ( ) ) ) { uri += "?" + ( com.google.gitiles.GitilesView.paramsToString ( parameters ) ) ; } return uri ; }
Source:
public static org.w3c.dom.Document parseFile ( java.io.File path ) throws java.io.IOException { try ( java.io.InputStream in = new java.io.FileInputStream ( path ) ) { org.w3c.dom.Document doc = com.google.gerrit.httpd.HtmlDomUtil.newBuilder ( ) . parse ( in ) ; com.google.gerrit.httpd.HtmlDomUtil.compact ( doc ) ; return doc ; } catch ( java.io.FileNotFoundException e ) { return null ; } catch ( org.xml.sax.SAXException | javax.xml.parsers.ParserConfigurationException | java.io.IOException e ) { throw new java.io.IOException ( ( "Error reading " + path ) , e ) ; } }

Target:
public static org.w3c.dom.Document parseFile ( java.nio.file.Path path ) throws java.io.IOException { try ( java.io.InputStream in = java.nio.file.Files.newInputStream ( path ) ) { org.w3c.dom.Document doc = com.google.gerrit.httpd.HtmlDomUtil.newBuilder ( ) . parse ( in ) ; com.google.gerrit.httpd.HtmlDomUtil.compact ( doc ) ; return doc ; } catch ( java.io.FileNotFoundException e ) { return null ; } catch ( org.xml.sax.SAXException | javax.xml.parsers.ParserConfigurationException | java.io.IOException e ) { throw new java.io.IOException ( ( "Error reading " + path ) , e ) ; } }
Source:
public void onSuccess ( com.google.gerrit.client.VoidResult n ) { prefs.copyTo ( com.google.gerrit.client.Gerrit.getEditPreferences ( ) ) ; }

Target:
void onIndentUnit ( com.google.gwt.event.logical.shared.ValueChangeEvent < java.lang.String > e ) { java.lang.String v = e.getValue ( ) ; if ( ( v != null ) && ( ( v.length ( ) ) > 0 ) ) { prefs.indentUnit ( java.lang.Math.max ( 0 , java.lang.Integer.parseInt ( v ) ) ) ; if ( ( view ) != null ) { view.setIndentUnit ( prefs.indentUnit ( ) ) ; } } }
Source:
public com.google.gerrit.reviewdb.client.Change update ( com.google.gerrit.reviewdb.client.Change change ) { if ( ( change.getStatus ( ) ) == from ) { change.setStatus ( to ) ; com.google.gerrit.server.ChangeUtil.updated ( change ) ; return change ; } return null ; }

Target:
public boolean updateChange ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx ) { com.google.gerrit.reviewdb.client.Change change = ctx.getChange ( ) ; if ( ( change.getStatus ( ) ) == from ) { change.setStatus ( to ) ; ctx.saveChange ( ) ; return true ; } return false ; }
Source:
public com.google.gerrit.extensions.restapi.Response < com.google.gerrit.extensions.api.projects.DashboardInfo > apply ( com.google.gerrit.server.project.DashboardResource resource , com.google.gerrit.server.project.SetDashboard.Input input ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.BadRequestException , com.google.gerrit.extensions.restapi.MethodNotAllowedException , com.google.gerrit.extensions.restapi.ResourceConflictException , com.google.gerrit.extensions.restapi.ResourceNotFoundException , com.google.gerrit.server.permissions.PermissionBackendException , java.io.IOException { if ( resource.isProjectDefault ( ) ) { return defaultSetter.get ( ) . apply ( resource , input ) ; } throw new com.google.gerrit.extensions.restapi.MethodNotAllowedException ( ) ; }

Target:
public com.google.gerrit.extensions.restapi.Response < com.google.gerrit.extensions.api.projects.DashboardInfo > apply ( com.google.gerrit.server.project.DashboardResource resource , com.google.gerrit.extensions.common.SetDashboardInput input ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.BadRequestException , com.google.gerrit.extensions.restapi.MethodNotAllowedException , com.google.gerrit.extensions.restapi.ResourceConflictException , com.google.gerrit.extensions.restapi.ResourceNotFoundException , com.google.gerrit.server.permissions.PermissionBackendException , java.io.IOException { if ( resource.isProjectDefault ( ) ) { return defaultSetter.get ( ) . apply ( resource , input ) ; } throw new com.google.gerrit.extensions.restapi.MethodNotAllowedException ( ) ; }
Source:
public static boolean includedInOne ( final org.eclipse.jgit.lib.Repository repo , org.eclipse.jgit.revwalk.RevWalk rw , org.eclipse.jgit.revwalk.RevCommit commit , java.util.Collection < org.eclipse.jgit.lib.Ref > refs ) throws java.io.IOException { org.eclipse.jgit.revwalk.RevFlag flag = com.google.gerrit.server.change.IncludedInResolver.newFlag ( rw ) ; try { return new com.google.gerrit.server.change.IncludedInResolver ( repo , rw , commit , flag ) . includedInOne ( refs ) ; } finally { rw.disposeFlag ( flag ) ; } }

Target:
public static boolean includedInAny ( final org.eclipse.jgit.lib.Repository repo , org.eclipse.jgit.revwalk.RevWalk rw , org.eclipse.jgit.revwalk.RevCommit commit , java.util.Collection < org.eclipse.jgit.lib.Ref > refs ) throws java.io.IOException { if ( refs.isEmpty ( ) ) { return false ; } org.eclipse.jgit.revwalk.RevFlag flag = com.google.gerrit.server.change.IncludedInResolver.newFlag ( rw ) ; try { return new com.google.gerrit.server.change.IncludedInResolver ( repo , rw , commit , flag ) . includedInOne ( refs ) ; } finally { rw.disposeFlag ( flag ) ; } }
Source:
public void getProject ( ) throws java.lang.Exception { java.lang.String name = project.get ( ) ; com.google.gerrit.acceptance.RestResponse r = adminSession.get ( ( "/projects/" + name ) ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( HttpStatus.SC_OK ) ; com.google.gerrit.extensions.common.ProjectInfo p = newGson ( ) . fromJson ( r.getReader ( ) , com.google.gerrit.extensions.common.ProjectInfo.class ) ; com.google.common.truth.Truth.assertThat ( p.name ) . isEqualTo ( name ) ; }

Target:
public void getProjectWithGitSuffix ( ) throws java.lang.Exception { java.lang.String name = project.get ( ) ; com.google.gerrit.extensions.common.ProjectInfo p = gApi.projects ( ) . name ( name ) . get ( ) ; com.google.common.truth.Truth.assertThat ( p.name ) . isEqualTo ( name ) ; }
Source:
private boolean isEmpty ( ) { if ( ! ( migration.commitChangeWrites ( ) ) ) { return true ; } return ( ( changeUpdates.isEmpty ( ) ) && ( draftUpdates.isEmpty ( ) ) ) && ( toDelete.isEmpty ( ) ) ; }

Target:
private boolean isEmpty ( ) { if ( ! ( migration.commitChangeWrites ( ) ) ) { return true ; } return ( ( ( changeUpdates.isEmpty ( ) ) && ( draftUpdates.isEmpty ( ) ) ) && ( robotCommentUpdates.isEmpty ( ) ) ) && ( toDelete.isEmpty ( ) ) ; }
Source:
public void run ( ) { if ( ( active ) == null ) { active = this ; fixup.scheduleRepeating ( 20 ) ; } if ( ( active ) == ( this ) ) { net.codemirror.lib.ScrollInfo si = src.getScrollInfo ( ) ; updateScreenHeader ( si ) ; dst.scrollTo ( si.left ( ) , align ( si.top ( ) ) ) ; state = 0 ; } }

Target:
public void run ( ) { if ( ( active ) == null ) { active = this ; fixup.scheduleRepeating ( 20 ) ; } if ( ( active ) == ( this ) ) { net.codemirror.lib.ScrollInfo si = src.getScrollInfo ( ) ; if ( autoHideDiffTableHeader ) { updateDiffTableHeader ( si ) ; } dst.scrollTo ( si.left ( ) , align ( si.top ( ) ) ) ; state = 0 ; } }
Source:
public void onNewProjectCreated ( com.google.gerrit.extensions.events.NewProjectCreatedListener.Event event ) { com.googlesource.gerrit.plugins.hooks.HookArgs args = hookFactory.createArgs ( ) ; args.add ( "--project" , event.getProjectName ( ) ) ; args.add ( "--head" , event.getHeadName ( ) ) ; hook.submit ( event.getProjectName ( ) , args ) ; }

Target:
public void onNewProjectCreated ( com.google.gerrit.extensions.events.NewProjectCreatedListener.Event event ) { com.googlesource.gerrit.plugins.hooks.HookArgs args = hookFactory.createArgs ( ) ; args.add ( "--project" , event.getProjectName ( ) ) ; args.add ( "--head" , event.getHeadName ( ) ) ; hook.execute ( event.getProjectName ( ) , args ) ; }
Source:
public void onLoad ( com.google.gerrit.plugin.client.screen.Screen screen ) { java.lang.String projectName = com.google.gwt.http.client.URL.decode ( screen.getToken ( 1 ) ) ; java.lang.String revision = com.google.gwt.http.client.URL.decode ( screen.getToken ( 2 ) ) ; java.lang.String fileName = com.google.gwt.http.client.URL.decode ( screen.getToken ( 3 ) ) ; screen.show ( new com.googlesource.gerrit.plugins.xdocs.client.XDocScreen ( projectName , revision , fileName ) ) ; }

Target:
public void onLoad ( com.google.gerrit.plugin.client.screen.Screen screen ) { java.lang.String projectName = com.google.gwt.http.client.URL.decode ( screen.getToken ( 1 ) ) ; java.lang.String revision = com.google.gwt.http.client.URL.decode ( screen.getToken ( 2 ) ) ; java.lang.String path = com.google.gwt.http.client.URL.decode ( screen.getToken ( 3 ) ) ; screen.show ( new com.googlesource.gerrit.plugins.xdocs.client.XDocScreen ( projectName , revision , path ) ) ; screen.setWindowTitle ( com.googlesource.gerrit.plugins.xdocs.client.XDocScreen.getFileName ( path ) ) ; }
Source:
public void init ( final javax.servlet.ServletConfig config ) throws javax.servlet.ServletException { super . init ( config ) ; try { allowed = java.lang.Boolean.getBoolean ( getClass ( ) . getName ( ) ) ; } catch ( java.lang.SecurityException se ) { allowed = false ; } try { server = com.google.gerrit.server.GerritServer.getInstance ( ) ; } catch ( com.google.gwtorm.client.OrmException e ) { throw new javax.servlet.ServletException ( "Cannot load GerritServer" , e ) ; } catch ( com.google.gwtjsonrpc.server.XsrfException e ) { throw new javax.servlet.ServletException ( "Cannot load GerritServer" , e ) ; } }

Target:
public void init ( final javax.servlet.ServletConfig config ) throws javax.servlet.ServletException { super . init ( config ) ; allowed = com.google.gerrit.server.BecomeAnyAccountLoginServlet.isAllowed ( ) ; try { server = com.google.gerrit.server.GerritServer.getInstance ( ) ; } catch ( com.google.gwtorm.client.OrmException e ) { throw new javax.servlet.ServletException ( "Cannot load GerritServer" , e ) ; } catch ( com.google.gwtjsonrpc.server.XsrfException e ) { throw new javax.servlet.ServletException ( "Cannot load GerritServer" , e ) ; } }
Source:
public Change.Id apply ( com.google.gerrit.reviewdb.client.StarredChange starredChange ) { return starredChange.getChangeId ( ) ; }

Target:
private static java.util.SortedSet < java.lang.String > validateLabels ( java.util.Set < java.lang.String > labels ) { if ( labels == null ) { return com.google.common.collect.ImmutableSortedSet.of ( ) ; } java.util.SortedSet < java.lang.String > invalidLabels = new java.util.TreeSet < > ( ) ; for ( java.lang.String label : labels ) { if ( com.google.common.base.CharMatcher.WHITESPACE.matchesAnyOf ( label ) ) { invalidLabels.add ( label ) ; } } return invalidLabels ; }
Source:
private com.google.gwt.user.client.ui.Widget createIgnoreWhitespace ( ) { final com.google.gwt.user.client.ui.CheckBox cb = new com.google.gwt.user.client.ui.CheckBox ( PatchUtil.C.ignoreWhitespace ( ) ) ; cb.addClickHandler ( new com.google.gwt.event.dom.client.ClickHandler ( ) { @ java.lang.Override public void onClick ( com.google.gwt.event.dom.client.ClickEvent arg0 ) { if ( cb.getValue ( ) ) { scriptSettings.setWhitespace ( com.google.gerrit.client.data.PatchScriptSettings.Whitespace.IGNORE_SPACE_CHANGE ) ; } else { scriptSettings.setWhitespace ( com.google.gerrit.client.data.PatchScriptSettings.Whitespace.IGNORE_NONE ) ; } refresh ( false ) ; } } ) ; return cb ; }

Target:
private com.google.gwt.user.client.ui.Widget createIgnoreWhitespace ( ) { final com.google.gwt.user.client.ui.CheckBox cb = new com.google.gwt.user.client.ui.CheckBox ( PatchUtil.C.ignoreWhitespace ( ) ) ; cb.addValueChangeHandler ( new com.google.gwt.event.logical.shared.ValueChangeHandler < java.lang.Boolean > ( ) { @ java.lang.Override public void onValueChange ( com.google.gwt.event.logical.shared.ValueChangeEvent < java.lang.Boolean > event ) { if ( event.getValue ( ) ) { scriptSettings.setWhitespace ( com.google.gerrit.client.data.PatchScriptSettings.Whitespace.IGNORE_SPACE_CHANGE ) ; } else { scriptSettings.setWhitespace ( com.google.gerrit.client.data.PatchScriptSettings.Whitespace.IGNORE_NONE ) ; } refresh ( false ) ; } } ) ; return cb ; }
Source:
public void onSuccess ( com.google.gerrit.client.VoidResult result ) { for ( int row = 1 ; row < ( table.getRowCount ( ) ) ; ) { com.google.gerrit.client.projects.BranchInfo k = getRowItem ( row ) ; if ( ( k != null ) && ( branches.contains ( k.ref ( ) ) ) ) { table.removeRow ( row ) ; } else { row ++ ; } } }

Target:
public void onSuccess ( com.google.gerrit.client.VoidResult result ) { for ( int row = 1 ; row < ( table.getRowCount ( ) ) ; ) { com.google.gerrit.client.projects.BranchInfo k = getRowItem ( row ) ; if ( ( k != null ) && ( branches.contains ( k.ref ( ) ) ) ) { table.removeRow ( row ) ; } else { row ++ ; } } updateDeleteButton ( ) ; }
Source:
private void createRelations ( final com.google.gwtorm.client.StatementExecutor e ) throws com.google.gwtorm.client.OrmException , java.sql.SQLException { final com.google.gwtorm.schema.sql.SqlDialect dialect = dbDef.getDialect ( ) ; final com.google.gwtorm.schema.SchemaModel model = dbDef.getSchemaModel ( ) ; java.util.Set < java.lang.String > have = dialect.listTables ( getConnection ( ) ) ; for ( final com.google.gwtorm.schema.RelationModel r : model.getRelations ( ) ) { if ( ! ( have.contains ( r.getRelationName ( ) . toLowerCase ( ) ) ) ) { e.execute ( r.getCreateTableSql ( dialect ) ) ; } } }

Target:
private void createRelations ( final com.google.gwtorm.server.StatementExecutor e ) throws com.google.gwtorm.server.OrmException , java.sql.SQLException { final com.google.gwtorm.schema.sql.SqlDialect dialect = dbDef.getDialect ( ) ; final com.google.gwtorm.schema.SchemaModel model = dbDef.getSchemaModel ( ) ; java.util.Set < java.lang.String > have = dialect.listTables ( getConnection ( ) ) ; for ( final com.google.gwtorm.schema.RelationModel r : model.getRelations ( ) ) { if ( ! ( have.contains ( r.getRelationName ( ) . toLowerCase ( ) ) ) ) { e.execute ( r.getCreateTableSql ( dialect ) ) ; } } }
Source:
private void initChannels ( ) { setChannelFactories ( java.util.Arrays.< org.apache.sshd.common.NamedFactory < org.apache.sshd.common.Channel > > asList ( new org.apache.sshd.server.channel.ChannelSession.Factory ( ) , new org.apache.sshd.server.channel.ChannelDirectTcpip.Factory ( ) ) ) ; }

Target:
private void initForwarding ( ) { setTcpipForwardingFilter ( new org.apache.sshd.common.ForwardingFilter ( ) { @ java.lang.Override public boolean canForwardAgent ( org.apache.sshd.common.Session session ) { return false ; } @ java.lang.Override public boolean canForwardX11 ( org.apache.sshd.common.Session session ) { return false ; } @ java.lang.Override public boolean canListen ( org.apache.sshd.common.SshdSocketAddress address , org.apache.sshd.common.Session session ) { return false ; } @ java.lang.Override public boolean canConnect ( org.apache.sshd.common.SshdSocketAddress address , org.apache.sshd.common.Session session ) { return false ; } } ) ; setTcpipForwarderFactory ( new org.apache.sshd.common.forward.DefaultTcpipForwarderFactory ( ) ) ; }
Source:
private void tearDown ( ) throws java.lang.Exception { stat.execute ( ( "DROP TABLE " + ( com.ericsson.gerrit.plugins.eventslog.sql.SQLTable.TABLE_NAME ) ) ) ; BRANCH ( 6 ) ; com.ericsson.gerrit.plugins.eventslog.sql.cf0c7 Update ; com.ericsson.gerrit.plugins.eventslog.sql.to latest = ( stable ) - 2.14 ; com.ericsson.gerrit.plugins.eventslog.sql.to use ; }

Target:
public void setUp ( ) throws java.sql.SQLException { java.sql.Connection conn = java.sql.DriverManager.getConnection ( ( ( ( com.ericsson.gerrit.plugins.eventslog.sql.SQLStoreTest.TEST_URL ) + ";" ) + ( com.ericsson.gerrit.plugins.eventslog.sql.SQLStoreTest.TEST_OPTIONS ) ) ) ; mockEvent = new com.ericsson.gerrit.plugins.eventslog.sql.SQLStoreTest.MockEvent ( ) ; stat = conn.createStatement ( ) ; poolMock = new com.ericsson.gerrit.plugins.eventslog.sql.SQLStoreTest.PoolMock ( ) ; org.mockito.Mockito.when ( cfgMock.getMaxAge ( ) ) . thenReturn ( 5 ) ; org.mockito.Mockito.when ( cfgMock.getLocalStorePath ( ) ) . thenReturn ( testFolder.getRoot ( ) . toPath ( ) ) ; }
Source:
public com.google.gerrit.extensions.registration.RegistrationHandle add ( final T item ) { final java.util.concurrent.atomic.AtomicReference < T > ref = new java.util.concurrent.atomic.AtomicReference < T > ( item ) ; items.add ( ref ) ; return new com.google.gerrit.extensions.registration.RegistrationHandle ( ) { @ java.lang.Override public void remove ( ) { if ( ref.compareAndSet ( item , null ) ) { items.remove ( ref ) ; } } } ; }

Target:
public com.google.gerrit.extensions.registration.ReloadableRegistrationHandle < T > add ( com.google.inject.Key < T > key , com.google.inject.Provider < T > item ) { java.util.concurrent.atomic.AtomicReference < com.google.inject.Provider < T > > ref = new java.util.concurrent.atomic.AtomicReference < com.google.inject.Provider < T > > ( item ) ; items.add ( ref ) ; return new ReloadableHandle ( ref , key , item ) ; }
Source:
public synchronized void start ( ) { com.google.gerrit.server.plugins.PluginLoader.log.info ( ( "Loading plugins from " + ( pluginsDir.getAbsolutePath ( ) ) ) ) ; rescan ( false ) ; if ( ( scanner ) != null ) { scanner.start ( ) ; } }

Target:
public synchronized void start ( ) { com.google.gerrit.server.plugins.PluginLoader.log.info ( ( "Loading plugins from " + ( pluginsDir.getAbsolutePath ( ) ) ) ) ; srvInfoImpl.state = ServerInformation.State.STARTUP ; rescan ( ) ; srvInfoImpl.state = ServerInformation.State.RUNNING ; if ( ( scanner ) != null ) { scanner.start ( ) ; } }
Source:
private void initUI ( ) { projects = new com.google.gerrit.client.admin.ProjectListScreen.ProjectTable ( ) ; projects.setSavePointerId ( Link.ADMIN_PROJECTS ) ; add ( projects ) ; final com.google.gwt.user.client.ui.VerticalPanel fp = new com.google.gwt.user.client.ui.VerticalPanel ( ) ; fp.setStyleName ( "gerrit-AddSshKeyPanel" ) ; final com.google.gwt.user.client.ui.Label hdr = new com.google.gwt.user.client.ui.Label ( Util.C.headingCreateGroup ( ) ) ; hdr.setStyleName ( "gerrit-SmallHeading" ) ; fp.add ( hdr ) ; }

Target:
private void initUI ( ) { projects = new com.google.gerrit.client.admin.ProjectListScreen.ProjectTable ( ) ; projects.setSavePointerId ( Link.ADMIN_PROJECTS ) ; add ( projects ) ; final com.google.gwt.user.client.ui.VerticalPanel fp = new com.google.gwt.user.client.ui.VerticalPanel ( ) ; fp.setStyleName ( "gerrit-AddSshKeyPanel" ) ; fp.add ( new com.google.gerrit.client.ui.SmallHeading ( Util.C.headingCreateGroup ( ) ) ) ; }
Source:
private com.google.gerrit.extensions.api.changes.ReviewInput reviewFromJson ( ) throws com.google.gerrit.sshd.commands.UnloggedFailure { try ( java.io.InputStreamReader r = new java.io.InputStreamReader ( in , java.nio.charset.StandardCharsets.UTF_8 ) ) { return OutputFormat.JSON.newGson ( ) . fromJson ( com.google.common.io.CharStreams.toString ( r ) , com.google.gerrit.extensions.api.changes.ReviewInput.class ) ; } catch ( java.io.IOException | com.google.gson.JsonSyntaxException e ) { writeError ( ( ( e.getMessage ( ) ) + '\n' ) ) ; throw com.google.gerrit.sshd.commands.ReviewCommand.error ( "internal error while reading review input" ) ; } }

Target:
private com.google.gerrit.extensions.api.changes.ReviewInput reviewFromJson ( ) throws com.google.gerrit.sshd.commands.UnloggedFailure { try ( java.io.InputStreamReader r = new java.io.InputStreamReader ( in , java.nio.charset.StandardCharsets.UTF_8 ) ) { return OutputFormat.JSON.newGson ( ) . fromJson ( com.google.common.io.CharStreams.toString ( r ) , com.google.gerrit.extensions.api.changes.ReviewInput.class ) ; } catch ( java.io.IOException | com.google.gson.JsonSyntaxException e ) { writeError ( ( ( e.getMessage ( ) ) + '\n' ) ) ; throw die ( "internal error while reading review input" ) ; } }
Source:
public void duplicatePatchSetRevisions ( ) throws java.lang.Exception { com.google.gerrit.server.project.ChangeControl ctl = insertChange ( ) ; com.google.gerrit.reviewdb.client.PatchSet ps1 = psUtil.current ( db , ctl.getNotes ( ) ) ; java.lang.String rev = ps1.getRevision ( ) . get ( ) ; ctl = incrementPatchSet ( ctl , testRepo.getRevWalk ( ) . parseCommit ( org.eclipse.jgit.lib.ObjectId.fromString ( rev ) ) ) ; assertProblems ( ctl , null , com.google.gerrit.acceptance.server.change.ConsistencyCheckerIT.problem ( ( ( "Multiple patch sets pointing to " + rev ) + ": [1, 2]" ) ) ) ; }

Target:
public void duplicatePatchSetRevisions ( ) throws java.lang.Exception { com.google.gerrit.server.notedb.ChangeNotes notes = insertChange ( ) ; com.google.gerrit.reviewdb.client.PatchSet ps1 = psUtil.current ( db , notes ) ; java.lang.String rev = ps1.getRevision ( ) . get ( ) ; notes = incrementPatchSet ( notes , testRepo.getRevWalk ( ) . parseCommit ( org.eclipse.jgit.lib.ObjectId.fromString ( rev ) ) ) ; assertProblems ( notes , null , com.google.gerrit.acceptance.server.change.ConsistencyCheckerIT.problem ( ( ( "Multiple patch sets pointing to " + rev ) + ": [1, 2]" ) ) ) ; }
Source:
public void diff ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; com.google.gerrit.extensions.common.DiffInfo diff = gApi.changes ( ) . id ( r.getChangeId ( ) ) . revision ( r.getCommit ( ) . name ( ) ) . file ( com.google.gerrit.acceptance.PushOneCommit.FILE_NAME ) . diff ( ) ; org.junit.Assert.assertNull ( diff.metaA ) ; org.junit.Assert.assertEquals ( 1 , diff.metaB.lines.intValue ( ) ) ; }

Target:
public void diff ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; com.google.gerrit.extensions.common.DiffInfo diff = gApi.changes ( ) . id ( r.getChangeId ( ) ) . revision ( r.getCommit ( ) . name ( ) ) . file ( com.google.gerrit.acceptance.PushOneCommit.FILE_NAME ) . diff ( ) ; com.google.common.truth.Truth.assertThat ( diff.metaA ) . isNull ( ) ; com.google.common.truth.Truth.assertThat ( diff.metaB.lines ) . isEqualTo ( 1 ) ; }
Source:
public void testUpsertOneException ( ) throws com.google.gwtorm.server.OrmException , java.sql.SQLException { java.sql.SQLException exception = new java.sql.BatchUpdateException ( ) ; java.sql.PreparedStatement update = stubStatementThrowExceptionOnExecute ( com.google.gwtorm.jdbc.TestJdbcAccess.UPDATE , exception ) ; com.google.gwtorm.jdbc.JdbcAccess < com.google.gwtorm.jdbc.TestJdbcAccess.Data , com.google.gwtorm.jdbc.TestJdbcAccess.Data.DataKey > classUnderTest = createClassUnderTest ( ) ; try { classUnderTest.upsert ( oneRow ) ; org.junit.Assert.fail ( "missingException" ) ; } catch ( com.google.gwtorm.server.OrmException e ) { org.junit.Assert.assertSame ( e.getCause ( ) , exception ) ; } com.google.gwtorm.jdbc.TestJdbcAccess.assertUsedBatchingOnly ( update ) ; }

Target:
public void upsertOneException ( ) throws com.google.gwtorm.server.OrmException , java.sql.SQLException { java.sql.SQLException exception = new java.sql.BatchUpdateException ( ) ; java.sql.PreparedStatement update = stubStatementThrowExceptionOnExecute ( com.google.gwtorm.jdbc.AbstractTestJdbcAccess.UPDATE , exception ) ; try { classUnderTest.upsert ( oneRow ) ; org.junit.Assert.fail ( "missingException" ) ; } catch ( com.google.gwtorm.server.OrmException e ) { org.junit.Assert.assertSame ( e.getCause ( ) , exception ) ; } assertCorrectUpdating ( update , 1 ) ; }
Source:
public void onFailure ( java.lang.Throwable caught ) { enableButtons ( true ) ; new com.google.gerrit.client.ErrorDialog ( caught.getMessage ( ) ) . center ( ) ; }

Target:
public void onSend ( ) { com.google.gerrit.client.changes.ChangeApi.message ( changeId.get ( ) , revision , getMessageText ( ) , new com.google.gerrit.client.rpc.GerritCallback < com.google.gwt.core.client.JavaScriptObject > ( ) { @ java.lang.Override public void onSuccess ( com.google.gwt.core.client.JavaScriptObject msg ) { com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( changeId ) ) ; hide ( ) ; } } ) ; }
Source:
com.google.gerrit.common.changes.Side getStoredSideFromDisplaySide ( com.google.gerrit.client.diff.DisplaySide side ) { return ( side == ( DisplaySide.A ) ) && ( ( base ) == null ) ? com.google.gerrit.common.changes.Side.PARENT : com.google.gerrit.common.changes.Side.REVISION ; }

Target:
public void onSuccess ( java.lang.Void result ) { java.lang.String b = ( ( base ) != null ) ? base.getId ( ) : null ; java.lang.String rev = revision.getId ( ) ; com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( changeId , b , rev ) , new com.google.gerrit.client.change.ChangeScreen2 ( changeId , b , rev , openReplyBox ) ) ; }
Source:
public void upsertTwoNotExistingNoInfo ( ) throws com.google.gwtorm.client.OrmException , java.sql.SQLException { java.sql.PreparedStatement update = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.AbstractTestJdbcAccess.UPDATE , 0 , 0 ) ; java.sql.PreparedStatement insert = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.AbstractTestJdbcAccess.INSERT , 1 , 1 ) ; classUnderTest.upsert ( twoRows ) ; assertCorrectUpdating ( update , 1 , 2 ) ; assertCorrectUpdating ( insert , 1 , 2 ) ; }

Target:
public void upsertTwoNotExistingNoInfo ( ) throws com.google.gwtorm.server.OrmException , java.sql.SQLException { java.sql.PreparedStatement update = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.AbstractTestJdbcAccess.UPDATE , 0 , 0 ) ; java.sql.PreparedStatement insert = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.AbstractTestJdbcAccess.INSERT , 1 , 1 ) ; classUnderTest.upsert ( twoRows ) ; assertCorrectAttempting ( update , 1 , 2 ) ; assertCorrectUpdating ( insert , 1 , 2 ) ; }
Source:
private static boolean isJsonBody ( final com.google.gwt.http.client.Response rsp ) { java.lang.String type = rsp.getHeader ( "Content-Type" ) ; if ( type == null ) { return false ; } int semi = type.indexOf ( ';' ) ; if ( semi >= 0 ) { type = type.substring ( 0 , semi ) . trim ( ) ; } return JsonUtil.JSON_TYPE.equals ( type ) ; }

Target:
private static boolean isJsonBody ( final com.google.gwt.http.client.Response rsp ) { java.lang.String type = rsp.getHeader ( "Content-Type" ) ; if ( type == null ) { return false ; } int semi = type.indexOf ( ';' ) ; if ( semi >= 0 ) { type = type.substring ( 0 , semi ) . trim ( ) ; } return JsonConstants.JSON_TYPE.equals ( type ) ; }
Source:
private void initMessage ( final com.google.gwt.user.client.ui.Panel body ) { body.add ( new com.google.gerrit.client.ui.SmallHeading ( Util.C.headingCoverMessage ( ) ) ) ; final com.google.gwt.user.client.ui.VerticalPanel mwrap = new com.google.gwt.user.client.ui.VerticalPanel ( ) ; mwrap.setStyleName ( Gerrit.RESOURCES.css ( ) . coverMessage ( ) ) ; body.add ( mwrap ) ; message = new com.google.gwtexpui.globalkey.client.NpTextArea ( ) ; message.setCharacterWidth ( 60 ) ; message.setVisibleLines ( 10 ) ; com.google.gwt.user.client.DOM.setElementPropertyBoolean ( message.getElement ( ) , "spellcheck" , true ) ; mwrap.add ( message ) ; }

Target:
private void initMessage ( final com.google.gwt.user.client.ui.Panel body ) { body.add ( new com.google.gerrit.client.ui.SmallHeading ( Util.C.headingCoverMessage ( ) ) ) ; final com.google.gwt.user.client.ui.VerticalPanel mwrap = new com.google.gwt.user.client.ui.VerticalPanel ( ) ; mwrap.setStyleName ( Gerrit.RESOURCES.css ( ) . coverMessage ( ) ) ; body.add ( mwrap ) ; message = new com.google.gwtexpui.globalkey.client.NpTextArea ( ) ; message.setCharacterWidth ( 60 ) ; message.setVisibleLines ( 10 ) ; message.setSpellCheck ( true ) ; mwrap.add ( message ) ; }
Source:
private com.google.gerrit.server.events.DependencyAttribute newDependencyAttribute ( com.google.gerrit.reviewdb.client.Change c , com.google.gerrit.reviewdb.client.PatchSet ps ) { com.google.gerrit.server.events.DependencyAttribute d = new com.google.gerrit.server.events.DependencyAttribute ( ) ; d.number = c.getId ( ) . toString ( ) ; d.id = c.getKey ( ) . toString ( ) ; d.revision = ps.getRevision ( ) . get ( ) ; d.ref = ps.getRefName ( ) ; return d ; }

Target:
private com.google.gerrit.server.data.DependencyAttribute newDependencyAttribute ( com.google.gerrit.reviewdb.client.Change c , com.google.gerrit.reviewdb.client.PatchSet ps ) { com.google.gerrit.server.data.DependencyAttribute d = new com.google.gerrit.server.data.DependencyAttribute ( ) ; d.number = c.getId ( ) . toString ( ) ; d.id = c.getKey ( ) . toString ( ) ; d.revision = ps.getRevision ( ) . get ( ) ; d.ref = ps.getRefName ( ) ; return d ; }
Source:
private void enableUI ( boolean on ) { on &= ( com.google.gerrit.client.Gerrit.getUserAccount ( ) . getUserName ( ) ) != null ; generatePassword.setEnabled ( on ) ; clearPassword.setVisible ( ( on && ( ! ( "" . equals ( password.getText ( ) ) ) ) ) ) ; }

Target:
private void enableUI ( boolean on ) { on &= ( com.google.gerrit.client.Gerrit.getUserAccount ( ) . username ( ) ) != null ; generatePassword.setEnabled ( on ) ; clearPassword.setVisible ( ( on && ( ! ( "" . equals ( password.getText ( ) ) ) ) ) ) ; }
Source:
private static void encodeInt ( final byte [ ] buf , int v ) { buf [ 3 ] = ( ( byte ) ( v ) ) ; v >>>= 8 ; buf [ 2 ] = ( ( byte ) ( v ) ) ; v >>>= 8 ; buf [ 1 ] = ( ( byte ) ( v ) ) ; v >>>= 8 ; buf [ 0 ] = ( ( byte ) ( v ) ) ; }

Target:
private static void encodeInt ( final byte [ ] buf , final int o , int v ) { buf [ ( o + 3 ) ] = ( ( byte ) ( v ) ) ; v >>>= 8 ; buf [ ( o + 2 ) ] = ( ( byte ) ( v ) ) ; v >>>= 8 ; buf [ ( o + 1 ) ] = ( ( byte ) ( v ) ) ; v >>>= 8 ; buf [ o ] = ( ( byte ) ( v ) ) ; }
Source:
protected static java.util.Date parse ( java.lang.String value ) throws com.google.gerrit.server.query.QueryParseException { try { return org.eclipse.jgit.util.GitDateParser.parse ( value , org.joda.time.DateTime.now ( ) . toCalendar ( java.util.Locale.US ) ) ; } catch ( java.text.ParseException e ) { throw new com.google.gerrit.server.query.QueryParseException ( e.getMessage ( ) , e ) ; } }

Target:
protected static java.sql.Timestamp parse ( java.lang.String value ) throws com.google.gerrit.server.query.QueryParseException { try { return com.google.gwtjsonrpc.common.JavaSqlTimestampHelper.parseTimestamp ( value ) ; } catch ( java.lang.IllegalArgumentException e ) { throw new com.google.gerrit.server.query.QueryParseException ( e.getMessage ( ) , e ) ; } }
Source:
public void testNotAuthorized ( ) throws java.lang.Exception { java.lang.String expected = "unauthorized" ; com.ericsson.gerrit.plugins.highavailability.HttpSessionTest.wireMockRule.givenThat ( com.github.tomakehurst.wiremock.client.WireMock.post ( com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo ( com.ericsson.gerrit.plugins.highavailability.HttpSessionTest.ENDPOINT ) ) . willReturn ( com.github.tomakehurst.wiremock.client.WireMock.aResponse ( ) . withStatus ( com.ericsson.gerrit.plugins.highavailability.HttpSessionTest.UNAUTHORIZED ) . withBody ( expected ) ) ) ; com.ericsson.gerrit.plugins.highavailability.IndexResponseHandler.IndexResult result = httpSession.post ( com.ericsson.gerrit.plugins.highavailability.HttpSessionTest.ENDPOINT ) ; com.google.common.truth.Truth.assertThat ( result.isSuccessful ( ) ) . isFalse ( ) ; com.google.common.truth.Truth.assertThat ( result.getMessage ( ) ) . isEqualTo ( expected ) ; }

Target:
public void testNotAuthorized ( ) throws java.lang.Exception { java.lang.String expected = "unauthorized" ; com.ericsson.gerrit.plugins.highavailability.HttpSessionTest.wireMockRule.givenThat ( com.github.tomakehurst.wiremock.client.WireMock.post ( com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo ( com.ericsson.gerrit.plugins.highavailability.HttpSessionTest.ENDPOINT ) ) . willReturn ( com.github.tomakehurst.wiremock.client.WireMock.aResponse ( ) . withStatus ( com.ericsson.gerrit.plugins.highavailability.HttpSessionTest.UNAUTHORIZED ) . withBody ( expected ) ) ) ; com.ericsson.gerrit.plugins.highavailability.HttpResponseHandler.HttpResult result = httpSession.post ( com.ericsson.gerrit.plugins.highavailability.HttpSessionTest.ENDPOINT ) ; com.google.common.truth.Truth.assertThat ( result.isSuccessful ( ) ) . isFalse ( ) ; com.google.common.truth.Truth.assertThat ( result.getMessage ( ) ) . isEqualTo ( expected ) ; }
Source:
public void testHasValidScheme ( ) { assertTrue ( com.google.gwtexpui.safehtml.client.LinkFindReplace.hasValidScheme ( "/absolute/path" ) ) ; assertTrue ( com.google.gwtexpui.safehtml.client.LinkFindReplace.hasValidScheme ( "relative/path" ) ) ; assertTrue ( com.google.gwtexpui.safehtml.client.LinkFindReplace.hasValidScheme ( "http://url/" ) ) ; assertTrue ( com.google.gwtexpui.safehtml.client.LinkFindReplace.hasValidScheme ( "HTTP://url/" ) ) ; assertTrue ( com.google.gwtexpui.safehtml.client.LinkFindReplace.hasValidScheme ( "https://url/" ) ) ; assertTrue ( com.google.gwtexpui.safehtml.client.LinkFindReplace.hasValidScheme ( "mailto://url/" ) ) ; assertFalse ( com.google.gwtexpui.safehtml.client.LinkFindReplace.hasValidScheme ( "ftp://url/" ) ) ; assertFalse ( com.google.gwtexpui.safehtml.client.LinkFindReplace.hasValidScheme ( "data:evil" ) ) ; assertFalse ( com.google.gwtexpui.safehtml.client.LinkFindReplace.hasValidScheme ( "javascript:alert(1)" ) ) ; }

Target:
public void testHasValidScheme ( ) { org.junit.Assert.assertTrue ( com.google.gwtexpui.safehtml.client.LinkFindReplace.hasValidScheme ( "/absolute/path" ) ) ; org.junit.Assert.assertTrue ( com.google.gwtexpui.safehtml.client.LinkFindReplace.hasValidScheme ( "relative/path" ) ) ; org.junit.Assert.assertTrue ( com.google.gwtexpui.safehtml.client.LinkFindReplace.hasValidScheme ( "http://url/" ) ) ; org.junit.Assert.assertTrue ( com.google.gwtexpui.safehtml.client.LinkFindReplace.hasValidScheme ( "HTTP://url/" ) ) ; org.junit.Assert.assertTrue ( com.google.gwtexpui.safehtml.client.LinkFindReplace.hasValidScheme ( "https://url/" ) ) ; org.junit.Assert.assertTrue ( com.google.gwtexpui.safehtml.client.LinkFindReplace.hasValidScheme ( "mailto://url/" ) ) ; org.junit.Assert.assertFalse ( com.google.gwtexpui.safehtml.client.LinkFindReplace.hasValidScheme ( "ftp://url/" ) ) ; org.junit.Assert.assertFalse ( com.google.gwtexpui.safehtml.client.LinkFindReplace.hasValidScheme ( "data:evil" ) ) ; org.junit.Assert.assertFalse ( com.google.gwtexpui.safehtml.client.LinkFindReplace.hasValidScheme ( "javascript:alert(1)" ) ) ; }
Source:
private static com.google.common.collect.Multimap < org.eclipse.jgit.lib.ObjectId , java.lang.String > collectGroups ( org.eclipse.jgit.revwalk.RevWalk rw , com.google.common.collect.ImmutableMultimap.Builder < org.eclipse.jgit.lib.ObjectId , com.google.gerrit.reviewdb.client.PatchSet.Id > patchSetsBySha , com.google.common.collect.ImmutableListMultimap.Builder < com.google.gerrit.reviewdb.client.PatchSet.Id , java.lang.String > groupLookup ) throws java.lang.Exception { com.google.gerrit.server.git.GroupCollector gc = new com.google.gerrit.server.git.GroupCollector ( patchSetsBySha.build ( ) , groupLookup.build ( ) ) ; org.eclipse.jgit.revwalk.RevCommit c ; while ( ( c = rw.next ( ) ) != null ) { gc.visit ( c ) ; } return gc.getGroups ( ) ; }

Target:
private static com.google.common.collect.SortedSetMultimap < org.eclipse.jgit.lib.ObjectId , java.lang.String > collectGroups ( org.eclipse.jgit.revwalk.RevWalk rw , com.google.common.collect.ImmutableListMultimap.Builder < org.eclipse.jgit.lib.ObjectId , com.google.gerrit.reviewdb.client.PatchSet.Id > patchSetsBySha , com.google.common.collect.ImmutableListMultimap.Builder < com.google.gerrit.reviewdb.client.PatchSet.Id , java.lang.String > groupLookup ) throws java.lang.Exception { com.google.gerrit.server.git.GroupCollector gc = new com.google.gerrit.server.git.GroupCollector ( patchSetsBySha.build ( ) , groupLookup.build ( ) ) ; org.eclipse.jgit.revwalk.RevCommit c ; while ( ( c = rw.next ( ) ) != null ) { gc.visit ( c ) ; } return gc.getGroups ( ) ; }
Source:
public void index ( com.google.gerrit.reviewdb.client.Project.NameKey nameKey ) throws java.io.IOException { for ( com.google.gerrit.index.Index < ? , com.google.gerrit.server.project.ProjectData > i : getWriteIndexes ( ) ) { i.replace ( projectCache.get ( nameKey ) . toProjectData ( ) ) ; } fireProjectIndexedEvent ( nameKey.get ( ) ) ; }

Target:
public void index ( com.google.gerrit.reviewdb.client.Project.NameKey nameKey ) throws java.io.IOException { com.google.gerrit.server.project.ProjectState projectState = projectCache.get ( nameKey ) ; if ( projectState != null ) { com.google.gerrit.server.project.ProjectData projectData = projectState.toProjectData ( ) ; for ( com.google.gerrit.server.index.project.ProjectIndex i : getWriteIndexes ( ) ) { i.replace ( projectData ) ; } fireProjectIndexedEvent ( nameKey.get ( ) ) ; } else { for ( com.google.gerrit.server.index.project.ProjectIndex i : getWriteIndexes ( ) ) { i.delete ( nameKey ) ; } } }
Source:
public void testUnblockVisibilityByRegisteredUsers ( ) { com.google.gerrit.server.project.Util.block ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS ) ; org.junit.Assert.assertTrue ( "u can read" , u.controlForRef ( "refs/heads/master" ) . isVisibleByRegisteredUsers ( ) ) ; }

Target:
public void testUnblockVisibilityByRegisteredUsers ( ) { com.google.gerrit.server.project.Util.block ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS ) ; com.google.common.truth.Truth.assertThat ( u.controlForRef ( "refs/heads/master" ) . isVisibleByRegisteredUsers ( ) ) . named ( "u can read" ) . isTrue ( ) ; }
Source:
public void onSuccess ( final com.google.gerrit.common.data.HostPageData result ) { com.google.gwt.dom.client.Document.get ( ) . getElementById ( "gerrit_hostpagedata" ) . removeFromParent ( ) ; com.google.gerrit.client.Gerrit.myConfig = result.config ; com.google.gerrit.client.Gerrit.myTheme = result.theme ; if ( ( result.account ) != null ) { com.google.gerrit.client.Gerrit.myAccount = result.account ; com.google.gerrit.client.Gerrit.xGerritAuth = result.xGerritAuth ; } if ( ( result.accountDiffPref ) != null ) { com.google.gerrit.client.Gerrit.myAccountDiffPref = result.accountDiffPref ; com.google.gerrit.client.Gerrit.applyUserPreferences ( ) ; } onModuleLoad2 ( result ) ; }

Target:
public void onSuccess ( com.google.gerrit.client.info.AccountInfo result ) { com.google.gerrit.client.Gerrit.myAccount = result ; }
Source:
private void assertProblems ( com.google.gerrit.server.git.gpg.TestKey tk , java.lang.String ... expected ) throws java.lang.Exception { com.google.gerrit.server.git.gpg.CheckResult result = checker.check ( tk.getPublicKey ( ) , tk.getKeyId ( ) ) ; org.junit.Assert.assertEquals ( java.util.Arrays.asList ( expected ) , result.getProblems ( ) ) ; }

Target:
private void assertProblems ( com.google.gerrit.gpg.testutil.TestKey tk , java.lang.String ... expected ) throws java.lang.Exception { com.google.gerrit.gpg.CheckResult result = checker.check ( tk.getPublicKey ( ) , tk.getKeyId ( ) ) ; org.junit.Assert.assertEquals ( java.util.Arrays.asList ( expected ) , result.getProblems ( ) ) ; }