auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private java.nio.file.Path moveToTrash ( java.nio.file.Path directory , com.google.gerrit.reviewdb.client.Project.NameKey nameKey ) throws java.io.IOException { java.io.File trashRepo = new java.io.File ( gitDir , ( ( ( ( nameKey.get ( ) ) + "." ) + ( java.lang.System.currentTimeMillis ( ) ) ) + ".deleted" ) ) ; return java.nio.file.Files.move ( directory , trashRepo.toPath ( ) , java.nio.file.StandardCopyOption.ATOMIC_MOVE ) ; }

Target:
private java.nio.file.Path moveToTrash ( java.nio.file.Path directory , com.google.gerrit.reviewdb.client.Project.NameKey nameKey ) throws java.io.IOException { java.nio.file.Path trashRepo = gitDir.resolve ( ( ( ( ( nameKey.get ( ) ) + "." ) + ( java.lang.System.currentTimeMillis ( ) ) ) + ".deleted" ) ) ; return java.nio.file.Files.move ( directory , trashRepo , java.nio.file.StandardCopyOption.ATOMIC_MOVE ) ; }
Source:
private java.lang.String link ( final com.google.gerrit.reviewdb.client.Project item ) { return com.google.gerrit.client.Dispatcher.toProjectAdmin ( item.getNameKey ( ) , ProjectScreen.INFO ) ; }

Target:
protected void populate ( final int row , final com.google.gerrit.client.projects.ProjectInfo k ) { table.setWidget ( row , 1 , new com.google.gerrit.client.ui.Hyperlink ( k.name ( ) , link ( k ) ) ) ; table.setText ( row , 2 , k.description ( ) ) ; setRowItem ( row , k ) ; }
Source:
private static void init ( ) { if ( ( com.google.gwtexpui.globalkey.client.GlobalKey.keys ) == null ) { com.google.gwtexpui.globalkey.client.GlobalKey.keys = new com.google.gwtexpui.globalkey.client.KeyCommandSet ( ) ; com.google.gwtexpui.globalkey.client.DocWidget.get ( ) . addKeyPressHandler ( com.google.gwtexpui.globalkey.client.GlobalKey.keys ) ; com.google.gwtexpui.globalkey.client.GlobalKey.keyApplication = new com.google.gwtexpui.globalkey.client.KeyCommandSet ( Util.C.applicationSection ( ) ) ; com.google.gwtexpui.globalkey.client.GlobalKey.keyApplication.add ( new com.google.gwtexpui.globalkey.client.ShowHelpCommand ( ) ) ; com.google.gwtexpui.globalkey.client.GlobalKey.keys.add ( com.google.gwtexpui.globalkey.client.GlobalKey.keyApplication ) ; } }

Target:
private static void initEvents ( ) { if ( ( com.google.gwtexpui.globalkey.client.GlobalKey.active ) == null ) { com.google.gwtexpui.globalkey.client.DocWidget.get ( ) . addKeyPressHandler ( new com.google.gwt.event.dom.client.KeyPressHandler ( ) { @ java.lang.Override public void onKeyPress ( final com.google.gwt.event.dom.client.KeyPressEvent event ) { com.google.gwtexpui.globalkey.client.GlobalKey.active.all.onKeyPress ( event ) ; } } ) ; com.google.gwtexpui.globalkey.client.GlobalKey.global = new com.google.gwtexpui.globalkey.client.GlobalKey.State ( null ) ; com.google.gwtexpui.globalkey.client.GlobalKey.active = com.google.gwtexpui.globalkey.client.GlobalKey.global ; } }
Source:
public com.google.gerrit.server.notedb.ChangeNotes create ( 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 { com.google.gerrit.reviewdb.client.Change change = com.google.gerrit.server.notedb.ChangeNotes.Factory.unwrap ( db ) . changes ( ) . get ( changeId ) ; com.google.common.base.Preconditions.checkArgument ( ( change != null ) , "change %s not found in ReviewDb" , changeId ) ; com.google.common.base.Preconditions.checkArgument ( change.getProject ( ) . equals ( project ) , ( "passed project %s when creating ChangeNotes for %s, but actual" + " project is %s" ) , project , changeId , change.getProject ( ) ) ; return new com.google.gerrit.server.notedb.ChangeNotes ( args , project , change ) . load ( ) ; }

Target:
public com.google.gerrit.server.notedb.ChangeNotes create ( 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 { com.google.gerrit.reviewdb.client.Change change = com.google.gerrit.server.notedb.ChangeNotes.Factory.unwrap ( db ) . changes ( ) . get ( changeId ) ; com.google.common.base.Preconditions.checkNotNull ( change , "change %s not found in ReviewDb" , changeId ) ; com.google.common.base.Preconditions.checkArgument ( change.getProject ( ) . equals ( project ) , ( "passed project %s when creating ChangeNotes for %s, but actual" + " project is %s" ) , project , changeId , change.getProject ( ) ) ; return new com.google.gerrit.server.notedb.ChangeNotes ( args , project , change ) . load ( ) ; }
Source:
public void testCreate ( ) { final java.lang.String find = "find" ; final java.lang.String replace = "replace" ; final com.google.gwtexpui.safehtml.client.RegexFindReplace a = new com.google.gwtexpui.safehtml.client.RegexFindReplace ( find , replace ) ; assertSame ( find , a.find ( ) ) ; assertSame ( replace , a.replace ( ) ) ; assertEquals ( ( ( ( "find = " + find ) + ", replace = " ) + replace ) , a.toString ( ) ) ; }

Target:
public void testFindReplace ( ) { final java.lang.String find = "find" ; final java.lang.String replace = "replace" ; final com.google.gwtexpui.safehtml.client.RawFindReplace a = new com.google.gwtexpui.safehtml.client.RawFindReplace ( find , replace ) ; assertEquals ( find , a.pattern ( ) . getSource ( ) ) ; assertEquals ( replace , a.replace ( find ) ) ; assertEquals ( ( ( ( "find = " + find ) + ", replace = " ) + replace ) , a.toString ( ) ) ; }
Source:
public java.lang.String string ( final java.lang.String title , java.lang.String name , java.lang.String dv , boolean nullIfDefault ) { final java.lang.String ov = get ( name ) ; java.lang.String nv = ui.readString ( ( ov != null ? ov : dv ) , "%s" , title ) ; if ( nullIfDefault && ( nv.equals ( dv ) ) ) { nv = null ; } if ( ! ( com.google.gerrit.pgm.init.api.Section.eq ( ov , nv ) ) ) { set ( name , nv ) ; } return nv ; }

Target:
public java.lang.String string ( final java.lang.String title , java.lang.String name , java.lang.String dv , boolean nullIfDefault ) { final java.lang.String ov = get ( name ) ; java.lang.String nv = ui.readString ( ( ov != null ? ov : dv ) , "%s" , title ) ; if ( nullIfDefault && ( nv.equals ( dv ) ) ) { nv = null ; } if ( ! ( java.util.Objects.equals ( ov , nv ) ) ) { set ( name , nv ) ; } return nv ; }
Source:
public com.google.gerrit.server.git.BatchUpdate getUpdate ( ) { com.google.common.base.Preconditions.checkState ( ( ( db ) != null ) , "call setContext before getUpdate" ) ; if ( ( update ) == null ) { update = batchUpdateFactory.create ( db , getProjectName ( ) , caller , ts ) . setRepository ( repo , rw , ins ) . setRequestId ( submissionId ) ; } return update ; }

Target:
public com.google.gerrit.server.git.BatchUpdate getUpdate ( ) { com.google.common.base.Preconditions.checkState ( ( ( db ) != null ) , "call setContext before getUpdate" ) ; if ( ( update ) == null ) { update = batchUpdateFactory.create ( db , getProjectName ( ) , caller , ts ) . setRepository ( repo , rw , ins ) . setRequestId ( submissionId ) . setOnSubmitValidators ( onSubmitValidatorsFactory.create ( ) ) ; } return update ; }
Source:
public void onSuccess ( com.google.gwtjsonrpc.client.VoidResult result ) { box.hide ( ) ; }

Target:
public void onSuccess ( com.google.gerrit.reviewdb.Account currentUser ) { box.hide ( ) ; if ( ( com.google.gerrit.client.Gerrit.getConfig ( ) . getAuthType ( ) ) == ( com.google.gerrit.reviewdb.AuthType.DEVELOPMENT_BECOME_ANY_ACCOUNT ) ) { currentEmail = addr ; if ( ( emailPick.getItemCount ( ) ) == 0 ) { onSaveSuccess ( currentUser ) ; } else { save.setEnabled ( true ) ; } updateEmailList ( ) ; } }
Source:
private void readDir ( final com.google.gerrit.server.tools.ToolsCatalog.Entry dir ) throws java.io.IOException { header ( dir , 0 ) ; readAck ( ) ; for ( com.google.gerrit.server.tools.ToolsCatalog.Entry e : dir.getChildren ( ) ) { if ( ( Entry.Type.DIR ) == ( e.getType ( ) ) ) { readDir ( e ) ; } else { readFile ( e ) ; } } out.write ( "E\n" . getBytes ( "UTF-8" ) ) ; out.flush ( ) ; readAck ( ) ; }

Target:
private void readDir ( final com.google.gerrit.server.tools.ToolsCatalog.Entry dir ) throws java.io.IOException { header ( dir , 0 ) ; readAck ( ) ; for ( com.google.gerrit.server.tools.ToolsCatalog.Entry e : dir.getChildren ( ) ) { if ( ( Entry.Type.DIR ) == ( e.getType ( ) ) ) { readDir ( e ) ; } else { readFile ( e ) ; } } out.write ( "E\n" . getBytes ( java.nio.charset.StandardCharsets.UTF_8 ) ) ; out.flush ( ) ; readAck ( ) ; }
Source:
private com.googlecode.prolog_cafe.lang.PrologMachineCopy consultRules ( java.lang.String name , java.io.Reader rules ) throws com.googlecode.prolog_cafe.compiler.CompileException { com.googlecode.prolog_cafe.lang.BufferingPrologControl ctl = newEmptyMachine ( systemLoader ) ; java.io.PushbackReader in = new java.io.PushbackReader ( rules , com.googlecode.prolog_cafe.lang.Prolog.PUSHBACK_SIZE ) ; try { if ( ! ( ctl.execute ( Prolog.BUILTIN , "consult_stream" , com.googlecode.prolog_cafe.lang.SymbolTerm.intern ( name ) , new com.googlecode.prolog_cafe.lang.JavaObjectTerm ( in ) ) ) ) { return null ; } } catch ( java.lang.RuntimeException e ) { throw new com.googlecode.prolog_cafe.compiler.CompileException ( ( "Error while consulting rules from " + name ) , e ) ; } return com.googlecode.prolog_cafe.lang.PrologMachineCopy.save ( ctl ) ; }

Target:
private com.googlecode.prolog_cafe.lang.PrologMachineCopy consultRules ( java.lang.String name , java.io.Reader rules ) throws com.googlecode.prolog_cafe.exceptions.CompileException { com.googlecode.prolog_cafe.lang.BufferingPrologControl ctl = newEmptyMachine ( systemLoader ) ; java.io.PushbackReader in = new java.io.PushbackReader ( rules , com.googlecode.prolog_cafe.lang.Prolog.PUSHBACK_SIZE ) ; try { if ( ! ( ctl.execute ( Prolog.BUILTIN , "consult_stream" , com.googlecode.prolog_cafe.lang.SymbolTerm.intern ( name ) , new com.googlecode.prolog_cafe.lang.JavaObjectTerm ( in ) ) ) ) { return null ; } } catch ( java.lang.RuntimeException e ) { throw new com.googlecode.prolog_cafe.exceptions.CompileException ( ( "Error while consulting rules from " + name ) , e ) ; } return com.googlecode.prolog_cafe.lang.PrologMachineCopy.save ( ctl ) ; }
Source:
void close ( ) { reopenThread.close ( ) ; try { writer.getIndexWriter ( ) . commit ( ) ; writer.getIndexWriter ( ) . close ( true ) ; } catch ( java.io.IOException e ) { com.google.gerrit.lucene.SubIndex.log.warn ( "error closing Lucene writer" , e ) ; } try { dir.close ( ) ; } catch ( java.io.IOException e ) { com.google.gerrit.lucene.SubIndex.log.warn ( "error closing Lucene directory" , e ) ; } }

Target:
void close ( ) { reopenThread.close ( ) ; try { writer.getIndexWriter ( ) . commit ( ) ; try { writer.getIndexWriter ( ) . close ( true ) ; } catch ( org.apache.lucene.store.AlreadyClosedException e ) { } } catch ( java.io.IOException e ) { com.google.gerrit.lucene.SubIndex.log.warn ( "error closing Lucene writer" , e ) ; } try { dir.close ( ) ; } catch ( java.io.IOException e ) { com.google.gerrit.lucene.SubIndex.log.warn ( "error closing Lucene directory" , e ) ; } }
Source:
void maybeRegisterRenderEntireFileKeyMap ( net.codemirror.lib.CodeMirror cm ) { if ( prefs.renderEntireFile ( ) ) { cm.addKeyMap ( com.google.gerrit.client.diff.DiffScreen.RENDER_ENTIRE_FILE_KEYMAP ) ; } }

Target:
public void onShowView ( ) { super . onShowView ( ) ; com.google.gwt.user.client.Window.enableScrolling ( false ) ; if ( prefs.hideTopMenu ( ) ) { com.google.gerrit.client.Gerrit.setHeaderVisible ( false ) ; } resizeHandler = com.google.gwt.user.client.Window.addResizeHandler ( new com.google.gwt.event.logical.shared.ResizeHandler ( ) { @ java.lang.Override public void onResize ( com.google.gwt.event.logical.shared.ResizeEvent event ) { resizeCodeMirror ( ) ; } } ) ; }
Source:
public org.apache.sshd.common.file.FileSystemView createFileSystemView ( org.apache.sshd.common.Session session ) throws java.io.IOException { return new org.apache.sshd.common.file.FileSystemView ( ) { @ java.lang.Override public org.apache.sshd.common.file.SshFile getFile ( org.apache.sshd.common.file.SshFile baseDir , java.lang.String file ) { return null ; } @ java.lang.Override public org.apache.sshd.common.file.SshFile getFile ( java.lang.String file ) { return null ; } @ java.lang.Override public org.apache.sshd.common.file.FileSystemView getNormalizedView ( ) { return this ; } } ; }

Target:
public java.nio.file.WatchService newWatchService ( ) throws java.io.IOException { return null ; }
Source:
public void onSuccess ( final com.google.gerrit.common.data.HostPageData result ) { com.google.gwt.dom.client.Document.get ( ) . getElementById ( "gerrit_hostpagedata" ) . removeFromParent ( ) ; com.google.gerrit.client.Gerrit.myConfig = result.config ; com.google.gerrit.client.Gerrit.myTheme = result.theme ; if ( ( result.account ) != null ) { com.google.gerrit.client.Gerrit.myAccount = result.account ; com.google.gerrit.client.Gerrit.xGerritAuth = result.xGerritAuth ; } if ( ( result.accountDiffPref ) != null ) { com.google.gerrit.client.Gerrit.myAccountDiffPref = result.accountDiffPref ; com.google.gerrit.client.Gerrit.applyUserPreferences ( ) ; } onModuleLoad2 ( result ) ; }

Target:
public java.lang.String encode ( java.lang.String e ) { e = com.google.gwt.http.client.URL.encodeQueryString ( e ) ; e = fixPathImpl ( e ) ; e = fixColonImpl ( e ) ; e = fixDoubleQuote ( e ) ; return e ; }
Source:
private static boolean sameFirstParents ( org.eclipse.jgit.revwalk.RevCommit prior , org.eclipse.jgit.revwalk.RevCommit next ) { return prior.getParent ( 0 ) . equals ( next.getParent ( 0 ) ) ; }

Target:
private static boolean sameFirstParents ( org.eclipse.jgit.revwalk.RevCommit prior , org.eclipse.jgit.revwalk.RevCommit next ) { if ( ( prior.getParentCount ( ) ) == 0 ) { return ( next.getParentCount ( ) ) == 0 ; } return prior.getParent ( 0 ) . equals ( next.getParent ( 0 ) ) ; }
Source:
public void usernameEmailPatternWithRegex ( ) { com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.project.Util.DEVS , "^refs/sb/${username}/heads/.*" ) ; com.google.gerrit.server.project.ProjectControl u = user ( local , "d.v@ger-rit.org" , com.google.gerrit.server.project.Util.DEVS ) ; com.google.gerrit.server.project.ProjectControl d = user ( local , "dev@ger-rit.org" , com.google.gerrit.server.project.Util.DEVS ) ; assertCannotRead ( "refs/sb/dev@ger-rit.org/heads/foobar" , u ) ; assertCanRead ( "refs/sb/dev@ger-rit.org/heads/foobar" , d ) ; }

Target:
public void sortWithRegex ( ) { com.google.gerrit.server.project.testing.Util.allow ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.project.testing.Util.DEVS , "^refs/heads/.*" ) ; com.google.gerrit.server.project.testing.Util.allow ( parent , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "^refs/heads/.*-QA-.*" ) ; com.google.gerrit.server.project.ProjectControl u = user ( local , com.google.gerrit.server.project.testing.Util.DEVS ) ; com.google.gerrit.server.project.ProjectControl d = user ( local , com.google.gerrit.server.project.testing.Util.DEVS ) ; assertCanRead ( "refs/heads/foo-QA-bar" , u ) ; assertCanRead ( "refs/heads/foo-QA-bar" , d ) ; }
Source:
public void topic ( java.lang.String topic ) throws com.google.gerrit.extensions.restapi.RestApiException { com.google.gerrit.server.change.PutTopic.Input in = new com.google.gerrit.server.change.PutTopic.Input ( ) ; in.topic = topic ; try { putTopic.apply ( change , in ) ; } catch ( com.google.gwtorm.server.OrmException | java.io.IOException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot set topic" , e ) ; } }

Target:
public com.google.gerrit.extensions.api.changes.RevisionApi revision ( java.lang.String id ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return revisionApi.create ( revisions.parse ( change , com.google.gerrit.extensions.restapi.IdString.fromDecoded ( id ) ) ) ; } catch ( com.google.gwtorm.server.OrmException | java.io.IOException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot parse revision" , e ) ; } }
Source:
protected void configure ( ) { final com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < java.lang.String , java.util.List > > type = new com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < java.lang.String , java.util.List > > ( ) { } ; core ( type , "openid" ) . maxAge ( 5 , java.util.concurrent.TimeUnit.MINUTES ) . memoryLimit ( 64 ) ; }

Target:
protected void configureServlets ( ) { rpc ( com.google.gerrit.httpd.auth.openid.OpenIdServiceImpl.class ) ; }
Source:
private com.google.gerrit.server.git.BatchUpdate.ChangeContext newChangeContext ( com.google.gerrit.reviewdb.server.ReviewDb db , org.eclipse.jgit.lib.Repository repo , org.eclipse.jgit.revwalk.RevWalk rw , com.google.gerrit.reviewdb.client.Change.Id id ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = newChanges.get ( id ) ; if ( c == null ) { c = com.google.gerrit.server.git.BatchUpdate.unwrap ( db ) . changes ( ) . get ( id ) ; } com.google.gerrit.server.notedb.ChangeNotes notes = changeNotesFactory.createForNew ( c ) ; com.google.gerrit.server.project.ChangeControl ctl = changeControlFactory.controlFor ( notes , user ) ; return new com.google.gerrit.server.git.BatchUpdate.ChangeContext ( ctl , new com.google.gerrit.server.git.BatchUpdateReviewDb ( db ) , repo , rw ) ; }

Target:
private com.google.gerrit.server.git.BatchUpdate.ChangeContext newChangeContext ( com.google.gerrit.reviewdb.server.ReviewDb db , org.eclipse.jgit.lib.Repository repo , org.eclipse.jgit.revwalk.RevWalk rw , com.google.gerrit.reviewdb.client.Change.Id id ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = newChanges.get ( id ) ; if ( c == null ) { c = com.google.gerrit.reviewdb.server.ReviewDbUtil.unwrapDb ( db ) . changes ( ) . get ( id ) ; } com.google.gerrit.server.notedb.ChangeNotes notes = changeNotesFactory.createForBatchUpdate ( c ) ; com.google.gerrit.server.project.ChangeControl ctl = changeControlFactory.controlFor ( notes , user ) ; return new com.google.gerrit.server.git.BatchUpdate.ChangeContext ( ctl , new com.google.gerrit.server.git.BatchUpdateReviewDb ( db ) , repo , rw ) ; }
Source:
private static java.lang.ClassLoader parentFor ( com.google.gerrit.server.plugins.Plugin.ApiType type ) throws com.google.gerrit.server.plugins.InvalidPluginException { switch ( type ) { case EXTENSION : return com.google.gerrit.extensions.annotations.PluginName.class . getClassLoader ( ) ; case PLUGIN : return com.google.gerrit.server.plugins.PluginLoader.class . getClassLoader ( ) ; default : throw new com.google.gerrit.server.plugins.InvalidPluginException ( ( "Unsupported ApiType " + type ) ) ; } }

Target:
private static java.lang.ClassLoader parentFor ( com.google.gerrit.server.plugins.Plugin.ApiType type ) throws com.google.gerrit.server.plugins.InvalidPluginException { switch ( type ) { case EXTENSION : return com.google.gerrit.extensions.annotations.PluginName.class . getClassLoader ( ) ; case PLUGIN : return com.google.gerrit.server.plugins.PluginLoader.class . getClassLoader ( ) ; case JS : return com.google.gerrit.extensions.webui.JavaScriptPlugin.class . getClassLoader ( ) ; default : throw new com.google.gerrit.server.plugins.InvalidPluginException ( ( "Unsupported ApiType " + type ) ) ; } }
Source:
void scheduleFullSync ( final com.google.gerrit.reviewdb.client.Project.NameKey project , final java.lang.String urlMatch , com.googlesource.gerrit.plugins.replication.ReplicationState state ) { if ( ! ( running ) ) { com.googlesource.gerrit.plugins.replication.ReplicationQueue.stateLog.warn ( "Replication plugin did not finish startup before event" , state ) ; return ; } for ( com.googlesource.gerrit.plugins.replication.Destination cfg : config.getDestinations ( FilterType.ALL ) ) { if ( cfg.wouldPushProject ( project ) ) { for ( org.eclipse.jgit.transport.URIish uri : cfg.getURIs ( project , urlMatch ) ) { cfg.schedule ( project , PushOne.ALL_REFS , uri , state ) ; } } } }

Target:
void scheduleFullSync ( final com.google.gerrit.reviewdb.client.Project.NameKey project , final java.lang.String urlMatch , com.googlesource.gerrit.plugins.replication.ReplicationState state ) { if ( ! ( running ) ) { stateLog.warn ( "Replication plugin did not finish startup before event" , state ) ; return ; } for ( com.googlesource.gerrit.plugins.replication.Destination cfg : config.getDestinations ( FilterType.ALL ) ) { if ( cfg.wouldPushProject ( project ) ) { for ( org.eclipse.jgit.transport.URIish uri : cfg.getURIs ( project , urlMatch ) ) { cfg.schedule ( project , PushOne.ALL_REFS , uri , state ) ; } } } }
Source:
public void submitWithErrorMessage ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = newChange ( ) ; com.google.gerrit.server.notedb.ChangeUpdate update = newUpdate ( c , changeOwner ) ; update.setSubject ( "Submit patch set 1" ) ; update.merge ( com.google.common.collect.ImmutableList.of ( submitRecord ( "RULE_ERROR" , "Problem with patch set:\n1" ) ) ) ; update.commit ( ) ; assertBodyEquals ( ( "Submit patch set 1\n" + ( ( ( "\n" + "Patch-set: 1\n" ) + "Status: merged\n" ) + "Submitted-with: RULE_ERROR Problem with patch set: 1\n" ) ) , update.getRevision ( ) ) ; }

Target:
public void submitWithErrorMessage ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = newChange ( ) ; com.google.gerrit.server.notedb.ChangeUpdate update = newUpdate ( c , changeOwner ) ; update.setSubjectForCommit ( "Submit patch set 1" ) ; update.merge ( "1-1453387607626-96fabc25" , com.google.common.collect.ImmutableList.of ( submitRecord ( "RULE_ERROR" , "Problem with patch set:\n1" ) ) ) ; update.commit ( ) ; assertBodyEquals ( ( "Submit patch set 1\n" + ( ( ( ( "\n" + "Patch-set: 1\n" ) + "Status: merged\n" ) + "Submission-id: 1-1453387607626-96fabc25\n" ) + "Submitted-with: RULE_ERROR Problem with patch set: 1\n" ) ) , update.getRevision ( ) ) ; }
Source:
public void onSuccess ( com.google.gerrit.client.changes.ChangeInfo result ) { render ( result.revisions ( ) ) ; loaded = true ; }

Target:
public void onSuccess ( com.google.gerrit.client.changes.ChangeInfo result ) { if ( ( edit ) != null ) { edit.set_name ( edit.commit ( ) . commit ( ) ) ; result.revisions ( ) . put ( edit.name ( ) , com.google.gerrit.client.changes.ChangeInfo.RevisionInfo.fromEdit ( edit ) ) ; } render ( result.revisions ( ) ) ; loaded = true ; }
Source:
private void appendNoLF ( final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder m ) { openLine ( m ) ; padLineNumber ( m ) ; padLineNumber ( m ) ; m.openTd ( ) ; m.addStyleName ( Gerrit.RESOURCES.css ( ) . diffText ( ) ) ; m.addStyleName ( Gerrit.RESOURCES.css ( ) . diffTextNoLF ( ) ) ; m.append ( "\\ No newline at end of file" ) ; m.closeTd ( ) ; closeLine ( m ) ; }

Target:
private void appendNoLF ( final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder m ) { openLine ( m ) ; padLineNumberForSideA ( m ) ; padLineNumberForSideB ( m ) ; m.openTd ( ) ; m.addStyleName ( Gerrit.RESOURCES.css ( ) . diffText ( ) ) ; m.addStyleName ( Gerrit.RESOURCES.css ( ) . diffTextNoLF ( ) ) ; m.append ( "\\ No newline at end of file" ) ; m.closeTd ( ) ; closeLine ( m ) ; }
Source:
private static java.lang.String getUserPreference ( ) { if ( com.google.gerrit.client.Gerrit.isSignedIn ( ) ) { com.google.gerrit.reviewdb.client.AccountGeneralPreferences.DownloadScheme pref = com.google.gerrit.client.Gerrit.getUserAccount ( ) . getGeneralPreferences ( ) . getDownloadUrl ( ) ; if ( pref != null ) { switch ( pref ) { case ANON_GIT : return "git" ; case ANON_HTTP : return "anonymous http" ; case HTTP : return "http" ; case SSH : return "ssh" ; case REPO_DOWNLOAD : return "repo" ; default : return null ; } } } return null ; }

Target:
private static java.lang.String getUserPreference ( ) { com.google.gerrit.reviewdb.client.AccountGeneralPreferences.DownloadScheme pref = com.google.gerrit.client.Gerrit.getUserPreferences ( ) . downloadScheme ( ) ; if ( pref != null ) { switch ( pref ) { case ANON_GIT : return "git" ; case ANON_HTTP : return "anonymous http" ; case HTTP : return "http" ; case SSH : return "ssh" ; case REPO_DOWNLOAD : return "repo" ; default : return null ; } } return null ; }
Source:
protected void onLoad ( ) { super . onLoad ( ) ; query = new com.google.gerrit.client.admin.ProjectTagsScreen.Query ( match ) . start ( start ) . run ( ) ; savedPanel = TAGS ; }

Target:
protected void onLoad ( ) { super . onLoad ( ) ; addPanel.setVisible ( false ) ; com.google.gerrit.client.access.AccessMap.get ( getProjectKey ( ) , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.access.ProjectAccessInfo > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.access.ProjectAccessInfo result ) { addPanel.setVisible ( result.canAddRefs ( ) ) ; } } ) ; query = new com.google.gerrit.client.admin.ProjectTagsScreen.Query ( match ) . start ( start ) . run ( ) ; savedPanel = TAGS ; }
Source:
private com.google.gerrit.reviewdb.client.ChangeMessage message ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx , java.lang.String body ) { java.lang.String uuid ; try { uuid = com.google.gerrit.server.ChangeUtil.messageUUID ( ctx.getDb ( ) ) ; } catch ( com.google.gwtorm.server.OrmException e ) { return null ; } com.google.gerrit.reviewdb.client.ChangeMessage m = new com.google.gerrit.reviewdb.client.ChangeMessage ( new com.google.gerrit.reviewdb.client.ChangeMessage.Key ( ctx.getChange ( ) . getId ( ) , uuid ) , null , ctx.getWhen ( ) , toMerge.change ( ) . currentPatchSetId ( ) ) ; m.setMessage ( body ) ; return m ; }

Target:
private com.google.gerrit.reviewdb.client.ChangeMessage message ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx , com.google.gerrit.reviewdb.client.PatchSet.Id psId , java.lang.String body ) { com.google.common.base.Preconditions.checkNotNull ( psId ) ; java.lang.String uuid ; try { uuid = com.google.gerrit.server.ChangeUtil.messageUUID ( ctx.getDb ( ) ) ; } catch ( com.google.gwtorm.server.OrmException e ) { return null ; } com.google.gerrit.reviewdb.client.ChangeMessage m = new com.google.gerrit.reviewdb.client.ChangeMessage ( new com.google.gerrit.reviewdb.client.ChangeMessage.Key ( psId.getParentKey ( ) , uuid ) , null , ctx.getWhen ( ) , psId ) ; m.setMessage ( body ) ; return m ; }
Source:
public boolean isVisible ( ) { com.google.gerrit.reviewdb.client.AccountGroup accountGroup = com.google.gerrit.common.data.GroupDescriptions.toAccountGroup ( group ) ; return ( ( ( ( ( accountGroup != null ) && ( accountGroup.isVisibleToAll ( ) ) ) || ( ( user ) instanceof com.google.gerrit.server.InternalUser ) ) || ( user.getEffectiveGroups ( ) . contains ( group.getGroupUUID ( ) ) ) ) || ( isOwner ( ) ) ) || ( user.getCapabilities ( ) . canAdministrateServer ( ) ) ; }

Target:
public boolean isVisible ( ) { return ( ( ( ( ( user ) instanceof com.google.gerrit.server.InternalUser ) || ( user.memberOf ( group.getGroupUUID ( ) ) ) ) || ( isOwner ( ) ) ) || ( user.getCapabilities ( ) . canAdministrateServer ( ) ) ) || ( groupBackend.isVisibleToAll ( group.getGroupUUID ( ) ) ) ; }
Source:
public static org.eclipse.jgit.lib.Config loadDefault ( javax.servlet.FilterConfig filterConfig ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { java.lang.String configPath = null ; if ( filterConfig != null ) { configPath = filterConfig.getInitParameter ( com.google.gitiles.GitilesConfig.FILTER_CONFIG_PARAM ) ; } if ( configPath == null ) { configPath = java.lang.System.getProperty ( com.google.gitiles.GitilesConfig.PROPERTY_NAME , com.google.gitiles.GitilesConfig.DEFAULT_PATH ) ; } org.eclipse.jgit.storage.file.FileBasedConfig config = new org.eclipse.jgit.storage.file.FileBasedConfig ( new java.io.File ( configPath ) , org.eclipse.jgit.util.FS.DETECTED ) ; config.load ( ) ; return config ; }

Target:
public static org.eclipse.jgit.lib.Config loadDefault ( javax.servlet.FilterConfig filterConfig ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { org.eclipse.jgit.storage.file.FileBasedConfig config = new org.eclipse.jgit.storage.file.FileBasedConfig ( com.google.gitiles.GitilesConfig.defaultFile ( ) , org.eclipse.jgit.util.FS.DETECTED ) ; config.load ( ) ; return config ; }
Source:
public void deleteReviewerFromReviewableWipChange ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableWipChange ( ) ; removeReviewer ( sc , extraReviewer ) ; assertThat ( sender ) . sent ( "deleteReviewer" , sc ) . notTo ( sc.owner ) . to ( extraReviewer ) . to ( sc.reviewerByEmail ) . cc ( extraCcer , sc.reviewer , sc.ccer ) . cc ( sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; }

Target:
public void deleteReviewerByEmailFromWipChangeInNoteDb ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isTrue ( ) ; com.google.gerrit.acceptance.server.mail.StagedChange sc = stageWipChange ( ) ; gApi.changes ( ) . id ( sc.changeId ) . reviewer ( sc.reviewerByEmail ) . remove ( ) ; assertThat ( sender ) . notSent ( ) ; }
Source:
private void init ( ) { tv ( R.id.commitMessage ) . setLinksClickable ( true ) ; }

Target:
private void init ( final com.google.reviewit.app.Change change ) { android.support.v4.widget.SwipeRefreshLayout swipeRefreshLayout = ( ( android.support.v4.widget.SwipeRefreshLayout ) ( v ( R.id.swipeRefreshLayout ) ) ) ; swipeRefreshLayout.setColorSchemeColors ( R.color.progressBar ) ; swipeRefreshLayout.setRefreshing ( true ) ; swipeRefreshLayout.setOnRefreshListener ( new android.support.v4.widget.SwipeRefreshLayout.OnRefreshListener ( ) { @ java.lang.Override public void onRefresh ( ) { refresh ( change ) ; } } ) ; tv ( R.id.commitMessage ) . setLinksClickable ( true ) ; }
Source:
protected void run ( ) throws com.google.gerrit.sshd.commands.Failure { try { com.google.gerrit.server.project.BanCommit.Input input = BanCommit.Input.fromCommits ( com.google.common.collect.Lists.transform ( commitsToBan , ObjectId :: getName ) ) ; input.reason = reason ; com.google.gerrit.server.project.BanCommit.BanResultInfo r = banCommit.apply ( new com.google.gerrit.server.project.ProjectResource ( projectControl ) , input ) ; printCommits ( r.newlyBanned , "The following commits were banned" ) ; printCommits ( r.alreadyBanned , "The following commits were already banned" ) ; printCommits ( r.ignored , "The following ids do not represent commits and were ignored" ) ; } catch ( java.lang.Exception e ) { throw die ( e ) ; } }

Target:
protected void run ( ) throws com.google.gerrit.sshd.commands.Failure { try { com.google.gerrit.server.project.BanCommit.Input input = BanCommit.Input.fromCommits ( com.google.common.collect.Lists.transform ( commitsToBan , ObjectId :: getName ) ) ; input.reason = reason ; com.google.gerrit.server.project.BanCommit.BanResultInfo r = banCommit.apply ( new com.google.gerrit.server.project.ProjectResource ( projectControl.getProjectState ( ) , projectControl.getUser ( ) ) , input ) ; printCommits ( r.newlyBanned , "The following commits were banned" ) ; printCommits ( r.alreadyBanned , "The following commits were already banned" ) ; printCommits ( r.ignored , "The following ids do not represent commits and were ignored" ) ; } catch ( java.lang.Exception e ) { throw die ( e ) ; } }
Source:
protected void setupVelocityContext ( ) { super . setupVelocityContext ( ) ; velocityContext.put ( "change" , change ) ; velocityContext.put ( "changeId" , change.getKey ( ) ) ; velocityContext.put ( "coverLetter" , getCoverLetter ( ) ) ; velocityContext.put ( "patchSet" , patchSet ) ; velocityContext.put ( "patchSetInfo" , patchSetInfo ) ; }

Target:
protected void setupVelocityContext ( ) { super . setupVelocityContext ( ) ; velocityContext.put ( "change" , change ) ; velocityContext.put ( "changeId" , change.getKey ( ) ) ; velocityContext.put ( "coverLetter" , getCoverLetter ( ) ) ; velocityContext.put ( "fromName" , getNameFor ( fromId ) ) ; velocityContext.put ( "patchSet" , patchSet ) ; velocityContext.put ( "patchSetInfo" , patchSetInfo ) ; }
Source:
private void convertLocalUserToLowerCase ( com.google.gerrit.server.account.ExternalId extId ) { if ( extId.isScheme ( com.google.gerrit.server.account.ExternalId.SCHEME_GERRIT ) ) { java.lang.String localUser = extId.key ( ) . id ( ) ; java.lang.String localUserLowerCase = localUser.toLowerCase ( java.util.Locale.US ) ; if ( ! ( localUser.equals ( localUserLowerCase ) ) ) { com.google.gerrit.server.account.ExternalId extIdLowerCase = com.google.gerrit.server.account.ExternalId.create ( com.google.gerrit.server.account.ExternalId.SCHEME_GERRIT , localUserLowerCase , extId.accountId ( ) , extId.email ( ) , extId.password ( ) ) ; externalIdsBatchUpdate.replace ( extId , extIdLowerCase ) ; } } }

Target:
private void convertLocalUserToLowerCase ( com.google.gerrit.server.account.externalids.ExternalId extId ) { if ( extId.isScheme ( com.google.gerrit.server.account.externalids.ExternalId.SCHEME_GERRIT ) ) { java.lang.String localUser = extId.key ( ) . id ( ) ; java.lang.String localUserLowerCase = localUser.toLowerCase ( java.util.Locale.US ) ; if ( ! ( localUser.equals ( localUserLowerCase ) ) ) { com.google.gerrit.server.account.externalids.ExternalId extIdLowerCase = com.google.gerrit.server.account.externalids.ExternalId.create ( com.google.gerrit.server.account.externalids.ExternalId.SCHEME_GERRIT , localUserLowerCase , extId.accountId ( ) , extId.email ( ) , extId.password ( ) ) ; externalIdsBatchUpdate.replace ( extId , extIdLowerCase ) ; } } }
Source:
public void publishEdit ( ) throws java.lang.Exception { org.junit.Assert.assertEquals ( RefUpdate.Result.NEW , modifier.createEdit ( change , getCurrentPatchSet ( changeId ) ) ) ; org.junit.Assert.assertEquals ( RefUpdate.Result.FORCED , modifier.modifyFile ( editUtil.byChange ( change ) . get ( ) , com.google.gerrit.acceptance.edit.ChangeEditIT.FILE_NAME , com.google.gerrit.acceptance.edit.ChangeEditIT.CONTENT_NEW2 ) ) ; editUtil.publish ( editUtil.byChange ( change ) . get ( ) ) ; org.junit.Assert.assertFalse ( editUtil.byChange ( change ) . isPresent ( ) ) ; }

Target:
public void publishEdit ( ) throws java.lang.Exception { com.google.common.truth.Truth.assertThat ( modifier.createEdit ( change , getCurrentPatchSet ( changeId ) ) ) . isEqualTo ( RefUpdate.Result.NEW ) ; com.google.common.truth.Truth.assertThat ( modifier.modifyFile ( editUtil.byChange ( change ) . get ( ) , com.google.gerrit.acceptance.edit.ChangeEditIT.FILE_NAME , com.google.gerrit.acceptance.edit.ChangeEditIT.CONTENT_NEW2 ) ) . isEqualTo ( RefUpdate.Result.FORCED ) ; editUtil.publish ( editUtil.byChange ( change ) . get ( ) ) ; com.google.common.truth.Truth.assertThat ( editUtil.byChange ( change ) . isPresent ( ) ) . isFalse ( ) ; }
Source:
public void testIsEnabledEventMultiBranchMixedMatchExact ( ) { java.lang.String [ ] branches = new java.lang.String [ ] { "refs/heads/testBranch" , "refs/heads/foo.*" } ; setupIsEnabled ( "true" , null , branches ) ; com.google.gerrit.server.events.PatchSetCreatedEvent event = new com.google.gerrit.server.events.PatchSetCreatedEvent ( ) ; com.google.gerrit.server.data.ChangeAttribute changeAttribute = new com.google.gerrit.server.data.ChangeAttribute ( ) ; changeAttribute.project = "testProject" ; changeAttribute.branch = "testBranch" ; event.change = com.google.common.base.Suppliers.ofInstance ( changeAttribute ) ; com.googlesource.gerrit.plugins.its.base.its.ItsConfig itsConfig = createItsConfig ( ) ; replayMocks ( ) ; assertTrue ( itsConfig.isEnabled ( event ) ) ; }

Target:
public void testIsEnabledEventMultiBranchMixedMatchExact ( ) { java.lang.String [ ] branches = new java.lang.String [ ] { "refs/heads/testBranch" , "refs/heads/foo.*" } ; setupIsEnabled ( "true" , null , branches ) ; com.google.gerrit.server.events.PatchSetCreatedEvent event = new com.google.gerrit.server.events.PatchSetCreatedEvent ( testChange ( "testProject" , "testBranch" ) ) ; com.googlesource.gerrit.plugins.its.base.its.ItsConfig itsConfig = createItsConfig ( ) ; replayMocks ( ) ; assertTrue ( itsConfig.isEnabled ( event ) ) ; }
Source:
public com.google.gerrit.reviewdb.client.PatchSetInfo createValue ( com.googlecode.prolog_cafe.lang.Prolog engine ) { com.google.gerrit.reviewdb.client.Change change = com.google.gerrit.rules.StoredValues.getChange ( engine ) ; com.google.gerrit.reviewdb.client.PatchSet ps = com.google.gerrit.rules.StoredValues.PATCH_SET.get ( engine ) ; com.google.gerrit.rules.PrologEnvironment env = ( ( com.google.gerrit.rules.PrologEnvironment ) ( engine.control ) ) ; com.google.gerrit.server.patch.PatchSetInfoFactory patchInfoFactory = env.getArgs ( ) . getPatchSetInfoFactory ( ) ; try { return patchInfoFactory.get ( change , ps ) ; } catch ( com.google.gerrit.server.patch.PatchSetInfoNotAvailableException e ) { throw new com.googlecode.prolog_cafe.exceptions.SystemException ( e.getMessage ( ) ) ; } }

Target:
public com.google.gerrit.reviewdb.client.PatchSetInfo createValue ( com.googlecode.prolog_cafe.lang.Prolog engine ) { com.google.gerrit.reviewdb.client.Change change = com.google.gerrit.rules.StoredValues.getChange ( engine ) ; com.google.gerrit.reviewdb.client.PatchSet ps = com.google.gerrit.rules.StoredValues.getPatchSet ( engine ) ; com.google.gerrit.rules.PrologEnvironment env = ( ( com.google.gerrit.rules.PrologEnvironment ) ( engine.control ) ) ; com.google.gerrit.server.patch.PatchSetInfoFactory patchInfoFactory = env.getArgs ( ) . getPatchSetInfoFactory ( ) ; try { return patchInfoFactory.get ( change , ps ) ; } catch ( com.google.gerrit.server.patch.PatchSetInfoNotAvailableException e ) { throw new com.googlecode.prolog_cafe.exceptions.SystemException ( e.getMessage ( ) ) ; } }
Source:
public void nonMatchingNames ( ) { doesNotMatch ( "a.git" ) ; doesNotMatch ( "a.1234567890123.git" ) ; doesNotMatch ( "a.1234567890123.deleted.git" ) ; doesNotMatch ( "a.123456789012.deleted" ) ; doesNotMatch ( "a.1234567890123.deleted." ) ; doesNotMatch ( "a.1234567890123.deleted.git" ) ; }

Target:
public void nonMatchingNames ( ) { doesNotMatch ( "a.git" ) ; doesNotMatch ( "a.1234567890123.git" ) ; doesNotMatch ( "a.1234567890123.deleted.git" ) ; doesNotMatch ( "a.123456789012.deleted" ) ; doesNotMatch ( "a.1234567890123.deleted." ) ; doesNotMatch ( "a.1234567890123.deleted.git" ) ; doesNotMatch ( "a.1234567890123.%deleted%" ) ; doesNotMatch ( "a.1234567890123.%deleted%.git." ) ; doesNotMatch ( "a.1234567890123.%deleted%.git.git" ) ; }
Source:
private void initMessage ( final com.google.gwt.user.client.ui.Panel body ) { body.add ( new com.google.gerrit.client.ui.SmallHeading ( Util.C.headingCoverMessage ( ) ) ) ; final com.google.gwt.user.client.ui.VerticalPanel mwrap = new com.google.gwt.user.client.ui.VerticalPanel ( ) ; mwrap.setStyleName ( "gerrit-CoverMessage" ) ; body.add ( mwrap ) ; message = new com.google.gwtexpui.globalkey.client.NpTextArea ( ) ; message.setCharacterWidth ( 60 ) ; message.setVisibleLines ( 10 ) ; com.google.gwt.user.client.DOM.setElementPropertyBoolean ( message.getElement ( ) , "spellcheck" , true ) ; mwrap.add ( message ) ; }

Target:
private void initMessage ( final com.google.gwt.user.client.ui.Panel body ) { body.add ( new com.google.gerrit.client.ui.SmallHeading ( Util.C.headingCoverMessage ( ) ) ) ; final com.google.gwt.user.client.ui.VerticalPanel mwrap = new com.google.gwt.user.client.ui.VerticalPanel ( ) ; mwrap.setStyleName ( Gerrit.RESOURCES.css ( ) . coverMessage ( ) ) ; body.add ( mwrap ) ; message = new com.google.gwtexpui.globalkey.client.NpTextArea ( ) ; message.setCharacterWidth ( 60 ) ; message.setVisibleLines ( 10 ) ; com.google.gwt.user.client.DOM.setElementPropertyBoolean ( message.getElement ( ) , "spellcheck" , true ) ; mwrap.add ( message ) ; }
Source:
public void onFailure ( java.lang.Throwable err ) { com.google.gerrit.client.change.DraftActions.setEnabled ( true , draftButtons ) ; if ( com.google.gerrit.client.change.SubmitFailureDialog.isConflict ( err ) ) { new com.google.gerrit.client.change.SubmitFailureDialog ( err.getMessage ( ) ) . center ( ) ; com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( id ) ) ; } else { super . onFailure ( err ) ; } }

Target:
public void onFailure ( java.lang.Throwable err ) { com.google.gerrit.client.change.ChangeActions.setEnabled ( true , draftButtons ) ; if ( com.google.gerrit.client.change.SubmitFailureDialog.isConflict ( err ) ) { new com.google.gerrit.client.change.SubmitFailureDialog ( err.getMessage ( ) ) . center ( ) ; com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( id ) ) ; } else { super . onFailure ( err ) ; } }
Source:
public java.util.List < com.google.gerrit.server.git.validators.CommitValidationMessage > onCommitReceived ( com.google.gerrit.server.events.CommitReceivedEvent receiveEvent ) throws com.google.gerrit.server.git.validators.CommitValidationException { if ( itsConfig.isEnabled ( receiveEvent.getProjectNameKey ( ) , receiveEvent.getRefName ( ) ) ) { return validCommit ( receiveEvent.commit ) ; } else { return java.util.Collections.emptyList ( ) ; } }

Target:
public java.util.List < com.google.gerrit.server.git.validators.CommitValidationMessage > onCommitReceived ( com.google.gerrit.server.events.CommitReceivedEvent receiveEvent ) throws com.google.gerrit.server.git.validators.CommitValidationException { com.googlesource.gerrit.plugins.its.base.its.ItsConfig.setCurrentProjectName ( receiveEvent.getProjectNameKey ( ) ) ; if ( itsConfig.isEnabled ( receiveEvent.getProjectNameKey ( ) , receiveEvent.getRefName ( ) ) ) { return validCommit ( receiveEvent.commit ) ; } else { return java.util.Collections.emptyList ( ) ; } }
Source:
private void updatePatchSet ( ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.Change.Status changeStatus = parentChange.getStatus ( ) ; switch ( changeStatus ) { case NEW : setPatchSetAsDraft ( ) ; updateChange ( ) ; break ; default : sendUserInfo ( ( "Unable to set patch set as draft, change is " + ( getStatusName ( changeStatus ) ) ) ) ; break ; } }

Target:
private void updatePatchSet ( ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.Change.Status changeStatus = parentChange.getStatus ( ) ; if ( changeStatus == ( Change.Status.NEW ) ) { setPatchSetAsDraft ( ) ; updateChange ( ) ; } else { sendUserInfo ( ( "Unable to set patch set as draft, change is " + ( getStatusName ( changeStatus ) ) ) ) ; } }
Source:
public void onSuccess ( com.google.gerrit.client.rpc.NativeMap < com.google.gwt.core.client.JsArray < com.google.gerrit.client.changes.CommentInfo > > result ) { draftsRevision = sort ( result.get ( path ) ) ; }

Target:
public void onSuccess ( com.google.gerrit.client.rpc.NativeMap < com.google.gwt.core.client.JsArray < com.google.gerrit.client.changes.CommentInfo > > result ) { for ( java.lang.String k : result.keySet ( ) ) { result.put ( k , filterForParent ( result.get ( k ) ) ) ; } draftsRevision = sort ( result.get ( path ) ) ; }
Source:
public void renameColumn ( com.google.gwtorm.client.StatementExecutor stmt , java.lang.String tableName , java.lang.String fromColumn , com.google.gwtorm.schema.ColumnModel col ) throws com.google.gwtorm.client.OrmException { final java.lang.StringBuilder r = new java.lang.StringBuilder ( ) ; r.append ( "ALTER TABLE " ) ; r.append ( tableName ) ; r.append ( " RENAME COLUMN " ) ; r.append ( fromColumn ) ; r.append ( " TO " ) ; r.append ( col.getColumnName ( ) ) ; stmt.execute ( r.toString ( ) ) ; }

Target:
public void renameColumn ( com.google.gwtorm.server.StatementExecutor stmt , java.lang.String tableName , java.lang.String fromColumn , com.google.gwtorm.schema.ColumnModel col ) throws com.google.gwtorm.server.OrmException { final java.lang.StringBuilder r = new java.lang.StringBuilder ( ) ; r.append ( "ALTER TABLE " ) ; r.append ( tableName ) ; r.append ( " RENAME COLUMN " ) ; r.append ( fromColumn ) ; r.append ( " TO " ) ; r.append ( col.getColumnName ( ) ) ; stmt.execute ( r.toString ( ) ) ; }
Source:
private void computeAllowed ( ) { final com.google.gerrit.client.reviewdb.Account.Id me = com.google.gerrit.client.rpc.Common.getAccountId ( ) ; final java.util.Set < com.google.gerrit.client.reviewdb.AccountGroup.Id > am = com.google.gerrit.client.rpc.Common.getGroupCache ( ) . getGroups ( me ) ; final com.google.gerrit.client.data.ProjectCache.Entry pe = com.google.gerrit.client.rpc.Common.getProjectCache ( ) . get ( change.getDest ( ) . getParentKey ( ) ) ; computeAllowed ( am , pe.getRights ( ) ) ; computeAllowed ( am , com.google.gerrit.client.rpc.Common.getProjectCache ( ) . getWildcardRights ( ) ) ; }

Target:
private void computeAllowed ( ) { final com.google.gerrit.client.reviewdb.Account.Id me = com.google.gerrit.client.rpc.Common.getAccountId ( ) ; final java.util.Set < com.google.gerrit.client.reviewdb.AccountGroup.Id > am = com.google.gerrit.client.rpc.Common.getGroupCache ( ) . getEffectiveGroups ( me ) ; final com.google.gerrit.client.data.ProjectCache.Entry pe = com.google.gerrit.client.rpc.Common.getProjectCache ( ) . get ( change.getDest ( ) . getParentKey ( ) ) ; computeAllowed ( am , pe.getRights ( ) ) ; computeAllowed ( am , com.google.gerrit.client.rpc.Common.getProjectCache ( ) . getWildcardRights ( ) ) ; }
Source:
public void listNonEmptyGroupIncludes ( ) throws java.lang.Exception { group ( "gx" , "Administrators" ) ; group ( "gy" , "Administrators" ) ; PUT ( "/groups/Administrators/groups/gx" ) ; PUT ( "/groups/Administrators/groups/gy" ) ; assertIncludes ( GET ( "/groups/Administrators/groups/" ) , "gx" , "gy" ) ; }

Target:
public void listOneIncludeMember ( ) throws java.lang.Exception { java.lang.String gx = group ( "gx" , "Administrators" ) ; java.lang.String gy = group ( "gy" , "Administrators" ) ; PUT ( ( ( ( "/groups/" + gx ) + "/groups/" ) + gy ) ) ; com.google.common.truth.Truth.assertThat ( GET_ONE ( ( ( ( "/groups/" + gx ) + "/groups/" ) + gy ) ) . name ) . isEqualTo ( gy ) ; }
Source:
public com.google.gerrit.server.patch.IntraLineDiff getIntraLineDiff ( com.google.gerrit.server.patch.IntraLineDiffKey key , com.google.gerrit.server.patch.IntraLineDiffArgs args ) { if ( computeIntraline ) { try { return intraCache.get ( key , intraLoaderFactory.create ( key , args ) ) ; } catch ( java.util.concurrent.ExecutionException | org.eclipse.jgit.errors.LargeObjectException e ) { IntraLineLoader.log.warn ( ( "Error computing " + key ) , e ) ; return new com.google.gerrit.server.patch.IntraLineDiff ( IntraLineDiff.Status.ERROR ) ; } } return new com.google.gerrit.server.patch.IntraLineDiff ( IntraLineDiff.Status.DISABLED ) ; }

Target:
public com.google.gerrit.server.diff.IntraLineDiff getIntraLineDiff ( com.google.gerrit.server.diff.IntraLineDiffKey key , com.google.gerrit.server.diff.IntraLineDiffArgs args ) { if ( computeIntraline ) { try { return intraCache.get ( key , intraLoaderFactory.create ( key , args ) ) ; } catch ( java.util.concurrent.ExecutionException | org.eclipse.jgit.errors.LargeObjectException e ) { IntraLineLoader.log.warn ( ( "Error computing " + key ) , e ) ; return new com.google.gerrit.server.diff.IntraLineDiff ( IntraLineDiff.Status.ERROR ) ; } } return new com.google.gerrit.server.diff.IntraLineDiff ( IntraLineDiff.Status.DISABLED ) ; }
Source:
private void testpushWithInvalidChangeId ( ) throws java.lang.Exception { com.google.gerrit.acceptance.git.AbstractPushForReview.createCommit ( testRepo , ( "Message with invalid Change-Id\n" + ( "\n" + "Change-Id: X\n" ) ) ) ; com.google.gerrit.acceptance.git.AbstractPushForReview.pushForReviewRejected ( testRepo , "invalid Change-Id line format in commit message footer" ) ; }

Target:
private void testpushWithInvalidChangeId ( ) throws java.lang.Exception { com.google.gerrit.acceptance.git.AbstractPushForReview.createCommit ( testRepo , ( "Message with invalid Change-Id\n" + ( "\n" + "Change-Id: X\n" ) ) ) ; com.google.gerrit.acceptance.git.AbstractPushForReview.pushForReviewRejected ( testRepo , "invalid Change-Id line format in commit message footer" ) ; com.google.gerrit.server.git.ProjectConfig config = projectCache.checkedGet ( project ) . getConfig ( ) ; config.getProject ( ) . setRequireChangeID ( InheritableBoolean.FALSE ) ; saveProjectConfig ( project , config ) ; com.google.gerrit.acceptance.git.AbstractPushForReview.pushForReviewRejected ( testRepo , "invalid Change-Id line format in commit message footer" ) ; }