auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static com.google.gerrit.reviewdb.AccountDiffPreference createDefault ( com.google.gerrit.reviewdb.Account.Id accountId ) { com.google.gerrit.reviewdb.AccountDiffPreference p = new com.google.gerrit.reviewdb.AccountDiffPreference ( accountId ) ; p.setIgnoreWhitespace ( com.google.gerrit.reviewdb.AccountDiffPreference.Whitespace.IGNORE_NONE ) ; p.setTabSize ( 8 ) ; p.setLineLength ( 100 ) ; p.setSyntaxHighlighting ( true ) ; p.setShowWhitespaceErrors ( true ) ; p.setIntralineDifference ( true ) ; p.setShowTabs ( true ) ; p.setContext ( com.google.gerrit.reviewdb.AccountDiffPreference.DEFAULT_CONTEXT ) ; return p ; }

Target:
public static com.google.gerrit.reviewdb.AccountDiffPreference createDefault ( com.google.gerrit.reviewdb.Account.Id accountId ) { com.google.gerrit.reviewdb.AccountDiffPreference p = new com.google.gerrit.reviewdb.AccountDiffPreference ( accountId ) ; p.setIgnoreWhitespace ( com.google.gerrit.reviewdb.AccountDiffPreference.Whitespace.IGNORE_NONE ) ; p.setTabSize ( 8 ) ; p.setLineLength ( 100 ) ; p.setSyntaxHighlighting ( true ) ; p.setShowWhitespaceErrors ( true ) ; p.setIntralineDifference ( true ) ; p.setShowTabs ( true ) ; p.setContext ( com.google.gerrit.reviewdb.AccountDiffPreference.DEFAULT_CONTEXT ) ; p.setManualReview ( false ) ; return p ; }
Source:
public void serverConfigWithPlugin ( ) throws java.lang.Exception { java.nio.file.Path plugins = tempSiteDir.newFolder ( "plugins" ) . toPath ( ) ; java.nio.file.Path jsplugin = plugins.resolve ( "js-plugin-1.js" ) ; java.nio.file.Files.write ( jsplugin , "Gerrit.install(function(self){});\n" . getBytes ( java.nio.charset.StandardCharsets.UTF_8 ) ) ; adminSshSession.exec ( "gerrit plugin reload" ) ; com.google.gerrit.extensions.common.ServerInfo i = gApi.config ( ) . server ( ) . getInfo ( ) ; com.google.common.truth.Truth.assertThat ( i.plugin.jsResourcePaths ) . hasSize ( 1 ) ; }

Target:
public void serverConfigWithPlugin ( ) throws java.lang.Exception { java.nio.file.Path plugins = sitePaths.plugins_dir ; java.nio.file.Files.createDirectory ( plugins ) ; java.nio.file.Path jsplugin = plugins.resolve ( "js-plugin-1.js" ) ; java.nio.file.Files.write ( jsplugin , "Gerrit.install(function(self){});\n" . getBytes ( java.nio.charset.StandardCharsets.UTF_8 ) ) ; adminSshSession.exec ( "gerrit plugin reload" ) ; com.google.gerrit.extensions.common.ServerInfo i = gApi.config ( ) . server ( ) . getInfo ( ) ; com.google.common.truth.Truth.assertThat ( i.plugin.jsResourcePaths ) . hasSize ( 1 ) ; }
Source:
protected void onLoad ( ) { super . onLoad ( ) ; com.google.gerrit.client.changes.ChangeApi.detail ( changeId.get ( ) , java.util.EnumSet.of ( ListChangesOption.ALL_REVISIONS , ListChangesOption.CURRENT_ACTIONS ) , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.changes.ChangeInfo > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.changes.ChangeInfo info ) { info.init ( ) ; loadConfigInfo ( info ) ; } } ) ; }

Target:
protected void onLoad ( ) { super . onLoad ( ) ; loadChangeInfo ( true , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.changes.ChangeInfo > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.changes.ChangeInfo info ) { info.init ( ) ; loadConfigInfo ( info ) ; } } ) ; }
Source:
public void parseInvalidTimestamps ( ) { com.google.gwtjsonrpc.common.JavaSqlTimestampHelperTest.assertInvalid ( "2006-01-02-15:04:05.999000000" ) ; com.google.gwtjsonrpc.common.JavaSqlTimestampHelperTest.assertInvalid ( "2006-01-02T15:04:05.999000000" ) ; com.google.gwtjsonrpc.common.JavaSqlTimestampHelperTest.assertInvalid ( "2006-01-02" ) ; com.google.gwtjsonrpc.common.JavaSqlTimestampHelperTest.assertInvalid ( "15:04:05" ) ; com.google.gwtjsonrpc.common.JavaSqlTimestampHelperTest.assertInvalid ( "15:04:05.999000000" ) ; com.google.gwtjsonrpc.common.JavaSqlTimestampHelperTest.assertInvalid ( "2006-01-02 10:04:05.999 -0500" ) ; com.google.gwtjsonrpc.common.JavaSqlTimestampHelperTest.assertInvalid ( "2006-01-02 10:04:05.999000000 -0500" ) ; }

Target:
public void parseInvalidTimestamps ( ) { com.google.gwtjsonrpc.common.JavaSqlTimestampHelperTest.assertInvalid ( "2006-01-02-15:04:05.789000000" ) ; com.google.gwtjsonrpc.common.JavaSqlTimestampHelperTest.assertInvalid ( "2006-01-02T15:04:05.789000000" ) ; com.google.gwtjsonrpc.common.JavaSqlTimestampHelperTest.assertInvalid ( "15:04:05" ) ; com.google.gwtjsonrpc.common.JavaSqlTimestampHelperTest.assertInvalid ( "15:04:05.999000000" ) ; com.google.gwtjsonrpc.common.JavaSqlTimestampHelperTest.assertInvalid ( "2006-01-02 10:04:05.789 -0500" ) ; com.google.gwtjsonrpc.common.JavaSqlTimestampHelperTest.assertInvalid ( "2006-01-02 10:04:05.789000000 -0500" ) ; }
Source:
public void noExternalIds ( ) throws java.lang.Exception { db.accountExternalIds ( ) . delete ( db.accountExternalIds ( ) . byAccount ( user.getAccountId ( ) ) ) ; reloadUser ( ) ; com.google.gerrit.gpg.testutil.TestKey key = com.google.gerrit.gpg.testutil.TestKeys.validKeyWithSecondUserId ( ) ; com.google.gerrit.gpg.GerritPublicKeyChecker checker = checkerFactory.create ( user ) ; assertProblems ( checker.check ( key.getPublicKey ( ) ) , Status.BAD , ( "No identities found for user; check" + " http://test/#/settings/web-identities" ) ) ; checker = checkerFactory.create ( ) ; assertProblems ( checker.check ( key.getPublicKey ( ) ) , Status.BAD , "Key is not associated with any users" ) ; db.accountExternalIds ( ) . insert ( java.util.Collections.singleton ( new com.google.gerrit.reviewdb.client.AccountExternalId ( user.getAccountId ( ) , com.google.gerrit.gpg.GerritPublicKeyChecker.toExtIdKey ( key.getPublicKey ( ) ) ) ) ) ; reloadUser ( ) ; assertProblems ( checker.check ( key.getPublicKey ( ) ) , Status.BAD , "No identities found for user" ) ; }

Target:
public void noExternalIds ( ) throws java.lang.Exception { db.accountExternalIds ( ) . delete ( db.accountExternalIds ( ) . byAccount ( user.getAccountId ( ) ) ) ; reloadUser ( ) ; com.google.gerrit.gpg.testutil.TestKey key = com.google.gerrit.gpg.testutil.TestKeys.validKeyWithSecondUserId ( ) ; com.google.gerrit.gpg.PublicKeyChecker checker = checkerFactory.create ( ) . setExpectedUser ( user ) . disableTrust ( ) ; assertProblems ( checker.check ( key.getPublicKey ( ) ) , Status.BAD , ( "No identities found for user; check" + " http://test/#/settings/web-identities" ) ) ; checker = checkerFactory.create ( ) . disableTrust ( ) ; assertProblems ( checker.check ( key.getPublicKey ( ) ) , Status.BAD , "Key is not associated with any users" ) ; db.accountExternalIds ( ) . insert ( java.util.Collections.singleton ( new com.google.gerrit.reviewdb.client.AccountExternalId ( user.getAccountId ( ) , com.google.gerrit.gpg.GerritPublicKeyChecker.toExtIdKey ( key.getPublicKey ( ) ) ) ) ) ; reloadUser ( ) ; assertProblems ( checker.check ( key.getPublicKey ( ) ) , Status.BAD , "No identities found for user" ) ; }
Source:
public com.google.gerrit.extensions.client.ChangeKind getChangeKind ( com.google.gerrit.reviewdb.client.Project.NameKey project , @ com.google.gerrit.common.Nullable org.eclipse.jgit.lib.Repository repo , @ com.google.gerrit.common.Nullable org.eclipse.jgit.revwalk.RevWalk rw , org.eclipse.jgit.lib.ObjectId prior , org.eclipse.jgit.lib.ObjectId next ) { try { com.google.gerrit.server.change.ChangeKindCacheImpl.Key key = new com.google.gerrit.server.change.ChangeKindCacheImpl.Key ( prior , next , useRecursiveMerge ) ; return new com.google.gerrit.server.change.ChangeKindCacheImpl.Loader ( key , repoManager , project , repo , rw ) . call ( ) ; } catch ( java.io.IOException e ) { com.google.gerrit.server.change.ChangeKindCacheImpl.log.warn ( ( ( ( "Cannot check trivial rebase of new patch set " + ( next.name ( ) ) ) + " in " ) + project ) , e ) ; return com.google.gerrit.extensions.client.ChangeKind.REWORK ; } }

Target:
public com.google.gerrit.extensions.client.ChangeKind getChangeKind ( com.google.gerrit.reviewdb.client.Project.NameKey project , @ com.google.gerrit.common.Nullable org.eclipse.jgit.revwalk.RevWalk rw , @ com.google.gerrit.common.Nullable org.eclipse.jgit.lib.Config repoConfig , org.eclipse.jgit.lib.ObjectId prior , org.eclipse.jgit.lib.ObjectId next ) { try { com.google.gerrit.server.change.ChangeKindCacheImpl.Key key = new com.google.gerrit.server.change.ChangeKindCacheImpl.Key ( prior , next , useRecursiveMerge ) ; return new com.google.gerrit.server.change.ChangeKindCacheImpl.Loader ( key , repoManager , project , rw , repoConfig ) . call ( ) ; } catch ( java.io.IOException e ) { com.google.gerrit.server.change.ChangeKindCacheImpl.log.warn ( ( ( ( "Cannot check trivial rebase of new patch set " + ( next.name ( ) ) ) + " in " ) + project ) , e ) ; return com.google.gerrit.extensions.client.ChangeKind.REWORK ; } }
Source:
protected void configureCommands ( ) { command ( com.googlesource.gerrit.plugins.adminconsole.ShowAccountCommand.class ) ; command ( com.googlesource.gerrit.plugins.adminconsole.ListUsersCommand.class ) ; alias ( "show-account" , com.googlesource.gerrit.plugins.adminconsole.ShowAccountCommand.class ) ; alias ( "show-repo-account-access" , com.googlesource.gerrit.plugins.adminconsole.ShowRepoAccountAccessCommand.class ) ; alias ( "show-repo-access" , com.googlesource.gerrit.plugins.adminconsole.ShowRepoAccessCommand.class ) ; }

Target:
protected void configureCommands ( ) { command ( com.googlesource.gerrit.plugins.adminconsole.ShowAccountCommand.class ) ; command ( com.googlesource.gerrit.plugins.adminconsole.ListUsersCommand.class ) ; command ( com.googlesource.gerrit.plugins.adminconsole.GetFullPathCommand.class ) ; alias ( "show-account" , com.googlesource.gerrit.plugins.adminconsole.ShowAccountCommand.class ) ; alias ( "show-repo-account-access" , com.googlesource.gerrit.plugins.adminconsole.ShowRepoAccountAccessCommand.class ) ; alias ( "show-repo-access" , com.googlesource.gerrit.plugins.adminconsole.ShowRepoAccessCommand.class ) ; alias ( "get-path" , com.googlesource.gerrit.plugins.adminconsole.GetFullPathCommand.class ) ; }
Source:
public void write ( com.google.gson.stream.JsonWriter out , java.sql.Timestamp ts ) throws java.io.IOException { out.value ( java.time.format.DateTimeFormatter.ISO_INSTANT.format ( ts.toInstant ( ) ) ) ; }

Target:
public void write ( com.google.gson.stream.JsonWriter out , java.sql.Timestamp ts ) throws java.io.IOException { java.sql.Timestamp truncated = new java.sql.Timestamp ( ( ( ( ts.getTime ( ) ) / 1000 ) * 1000 ) ) ; out.value ( java.time.format.DateTimeFormatter.ISO_INSTANT.format ( truncated.toInstant ( ) ) ) ; }
Source:
public boolean shouldPublish ( ) { if ( ! ( config.isEnabled ( ) ) ) return false ; boolean result ; result = true ; try { java.util.regex.Pattern pattern ; pattern = java.util.regex.Pattern.compile ( config.getIgnore ( ) , java.util.regex.Pattern.DOTALL ) ; java.util.regex.Matcher matcher ; matcher = pattern.matcher ( event.change.commitMessage ) ; result = ! ( matcher.matches ( ) ) ; } catch ( java.lang.Exception e ) { com.cisco.gerrit.plugins.slack.message.PatchSetCreatedMessageGenerator.LOGGER.warn ( "The specified ignore pattern was invalid" , e ) ; } return result ; }

Target:
public boolean shouldPublish ( ) { if ( ! ( config.isEnabled ( ) ) ) return false ; boolean result ; result = true ; try { java.util.regex.Pattern pattern ; pattern = java.util.regex.Pattern.compile ( config.getIgnore ( ) , java.util.regex.Pattern.DOTALL ) ; java.util.regex.Matcher matcher ; matcher = pattern.matcher ( event.change.get ( ) . commitMessage ) ; result = ! ( matcher.matches ( ) ) ; } catch ( java.lang.Exception e ) { com.cisco.gerrit.plugins.slack.message.PatchSetCreatedMessageGenerator.LOGGER.warn ( "The specified ignore pattern was invalid" , e ) ; } return result ; }
Source:
public final com.google.gerrit.extensions.client.EditPreferencesInfo copyTo ( com.google.gerrit.extensions.client.EditPreferencesInfo p ) { p.tabSize = tabSize ( ) ; p.lineLength = lineLength ( ) ; p.cursorBlinkRate = cursorBlinkRate ( ) ; p.hideTopMenu = hideTopMenu ( ) ; p.showTabs = showTabs ( ) ; p.showWhitespaceErrors = showWhitespaceErrors ( ) ; p.syntaxHighlighting = syntaxHighlighting ( ) ; p.hideLineNumbers = hideLineNumbers ( ) ; p.matchBrackets = matchBrackets ( ) ; p.autoCloseBrackets = autoCloseBrackets ( ) ; p.theme = theme ( ) ; p.keyMapType = keyMapType ( ) ; return p ; }

Target:
public final com.google.gerrit.extensions.client.EditPreferencesInfo copyTo ( com.google.gerrit.extensions.client.EditPreferencesInfo p ) { p.tabSize = tabSize ( ) ; p.lineLength = lineLength ( ) ; p.indentUnit = indentUnit ( ) ; p.cursorBlinkRate = cursorBlinkRate ( ) ; p.hideTopMenu = hideTopMenu ( ) ; p.showTabs = showTabs ( ) ; p.showWhitespaceErrors = showWhitespaceErrors ( ) ; p.syntaxHighlighting = syntaxHighlighting ( ) ; p.hideLineNumbers = hideLineNumbers ( ) ; p.matchBrackets = matchBrackets ( ) ; p.autoCloseBrackets = autoCloseBrackets ( ) ; p.showBase = showBase ( ) ; p.theme = theme ( ) ; p.keyMapType = keyMapType ( ) ; return p ; }
Source:
protected void configure ( ) { bind ( DataSourceProvider.Context.class ) . toInstance ( DataSourceProvider.Context.MULTI_USER ) ; bind ( com.google.inject.Key.get ( javax.sql.DataSource.class , com.google.inject.name.Names.named ( "ReviewDb" ) ) ) . toProvider ( com.google.gerrit.server.schema.DataSourceProvider.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; listener ( ) . to ( com.google.gerrit.server.schema.DataSourceProvider.class ) ; }

Target:
protected void configure ( ) { bind ( com.google.gerrit.server.schema.DataSourceType.class ) . toInstance ( dst ) ; bind ( DataSourceProvider.Context.class ) . toInstance ( DataSourceProvider.Context.MULTI_USER ) ; bind ( com.google.inject.Key.get ( javax.sql.DataSource.class , com.google.inject.name.Names.named ( "ReviewDb" ) ) ) . toProvider ( com.google.gerrit.server.schema.DataSourceProvider.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; listener ( ) . to ( com.google.gerrit.server.schema.DataSourceProvider.class ) ; }
Source:
public synchronized void stop ( ) { if ( ( daemonAcceptor ) != null ) { try { daemonAcceptor.close ( true ) . await ( ) ; com.google.gerrit.sshd.SshDaemon.log.info ( "Stopped Gerrit SSHD" ) ; } catch ( java.lang.InterruptedException e ) { com.google.gerrit.sshd.SshDaemon.log.warn ( "Exception caught while closing" , e ) ; } finally { daemonAcceptor = null ; } } }

Target:
public synchronized void stop ( ) { if ( ( daemonAcceptor ) != null ) { try { daemonAcceptor.close ( true ) . await ( ) ; com.google.gerrit.sshd.SshDaemon.sshDaemonLog.info ( "Stopped Gerrit SSHD" ) ; } catch ( java.lang.InterruptedException e ) { com.google.gerrit.sshd.SshDaemon.sshDaemonLog.warn ( "Exception caught while closing" , e ) ; } finally { daemonAcceptor = null ; } } }
Source:
protected void configure ( ) { bind ( java.util.concurrent.Executor.class ) . annotatedWith ( com.ericsson.gerrit.plugins.highavailability.event.EventExecutor.class ) . toProvider ( com.ericsson.gerrit.plugins.highavailability.event.EventExecutorProvider.class ) ; listener ( ) . to ( com.ericsson.gerrit.plugins.highavailability.event.EventExecutorProvider.class ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.common.EventListener.class ) . to ( com.ericsson.gerrit.plugins.highavailability.event.EventHandler.class ) ; }

Target:
protected void configure ( ) { bind ( java.util.concurrent.Executor.class ) . annotatedWith ( com.ericsson.gerrit.plugins.highavailability.event.EventExecutor.class ) . toProvider ( com.ericsson.gerrit.plugins.highavailability.event.EventExecutorProvider.class ) ; listener ( ) . to ( com.ericsson.gerrit.plugins.highavailability.event.EventExecutorProvider.class ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.server.events.EventListener.class ) . to ( com.ericsson.gerrit.plugins.highavailability.event.EventHandler.class ) ; }
Source:
public void deleteVoteFromReviewableChangeNotifyOwnerWithSelfCc ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; selfCc ( ) ; deleteVote ( sc , voter , NotifyHandling.OWNER ) ; assertThat ( sender ) . sent ( "deleteVote" , sc ) . to ( sc.owner ) . cc ( voter ) . notTo ( sc.reviewer , sc.ccer ) . notTo ( sc.reviewerByEmail , sc.ccerByEmail ) . notTo ( sc.starrer ) . notTo ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; }

Target:
public void deleteVoteFromReviewableChangeNotifyOwnerWithSelfCc ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; selfCc ( ) ; deleteVote ( sc , voter , NotifyHandling.OWNER ) ; assertThat ( sender ) . sent ( "deleteVote" , sc ) . to ( sc.owner ) . cc ( voter ) . noOneElse ( ) ; }
Source:
public void newPatchSetOnWipChangeNotifyAllInNoteDb ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isTrue ( ) ; com.google.gerrit.acceptance.server.mail.StagedChange sc = stageWipChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) ; pushTo ( sc , "refs/for/master%wip,notify=ALL" , sc.owner ) ; assertThat ( sender ) . sent ( "newpatchset" , sc ) . notTo ( sc.owner ) . to ( sc.reviewer ) . cc ( sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) ; }

Target:
public void newPatchSetOnWipChangeToReadyInNoteDb ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isTrue ( ) ; com.google.gerrit.acceptance.server.mail.StagedChange sc = stageWipChange ( ) ; pushTo ( sc , "refs/for/master%ready" , sc.owner ) ; assertThat ( sender ) . sent ( "newpatchset" , sc ) . to ( sc.reviewer ) . cc ( sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) . noOneElse ( ) ; }
Source:
private static java.util.Map < java.lang.String , java.lang.String > parseUrlAliases ( org.eclipse.jgit.lib.Config cfg , @ com.google.gerrit.common.Nullable org.eclipse.jgit.lib.Config defaultCfg ) { java.util.Map < java.lang.String , java.lang.String > urlAliases = com.google.gerrit.server.account.PreferencesConfig.urlAliases ( cfg ) ; if ( ( urlAliases == null ) && ( defaultCfg != null ) ) { urlAliases = com.google.gerrit.server.account.PreferencesConfig.urlAliases ( defaultCfg ) ; } return urlAliases ; }

Target:
private static java.util.Map < java.lang.String , java.lang.String > parseUrlAliases ( org.eclipse.jgit.lib.Config cfg , @ com.google.gerrit.common.Nullable org.eclipse.jgit.lib.Config defaultCfg ) { java.util.Map < java.lang.String , java.lang.String > urlAliases = com.google.gerrit.server.account.Preferences.urlAliases ( cfg ) ; if ( ( urlAliases == null ) && ( defaultCfg != null ) ) { urlAliases = com.google.gerrit.server.account.Preferences.urlAliases ( defaultCfg ) ; } return urlAliases ; }
Source:
public void missingRepo ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = com.google.gerrit.testutil.TestChanges.newChange ( new com.google.gerrit.reviewdb.client.Project.NameKey ( "otherproject" ) , userId ) ; db.changes ( ) . insert ( java.util.Collections.singleton ( c ) ) ; com.google.gerrit.reviewdb.client.PatchSet ps = com.google.gerrit.testutil.TestChanges.newPatchSet ( c.currentPatchSetId ( ) , org.eclipse.jgit.lib.ObjectId.fromString ( "deadbeefdeadbeefdeadbeefdeadbeefdeadbeef" ) , userId ) ; db.patchSets ( ) . insert ( java.util.Collections.singleton ( ps ) ) ; com.google.common.truth.Truth.assertThat ( checker.check ( c ) ) . containsExactly ( "Destination repository not found: otherproject" ) ; }

Target:
public void missingRepo ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = com.google.gerrit.testutil.TestChanges.newChange ( new com.google.gerrit.reviewdb.client.Project.NameKey ( "otherproject" ) , userId ) ; db.changes ( ) . insert ( java.util.Collections.singleton ( c ) ) ; com.google.gerrit.reviewdb.client.PatchSet ps = com.google.gerrit.testutil.TestChanges.newPatchSet ( c.currentPatchSetId ( ) , org.eclipse.jgit.lib.ObjectId.fromString ( "deadbeefdeadbeefdeadbeefdeadbeefdeadbeef" ) , userId ) ; db.patchSets ( ) . insert ( java.util.Collections.singleton ( ps ) ) ; assertProblems ( c , "Destination repository not found: otherproject" ) ; }
Source:
public void onFailure ( java.lang.Throwable err ) { if ( com.google.gerrit.client.changes.SubmitFailureDialog.isConflict ( err ) ) { new com.google.gerrit.client.changes.SubmitFailureDialog ( err.getMessage ( ) ) . center ( ) ; com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( id ) ) ; } else { super . onFailure ( err ) ; } }

Target:
public void onClick ( final com.google.gwt.event.dom.client.ClickEvent event ) { b.setEnabled ( false ) ; final com.google.gerrit.reviewdb.client.Change.Id id = patchSet.getId ( ) . getParentKey ( ) ; com.google.gerrit.client.changes.ChangeApi.publish ( id.get ( ) , patchSet.getRevision ( ) . get ( ) , com.google.gerrit.client.change.DraftActions.cs ( id ) ) ; }
Source:
public com.google.gerrit.server.project.ProjectState getParentState ( ) { if ( isAllProjects ) { return null ; } return projectCache.get ( getProject ( ) . getParent ( allProjectsName ) ) ; }

Target:
private boolean getInheritableBoolean ( com.google.common.base.Function < com.google.gerrit.reviewdb.client.Project , com.google.gerrit.reviewdb.client.Project.InheritableBoolean > func ) { for ( com.google.gerrit.server.project.ProjectState s : tree ( ) ) { switch ( func.apply ( s.getProject ( ) ) ) { case TRUE : return true ; case FALSE : return false ; case INHERIT : default : continue ; } } return false ; }
Source:
protected java.lang.String velocify ( java.lang.String tpl ) throws com.google.gerrit.server.mail.EmailException { try { java.io.StringWriter w = new java.io.StringWriter ( ) ; org.apache.velocity.app.Velocity.evaluate ( velocityContext , w , "OutgoingEmail" , tpl ) ; return w.toString ( ) ; } catch ( java.lang.Exception e ) { throw new com.google.gerrit.server.mail.EmailException ( ( "Velocity template " + ( tpl.toString ( ) ) ) , e ) ; } }

Target:
protected java.lang.String velocify ( java.lang.String template ) throws com.google.gerrit.server.mail.EmailException { try { java.io.StringWriter w = new java.io.StringWriter ( ) ; org.apache.velocity.app.Velocity.evaluate ( velocityContext , w , "OutgoingEmail" , template ) ; return w.toString ( ) ; } catch ( java.lang.Exception e ) { throw new com.google.gerrit.server.mail.EmailException ( ( "Velocity template " + template ) , e ) ; } }
Source:
private static java.lang.String defaultOf ( com.google.gerrit.reviewdb.client.Project proj ) { return com.google.common.base.Objects.firstNonNull ( proj.getLocalDefaultDashboard ( ) , com.google.common.base.Strings.nullToEmpty ( proj.getDefaultDashboard ( ) ) ) ; }

Target:
private static java.lang.String defaultOf ( com.google.gerrit.reviewdb.client.Project proj ) { final java.lang.String defaultId = com.google.common.base.Objects.firstNonNull ( proj.getLocalDefaultDashboard ( ) , com.google.common.base.Strings.nullToEmpty ( proj.getDefaultDashboard ( ) ) ) ; if ( defaultId.startsWith ( com.google.gerrit.server.git.GitRepositoryManager.REFS_DASHBOARDS ) ) { return defaultId.substring ( com.google.gerrit.server.git.GitRepositoryManager.REFS_DASHBOARDS.length ( ) ) ; } else { return defaultId ; } }
Source:
public void run ( ) { if ( ( ( getSelectedTheme ( ) ) == newTheme ) && ( isAttached ( ) ) ) { java.lang.String t = newTheme.name ( ) . toLowerCase ( ) ; view.getCmFromSide ( DisplaySide.A ) . setOption ( "theme" , t ) ; view.getCmFromSide ( DisplaySide.B ) . setOption ( "theme" , t ) ; view.setThemeStyles ( newTheme.isDark ( ) ) ; } }

Target:
void onLineWrapping ( com.google.gwt.event.logical.shared.ValueChangeEvent < java.lang.Boolean > e ) { prefs.lineWrapping ( e.getValue ( ) ) ; view.getCmFromSide ( DisplaySide.A ) . setOption ( "lineWrapping" , prefs.lineWrapping ( ) ) ; view.getCmFromSide ( DisplaySide.B ) . setOption ( "lineWrapping" , prefs.lineWrapping ( ) ) ; }
Source:
private void cherryPickOne ( com.google.gerrit.server.git.CodeReviewCommit n , com.google.gerrit.server.git.MergeTip mergeTip ) throws com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException , java.io.IOException { try { com.google.gerrit.server.git.CodeReviewCommit merge = writeCherryPickCommit ( mergeTip.getCurrentTip ( ) , n ) ; mergeTip.moveTipTo ( merge , merge ) ; newCommits.put ( mergeTip.getCurrentTip ( ) . getPatchsetId ( ) . getParentKey ( ) , mergeTip.getCurrentTip ( ) ) ; } catch ( com.google.gerrit.server.git.MergeConflictException mce ) { n.setStatusCode ( CommitMergeStatus.PATH_CONFLICT ) ; } catch ( com.google.gerrit.server.git.MergeIdenticalTreeException mie ) { n.setStatusCode ( CommitMergeStatus.ALREADY_MERGED ) ; } }

Target:
public void updateRepo ( com.google.gerrit.server.git.BatchUpdate.RepoContext ctx ) { toMerge.setStatusCode ( CommitMergeStatus.CANNOT_CHERRY_PICK_ROOT ) ; }
Source:
public void parseReviewer ( ) throws java.lang.Exception { assertParseSucceeds ( ( "Update change\n" + ( ( ( ( ( ( "\n" + "Branch: refs/heads/master\n" ) + "Change-id: I577fb248e474018276351785930358ec0450e9f7\n" ) + "Patch-set: 1\n" ) + "Reviewer: Change Owner <1@gerrit>\n" ) + "CC: Other Account <2@gerrit>\n" ) + "Subject: This is a test change\n" ) ) ) ; assertParseFails ( ( "Update change\n" + ( ( "\n" + "Patch-set: 1\n" ) + "Reviewer: 1@gerrit\n" ) ) ) ; }

Target:
public void parseTopic ( ) throws java.lang.Exception { assertParseSucceeds ( ( "Update change\n" + ( ( ( ( ( "\n" + "Branch: refs/heads/master\n" ) + "Change-id: I577fb248e474018276351785930358ec0450e9f7\n" ) + "Patch-set: 1\n" ) + "Topic: Some Topic\n" ) + "Subject: This is a test change\n" ) ) ) ; assertParseSucceeds ( ( "Update change\n" + ( ( ( ( ( "\n" + "Branch: refs/heads/master\n" ) + "Change-id: I577fb248e474018276351785930358ec0450e9f7\n" ) + "Patch-set: 1\n" ) + "Topic:\n" ) + "Subject: This is a test change\n" ) ) ) ; assertParseFails ( "Update change\n\nPatch-set: 1\nTopic: Some Topic\nTopic: Other Topic" ) ; }
Source:
public void optionsArgumentOverridesAllLimitPredicates ( ) throws java.lang.Exception { com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > in = parse ( "limit:1 file:a limit:3" ) ; com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > out = rewrite ( in , com.google.gerrit.server.index.change.ChangeIndexRewriterTest.options ( 0 , 5 ) ) ; com.google.common.truth.Truth.assertThat ( out.getClass ( ) ) . isEqualTo ( com.google.gerrit.server.query.change.AndChangeSource.class ) ; com.google.common.truth.Truth.assertThat ( out.getChildren ( ) ) . containsExactly ( query ( in.getChild ( 1 ) , 5 ) , parse ( "limit:5" ) , parse ( "limit:5" ) ) . inOrder ( ) ; }

Target:
public void optionsArgumentOverridesAllLimitPredicates ( ) throws java.lang.Exception { com.google.gerrit.index.query.Predicate < com.google.gerrit.server.query.change.ChangeData > in = parse ( "limit:1 file:a limit:3" ) ; com.google.gerrit.index.query.Predicate < com.google.gerrit.server.query.change.ChangeData > out = rewrite ( in , com.google.gerrit.server.index.change.ChangeIndexRewriterTest.options ( 0 , 5 ) ) ; com.google.common.truth.Truth.assertThat ( out.getClass ( ) ) . isEqualTo ( com.google.gerrit.server.query.change.AndChangeSource.class ) ; com.google.common.truth.Truth.assertThat ( out.getChildren ( ) ) . containsExactly ( query ( in.getChild ( 1 ) , 5 ) , parse ( "limit:5" ) , parse ( "limit:5" ) ) . inOrder ( ) ; }
Source:
void onMatchBrackets ( com.google.gwt.event.logical.shared.ValueChangeEvent < java.lang.Boolean > e ) { prefs.matchBrackets ( e.getValue ( ) ) ; view.getCmFromSide ( DisplaySide.A ) . setOption ( "matchBrackets" , prefs.matchBrackets ( ) ) ; view.getCmFromSide ( DisplaySide.B ) . setOption ( "matchBrackets" , prefs.matchBrackets ( ) ) ; }

Target:
public void run ( ) { boolean s = prefs.showWhitespaceErrors ( ) ; for ( net.codemirror.lib.CodeMirror cm : view.getCms ( ) ) { cm.setOption ( "showTrailingSpace" , s ) ; } }
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 { if ( ! ( sitePaths.tmp_dir.exists ( ) ) ) { sitePaths.tmp_dir.mkdirs ( ) ; } return com.google.gerrit.server.plugins.PluginLoader.asTemp ( in , com.google.gerrit.server.plugins.JarPluginProvider.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 ( ! ( java.nio.file.Files.exists ( sitePaths.tmp_dir ) ) ) { java.nio.file.Files.createDirectories ( sitePaths.tmp_dir ) ; } return com.google.gerrit.server.plugins.PluginLoader.asTemp ( in , com.google.gerrit.server.plugins.JarPluginProvider.tempNameFor ( pluginName ) , ".jar" , sitePaths.tmp_dir.toFile ( ) ) ; }
Source:
private static com.google.gerrit.server.change.GetRelated.ChangeAndCommit changeAndCommit ( java.lang.String changeId , org.eclipse.jgit.lib.ObjectId commitId , int revisionNum , int currentRevisionNum ) { com.google.gerrit.server.change.GetRelated.ChangeAndCommit result = new com.google.gerrit.server.change.GetRelated.ChangeAndCommit ( ) ; result.changeId = changeId ; result.commit = new com.google.gerrit.extensions.common.CommitInfo ( ) ; result.commit.commit = commitId.name ( ) ; result._revisionNumber = revisionNum ; result._currentRevisionNumber = currentRevisionNum ; result.status = "NEW" ; return result ; }

Target:
private static com.google.gerrit.server.change.GetRelated.ChangeAndCommit changeAndCommit ( com.google.gerrit.reviewdb.client.PatchSet.Id psId , org.eclipse.jgit.lib.ObjectId commitId , int currentRevisionNum ) { com.google.gerrit.server.change.GetRelated.ChangeAndCommit result = new com.google.gerrit.server.change.GetRelated.ChangeAndCommit ( ) ; result._changeNumber = psId.getParentKey ( ) . get ( ) ; result.commit = new com.google.gerrit.extensions.common.CommitInfo ( ) ; result.commit.commit = commitId.name ( ) ; result._revisionNumber = psId.get ( ) ; result._currentRevisionNumber = currentRevisionNum ; result.status = "NEW" ; return result ; }
Source:
private java.util.List < com.google.gerrit.common.data.PermissionRule > getRules ( java.lang.String permissionName ) { java.util.List < com.google.gerrit.common.data.PermissionRule > rules = capabilities.getPermission ( permissionName ) ; com.google.gerrit.server.account.GroupMembership groups = user.getEffectiveGroups ( ) ; java.util.List < com.google.gerrit.common.data.PermissionRule > mine = new java.util.ArrayList ( rules.size ( ) ) ; for ( com.google.gerrit.common.data.PermissionRule rule : rules ) { if ( com.google.gerrit.server.account.CapabilityControl.match ( groups , rule ) ) { mine.add ( rule ) ; } } return mine ; }

Target:
private java.util.List < com.google.gerrit.common.data.PermissionRule > getRules ( java.lang.String permissionName ) { java.util.List < com.google.gerrit.common.data.PermissionRule > rules = capabilities.getPermission ( permissionName ) ; com.google.gerrit.server.account.GroupMembership groups = user.getEffectiveGroups ( ) ; java.util.List < com.google.gerrit.common.data.PermissionRule > mine = new java.util.ArrayList ( rules.size ( ) ) ; for ( com.google.gerrit.common.data.PermissionRule rule : rules ) { if ( com.google.gerrit.server.account.AccountLimits.match ( groups , rule ) ) { mine.add ( rule ) ; } } return mine ; }
Source:
public final com.google.gerrit.gpg.CheckResult check ( org.bouncycastle.openpgp.PGPPublicKey key ) { return check ( key , null , 0 , false , null ) ; }

Target:
public final com.google.gerrit.gpg.CheckResult check ( org.bouncycastle.openpgp.PGPPublicKey key ) { if ( ( ( store ) == null ) && ( ( trusted ) != null ) ) { throw new java.lang.IllegalStateException ( "PublicKeyStore is required" ) ; } return check ( key , 0 , true , ( ( trusted ) != null ? new java.util.HashSet < com.google.gerrit.gpg.Fingerprint > ( ) : null ) ) ; }
Source:
protected void onUnload ( ) { super . onUnload ( ) ; removeKeyHandlerRegs ( ) ; if ( ( resizeHandler ) != null ) { resizeHandler.removeHandler ( ) ; resizeHandler = null ; } if ( ( cmA ) != null ) { cmA.getWrapperElement ( ) . removeFromParent ( ) ; cmA = null ; } if ( ( cmB ) != null ) { cmB.getWrapperElement ( ) . removeFromParent ( ) ; cmB = null ; } com.google.gwt.user.client.Window.enableScrolling ( true ) ; }

Target:
net.codemirror.lib.CodeMirror getCmA ( ) { return cmA ; }
Source:
public void setFrom ( final com.google.gerrit.reviewdb.Account.Id id ) { super . setFrom ( id ) ; final com.google.gerrit.server.IdentifiedUser user = args.identifiedUserFactory.create ( id ) ; final java.util.Set < com.google.gerrit.reviewdb.AccountGroup.UUID > gids = user.getEffectiveGroups ( ) ; for ( final com.google.gerrit.reviewdb.AccountGroup.UUID gid : gids ) { com.google.gerrit.reviewdb.AccountGroup group = args.groupCache.get ( gid ) ; if ( ( group != null ) && ( group.isEmailOnlyAuthors ( ) ) ) { emailOnlyAuthors = true ; break ; } } }

Target:
public void setFrom ( final com.google.gerrit.reviewdb.client.Account.Id id ) { super . setFrom ( id ) ; final com.google.gerrit.server.IdentifiedUser user = args.identifiedUserFactory.create ( id ) ; emailOnlyAuthors = ! ( user.getCapabilities ( ) . canEmailReviewers ( ) ) ; }
Source:
public java.lang.Iterable < com.google.gerrit.extensions.common.WebLinkInfo > getProjectLinks ( java.lang.String project ) { java.util.List < com.google.gerrit.extensions.common.WebLinkInfo > links = com.google.common.collect.Lists.newArrayList ( ) ; for ( com.google.gerrit.extensions.webui.ProjectWebLink webLink : projectLinks ) { links.add ( new com.google.gerrit.extensions.common.WebLinkInfo ( webLink.getLinkName ( ) , webLink.getImageUrl ( ) , webLink.getProjectUrl ( project ) , webLink.getTarget ( ) ) ) ; } return links ; }

Target:
public com.google.gerrit.extensions.common.WebLinkInfo apply ( com.google.gerrit.extensions.webui.WebLink webLink ) { return ( ( com.google.gerrit.extensions.webui.ProjectWebLink ) ( webLink ) ) . getProjectWeblink ( project ) ; }
Source:
public void updateChange ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx ) throws java.lang.Exception { ctx.getUpdate ( ps.getId ( ) ) . setTopic ( magicBranch.topic ) ; }

Target:
public void run ( ) { try { com.google.gerrit.server.mail.MergedSender cm = mergedSenderFactory.create ( ps.getId ( ) . getParentKey ( ) ) ; cm.setFrom ( user.getAccountId ( ) ) ; cm.setPatchSet ( ps , info ) ; cm.send ( ) ; } catch ( java.lang.Exception e ) { com.google.gerrit.server.git.ReceiveCommits.log.error ( ( "Cannot send email for submitted patch set " + ( ps.getId ( ) ) ) , e ) ; } }
Source:
private java.util.List < com.google.gerrit.reviewdb.client.PatchSetApproval > safeGetApprovals ( com.google.gerrit.server.git.CodeReviewCommit n ) { try { return approvalsUtil.byPatchSet ( db.get ( ) , n.notes ( ) , n.patchsetId ) ; } catch ( com.google.gwtorm.server.OrmException e ) { com.google.gerrit.server.git.MergeUtil.log.error ( ( "Can't read approval records for " + ( n.patchsetId ) ) , e ) ; return java.util.Collections.emptyList ( ) ; } }

Target:
private java.util.List < com.google.gerrit.reviewdb.client.PatchSetApproval > safeGetApprovals ( com.google.gerrit.server.git.CodeReviewCommit n ) { try { return approvalsUtil.byPatchSet ( db.get ( ) , n.notes ( ) , n.getPatchsetId ( ) ) ; } catch ( com.google.gwtorm.server.OrmException e ) { com.google.gerrit.server.git.MergeUtil.log.error ( ( "Can't read approval records for " + ( n.getPatchsetId ( ) ) ) , e ) ; return java.util.Collections.emptyList ( ) ; } }
Source:
public void testPushForMaster ( ) throws com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { com.google.gerrit.acceptance.git.PushForReviewIT.PushOneCommit push = new com.google.gerrit.acceptance.git.PushForReviewIT.PushOneCommit ( ) ; java.lang.String ref = "refs/for/master" ; org.eclipse.jgit.transport.PushResult r = push.to ( ref ) ; com.google.gerrit.acceptance.git.PushForReviewIT.assertOkStatus ( r , ref ) ; assertChange ( push.changeId , Change.Status.NEW , com.google.gerrit.acceptance.git.PushForReviewIT.PushOneCommit.SUBJECT , null ) ; }

Target:
public void testPushForMasterWithTopic ( ) throws com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { java.lang.String topic = "my/topic" ; com.google.gerrit.acceptance.git.PushOneCommit.Result r = pushTo ( ( "refs/for/master/" + topic ) ) ; r.assertOkStatus ( ) ; r.assertChange ( Change.Status.NEW , topic ) ; r = pushTo ( ( "refs/for/master%topic=" + topic ) ) ; r.assertOkStatus ( ) ; r.assertChange ( Change.Status.NEW , topic ) ; }
Source:
public boolean equals ( java.lang.Object other ) { if ( other == null ) { return false ; } if ( ( getClass ( ) ) == ( other.getClass ( ) ) ) { final com.google.gerrit.server.query.IntPredicate < ? > p = ( ( com.google.gerrit.server.query.IntPredicate < ? > ) ( other ) ) ; return ( com.google.gerrit.server.query.IntPredicate.getOperator ( ) . equals ( p.getOperator ( ) ) ) && ( ( intValue ( ) ) == ( p.intValue ( ) ) ) ; } return false ; }

Target:
public boolean equals ( java.lang.Object other ) { if ( other == null ) { return false ; } if ( ( getClass ( ) ) == ( other.getClass ( ) ) ) { final com.google.gerrit.index.query.IntPredicate < ? > p = ( ( com.google.gerrit.index.query.IntPredicate < ? > ) ( other ) ) ; return ( com.google.gerrit.index.query.IntPredicate.getOperator ( ) . equals ( p.getOperator ( ) ) ) && ( ( intValue ( ) ) == ( p.intValue ( ) ) ) ; } return false ; }
Source:
public java.lang.String [ ] getList ( java.lang.String section , java.lang.String subsection , java.lang.String name ) { return sec.getStringList ( section , subsection , name ) ; }

Target:
public java.lang.String [ ] getList ( java.lang.String section , java.lang.String subsection , java.lang.String name ) { return java.util.Arrays.stream ( sec.getStringList ( section , subsection , name ) ) . map ( codec :: decode ) . toArray ( java.lang.String [ ] :: new ) ; }
Source:
public java.lang.Boolean callImpl ( com.google.inject.Provider < com.google.gerrit.reviewdb.server.ReviewDb > db ) throws java.lang.Exception { if ( ! ( stalenessChecker.isStale ( id ) ) ) { return false ; } index ( newChangeData ( db.get ( ) , project , id ) ) ; return true ; }

Target:
public java.lang.Boolean callImpl ( com.google.inject.Provider < com.google.gerrit.reviewdb.server.ReviewDb > db ) throws java.lang.Exception { try { if ( stalenessChecker.isStale ( id ) ) { index ( newChangeData ( db.get ( ) , project , id ) ) ; return true ; } } catch ( com.google.gerrit.server.project.NoSuchChangeException e ) { com.google.gerrit.server.index.change.ChangeIndexer.log.debug ( "Change was deleted, aborting reindexing the change." , id.get ( ) ) ; } return false ; }
Source:
public void unblockRangeForChangeOwner ( ) { com.google.gerrit.server.project.Util.allow ( local , ( ( com.google.gerrit.common.data.Permission.LABEL ) + "Code-Review" ) , ( - 2 ) , ( + 2 ) , com.google.gerrit.server.group.SystemGroupBackend.CHANGE_OWNER , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = user ( local , com.google.gerrit.server.project.Util.DEVS ) ; com.google.gerrit.common.data.PermissionRange range = u.controlForRef ( "refs/heads/master" ) . getRange ( ( ( com.google.gerrit.common.data.Permission.LABEL ) + "Code-Review" ) , true ) ; assertCanVote ( ( - 2 ) , range ) ; assertCanVote ( 2 , range ) ; }

Target:
public void unblockRangeForChangeOwner ( ) { com.google.gerrit.server.project.testing.Util.allow ( local , ( ( com.google.gerrit.common.data.Permission.LABEL ) + "Code-Review" ) , ( - 2 ) , ( + 2 ) , com.google.gerrit.server.group.SystemGroupBackend.CHANGE_OWNER , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = user ( local , com.google.gerrit.server.project.testing.Util.DEVS ) ; com.google.gerrit.common.data.PermissionRange range = u.controlForRef ( "refs/heads/master" ) . getRange ( ( ( com.google.gerrit.common.data.Permission.LABEL ) + "Code-Review" ) , true ) ; assertCanVote ( ( - 2 ) , range ) ; assertCanVote ( 2 , range ) ; }
Source:
private java.nio.file.Path webappSourcePath ( java.lang.String name ) { com.google.gerrit.httpd.raw.StaticModule.Paths p = getPaths ( ) ; if ( ( p.unpackedWar ) != null ) { return p.unpackedWar.resolve ( name ) ; } return p.buckOut.resolveSibling ( "gerrit-war" ) . resolve ( "src" ) . resolve ( "main" ) . resolve ( "webapp" ) . resolve ( name ) ; }

Target:
private java.nio.file.Path webappSourcePath ( java.lang.String name ) { com.google.gerrit.httpd.raw.StaticModule.Paths p = getPaths ( ) ; if ( ( p.unpackedWar ) != null ) { return p.unpackedWar.resolve ( name ) ; } return p.sourceRoot.resolve ( ( "gerrit-war/src/main/webapp/" + name ) ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.enabled ( ) ) . isFalse ( ) ; testRepo = new org.eclipse.jgit.junit.TestRepository ( ( ( org.eclipse.jgit.internal.storage.dfs.InMemoryRepository ) ( repoManager.openRepository ( project ) ) ) ) ; tip = testRepo.getRevWalk ( ) . parseCommit ( testRepo.getRepository ( ) . exactRef ( "HEAD" ) . getObjectId ( ) ) ; adminId = admin.getId ( ) ; checker = checkerProvider.get ( ) ; }

Target:
public void missingRepo ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.enabled ( ) ) . isFalse ( ) ; com.google.gerrit.server.project.ChangeControl ctl = insertChange ( ) ; com.google.gerrit.reviewdb.client.Project.NameKey name = ctl.getProject ( ) . getNameKey ( ) ; ( ( com.google.gerrit.testutil.InMemoryRepositoryManager ) ( repoManager ) ) . deleteRepository ( name ) ; assertProblems ( ctl , null , com.google.gerrit.acceptance.server.change.ConsistencyCheckerIT.problem ( ( "Destination repository not found: " + name ) ) ) ; }
Source:
public com.google.gerrit.reviewdb.client.Change reloadChange ( ) throws com.google.gwtorm.server.OrmException { HEAD ( 685 ) ; com.google.gerrit.server.query.change.b5b Merge ; }

Target:
public com.google.gerrit.reviewdb.client.Change reloadChange ( ) throws com.google.gwtorm.server.OrmException { notes = notesFactory.create ( db , project , legacyId ) ; change = notes.getChange ( ) ; if ( ( change ) == null ) { throw new com.google.gwtorm.server.OrmException ( ( "Unable to load change " + ( legacyId ) ) ) ; } return change ; }
Source:
protected void configure ( ) { bind ( com.google.gerrit.httpd.ProjectServlet.Resolver.class ) ; bind ( com.google.gerrit.httpd.ProjectServlet.Upload.class ) ; bind ( com.google.gerrit.httpd.ProjectServlet.Receive.class ) ; }

Target:
protected void configure ( ) { bind ( com.google.gerrit.httpd.ProjectServlet.Resolver.class ) ; bind ( com.google.gerrit.httpd.ProjectServlet.Upload.class ) ; bind ( com.google.gerrit.httpd.ProjectServlet.Receive.class ) ; bind ( com.google.gerrit.httpd.ProjectServlet.ReceiveFilter.class ) ; install ( new com.google.gerrit.server.cache.CacheModule ( ) { @ java.lang.Override protected void configure ( ) { com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < com.google.gerrit.httpd.AdvertisedObjectsCacheKey , java.util.Set < org.eclipse.jgit.lib.ObjectId > > > cache = new com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < com.google.gerrit.httpd.AdvertisedObjectsCacheKey , java.util.Set < org.eclipse.jgit.lib.ObjectId > > > ( ) { } ; core ( cache , com.google.gerrit.httpd.ProjectServlet.ID_CACHE ) . memoryLimit ( 4096 ) . maxAge ( 10 , java.util.concurrent.TimeUnit.MINUTES ) ; } } ) ; }
Source:
public void testDeleteOneNotExisting ( ) throws com.google.gwtorm.client.OrmException , java.sql.SQLException { stubExecuteBatchOK ( com.google.gwtorm.jdbc.TestJdbcAccess.DELETE , 0 ) ; try { createClassUnderTest ( ) . delete ( com.google.gwtorm.jdbc.TestJdbcAccess.ONE_ROW ) ; org.junit.Assert.fail ( "missing OrmConcurrencyException" ) ; } catch ( com.google.gwtorm.client.OrmConcurrencyException e ) { } }

Target:
public void testUpdateOneDBException ( ) throws com.google.gwtorm.server.OrmException , java.sql.SQLException { java.sql.SQLException exception = new java.sql.BatchUpdateException ( ) ; java.sql.PreparedStatement update = stubStatementThrowExceptionOnExecute ( com.google.gwtorm.jdbc.TestJdbcAccess.UPDATE , exception ) ; com.google.gwtorm.jdbc.JdbcAccess < com.google.gwtorm.jdbc.TestJdbcAccess.Data , com.google.gwtorm.jdbc.TestJdbcAccess.Data.DataKey > classUnderTest = createClassUnderTest ( ) ; try { classUnderTest.update ( oneRow ) ; org.junit.Assert.fail ( "missingException" ) ; } catch ( com.google.gwtorm.server.OrmException e ) { org.junit.Assert.assertSame ( e.getCause ( ) , exception ) ; } com.google.gwtorm.jdbc.TestJdbcAccess.assertUsedBatchingOnly ( update ) ; }
Source:
public com.google.gerrit.server.project.ProjectResource parse ( java.lang.String id , boolean checkVisibility ) throws com.google.gerrit.extensions.restapi.UnprocessableEntityException , java.io.IOException { com.google.gerrit.server.project.ProjectResource rsrc = _parse ( id , checkVisibility ) ; if ( rsrc == null ) { throw new com.google.gerrit.extensions.restapi.UnprocessableEntityException ( java.lang.String.format ( "Project Not Found: %s" , id ) ) ; } return rsrc ; }

Target:
public com.google.gerrit.server.project.ProjectResource parse ( java.lang.String id , boolean checkAccess ) throws com.google.gerrit.extensions.restapi.UnprocessableEntityException , com.google.gerrit.server.permissions.PermissionBackendException , java.io.IOException { com.google.gerrit.server.project.ProjectResource rsrc = _parse ( id , checkAccess ) ; if ( rsrc == null ) { throw new com.google.gerrit.extensions.restapi.UnprocessableEntityException ( java.lang.String.format ( "Project Not Found: %s" , id ) ) ; } return rsrc ; }
Source:
private java.util.Map < java.lang.String , com.google.common.cache.Cache < ? , ? > > sortedCoreCaches ( ) { java.util.SortedMap < java.lang.String , com.google.common.cache.Cache < ? , ? > > m = com.google.common.collect.Maps.newTreeMap ( ) ; for ( java.util.Map.Entry < java.lang.String , com.google.inject.Provider < com.google.common.cache.Cache < ? , ? > > > entry : cacheMap.byPlugin ( "gerrit" ) . entrySet ( ) ) { m.put ( cacheNameOf ( "gerrit" , entry.getKey ( ) ) , entry.getValue ( ) . get ( ) ) ; } return m ; }

Target:
private void printMemoryPluginCaches ( java.util.Collection < com.google.gerrit.server.config.ListCaches.CacheInfo > caches ) { for ( com.google.gerrit.server.config.ListCaches.CacheInfo cache : caches ) { if ( ( cache.name.contains ( "-" ) ) && ( CacheType.MEM.equals ( cache.type ) ) ) { printCache ( cache ) ; } } }