auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public UiAction.Description getDescription ( com.google.gerrit.server.change.ChangeResource resource ) { return new com.google.gerrit.extensions.webui.UiAction.Description ( ) . setLabel ( "Restore" ) . setVisible ( ( ( ( resource.getChange ( ) . getStatus ( ) ) == ( com.google.gerrit.reviewdb.client.Change.Status.ABANDONED ) ) && ( resource.getControl ( ) . canRestore ( ) ) ) ) ; }

Target:
public UiAction.Description getDescription ( com.google.gerrit.server.change.ChangeResource resource ) { return new com.google.gerrit.extensions.webui.UiAction.Description ( ) . setLabel ( "Restore" ) . setTitle ( "Restore the change" ) . setVisible ( ( ( ( resource.getChange ( ) . getStatus ( ) ) == ( com.google.gerrit.reviewdb.client.Change.Status.ABANDONED ) ) && ( resource.getControl ( ) . canRestore ( ) ) ) ) ; }
Source:
public java.lang.String toBranch ( final com.google.gerrit.reviewdb.Branch.NameKey branch ) { com.google.gerrit.common.data.ParameterizedString pattern = new com.google.gerrit.common.data.ParameterizedString ( type.getBranch ( ) ) ; final java.util.Map < java.lang.String , java.lang.String > p = new java.util.HashMap < java.lang.String , java.lang.String > ( ) ; p.put ( "project" , com.google.gwt.http.client.URL.encodeQueryString ( branch.getParentKey ( ) . get ( ) ) ) ; p.put ( "branch" , com.google.gwt.http.client.URL.encodeQueryString ( branch.get ( ) ) ) ; return ( baseUrl ) + ( pattern.replace ( p ) ) ; }

Target:
public java.lang.String toBranch ( final com.google.gerrit.reviewdb.Branch.NameKey branch ) { com.google.gerrit.common.data.ParameterizedString pattern = new com.google.gerrit.common.data.ParameterizedString ( type.getBranch ( ) ) ; final java.util.Map < java.lang.String , java.lang.String > p = new java.util.HashMap < java.lang.String , java.lang.String > ( ) ; p.put ( "project" , encode ( branch.getParentKey ( ) . get ( ) ) ) ; p.put ( "branch" , encode ( branch.get ( ) ) ) ; return ( baseUrl ) + ( pattern.replace ( p ) ) ; }
Source:
private java.util.Map < java.lang.String , com.google.gerrit.common.data.LabelType > byLabel ( ) { if ( ( byLabel ) == null ) { byLabel = new java.util.HashMap < java.lang.String , com.google.gerrit.common.data.LabelType > ( ) ; if ( ( labelTypes ) != null ) { for ( com.google.gerrit.common.data.LabelType t : labelTypes ) { byLabel.put ( t.getName ( ) . toLowerCase ( ) , t ) ; } } } return byLabel ; }

Target:
private java.util.Map < java.lang.String , com.google.gerrit.common.data.LabelType > byLabel ( ) { if ( ( byLabel ) == null ) { synchronized ( this ) { if ( ( byLabel ) == null ) { java.util.Map < java.lang.String , com.google.gerrit.common.data.LabelType > l = new java.util.HashMap < java.lang.String , com.google.gerrit.common.data.LabelType > ( ) ; if ( ( labelTypes ) != null ) { for ( com.google.gerrit.common.data.LabelType t : labelTypes ) { l.put ( t.getName ( ) . toLowerCase ( ) , t ) ; } } byLabel = l ; } } } return byLabel ; }
Source:
private net.codemirror.lib.Configuration getConfig ( ) { return net.codemirror.lib.Configuration.create ( ) . set ( "readOnly" , false ) . set ( "cursorBlinkRate" , 0 ) . set ( "cursorHeight" , 0.85 ) . set ( "lineNumbers" , true ) . set ( "tabSize" , 4 ) . set ( "lineWrapping" , false ) . set ( "styleSelectedText" , true ) . set ( "showTrailingSpace" , true ) . set ( "keyMap" , "default" ) . set ( "mode" , net.codemirror.lib.ModeInjector.getContentType ( type ) ) ; }

Target:
private net.codemirror.lib.Configuration getConfig ( ) { return net.codemirror.lib.Configuration.create ( ) . set ( "readOnly" , false ) . set ( "cursorBlinkRate" , 0 ) . set ( "cursorHeight" , 0.85 ) . set ( "lineNumbers" , true ) . set ( "tabSize" , 4 ) . set ( "lineWrapping" , false ) . set ( "styleSelectedText" , true ) . set ( "showTrailingSpace" , true ) . set ( "keyMap" , "default" ) . set ( "mode" , net.codemirror.mode.ModeInjector.getContentType ( type ) ) ; }
Source:
public void updateComment ( com.google.gerrit.reviewdb.client.PatchLineComment c ) throws com.google.gwtorm.server.OrmException { verifyComment ( c ) ; com.google.common.base.Preconditions.checkArgument ( ( ( c.getStatus ( ) ) == ( com.google.gerrit.reviewdb.client.PatchLineComment.Status.DRAFT ) ) , "Cannot update a published comment into a ChangeDraftUpdate" ) ; com.google.common.base.Preconditions.checkArgument ( draftNotes.containsComment ( c ) , "Cannot update this comment because it didn't exist previously" ) ; upsertComments.add ( c ) ; }

Target:
public void updateComment ( com.google.gerrit.reviewdb.client.PatchLineComment c ) throws com.google.gwtorm.server.OrmException { verifyComment ( c ) ; com.google.common.base.Preconditions.checkArgument ( ( ( c.getStatus ( ) ) == ( com.google.gerrit.reviewdb.client.PatchLineComment.Status.DRAFT ) ) , "Cannot update a published comment into a ChangeDraftUpdate" ) ; if ( migration.readComments ( ) ) { com.google.common.base.Preconditions.checkArgument ( draftNotes.containsComment ( c ) , "Cannot update this comment because it didn't exist previously" ) ; } upsertComments.add ( c ) ; }
Source:
static int toMask ( final com.google.gwt.event.dom.client.KeyPressEvent event ) { int mask = event.getCharCode ( ) ; if ( event.isAltKeyDown ( ) ) { mask |= KeyCommand.M_ALT ; } if ( event.isControlKeyDown ( ) ) { mask |= KeyCommand.M_CTRL ; } if ( event.isMetaKeyDown ( ) ) { mask |= KeyCommand.M_META ; } return mask ; }

Target:
static int toMask ( final com.google.gwt.event.dom.client.KeyPressEvent event ) { int mask = event.getUnicodeCharCode ( ) ; if ( mask == 0 ) { mask = event.getNativeEvent ( ) . getKeyCode ( ) ; } if ( event.isAltKeyDown ( ) ) { mask |= KeyCommand.M_ALT ; } if ( event.isControlKeyDown ( ) ) { mask |= KeyCommand.M_CTRL ; } if ( event.isMetaKeyDown ( ) ) { mask |= KeyCommand.M_META ; } return mask ; }
Source:
public void testCreate_NotDirectory ( ) throws java.io.IOException { final java.io.File root = com.google.gerrit.server.config.SitePathsTest.random ( ) ; try { org.junit.Assert.assertTrue ( root.createNewFile ( ) ) ; try { new com.google.gerrit.server.config.SitePaths ( root ) ; org.junit.Assert.fail ( "Did not throw exception" ) ; } catch ( java.io.FileNotFoundException e ) { org.junit.Assert.assertEquals ( ( "Not a directory: " + ( root.getPath ( ) ) ) , e.getMessage ( ) ) ; } } finally { root.delete ( ) ; } }

Target:
public void testCreate_NotDirectory ( ) throws java.io.IOException { final java.nio.file.Path root = com.google.gerrit.server.config.SitePathsTest.random ( ) ; try { java.nio.file.Files.createFile ( root ) ; try { new com.google.gerrit.server.config.SitePaths ( root ) ; org.junit.Assert.fail ( "Did not throw exception" ) ; } catch ( java.io.FileNotFoundException e ) { org.junit.Assert.assertEquals ( ( "Not a directory: " + root ) , e.getMessage ( ) ) ; } } finally { java.nio.file.Files.delete ( root ) ; } }
Source:
public java.lang.Boolean run ( com.google.gerrit.reviewdb.ReviewDb db , com.google.gwtorm.client.Transaction txn , boolean retry ) throws com.google.gwtorm.client.OrmException { return doAbandonChange ( message , change , patchSetId , cmsg , db , txn ) ; }

Target:
public com.google.gerrit.reviewdb.Change update ( com.google.gerrit.reviewdb.Change change ) { if ( ( change.getStatus ( ) . isOpen ( ) ) && ( change.currentPatchSetId ( ) . equals ( patchSetId ) ) ) { change.setStatus ( Change.Status.ABANDONED ) ; com.google.gerrit.server.ChangeUtil.updated ( change ) ; return change ; } else { return null ; } }
Source:
public UiAction.Description getDescription ( com.google.gerrit.server.change.ChangeResource rsrc ) { try { return new com.google.gerrit.extensions.webui.UiAction.Description ( ) . setTitle ( java.lang.String.format ( "Delete draft change %d" , rsrc.getChange ( ) . getChangeId ( ) ) ) . setVisible ( ( ( ( rsrc.getChange ( ) . getStatus ( ) ) == ( com.google.gerrit.reviewdb.client.Change.Status.DRAFT ) ) && ( rsrc.getControl ( ) . canDeleteDraft ( dbProvider.get ( ) ) ) ) ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new java.lang.IllegalStateException ( e ) ; } }

Target:
public UiAction.Description getDescription ( com.google.gerrit.server.change.ChangeResource rsrc ) { try { return new com.google.gerrit.extensions.webui.UiAction.Description ( ) . setTitle ( java.lang.String.format ( "Delete draft change %d" , rsrc.getChange ( ) . getChangeId ( ) ) ) . setVisible ( ( ( ( allowDrafts ) && ( ( rsrc.getChange ( ) . getStatus ( ) ) == ( com.google.gerrit.reviewdb.client.Change.Status.DRAFT ) ) ) && ( rsrc.getControl ( ) . canDeleteDraft ( dbProvider.get ( ) ) ) ) ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new java.lang.IllegalStateException ( e ) ; } }
Source:
public static com.google.gerrit.git.WorkQueue.Task < ? > [ ] getTasks ( ) { final com.google.gerrit.git.WorkQueue.Executor p = com.google.gerrit.git.WorkQueue.getPool ( false ) ; final com.google.gerrit.git.WorkQueue.Task < ? > [ ] r ; r = ( p != null ) ? p.toTaskArray ( ) : new com.google.gerrit.git.WorkQueue.Task [ ] { } ; return r ; }

Target:
public static com.google.gerrit.git.WorkQueue.Executor createQueue ( final int poolsize ) { final com.google.gerrit.git.WorkQueue.Executor r = new com.google.gerrit.git.WorkQueue.Executor ( poolsize ) ; r.setContinueExistingPeriodicTasksAfterShutdownPolicy ( false ) ; r.setExecuteExistingDelayedTasksAfterShutdownPolicy ( false ) ; com.google.gerrit.git.WorkQueue.queues.add ( r ) ; return r ; }
Source:
public void setUp ( ) throws java.lang.Exception { setUpPermissions ( ) ; com.google.gerrit.reviewdb.client.Account.Id user = accountManager.authenticate ( com.google.gerrit.server.account.AuthRequest.forUser ( "user" ) ) . getAccountId ( ) ; testEnvironment.setApiUser ( user ) ; com.google.gerrit.reviewdb.client.Project.NameKey name = new com.google.gerrit.reviewdb.client.Project.NameKey ( "project" ) ; org.eclipse.jgit.internal.storage.dfs.InMemoryRepository inMemoryRepo = repoManager.createRepository ( name ) ; project = new com.google.gerrit.server.git.ProjectConfig ( name ) ; project.load ( inMemoryRepo ) ; repo = new org.eclipse.jgit.junit.TestRepository ( inMemoryRepo ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { setUpPermissions ( ) ; com.google.gerrit.reviewdb.client.Account.Id user = accountManager.authenticate ( com.google.gerrit.server.account.AuthRequest.forUser ( "user" ) ) . getAccountId ( ) ; testEnvironment.setApiUser ( user ) ; com.google.gerrit.reviewdb.client.Project.NameKey name = new com.google.gerrit.reviewdb.client.Project.NameKey ( "project" ) ; org.eclipse.jgit.internal.storage.dfs.InMemoryRepository inMemoryRepo = repoManager.createRepository ( name ) ; project = new com.google.gerrit.server.project.ProjectConfig ( name ) ; project.load ( inMemoryRepo ) ; repo = new org.eclipse.jgit.junit.TestRepository ( inMemoryRepo ) ; }
Source:
public void run ( ) { com.google.gerrit.server.git.PerThreadRequestScope ctx = new com.google.gerrit.server.git.PerThreadRequestScope ( ) ; com.google.gerrit.server.git.PerThreadRequestScope old = com.google.gerrit.server.git.PerThreadRequestScope.set ( ctx ) ; try { runPushOperation ( ) ; } finally { com.google.gerrit.server.git.PerThreadRequestScope.set ( old ) ; } }

Target:
public void run ( ) { try { threadScoper.scope ( new java.util.concurrent.Callable < java.lang.Void > ( ) { @ java.lang.Override public java.lang.Void call ( ) { runPushOperation ( ) ; return null ; } } ) . call ( ) ; } catch ( java.lang.Exception e ) { throw com.google.common.base.Throwables.propagate ( e ) ; } }
Source:
public void start ( org.apache.sshd.server.Environment env ) { startThread ( new com.google.gerrit.sshd.commands.CommandRunnable ( ) { @ java.lang.Override public void run ( ) throws java.lang.Exception { parseCommandLine ( ) ; try { performCreateGroupFactory.create ( ) . createGroup ( groupName , groupDescription , visibleToAll , ownerGroupId , initialMembers , initialGroups ) ; } catch ( com.google.gerrit.common.errors.PermissionDeniedException e ) { throw die ( e ) ; } catch ( com.google.gerrit.common.errors.NameAlreadyUsedException e ) { throw die ( e ) ; } } } ) ; }

Target:
protected void run ( ) throws com.google.gerrit.sshd.commands.Failure , com.google.gwtorm.server.OrmException { try { performCreateGroupFactory.create ( ) . createGroup ( groupName , groupDescription , visibleToAll , ownerGroupId , initialMembers , initialGroups ) ; } catch ( com.google.gerrit.common.errors.PermissionDeniedException e ) { throw die ( e ) ; } catch ( com.google.gerrit.common.errors.NameAlreadyUsedException e ) { throw die ( e ) ; } }
Source:
private void renderRevisionInfo ( com.google.gerrit.client.changes.ChangeInfo info , com.google.gerrit.client.rpc.NativeMap < com.google.gerrit.client.actions.ActionInfo > actionMap ) { initRevisionsAction ( info , revision , actionMap ) ; actions.reloadRevisionActions ( actionMap ) ; }

Target:
private void renderRevisionInfo ( com.google.gerrit.client.changes.ChangeInfo info , com.google.gerrit.client.rpc.NativeMap < com.google.gerrit.client.actions.ActionInfo > actionMap ) { initRevisionsAction ( info , revision , actionMap ) ; commit.setParentNotCurrent ( ( ( actionMap.containsKey ( "rebase" ) ) && ( actionMap.get ( "rebase" ) . enabled ( ) ) ) ) ; actions.reloadRevisionActions ( actionMap ) ; }
Source:
public static void doSignOut ( ) { com.google.gerrit.client.Gerrit.myAccount = null ; com.google.gwt.user.client.Cookies.removeCookie ( com.google.gerrit.client.Gerrit.ACCOUNT_COOKIE ) ; for ( final com.google.gerrit.client.SignedInListener l : com.google.gerrit.client.Gerrit.signedInListeners ) { l.onSignOut ( ) ; } com.google.gerrit.client.Gerrit.refreshMenuBar ( ) ; if ( ( com.google.gerrit.client.Gerrit.currentScreen ) != null ) { com.google.gerrit.client.Gerrit.currentScreen.onSignOut ( ) ; } }

Target:
public static void doSignOut ( ) { com.google.gerrit.client.Gerrit.myAccount = null ; com.google.gwt.user.client.Cookies.removeCookie ( com.google.gerrit.client.Gerrit.ACCOUNT_COOKIE ) ; for ( final com.google.gerrit.client.SignedInListener l : com.google.gerrit.client.Gerrit.signedInListeners ) { l.onSignOut ( ) ; } com.google.gerrit.client.Gerrit.refreshMenuBar ( ) ; final com.google.gerrit.client.ui.Screen cs = com.google.gerrit.client.Gerrit.body.getView ( ) ; if ( cs != null ) { cs.onSignOut ( ) ; } }
Source:
private void service ( ) throws com.google.gerrit.server.permissions.PermissionBackendException , com.google.gerrit.sshd.Failure , java.io.IOException { project = projectControl.getProjectState ( ) . getProject ( ) ; try { repo = repoManager.openRepository ( project.getNameKey ( ) ) ; } catch ( org.eclipse.jgit.errors.RepositoryNotFoundException e ) { throw new com.google.gerrit.sshd.Failure ( 1 , ( ( "fatal: '" + ( project.getName ( ) ) ) + "': not a git archive" ) , e ) ; } try { runImpl ( ) ; } finally { repo.close ( ) ; } }

Target:
private void service ( ) throws com.google.gerrit.server.permissions.PermissionBackendException , com.google.gerrit.sshd.Failure , java.io.IOException { state = projectControl.getProjectState ( ) ; project = state.getProject ( ) ; projectName = project.getNameKey ( ) ; try { repo = repoManager.openRepository ( projectName ) ; } catch ( org.eclipse.jgit.errors.RepositoryNotFoundException e ) { throw new com.google.gerrit.sshd.Failure ( 1 , ( ( "fatal: '" + ( project.getName ( ) ) ) + "': not a git archive" ) , e ) ; } try { runImpl ( ) ; } finally { repo.close ( ) ; } }
Source:
public java.lang.Object createEntry ( final java.lang.Object key ) throws java.lang.Exception { return lookup ( ( ( com.google.gerrit.client.reviewdb.AccountGroup.Id ) ( key ) ) ) ; }

Target:
protected void configure ( ) { final com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < com.google.gerrit.client.reviewdb.AccountGroup.Id , com.google.gerrit.client.reviewdb.AccountGroup > > type = new com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < com.google.gerrit.client.reviewdb.AccountGroup.Id , com.google.gerrit.client.reviewdb.AccountGroup > > ( ) { } ; core ( type , com.google.gerrit.server.account.GroupCache.CACHE_NAME ) ; bind ( com.google.gerrit.server.account.GroupCache.class ) ; }
Source:
public void execute ( ) { int h = ( com.google.gerrit.client.Gerrit.getHeaderFooterHeight ( ) ) + ( reviewed.getOffsetHeight ( ) ) ; if ( ( cmA ) != null ) { cmA.setHeight ( ( ( com.google.gwt.user.client.Window.getClientHeight ( ) ) - h ) ) ; cmA.setOption ( "viewportMargin" , 10 ) ; } if ( ( cmB ) != null ) { cmB.setHeight ( ( ( com.google.gwt.user.client.Window.getClientHeight ( ) ) - h ) ) ; cmB.setOption ( "viewportMargin" , 10 ) ; } }

Target:
private void resizeCodeMirror ( ) { int h = ( com.google.gerrit.client.Gerrit.getHeaderFooterHeight ( ) ) + ( reviewed.getOffsetHeight ( ) ) ; if ( ( cmA ) != null ) { cmA.setHeight ( ( ( com.google.gwt.user.client.Window.getClientHeight ( ) ) - h ) ) ; cmA.refresh ( ) ; } if ( ( cmB ) != null ) { cmB.setHeight ( ( ( com.google.gwt.user.client.Window.getClientHeight ( ) ) - h ) ) ; cmB.refresh ( ) ; } }
Source:
private static synchronized javax.sql.DataSource newDataSource ( ) throws java.sql.SQLException { final java.util.Properties p = new java.util.Properties ( ) ; p.setProperty ( "driver" , org.h2.Driver.class . getName ( ) ) ; p.setProperty ( "url" , ( "jdbc:h2:mem:Test_" + ( ++ ( com.google.gerrit.testing.InMemoryDatabase.dbCnt ) ) ) ) ; return new com.google.gwtorm.jdbc.SimpleDataSource ( p ) ; }

Target:
private static synchronized javax.sql.DataSource newDataSource ( ) throws java.sql.SQLException { final java.util.Properties p = new java.util.Properties ( ) ; p.setProperty ( "driver" , org.h2.Driver.class . getName ( ) ) ; p.setProperty ( "url" , ( "jdbc:h2:mem:Test_" + ( ++ ( com.google.gerrit.testing.InMemoryDatabase.Instance.dbCnt ) ) ) ) ; return new com.google.gwtorm.jdbc.SimpleDataSource ( p ) ; }
Source:
public static void doSignOut ( ) { com.google.gerrit.client.Gerrit.myAccount = null ; com.google.gwt.user.client.Cookies.removeCookie ( com.google.gerrit.client.Gerrit.ACCOUNT_COOKIE ) ; for ( final com.google.gerrit.client.SignedInListener l : com.google.gerrit.client.Gerrit.signedInListeners ) { l.onSignOut ( ) ; } com.google.gerrit.client.Gerrit.refreshMenuBar ( ) ; final com.google.gerrit.client.ui.Screen cs = com.google.gerrit.client.Gerrit.body.getView ( ) ; if ( cs != null ) { cs.onSignOut ( ) ; } }

Target:
public boolean include ( final com.google.gwtexpui.globalkey.client.KeyCommand key ) { return ! ( key instanceof com.google.gerrit.client.ui.NeedsSignInKeyCommand ) ; }
Source:
public void run ( ) { java.nio.file.Path pluginPath = pluginDir.resolve ( ( ( pluginName ) + ".ssh" ) ) ; try { java.nio.file.Files.copy ( pluginPath , out ) ; } catch ( java.io.IOException e ) { throw new java.lang.RuntimeException ( ( "Cannot read plugin content of " + pluginPath ) , e ) ; } }

Target:
public void run ( ) { java.nio.file.Path pluginPath = pluginDir.resolve ( ( ( pluginName ) + ".ssh" ) ) ; printOne ( pluginPath ) ; for ( java.lang.String name : files ) { java.nio.file.Path p = dataDir.resolve ( name ) . normalize ( ) ; if ( ! ( p.startsWith ( dataDir ) ) ) { throw new java.lang.RuntimeException ( ( ( p + " is outside data directory " ) + ( dataDir ) ) ) ; } printOne ( p ) ; } }
Source:
private void appliedBy ( com.google.gerrit.common.data.SubmitRecord.Label label , com.googlecode.prolog_cafe.lang.Term status ) throws com.google.gerrit.server.project.SubmitRuleEvaluator.UserTermExpected { if ( ( status.isStructure ( ) ) && ( ( status.arity ( ) ) == 1 ) ) { com.googlecode.prolog_cafe.lang.Term who = status.arg ( 0 ) ; if ( com.google.gerrit.server.project.SubmitRuleEvaluator.isUser ( who ) ) { label.appliedBy = new com.google.gerrit.reviewdb.client.Account.Id ( ( ( com.googlecode.prolog_cafe.lang.IntegerTerm ) ( who.arg ( 0 ) ) ) . intValue ( ) ) ; } else { throw new com.google.gerrit.server.project.SubmitRuleEvaluator.UserTermExpected ( label ) ; } } }

Target:
private void appliedBy ( com.google.gerrit.common.data.SubmitRecord.Label label , com.googlecode.prolog_cafe.lang.Term status ) throws com.google.gerrit.server.project.SubmitRuleEvaluator.UserTermExpected { if ( ( status instanceof com.googlecode.prolog_cafe.lang.StructureTerm ) && ( ( status.arity ( ) ) == 1 ) ) { com.googlecode.prolog_cafe.lang.Term who = status.arg ( 0 ) ; if ( com.google.gerrit.server.project.SubmitRuleEvaluator.isUser ( who ) ) { label.appliedBy = new com.google.gerrit.reviewdb.client.Account.Id ( ( ( com.googlecode.prolog_cafe.lang.IntegerTerm ) ( who.arg ( 0 ) ) ) . intValue ( ) ) ; } else { throw new com.google.gerrit.server.project.SubmitRuleEvaluator.UserTermExpected ( label ) ; } } }
Source:
private void appendFileLine ( java.lang.StringBuilder cmts , com.google.gerrit.server.patch.PatchFile fileData , short side , int line ) { cmts.append ( ( "Line " + line ) ) ; try { final java.lang.String lineStr = fileData.getLine ( side , line ) ; cmts.append ( ": " ) ; cmts.append ( lineStr ) ; } catch ( java.lang.Throwable e ) { } cmts.append ( "\n" ) ; }

Target:
private java.lang.String getLine ( com.google.gerrit.server.patch.PatchFile fileInfo , short side , int lineNbr ) { try { return fileInfo.getLine ( side , lineNbr ) ; } catch ( java.io.IOException err ) { com.google.gerrit.server.mail.CommentSender.log.warn ( java.lang.String.format ( "Failed to read file on side %d" , side ) , err ) ; return "" ; } catch ( java.lang.IndexOutOfBoundsException err ) { com.google.gerrit.server.mail.CommentSender.log.warn ( java.lang.String.format ( "Failed to get line number of file on side %d" , side ) , err ) ; return "" ; } catch ( com.google.gerrit.common.errors.NoSuchEntityException err ) { com.google.gerrit.server.mail.CommentSender.log.warn ( java.lang.String.format ( "Side %d of file didn't exist" , side ) , err ) ; return "" ; } }
Source:
public java.util.List < com.google.gerrit.reviewdb.client.ChangeMessage > byPatchSet ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.notedb.ChangeNotes notes , com.google.gerrit.reviewdb.client.PatchSet.Id psId ) throws com.google.gwtorm.server.OrmException { if ( ! ( migration.readChanges ( ) ) ) { return com.google.gerrit.server.ChangeMessagesUtil.sortChangeMessages ( db.changeMessages ( ) . byPatchSet ( psId ) ) ; } return notes.load ( ) . getChangeMessages ( ) . get ( psId ) ; }

Target:
public java.lang.Iterable < com.google.gerrit.reviewdb.client.ChangeMessage > byPatchSet ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.notedb.ChangeNotes notes , com.google.gerrit.reviewdb.client.PatchSet.Id psId ) throws com.google.gwtorm.server.OrmException { if ( ! ( migration.readChanges ( ) ) ) { return db.changeMessages ( ) . byPatchSet ( psId ) ; } return notes.load ( ) . getChangeMessages ( ) . get ( psId ) ; }
Source:
public void lastInGroup ( ) { if ( ! ( getItems ( ) . isEmpty ( ) ) ) { final com.google.gwt.user.client.ui.MenuItem i = getItems ( ) . get ( ( ( getItems ( ) . size ( ) ) - 1 ) ) ; i.removeStyleDependentName ( "NormalItem" ) ; i.addStyleDependentName ( "LastItem" ) ; } }

Target:
public void addItem ( final java.lang.String text , final com.google.gwt.user.client.Command imp ) { add ( new com.google.gerrit.client.ui.CommandMenuItem ( text , imp ) ) ; }
Source:
public boolean match ( final T object ) throws com.google.gwtorm.server.OrmException { for ( com.google.gerrit.server.query.Predicate < T > c : children ) { com.google.common.base.Preconditions.checkState ( c.isMatchable ( ) , ( "match invoked, but child predicate %s " + "doesn't implement %s" ) , c , com.google.gerrit.server.query.Matchable.class . getName ( ) ) ; if ( ! ( c.asMatchable ( ) . match ( object ) ) ) { return false ; } } return true ; }

Target:
public boolean match ( final T object ) throws com.google.gwtorm.server.OrmException { for ( com.google.gerrit.server.query.Predicate < T > c : children ) { com.google.common.base.Preconditions.checkState ( c.isMatchable ( ) , "match invoked, but child predicate %s doesn't implement %s" , c , com.google.gerrit.server.query.Matchable.class . getName ( ) ) ; if ( ! ( c.asMatchable ( ) . match ( object ) ) ) { return false ; } } return true ; }
Source:
public void testGc ( ) throws com.jcraft.jsch.JSchException , java.io.IOException { java.lang.String response = sshSession.exec ( ( ( ( ( "gerrit gc \"" + ( project1.get ( ) ) ) + "\" \"" ) + ( project2.get ( ) ) ) + "\"" ) ) ; org.junit.Assert.assertFalse ( sshSession.hasError ( ) ) ; assertNoError ( response ) ; assertHasPackFile ( project1 , project2 ) ; assertHasNoPackFile ( allProjects , project3 ) ; }

Target:
public void testGc ( ) throws com.jcraft.jsch.JSchException , java.io.IOException { java.lang.String response = sshSession.exec ( ( ( ( ( "gerrit gc \"" + ( project1.get ( ) ) ) + "\" \"" ) + ( project2.get ( ) ) ) + "\"" ) ) ; org.junit.Assert.assertFalse ( sshSession.hasError ( ) ) ; assertNoError ( response ) ; gcAssert.assertHasPackFile ( project1 , project2 ) ; gcAssert.assertHasNoPackFile ( allProjects , project3 ) ; }
Source:
public void patchSetObjectAndRefMissing ( ) throws java.lang.Exception { java.lang.String rev = "deadbeefdeadbeefdeadbeefdeadbeefdeadbeef" ; com.google.gerrit.server.project.ChangeControl ctl = insertChange ( ) ; com.google.gerrit.reviewdb.client.PatchSet ps = insertMissingPatchSet ( ctl , rev ) ; ctl = reload ( ctl ) ; assertProblems ( ctl , null , com.google.gerrit.acceptance.server.change.ConsistencyCheckerIT.problem ( ( "Ref missing: " + ( ps.getId ( ) . toRefName ( ) ) ) ) , com.google.gerrit.acceptance.server.change.ConsistencyCheckerIT.problem ( "Object missing: patch set 2: deadbeefdeadbeefdeadbeefdeadbeefdeadbeef" ) ) ; }

Target:
public void patchSetObjectAndRefMissing ( ) throws java.lang.Exception { java.lang.String rev = "deadbeefdeadbeefdeadbeefdeadbeefdeadbeef" ; com.google.gerrit.server.notedb.ChangeNotes notes = insertChange ( ) ; com.google.gerrit.reviewdb.client.PatchSet ps = insertMissingPatchSet ( notes , rev ) ; notes = reload ( notes ) ; assertProblems ( notes , null , com.google.gerrit.acceptance.server.change.ConsistencyCheckerIT.problem ( ( "Ref missing: " + ( ps.getId ( ) . toRefName ( ) ) ) ) , com.google.gerrit.acceptance.server.change.ConsistencyCheckerIT.problem ( "Object missing: patch set 2: deadbeefdeadbeefdeadbeefdeadbeefdeadbeef" ) ) ; }
Source:
public com.google.gitiles.doc.html.HtmlBuilder open ( java.lang.String tagName ) { com.google.common.base.Preconditions.checkArgument ( com.google.gitiles.doc.html.HtmlBuilder.ALLOWED_TAGS.contains ( tagName ) , "invalid HTML tag %s" , tagName ) ; finishActiveTag ( ) ; htmlBuf.append ( '<' ) . append ( tagName ) ; tag = tagName ; return this ; }

Target:
public com.google.gitiles.doc.html.HtmlBuilder open ( java.lang.String tagName ) { com.google.common.base.Preconditions.checkArgument ( com.google.gitiles.doc.html.HtmlBuilder.ALLOWED_TAGS.contains ( tagName ) , "invalid HTML tag %s" , tagName ) ; finishActiveTag ( ) ; try { htmlBuf.append ( '<' ) . append ( tagName ) ; } catch ( java.io.IOException e ) { throw new com.google.gitiles.doc.RuntimeIOException ( e ) ; } tag = tagName ; return this ; }
Source:
private void appendHunkHeader ( final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder m , final com.google.gerrit.prettify.common.EditList.Hunk hunk ) { openLine ( m , false ) ; padLineNumber ( m , false , true ) ; padLineNumber ( m , false , false ) ; m.openTd ( ) ; m.setStyleName ( Gerrit.RESOURCES.css ( ) . fileLine ( ) ) ; m.addStyleName ( Gerrit.RESOURCES.css ( ) . diffText ( ) ) ; m.addStyleName ( Gerrit.RESOURCES.css ( ) . diffTextHunkHeader ( ) ) ; m.append ( "@@ -" ) ; appendRange ( m , ( ( hunk.getCurA ( ) ) + 1 ) , ( ( hunk.getEndA ( ) ) - ( hunk.getCurA ( ) ) ) ) ; m.append ( " +" ) ; appendRange ( m , ( ( hunk.getCurB ( ) ) + 1 ) , ( ( hunk.getEndB ( ) ) - ( hunk.getCurB ( ) ) ) ) ; m.append ( " @@" ) ; m.closeTd ( ) ; closeLine ( m ) ; }

Target:
private void appendHunkHeader ( final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder m , final com.google.gerrit.prettify.common.EditList.Hunk hunk ) { openLine ( m ) ; padLineNumberForSideA ( m ) ; padLineNumberForSideB ( m ) ; m.openTd ( ) ; m.setStyleName ( Gerrit.RESOURCES.css ( ) . fileLine ( ) ) ; m.addStyleName ( Gerrit.RESOURCES.css ( ) . diffText ( ) ) ; m.addStyleName ( Gerrit.RESOURCES.css ( ) . diffTextHunkHeader ( ) ) ; m.append ( "@@ -" ) ; appendRange ( m , ( ( hunk.getCurA ( ) ) + 1 ) , ( ( hunk.getEndA ( ) ) - ( hunk.getCurA ( ) ) ) ) ; m.append ( " +" ) ; appendRange ( m , ( ( hunk.getCurB ( ) ) + 1 ) , ( ( hunk.getEndB ( ) ) - ( hunk.getCurB ( ) ) ) ) ; m.append ( " @@" ) ; m.closeTd ( ) ; closeLine ( m ) ; }
Source:
public static void topic ( int id , java.lang.String topic , com.google.gwt.user.client.rpc.AsyncCallback < java.lang.String > cb ) { com.google.gerrit.client.rpc.RestApi call = com.google.gerrit.client.changes.ChangeApi.call ( id , "topic" ) ; topic = com.google.gerrit.client.changes.ChangeApi.emptyToNull ( topic ) ; if ( topic != null ) { com.google.gerrit.client.changes.ChangeApi.Input input = com.google.gerrit.client.changes.ChangeApi.Input.create ( ) ; input.topic ( topic ) ; call.put ( input , com.google.gerrit.client.rpc.NativeString.unwrap ( cb ) ) ; } else { call.delete ( com.google.gerrit.client.rpc.NativeString.unwrap ( cb ) ) ; } }

Target:
public static void topic ( int id , java.lang.String topic , com.google.gwt.user.client.rpc.AsyncCallback < java.lang.String > cb ) { com.google.gerrit.client.rpc.RestApi call = com.google.gerrit.client.changes.ChangeApi.call ( id , "topic" ) ; topic = com.google.gerrit.client.changes.ChangeApi.emptyToNull ( topic ) ; if ( topic != null ) { com.google.gerrit.client.changes.ChangeApi.TopicInput input = com.google.gerrit.client.changes.ChangeApi.TopicInput.create ( ) ; input.topic ( topic ) ; call.put ( input , com.google.gerrit.client.rpc.NativeString.unwrap ( cb ) ) ; } else { call.delete ( com.google.gerrit.client.rpc.NativeString.unwrap ( cb ) ) ; } }
Source:
protected void onLoad ( ) { super . onLoad ( ) ; Util.ACCOUNT_SEC.validateEmail ( magicToken , new com.google.gerrit.client.rpc.ScreenLoadCallback < com.google.gwtjsonrpc.common.VoidResult > ( this ) { @ java.lang.Override protected void preDisplay ( final com.google.gwtjsonrpc.common.VoidResult result ) { } @ java.lang.Override protected void postDisplay ( ) { com.google.gerrit.client.Gerrit.display ( PageLinks.SETTINGS_CONTACT ) ; } } ) ; }

Target:
protected void onLoad ( ) { super . onLoad ( ) ; com.google.gerrit.client.config.ConfigServerApi.confirmEmail ( magicToken , new com.google.gerrit.client.rpc.ScreenLoadCallback < com.google.gerrit.client.VoidResult > ( this ) { @ java.lang.Override protected void preDisplay ( final com.google.gerrit.client.VoidResult result ) { } @ java.lang.Override protected void postDisplay ( ) { com.google.gerrit.client.Gerrit.display ( PageLinks.SETTINGS_CONTACT ) ; } } ) ; }
Source:
private void goUpToChange ( boolean openReplyBox ) { java.lang.String b = ( ( base ) != null ) ? java.lang.String.valueOf ( base.get ( ) ) : null ; java.lang.String rev = java.lang.String.valueOf ( revision.get ( ) ) ; com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( changeId , rev ) , new com.google.gerrit.client.change.ChangeScreen2 ( changeId , b , rev , openReplyBox ) ) ; }

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 testIsEnabledEventDisabled ( ) { java.lang.String [ ] branches = new java.lang.String [ ] { "^refs/heads/foo.*" } ; setupIsEnabled ( "true" , null , branches ) ; com.google.gerrit.server.events.PatchSetCreatedEvent event = new com.google.gerrit.server.events.PatchSetCreatedEvent ( ) ; event.change = new com.google.gerrit.server.data.ChangeAttribute ( ) ; event.change.project = "testProject" ; event.change.branch = "testBranch" ; com.googlesource.gerrit.plugins.hooks.its.ItsConfig itsConfig = createItsConfig ( ) ; replayMocks ( ) ; assertFalse ( itsConfig.isEnabled ( event ) ) ; }

Target:
public void testIsEnabledEventDisabled ( ) { java.lang.String [ ] branches = new java.lang.String [ ] { "^refs/heads/testBranch" } ; setupIsEnabled ( "false" , null , branches ) ; com.google.gerrit.server.events.PatchSetCreatedEvent event = new com.google.gerrit.server.events.PatchSetCreatedEvent ( ) ; event.change = new com.google.gerrit.server.data.ChangeAttribute ( ) ; event.change.project = "testProject" ; event.change.branch = "testBranch" ; com.googlesource.gerrit.plugins.hooks.its.ItsConfig itsConfig = createItsConfig ( ) ; replayMocks ( ) ; assertFalse ( itsConfig.isEnabled ( event ) ) ; }
Source:
private static org.eclipse.jgit.util.TemporaryBuffer.Heap compress ( com.google.gerrit.extensions.restapi.BinaryResult bin ) throws java.io.IOException { org.eclipse.jgit.util.TemporaryBuffer.Heap buf = com.google.gerrit.httpd.restapi.RestApiServlet.heap ( ( 20 << 20 ) ) ; java.util.zip.GZIPOutputStream gz = new java.util.zip.GZIPOutputStream ( buf ) ; bin.writeTo ( gz ) ; gz.finish ( ) ; gz.flush ( ) ; return buf ; }

Target:
public void writeTo ( java.io.OutputStream out ) throws java.io.IOException { java.util.zip.GZIPOutputStream gz = new java.util.zip.GZIPOutputStream ( out ) ; src.writeTo ( gz ) ; gz.finish ( ) ; gz.flush ( ) ; }
Source:
public void addUrl ( com.google.gerrit.extensions.common.ChangeInfo change ) { args.add ( "--change-url" ) ; java.lang.String url = urlProvider.get ( ) ; if ( ( change != null ) && ( url != null ) ) { args.add ( ( url + ( change.changeId ) ) ) ; } else { args.add ( "" ) ; } }

Target:
public void addUrl ( com.google.gerrit.extensions.common.ChangeInfo change ) { args.add ( "--change-url" ) ; java.lang.String url = urlProvider.get ( ) ; if ( ( change != null ) && ( url != null ) ) { args.add ( ( url + ( change._number ) ) ) ; } else { args.add ( "" ) ; } }
Source:
public void createEmptyChange_MissingMessage ( ) throws java.lang.Exception { com.google.gerrit.extensions.common.ChangeInfo ci = new com.google.gerrit.extensions.common.ChangeInfo ( ) ; ci.project = project.get ( ) ; ci.branch = "master" ; com.google.gerrit.acceptance.RestResponse r = adminSession.post ( "/changes/" , ci ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( HttpStatus.SC_BAD_REQUEST ) ; com.google.common.truth.Truth.assertThat ( r.getEntityContent ( ) ) . contains ( "commit message must be non-empty" ) ; }

Target:
public void createEmptyChange_MissingMessage ( ) throws java.lang.Exception { com.google.gerrit.extensions.common.ChangeInfo ci = new com.google.gerrit.extensions.common.ChangeInfo ( ) ; ci.project = project.get ( ) ; ci.branch = "master" ; assertCreateFails ( ci , com.google.gerrit.extensions.restapi.BadRequestException.class , "commit message must be non-empty" ) ; }
Source:
public com.google.gerrit.extensions.client.DiffPreferencesInfo apply ( com.google.gerrit.server.account.AccountResource rsrc ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.server.permissions.PermissionBackendException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { if ( ( self.get ( ) ) != ( rsrc.getUser ( ) ) ) { permissionBackend.user ( self ) . check ( GlobalPermission.ADMINISTRATE_SERVER ) ; } com.google.gerrit.reviewdb.client.Account.Id id = rsrc.getUser ( ) . getAccountId ( ) ; return accountCache.get ( id ) . getDiffPreferences ( ) ; }

Target:
public com.google.gerrit.extensions.client.DiffPreferencesInfo apply ( com.google.gerrit.server.account.AccountResource rsrc ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.permissions.PermissionBackendException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { if ( ( self.get ( ) ) != ( rsrc.getUser ( ) ) ) { permissionBackend.user ( self ) . check ( GlobalPermission.ADMINISTRATE_SERVER ) ; } com.google.gerrit.reviewdb.client.Account.Id id = rsrc.getUser ( ) . getAccountId ( ) ; return accountCache.maybeGet ( id ) . map ( AccountState :: getDiffPreferences ) . orElseThrow ( ( ) -> new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( com.google.gerrit.extensions.restapi.IdString.fromDecoded ( id.toString ( ) ) ) ) ; }
Source:
public java.util.Set < com.google.gerrit.reviewdb.client.Change.Id > getStarredChanges ( ) { if ( ( starredChanges ) == null ) { if ( ( starredChangesUtil ) == null ) { throw new java.lang.IllegalStateException ( "StarredChangesUtil is missing" ) ; } try { starredChanges = com.google.common.collect.FluentIterable.from ( ( ( starredQuery ) != null ? starredQuery : starredChangesUtil.query ( accountId ) ) ) . toSet ( ) ; } finally { starredQuery = null ; } } return starredChanges ; }

Target:
public java.util.Set < com.google.gerrit.reviewdb.client.Change.Id > getStarredChanges ( ) { if ( ( starredChanges ) == null ) { if ( ( starredChangesUtil ) == null ) { throw new java.lang.IllegalStateException ( "StarredChangesUtil is missing" ) ; } try { starredChanges = com.google.common.collect.FluentIterable.from ( ( ( starredQuery ) != null ? starredQuery : starredChangesUtil.queryFromIndex ( accountId ) ) ) . toSet ( ) ; } finally { starredQuery = null ; } } return starredChanges ; }
Source:
public static void terminate ( ) { for ( final com.google.gerrit.git.WorkQueue.Executor p : com.google.gerrit.git.WorkQueue.queues ) { p.shutdown ( ) ; boolean isTerminated ; do { try { isTerminated = p.awaitTermination ( 10 , java.util.concurrent.TimeUnit.SECONDS ) ; } catch ( java.lang.InterruptedException ie ) { isTerminated = false ; } } while ( ! isTerminated ) ; } com.google.gerrit.git.WorkQueue.queues.clear ( ) ; }

Target:
public void shutdown ( ) { for ( final com.google.gerrit.git.WorkQueue.Executor p : queues ) { p.shutdown ( ) ; boolean isTerminated ; do { try { isTerminated = p.awaitTermination ( 10 , java.util.concurrent.TimeUnit.SECONDS ) ; } catch ( java.lang.InterruptedException ie ) { isTerminated = false ; } } while ( ! isTerminated ) ; } queues.clear ( ) ; }
Source:
public void testUpdateNoPerson ( ) throws java.lang.Exception { final com.google.gwtorm.data.PhoneBookDb schema = openAndCreate ( ) ; final com.google.gwtorm.data.TestPerson bob = new com.google.gwtorm.data.TestPerson ( new com.google.gwtorm.data.TestPerson.Key ( "Bob" ) , 18 ) ; try { schema.people ( ) . update ( java.util.Collections.singleton ( bob ) ) ; fail ( "Update of missing person succeeded" ) ; } catch ( com.google.gwtorm.client.OrmConcurrencyException e ) { assertEquals ( "Concurrent modification detected" , e.getMessage ( ) ) ; } }

Target:
public void testUpdateNoPerson ( ) throws java.lang.Exception { final com.google.gwtorm.data.PhoneBookDb schema = openAndCreate ( ) ; final com.google.gwtorm.data.Person bob = new com.google.gwtorm.data.Person ( new com.google.gwtorm.data.Person.Key ( "Bob" ) , 18 ) ; try { schema.people ( ) . update ( java.util.Collections.singleton ( bob ) ) ; org.junit.Assert.fail ( "Update of missing person succeeded" ) ; } catch ( com.google.gwtorm.server.OrmConcurrencyException e ) { org.junit.Assert.assertEquals ( "Concurrent modification detected" , e.getMessage ( ) ) ; } }
Source:
private static void createIndexes ( ) { com.google.gerrit.elasticsearch.ElasticChangeIndex.ChangeMapping openChangesMapping = new com.google.gerrit.elasticsearch.ElasticChangeIndex.ChangeMapping ( ChangeSchemaDefinitions.INSTANCE.getLatest ( ) ) ; com.google.gerrit.elasticsearch.ElasticChangeIndex.ChangeMapping closedChangesMapping = new com.google.gerrit.elasticsearch.ElasticChangeIndex.ChangeMapping ( ChangeSchemaDefinitions.INSTANCE.getLatest ( ) ) ; openChangesMapping.closedChanges = null ; closedChangesMapping.openChanges = null ; com.google.gerrit.elasticsearch.ElasticQueryChangesTest.node.client ( ) . admin ( ) . indices ( ) . prepareCreate ( "gerrit" ) . addMapping ( com.google.gerrit.elasticsearch.ElasticChangeIndex.OPEN_CHANGES , com.google.gerrit.elasticsearch.ElasticQueryChangesTest.gson.toJson ( openChangesMapping ) ) . addMapping ( com.google.gerrit.elasticsearch.ElasticChangeIndex.CLOSED_CHANGES , com.google.gerrit.elasticsearch.ElasticQueryChangesTest.gson.toJson ( closedChangesMapping ) ) . execute ( ) . actionGet ( ) ; }

Target:
private static void createIndexes ( ) { com.google.gerrit.elasticsearch.ElasticChangeIndex.ChangeMapping openChangesMapping = new com.google.gerrit.elasticsearch.ElasticChangeIndex.ChangeMapping ( ChangeSchemaDefinitions.INSTANCE.getLatest ( ) ) ; com.google.gerrit.elasticsearch.ElasticChangeIndex.ChangeMapping closedChangesMapping = new com.google.gerrit.elasticsearch.ElasticChangeIndex.ChangeMapping ( ChangeSchemaDefinitions.INSTANCE.getLatest ( ) ) ; openChangesMapping.closedChanges = null ; closedChangesMapping.openChanges = null ; com.google.gerrit.elasticsearch.ElasticQueryChangesTest.node.client ( ) . admin ( ) . indices ( ) . prepareCreate ( com.google.gerrit.elasticsearch.ElasticQueryChangesTest.INDEX_NAME ) . addMapping ( com.google.gerrit.elasticsearch.ElasticChangeIndex.OPEN_CHANGES , com.google.gerrit.elasticsearch.ElasticQueryChangesTest.gson.toJson ( openChangesMapping ) ) . addMapping ( com.google.gerrit.elasticsearch.ElasticChangeIndex.CLOSED_CHANGES , com.google.gerrit.elasticsearch.ElasticQueryChangesTest.gson.toJson ( closedChangesMapping ) ) . execute ( ) . actionGet ( ) ; }
Source:
public static java.io.File storeInTemp ( java.lang.String pluginName , java.io.InputStream in , com.google.gerrit.server.config.SitePaths sitePaths ) throws java.io.IOException { return com.google.gerrit.server.plugins.PluginLoader.asTemp ( in , com.google.gerrit.server.plugins.PluginLoader.tempNameFor ( pluginName ) , ".jar" , sitePaths.tmp_dir ) ; }

Target:
public static java.io.File storeInTemp ( java.lang.String pluginName , java.io.InputStream in , com.google.gerrit.server.config.SitePaths sitePaths ) throws java.io.IOException { if ( ! ( sitePaths.tmp_dir.exists ( ) ) ) { sitePaths.tmp_dir.mkdirs ( ) ; } return com.google.gerrit.server.plugins.PluginLoader.asTemp ( in , com.google.gerrit.server.plugins.PluginLoader.tempNameFor ( pluginName ) , ".jar" , sitePaths.tmp_dir ) ; }
Source:
public java.util.List < com.google.gerrit.reviewdb.client.ChangeMessage > messages ( ) throws com.google.gwtorm.server.OrmException { if ( ( messages ) == null ) { messages = cmUtil.byChange ( db , notes ( ) ) ; } return messages ; }

Target:
public java.util.List < com.google.gerrit.reviewdb.client.ChangeMessage > messages ( ) throws com.google.gwtorm.server.OrmException { if ( ( messages ) == null ) { if ( ! ( lazyLoad ) ) { return java.util.Collections.emptyList ( ) ; } messages = cmUtil.byChange ( db , notes ( ) ) ; } return messages ; }
Source:
public UiAction.Description getDescription ( com.google.gerrit.server.change.ChangeResource rsrc ) { try { return new com.google.gerrit.extensions.webui.UiAction.Description ( ) . setTitle ( ( "Delete draft change " + ( rsrc.getId ( ) ) ) ) . setVisible ( ( ( ( allowDrafts ) && ( ( rsrc.getChange ( ) . getStatus ( ) ) == ( com.google.gerrit.reviewdb.client.Change.Status.DRAFT ) ) ) && ( rsrc.getControl ( ) . canDeleteDraft ( db.get ( ) ) ) ) ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new java.lang.IllegalStateException ( e ) ; } }

Target:
public UiAction.Description getDescription ( com.google.gerrit.server.change.ChangeResource rsrc ) { try { return new com.google.gerrit.extensions.webui.UiAction.Description ( ) . setLabel ( "Delete" ) . setTitle ( ( "Delete draft change " + ( rsrc.getId ( ) ) ) ) . setVisible ( ( ( ( allowDrafts ) && ( ( rsrc.getChange ( ) . getStatus ( ) ) == ( com.google.gerrit.reviewdb.client.Change.Status.DRAFT ) ) ) && ( rsrc.getControl ( ) . canDeleteDraft ( db.get ( ) ) ) ) ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new java.lang.IllegalStateException ( e ) ; } }
Source:
public void onSuccess ( com.google.gerrit.client.diff.DiffInfo diffInfo ) { diff = diffInfo ; new net.codemirror.lib.ModeInjector ( ) . add ( getContentType ( diff.meta_a ( ) ) ) . add ( getContentType ( diff.meta_b ( ) ) ) . inject ( modeInjectorCb ) ; }

Target:
public void onSuccess ( com.google.gerrit.client.diff.DiffInfo diffInfo ) { diff = diffInfo ; if ( prefs.syntaxHighlighting ( ) ) { largeFile = com.google.gerrit.client.diff.SideBySide2.isLargeFile ( diffInfo ) ; if ( largeFile ) { modeInjectorCb.onSuccess ( null ) ; } else { injectMode ( diffInfo , modeInjectorCb ) ; } } else { modeInjectorCb.onSuccess ( null ) ; } }
Source:
public void index ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Change change ) throws com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.server.query.change.ChangeData cd ; if ( notesMigration.commitChangeWrites ( ) ) { com.google.gerrit.server.notedb.ChangeNotes notes = changeNotesFactory.createWithAutoRebuildingDisabled ( change , null ) ; cd = changeDataFactory.create ( db , notes ) ; } else { cd = changeDataFactory.create ( db , change ) ; } index ( cd ) ; }

Target:
public void index ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Project.NameKey project , com.google.gerrit.reviewdb.client.Change.Id changeId ) throws com.google.gwtorm.server.OrmException , java.io.IOException { index ( newChangeData ( db , project , changeId ) ) ; }
Source:
private void emptycell ( final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder m , final int colspan ) { m.openTd ( ) ; m.addStyleName ( com.google.gerrit.client.changes.S_DATA_CELL ) ; m.addStyleName ( "DiffLinkCell" ) ; m.setAttribute ( "colspan" , colspan ) ; m.nbsp ( ) ; m.closeTd ( ) ; }

Target:
private void openlink ( final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder m , final int colspan ) { m.openTd ( ) ; m.addStyleName ( Gerrit.RESOURCES.css ( ) . dataCell ( ) ) ; m.addStyleName ( Gerrit.RESOURCES.css ( ) . diffLinkCell ( ) ) ; m.setAttribute ( "colspan" , colspan ) ; }
Source:
public static java.util.List < com.google.gerrit.reviewdb.client.Change > scan ( com.google.gerrit.server.notedb.NotesMigration notesMigration , com.google.gerrit.server.notedb.ChangeNotes.Factory notesFactory , org.eclipse.jgit.lib.Repository repo , com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Project.NameKey project ) throws com.google.gwtorm.server.OrmException , java.io.IOException { if ( ! ( notesMigration.readChanges ( ) ) ) { return com.google.gerrit.server.git.ScanningChangeCacheImpl.scanDb ( repo , db ) ; } return com.google.gerrit.server.git.ScanningChangeCacheImpl.scanNotedb ( notesFactory , repo , db , project ) ; }

Target:
public static java.util.List < com.google.gerrit.reviewdb.client.Change > scan ( com.google.gerrit.server.notedb.NotesMigration notesMigration , com.google.gerrit.server.notedb.ChangeNotes.Factory notesFactory , org.eclipse.jgit.lib.Repository repo , com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Project.NameKey project ) throws com.google.gwtorm.server.OrmException , java.io.IOException { if ( ! ( notesMigration.readChanges ( ) ) ) { return com.google.gerrit.server.git.ScanningChangeCacheImpl.scanDb ( repo , db ) ; } return com.google.gerrit.server.git.ScanningChangeCacheImpl.scanChangesFromNotedb ( notesFactory , repo , db , project ) ; }
Source:
protected void assertCurrentRevision ( java.lang.String changeId , int expectedNum , org.eclipse.jgit.lib.ObjectId expectedId ) throws java.io.IOException { com.google.gerrit.extensions.common.ChangeInfo c = getChange ( changeId , com.google.gerrit.extensions.common.ListChangesOption.CURRENT_REVISION ) ; com.google.common.truth.Truth.assertThat ( c.currentRevision ) . isEqualTo ( expectedId.name ( ) ) ; com.google.common.truth.Truth.assertThat ( c.revisions.get ( expectedId.name ( ) ) . _number ) . isEqualTo ( expectedNum ) ; }

Target:
protected void assertCurrentRevision ( java.lang.String changeId , int expectedNum , org.eclipse.jgit.lib.ObjectId expectedId ) throws java.io.IOException { com.google.gerrit.extensions.common.ChangeInfo c = getChange ( changeId , com.google.gerrit.extensions.client.ListChangesOption.CURRENT_REVISION ) ; com.google.common.truth.Truth.assertThat ( c.currentRevision ) . isEqualTo ( expectedId.name ( ) ) ; com.google.common.truth.Truth.assertThat ( c.revisions.get ( expectedId.name ( ) ) . _number ) . isEqualTo ( expectedNum ) ; }