auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected static < T extends java.lang.Enum < ? > > T [ ] all ( final T value ) { try { return ( ( T [ ] ) ( value.getClass ( ) . getMethod ( "values" ) . invoke ( null ) ) ) ; } catch ( java.lang.IllegalArgumentException | java.lang.NoSuchMethodException | java.lang.reflect.InvocationTargetException | java.lang.IllegalAccessException | java.lang.SecurityException e ) { throw new java.lang.IllegalArgumentException ( "Cannot obtain enumeration values" , e ) ; } }

Target:
protected static < T extends java.lang.Enum < ? > > T [ ] all ( final T value ) { try { return ( ( T [ ] ) ( value.getDeclaringClass ( ) . getMethod ( "values" ) . invoke ( null ) ) ) ; } catch ( java.lang.IllegalArgumentException | java.lang.NoSuchMethodException | java.lang.reflect.InvocationTargetException | java.lang.IllegalAccessException | java.lang.SecurityException e ) { throw new java.lang.IllegalArgumentException ( "Cannot obtain enumeration values" , e ) ; } }
Source:
public void createEmptyEditRest ( ) throws java.lang.Exception { adminRestSession.post ( urlEdit ( ) ) . assertNoContent ( ) ; com.google.common.base.Optional < com.google.gerrit.server.edit.ChangeEdit > edit = editUtil.byChange ( change ) ; com.google.gerrit.acceptance.edit.ChangeEditIT.assertByteArray ( fileUtil.getContent ( projectCache.get ( edit.get ( ) . getChange ( ) . getProject ( ) ) , org.eclipse.jgit.lib.ObjectId.fromString ( edit.get ( ) . getRevision ( ) . get ( ) ) , com.google.gerrit.acceptance.edit.ChangeEditIT.FILE_NAME ) , com.google.gerrit.acceptance.edit.ChangeEditIT.CONTENT_OLD ) ; }

Target:
public void createEmptyEditRest ( ) throws java.lang.Exception { adminRestSession.post ( urlEdit ( ) ) . assertNoContent ( ) ; java.util.Optional < com.google.gerrit.server.edit.ChangeEdit > edit = editUtil.byChange ( change ) ; com.google.gerrit.acceptance.edit.ChangeEditIT.assertByteArray ( fileUtil.getContent ( projectCache.get ( edit.get ( ) . getChange ( ) . getProject ( ) ) , org.eclipse.jgit.lib.ObjectId.fromString ( edit.get ( ) . getRevision ( ) . get ( ) ) , com.google.gerrit.acceptance.edit.ChangeEditIT.FILE_NAME ) , com.google.gerrit.acceptance.edit.ChangeEditIT.CONTENT_OLD ) ; }
Source:
public boolean equals ( java.lang.Object other ) { return ( ( other != null ) && ( ( getClass ( ) ) == ( other.getClass ( ) ) ) ) && ( pred.equals ( ( ( com.google.gerrit.server.index.PredicateWrapper ) ( other ) ) . pred ) ) ; }

Target:
public boolean equals ( java.lang.Object other ) { return ( ( other != null ) && ( ( getClass ( ) ) == ( other.getClass ( ) ) ) ) && ( pred.equals ( ( ( com.google.gerrit.server.index.IndexedChangeQuery ) ( other ) ) . pred ) ) ; }
Source:
private static boolean eq ( final org.spearce.jgit.lib.ObjectId a , final org.spearce.jgit.lib.ObjectId b ) { if ( ( a == null ) && ( b == null ) ) { return true ; } return ( a != null ) && ( b != null ) ? a.equals ( b ) : false ; }

Target:
private static boolean eq ( final org.spearce.jgit.lib.ObjectId a , final org.spearce.jgit.lib.ObjectId b ) { if ( ( a == null ) && ( b == null ) ) { return true ; } return ( ( a != null ) && ( b != null ) ) && ( org.spearce.jgit.lib.AnyObjectId.equals ( a , b ) ) ; }
Source:
public void onSuccess ( com.google.gwt.core.client.JsArray < com.google.gerrit.client.account.SshKeyInfo > result ) { keys.display ( com.google.gerrit.client.rpc.Natives.asList ( result ) ) ; if ( ( ( result.length ( ) ) == 0 ) && ( keys.isVisible ( ) ) ) { showAddKeyBlock ( true ) ; } if ( ( ++ ( loadCount ) ) == 2 ) { display ( ) ; } }

Target:
public void onSuccess ( final java.util.List < com.google.gerrit.common.data.SshHostKey > result ) { serverKeys.clear ( ) ; for ( final com.google.gerrit.common.data.SshHostKey keyInfo : result ) { serverKeys.add ( new com.google.gerrit.client.account.SshHostKeyPanel ( keyInfo ) ) ; } if ( ( ++ ( loadCount ) ) == 2 ) { display ( ) ; } }
Source:
public void rescheduleOnRecoverableException ( ) throws java.io.IOException { org.mockito.Mockito.when ( session.post ( org.mockito.ArgumentMatchers.eq ( com.googlesource.gerrit.plugins.webhooks.PostTaskTest.WEBHOOK_URL ) , org.mockito.ArgumentMatchers.eq ( content ) ) ) . thenThrow ( java.io.IOException.class ) ; task.run ( ) ; org.mockito.Mockito.verify ( executor , org.mockito.Mockito.times ( 1 ) ) . schedule ( task , com.googlesource.gerrit.plugins.webhooks.PostTaskTest.RETRY_INTERVAL , java.util.concurrent.TimeUnit.MILLISECONDS ) ; }

Target:
public void rescheduleOnRecoverableException ( ) throws java.io.IOException { org.mockito.Mockito.when ( session.post ( org.mockito.ArgumentMatchers.eq ( remote ) , org.mockito.ArgumentMatchers.eq ( content ) ) ) . thenThrow ( java.io.IOException.class ) ; task.run ( ) ; org.mockito.Mockito.verify ( executor , org.mockito.Mockito.times ( 1 ) ) . schedule ( task , com.googlesource.gerrit.plugins.webhooks.PostTaskTest.RETRY_INTERVAL , java.util.concurrent.TimeUnit.MILLISECONDS ) ; }
Source:
protected void displayPopup ( ) { popingUp = true ; if ( firstPopupLoad ) { populateProjects ( ) ; } else { popup.setPopupPositionAndShow ( popupPosition ) ; com.google.gwtexpui.globalkey.client.GlobalKey.dialog ( popup ) ; com.google.gwtexpui.globalkey.client.GlobalKey.addApplication ( popup , new com.google.gwtexpui.globalkey.client.HidePopupPanelCommand ( 0 , com.google.gwt.event.dom.client.KeyCodes.KEY_ESCAPE , popup ) ) ; projectsTab.setRegisterKeys ( true ) ; popingUp = false ; } }

Target:
protected void displayPopup ( ) { popingUp = true ; if ( firstPopupLoad ) { populateProjects ( ) ; } else { popup.setPopupPositionAndShow ( popupPosition ) ; com.google.gwtexpui.globalkey.client.GlobalKey.dialog ( popup ) ; com.google.gwtexpui.globalkey.client.GlobalKey.addApplication ( popup , new com.google.gwtexpui.globalkey.client.HidePopupPanelCommand ( 0 , com.google.gwt.event.dom.client.KeyCodes.KEY_ESCAPE , popup ) ) ; projectsTab.setRegisterKeys ( true ) ; projectsTab.finishDisplay ( ) ; if ( ( regWindowResize ) == null ) { regWindowResize = com.google.gwt.user.client.Window.addResizeHandler ( this ) ; } popingUp = false ; } }
Source:
public void unblockMoreSpecificRefWithExclusiveFlag ( ) { com.google.gerrit.server.project.Util.block ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/heads/master" , true ) ; com.google.gerrit.server.project.ProjectControl u = user ( local , com.google.gerrit.server.project.Util.DEVS ) ; assertCanUpdate ( "refs/heads/master" , u ) ; }

Target:
public void unblockMoreSpecificRefInLocalWithExclusiveFlag_Fails ( ) { com.google.gerrit.server.project.testing.Util.block ( parent , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.testing.Util.allow ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.testing.Util.DEVS , "refs/heads/master" , true ) ; com.google.gerrit.server.project.ProjectControl u = user ( local , com.google.gerrit.server.project.testing.Util.DEVS ) ; assertCannotUpdate ( "refs/heads/master" , u ) ; }
Source:
private void setUpClient ( ) { eventsDb = new com.ericsson.gerrit.plugins.eventslog.SQLClient ( com.ericsson.gerrit.plugins.eventslog.SQLStoreTest.TEST_DRIVER , com.ericsson.gerrit.plugins.eventslog.SQLStoreTest.TEST_PATH , com.ericsson.gerrit.plugins.eventslog.SQLStoreTest.TEST_OPTIONS ) ; localEventsDb = new com.ericsson.gerrit.plugins.eventslog.SQLClient ( com.ericsson.gerrit.plugins.eventslog.SQLStoreTest.TEST_DRIVER , com.ericsson.gerrit.plugins.eventslog.SQLStoreTest.TEST_LOCAL_PATH , com.ericsson.gerrit.plugins.eventslog.SQLStoreTest.TEST_OPTIONS ) ; store = new com.ericsson.gerrit.plugins.eventslog.SQLStore ( pcFactoryMock , userProviderMock , cfgMock , eventsDb , localEventsDb ) ; store.start ( ) ; }

Target:
private void setUpClient ( ) { eventsDb = new com.ericsson.gerrit.plugins.eventslog.SQLClient ( com.ericsson.gerrit.plugins.eventslog.SQLStoreTest.TEST_DRIVER , com.ericsson.gerrit.plugins.eventslog.SQLStoreTest.TEST_PATH , com.ericsson.gerrit.plugins.eventslog.SQLStoreTest.TEST_OPTIONS ) ; localEventsDb = new com.ericsson.gerrit.plugins.eventslog.SQLClient ( com.ericsson.gerrit.plugins.eventslog.SQLStoreTest.TEST_DRIVER , com.ericsson.gerrit.plugins.eventslog.SQLStoreTest.TEST_LOCAL_PATH , com.ericsson.gerrit.plugins.eventslog.SQLStoreTest.TEST_OPTIONS ) ; store = new com.ericsson.gerrit.plugins.eventslog.SQLStore ( pcFactoryMock , userProviderMock , cfgMock , eventsDb , localEventsDb , poolMock ) ; store.start ( ) ; }
Source:
com.google.common.util.concurrent.ListeningExecutorService getIndexExecutor ( @ com.google.gerrit.server.config.GerritServerConfig org.eclipse.jgit.lib.Config config , com.google.gerrit.server.git.WorkQueue workQueue ) { int threads = this . threads ; if ( threads <= 0 ) { threads = config.getInt ( "index" , null , "threads" , 0 ) ; } if ( threads <= 0 ) { return com.google.common.util.concurrent.MoreExecutors.newDirectExecutorService ( ) ; } return com.google.common.util.concurrent.MoreExecutors.listeningDecorator ( workQueue.createQueue ( threads , "index" ) ) ; }

Target:
com.google.common.util.concurrent.ListeningExecutorService getInteractiveIndexExecutor ( @ com.google.gerrit.server.config.GerritServerConfig org.eclipse.jgit.lib.Config config , com.google.gerrit.server.git.WorkQueue workQueue ) { if ( ( interactiveExecutor ) != null ) { return interactiveExecutor ; } int threads = this . threads ; if ( threads <= 0 ) { threads = config.getInt ( "index" , null , "threads" , 0 ) ; } if ( threads <= 0 ) { return com.google.common.util.concurrent.MoreExecutors.newDirectExecutorService ( ) ; } return com.google.common.util.concurrent.MoreExecutors.listeningDecorator ( workQueue.createQueue ( threads , "Index-Interactive" ) ) ; }
Source:
private org.eclipse.jgit.treewalk.TreeWalk find ( final org.eclipse.jgit.lib.ObjectId within ) throws java.io.IOException , org.eclipse.jgit.errors.CorruptObjectException , org.eclipse.jgit.errors.IncorrectObjectTypeException , org.eclipse.jgit.errors.MissingObjectException { if ( ( path ) == null ) { return null ; } final org.eclipse.jgit.revwalk.RevWalk rw = new org.eclipse.jgit.revwalk.RevWalk ( db ) ; final org.eclipse.jgit.revwalk.RevTree tree = rw.parseTree ( within ) ; return org.eclipse.jgit.treewalk.TreeWalk.forPath ( db , path , tree ) ; }

Target:
private org.eclipse.jgit.treewalk.TreeWalk find ( final org.eclipse.jgit.lib.ObjectId within ) throws java.io.IOException , org.eclipse.jgit.errors.CorruptObjectException , org.eclipse.jgit.errors.IncorrectObjectTypeException , org.eclipse.jgit.errors.MissingObjectException { if ( ( path ) == null ) { return null ; } final org.eclipse.jgit.revwalk.RevWalk rw = new org.eclipse.jgit.revwalk.RevWalk ( reader ) ; final org.eclipse.jgit.revwalk.RevTree tree = rw.parseTree ( within ) ; return org.eclipse.jgit.treewalk.TreeWalk.forPath ( reader , path , tree ) ; }
Source:
private void install ( com.google.gerrit.server.plugins.Plugin plugin ) { if ( ! ( plugin.getName ( ) . equals ( pluginName ) ) ) { return ; } filter = load ( plugin ) ; plugin.add ( new com.google.gerrit.extensions.registration.RegistrationHandle ( ) { @ java.lang.Override public void remove ( ) { filter = null ; } } ) ; }

Target:
private void install ( com.google.gerrit.server.plugins.Plugin plugin ) { if ( ! ( plugin.getName ( ) . equals ( pluginName ) ) ) { return ; } final com.google.inject.servlet.GuiceFilter guiceFilter = load ( plugin ) ; plugin.add ( new com.google.gerrit.extensions.registration.RegistrationHandle ( ) { @ java.lang.Override public void remove ( ) { filter.compareAndSet ( guiceFilter , null ) ; } } ) ; filter.set ( guiceFilter ) ; }
Source:
public void visit ( org.pegdown.ast.StrongEmphSuperNode node ) { if ( node.isClosed ( ) ) { wrapChildren ( ( node.isStrong ( ) ? "strong" : "em" ) , node ) ; } else { html.appendAndEscape ( node.getChars ( ) ) ; visitChildren ( node ) ; } }

Target:
public void visit ( org.commonmark.node.Code node ) { html.open ( "code" ) . appendAndEscape ( node.getLiteral ( ) ) . close ( "code" ) ; }
Source:
public static com.google.gerrit.common.data.LabelType withDefaultValuesDoNotCheckName ( java.lang.String name ) { java.util.List < com.google.gerrit.common.data.LabelValue > values = new java.util.ArrayList < > ( 2 ) ; values.add ( new com.google.gerrit.common.data.LabelValue ( ( ( short ) ( 0 ) ) , "Rejected" ) ) ; values.add ( new com.google.gerrit.common.data.LabelValue ( ( ( short ) ( 1 ) ) , "Approved" ) ) ; return new com.google.gerrit.common.data.LabelType ( name , values ) ; }

Target:
public static com.google.gerrit.common.data.LabelType withDefaultValues ( java.lang.String name ) { com.google.gerrit.common.data.LabelType.checkName ( name ) ; java.util.List < com.google.gerrit.common.data.LabelValue > values = new java.util.ArrayList < > ( 2 ) ; values.add ( new com.google.gerrit.common.data.LabelValue ( ( ( short ) ( 0 ) ) , "Rejected" ) ) ; values.add ( new com.google.gerrit.common.data.LabelValue ( ( ( short ) ( 1 ) ) , "Approved" ) ) ; return new com.google.gerrit.common.data.LabelType ( name , values ) ; }
Source:
private void fireEvent ( final com.google.gerrit.reviewdb.Change change , final com.google.gerrit.server.events.ChangeEvent event ) { for ( com.google.gerrit.common.ChangeHookRunner.ChangeListenerHolder holder : listeners.values ( ) ) { if ( isVisibleTo ( change , holder.user ) ) { holder.listener.onChangeEvent ( event ) ; } } }

Target:
private void fireEvent ( final com.google.gerrit.reviewdb.Change change , final com.google.gerrit.server.events.ChangeEvent event , final com.google.gerrit.reviewdb.ReviewDb db ) throws com.google.gwtorm.client.OrmException { for ( com.google.gerrit.common.ChangeHookRunner.ChangeListenerHolder holder : listeners.values ( ) ) { if ( isVisibleTo ( change , holder.user , db ) ) { holder.listener.onChangeEvent ( event ) ; } } }
Source:
public void SetDiffPreferences ( ) throws java.lang.Exception { int newLineLength = ( com.google.gerrit.extensions.client.DiffPreferencesInfo.defaults ( ) . lineLength ) + 10 ; com.google.gerrit.extensions.client.DiffPreferencesInfo update = new com.google.gerrit.extensions.client.DiffPreferencesInfo ( ) ; update.lineLength = newLineLength ; com.google.gerrit.extensions.client.DiffPreferencesInfo result = put ( update ) ; com.google.common.truth.Truth.assertThat ( result.lineLength ) . named ( "lineLength" ) . isEqualTo ( newLineLength ) ; result = get ( ) ; com.google.gerrit.extensions.client.DiffPreferencesInfo expected = com.google.gerrit.extensions.client.DiffPreferencesInfo.defaults ( ) ; expected.lineLength = newLineLength ; assertPrefsEqual ( result , expected ) ; }

Target:
public void setDiffPreferences ( ) throws java.lang.Exception { int newLineLength = ( com.google.gerrit.extensions.client.DiffPreferencesInfo.defaults ( ) . lineLength ) + 10 ; com.google.gerrit.extensions.client.DiffPreferencesInfo update = new com.google.gerrit.extensions.client.DiffPreferencesInfo ( ) ; update.lineLength = newLineLength ; com.google.gerrit.extensions.client.DiffPreferencesInfo result = put ( update ) ; com.google.common.truth.Truth.assertThat ( result.lineLength ) . named ( "lineLength" ) . isEqualTo ( newLineLength ) ; result = get ( ) ; com.google.gerrit.extensions.client.DiffPreferencesInfo expected = com.google.gerrit.extensions.client.DiffPreferencesInfo.defaults ( ) ; expected.lineLength = newLineLength ; assertPrefsEqual ( result , expected ) ; }
Source:
public com.google.common.collect.ImmutableList < com.google.gerrit.reviewdb.client.AccountGroup.UUID > load ( com.google.gerrit.reviewdb.client.AccountGroup.UUID key ) throws com.google.gwtorm.server.OrmException { try ( com.google.gerrit.reviewdb.server.ReviewDb db = schema.open ( ) ) { return groups.getParentGroups ( db , key ) . map ( groupCache :: get ) . map ( AccountGroup :: getGroupUUID ) . filter ( java.util.Objects :: nonNull ) . collect ( com.google.common.collect.ImmutableList.toImmutableList ( ) ) ; } }

Target:
public com.google.common.collect.ImmutableList < com.google.gerrit.reviewdb.client.AccountGroup.UUID > load ( com.google.gerrit.reviewdb.client.AccountGroup.UUID key ) throws com.google.gwtorm.server.OrmException { try ( com.google.gerrit.reviewdb.server.ReviewDb db = schema.open ( ) ) { return groups.getParentGroups ( db , key ) . map ( groupCache :: get ) . flatMap ( Streams :: stream ) . map ( InternalGroup :: getGroupUUID ) . collect ( com.google.common.collect.ImmutableList.toImmutableList ( ) ) ; } }
Source:
private com.google.gerrit.server.query.change.ChangeDataSource source ( ) { for ( com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > p : getChildren ( ) ) { if ( p instanceof com.google.gerrit.server.query.change.ChangeDataSource ) { return ( ( com.google.gerrit.server.query.change.ChangeDataSource ) ( p ) ) ; } } return null ; }

Target:
private com.google.gerrit.server.query.change.ChangeDataSource source ( ) { int minCost = java.lang.Integer.MAX_VALUE ; com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > s = null ; for ( com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > p : getChildren ( ) ) { if ( ( p instanceof com.google.gerrit.server.query.change.ChangeDataSource ) && ( ( p.getCost ( ) ) < minCost ) ) { s = p ; minCost = p.getCost ( ) ; } } return ( ( com.google.gerrit.server.query.change.ChangeDataSource ) ( s ) ) ; }
Source:
public void add ( com.google.gerrit.server.notedb.ChangeUpdate update ) { com.google.common.base.Preconditions.checkArgument ( update.getProjectName ( ) . equals ( projectName ) , "update for project %s cannot be added to manager for project %s" , update.getProjectName ( ) , projectName ) ; changeUpdates.put ( update.getRefName ( ) , update ) ; com.google.gerrit.server.notedb.ChangeDraftUpdate du = update.getDraftUpdate ( ) ; if ( du != null ) { draftUpdates.put ( du.getRefName ( ) , du ) ; } }

Target:
public void add ( com.google.gerrit.server.notedb.ChangeUpdate update ) { com.google.common.base.Preconditions.checkArgument ( update.getProjectName ( ) . equals ( projectName ) , "update for project %s cannot be added to manager for project %s" , update.getProjectName ( ) , projectName ) ; com.google.common.base.Preconditions.checkState ( ( ( staged ) == null ) , "cannot add new update after staging" ) ; changeUpdates.put ( update.getRefName ( ) , update ) ; com.google.gerrit.server.notedb.ChangeDraftUpdate du = update.getDraftUpdate ( ) ; if ( du != null ) { draftUpdates.put ( du.getRefName ( ) , du ) ; } }
Source:
private void enableForm ( final boolean canModify ) { groupNameTxt.setEnabled ( canModify ) ; ownerTxtBox.setEnabled ( canModify ) ; descTxt.setEnabled ( canModify ) ; typeSelect.setEnabled ( canModify ) ; addMemberBox.setEnabled ( canModify ) ; externalNameFilter.setEnabled ( canModify ) ; externalNameSearch.setEnabled ( canModify ) ; visibleToAllCheckBox.setEnabled ( canModify ) ; emailOnlyAuthors.setEnabled ( canModify ) ; }

Target:
private void enableForm ( final boolean canModify ) { groupNameTxt.setEnabled ( canModify ) ; ownerTxtBox.setEnabled ( canModify ) ; descTxt.setEnabled ( canModify ) ; typeSelect.setEnabled ( canModify ) ; addMemberBox.setEnabled ( canModify ) ; members.setEnabled ( canModify ) ; externalNameFilter.setEnabled ( canModify ) ; externalNameSearch.setEnabled ( canModify ) ; visibleToAllCheckBox.setEnabled ( canModify ) ; emailOnlyAuthors.setEnabled ( canModify ) ; addIncludeBox.setEnabled ( canModify ) ; includes.setEnabled ( canModify ) ; }
Source:
public boolean isVisible ( com.google.gerrit.reviewdb.ReviewDb db ) throws com.google.gwtorm.client.OrmException { if ( ( ( ( change.getStatus ( ) ) == ( Change.Status.DRAFT ) ) && ( ! ( isOwner ( ) ) ) ) && ( ! ( isReviewer ( db ) ) ) ) { return false ; } return isVisible ( ) ; }

Target:
private boolean isDraftVisible ( com.google.gerrit.reviewdb.ReviewDb db ) throws com.google.gwtorm.client.OrmException { return ( isOwner ( ) ) || ( isReviewer ( db ) ) ; }
Source:
public void fullName ( ) throws java.lang.Exception { com.google.common.truth.Truth.assertThat ( com.google.gerrit.reviewdb.client.RefNames.fullName ( "refs/meta/config" ) ) . isEqualTo ( "refs/meta/config" ) ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.reviewdb.client.RefNames.fullName ( "refs/heads/master" ) ) . isEqualTo ( "refs/heads/master" ) ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.reviewdb.client.RefNames.fullName ( "master" ) ) . isEqualTo ( "refs/heads/master" ) ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.reviewdb.client.RefNames.fullName ( "refs/tags/v1.0" ) ) . isEqualTo ( "refs/tags/v1.0" ) ; }

Target:
public void fullName ( ) throws java.lang.Exception { com.google.common.truth.Truth.assertThat ( com.google.gerrit.reviewdb.client.RefNames.fullName ( "refs/meta/config" ) ) . isEqualTo ( "refs/meta/config" ) ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.reviewdb.client.RefNames.fullName ( "refs/heads/master" ) ) . isEqualTo ( "refs/heads/master" ) ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.reviewdb.client.RefNames.fullName ( "master" ) ) . isEqualTo ( "refs/heads/master" ) ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.reviewdb.client.RefNames.fullName ( "refs/tags/v1.0" ) ) . isEqualTo ( "refs/tags/v1.0" ) ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.reviewdb.client.RefNames.fullName ( "HEAD" ) ) . isEqualTo ( "HEAD" ) ; }
Source:
private void warning ( final java.lang.String msg ) { switch ( outputFormat ) { case JSON : { final com.google.gson.JsonObject obj = new com.google.gson.JsonObject ( ) ; obj.addProperty ( "type" , "warning" ) ; obj.addProperty ( "message" , msg ) ; println ( obj.toString ( ) ) ; break ; } case PRETTY : default : println ( ( "WARNING: " + msg ) ) ; break ; } }

Target:
private void warning ( final java.lang.String msg ) { switch ( outputFormat ) { case JSON_SINGLE : case JSON : { final com.google.gson.JsonObject obj = new com.google.gson.JsonObject ( ) ; obj.addProperty ( "type" , "warning" ) ; obj.addProperty ( "message" , msg ) ; println ( obj.toString ( ) ) ; break ; } case PRETTY : default : println ( ( "WARNING: " + msg ) ) ; break ; } }
Source:
public void testWithSubmodule ( ) throws java.lang.Exception { org.eclipse.jgit.revwalk.RevCommit c = makeCommitWithSubmodule ( ) ; java.util.List < com.google.gerrit.server.git.validators.CommitValidationMessage > m = com.googlesource.gerrit.plugins.uploadvalidator.SubmoduleValidator.performValidation ( repo , c ) ; org.junit.Assert.assertEquals ( 1 , m.size ( ) ) ; java.util.List < com.google.gerrit.server.git.validators.CommitValidationMessage > expected = new java.util.ArrayList < > ( ) ; expected.add ( new com.google.gerrit.server.git.validators.CommitValidationMessage ( ( "submodules are not allowed: " + "modules/library" ) , true ) ) ; org.junit.Assert.assertTrue ( com.googlesource.gerrit.plugins.uploadvalidator.TestUtils.compareCommitValidationMessage ( m , expected ) ) ; }

Target:
public void testWithSubmodule ( ) throws java.lang.Exception { org.eclipse.jgit.revwalk.RevCommit c = makeCommitWithSubmodule ( ) ; java.util.List < com.google.gerrit.server.git.validators.CommitValidationMessage > m = com.googlesource.gerrit.plugins.uploadvalidator.SubmoduleValidator.performValidation ( repo , c ) ; com.google.common.truth.Truth.assertThat ( com.googlesource.gerrit.plugins.uploadvalidator.TestUtils.transformMessages ( m ) ) . containsExactlyElementsIn ( com.google.common.collect.ImmutableSet.of ( "ERROR: submodules are not allowed: modules/library" ) ) ; }
Source:
protected void configure ( ) { bind ( com.google.gerrit.server.git.ChangeCache.class ) . to ( com.google.gerrit.server.git.SearchingChangeCacheImpl.class ) ; cache ( com.google.gerrit.server.git.SearchingChangeCacheImpl.ID_CACHE , Project.NameKey.class , new com.google.inject.TypeLiteral < java.util.List < com.google.gerrit.server.git.SearchingChangeCacheImpl.CachedChange > > ( ) { } ) . maximumWeight ( 0 ) . loader ( com.google.gerrit.server.git.SearchingChangeCacheImpl.Loader.class ) ; }

Target:
protected void configure ( ) { cache ( com.google.gerrit.server.git.SearchingChangeCacheImpl.ID_CACHE , Project.NameKey.class , new com.google.inject.TypeLiteral < java.util.List < com.google.gerrit.server.git.SearchingChangeCacheImpl.CachedChange > > ( ) { } ) . maximumWeight ( 0 ) . loader ( com.google.gerrit.server.git.SearchingChangeCacheImpl.Loader.class ) ; bind ( com.google.gerrit.server.git.SearchingChangeCacheImpl.class ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.extensions.events.GitReferenceUpdatedListener.class ) . to ( com.google.gerrit.server.git.SearchingChangeCacheImpl.class ) ; }
Source:
private void format ( com.google.gerrit.client.changes.ChangeInfo.GitPerson person , com.google.gwt.dom.client.Element name , com.google.gwt.dom.client.Element date ) { name.setInnerText ( ( ( ( ( person.name ( ) ) + " <" ) + ( person.email ( ) ) ) + ">" ) ) ; date.setInnerText ( com.google.gerrit.client.FormatUtil.mediumFormat ( person.date ( ) ) ) ; }

Target:
private static java.lang.String renderName ( com.google.gerrit.client.changes.ChangeInfo.GitPerson person ) { return ( ( ( person.name ( ) ) + " <" ) + ( person.email ( ) ) ) + ">" ; }
Source:
public void currentRevision ( ) throws java.lang.Exception { com.google.gerrit.extensions.common.ChangeInfo c = get ( changeId , com.google.gerrit.extensions.common.ListChangesOption.CURRENT_REVISION ) ; com.google.common.truth.Truth.assertThat ( c.currentRevision ) . isEqualTo ( commitId ( 2 ) ) ; com.google.common.truth.Truth.assertThat ( ( ( java.lang.Iterable < ? > ) ( c.revisions.keySet ( ) ) ) ) . containsAllIn ( com.google.common.collect.ImmutableSet.of ( commitId ( 2 ) ) ) ; com.google.common.truth.Truth.assertThat ( c.revisions.get ( commitId ( 2 ) ) . _number ) . isEqualTo ( 3 ) ; }

Target:
public void currentRevision ( ) throws java.lang.Exception { com.google.gerrit.extensions.common.ChangeInfo c = get ( changeId , com.google.gerrit.extensions.client.ListChangesOption.CURRENT_REVISION ) ; com.google.common.truth.Truth.assertThat ( c.currentRevision ) . isEqualTo ( commitId ( 2 ) ) ; com.google.common.truth.Truth.assertThat ( ( ( java.lang.Iterable < ? > ) ( c.revisions.keySet ( ) ) ) ) . containsAllIn ( com.google.common.collect.ImmutableSet.of ( commitId ( 2 ) ) ) ; com.google.common.truth.Truth.assertThat ( c.revisions.get ( commitId ( 2 ) ) . _number ) . isEqualTo ( 3 ) ; }
Source:
public int compareTo ( com.google.gerrit.common.data.PermissionRule o ) { int cmp = ( com.google.gerrit.common.data.PermissionRule.deny ( this ) ) - ( com.google.gerrit.common.data.PermissionRule.deny ( o ) ) ; if ( cmp == 0 ) cmp = com.google.gerrit.common.data.PermissionRule.group ( this ) . compareTo ( com.google.gerrit.common.data.PermissionRule.group ( o ) ) ; return cmp ; }

Target:
public int compareTo ( com.google.gerrit.common.data.PermissionRule o ) { int cmp = ( com.google.gerrit.common.data.PermissionRule.deny ( this ) ) - ( com.google.gerrit.common.data.PermissionRule.deny ( o ) ) ; if ( cmp == 0 ) cmp = ( com.google.gerrit.common.data.PermissionRule.range ( o ) ) - ( com.google.gerrit.common.data.PermissionRule.range ( this ) ) ; if ( cmp == 0 ) cmp = com.google.gerrit.common.data.PermissionRule.group ( this ) . compareTo ( com.google.gerrit.common.data.PermissionRule.group ( o ) ) ; return cmp ; }
Source:
private java.util.Map < java.lang.String , java.lang.Integer > getSingleSchemaVersions ( ) { java.util.Map < java.lang.String , java.lang.Integer > singleVersions = new java.util.HashMap < > ( ) ; java.lang.String schemaName = ChangeSchemaDefinitions.INSTANCE.getName ( ) ; int version = cfg.getInt ( "index" , "lucene" , ( schemaName + "TestVersion" ) , ( - 1 ) ) ; if ( version > 0 ) { singleVersions.put ( schemaName , version ) ; } return singleVersions ; }

Target:
private void putSchemaVersion ( java.util.Map < java.lang.String , java.lang.Integer > singleVersions , com.google.gerrit.server.index.SchemaDefinitions < ? > schemaDef ) { java.lang.String schemaName = schemaDef.getName ( ) ; int version = cfg.getInt ( "index" , "lucene" , ( schemaName + "TestVersion" ) , ( - 1 ) ) ; if ( version > 0 ) { com.google.common.base.Preconditions.checkState ( ( ! ( singleVersions.containsKey ( schemaName ) ) ) , "version for schema %s was alreay set" , schemaName ) ; singleVersions.put ( schemaName , version ) ; } }
Source:
private void deleteGitRepository ( final org.eclipse.jgit.lib.Repository repository ) throws java.io.IOException { java.io.File parentFile = repository.getDirectory ( ) . getParentFile ( ) ; if ( ! ( recursiveDelete ( repository.getDirectory ( ) ) ) ) { throw new java.io.IOException ( ( "Error trying to delete " + ( repository.getDirectory ( ) . getAbsolutePath ( ) ) ) ) ; } recursiveDeleteParent ( parentFile , gitDir ) ; }

Target:
public java.lang.String getProjectName ( ) { return project.get ( ) ; }
Source:
public void onOpen ( final com.google.gwt.user.client.ui.DisclosureEvent event ) { if ( ( infoTable ) == null ) { Util.DETAIL_SVC.patchSetDetail ( patchSet.getId ( ) , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.data.PatchSetDetail > ( ) { public void onSuccess ( final com.google.gerrit.client.data.PatchSetDetail result ) { ensureLoaded ( result ) ; } } ) ; } }

Target:
public void onOpen ( final com.google.gwt.event.logical.shared.OpenEvent < com.google.gwt.user.client.ui.DisclosurePanel > event ) { if ( ( infoTable ) == null ) { Util.DETAIL_SVC.patchSetDetail ( patchSet.getId ( ) , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.data.PatchSetDetail > ( ) { public void onSuccess ( final com.google.gerrit.client.data.PatchSetDetail result ) { ensureLoaded ( result ) ; } } ) ; } }
Source:
private static com.google.gerrit.server.account.AccountState missing ( com.google.gerrit.reviewdb.client.Account.Id accountId ) { com.google.gerrit.reviewdb.client.Account account = new com.google.gerrit.reviewdb.client.Account ( accountId ) ; java.util.Collection < com.google.gerrit.reviewdb.client.AccountExternalId > ids = java.util.Collections.emptySet ( ) ; java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.UUID > anon = com.google.common.collect.ImmutableSet.of ( AccountGroup.ANONYMOUS_USERS ) ; return new com.google.gerrit.server.account.AccountState ( account , anon , ids ) ; }

Target:
private static com.google.gerrit.server.account.AccountState missing ( com.google.gerrit.reviewdb.client.Account.Id accountId ) { com.google.gerrit.reviewdb.client.Account account = new com.google.gerrit.reviewdb.client.Account ( accountId , com.google.gerrit.server.util.TimeUtil.nowTs ( ) ) ; java.util.Collection < com.google.gerrit.reviewdb.client.AccountExternalId > ids = java.util.Collections.emptySet ( ) ; java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.UUID > anon = com.google.common.collect.ImmutableSet.of ( AccountGroup.ANONYMOUS_USERS ) ; return new com.google.gerrit.server.account.AccountState ( account , anon , ids ) ; }
Source:
private static com.google.gerrit.server.index.FieldDef < com.google.gerrit.server.query.change.ChangeData , ? > sortkeyField ( com.google.gerrit.server.index.Schema < com.google.gerrit.server.query.change.ChangeData > schema ) { if ( schema == null ) { return com.google.gerrit.server.index.ChangeField.LEGACY_SORTKEY ; } com.google.gerrit.server.index.FieldDef < com.google.gerrit.server.query.change.ChangeData , ? > f = schema.getFields ( ) . get ( com.google.gerrit.server.index.ChangeField.SORTKEY.getName ( ) ) ; if ( f != null ) { return f ; } return com.google.common.base.Preconditions.checkNotNull ( schema.getFields ( ) . get ( ChangeField.LEGACY_SORTKEY.getName ( ) ) , "schema missing sortkey field, found: %s" , schema.getFields ( ) . keySet ( ) ) ; }

Target:
private static com.google.gerrit.server.index.FieldDef < com.google.gerrit.server.query.change.ChangeData , ? > sortkeyFieldOrNull ( com.google.gerrit.server.index.Schema < com.google.gerrit.server.query.change.ChangeData > schema ) { if ( schema == null ) { return com.google.gerrit.server.index.ChangeField.LEGACY_SORTKEY ; } com.google.gerrit.server.index.FieldDef < com.google.gerrit.server.query.change.ChangeData , ? > f = schema.getFields ( ) . get ( com.google.gerrit.server.index.ChangeField.SORTKEY.getName ( ) ) ; if ( f != null ) { return f ; } return schema.getFields ( ) . get ( ChangeField.LEGACY_SORTKEY.getName ( ) ) ; }
Source:
private java.util.List < com.google.gerrit.common.data.SubmitRecord > ruleError ( java.lang.String err ) { if ( logErrors ) { com.google.gerrit.server.project.SubmitRuleEvaluator.log.error ( err ) ; return com.google.gerrit.server.project.SubmitRuleEvaluator.defaultRuleError ( ) ; } else { return com.google.gerrit.server.project.SubmitRuleEvaluator.createRuleError ( err ) ; } }

Target:
private com.google.gerrit.common.data.SubmitTypeRecord typeError ( java.lang.String err , java.lang.Exception e ) { if ( logErrors ) { if ( e == null ) { com.google.gerrit.server.project.SubmitRuleEvaluator.log.error ( err ) ; } else { com.google.gerrit.server.project.SubmitRuleEvaluator.log.error ( err , e ) ; } return com.google.gerrit.server.project.SubmitRuleEvaluator.defaultTypeError ( ) ; } else { return com.google.gerrit.server.project.SubmitRuleEvaluator.createTypeError ( err ) ; } }
Source:
public void testUnblockMoreSpecificRef_Fails ( ) { com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/*" ) . setBlock ( ) ; com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/heads/master" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; org.junit.Assert.assertFalse ( "u can't push" , u.controlForRef ( "refs/heads/master" ) . canUpdate ( ) ) ; }

Target:
public void testUnblockMoreSpecificRef_Fails ( ) { com.google.gerrit.server.project.Util.block ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/heads/master" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; org.junit.Assert.assertFalse ( "u can't push" , u.controlForRef ( "refs/heads/master" ) . canUpdate ( ) ) ; }
Source:
protected void configure ( ) { bind ( com.google.gerrit.common.ChangeHookRunner.class ) ; bind ( com.google.gerrit.common.ChangeHooks.class ) . to ( com.google.gerrit.common.ChangeHookRunner.class ) ; listener ( ) . to ( com.google.gerrit.common.ChangeHookRunner.class ) ; }

Target:
protected void configure ( ) { bind ( com.google.gerrit.common.ChangeHookRunner.class ) ; bind ( com.google.gerrit.common.ChangeHooks.class ) . to ( com.google.gerrit.common.ChangeHookRunner.class ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.extensions.events.NewProjectCreatedListener.class ) . to ( com.google.gerrit.common.ChangeHookRunner.class ) ; listener ( ) . to ( com.google.gerrit.common.ChangeHookRunner.class ) ; }
Source:
private void loadCommit ( final com.google.gerrit.client.changes.ChangeInfo.RevisionInfo rev , com.google.gerrit.client.rpc.CallbackGroup group ) { if ( rev.is_edit ( ) ) { return ; } com.google.gerrit.client.changes.ChangeApi.revision ( changeId.get ( ) , rev.name ( ) ) . view ( "commit" ) . get ( group.add ( new com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.changes.ChangeInfo.CommitInfo > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.changes.ChangeInfo.CommitInfo info ) { rev.set_commit ( info ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { } } ) ) ; }

Target:
private void loadCommit ( final com.google.gerrit.client.changes.ChangeInfo.RevisionInfo rev , com.google.gerrit.client.rpc.CallbackGroup group ) { if ( rev.is_edit ( ) ) { return ; } com.google.gerrit.client.changes.ChangeApi.commitWithLinks ( changeId.get ( ) , rev.name ( ) , group.add ( new com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.changes.ChangeInfo.CommitInfo > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.changes.ChangeInfo.CommitInfo info ) { rev.set_commit ( info ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { } } ) ) ; }
Source:
public void addRemoveMember ( ) throws java.lang.Exception { java.lang.String g = group ( "users" ) ; gApi.groups ( ) . id ( g ) . addMembers ( "user" ) ; assertMembers ( g , admin , user ) ; gApi.groups ( ) . id ( g ) . removeMembers ( "user" ) ; assertMembers ( g , admin ) ; }

Target:
public void addRemoveMember ( ) throws java.lang.Exception { java.lang.String g = createGroup ( "users" ) ; gApi.groups ( ) . id ( g ) . addMembers ( "user" ) ; assertMembers ( g , user ) ; gApi.groups ( ) . id ( g ) . removeMembers ( "user" ) ; assertNoMembers ( g ) ; }
Source:
public org.eclipse.jgit.transport.UploadPack create ( javax.servlet.http.HttpServletRequest req , org.eclipse.jgit.lib.Repository repo ) { org.eclipse.jgit.transport.UploadPack up = new org.eclipse.jgit.transport.UploadPack ( repo ) ; up.setPackConfig ( config.getPackConfig ( ) ) ; up.setTimeout ( config.getTimeout ( ) ) ; return up ; }

Target:
public org.eclipse.jgit.transport.UploadPack create ( javax.servlet.http.HttpServletRequest req , org.eclipse.jgit.lib.Repository repo ) { org.eclipse.jgit.transport.UploadPack up = new org.eclipse.jgit.transport.UploadPack ( repo ) ; up.setPreUploadHook ( org.eclipse.jgit.transport.PreUploadHookChain.newChain ( com.google.common.collect.Lists.newArrayList ( preUploadHooks ) ) ) ; up.setPackConfig ( config.getPackConfig ( ) ) ; up.setTimeout ( config.getTimeout ( ) ) ; return up ; }
Source:
void resizeCodeMirror ( ) { int rest = ( ( ( com.google.gerrit.client.Gerrit.getHeaderFooterHeight ( ) ) + ( header.getOffsetHeight ( ) ) ) + ( diffTable.getHeaderHeight ( ) ) ) + 5 ; int h = ( com.google.gwt.user.client.Window.getClientHeight ( ) ) - rest ; cmA.setHeight ( h ) ; cmB.setHeight ( h ) ; cmA.refresh ( ) ; cmB.refresh ( ) ; diffTable.sidePanel.adjustGutters ( cmB ) ; }

Target:
private int getCodeMirrorHeight ( ) { int rest = ( ( ( com.google.gerrit.client.Gerrit.getHeaderFooterHeight ( ) ) + ( header.getOffsetHeight ( ) ) ) + ( diffTable.getHeaderHeight ( ) ) ) + 5 ; return ( com.google.gwt.user.client.Window.getClientHeight ( ) ) - rest ; }
Source:
private void set ( org.eclipse.jgit.lib.Config cfg , java.lang.String section , java.lang.String name , java.lang.String value ) { if ( ( value != null ) && ( ! ( value.isEmpty ( ) ) ) ) { cfg.setString ( section , null , name , value ) ; } else { cfg.unset ( section , null , name ) ; } }

Target:
java.lang.String get ( java.lang.String name ) { return cfg.getString ( section , null , name ) ; }
Source:
public void noChangeMessage ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = newChange ( ) ; com.google.gerrit.server.notedb.ChangeUpdate update = newUpdate ( c , changeOwner ) ; update.putReviewer ( changeOwner.getAccount ( ) . getId ( ) , com.google.gerrit.server.notedb.ReviewerState.REVIEWER ) ; update.commit ( ) ; com.google.gerrit.server.notedb.ChangeNotes notes = newNotes ( c ) ; com.google.common.truth.Truth.assertThat ( notes.getChangeMessages ( ) ) . isEmpty ( ) ; }

Target:
public void noChangeMessage ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = newChange ( ) ; com.google.gerrit.server.notedb.ChangeUpdate update = newUpdate ( c , changeOwner ) ; update.putReviewer ( changeOwner.getAccount ( ) . getId ( ) , com.google.gerrit.server.notedb.ReviewerStateInternal.REVIEWER ) ; update.commit ( ) ; com.google.gerrit.server.notedb.ChangeNotes notes = newNotes ( c ) ; com.google.common.truth.Truth.assertThat ( notes.getChangeMessages ( ) ) . isEmpty ( ) ; }
Source:
public void onSuccess ( com.google.gwt.core.client.JsArray < com.google.gerrit.client.account.EmailInfo > result ) { if ( ! ( isAttached ( ) ) ) { return ; } for ( com.google.gerrit.client.account.EmailInfo i : com.google.gerrit.client.rpc.Natives.asList ( result ) ) { emailPick.addItem ( i.email ( ) ) ; } haveEmails = true ; postLoad ( ) ; }

Target:
public void onSuccess ( com.google.gwt.core.client.JsArray < com.google.gerrit.client.account.EmailInfo > result ) { for ( com.google.gerrit.client.account.EmailInfo i : com.google.gerrit.client.rpc.Natives.asList ( result ) ) { emailPick.addItem ( i.email ( ) ) ; if ( i.isPreferred ( ) ) { currentEmail = i.email ( ) ; } } haveEmails = true ; postLoad ( ) ; }
Source:
private static com.google.common.base.Optional < com.google.gerrit.server.plugins.PluginEntry > findSource ( com.google.gerrit.server.plugins.PluginContentScanner scanner , java.lang.String file ) throws java.io.IOException { if ( file.endsWith ( ".html" ) ) { int d = file.lastIndexOf ( '.' ) ; return scanner.getEntry ( ( ( file.substring ( 0 , d ) ) + ".md" ) ) ; } return com.google.common.base.Optional.absent ( ) ; }

Target:
private static java.util.Optional < com.google.gerrit.server.plugins.PluginEntry > findSource ( com.google.gerrit.server.plugins.PluginContentScanner scanner , java.lang.String file ) throws java.io.IOException { if ( file.endsWith ( ".html" ) ) { int d = file.lastIndexOf ( '.' ) ; return scanner.getEntry ( ( ( file.substring ( 0 , d ) ) + ".md" ) ) ; } return java.util.Optional.empty ( ) ; }
Source:
public java.lang.String getOrSetTopic ( int sourceId , java.lang.String topic ) throws com.google.gerrit.extensions.restapi.RestApiException { if ( ( topic == null ) || ( topic.isEmpty ( ) ) ) { topic = "am-" + ( java.util.UUID.randomUUID ( ) . toString ( ) ) ; com.googlesource.gerrit.plugins.automerger.DownstreamCreator.log.debug ( "Setting original change topic to {}" , sourceId , topic ) ; gApi.changes ( ) . id ( sourceId ) . topic ( topic ) ; } return topic ; }

Target:
public java.lang.String getOrSetTopic ( int sourceId , java.lang.String topic ) throws com.google.gerrit.extensions.restapi.RestApiException { if ( com.google.common.base.Strings.isNullOrEmpty ( topic ) ) { topic = "am-" + ( java.util.UUID.randomUUID ( ) ) ; com.googlesource.gerrit.plugins.automerger.DownstreamCreator.log.debug ( "Setting original change topic to {}" , sourceId , topic ) ; gApi.changes ( ) . id ( sourceId ) . topic ( topic ) ; } return topic ; }
Source:
public com.googlesource.gerrit.plugins.wip.Description getDescription ( com.google.gerrit.server.change.RevisionResource rsrc ) { com.google.gerrit.reviewdb.client.PatchSet.Id current = rsrc.getChange ( ) . currentPatchSetId ( ) ; return new com.googlesource.gerrit.plugins.wip.Description ( ) . setLabel ( "WIP" ) . setTitle ( "Set Work In Progress" ) . setVisible ( ( ( ( rsrc.getChange ( ) . getStatus ( ) ) == ( com.google.gerrit.reviewdb.client.Change.Status.NEW ) ) && ( rsrc.getPatchSet ( ) . getId ( ) . equals ( current ) ) ) ) ; }

Target:
public com.googlesource.gerrit.plugins.wip.Description getDescription ( com.google.gerrit.server.change.RevisionResource rsrc ) { com.google.gerrit.reviewdb.client.PatchSet.Id current = rsrc.getChange ( ) . currentPatchSetId ( ) ; return new com.googlesource.gerrit.plugins.wip.Description ( ) . setLabel ( "WIP" ) . setTitle ( "Set Work In Progress" ) . setVisible ( ( ( ( rsrc.getControl ( ) . isOwner ( ) ) && ( ( rsrc.getChange ( ) . getStatus ( ) ) == ( com.google.gerrit.reviewdb.client.Change.Status.NEW ) ) ) && ( rsrc.getPatchSet ( ) . getId ( ) . equals ( current ) ) ) ) ; }
Source:
private static void addDiffLink ( final com.google.gerrit.client.ui.LinkMenuBar m , final java.lang.String text , final com.google.gerrit.client.patches.PatchScreen.TopView tv ) { m.addItem ( new com.google.gerrit.client.ui.LinkMenuItem ( text , "" ) { @ java.lang.Override public void go ( ) { if ( ( com.google.gerrit.client.Gerrit.patchScreen ) != null ) { com.google.gerrit.client.Gerrit.patchScreen.setTopView ( tv ) ; } com.google.gwt.dom.client.AnchorElement.as ( getElement ( ) ) . blur ( ) ; } } ) ; }

Target:
public static void setUserPreferences ( com.google.gerrit.client.info.AccountPreferencesInfo prefs ) { com.google.gerrit.client.Gerrit.myPrefs = prefs ; com.google.gerrit.client.Gerrit.applyUserPreferences ( ) ; com.google.gerrit.client.Gerrit.refreshMenuBar ( ) ; }
Source:
private static void asyncInjectCss ( com.google.gwt.resources.client.ExternalTextResource css ) { try { css.getText ( new com.google.gwt.resources.client.ResourceCallback < com.google.gwt.resources.client.TextResource > ( ) { @ java.lang.Override public void onSuccess ( com.google.gwt.resources.client.TextResource resource ) { com.google.gwt.dom.client.StyleInjector.inject ( resource.getText ( ) ) ; } @ java.lang.Override public void onError ( com.google.gwt.resources.client.ResourceException e ) { net.codemirror.lib.CodeMirror.error ( e ) ; } } ) ; } catch ( com.google.gwt.resources.client.ResourceException e ) { net.codemirror.lib.CodeMirror.error ( e ) ; } }

Target:
public static void initLibrary ( com.google.gwt.user.client.rpc.AsyncCallback < java.lang.Void > cb ) { net.codemirror.lib.Loader.initLibrary ( cb ) ; }
Source:
public boolean canForceUpdate ( ) { return ( ( canPushWithForce ( ) ) || ( canDelete ( ) ) ) && ( canWrite ( ) ) ; }

Target:
public boolean canForceUpdate ( ) { if ( ! ( canWrite ( ) ) ) { return false ; } if ( canPushWithForce ( ) ) { return true ; } switch ( getUser ( ) . getAccessPath ( ) ) { case GIT : return false ; case JSON_RPC : case REST_API : case SSH_COMMAND : case UNKNOWN : case WEB_BROWSER : default : return ( getUser ( ) . getCapabilities ( ) . canAdministrateServer ( ) ) || ( ( isOwner ( ) ) && ( ! ( isForceBlocked ( Permission.PUSH ) ) ) ) ; } }
Source:
private static java.nio.file.Path hook ( org.eclipse.jgit.lib.Config config , java.nio.file.Path path , java.lang.String name ) { java.lang.String setting = ( name.replace ( "-" , "" ) ) + "hook" ; java.lang.String value = config.getString ( "hooks" , null , setting ) ; return path.resolve ( ( value != null ? value : name ) ) ; }

Target:
private static com.google.common.base.Optional < java.nio.file.Path > hook ( org.eclipse.jgit.lib.Config config , java.nio.file.Path path , java.lang.String name ) { java.lang.String setting = ( name.replace ( "-" , "" ) ) + "hook" ; java.lang.String value = config.getString ( "hooks" , null , setting ) ; java.nio.file.Path p = path.resolve ( ( value != null ? value : name ) ) ; return java.nio.file.Files.exists ( p ) ? com.google.common.base.Optional.of ( p ) : com.google.common.base.Optional.< java.nio.file.Path > absent ( ) ; }
Source:
private static void initVimKeys ( ) { net.codemirror.lib.KeyMap km = net.codemirror.lib.CodeMirror.cloneKeyMap ( "vim" ) ; for ( java.lang.String s : new java.lang.String [ ] { "A" , "C" , "O" , "R" , "U" , "Ctrl-C" , "Ctrl-O" } ) { km.remove ( s ) ; } net.codemirror.lib.CodeMirror.addKeyMap ( "vim_ro" , km ) ; }

Target:
private static void initVimKeys ( ) { net.codemirror.lib.KeyMap km = net.codemirror.lib.CodeMirror.cloneKeyMap ( "vim" ) ; for ( java.lang.String s : new java.lang.String [ ] { "A" , "C" , "I" , "O" , "R" , "U" , "Ctrl-C" , "Ctrl-O" } ) { km.remove ( s ) ; } net.codemirror.lib.CodeMirror.addKeyMap ( "vim_ro" , km ) ; }