auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private com.google.gerrit.extensions.common.EditInfo toEditInfo ( boolean files ) throws java.lang.Exception { com.google.gerrit.acceptance.RestResponse r = adminSession.get ( ( files ? urlGetFiles ( ) : urlEdit ( ) ) ) ; r.assertOK ( ) ; return newGson ( ) . fromJson ( r.getReader ( ) , com.google.gerrit.extensions.common.EditInfo.class ) ; }

Target:
private com.google.gerrit.extensions.common.EditInfo toEditInfo ( boolean files ) throws java.lang.Exception { com.google.gerrit.acceptance.RestResponse r = adminSession.get ( ( files ? urlGetFiles ( ) : urlEdit ( ) ) ) ; return readContentFromJson ( r , com.google.gerrit.extensions.common.EditInfo.class ) ; }
Source:
public void onSuccess ( com.google.gwt.core.client.JavaScriptObject msg ) { if ( com.google.gerrit.client.rpc.NativeString.is ( msg ) ) { com.google.gerrit.client.rpc.NativeString str = ( ( com.google.gerrit.client.rpc.NativeString ) ( msg ) ) ; if ( ! ( str.asString ( ) . isEmpty ( ) ) ) { com.google.gwt.user.client.Window.alert ( str.asString ( ) ) ; } } com.google.gerrit.client.Gerrit.display ( PageLinks.ADMIN_PROJECTS ) ; }

Target:
public void onSuccess ( com.google.gwt.core.client.JavaScriptObject msg ) { if ( com.google.gerrit.client.rpc.NativeString.is ( msg ) ) { com.google.gerrit.client.rpc.NativeString str = ( ( com.google.gerrit.client.rpc.NativeString ) ( msg ) ) ; if ( ! ( str.asString ( ) . isEmpty ( ) ) ) { com.google.gwt.user.client.Window.alert ( str.asString ( ) ) ; } } com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toProject ( project ) ) ; }
Source:
public int nextAccountId ( com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { @ java.lang.SuppressWarnings ( value = "deprecation" ) com.google.gerrit.server.notedb.RepoSequence.Seed accountSeed = ( ) -> db.nextAccountId ( ) ; com.google.gerrit.server.notedb.RepoSequence accountSeq = new com.google.gerrit.server.notedb.RepoSequence ( repoManager , new com.google.gerrit.reviewdb.client.Project.NameKey ( allUsersName.get ( ) ) , com.google.gerrit.server.Sequences.NAME_ACCOUNTS , accountSeed , 1 ) ; return accountSeq.next ( ) ; }

Target:
public int nextAccountId ( com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { @ java.lang.SuppressWarnings ( value = "deprecation" ) com.google.gerrit.server.notedb.RepoSequence.Seed accountSeed = ( ) -> db.nextAccountId ( ) ; com.google.gerrit.server.notedb.RepoSequence accountSeq = new com.google.gerrit.server.notedb.RepoSequence ( repoManager , com.google.gerrit.server.extensions.events.GitReferenceUpdated.DISABLED , new com.google.gerrit.reviewdb.client.Project.NameKey ( allUsersName.get ( ) ) , com.google.gerrit.server.Sequences.NAME_ACCOUNTS , accountSeed , 1 ) ; return accountSeq.next ( ) ; }
Source:
public java.lang.String getUrl ( ) { java.lang.String database = cfg.getString ( "database" , null , "database" ) ; if ( ( database == null ) || ( database.isEmpty ( ) ) ) { database = "db/ReviewDB" ; } java.io.File db = site.resolve ( database ) ; try { db = db.getCanonicalFile ( ) ; } catch ( java.io.IOException e ) { db = db.getAbsoluteFile ( ) ; } return "jdbc:h2:" + ( db.toURI ( ) . toString ( ) ) ; }

Target:
public java.lang.String getUrl ( ) { java.lang.String database = cfg.getString ( "database" , null , "database" ) ; if ( ( database == null ) || ( database.isEmpty ( ) ) ) { database = "db/ReviewDB" ; } return "jdbc:h2:" + ( site.resolve ( database ) . toUri ( ) . toString ( ) ) ; }
Source:
public static com.google.gerrit.acceptance.git.GitUtil.Commit amendCommit ( org.eclipse.jgit.api.Git git , org.eclipse.jgit.lib.PersonIdent i , java.lang.String msg , java.lang.String changeId ) throws java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { msg = org.eclipse.jgit.util.ChangeIdUtil.insertId ( msg , org.eclipse.jgit.lib.ObjectId.fromString ( changeId.substring ( 1 ) ) ) ; return com.google.gerrit.acceptance.git.GitUtil.createCommit ( git , i , msg , changeId ) ; }

Target:
public static com.google.gerrit.acceptance.GitUtil.Commit amendCommit ( org.eclipse.jgit.api.Git git , org.eclipse.jgit.lib.PersonIdent i , java.lang.String msg , java.lang.String changeId ) throws java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { msg = org.eclipse.jgit.util.ChangeIdUtil.insertId ( msg , org.eclipse.jgit.lib.ObjectId.fromString ( changeId.substring ( 1 ) ) ) ; return com.google.gerrit.acceptance.GitUtil.createCommit ( git , i , msg , changeId ) ; }
Source:
private java.lang.String readResponse ( java.io.InputStream responseStream ) { try { java.util.Scanner scanner ; scanner = new java.util.Scanner ( responseStream , "UTF-8" ) ; scanner.useDelimiter ( "\\A" ) ; return scanner.next ( ) ; } catch ( java.lang.Exception e ) { throw new java.lang.RuntimeException ( ( ( "Error reading response: [" + ( e.getMessage ( ) ) ) + "]." ) , e ) ; } }

Target:
private java.lang.String getResponse ( java.net.HttpURLConnection connection ) { try ( java.io.InputStream responseStream = getResponseStream ( connection ) ; java.util.Scanner scanner = new java.util.Scanner ( responseStream , java.nio.charset.StandardCharsets.UTF_8.name ( ) ) ) { scanner.useDelimiter ( "\\A" ) ; return scanner.next ( ) ; } catch ( java.io.IOException e ) { com.cisco.gerrit.plugins.slack.client.WebhookClient.LOGGER.debug ( ( "Error closing response stream: " + ( e.getMessage ( ) ) ) ) ; } return null ; }
Source:
public void fire ( com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.reviewdb.client.Account account , java.lang.String oldTopicName ) { if ( ! ( listeners.iterator ( ) . hasNext ( ) ) ) { return ; } try { fire ( util.changeInfo ( change ) , util.accountInfo ( account ) , oldTopicName ) ; } catch ( com.google.gwtorm.server.OrmException e ) { com.google.gerrit.server.extensions.events.TopicEdited.log.error ( "Couldn't fire event" , e ) ; } }

Target:
public void fire ( com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.reviewdb.client.Account account , java.lang.String oldTopicName , java.sql.Timestamp when ) { if ( ! ( listeners.iterator ( ) . hasNext ( ) ) ) { return ; } try { fire ( util.changeInfo ( change ) , util.accountInfo ( account ) , oldTopicName , when ) ; } catch ( com.google.gwtorm.server.OrmException e ) { com.google.gerrit.server.extensions.events.TopicEdited.log.error ( "Couldn't fire event" , e ) ; } }
Source:
public void onResize ( com.google.gwt.event.logical.shared.ResizeEvent event ) { if ( ( cmA ) != null ) { cmA.setHeight ( ( ( event.getHeight ( ) ) - ( com.google.gerrit.client.diff.SideBySide2.HEADER_FOOTER ) ) ) ; cmA.refresh ( ) ; } if ( ( cmB ) != null ) { cmB.setHeight ( ( ( event.getHeight ( ) ) - ( com.google.gerrit.client.diff.SideBySide2.HEADER_FOOTER ) ) ) ; cmB.refresh ( ) ; } }

Target:
net.codemirror.lib.CodeMirror getCmB ( ) { return cmB ; }
Source:
public < T > T execute ( com.google.gerrit.server.update.RetryHelper.ActionType actionType , com.google.gerrit.server.update.RetryHelper.Action < T > action , com.google.gerrit.server.update.RetryHelper.Options opts , com.google.common.base.Predicate < java.lang.Throwable > exceptionPredicate ) throws java.lang.Exception { try { return executeWithAttemptCount ( actionType , action , opts , exceptionPredicate ) ; } catch ( java.lang.Throwable t ) { com.google.common.base.Throwables.throwIfUnchecked ( t ) ; com.google.common.base.Throwables.throwIfInstanceOf ( t , java.lang.Exception.class ) ; throw new java.lang.IllegalStateException ( t ) ; } }

Target:
public < T > T execute ( com.google.gerrit.server.update.RetryHelper.ActionType actionType , com.google.gerrit.server.update.RetryHelper.Action < T > action , com.google.gerrit.server.update.RetryHelper.Options opts , com.google.common.base.Predicate < java.lang.Throwable > exceptionPredicate ) throws java.lang.Exception { try { return executeWithAttemptAndTimeoutCount ( actionType , action , opts , exceptionPredicate ) ; } catch ( java.lang.Throwable t ) { com.google.common.base.Throwables.throwIfUnchecked ( t ) ; com.google.common.base.Throwables.throwIfInstanceOf ( t , java.lang.Exception.class ) ; throw new java.lang.IllegalStateException ( t ) ; } }
Source:
public void stop ( ) { if ( ( scanner ) != null ) { scanner.end ( ) ; } synchronized ( this ) { boolean clean = ! ( running.isEmpty ( ) ) ; for ( com.google.gerrit.server.plugins.Plugin p : running.values ( ) ) { p.stop ( ) ; } running.clear ( ) ; broken.clear ( ) ; if ( clean ) { java.lang.System.gc ( ) ; processPendingCleanups ( ) ; } } }

Target:
public void stop ( ) { if ( ( scanner ) != null ) { scanner.end ( ) ; } srvInfoImpl.state = ServerInformation.State.SHUTDOWN ; synchronized ( this ) { for ( com.google.gerrit.server.plugins.Plugin p : running.values ( ) ) { p.stop ( ) ; } running.clear ( ) ; broken.clear ( ) ; if ( ( cleanupHandles.size ( ) ) > ( running.size ( ) ) ) { java.lang.System.gc ( ) ; processPendingCleanups ( ) ; } } }
Source:
public void parseBranch ( ) throws java.lang.Exception { assertParseSucceeds ( ( "Update change\n" + ( ( "\n" + "Patch-Set: 1\n" ) + "Branch: refs/heads/master" ) ) ) ; assertParseSucceeds ( ( "Update change\n" + ( ( "\n" + "Patch-Set: 1\n" ) + "Branch: master" ) ) ) ; assertParseFails ( ( "Update change\n" + ( ( ( "\n" + "Patch-Set: 1\n" ) + "Branch: refs/heads/master\n" ) + "Branch: refs/heads/stable" ) ) ) ; }

Target:
public void parseTopic ( ) throws java.lang.Exception { assertParseSucceeds ( ( "Update change\n" + ( ( ( ( "\n" + "Branch: refs/heads/master\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" ) + "Patch-Set: 1\n" ) + "Topic:\n" ) + "Subject: This is a test change\n" ) ) ) ; assertParseFails ( ( "Update change\n" + ( ( ( "\n" + "Patch-Set: 1\n" ) + "Topic: Some Topic\n" ) + "Topic: Other Topic" ) ) ) ; }
Source:
public boolean indexChange ( int changeId ) { try { com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpResponseHandler.HttpResult result = httpSession.post ( buildIndexEndpoint ( changeId ) ) ; if ( result.isSuccessful ( ) ) { return true ; } com.ericsson.gerrit.plugins.highavailability.forwarder.rest.RestForwarder.log.error ( "Unable to index change {}. Cause: {}" , changeId , result.getMessage ( ) ) ; } catch ( java.io.IOException e ) { com.ericsson.gerrit.plugins.highavailability.forwarder.rest.RestForwarder.log.error ( ( "Error trying to index change " + changeId ) , e ) ; } return false ; }

Target:
public boolean indexChange ( final int changeId ) { return new com.ericsson.gerrit.plugins.highavailability.forwarder.rest.RestForwarder.Request ( ( "index change " + changeId ) ) { @ java.lang.Override com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpResponseHandler.HttpResult send ( ) throws java.io.IOException { return httpSession.post ( buildIndexEndpoint ( changeId ) ) ; } } . execute ( ) ; }
Source:
private void appendHunkHeader ( final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder m , final com.google.gerrit.common.data.EditList.Hunk hunk ) { openLine ( m ) ; padLineNumber ( m ) ; padLineNumber ( m ) ; m.openTd ( ) ; m.addStyleName ( Gerrit.RESOURCES.css ( ) . diffText ( ) ) ; m.addStyleName ( Gerrit.RESOURCES.css ( ) . diffTextHunkHeader ( ) ) ; m.append ( "@@ -" ) ; appendRange ( m , ( ( hunk.getCurA ( ) ) + 1 ) , ( ( hunk.getEndA ( ) ) - ( hunk.getCurA ( ) ) ) ) ; m.append ( " +" ) ; appendRange ( m , ( ( hunk.getCurB ( ) ) + 1 ) , ( ( hunk.getEndB ( ) ) - ( hunk.getCurB ( ) ) ) ) ; m.append ( " @@" ) ; m.closeTd ( ) ; closeLine ( m ) ; }

Target:
private void appendHunkHeader ( final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder m , final com.google.gerrit.prettify.common.EditList.Hunk hunk ) { openLine ( m ) ; padLineNumber ( m ) ; padLineNumber ( m ) ; m.openTd ( ) ; m.addStyleName ( Gerrit.RESOURCES.css ( ) . diffText ( ) ) ; m.addStyleName ( Gerrit.RESOURCES.css ( ) . diffTextHunkHeader ( ) ) ; m.append ( "@@ -" ) ; appendRange ( m , ( ( hunk.getCurA ( ) ) + 1 ) , ( ( hunk.getEndA ( ) ) - ( hunk.getCurA ( ) ) ) ) ; m.append ( " +" ) ; appendRange ( m , ( ( hunk.getCurB ( ) ) + 1 ) , ( ( hunk.getEndB ( ) ) - ( hunk.getCurB ( ) ) ) ) ; m.append ( " @@" ) ; m.closeTd ( ) ; closeLine ( m ) ; }
Source:
public void run ( ) { net.codemirror.lib.CodeMirror.Viewport fromTo = cm.getViewport ( ) ; int size = ( ( fromTo.getTo ( ) ) - ( fromTo.getFrom ( ) ) ) + 1 ; if ( ( cm.getOldViewportSize ( ) ) == size ) { return ; } cm.setOldViewportSize ( size ) ; diffTable.sidePanel.adjustGutters ( cmB ) ; }

Target:
public void run ( ) { net.codemirror.lib.CodeMirror.Viewport fromTo = cm.getViewport ( ) ; int size = ( ( fromTo.getTo ( ) ) - ( fromTo.getFrom ( ) ) ) + 1 ; if ( ( cm.getOldViewportSize ( ) ) == size ) { return ; } cm.setOldViewportSize ( size ) ; diffTable.overview.adjustGutters ( cmB ) ; }
Source:
private java.lang.String url ( com.google.gerrit.client.info.FileInfo info ) { return ( ( diffScreenType ) == ( com.google.gerrit.client.diff.DiffScreen.DiffScreenType.UNIFIED ) ) || ( info.binary ( ) ) ? com.google.gerrit.client.Dispatcher.toUnified ( base , patchSetId , info.path ( ) ) : com.google.gerrit.client.Dispatcher.toSideBySide ( base , patchSetId , info.path ( ) ) ; }

Target:
private java.lang.String url ( com.google.gerrit.client.info.FileInfo info ) { return ( diffScreenType ) == ( com.google.gerrit.extensions.client.GeneralPreferencesInfo.DiffView.UNIFIED_DIFF ) ? com.google.gerrit.client.Dispatcher.toUnified ( base , patchSetId , info.path ( ) ) : com.google.gerrit.client.Dispatcher.toSideBySide ( base , patchSetId , info.path ( ) ) ; }
Source:
private static int index ( com.google.gerrit.common.data.Permission a ) { java.lang.String lc = ( a.isLabel ( ) ) ? com.google.gerrit.common.data.Permission.LABEL : a.getName ( ) . toLowerCase ( ) ; int index = com.google.gerrit.common.data.Permission.NAMES_LC.indexOf ( lc ) ; return 0 <= index ? index : com.google.gerrit.common.data.Permission.NAMES_LC.size ( ) ; }

Target:
private static int index ( com.google.gerrit.common.data.Permission a ) { if ( a.isLabel ( ) ) { return com.google.gerrit.common.data.Permission.labelIndex ; } int index = com.google.gerrit.common.data.Permission.NAMES_LC.indexOf ( a.getName ( ) . toLowerCase ( ) ) ; return 0 <= index ? index : com.google.gerrit.common.data.Permission.NAMES_LC.size ( ) ; }
Source:
private boolean flush ( final java.lang.String cacheName ) { return ( all ) || ( caches.contains ( cacheName ) ) ; }

Target:
private boolean flush ( final java.lang.String cacheName ) { if ( caches.contains ( cacheName ) ) { return true ; } else if ( all ) { if ( "web_sessions" . equals ( cacheName ) ) { return false ; } return true ; } else { return false ; } }
Source:
private static com.google.gerrit.client.rpc.RestApi api ( int id , java.lang.String action ) { return new com.google.gerrit.client.rpc.RestApi ( ( ( ( "/changes/" + id ) + "/" ) + action ) ) ; }

Target:
public static void cherrypick ( int id , java.lang.String commit , java.lang.String destination , java.lang.String message , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.changes.ChangeInfo > cb ) { com.google.gerrit.client.changes.ChangeApi.CherryPickInput cherryPickInput = com.google.gerrit.client.changes.ChangeApi.CherryPickInput.create ( ) ; cherryPickInput.setMessage ( message ) ; cherryPickInput.setDestination ( destination ) ; com.google.gerrit.client.changes.ChangeApi.call ( id , commit , "cherrypick" ) . post ( cherryPickInput , cb ) ; }
Source:
private void reindex ( com.google.gerrit.reviewdb.client.Change change ) throws com.google.gwtorm.server.OrmException , java.io.IOException { indexer.index ( reviewDb.get ( ) , change ) ; }

Target:
private void createEditReference ( org.eclipse.jgit.lib.Repository repository , com.google.gerrit.server.project.ChangeControl changeControl , com.google.gerrit.reviewdb.client.PatchSet basePatchSet , org.eclipse.jgit.lib.ObjectId newEditCommit , java.sql.Timestamp timestamp ) throws com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.reviewdb.client.Change change = changeControl.getChange ( ) ; java.lang.String editRefName = getEditRefName ( change , basePatchSet ) ; updateReference ( repository , editRefName , org.eclipse.jgit.lib.ObjectId.zeroId ( ) , newEditCommit , timestamp ) ; indexer.index ( reviewDb.get ( ) , change ) ; }
Source:
public void listGroupMembersRecursively ( ) throws java.lang.Exception { group ( "gx" , "Administrators" ) ; accounts.create ( "ux" , "gx" ) ; group ( "gy" , "Administrators" ) ; accounts.create ( "uy" , "gy" ) ; PUT ( "/groups/Administrators/groups/gx" ) ; PUT ( "/groups/gx/groups/gy" ) ; assertMembers ( GET ( "/groups/Administrators/members/?recursive" ) , admin.fullName , "ux" , "uy" ) ; }

Target:
public void listOneGroupMember ( ) throws java.lang.Exception { java.lang.String group = createGroup ( "group" ) ; java.lang.String user = createAccount ( "user1" , group ) ; assertMembers ( GET ( ( ( "/groups/" + group ) + "/members/" ) ) , user ) ; com.google.common.truth.Truth.assertThat ( GET_ONE ( ( ( ( "/groups/" + group ) + "/members/" ) + user ) ) . name ) . isEqualTo ( user ) ; }
Source:
public static boolean isPermission ( java.lang.String varName ) { java.lang.String lc = varName.toLowerCase ( ) ; if ( lc.startsWith ( com.google.gerrit.common.data.Permission.LABEL ) ) { return ( com.google.gerrit.common.data.Permission.LABEL.length ( ) ) < ( lc.length ( ) ) ; } return com.google.gerrit.common.data.Permission.NAMES_LC.contains ( lc ) ; }

Target:
public static boolean isLabelAs ( java.lang.String var ) { return ( var.startsWith ( com.google.gerrit.common.data.Permission.LABEL_AS ) ) && ( ( com.google.gerrit.common.data.Permission.LABEL_AS.length ( ) ) < ( var.length ( ) ) ) ; }
Source:
private com.google.gwtexpui.safehtml.client.SafeHtml showTrailingWhitespace ( com.google.gwtexpui.safehtml.client.SafeHtml src ) { final java.lang.String r = "<span class=\"wse\">$1</span>$2" ; src = src.replaceAll ( "([ \t][ \t]*)(\r?(</span>)?\n)" , r ) ; src = src.replaceFirst ( "([ \t][ \t]*)(\r?(</span>)?\n?)$" , r ) ; return src ; }

Target:
private com.google.gwtexpui.safehtml.client.SafeHtml showTrailingWhitespace ( com.google.gwtexpui.safehtml.client.SafeHtml src ) { final java.lang.String r = ( ( ( "<span class=\"wse\"" + " title=\"" ) + ( PrettifyConstants.C.wseTrailingSpace ( ) ) ) + "\"" ) + ">$1</span>$2" ; src = src.replaceAll ( "([ \t][ \t]*)(\r?(</span>)?\n)" , r ) ; src = src.replaceFirst ( "([ \t][ \t]*)(\r?(</span>)?\n?)$" , r ) ; return src ; }
Source:
protected void run ( ) throws com.google.gerrit.sshd.commands.UnloggedFailure { try { if ( luceneVersionManager.activateLatestIndex ( name ) ) { stdout.println ( "Activated latest index version" ) ; } else { stdout.println ( "Not activating index, already using latest version" ) ; } } catch ( com.google.gerrit.lucene.ReindexerAlreadyRunningException e ) { throw die ( ( "Failed to activate latest index: " + ( e.getMessage ( ) ) ) ) ; } }

Target:
protected void run ( ) throws com.google.gerrit.sshd.commands.UnloggedFailure { try { if ( luceneVersionManager.activateLatestIndex ( name ) ) { stdout.println ( "Activated latest index version" ) ; } else { stdout.println ( "Not activating index, already using latest version" ) ; } } catch ( com.google.gerrit.server.index.ReindexerAlreadyRunningException e ) { throw die ( ( "Failed to activate latest index: " + ( e.getMessage ( ) ) ) ) ; } }
Source:
private void enable ( final boolean on ) { showSiteHeader.setEnabled ( on ) ; useFlashClipboard.setEnabled ( on ) ; copySelfOnEmails.setEnabled ( on ) ; displayPatchSetsInReverseOrder.setEnabled ( on ) ; maximumPageSize.setEnabled ( on ) ; dateFormat.setEnabled ( on ) ; timeFormat.setEnabled ( on ) ; }

Target:
private void enable ( final boolean on ) { showSiteHeader.setEnabled ( on ) ; useFlashClipboard.setEnabled ( on ) ; copySelfOnEmails.setEnabled ( on ) ; displayPatchSetsInReverseOrder.setEnabled ( on ) ; displayPersonNameInReviewCategory.setEnabled ( on ) ; maximumPageSize.setEnabled ( on ) ; dateFormat.setEnabled ( on ) ; timeFormat.setEnabled ( on ) ; }
Source:
public static com.google.common.cache.CacheBuilder < com.google.gitiles.blame.BlameCacheImpl.Key , java.util.List < com.google.gitiles.blame.Region > > newBuilder ( ) { return com.google.common.cache.CacheBuilder.newBuilder ( ) . weigher ( new com.google.common.cache.Weigher < com.google.gitiles.blame.BlameCacheImpl.Key , java.util.List < com.google.gitiles.blame.Region > > ( ) { @ java.lang.Override public int weigh ( com.google.gitiles.blame.BlameCacheImpl.Key key , java.util.List < com.google.gitiles.blame.Region > value ) { return value.size ( ) ; } } ) . maximumWeight ( ( 10 << 10 ) ) ; }

Target:
public static com.google.common.cache.CacheBuilder < com.google.gitiles.blame.BlameCacheImpl.Key , java.util.List < com.google.gitiles.blame.Region > > defaultBuilder ( ) { return com.google.gitiles.blame.BlameCacheImpl.weigher ( com.google.common.cache.CacheBuilder.newBuilder ( ) ) . maximumWeight ( ( 10 << 10 ) ) ; }
Source:
private com.google.inject.Injector createSshInjector ( ) { final java.util.List < com.google.inject.Module > modules = new java.util.ArrayList < com.google.inject.Module > ( ) ; modules.add ( new com.google.gerrit.sshd.SshModule ( ) ) ; if ( slave ) { modules.add ( new com.google.gerrit.sshd.commands.SlaveCommandModule ( ) ) ; } else { modules.add ( new com.google.gerrit.sshd.commands.MasterCommandModule ( ) ) ; } return sysInjector.createChildInjector ( modules ) ; }

Target:
private com.google.inject.Injector createSshInjector ( ) { final java.util.List < com.google.inject.Module > modules = new java.util.ArrayList < com.google.inject.Module > ( ) ; if ( sshd ) { modules.add ( new com.google.gerrit.sshd.SshModule ( ) ) ; if ( slave ) { modules.add ( new com.google.gerrit.sshd.commands.SlaveCommandModule ( ) ) ; } else { modules.add ( new com.google.gerrit.sshd.commands.MasterCommandModule ( ) ) ; } } else { modules.add ( new com.google.gerrit.server.ssh.NoSshModule ( ) ) ; } return sysInjector.createChildInjector ( modules ) ; }
Source:
public com.google.common.collect.ImmutableSetMultimap < com.google.gerrit.server.notedb.ReviewerStateInternal , com.google.gerrit.reviewdb.client.Account.Id > getReviewers ( com.google.gerrit.server.notedb.ChangeNotes notes , java.lang.Iterable < com.google.gerrit.reviewdb.client.PatchSetApproval > allApprovals ) throws com.google.gwtorm.server.OrmException { if ( ! ( migration.readChanges ( ) ) ) { return com.google.gerrit.server.ApprovalsUtil.getReviewers ( allApprovals ) ; } return notes.load ( ) . getReviewers ( ) ; }

Target:
public com.google.gerrit.server.ReviewerSet getReviewers ( com.google.gerrit.server.notedb.ChangeNotes notes , java.lang.Iterable < com.google.gerrit.reviewdb.client.PatchSetApproval > allApprovals ) throws com.google.gwtorm.server.OrmException { if ( ! ( migration.readChanges ( ) ) ) { return com.google.gerrit.server.ReviewerSet.fromApprovals ( allApprovals ) ; } return notes.load ( ) . getReviewers ( ) ; }
Source:
public UiAction.Description getDescription ( com.google.gerrit.server.change.RevisionResource resource ) { com.google.gerrit.reviewdb.client.PatchSet.Id current = resource.getChange ( ) . currentPatchSetId ( ) ; return new com.google.gerrit.extensions.webui.UiAction.Description ( ) . setLabel ( java.lang.String.format ( "Submit Revision %d" , resource.getPatchSet ( ) . getPatchSetId ( ) ) ) . setVisible ( ( ( ( resource.getChange ( ) . getStatus ( ) . isOpen ( ) ) && ( resource.getPatchSet ( ) . getId ( ) . equals ( current ) ) ) && ( resource.getControl ( ) . canSubmit ( ) ) ) ) ; }

Target:
public UiAction.Description getDescription ( com.google.gerrit.server.change.RevisionResource resource ) { com.google.gerrit.reviewdb.client.PatchSet.Id current = resource.getChange ( ) . currentPatchSetId ( ) ; return new com.google.gerrit.extensions.webui.UiAction.Description ( ) . setTitle ( java.lang.String.format ( "Submit Revision %d" , resource.getPatchSet ( ) . getPatchSetId ( ) ) ) . setVisible ( ( ( ( resource.getChange ( ) . getStatus ( ) . isOpen ( ) ) && ( resource.getPatchSet ( ) . getId ( ) . equals ( current ) ) ) && ( resource.getControl ( ) . canSubmit ( ) ) ) ) ; }
Source:
protected void preDisplay ( final com.google.gerrit.common.data.GroupDetail result ) { display ( result ) ; }

Target:
protected void preDisplay ( final com.google.gerrit.common.data.GroupDetail result ) { groupId = result.group.getId ( ) ; groupUUID = result.group.getGroupUUID ( ) ; display ( result ) ; enableForm ( result.canModify ) ; saveName.setVisible ( result.canModify ) ; saveOwner.setVisible ( result.canModify ) ; saveDesc.setVisible ( result.canModify ) ; saveGroupOptions.setVisible ( result.canModify ) ; delMember.setVisible ( result.canModify ) ; saveType.setVisible ( result.canModify ) ; delInclude.setVisible ( result.canModify ) ; }
Source:
public void dontSkipForOtherOps ( ) throws java.lang.Exception { java.lang.String config = "[plugin \"uploadvalidator\"]\n" + ( ( "skipValidation=testOp\n" + "skipGroup=testGroup\n" ) + "skipGroup=anotherGroup" ) ; com.googlesource.gerrit.plugins.uploadvalidator.ValidatorConfig validatorConfig = new com.googlesource.gerrit.plugins.uploadvalidator.ValidatorConfig ( new com.googlesource.gerrit.plugins.uploadvalidator.FakeConfigFactory ( projectName , config ) , new com.googlesource.gerrit.plugins.uploadvalidator.FakeGroupCacheUUIDByName ( ) ) ; com.google.common.truth.Truth.assertThat ( validatorConfig.isEnabledForRef ( anyUser , projectName , "anyRef" , "anotherOp" ) ) . isTrue ( ) ; }

Target:
public void dontSkipForOtherOps ( ) throws java.lang.Exception { java.lang.String config = "[plugin \"uploadvalidator\"]\n" + ( ( "skipValidation=testOp\n" + "skipGroup=testGroup\n" ) + "skipGroup=anotherGroup" ) ; com.googlesource.gerrit.plugins.uploadvalidator.ValidatorConfig validatorConfig = new com.googlesource.gerrit.plugins.uploadvalidator.ValidatorConfig ( new com.googlesource.gerrit.plugins.uploadvalidator.FakeConfigFactory ( projectName , config ) , new com.googlesource.gerrit.plugins.uploadvalidator.FakeGroupByNameFinder ( ) ) ; com.google.common.truth.Truth.assertThat ( validatorConfig.isEnabledForRef ( anyUser , projectName , "anyRef" , "anotherOp" ) ) . isTrue ( ) ; }
Source:
public java.util.Map < java.lang.String , com.google.gerrit.extensions.api.access.ProjectAccessInfo > apply ( com.google.gerrit.extensions.restapi.TopLevelResource resource ) throws com.google.gerrit.extensions.restapi.ResourceConflictException , com.google.gerrit.extensions.restapi.ResourceNotFoundException , java.io.IOException { java.util.Map < java.lang.String , com.google.gerrit.extensions.api.access.ProjectAccessInfo > access = new java.util.TreeMap < > ( ) ; for ( java.lang.String p : projects ) { com.google.gerrit.reviewdb.client.Project.NameKey projectName = new com.google.gerrit.reviewdb.client.Project.NameKey ( p ) ; access.put ( p , getAccess.apply ( projectName ) ) ; } return access ; }

Target:
public java.util.Map < java.lang.String , com.google.gerrit.extensions.api.access.ProjectAccessInfo > apply ( com.google.gerrit.extensions.restapi.TopLevelResource resource ) throws com.google.gerrit.extensions.restapi.ResourceConflictException , com.google.gerrit.extensions.restapi.ResourceNotFoundException , com.google.gerrit.server.permissions.PermissionBackendException , java.io.IOException { java.util.Map < java.lang.String , com.google.gerrit.extensions.api.access.ProjectAccessInfo > access = new java.util.TreeMap < > ( ) ; for ( java.lang.String p : projects ) { access.put ( p , getAccess.apply ( new com.google.gerrit.reviewdb.client.Project.NameKey ( p ) ) ) ; } return access ; }
Source:
public com.google.gerrit.extensions.common.AccountInfo get ( ) throws com.google.gerrit.extensions.restapi.RestApiException { com.google.gerrit.server.account.AccountLoader accountLoader = accountLoaderFactory.create ( true ) ; try { com.google.gerrit.extensions.common.AccountInfo ai = accountLoader.get ( account.getUser ( ) . getAccountId ( ) ) ; accountLoader.fill ( ) ; return ai ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot parse change" , e ) ; } }

Target:
public com.google.gerrit.extensions.common.AccountInfo get ( ) throws com.google.gerrit.extensions.restapi.RestApiException { com.google.gerrit.server.account.AccountLoader accountLoader = accountLoaderFactory.create ( true ) ; try { com.google.gerrit.extensions.common.AccountInfo ai = accountLoader.get ( account.getUser ( ) . getAccountId ( ) ) ; accountLoader.fill ( ) ; return ai ; } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( "Cannot parse change" , e ) ; } }
Source:
private void checkDownloadScheme ( com.google.gerrit.extensions.client.AccountGeneralPreferencesInfo p ) throws com.google.gerrit.extensions.restapi.BadRequestException { if ( com.google.common.base.Strings.isNullOrEmpty ( p.downloadScheme ) ) { return ; } for ( com.google.gerrit.extensions.registration.DynamicMap.Entry < com.google.gerrit.extensions.config.DownloadScheme > e : downloadSchemes ) { if ( ( e.getExportName ( ) . equals ( p.downloadScheme ) ) && ( e.getProvider ( ) . get ( ) . isEnabled ( ) ) ) { return ; } } throw new com.google.gerrit.extensions.restapi.BadRequestException ( ( "Unsupported download scheme: " + ( p.downloadScheme ) ) ) ; }

Target:
private void checkDownloadScheme ( java.lang.String downloadScheme ) throws com.google.gerrit.extensions.restapi.BadRequestException { if ( com.google.common.base.Strings.isNullOrEmpty ( downloadScheme ) ) { return ; } for ( com.google.gerrit.extensions.registration.DynamicMap.Entry < com.google.gerrit.extensions.config.DownloadScheme > e : downloadSchemes ) { if ( ( e.getExportName ( ) . equals ( downloadScheme ) ) && ( e.getProvider ( ) . get ( ) . isEnabled ( ) ) ) { return ; } } throw new com.google.gerrit.extensions.restapi.BadRequestException ( ( "Unsupported download scheme: " + downloadScheme ) ) ; }
Source:
public void fire ( com.google.gerrit.extensions.common.ChangeInfo change , com.google.gerrit.extensions.common.AccountInfo editor , java.lang.String oldTopic ) { if ( ! ( listeners.iterator ( ) . hasNext ( ) ) ) { return ; } com.google.gerrit.server.extensions.events.TopicEdited.Event event = new com.google.gerrit.server.extensions.events.TopicEdited.Event ( change , editor , oldTopic ) ; for ( com.google.gerrit.extensions.events.TopicEditedListener l : listeners ) { try { l.onTopicEdited ( event ) ; } catch ( java.lang.Exception e ) { com.google.gerrit.server.extensions.events.TopicEdited.log.warn ( "Error in event listener" , e ) ; } } }

Target:
public void fire ( com.google.gerrit.extensions.common.ChangeInfo change , com.google.gerrit.extensions.common.AccountInfo editor , java.lang.String oldTopic , java.sql.Timestamp when ) { if ( ! ( listeners.iterator ( ) . hasNext ( ) ) ) { return ; } com.google.gerrit.server.extensions.events.TopicEdited.Event event = new com.google.gerrit.server.extensions.events.TopicEdited.Event ( change , editor , oldTopic , when ) ; for ( com.google.gerrit.extensions.events.TopicEditedListener l : listeners ) { try { l.onTopicEdited ( event ) ; } catch ( java.lang.Exception e ) { com.google.gerrit.server.extensions.events.TopicEdited.log.warn ( "Error in event listener" , e ) ; } } }
Source:
public void renameColumn ( java.sql.Statement stmt , java.lang.String tableName , java.lang.String fromColumn , com.google.gwtorm.schema.ColumnModel col ) throws java.sql.SQLException { final java.lang.StringBuilder r = new java.lang.StringBuilder ( ) ; r.append ( "ALTER TABLE " ) ; r.append ( tableName ) ; r.append ( " ALTER COLUMN " ) ; r.append ( fromColumn ) ; r.append ( " RENAME TO " ) ; r.append ( col.getColumnName ( ) ) ; stmt.execute ( r.toString ( ) ) ; }

Target:
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 ( " ALTER COLUMN " ) ; r.append ( fromColumn ) ; r.append ( " RENAME TO " ) ; r.append ( col.getColumnName ( ) ) ; stmt.execute ( r.toString ( ) ) ; }
Source:
protected void configure ( ) { bind ( com.google.gerrit.git.PushReplication.ReplicationConfig.class ) . toInstance ( this ) ; bind ( org.eclipse.jgit.transport.RemoteConfig.class ) . toInstance ( remote ) ; bind ( PushOp.Factory.class ) . toProvider ( com.google.inject.assistedinject.FactoryProvider.newFactory ( PushOp.Factory.class , com.google.gerrit.git.PushOp.class ) ) ; }

Target:
protected void configure ( ) { bind ( com.google.gerrit.server.CurrentUser.class ) . toInstance ( remoteUser ) ; }
Source:
public void newPatchSetByOwnerOnReviewableChangeToWipInNoteDb ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isTrue ( ) ; com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) ; pushTo ( sc , "refs/for/master%wip" , sc.owner ) ; assertThat ( sender ) . sent ( "newpatchset" , sc ) . notTo ( sc.owner ) . to ( sc.reviewer ) . to ( sc.reviewerByEmail ) . cc ( sc.ccer ) . cc ( sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) ; }

Target:
public void newPatchSetOnWipChange ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageWipChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) ; pushTo ( sc , "refs/for/master%wip" , sc.owner ) ; assertThat ( sender ) . notSent ( ) ; }
Source:
public final void check ( com.google.gerrit.server.schema.UpdateUI ui , com.google.gerrit.reviewdb.client.CurrentSchemaVersion curr , com.google.gerrit.reviewdb.server.ReviewDb db , boolean toTargetVersion ) throws com.google.gwtorm.server.OrmException , java.sql.SQLException { if ( ( curr.versionNbr ) == ( versionNbr ) ) { } else { upgradeFrom ( ui , curr , db , toTargetVersion ) ; } }

Target:
public final void check ( com.google.gerrit.server.schema.UpdateUI ui , com.google.gerrit.reviewdb.client.CurrentSchemaVersion curr , com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException , java.sql.SQLException { if ( ( curr.versionNbr ) == ( versionNbr ) ) { } else if ( ( curr.versionNbr ) > ( versionNbr ) ) { throw new com.google.gwtorm.server.OrmException ( ( ( ( ( "Cannot downgrade database schema from version " + ( curr.versionNbr ) ) + " to " ) + ( versionNbr ) ) + "." ) ) ; } else { upgradeFrom ( ui , curr , db ) ; } }
Source:
public void mySshKeys ( final com.google.gwt.user.client.rpc.AsyncCallback < java.util.List < com.google.gerrit.reviewdb.AccountSshKey > > callback ) { run ( callback , new com.google.gerrit.httpd.rpc.account.Action < java.util.List < com.google.gerrit.reviewdb.AccountSshKey > > ( ) { public java.util.List < com.google.gerrit.reviewdb.AccountSshKey > run ( com.google.gerrit.reviewdb.ReviewDb db ) throws com.google.gwtorm.client.OrmException { return db.accountSshKeys ( ) . byAccount ( getAccountId ( ) ) . toList ( ) ; } } ) ; }

Target:
public void mySshKeys ( final com.google.gwt.user.client.rpc.AsyncCallback < java.util.List < com.google.gerrit.reviewdb.AccountSshKey > > callback ) { run ( callback , new com.google.gerrit.httpd.rpc.account.Action < java.util.List < com.google.gerrit.reviewdb.AccountSshKey > > ( ) { public java.util.List < com.google.gerrit.reviewdb.AccountSshKey > run ( com.google.gerrit.reviewdb.ReviewDb db ) throws com.google.gwtorm.client.OrmException { com.google.gerrit.server.IdentifiedUser u = user.get ( ) ; return db.accountSshKeys ( ) . byAccount ( u.getAccountId ( ) ) . toList ( ) ; } } ) ; }
Source:
public void onError ( com.google.gwt.http.client.Request req , java.lang.Throwable err ) { RpcStatus.INSTANCE.onRpcComplete ( ) ; if ( err.getMessage ( ) . contains ( "XmlHttpRequest.status" ) ) { cb.onFailure ( new com.google.gwt.user.client.rpc.StatusCodeException ( com.google.gerrit.client.rpc.RestApi.SC_UNAVAILABLE , RpcConstants.C.errorServerUnavailable ( ) ) ) ; } else { cb.onFailure ( new com.google.gwt.user.client.rpc.StatusCodeException ( com.google.gerrit.client.rpc.RestApi.SC_TRANSPORT , err.getMessage ( ) ) ) ; } }

Target:
public void onError ( com.google.gwt.http.client.Request req , java.lang.Throwable err ) { RpcStatus.INSTANCE.onRpcComplete ( ) ; if ( err.getMessage ( ) . contains ( "XmlHttpRequest.status" ) ) { cb.onFailure ( new com.google.gwt.user.client.rpc.StatusCodeException ( com.google.gerrit.client.rpc.RestApi.SC_UNAVAILABLE , RpcConstants.C.errorServerUnavailable ( ) ) ) ; } else { cb.onFailure ( new com.google.gwt.user.client.rpc.StatusCodeException ( com.google.gerrit.client.rpc.RestApi.SC_BAD_TRANSPORT , err.getMessage ( ) ) ) ; } }
Source:
private com.google.inject.Injector createSysInjector ( ) { final java.util.List < com.google.inject.Module > modules = new java.util.ArrayList < com.google.inject.Module > ( ) ; modules.add ( cfgInjector.getInstance ( com.google.gerrit.server.config.GerritGlobalModule.class ) ) ; modules.add ( new com.google.gerrit.server.mail.SmtpEmailSender.Module ( ) ) ; modules.add ( new com.google.gerrit.server.config.CanonicalWebUrlModule ( ) { @ java.lang.Override protected java.lang.Class < ? extends com.google.inject.Provider < java.lang.String > > provider ( ) { return com.google.gerrit.httpd.HttpCanonicalWebUrlProvider.class ; } } ) ; modules.add ( new com.google.gerrit.server.config.MasterNodeStartup ( ) ) ; return cfgInjector.createChildInjector ( modules ) ; }

Target:
private com.google.inject.Injector createSysInjector ( ) { final java.util.List < com.google.inject.Module > modules = new java.util.ArrayList < com.google.inject.Module > ( ) ; modules.add ( new com.google.gerrit.server.git.WorkQueue.Module ( ) ) ; modules.add ( cfgInjector.getInstance ( com.google.gerrit.server.config.GerritGlobalModule.class ) ) ; modules.add ( new com.google.gerrit.server.mail.SmtpEmailSender.Module ( ) ) ; modules.add ( new com.google.gerrit.server.config.CanonicalWebUrlModule ( ) { @ java.lang.Override protected java.lang.Class < ? extends com.google.inject.Provider < java.lang.String > > provider ( ) { return com.google.gerrit.httpd.HttpCanonicalWebUrlProvider.class ; } } ) ; modules.add ( new com.google.gerrit.server.config.MasterNodeStartup ( ) ) ; return cfgInjector.createChildInjector ( modules ) ; }
Source:
private org.apache.lucene.document.Document toDocument ( com.google.gerrit.server.query.change.ChangeData cd ) throws java.io.IOException { try { org.apache.lucene.document.Document result = new org.apache.lucene.document.Document ( ) ; for ( com.google.gerrit.server.index.Schema.Values < com.google.gerrit.server.query.change.ChangeData > vs : schema.buildFields ( cd , fillArgs ) ) { if ( ( vs.getValues ( ) ) != null ) { add ( result , vs ) ; } } return result ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new java.io.IOException ( e ) ; } }

Target:
static org.apache.lucene.index.Term idTerm ( com.google.gerrit.server.query.change.ChangeData cd ) { return com.google.gerrit.lucene.QueryBuilder.intTerm ( com.google.gerrit.server.index.change.ChangeField.LEGACY_ID.getName ( ) , cd.getId ( ) . get ( ) ) ; }
Source:
private java.util.List < com.google.gerrit.server.data.ChangeAttribute > executeSuccessfulQuery ( java.lang.String params ) throws java.lang.Exception { java.lang.String rawResponse = sshSession.exec ( ( "gerrit query --format=JSON " + params ) ) ; com.google.common.truth.Truth.assert_ ( ) . withFailureMessage ( sshSession.getError ( ) ) . that ( sshSession.hasError ( ) ) . isFalse ( ) ; return com.google.gerrit.acceptance.ssh.QueryIT.getChanges ( rawResponse ) ; }

Target:
private java.util.List < com.google.gerrit.server.data.ChangeAttribute > executeSuccessfulQuery ( java.lang.String params , com.google.gerrit.acceptance.SshSession session ) throws java.lang.Exception { java.lang.String rawResponse = session.exec ( ( "gerrit query --format=JSON " + params ) ) ; com.google.common.truth.Truth.assert_ ( ) . withFailureMessage ( session.getError ( ) ) . that ( session.hasError ( ) ) . isFalse ( ) ; return com.google.gerrit.acceptance.ssh.QueryIT.getChanges ( rawResponse ) ; }
Source:
public com.google.gerrit.server.git.MetaDataUpdate create ( com.google.gerrit.reviewdb.client.Project.NameKey name , com.google.gerrit.server.IdentifiedUser user ) throws java.io.IOException , org.eclipse.jgit.errors.RepositoryNotFoundException { com.google.gerrit.server.git.MetaDataUpdate md = factory.create ( name , mgr.openRepository ( name ) ) ; md.getCommitBuilder ( ) . setAuthor ( createPersonIdent ( user ) ) ; md.getCommitBuilder ( ) . setCommitter ( serverIdent ) ; return md ; }

Target:
public com.google.gerrit.server.git.MetaDataUpdate create ( com.google.gerrit.reviewdb.client.Project.NameKey name , com.google.gerrit.server.IdentifiedUser user , org.eclipse.jgit.lib.BatchRefUpdate batch ) throws java.io.IOException , org.eclipse.jgit.errors.RepositoryNotFoundException { com.google.gerrit.server.git.MetaDataUpdate md = factory.create ( name , mgr.openRepository ( name ) , batch ) ; md.getCommitBuilder ( ) . setAuthor ( createPersonIdent ( user ) ) ; md.getCommitBuilder ( ) . setCommitter ( serverIdent ) ; return md ; }
Source:
private java.util.List < com.google.gerrit.common.data.SubmitRecord > ruleError ( java.lang.String err , java.lang.Exception e ) { if ( logErrors ) { com.google.gerrit.server.project.SubmitRuleEvaluator.log.error ( err , e ) ; return com.google.gerrit.server.project.SubmitRuleEvaluator.defaultRuleError ( ) ; } else { return com.google.gerrit.server.project.SubmitRuleEvaluator.createRuleError ( err ) ; } }

Target:
private com.google.gerrit.common.data.SubmitTypeRecord typeError ( java.lang.String err , java.lang.Exception e ) { if ( logErrors ) { if ( e == null ) { com.google.gerrit.server.project.SubmitRuleEvaluator.log.error ( err ) ; } else { com.google.gerrit.server.project.SubmitRuleEvaluator.log.error ( err , e ) ; } return com.google.gerrit.server.project.SubmitRuleEvaluator.defaultTypeError ( ) ; } else { return com.google.gerrit.server.project.SubmitRuleEvaluator.createTypeError ( err ) ; } }
Source:
private static java.lang.String getPluginVersion ( java.io.File srcFile ) { java.lang.String srcFileName = srcFile.getName ( ) ; int startPos = srcFileName.lastIndexOf ( '-' ) ; if ( startPos == ( - 1 ) ) { return "0" ; } int endPos = srcFileName.lastIndexOf ( '.' ) ; return srcFileName.substring ( ( startPos + 1 ) , endPos ) ; }

Target:
private static java.lang.String getPluginVersion ( java.nio.file.Path srcFile ) { java.lang.String srcFileName = srcFile.getFileName ( ) . toString ( ) ; int startPos = srcFileName.lastIndexOf ( '-' ) ; if ( startPos == ( - 1 ) ) { return "0" ; } int endPos = srcFileName.lastIndexOf ( '.' ) ; return srcFileName.substring ( ( startPos + 1 ) , endPos ) ; }
Source:
public void testCreate_NotExisting ( ) throws java.io.FileNotFoundException { final java.io.File root = random ( ) ; final com.google.gerrit.server.config.SitePaths site = new com.google.gerrit.server.config.SitePaths ( root ) ; assertTrue ( site.isNew ) ; assertEquals ( root , site.site_path ) ; assertEquals ( new java.io.File ( root , "etc" ) , site.etc_dir ) ; }

Target:
public void testCreate_NotExisting ( ) throws java.io.IOException { final java.io.File root = com.google.gerrit.server.config.SitePathsTest.random ( ) ; final com.google.gerrit.server.config.SitePaths site = new com.google.gerrit.server.config.SitePaths ( root ) ; assertTrue ( site.isNew ) ; assertEquals ( root , site.site_path ) ; assertEquals ( new java.io.File ( root , "etc" ) , site.etc_dir ) ; }
Source:
public com.google.gerrit.extensions.restapi.Response < ? > apply ( com.google.gerrit.server.project.TagResource resource , com.google.gerrit.server.project.DeleteTag.Input input ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gwtorm.server.OrmException , java.io.IOException { java.lang.String tag = com.google.gerrit.server.project.RefUtil.normalizeTagRef ( resource.getTagInfo ( ) . ref ) ; com.google.gerrit.server.project.RefControl refControl = resource.getControl ( ) . controlForRef ( tag ) ; if ( ! ( refControl.canDelete ( ) ) ) { throw new com.google.gerrit.extensions.restapi.AuthException ( "Cannot delete tag" ) ; } deleteRefFactory.create ( resource ) . ref ( tag ) . delete ( ) ; return com.google.gerrit.extensions.restapi.Response.none ( ) ; }

Target:
public com.google.gerrit.extensions.restapi.Response < ? > apply ( com.google.gerrit.server.project.TagResource resource , com.google.gerrit.server.project.DeleteTag.Input input ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.permissions.PermissionBackendException , com.google.gwtorm.server.OrmException , java.io.IOException { java.lang.String tag = com.google.gerrit.server.project.RefUtil.normalizeTagRef ( resource.getTagInfo ( ) . ref ) ; permissionBackend.user ( user ) . project ( resource.getNameKey ( ) ) . ref ( tag ) . check ( RefPermission.DELETE ) ; deleteRefFactory.create ( resource ) . ref ( tag ) . delete ( ) ; return com.google.gerrit.extensions.restapi.Response.none ( ) ; }
Source:
public void patchSetObjectAndRefMissing ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = insertChange ( ) ; 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 , ( "Ref missing: " + ( ps.getId ( ) . toRefName ( ) ) ) , "Object missing: patch set 1: deadbeefdeadbeefdeadbeefdeadbeefdeadbeef" ) ; }

Target:
public void patchSetObjectAndRefMissing ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = insertChange ( ) ; com.google.gerrit.reviewdb.client.PatchSet ps = com.google.gerrit.testutil.TestChanges.newPatchSet ( c.currentPatchSetId ( ) , org.eclipse.jgit.lib.ObjectId.fromString ( "deadbeefdeadbeefdeadbeefdeadbeefdeadbeef" ) , adminId ) ; db.patchSets ( ) . insert ( java.util.Collections.singleton ( ps ) ) ; assertProblems ( c , ( "Ref missing: " + ( ps.getId ( ) . toRefName ( ) ) ) , "Object missing: patch set 1: deadbeefdeadbeefdeadbeefdeadbeefdeadbeef" ) ; }
Source:
public java.lang.String toString ( ) { if ( ( psId ) != null ) { return psId.getId ( ) ; } return null ; }

Target:
public java.lang.String asString ( ) { if ( autoMerge ) { if ( ( com.google.gerrit.client.Gerrit.getUserPreferences ( ) . defaultBaseForMerges ( ) ) != ( com.google.gerrit.extensions.client.GeneralPreferencesInfo.DefaultBase.AUTO_MERGE ) ) { return com.google.gerrit.client.DiffObject.AUTO_MERGE ; } return null ; } if ( ( psId ) != null ) { return psId.getId ( ) ; } return null ; }
Source:
public void setAssigneeOnReviewableChangeByOwnerCcingSelf ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; assign ( sc , sc.owner , sc.assignee , com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy.CC_ON_OWN_COMMENTS ) ; assertThat ( sender ) . sent ( "setassignee" , sc ) . notTo ( sc.reviewer , sc.ccer , sc.starrer ) . cc ( sc.owner ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . to ( sc.assignee ) ; }

Target:
public void setAssigneeOnReviewableChangeByOwnerCcingSelf ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; assign ( sc , sc.owner , sc.assignee , com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy.CC_ON_OWN_COMMENTS ) ; assertThat ( sender ) . sent ( "setassignee" , sc ) . cc ( sc.owner ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . to ( sc.assignee ) . noOneElse ( ) ; }