auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
void addChange ( java.lang.String token ) { try { addChangeImpl ( token ) ; } catch ( com.google.gerrit.sshd.commands.UnloggedFailure e ) { throw new java.lang.IllegalArgumentException ( e.getMessage ( ) , e ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new java.lang.IllegalArgumentException ( "database is down" , e ) ; } }

Target:
void addChange ( java.lang.String token ) { try { changeArgumentParser.addChange ( token , changes , projectControl ) ; } catch ( com.google.gerrit.sshd.commands.UnloggedFailure e ) { throw new java.lang.IllegalArgumentException ( e.getMessage ( ) , e ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new java.lang.IllegalArgumentException ( "database is down" , e ) ; } }
Source:
private java.lang.String readCookie ( ) { final javax.servlet.http.Cookie [ ] all = request.getCookies ( ) ; if ( all != null ) { for ( final javax.servlet.http.Cookie c : all ) { if ( com.google.gerrit.httpd.CacheBasedWebSession.ACCOUNT_COOKIE.equals ( c.getName ( ) ) ) { final java.lang.String v = c.getValue ( ) ; return ( v != null ) && ( ! ( "" . equals ( v ) ) ) ? v : null ; } } } return null ; }

Target:
private void authFromCookie ( java.lang.String cookie ) { key = new com.google.gerrit.httpd.WebSessionManager.Key ( cookie ) ; val = manager.get ( key ) ; java.lang.String token = request.getHeader ( HostPageData.XSRF_HEADER_NAME ) ; if ( ( ( ( val ) != null ) && ( token != null ) ) && ( token.equals ( val.getAuth ( ) ) ) ) { okPaths.add ( AccessPath.REST_API ) ; } }
Source:
public void onSuccess ( com.google.gerrit.client.projects.ProjectMap result ) { projects.display ( result ) ; }

Target:
public void onSuccess ( com.google.gerrit.client.projects.ProjectMap result ) { if ( open && ( ( result.values ( ) . length ( ) ) > 0 ) ) { com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toProject ( result.values ( ) . get ( 0 ) . name_key ( ) ) ) ; } else { projects.display ( result ) ; } }
Source:
public void deleteDraftChange ( ) throws com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { java.lang.String changeId = createDraftChange ( ) ; com.google.gerrit.server.change.ChangeJson.ChangeInfo c = getChange ( changeId ) ; org.junit.Assert.assertEquals ( ( "p~master~" + changeId ) , c.id ) ; org.junit.Assert.assertEquals ( Change.Status.DRAFT , c.status ) ; com.google.gerrit.acceptance.RestResponse r = com.google.gerrit.acceptance.rest.change.DeleteDraftChangeIT.deleteChange ( changeId , adminSession ) ; org.junit.Assert.assertEquals ( 204 , r.getStatusCode ( ) ) ; }

Target:
public void publishDraftChange ( ) throws com.google.gerrit.extensions.restapi.RestApiException , java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { java.lang.String changeId = createDraftChange ( ) ; java.lang.String triplet = "p~master~" + changeId ; com.google.gerrit.extensions.common.ChangeInfo c = get ( triplet ) ; org.junit.Assert.assertEquals ( triplet , c.id ) ; org.junit.Assert.assertEquals ( ChangeStatus.DRAFT , c.status ) ; com.google.gerrit.acceptance.RestResponse r = publishChange ( changeId ) ; org.junit.Assert.assertEquals ( 204 , r.getStatusCode ( ) ) ; c = get ( triplet ) ; org.junit.Assert.assertEquals ( ChangeStatus.NEW , c.status ) ; }
Source:
private void assertDeleteSucceeds ( ) throws java.lang.Exception { java.lang.String tagRev = tag ( ) . get ( ) . revision ; tag ( ) . delete ( ) ; eventRecorder.assertRefUpdatedEvents ( project.get ( ) , TAG , null , tagRev , tagRev , null ) ; exception.expect ( com.google.gerrit.extensions.restapi.ResourceNotFoundException.class ) ; tag ( ) . get ( ) ; }

Target:
private void assertDeleteSucceeds ( ) throws java.lang.Exception { java.lang.String tagRev = tag ( ) . get ( ) . revision ; tag ( ) . delete ( ) ; eventRecorder.assertRefUpdatedEvents ( project.get ( ) , com.google.gerrit.acceptance.rest.project.DeleteTagIT.TAG , null , tagRev , tagRev , null ) ; exception.expect ( com.google.gerrit.extensions.restapi.ResourceNotFoundException.class ) ; tag ( ) . get ( ) ; }
Source:
private boolean isPolyGerritEnabled ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse res ) { if ( ! ( options.enableGwtUi ( ) ) ) { return true ; } java.lang.String param = req.getParameter ( "polygerrit" ) ; if ( "1" . equals ( param ) ) { return setPolyGerritCookie ( req , res , UiPreference.POLYGERRIT ) ; } else if ( "0" . equals ( param ) ) { return setPolyGerritCookie ( req , res , UiPreference.GWT ) ; } else { return isPolyGerritCookie ( req ) ; } }

Target:
private boolean isPolyGerritEnabled ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse res ) { if ( ! ( options.enableGwtUi ( ) ) ) { return true ; } java.lang.String param = req.getParameter ( "polygerrit" ) ; if ( "1" . equals ( param ) ) { return setPolyGerritCookie ( req , res , UiType.POLYGERRIT ) ; } else if ( "0" . equals ( param ) ) { return setPolyGerritCookie ( req , res , UiType.GWT ) ; } else { return isPolyGerritCookie ( req ) ; } }
Source:
public void testParseRef ( ) throws java.lang.Exception { org.eclipse.jgit.revwalk.RevCommit master = repo.branch ( "refs/heads/master" ) . commit ( ) . create ( ) ; assertEquals ( new com.google.gitiles.RevisionParser.Result ( com.google.gitiles.Revision.peeled ( "master" , master ) ) , parser.parse ( "master" ) ) ; assertEquals ( new com.google.gitiles.RevisionParser.Result ( com.google.gitiles.Revision.peeled ( "refs/heads/master" , master ) ) , parser.parse ( "refs/heads/master" ) ) ; assertNull ( parser.parse ( "refs//heads//master" ) ) ; }

Target:
public void testParseRef ( ) throws java.lang.Exception { org.eclipse.jgit.revwalk.RevCommit master = repo.branch ( "refs/heads/master" ) . commit ( ) . create ( ) ; assertEquals ( new com.google.gitiles.RevisionParser.Result ( com.google.gitiles.Revision.peeled ( "master" , master ) ) , parser.parse ( "master" ) ) ; assertEquals ( new com.google.gitiles.RevisionParser.Result ( com.google.gitiles.Revision.peeled ( "refs/heads/master" , master ) ) , parser.parse ( "refs/heads/master" ) ) ; assertNull ( parser.parse ( "refs//heads//master" ) ) ; assertNull ( parser.parse ( "refs heads master" ) ) ; }
Source:
public void testKeyObjectId ( ) throws java.lang.Exception { org.bouncycastle.openpgp.PGPPublicKey key = com.google.gerrit.gpg.testutil.TestKeys.key1 ( ) . getPublicKey ( ) ; java.lang.String objId = com.google.gerrit.gpg.PublicKeyStore.keyObjectId ( key.getKeyID ( ) ) . name ( ) ; org.junit.Assert.assertEquals ( "ed0625dc46328a8c000000000000000000000000" , objId ) ; org.junit.Assert.assertEquals ( com.google.gerrit.gpg.PublicKeyStore.keyIdToString ( key.getKeyID ( ) ) . toLowerCase ( ) , objId.substring ( 8 , 16 ) ) ; }

Target:
public void testKeyObjectId ( ) throws java.lang.Exception { org.bouncycastle.openpgp.PGPPublicKey key = com.google.gerrit.gpg.testutil.TestKeys.validKeyWithoutExpiration ( ) . getPublicKey ( ) ; java.lang.String objId = com.google.gerrit.gpg.PublicKeyStore.keyObjectId ( key.getKeyID ( ) ) . name ( ) ; org.junit.Assert.assertEquals ( "ed0625dc46328a8c000000000000000000000000" , objId ) ; org.junit.Assert.assertEquals ( com.google.gerrit.gpg.PublicKeyStore.keyIdToString ( key.getKeyID ( ) ) . toLowerCase ( ) , objId.substring ( 8 , 16 ) ) ; }
Source:
public void linkifyMessageNoMatch ( ) throws java.lang.Exception { org.eclipse.jgit.lib.Config config = new org.eclipse.jgit.lib.Config ( ) ; com.google.gitiles.Linkifier l = new com.google.gitiles.Linkifier ( TestGitilesUrls.URLS , config ) ; org.junit.Assert.assertEquals ( com.google.common.collect.ImmutableList.of ( com.google.common.collect.ImmutableMap.of ( "text" , "some message text" ) ) , l.linkify ( com.google.gitiles.FakeHttpServletRequest.newRequest ( ) , "some message text" ) ) ; }

Target:
public void linkifyMessageNoMatch ( ) throws java.lang.Exception { org.eclipse.jgit.lib.Config config = new org.eclipse.jgit.lib.Config ( ) ; com.google.gitiles.Linkifier l = new com.google.gitiles.Linkifier ( TestGitilesUrls.URLS , config ) ; com.google.common.truth.Truth.assertThat ( l.linkify ( com.google.gitiles.FakeHttpServletRequest.newRequest ( ) , "some message text" ) ) . containsExactly ( com.google.common.collect.ImmutableMap.of ( "text" , "some message text" ) ) ; }
Source:
public com.google.common.base.Optional < com.google.gerrit.server.plugins.PluginEntry > getEntry ( java.lang.String resourcePath ) { java.io.File resourceFile = getResourceFile ( resourcePath ) ; if ( ( resourceFile.exists ( ) ) && ( ( resourceFile.length ( ) ) > 0 ) ) { return resourceOf ( resourcePath ) ; } else { return com.google.common.base.Optional.absent ( ) ; } }

Target:
public com.google.common.base.Optional < com.google.gerrit.server.plugins.PluginEntry > getEntry ( java.lang.String resourcePath ) throws java.io.IOException { java.nio.file.Path resourceFile = getResourceFile ( resourcePath ) ; if ( ( java.nio.file.Files.exists ( resourceFile ) ) && ( ( java.nio.file.Files.size ( resourceFile ) ) > 0 ) ) { return resourceOf ( resourcePath ) ; } else { return com.google.common.base.Optional.absent ( ) ; } }
Source:
private java.util.Map < java.lang.String , org.eclipse.jgit.lib.Ref > visibleTags ( com.google.gerrit.server.project.ProjectControl control , org.eclipse.jgit.lib.Repository repo , java.util.Map < java.lang.String , org.eclipse.jgit.lib.Ref > tags ) { return new com.google.gerrit.server.git.VisibleRefFilter ( tagCache , changeCache , repo , control , dbProvider.get ( ) , false ) . filter ( tags , true ) ; }

Target:
private java.util.Map < java.lang.String , org.eclipse.jgit.lib.Ref > visibleTags ( com.google.gerrit.server.project.ProjectControl control , org.eclipse.jgit.lib.Repository repo , java.util.Map < java.lang.String , org.eclipse.jgit.lib.Ref > tags ) { return new com.google.gerrit.server.git.VisibleRefFilter ( tagCache , changeNotesFactory , changeCache , repo , control , dbProvider.get ( ) , false ) . filter ( tags , true ) ; }
Source:
public void run ( ) { try { onStart ( ) ; } catch ( java.lang.Exception e ) { com.google.gerrit.sshd.CommandFactoryProvider.logger.warn ( ( ( ( "Cannot start command \"" + ( ctx.getCommandLine ( ) ) ) + "\" for user " ) + ( ctx.getSession ( ) . getUsername ( ) ) ) , e ) ; } }

Target:
public void run ( ) { try { onStart ( ) ; } catch ( java.lang.Exception e ) { com.google.gerrit.sshd.CommandFactoryProvider.logger.warn ( ( ( ( "Cannot start command \"" + ( cmd.getFormattedMaskedArguments ( " " ) ) ) + "\" for user " ) + ( ctx.getSession ( ) . getUsername ( ) ) ) , e ) ; } }
Source:
private static boolean isBlankLineGap ( com.google.gerrit.server.diff.Text a , int b , int e ) { for ( ; b < e ; b ++ ) { if ( ! ( com.google.gerrit.server.patch.IntraLineLoader.BLANK_LINE_RE.matcher ( a.getString ( b ) ) . matches ( ) ) ) { return false ; } } return true ; }

Target:
private static boolean isBlankLineGap ( com.google.gerrit.server.patch.Text a , int b , int e ) { for ( ; b < e ; b ++ ) { if ( ! ( com.google.gerrit.server.patch.IntraLineLoader.BLANK_LINE_RE.matcher ( a.getString ( b ) ) . matches ( ) ) ) { return false ; } } return true ; }
Source:
private java.util.List < com.google.gerrit.common.data.SubmitRecord > submitRecords ( com.google.gerrit.server.query.change.ChangeData cd ) throws com.google.gwtorm.server.OrmException { if ( ( cd.getSubmitRecords ( ) ) != null ) { return cd.getSubmitRecords ( ) ; } cd.setSubmitRecords ( new com.google.gerrit.server.project.SubmitRuleEvaluator ( cd ) . setFastEvalLabels ( true ) . setAllowDraft ( true ) . evaluate ( ) ) ; return cd.getSubmitRecords ( ) ; }

Target:
private java.util.Collection < com.google.gerrit.extensions.common.AccountInfo > toAccountInfo ( java.util.Collection < com.google.gerrit.reviewdb.client.Account.Id > accounts ) { return com.google.common.collect.FluentIterable.from ( accounts ) . transform ( new com.google.common.base.Function < com.google.gerrit.reviewdb.client.Account.Id , com.google.gerrit.extensions.common.AccountInfo > ( ) { @ java.lang.Override public com.google.gerrit.extensions.common.AccountInfo apply ( com.google.gerrit.reviewdb.client.Account.Id id ) { return accountLoader.get ( id ) ; } } ) . toSortedList ( AccountInfoComparator.ORDER_NULLS_FIRST ) ; }
Source:
public void rebuildEmptySite ( ) throws java.lang.Exception { initSite ( ) ; com.google.common.io.Files.append ( com.google.gerrit.server.notedb.NotesMigration.allEnabledConfig ( ) . toText ( ) , new java.io.File ( sitePath.toString ( ) , "etc/gerrit.config" ) , java.nio.charset.StandardCharsets.UTF_8 ) ; com.google.gerrit.acceptance.pgm.RebuildNotedbIT.runGerrit ( "RebuildNotedb" , "-d" , sitePath.toString ( ) , "--show-stack-trace" ) ; }

Target:
public void rebuildEmptySite ( ) throws java.lang.Exception { initSite ( ) ; com.google.common.io.Files.append ( com.google.gerrit.server.notedb.ConfigNotesMigration.allEnabledConfig ( ) . toText ( ) , new java.io.File ( sitePath.toString ( ) , "etc/gerrit.config" ) , java.nio.charset.StandardCharsets.UTF_8 ) ; com.google.gerrit.acceptance.pgm.RebuildNotedbIT.runGerrit ( "RebuildNotedb" , "-d" , sitePath.toString ( ) , "--show-stack-trace" ) ; }
Source:
private void setReviewedByCurrentUser ( boolean reviewed ) { PatchUtil.DETAIL_SVC.setReviewedByCurrentUser ( patchKey , reviewed , new com.google.gwt.user.client.rpc.AsyncCallback < com.google.gwtjsonrpc.client.VoidResult > ( ) { @ java.lang.Override public void onFailure ( java.lang.Throwable arg0 ) { } @ java.lang.Override public void onSuccess ( com.google.gwtjsonrpc.client.VoidResult result ) { } } ) ; }

Target:
private void setReviewedByCurrentUser ( boolean reviewed ) { if ( ( fileList ) != null ) { fileList.updateReviewedStatus ( patchKey , reviewed ) ; } PatchUtil.DETAIL_SVC.setReviewedByCurrentUser ( patchKey , reviewed , new com.google.gwt.user.client.rpc.AsyncCallback < com.google.gwtjsonrpc.client.VoidResult > ( ) { @ java.lang.Override public void onFailure ( java.lang.Throwable arg0 ) { } @ java.lang.Override public void onSuccess ( com.google.gwtjsonrpc.client.VoidResult result ) { } } ) ; }
Source:
public void encode ( T obj , final byte [ ] data , int offset , int length ) { com.google.protobuf.CodedOutputStream out = com.google.protobuf.CodedOutputStream.newInstance ( data , offset , length ) ; encode ( obj , out ) ; com.google.gwtorm.protobuf.ProtobufCodec.flush ( out ) ; }

Target:
public void encode ( T obj , final byte [ ] data , int offset , int length ) { com.google.protobuf.CodedOutputStream out = com.google.protobuf.CodedOutputStream.newInstance ( data , offset , length ) ; try { encode ( obj , out ) ; out.flush ( ) ; } catch ( java.io.IOException err ) { throw new java.lang.RuntimeException ( "Cannot encode message" , err ) ; } }
Source:
public java.util.List < com.google.gerrit.testutil.FakeEmailSender.Message > getMessages ( java.lang.String changeId , java.lang.String type ) { final java.lang.String idFooter = ( "\nGerrit-Change-Id: " + changeId ) + "\n" ; final java.lang.String typeFooter = ( "\nGerrit-MessageType: " + type ) + "\n" ; return getMessages ( ) . stream ( ) . filter ( ( in ) -> ( in.body ( ) . contains ( idFooter ) ) && ( in.body ( ) . contains ( typeFooter ) ) ) . collect ( java.util.stream.Collectors.toList ( ) ) ; }

Target:
public java.util.List < com.google.gerrit.testing.FakeEmailSender.Message > getMessages ( java.lang.String changeId , java.lang.String type ) { final java.lang.String idFooter = ( "\nGerrit-Change-Id: " + changeId ) + "\n" ; final java.lang.String typeFooter = ( "\nGerrit-MessageType: " + type ) + "\n" ; return getMessages ( ) . stream ( ) . filter ( ( in ) -> ( in.body ( ) . contains ( idFooter ) ) && ( in.body ( ) . contains ( typeFooter ) ) ) . collect ( java.util.stream.Collectors.toList ( ) ) ; }
Source:
public void deleteProjectWatches ( com.google.gerrit.reviewdb.client.Account.Id accountId , java.util.Collection < com.google.gerrit.server.account.WatchConfig.ProjectWatchKey > projectWatchKeys ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { try ( com.google.gerrit.server.account.WatchConfig watchConfig = open ( accountId ) ) { java.util.Map < com.google.gerrit.server.account.WatchConfig.ProjectWatchKey , java.util.Collection < com.google.gerrit.reviewdb.client.AccountProjectWatch.NotifyType > > projectWatches = watchConfig.getProjectWatches ( ) ; for ( com.google.gerrit.server.account.WatchConfig.ProjectWatchKey key : projectWatchKeys ) { projectWatches.remove ( key ) ; } commit ( watchConfig ) ; } }

Target:
public synchronized void deleteProjectWatches ( com.google.gerrit.reviewdb.client.Account.Id accountId , java.util.Collection < com.google.gerrit.server.account.WatchConfig.ProjectWatchKey > projectWatchKeys ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { com.google.gerrit.server.account.WatchConfig watchConfig = read ( accountId ) ; java.util.Map < com.google.gerrit.server.account.WatchConfig.ProjectWatchKey , java.util.Set < com.google.gerrit.server.account.WatchConfig.NotifyType > > projectWatches = watchConfig.getProjectWatches ( ) ; boolean commit = false ; for ( com.google.gerrit.server.account.WatchConfig.ProjectWatchKey key : projectWatchKeys ) { if ( ( projectWatches.remove ( key ) ) != null ) { commit = true ; } } if ( commit ) { commit ( watchConfig ) ; } }
Source:
public void changeUserName ( final java.lang.String newName , final com.google.gwt.user.client.rpc.AsyncCallback < com.google.gwtjsonrpc.client.VoidResult > callback ) { if ( realm.allowsEdit ( Account.FieldName.USER_NAME ) ) { com.google.gerrit.httpd.rpc.Handler.wrap ( changeUserNameFactory.create ( newName ) ) . to ( callback ) ; } else { callback.onFailure ( new com.google.gerrit.common.errors.NameAlreadyUsedException ( ) ) ; } }

Target:
public void changeUserName ( final java.lang.String newName , final com.google.gwtjsonrpc.common.AsyncCallback < com.google.gwtjsonrpc.common.VoidResult > callback ) { if ( realm.allowsEdit ( Account.FieldName.USER_NAME ) ) { com.google.gerrit.httpd.rpc.Handler.wrap ( changeUserNameFactory.create ( newName ) ) . to ( callback ) ; } else { callback.onFailure ( new com.google.gerrit.common.errors.NameAlreadyUsedException ( ) ) ; } }
Source:
private void savePatchSet ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gwtorm.server.OrmException { if ( ! ( patchSet.isDraft ( ) ) ) { throw new com.google.gerrit.extensions.restapi.ResourceConflictException ( "Patch set is not a draft" ) ; } patchSet.setDraft ( false ) ; if ( ! ( wasDraftChange ) ) { ctx.saveChange ( ) ; } ctx.getDb ( ) . patchSets ( ) . update ( java.util.Collections.singleton ( patchSet ) ) ; }

Target:
private void savePatchSet ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gwtorm.server.OrmException { if ( ! ( patchSet.isDraft ( ) ) ) { throw new com.google.gerrit.extensions.restapi.ResourceConflictException ( "Patch set is not a draft" ) ; } psUtil.publish ( ctx.getDb ( ) , ctx.getUpdate ( psId ) , patchSet ) ; if ( ! ( wasDraftChange ) ) { ctx.saveChange ( ) ; } }
Source:
protected void configure ( ) { bind ( com.google.gerrit.server.config.SitePaths.class ) ; bind ( com.google.gerrit.server.config.TrackingFooters.class ) . toProvider ( com.google.gerrit.server.config.TrackingFootersProvider.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; bind ( org.eclipse.jgit.lib.Config.class ) . annotatedWith ( com.google.gerrit.server.config.GerritServerConfig.class ) . toProvider ( com.google.gerrit.server.config.GerritServerConfigProvider.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; }

Target:
protected void configure ( ) { bind ( com.google.gerrit.server.config.SitePaths.class ) ; bind ( com.google.gerrit.server.config.TrackingFooters.class ) . toProvider ( com.google.gerrit.server.config.TrackingFootersProvider.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; bind ( org.eclipse.jgit.lib.Config.class ) . annotatedWith ( com.google.gerrit.server.config.GerritServerConfig.class ) . toProvider ( com.google.gerrit.server.config.GerritServerConfigProvider.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; bind ( com.google.gerrit.server.securestore.SecureStore.class ) . toProvider ( com.google.gerrit.server.securestore.SecureStoreProvider.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; }
Source:
private static byte [ ] message ( org.eclipse.jetty.server.HttpConnection conn ) { java.lang.String msg = conn.getHttpChannel ( ) . getResponse ( ) . getReason ( ) ; if ( msg == null ) { msg = org.eclipse.jetty.http.HttpStatus.getMessage ( conn.getHttpChannel ( ) . getResponse ( ) . getStatus ( ) ) ; } return msg.getBytes ( com.google.common.base.Charsets.ISO_8859_1 ) ; }

Target:
private static byte [ ] message ( org.eclipse.jetty.server.HttpConnection conn ) { java.lang.String msg = conn.getHttpChannel ( ) . getResponse ( ) . getReason ( ) ; if ( msg == null ) { msg = org.eclipse.jetty.http.HttpStatus.getMessage ( conn.getHttpChannel ( ) . getResponse ( ) . getStatus ( ) ) ; } return msg.getBytes ( java.nio.charset.StandardCharsets.ISO_8859_1 ) ; }
Source:
private java.util.Map < java.lang.String , com.google.gerrit.reviewdb.client.PatchLineComment > patchSetDrafts ( com.google.gerrit.server.change.RevisionResource rsrc ) throws com.google.gwtorm.server.OrmException { java.util.Map < java.lang.String , com.google.gerrit.reviewdb.client.PatchLineComment > drafts = com.google.common.collect.Maps.newHashMap ( ) ; for ( com.google.gerrit.reviewdb.client.PatchLineComment c : plcUtil.draftByPatchSetAuthor ( db.get ( ) , rsrc.getPatchSet ( ) . getId ( ) , rsrc.getAccountId ( ) , rsrc.getNotes ( ) ) ) { drafts.put ( c.getKey ( ) . get ( ) , c ) ; } return drafts ; }

Target:
private java.util.Map < java.lang.String , com.google.gerrit.reviewdb.client.PatchLineComment > patchSetDrafts ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx ) throws com.google.gwtorm.server.OrmException { java.util.Map < java.lang.String , com.google.gerrit.reviewdb.client.PatchLineComment > drafts = com.google.common.collect.Maps.newHashMap ( ) ; for ( com.google.gerrit.reviewdb.client.PatchLineComment c : plcUtil.draftByPatchSetAuthor ( ctx.getDb ( ) , psId , user.getAccountId ( ) , ctx.getNotes ( ) ) ) { drafts.put ( c.getKey ( ) . get ( ) , c ) ; } return drafts ; }
Source:
public com.google.gerrit.server.notedb.ChangeNotes notes ( ) throws com.google.gwtorm.server.OrmException { if ( ( notes ) == null ) { com.google.gerrit.reviewdb.client.Change c = change ( ) ; notes = notesFactory.create ( db , c.getProject ( ) , c.getId ( ) ) ; } return notes ; }

Target:
public com.google.gerrit.reviewdb.client.Change reloadChange ( ) throws com.google.gwtorm.server.OrmException { notes = notesFactory.create ( db , project , legacyId ) ; change = notes.getChange ( ) ; if ( ( change ) == null ) { throw new com.google.gwtorm.server.OrmException ( ( "Unable to load change " + ( legacyId ) ) ) ; } return change ; }
Source:
protected void preDisplay ( java.lang.Void result ) { display ( diff ) ; }

Target:
public void onSuccess ( com.google.gerrit.client.diff.DiffInfo diffInfo ) { diff = diffInfo ; new net.codemirror.lib.ModeInjector ( ) . add ( com.google.gerrit.client.diff.CodeMirrorDemo.getContentType ( diff.meta_a ( ) ) ) . add ( com.google.gerrit.client.diff.CodeMirrorDemo.getContentType ( diff.meta_b ( ) ) ) . inject ( modeInjectorCb ) ; }
Source:
protected void link ( java.lang.String text , java.lang.String target ) { final com.google.gerrit.client.ui.LinkMenuItem item = new com.google.gerrit.client.ui.LinkMenuItem ( text , target ) ; item.setStyleName ( Gerrit.RESOURCES.css ( ) . menuItem ( ) ) ; menu.add ( item ) ; }

Target:
protected void link ( final java.lang.String text , final java.lang.String target , final boolean visible ) { final com.google.gerrit.client.ui.LinkMenuItem item = new com.google.gerrit.client.ui.LinkMenuItem ( text , target ) ; item.setStyleName ( Gerrit.RESOURCES.css ( ) . menuItem ( ) ) ; item.setVisible ( visible ) ; menu.add ( item ) ; }
Source:
private static com.google.gerrit.client.reviewdb.AccountExternalId lookupGoogleAccount ( final com.google.gerrit.client.reviewdb.AccountExternalIdAccess extAccess , final java.lang.String email ) throws com.google.gwtorm.client.OrmException { for ( final com.google.gerrit.client.reviewdb.AccountExternalId e : extAccess.byEmailAddress ( email ) ) { if ( com.google.gerrit.server.OpenIdLoginServlet.isGoogleAccount ( e ) ) { return e ; } } return null ; }

Target:
private static com.google.gerrit.client.reviewdb.AccountExternalId lookupGoogleAccount ( final com.google.gerrit.client.reviewdb.AccountExternalIdAccess extAccess , final java.lang.String email ) throws com.google.gwtorm.client.OrmException { final java.util.List < com.google.gerrit.client.reviewdb.AccountExternalId > m = new java.util.ArrayList < com.google.gerrit.client.reviewdb.AccountExternalId > ( ) ; for ( final com.google.gerrit.client.reviewdb.AccountExternalId e : extAccess.byEmailAddress ( email ) ) { if ( e.getExternalId ( ) . equals ( OpenIdUtil.URL_GOOGLE ) ) { m.add ( e ) ; } } return ( m.size ( ) ) == 1 ? m.get ( 0 ) : null ; }
Source:
private com.google.gerrit.client.diff.DraftBox addNewDraft ( net.codemirror.lib.CodeMirror cm , int line ) { com.google.gerrit.common.changes.Side side = ( cm == ( cmA ) ) ? com.google.gerrit.common.changes.Side.PARENT : com.google.gerrit.common.changes.Side.REVISION ; com.google.gerrit.client.changes.CommentInfo info = com.google.gerrit.client.changes.CommentInfo.create ( path , side , ( line + 1 ) , null , null ) ; return addDraftBox ( info , false ) ; }

Target:
private com.google.gerrit.client.diff.DraftBox addNewDraft ( net.codemirror.lib.CodeMirror cm , int line ) { com.google.gerrit.common.changes.Side side = getSideFromCm ( cm ) ; com.google.gerrit.client.changes.CommentInfo info = com.google.gerrit.client.changes.CommentInfo.create ( path , side , ( line + 1 ) , null , null ) ; return addDraftBox ( info , false ) ; }
Source:
public void onFailure ( java.lang.Throwable err ) { 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 ( PageLinks.MINE ) ; } else { super . onFailure ( err ) ; } }

Target:
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 ( PageLinks.MINE ) ; } else { super . onFailure ( err ) ; } }
Source:
com.google.gerrit.httpd.WebSessionManager.Val createVal ( final com.google.gerrit.httpd.WebSessionManager.Key key , final com.google.gerrit.httpd.WebSessionManager.Val val ) { final com.google.gerrit.reviewdb.Account.Id who = val.getAccountId ( ) ; final boolean remember = val.isPersistentCookie ( ) ; final com.google.gerrit.reviewdb.AccountExternalId.Key lastLogin = val.getExternalId ( ) ; return createVal ( key , who , remember , lastLogin ) ; }

Target:
com.google.gerrit.httpd.WebSessionManager.Val createVal ( final com.google.gerrit.httpd.WebSessionManager.Key key , final com.google.gerrit.httpd.WebSessionManager.Val val ) { final com.google.gerrit.reviewdb.Account.Id who = val.getAccountId ( ) ; final boolean remember = val.isPersistentCookie ( ) ; final com.google.gerrit.reviewdb.AccountExternalId.Key lastLogin = val.getExternalId ( ) ; final java.lang.String xsrfToken = val.getXsrfToken ( ) ; return createVal ( key , who , remember , lastLogin , xsrfToken ) ; }
Source:
private java.lang.String readContentFromJson ( com.google.gerrit.acceptance.RestResponse r ) throws java.io.IOException { com.google.gson.stream.JsonReader jsonReader = new com.google.gson.stream.JsonReader ( r.getReader ( ) ) ; jsonReader.setLenient ( true ) ; return newGson ( ) . fromJson ( jsonReader , java.lang.String.class ) ; }

Target:
private < T > T readContentFromJson ( com.google.gerrit.acceptance.RestResponse r , java.lang.Class < T > clazz ) throws java.lang.Exception { r.assertOK ( ) ; com.google.gson.stream.JsonReader jsonReader = new com.google.gson.stream.JsonReader ( r.getReader ( ) ) ; jsonReader.setLenient ( true ) ; return newGson ( ) . fromJson ( jsonReader , clazz ) ; }
Source:
public java.util.List < com.google.gerrit.server.update.BatchUpdate > batchUpdates ( java.util.Collection < com.google.gerrit.reviewdb.client.Project.NameKey > projects ) throws com.google.gerrit.server.project.NoSuchProjectException , java.io.IOException { java.util.List < com.google.gerrit.server.update.BatchUpdate > updates = new java.util.ArrayList ( projects.size ( ) ) ; for ( com.google.gerrit.reviewdb.client.Project.NameKey project : projects ) { updates.add ( getRepo ( project ) . getUpdate ( ) ) ; } return updates ; }

Target:
public java.util.List < com.google.gerrit.server.update.BatchUpdate > batchUpdates ( java.util.Collection < com.google.gerrit.reviewdb.client.Project.NameKey > projects ) throws com.google.gerrit.server.project.NoSuchProjectException , java.io.IOException { java.util.List < com.google.gerrit.server.update.BatchUpdate > updates = new java.util.ArrayList ( projects.size ( ) ) ; for ( com.google.gerrit.reviewdb.client.Project.NameKey project : projects ) { updates.add ( getRepo ( project ) . getUpdate ( ) . setRefLogMessage ( "merged" ) ) ; } return updates ; }
Source:
public void onBrowserEvent ( com.google.gwt.user.client.Event event ) { super . onBrowserEvent ( event ) ; if ( ( ( com.google.gwt.user.client.DOM.eventGetType ( event ) ) == ( com.google.gwt.user.client.Event.ONCLICK ) ) && ( com.google.gerrit.client.ui.LinkMenuItem.impl.handleAsClick ( event ) ) ) { com.google.gwt.dom.client.AnchorElement.as ( getElement ( ) ) . blur ( ) ; } }

Target:
public void go ( ) { super . go ( ) ; com.google.gwt.dom.client.AnchorElement.as ( getElement ( ) ) . blur ( ) ; }
Source:
public void testUnblockRangeForNotChangeOwner ( ) { com.google.gerrit.server.project.Util.allow ( local , ( ( com.google.gerrit.common.data.Permission.LABEL ) + "Code-Review" ) , ( - 2 ) , ( + 2 ) , com.google.gerrit.server.group.SystemGroupBackend.CHANGE_OWNER , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; com.google.gerrit.common.data.PermissionRange range = u.controlForRef ( "refs/heads/master" ) . getRange ( ( ( com.google.gerrit.common.data.Permission.LABEL ) + "Code-Review" ) ) ; org.junit.Assert.assertFalse ( "u can vote -2" , range.contains ( ( - 2 ) ) ) ; org.junit.Assert.assertFalse ( "u can vote +2" , range.contains ( 2 ) ) ; }

Target:
public void testUnblockRangeForNotChangeOwner ( ) { com.google.gerrit.server.project.Util.allow ( local , ( ( com.google.gerrit.common.data.Permission.LABEL ) + "Code-Review" ) , ( - 2 ) , ( + 2 ) , com.google.gerrit.server.group.SystemGroupBackend.CHANGE_OWNER , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; com.google.gerrit.common.data.PermissionRange range = u.controlForRef ( "refs/heads/master" ) . getRange ( ( ( com.google.gerrit.common.data.Permission.LABEL ) + "Code-Review" ) ) ; assertCannotVote ( ( - 2 ) , range ) ; assertCannotVote ( 2 , range ) ; }
Source:
public com.google.gerrit.common.data.GroupInfoCache create ( ) { final java.util.List < com.google.gerrit.common.data.GroupInfo > r = new java.util.ArrayList < com.google.gerrit.common.data.GroupInfo > ( out.size ( ) ) ; for ( final com.google.gerrit.reviewdb.client.AccountGroup a : out.values ( ) ) { if ( a == null ) continue ; r.add ( new com.google.gerrit.common.data.GroupInfo ( a ) ) ; } return new com.google.gerrit.common.data.GroupInfoCache ( r ) ; }

Target:
public com.google.gerrit.common.data.GroupInfoCache create ( ) { java.util.List < com.google.gerrit.common.data.GroupInfo > r = com.google.common.collect.Lists.newArrayListWithCapacity ( out.size ( ) ) ; for ( com.google.gerrit.common.data.GroupDescription.Basic a : out.values ( ) ) { if ( a != null ) { r.add ( new com.google.gerrit.common.data.GroupInfo ( a ) ) ; } } return new com.google.gerrit.common.data.GroupInfoCache ( r ) ; }
Source:
protected final com.google.gerrit.server.mail.send.ProjectWatch.Watchers getWatchers ( com.google.gerrit.server.account.WatchConfig.NotifyType type , boolean includeWatchersFromNotifyConfig ) throws com.google.gwtorm.server.OrmException { if ( ! ( NotifyHandling.ALL.equals ( notify ) ) ) { return new com.google.gerrit.server.mail.send.ProjectWatch.Watchers ( ) ; } com.google.gerrit.server.mail.send.ProjectWatch watch = new com.google.gerrit.server.mail.send.ProjectWatch ( args , branch.getParentKey ( ) , projectState , changeData ) ; return watch.getWatchers ( type , includeWatchersFromNotifyConfig ) ; }

Target:
protected final com.google.gerrit.server.mail.send.ProjectWatch.Watchers getWatchers ( com.google.gerrit.server.account.ProjectWatches.NotifyType type , boolean includeWatchersFromNotifyConfig ) throws com.google.gwtorm.server.OrmException { if ( ! ( NotifyHandling.ALL.equals ( notify ) ) ) { return new com.google.gerrit.server.mail.send.ProjectWatch.Watchers ( ) ; } com.google.gerrit.server.mail.send.ProjectWatch watch = new com.google.gerrit.server.mail.send.ProjectWatch ( args , branch.getParentKey ( ) , projectState , changeData ) ; return watch.getWatchers ( type , includeWatchersFromNotifyConfig ) ; }
Source:
public int compare ( com.google.gerrit.client.account.AccountInfo a , com.google.gerrit.client.account.AccountInfo b ) { int cmp = nullToEmpty ( a.name ( ) ) . compareTo ( nullToEmpty ( b.name ( ) ) ) ; if ( cmp != 0 ) { return cmp ; } cmp = nullToEmpty ( a.email ( ) ) . compareTo ( nullToEmpty ( b.email ( ) ) ) ; if ( cmp != 0 ) { return cmp ; } return ( a._accountId ( ) ) - ( b._accountId ( ) ) ; }

Target:
public int compare ( com.google.gerrit.client.info.AccountInfo a , com.google.gerrit.client.info.AccountInfo b ) { int cmp = nullToEmpty ( a.name ( ) ) . compareTo ( nullToEmpty ( b.name ( ) ) ) ; if ( cmp != 0 ) { return cmp ; } cmp = nullToEmpty ( a.email ( ) ) . compareTo ( nullToEmpty ( b.email ( ) ) ) ; if ( cmp != 0 ) { return cmp ; } return ( a._accountId ( ) ) - ( b._accountId ( ) ) ; }
Source:
public void testOptionsArgumentOverridesAllLimitPredicates ( ) throws java.lang.Exception { com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > in = parse ( "limit:1 file:a limit:3" ) ; com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > out = rewrite ( in , com.google.gerrit.server.index.change.IndexRewriterTest.options ( 0 , 5 ) ) ; com.google.common.truth.Truth.assertThat ( out.getClass ( ) ) . isEqualTo ( com.google.gerrit.server.query.change.AndSource.class ) ; com.google.common.truth.Truth.assertThat ( out.getChildren ( ) ) . containsExactly ( query ( in.getChild ( 1 ) , 5 ) , parse ( "limit:5" ) , parse ( "limit:5" ) ) . inOrder ( ) ; }

Target:
public void testOptionsArgumentOverridesAllLimitPredicates ( ) throws java.lang.Exception { com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > in = parse ( "limit:1 file:a limit:3" ) ; com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > out = rewrite ( in , com.google.gerrit.server.index.change.ChangeIndexRewriterTest.options ( 0 , 5 ) ) ; com.google.common.truth.Truth.assertThat ( out.getClass ( ) ) . isEqualTo ( com.google.gerrit.server.query.change.AndSource.class ) ; com.google.common.truth.Truth.assertThat ( out.getChildren ( ) ) . containsExactly ( query ( in.getChild ( 1 ) , 5 ) , parse ( "limit:5" ) , parse ( "limit:5" ) ) . inOrder ( ) ; }
Source:
private void appendQuotedParent ( java.lang.StringBuilder out , com.google.gerrit.reviewdb.client.Comment child ) { com.google.common.base.Optional < com.google.gerrit.reviewdb.client.Comment > parent = getParent ( child ) ; if ( parent.isPresent ( ) ) { out.append ( "> " ) . append ( getShortenedCommentMessage ( parent.get ( ) ) ) . append ( '\n' ) ; } }

Target:
private void appendFileLine ( java.lang.StringBuilder cmts , com.google.gerrit.server.patch.PatchFile fileData , short side , int line ) { java.lang.String lineStr = getLine ( fileData , side , line ) ; cmts.append ( "Line " ) . append ( line ) . append ( ": " ) . append ( lineStr ) . append ( "\n" ) ; }
Source:
public void evictAfterRename ( final com.google.gerrit.reviewdb.client.AccountGroup.NameKey oldName , final com.google.gerrit.reviewdb.client.AccountGroup.NameKey newName ) { byName.remove ( oldName ) ; updateGroupList ( oldName , newName ) ; }

Target:
public com.google.gerrit.reviewdb.client.AccountGroup get ( com.google.gerrit.reviewdb.client.AccountGroup.NameKey name ) { if ( name == null ) { return null ; } try { return byName.get ( name.get ( ) ) . orNull ( ) ; } catch ( java.util.concurrent.ExecutionException e ) { com.google.gerrit.server.account.GroupCacheImpl.log.warn ( java.lang.String.format ( "Cannot lookup group %s by name" , name.get ( ) ) , e ) ; return null ; } }
Source:
public boolean isContextLine ( ) { return ( ! ( isModifiedLine ( ) ) ) || ( ( ( endIdx ) + 1 ) < ( curIdx ) ) ; }

Target:
public boolean next ( ) { if ( ! ( in ( curEdit ) ) ) { if ( ( curIdx ) < ( endIdx ) ) { curEdit = edits.get ( ( ++ ( curIdx ) ) ) ; } } return ( ( aCur ) < ( aEnd ) ) || ( ( bCur ) < ( bEnd ) ) ; }
Source:
com.google.common.collect.ImmutableList < com.google.gerrit.reviewdb.client.PatchLineComment > exportComments ( final com.google.gerrit.reviewdb.client.PatchLineComment.Status status ) { return com.google.common.collect.ImmutableList.copyOf ( com.google.common.collect.Lists.transform ( comments , new com.google.common.base.Function < com.google.gerrit.server.notedb.RevisionNoteData.Comment , com.google.gerrit.reviewdb.client.PatchLineComment > ( ) { @ java.lang.Override public com.google.gerrit.reviewdb.client.PatchLineComment apply ( com.google.gerrit.server.notedb.RevisionNoteData.Comment c ) { com.google.gerrit.reviewdb.client.PatchLineComment plc = c.export ( ) ; plc.setStatus ( status ) ; return plc ; } } ) ) ; }

Target:
com.google.common.collect.ImmutableList < com.google.gerrit.reviewdb.client.PatchLineComment > exportComments ( com.google.gerrit.reviewdb.client.PatchLineComment.Status status ) { return com.google.common.collect.ImmutableList.copyOf ( comments.stream ( ) . map ( ( c ) -> c.export ( status ) ) . collect ( java.util.stream.Collectors.toList ( ) ) ) ; }
Source:
public static java.lang.String messageUUID ( com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { int p ; int s ; synchronized ( com.google.gerrit.server.ChangeUtil.uuidLock ) { if ( ( com.google.gerrit.server.ChangeUtil.uuidSeq ) == 0 ) { com.google.gerrit.server.ChangeUtil.uuidPrefix = db.nextChangeMessageId ( ) ; com.google.gerrit.server.ChangeUtil.uuidSeq = java.lang.Integer.MAX_VALUE ; } p = com.google.gerrit.server.ChangeUtil.uuidPrefix ; s = ( com.google.gerrit.server.ChangeUtil.uuidSeq ) -- ; } java.lang.String u = com.google.gerrit.server.util.IdGenerator.format ( com.google.gerrit.server.util.IdGenerator.mix ( com.google.gerrit.server.ChangeUtil.SEED , p ) ) ; java.lang.String l = com.google.gerrit.server.util.IdGenerator.format ( com.google.gerrit.server.util.IdGenerator.mix ( p , s ) ) ; return ( u + '_' ) + l ; }

Target:
public static java.lang.String messageUuid ( ) { byte [ ] buf = new byte [ 8 ] ; com.google.gerrit.server.ChangeUtil.UUID_RANDOM.nextBytes ( buf ) ; return ( ( com.google.gerrit.server.ChangeUtil.UUID_ENCODING.encode ( buf , 0 , 4 ) ) + '_' ) + ( com.google.gerrit.server.ChangeUtil.UUID_ENCODING.encode ( buf , 4 , 4 ) ) ; }
Source:
public synchronized com.google.gerrit.testutil.InMemoryRepositoryManager.Repo createRepository ( com.google.gerrit.reviewdb.client.Project.NameKey name ) throws com.google.gerrit.server.git.RepositoryCaseMismatchException , org.eclipse.jgit.errors.RepositoryNotFoundException { com.google.gerrit.testutil.InMemoryRepositoryManager.Repo repo ; try { repo = get ( name ) ; if ( ! ( repo.getDescription ( ) . getRepositoryName ( ) . equals ( name.get ( ) ) ) ) { throw new com.google.gerrit.server.git.RepositoryCaseMismatchException ( name ) ; } } catch ( org.eclipse.jgit.errors.RepositoryNotFoundException e ) { repo = new com.google.gerrit.testutil.InMemoryRepositoryManager.Repo ( name ) ; repos.put ( name.get ( ) . toLowerCase ( ) , repo ) ; } return repo ; }

Target:
public synchronized com.google.gerrit.testutil.InMemoryRepositoryManager.Repo createRepository ( com.google.gerrit.reviewdb.client.Project.NameKey name ) throws com.google.gerrit.server.git.RepositoryCaseMismatchException , org.eclipse.jgit.errors.RepositoryNotFoundException { com.google.gerrit.testutil.InMemoryRepositoryManager.Repo repo ; try { repo = get ( name ) ; if ( ! ( repo.getDescription ( ) . getRepositoryName ( ) . equals ( name.get ( ) ) ) ) { throw new com.google.gerrit.server.git.RepositoryCaseMismatchException ( name ) ; } } catch ( org.eclipse.jgit.errors.RepositoryNotFoundException e ) { repo = new com.google.gerrit.testutil.InMemoryRepositoryManager.Repo ( name ) ; repos.put ( com.google.gerrit.testutil.InMemoryRepositoryManager.normalize ( name ) , repo ) ; } return repo ; }
Source:
private java.lang.Runnable maybeNextVimSearch ( final net.codemirror.lib.CodeMirror cm ) { return new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { if ( cm.hasVimSearchHighlight ( ) ) { net.codemirror.lib.CodeMirror.handleVimKey ( cm , "n" ) ; } else { diffChunkNav ( cm , false ) . run ( ) ; } } } ; }

Target:
private java.lang.Runnable maybeNextVimSearch ( final net.codemirror.lib.CodeMirror cm ) { return new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { if ( cm.hasVimSearchHighlight ( ) ) { net.codemirror.lib.CodeMirror.handleVimKey ( cm , "n" ) ; } else { chunkManager.diffChunkNav ( cm , Direction.NEXT ) . run ( ) ; } } } ; }
Source:
public void createNewChangeSignedOffByFooter ( ) throws java.lang.Exception { setSignedOffByFooter ( ) ; com.google.gerrit.extensions.common.ChangeInfo info = assertCreateSucceeds ( newChangeInput ( ChangeStatus.NEW ) ) ; java.lang.String message = info.revisions.get ( info.currentRevision ) . commit.message ; com.google.common.truth.Truth.assertThat ( message ) . contains ( java.lang.String.format ( "%sAdministrator <%s>" , org.eclipse.jgit.lib.Constants.SIGNED_OFF_BY_TAG , admin.getIdent ( ) . getEmailAddress ( ) ) ) ; }

Target:
public void createNewChange ( ) throws java.lang.Exception { com.google.gerrit.extensions.common.ChangeInfo info = assertCreateSucceeds ( newChangeInput ( ChangeStatus.NEW ) ) ; com.google.common.truth.Truth.assertThat ( info.revisions.get ( info.currentRevision ) . commit.message ) . contains ( ( "Change-Id: " + ( info.changeId ) ) ) ; }
Source:
public PerThreadRequestScope.Scoper provideScoper ( final com.google.gerrit.server.git.PerThreadRequestScope.Propagator propagator ) { final com.google.gerrit.server.util.RequestContext requestContext = new com.google.gerrit.server.util.RequestContext ( ) { @ java.lang.Override public com.google.gerrit.server.CurrentUser getCurrentUser ( ) { return remoteUser ; } } ; return new com.google.gerrit.server.git.PerThreadRequestScope.Scoper ( ) { @ java.lang.Override public < T > java.util.concurrent.Callable < T > scope ( java.util.concurrent.Callable < T > callable ) { return propagator.scope ( requestContext , callable ) ; } } ; }

Target:
public PerThreadRequestScope.Scoper provideScoper ( final com.google.gerrit.server.git.PerThreadRequestScope.Propagator propagator , final com.google.inject.Provider < com.google.gerrit.server.config.RequestScopedReviewDbProvider > dbProvider ) { final com.google.gerrit.server.util.RequestContext requestContext = new com.google.gerrit.server.util.RequestContext ( ) { @ java.lang.Override public com.google.gerrit.server.CurrentUser getCurrentUser ( ) { return remoteUser ; } @ java.lang.Override public com.google.inject.Provider < com.google.gerrit.reviewdb.server.ReviewDb > getReviewDbProvider ( ) { return dbProvider.get ( ) ; } } ; return new com.google.gerrit.server.git.PerThreadRequestScope.Scoper ( ) { @ java.lang.Override public < T > java.util.concurrent.Callable < T > scope ( java.util.concurrent.Callable < T > callable ) { return propagator.scope ( requestContext , callable ) ; } } ; }
Source:
private void call ( com.googlecode.prolog_cafe.lang.BufferingPrologControl env , java.lang.String name ) { com.googlecode.prolog_cafe.lang.StructureTerm head = com.googlecode.prolog_cafe.lang.SymbolTerm.create ( pkg , name , 0 ) ; if ( ! ( env.execute ( Prolog.BUILTIN , "call" , head ) ) ) { org.junit.Assert.fail ( ( ( ( "Cannot invoke " + ( pkg ) ) + ":" ) + name ) ) ; } }

Target:
private void call ( com.googlecode.prolog_cafe.lang.BufferingPrologControl env , java.lang.String name ) { com.googlecode.prolog_cafe.lang.StructureTerm head = com.googlecode.prolog_cafe.lang.SymbolTerm.create ( pkg , name , 0 ) ; com.google.common.truth.Truth.assert_ ( ) . withFailureMessage ( ( ( ( "Cannot invoke " + ( pkg ) ) + ":" ) + name ) ) . that ( env.execute ( Prolog.BUILTIN , "call" , head ) ) . isTrue ( ) ; }
Source:
private java.lang.String parseExactlyOneFooter ( org.eclipse.jgit.revwalk.RevCommit commit , org.eclipse.jgit.revwalk.FooterKey footerKey ) throws org.eclipse.jgit.errors.ConfigInvalidException { java.lang.String line = parseOneFooter ( commit , footerKey ) ; if ( line == null ) { throw expectedOneFooter ( footerKey , java.util.Collections.< java.lang.String > emptyList ( ) ) ; } return line ; }

Target:
private java.lang.String parseExactlyOneFooter ( com.google.gerrit.server.notedb.ChangeNotesCommit commit , org.eclipse.jgit.revwalk.FooterKey footerKey ) throws org.eclipse.jgit.errors.ConfigInvalidException { java.lang.String line = parseOneFooter ( commit , footerKey ) ; if ( line == null ) { throw expectedOneFooter ( footerKey , java.util.Collections.< java.lang.String > emptyList ( ) ) ; } return line ; }
Source:
private void updateEditReference ( org.eclipse.jgit.lib.Repository repository , com.google.gerrit.server.edit.ChangeEdit changeEdit , org.eclipse.jgit.lib.ObjectId newEditCommit , java.sql.Timestamp timestamp ) throws java.io.IOException { java.lang.String editRefName = changeEdit.getRefName ( ) ; org.eclipse.jgit.revwalk.RevCommit currentEditCommit = changeEdit.getEditCommit ( ) ; updateReference ( repository , editRefName , currentEditCommit , newEditCommit , timestamp ) ; }

Target:
private void updateEditReference ( org.eclipse.jgit.lib.Repository repository , com.google.gerrit.server.edit.ChangeEdit changeEdit , org.eclipse.jgit.lib.ObjectId newEditCommit , java.sql.Timestamp timestamp ) throws com.google.gwtorm.server.OrmException , java.io.IOException { java.lang.String editRefName = changeEdit.getRefName ( ) ; org.eclipse.jgit.revwalk.RevCommit currentEditCommit = changeEdit.getEditCommit ( ) ; updateReference ( repository , editRefName , currentEditCommit , newEditCommit , timestamp ) ; reindex ( changeEdit.getChange ( ) ) ; }
Source:
public java.lang.String apply ( com.google.gerrit.server.change.RevisionResource rev , com.googlesource.gerrit.plugins.cookbook.HelloWorldAction.Input input ) { return java.lang.String.format ( "%s %s!" , "Hello" , com.google.common.base.Objects.firstNonNull ( user.get ( ) . getUserName ( ) , "world" ) ) ; }

Target:
public java.lang.String apply ( com.google.gerrit.server.change.RevisionResource rev , com.googlesource.gerrit.plugins.cookbook.HelloWorldAction.Input input ) { final java.lang.String greeting = ( input.french ) ? "Bonjour" : "Hello" ; return java.lang.String.format ( "%s %s from change %s, patch set %d!" , greeting , ( com.google.common.base.Strings.isNullOrEmpty ( input.message ) ? com.google.common.base.Objects.firstNonNull ( user.get ( ) . getUserName ( ) , "world" ) : input.message ) , rev.getChange ( ) . getId ( ) . toString ( ) , rev.getPatchSet ( ) . getPatchSetId ( ) ) ; }