auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testGetRefsHeadsTextTrailingSlash ( ) throws java.lang.Exception { com.google.gitiles.FakeHttpServletRequest req = com.google.gitiles.FakeHttpServletRequest.newRequest ( ) ; req.setPathInfo ( "/test/+refs/heads/" ) ; req.setQueryString ( "format=TEXT" ) ; com.google.gitiles.FakeHttpServletResponse res = new com.google.gitiles.FakeHttpServletResponse ( ) ; servlet.service ( req , res ) ; assertEquals ( 200 , res.getStatus ( ) ) ; assertEquals ( ( ( ( ( id ( "refs/heads/branch" ) ) + " refs/heads/branch\n" ) + ( id ( "refs/heads/master" ) ) ) + " refs/heads/master\n" ) , res.getActualBodyString ( ) ) ; }

Target:
public void getRefsHeadsTextTrailingSlash ( ) throws java.lang.Exception { com.google.gitiles.FakeHttpServletRequest req = com.google.gitiles.FakeHttpServletRequest.newRequest ( ) ; req.setPathInfo ( "/test/+refs/heads/" ) ; req.setQueryString ( "format=TEXT" ) ; com.google.gitiles.FakeHttpServletResponse res = new com.google.gitiles.FakeHttpServletResponse ( ) ; servlet.service ( req , res ) ; org.junit.Assert.assertEquals ( 200 , res.getStatus ( ) ) ; org.junit.Assert.assertEquals ( ( ( ( ( id ( "refs/heads/branch" ) ) + " refs/heads/branch\n" ) + ( id ( "refs/heads/master" ) ) ) + " refs/heads/master\n" ) , res.getActualBodyString ( ) ) ; }
Source:
private static int split ( java.lang.String line ) { int sp = line.indexOf ( ' ' ) ; int tab = line.indexOf ( '\t' ) ; if ( ( sp < 0 ) && ( tab < 0 ) ) { return - 1 ; } if ( ( sp < 0 ) && ( 0 <= tab ) ) { return tab ; } if ( ( 0 <= sp ) && ( tab < 0 ) ) { return sp ; } return java.lang.Math.min ( sp , tab ) ; }

Target:
public void replace ( com.google.gerrit.common.data.AccessSection section ) { for ( com.google.gerrit.common.data.Permission permission : section.getPermissions ( ) ) { for ( com.google.gerrit.common.data.PermissionRule rule : permission.getRules ( ) ) { rule.setGroup ( resolve ( rule.getGroup ( ) ) ) ; } } accessSections.put ( section.getRefPattern ( ) , section ) ; }
Source:
private void setListIdHeader ( ) throws com.google.gerrit.common.errors.EmailException { setVHeader ( "List-Id" , "<$email.listId.replace('@', '.')>" ) ; if ( ( getSettingsUrl ( ) ) != null ) { setVHeader ( "List-Unsubscribe" , "<$email.settingsUrl>" ) ; } }

Target:
private void setListIdHeader ( ) { setHeader ( "List-Id" , ( ( ( ( "<gerrit-" + ( branch.getParentKey ( ) . get ( ) . replace ( '/' , '-' ) ) ) + "." ) + ( getGerritHost ( ) ) ) + ">" ) ) ; if ( ( getSettingsUrl ( ) ) != null ) { setHeader ( "List-Unsubscribe" , ( ( "<" + ( getSettingsUrl ( ) ) ) + ">" ) ) ; } }
Source:
private com.google.common.util.concurrent.ListenableFuture < ? > submit ( java.util.concurrent.Callable < java.lang.Long > task ) { com.google.common.util.concurrent.ListenableFuture < java.lang.Long > future = com.google.common.util.concurrent.Futures.nonCancellationPropagating ( writerThread.submit ( task ) ) ; return com.google.common.util.concurrent.Futures.transformAsync ( future , new com.google.common.util.concurrent.AsyncFunction < java.lang.Long , java.lang.Void > ( ) { @ java.lang.Override public com.google.common.util.concurrent.ListenableFuture < java.lang.Void > apply ( java.lang.Long gen ) throws java.lang.InterruptedException { reopenThread.waitForGeneration ( gen , 0 ) ; return new NrtFuture ( gen ) ; } } ) ; }

Target:
private com.google.common.util.concurrent.ListenableFuture < ? > submit ( java.util.concurrent.Callable < java.lang.Long > task ) { com.google.common.util.concurrent.ListenableFuture < java.lang.Long > future = com.google.common.util.concurrent.Futures.nonCancellationPropagating ( writerThread.submit ( task ) ) ; return com.google.common.util.concurrent.Futures.transformAsync ( future , new com.google.common.util.concurrent.AsyncFunction < java.lang.Long , java.lang.Void > ( ) { @ java.lang.Override public com.google.common.util.concurrent.ListenableFuture < java.lang.Void > apply ( java.lang.Long gen ) throws java.lang.InterruptedException { reopenThread.waitForGeneration ( gen , 0 ) ; return new NrtFuture ( gen ) ; } } , com.google.common.util.concurrent.MoreExecutors.directExecutor ( ) ) ; }
Source:
private void saveLabelConfig ( ) throws java.lang.Exception { com.google.gerrit.server.git.ProjectConfig cfg = projectCache.checkedGet ( allProjects ) . getConfig ( ) ; cfg.getLabelSections ( ) . put ( Q.getName ( ) , Q ) ; saveProjectConfig ( cfg ) ; }

Target:
private void saveLabelConfig ( ) throws java.lang.Exception { com.google.gerrit.server.git.ProjectConfig cfg = projectCache.checkedGet ( allProjects ) . getConfig ( ) ; cfg.getLabelSections ( ) . put ( Q.getName ( ) , Q ) ; cfg.getLabelSections ( ) . put ( P.getName ( ) , P ) ; saveProjectConfig ( cfg ) ; }
Source:
private static com.google.gerrit.server.git.MergeSuperSet.QueryKey create ( com.google.gerrit.reviewdb.client.Branch.NameKey branch , java.lang.Iterable < java.lang.String > hashes ) { return new com.google.gerrit.server.git.AutoValue_MergeSuperSet_QueryKey ( branch , com.google.common.collect.ImmutableSet.copyOf ( hashes ) ) ; }

Target:
private static com.google.common.collect.ImmutableListMultimap < com.google.gerrit.reviewdb.client.Branch.NameKey , com.google.gerrit.server.query.change.ChangeData > byBranch ( java.lang.Iterable < com.google.gerrit.server.query.change.ChangeData > changes ) throws com.google.gwtorm.server.OrmException { com.google.common.collect.ImmutableListMultimap.Builder < com.google.gerrit.reviewdb.client.Branch.NameKey , com.google.gerrit.server.query.change.ChangeData > builder = com.google.common.collect.ImmutableListMultimap.builder ( ) ; for ( com.google.gerrit.server.query.change.ChangeData cd : changes ) { builder.put ( cd.change ( ) . getDest ( ) , cd ) ; } return builder.build ( ) ; }
Source:
protected void configure ( ) { final com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < com.google.gerrit.server.patch.PatchListKey , com.google.gerrit.server.patch.PatchList > > type = new com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < com.google.gerrit.server.patch.PatchListKey , com.google.gerrit.server.patch.PatchList > > ( ) { } ; disk ( type , com.google.gerrit.server.patch.PatchListCacheImpl.CACHE_NAME ) . memoryLimit ( 128 ) . evictionPolicy ( EvictionPolicy.LRU ) . populateWith ( com.google.gerrit.server.patch.PatchListCacheImpl.Loader.class ) ; bind ( com.google.gerrit.server.patch.PatchListCacheImpl.class ) ; bind ( com.google.gerrit.server.patch.PatchListCache.class ) . to ( com.google.gerrit.server.patch.PatchListCacheImpl.class ) ; }

Target:
protected void configure ( ) { final com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < com.google.gerrit.server.patch.PatchListKey , com.google.gerrit.server.patch.PatchList > > type = new com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < com.google.gerrit.server.patch.PatchListKey , com.google.gerrit.server.patch.PatchList > > ( ) { } ; cache ( type , com.google.gerrit.server.patch.PatchListCacheImpl.CACHE_NAME ) . memoryLimit ( 128 ) . diskLimit ( 16384 ) . evictionPolicy ( EvictionPolicy.LRU ) . populateWith ( com.google.gerrit.server.patch.PatchListCacheImpl.Loader.class ) ; bind ( com.google.gerrit.server.patch.PatchListCacheImpl.class ) ; bind ( com.google.gerrit.server.patch.PatchListCache.class ) . to ( com.google.gerrit.server.patch.PatchListCacheImpl.class ) ; }
Source:
private void fill ( com.google.gerrit.reviewdb.client.Account account , boolean detailed ) { name = account.getFullName ( ) ; if ( detailed ) { _account_id = account.getId ( ) . get ( ) ; email = account.getPreferredEmail ( ) ; } }

Target:
private void fill ( com.google.gerrit.reviewdb.client.Account account , boolean detailed ) { name = account.getFullName ( ) ; if ( detailed ) { _account_id = account.getId ( ) . get ( ) ; email = account.getPreferredEmail ( ) ; username = account.getUserName ( ) ; } }
Source:
private void notFound ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse rsp ) throws java.io.IOException { if ( userProvider.get ( ) . isIdentifiedUser ( ) ) { rsp.sendError ( HttpServletResponse.SC_NOT_FOUND ) ; } else { rsp.sendRedirect ( com.google.gerrit.httpd.gitweb.GitwebServlet.getLoginRedirectUrl ( req ) ) ; } }

Target:
private void sendErrorOrRedirect ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse rsp , int statusCode ) throws java.io.IOException { if ( userProvider.get ( ) . isIdentifiedUser ( ) ) { rsp.sendError ( statusCode ) ; } else { rsp.sendRedirect ( com.google.gerrit.httpd.gitweb.GitwebServlet.getLoginRedirectUrl ( req ) ) ; } }
Source:
private java.lang.String healthCheckAccess ( ) throws java.io.IOException { client ( ) . sysInfo ( ) ; java.lang.String result = ( "{\"status\"=\"ok\",\"username\"=\"" + ( getUsername ( ) ) ) + "\"}" ; log.debug ( "Health check on access result: {}" , result ) ; return result ; }

Target:
public java.lang.String healthCheck ( com.googlesource.gerrit.plugins.its.jira.Check check ) throws java.io.IOException { return execute ( ( ) -> { if ( check.equals ( Check.ACCESS ) ) { return client ( ) . healthCheckAccess ( ) ; } return client ( ) . healthCheckSysinfo ( ) ; } ) ; }
Source:
static com.google.gson.JsonArray newJsonArrayFromStrings ( java.util.Collection < java.lang.String > names ) { com.google.gson.JsonArray result = new com.google.gson.JsonArray ( ) ; java.util.List < java.lang.String > list = new java.util.ArrayList < java.lang.String > ( names ) ; java.util.Collections.sort ( list ) ; for ( java.lang.String name : list ) { result.add ( name ) ; } return result ; }

Target:
static void addToMap ( java.util.Map < java.lang.String , java.util.Set < java.lang.String > > map , java.lang.String key , java.lang.String value ) { if ( ( map.get ( key ) ) == null ) { map.put ( key , new java.util.HashSet < > ( ) ) ; } map.get ( key ) . add ( value ) ; }
Source:
public com.google.gerrit.extensions.common.RevisionInfo addRevisionActions ( com.google.gerrit.extensions.common.RevisionInfo to , com.google.gerrit.server.change.RevisionResource rsrc ) { to.actions = toActionMap ( rsrc ) ; return to ; }

Target:
public java.util.Map < java.lang.String , com.google.gerrit.extensions.common.ActionInfo > format ( com.google.gerrit.server.change.RevisionResource rsrc ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.extensions.common.ChangeInfo changeInfo = null ; com.google.gerrit.extensions.common.RevisionInfo revisionInfo = null ; java.util.List < com.google.gerrit.extensions.api.changes.ActionVisitor > visitors = visitors ( ) ; if ( ! ( visitors.isEmpty ( ) ) ) { changeInfo = changeJson ( ) . format ( rsrc ) ; revisionInfo = com.google.common.base.Preconditions.checkNotNull ( com.google.common.collect.Iterables.getOnlyElement ( changeInfo.revisions.values ( ) ) ) ; changeInfo.revisions = null ; } return toActionMap ( rsrc , visitors , changeInfo , revisionInfo ) ; }
Source:
private java.util.Map < com.google.gerrit.reviewdb.client.Change.Key , com.google.gerrit.reviewdb.client.Change.Id > openChangesByKey ( com.google.gerrit.reviewdb.client.Branch.NameKey branch ) throws com.google.gwtorm.server.OrmException { final java.util.Map < com.google.gerrit.reviewdb.client.Change.Key , com.google.gerrit.reviewdb.client.Change.Id > r = new java.util.HashMap < > ( ) ; for ( com.google.gerrit.reviewdb.client.Change c : db.changes ( ) . byBranchOpenAll ( branch ) ) { r.put ( c.getKey ( ) , c.getId ( ) ) ; } return r ; }

Target:
private java.util.Map < com.google.gerrit.reviewdb.client.Change.Key , com.google.gerrit.server.notedb.ChangeNotes > openChangesByBranch ( com.google.gerrit.reviewdb.client.Branch.NameKey branch ) throws com.google.gwtorm.server.OrmException { java.util.Map < com.google.gerrit.reviewdb.client.Change.Key , com.google.gerrit.server.notedb.ChangeNotes > r = new java.util.HashMap < > ( ) ; for ( com.google.gerrit.server.query.change.ChangeData cd : queryProvider.get ( ) . byBranchOpen ( branch ) ) { r.put ( cd.change ( ) . getKey ( ) , cd.notes ( ) ) ; } return r ; }
Source:
public com.google.common.collect.Multimap < com.google.gerrit.reviewdb.client.Project.NameKey , com.google.gerrit.reviewdb.client.Project.NameKey > getProjectSubscriptionGraph ( ) { com.google.common.collect.Multimap < com.google.gerrit.reviewdb.client.Project.NameKey , com.google.gerrit.reviewdb.client.Project.NameKey > graph = com.google.common.collect.HashMultimap.create ( ) ; for ( com.google.gerrit.reviewdb.client.Branch.NameKey b : targets.keySet ( ) ) { java.util.Collection < com.google.gerrit.reviewdb.client.SubmoduleSubscription > ss = targets.get ( b ) ; for ( com.google.gerrit.reviewdb.client.SubmoduleSubscription s : ss ) { graph.put ( b.getParentKey ( ) , s.getSubmodule ( ) . getParentKey ( ) ) ; } } return graph ; }

Target:
public boolean hasSubscription ( com.google.gerrit.reviewdb.client.Branch.NameKey branch ) { return targets.containsKey ( branch ) ; }
Source:
public void deleteReviewerFromReviewableChange ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; removeReviewer ( sc , extraReviewer ) ; assertThat ( sender ) . sent ( "deleteReviewer" , sc ) . notTo ( sc.owner ) . to ( extraReviewer ) . cc ( extraCcer , sc.reviewer , sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; }

Target:
public void deleteReviewerFromReviewableChange ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChangeWithExtraReviewer ( ) ; removeReviewer ( sc , extraReviewer ) ; assertThat ( sender ) . sent ( "deleteReviewer" , sc ) . to ( extraReviewer ) . cc ( extraCcer , sc.reviewer , sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) . noOneElse ( ) ; }
Source:
private com.google.gerrit.reviewdb.client.AccountGroup newGroup ( com.google.gerrit.reviewdb.server.ReviewDb c , java.lang.String name , com.google.gerrit.reviewdb.client.AccountGroup.UUID uuid ) throws com.google.gwtorm.server.OrmException { if ( uuid == null ) { uuid = com.google.gerrit.server.account.GroupUUID.make ( name , serverUser ) ; } return new com.google.gerrit.reviewdb.client.AccountGroup ( new com.google.gerrit.reviewdb.client.AccountGroup.NameKey ( name ) , new com.google.gerrit.reviewdb.client.AccountGroup.Id ( c.nextAccountGroupId ( ) ) , uuid ) ; }

Target:
private com.google.gerrit.reviewdb.client.AccountGroup newGroup ( com.google.gerrit.reviewdb.server.ReviewDb c , java.lang.String name , com.google.gerrit.reviewdb.client.AccountGroup.UUID uuid ) throws com.google.gwtorm.server.OrmException { if ( uuid == null ) { uuid = com.google.gerrit.server.account.GroupUUID.make ( name , serverUser ) ; } return new com.google.gerrit.reviewdb.client.AccountGroup ( new com.google.gerrit.reviewdb.client.AccountGroup.NameKey ( name ) , new com.google.gerrit.reviewdb.client.AccountGroup.Id ( c.nextAccountGroupId ( ) ) , uuid , com.google.gerrit.common.TimeUtil.nowTs ( ) ) ; }
Source:
public void parseCommit ( ) throws java.lang.Exception { assertParseSucceeds ( ( "Update change\n" + ( ( ( ( "\n" + "Patch-set: 1\n" ) + "Branch: refs/heads/master\n" ) + "Subject: Some subject of a change\n" ) + "Commit: abcd1234abcd1234abcd1234abcd1234abcd1234" ) ) ) ; assertParseFails ( ( "Update change\n" + ( ( ( ( ( "\n" + "Patch-set: 1\n" ) + "Branch: refs/heads/master\n" ) + "Subject: Some subject of a change\n" ) + "Commit: abcd1234abcd1234abcd1234abcd1234abcd1234\n" ) + "Commit: deadbeefdeadbeefdeadbeefdeadbeefdeadbeef" ) ) ) ; assertParseFails ( ( "Update patch set 1\n" + ( ( ( ( "Uploaded patch set 1.\n" + "Patch-set: 1\n" ) + "Branch: refs/heads/master\n" ) + "Subject: Some subject of a change\n" ) + "Commit: beef" ) ) ) ; }

Target:
public void parseCommit ( ) throws java.lang.Exception { assertParseSucceeds ( ( "Update change\n" + ( ( ( ( ( "\n" + "Patch-set: 1\n" ) + "Branch: refs/heads/master\n" ) + "Change-id: I577fb248e474018276351785930358ec0450e9f7\n" ) + "Subject: Some subject of a change\n" ) + "Commit: abcd1234abcd1234abcd1234abcd1234abcd1234" ) ) ) ; assertParseFails ( ( "Update change\n" + ( ( ( ( ( "\n" + "Patch-set: 1\n" ) + "Branch: refs/heads/master\n" ) + "Subject: Some subject of a change\n" ) + "Commit: abcd1234abcd1234abcd1234abcd1234abcd1234\n" ) + "Commit: deadbeefdeadbeefdeadbeefdeadbeefdeadbeef" ) ) ) ; assertParseFails ( ( "Update patch set 1\n" + ( ( ( ( "Uploaded patch set 1.\n" + "Patch-set: 1\n" ) + "Branch: refs/heads/master\n" ) + "Subject: Some subject of a change\n" ) + "Commit: beef" ) ) ) ; }
Source:
public void execute ( ) { for ( com.google.gerrit.client.diff.CommentBox box : initialBoxes ) { box.resizePaddingWidget ( ) ; } }

Target:
public void onShowView ( ) { super . onShowView ( ) ; if ( ( cmA ) != null ) { cmA.refresh ( ) ; } if ( ( cmB ) != null ) { cmB.refresh ( ) ; } com.google.gwt.user.client.Window.enableScrolling ( false ) ; for ( com.google.gerrit.client.diff.CommentBox box : initialBoxes ) { box.resizePaddingWidget ( ) ; } }
Source:
public void generateResultSetGet ( final com.google.gwtorm.jdbc.gen.CodeGenSupport cgs ) { cgs.fieldSetBegin ( ) ; cgs.mv.visitLdcInsn ( getTrueValue ( ) ) ; cgs.pushSqlHandle ( ) ; cgs.pushColumnIndex ( ) ; cgs.invokeResultSetGet ( getJavaSqlTypeAlias ( ) ) ; cgs.mv.visitMethodInsn ( Opcodes.INVOKEVIRTUAL , org.objectweb.asm.Type.getInternalName ( java.lang.String.class ) , "equals" , org.objectweb.asm.Type.getMethodDescriptor ( Type.BOOLEAN_TYPE , new org.objectweb.asm.Type [ ] { org.objectweb.asm.Type.getType ( java.lang.Object.class ) } ) ) ; cgs.fieldSetEnd ( ) ; }

Target:
public void generateResultSetGet ( final com.google.gwtorm.server.CodeGenSupport cgs ) { cgs.fieldSetBegin ( ) ; cgs.mv.visitLdcInsn ( getTrueValue ( ) ) ; cgs.pushSqlHandle ( ) ; cgs.pushColumnIndex ( ) ; cgs.invokeResultSetGet ( getJavaSqlTypeAlias ( ) ) ; cgs.mv.visitMethodInsn ( Opcodes.INVOKEVIRTUAL , org.objectweb.asm.Type.getInternalName ( java.lang.String.class ) , "equals" , org.objectweb.asm.Type.getMethodDescriptor ( Type.BOOLEAN_TYPE , new org.objectweb.asm.Type [ ] { org.objectweb.asm.Type.getType ( java.lang.Object.class ) } ) ) ; cgs.fieldSetEnd ( ) ; }
Source:
public void onSuccess ( ) { com.google.gerrit.client.Gerrit.display ( token , select ( ) ) ; }

Target:
public void onSuccess ( ) { com.google.gerrit.client.patches.PatchScreen.TopView top = ( topView == null ) ? com.google.gerrit.client.Gerrit.getPatchScreenTopView ( ) : topView ; switch ( type ) { case SIDE_BY_SIDE : com.google.gerrit.client.Gerrit.display ( token , new com.google.gerrit.client.patches.PatchScreen.SideBySide ( id , patchIndex , patchSetDetail , patchTable , top , baseId ) ) ; break ; case UNIFIED : com.google.gerrit.client.Gerrit.display ( token , new com.google.gerrit.client.patches.PatchScreen.Unified ( id , patchIndex , patchSetDetail , patchTable , top , baseId ) ) ; break ; } }
Source:
protected com.google.gerrit.extensions.common.ChangeInfo get ( java.lang.String id , com.google.gerrit.extensions.common.ListChangesOption ... options ) throws com.google.gerrit.extensions.restapi.RestApiException { java.util.EnumSet < com.google.gerrit.extensions.common.ListChangesOption > s = java.util.EnumSet.noneOf ( com.google.gerrit.extensions.common.ListChangesOption.class ) ; s.addAll ( java.util.Arrays.asList ( options ) ) ; return gApi.changes ( ) . id ( id ) . get ( s ) ; }

Target:
protected com.google.gerrit.extensions.common.EditInfo getEdit ( java.lang.String id ) throws com.google.gerrit.extensions.restapi.RestApiException { return gApi.changes ( ) . id ( id ) . getEdit ( ) ; }
Source:
protected com.google.gerrit.extensions.common.ChangeInfo queryOne ( java.lang.Object query ) throws java.lang.Exception { java.util.List < com.google.gerrit.extensions.common.ChangeInfo > results = query ( query ) ; com.google.common.truth.Truth.assert_ ( ) . withFailureMessage ( java.lang.String.format ( "expected singleton List<ChangeInfo>, found %s for [%s]" , results , query ) ) . that ( results ) . hasSize ( 1 ) ; return results.get ( 0 ) ; }

Target:
protected static java.lang.Iterable < java.lang.Integer > ids ( com.google.gerrit.reviewdb.client.Change ... changes ) { return com.google.common.collect.FluentIterable.from ( java.util.Arrays.asList ( changes ) ) . transform ( new com.google.common.base.Function < com.google.gerrit.reviewdb.client.Change , java.lang.Integer > ( ) { @ java.lang.Override public java.lang.Integer apply ( com.google.gerrit.reviewdb.client.Change in ) { return in.getId ( ) . get ( ) ; } } ) ; }
Source:
private static void unified ( final java.lang.String token , final com.google.gerrit.reviewdb.client.PatchSet.Id baseId , final com.google.gerrit.reviewdb.client.Patch.Key id ) { com.google.gwt.core.client.GWT.runAsync ( new com.google.gerrit.client.Dispatcher.AsyncSplit ( token ) { @ java.lang.Override public void onSuccess ( ) { com.google.gerrit.client.patches.UnifiedPatchScreen.TopView top = com.google.gerrit.client.Gerrit.getPatchScreenTopView ( ) ; com.google.gerrit.client.Gerrit.display ( token , new com.google.gerrit.client.patches.UnifiedPatchScreen ( id , top , baseId ) ) ; } } ) ; }

Target:
private static void unified ( final java.lang.String token , final com.google.gerrit.reviewdb.client.PatchSet.Id baseId , final com.google.gerrit.reviewdb.client.Patch.Key id , final com.google.gerrit.client.diff.DisplaySide side , final int line ) { com.google.gwt.core.client.GWT.runAsync ( new com.google.gerrit.client.Dispatcher.AsyncSplit ( token ) { @ java.lang.Override public void onSuccess ( ) { com.google.gerrit.client.Gerrit.display ( token , new com.google.gerrit.client.diff.Unified ( baseId , id.getParentKey ( ) , id.get ( ) , side , line ) ) ; } } ) ; }
Source:
public final void copyTo ( com.google.gerrit.extensions.client.EditPreferencesInfo p ) { p.tabSize = tabSize ( ) ; p.lineLength = lineLength ( ) ; p.hideTopMenu = hideTopMenu ( ) ; p.showTabs = showTabs ( ) ; p.showWhitespaceErrors = showWhitespaceErrors ( ) ; p.syntaxHighlighting = syntaxHighlighting ( ) ; p.hideLineNumbers = hideLineNumbers ( ) ; p.theme = theme ( ) ; }

Target:
public final void copyTo ( com.google.gerrit.extensions.client.EditPreferencesInfo p ) { p.tabSize = tabSize ( ) ; p.lineLength = lineLength ( ) ; p.hideTopMenu = hideTopMenu ( ) ; p.showTabs = showTabs ( ) ; p.showWhitespaceErrors = showWhitespaceErrors ( ) ; p.syntaxHighlighting = syntaxHighlighting ( ) ; p.hideLineNumbers = hideLineNumbers ( ) ; p.theme = theme ( ) ; p.keyMapType = keyMapType ( ) ; }
Source:
void onBeginAddRule ( com.google.gwt.event.dom.client.ClickEvent event ) { addStage1.getStyle ( ) . setDisplay ( Display.NONE ) ; addStage2.getStyle ( ) . setDisplay ( Display.BLOCK ) ; com.google.gwt.core.client.Scheduler.get ( ) . scheduleDeferred ( new com.google.gwt.core.client.Scheduler.ScheduledCommand ( ) { @ java.lang.Override public void execute ( ) { groupToAdd.setFocus ( true ) ; } } ) ; }

Target:
void beginAddRule ( ) { addStage1.getStyle ( ) . setDisplay ( Display.NONE ) ; addStage2.getStyle ( ) . setDisplay ( Display.BLOCK ) ; com.google.gwt.core.client.Scheduler.get ( ) . scheduleDeferred ( new com.google.gwt.core.client.Scheduler.ScheduledCommand ( ) { @ java.lang.Override public void execute ( ) { groupToAdd.setFocus ( true ) ; } } ) ; }
Source:
public void onSuccess ( com.google.gerrit.client.diff.DiffInfo diffInfo ) { if ( ( id == ( reloadVersionId ) ) && ( isAttached ( ) ) ) { diff = diffInfo ; operation ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { clearSkipBars ( ) ; clearMarkers ( ) ; diffTable.sidePanel.clearDiffGutters ( ) ; setShowIntraline ( prefs.intralineDifference ( ) ) ; render ( diff ) ; renderSkips ( prefs.context ( ) ) ; } } ) ; } }

Target:
public void onSuccess ( com.google.gerrit.client.diff.DiffInfo diffInfo ) { if ( ( id == ( reloadVersionId ) ) && ( isAttached ( ) ) ) { diff = diffInfo ; operation ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { skipManager.removeAll ( ) ; chunkManager.reset ( ) ; diffTable.overview.clearDiffMarkers ( ) ; setShowIntraline ( prefs.intralineDifference ( ) ) ; render ( diff ) ; skipManager.render ( prefs.context ( ) , diff ) ; } } ) ; } }
Source:
private static void init ( ) { if ( ( com.google.gwtexpui.globalkey.client.GlobalKey.keys ) == null ) { com.google.gwtexpui.globalkey.client.GlobalKey.keys = new com.google.gwtexpui.globalkey.client.KeyCommandSet ( ) ; com.google.gwtexpui.globalkey.client.DocWidget.get ( ) . addKeyPressHandler ( com.google.gwtexpui.globalkey.client.GlobalKey.keys ) ; com.google.gwtexpui.globalkey.client.GlobalKey.keyApplication = new com.google.gwtexpui.globalkey.client.KeyCommandSet ( Util.C.applicationSection ( ) ) ; com.google.gwtexpui.globalkey.client.GlobalKey.keyApplication.add ( new com.google.gwtexpui.globalkey.client.ShowHelpCommand ( ) ) ; com.google.gwtexpui.globalkey.client.GlobalKey.keys.add ( com.google.gwtexpui.globalkey.client.GlobalKey.keyApplication ) ; } }

Target:
public static void dialog ( final com.google.gwt.user.client.ui.PopupPanel panel ) { com.google.gwtexpui.globalkey.client.GlobalKey.initEvents ( ) ; com.google.gwtexpui.globalkey.client.GlobalKey.initDialog ( ) ; assert panel.isVisible ( ) ; assert ( com.google.gwtexpui.globalkey.client.GlobalKey.active ) == ( com.google.gwtexpui.globalkey.client.GlobalKey.global ) ; com.google.gwtexpui.globalkey.client.GlobalKey.active = new com.google.gwtexpui.globalkey.client.GlobalKey.State ( panel ) ; com.google.gwtexpui.globalkey.client.GlobalKey.active.add ( new com.google.gwtexpui.globalkey.client.KeyCommand ( 0 , com.google.gwt.event.dom.client.KeyCodes.KEY_ESCAPE , Util.C.closeCurrentDialog ( ) ) { @ java.lang.Override public void onKeyPress ( final com.google.gwt.event.dom.client.KeyPressEvent event ) { panel.hide ( ) ; } } ) ; panel.addCloseHandler ( com.google.gwtexpui.globalkey.client.GlobalKey.restoreGlobal ) ; }
Source:
public java.util.concurrent.ConcurrentMap < java.lang.String , com.google.gerrit.httpd.WebSessionManager.Val > asMap ( ) { java.util.concurrent.ConcurrentMap < java.lang.String , com.google.gerrit.httpd.WebSessionManager.Val > map = new java.util.concurrent.ConcurrentHashMap < > ( ) ; java.io.File [ ] files = dir.listFiles ( ) ; if ( files == null ) { return map ; } for ( java.io.File f : files ) { com.google.gerrit.httpd.WebSessionManager.Val v = readFile ( f ) ; if ( v != null ) { map.put ( f.getName ( ) , v ) ; } } return map ; }

Target:
public java.util.concurrent.ConcurrentMap < java.lang.String , com.google.gerrit.httpd.WebSessionManager.Val > asMap ( ) { java.util.concurrent.ConcurrentMap < java.lang.String , com.google.gerrit.httpd.WebSessionManager.Val > map = new java.util.concurrent.ConcurrentHashMap < > ( ) ; for ( java.nio.file.Path path : listFiles ( ) ) { com.google.gerrit.httpd.WebSessionManager.Val v = readFile ( path ) ; if ( v != null ) { map.put ( path.getFileName ( ) . toString ( ) , v ) ; } } return map ; }
Source:
protected void bccStarredBy ( ) { try { for ( com.google.gerrit.reviewdb.StarredChange w : args.db.get ( ) . starredChanges ( ) . byChange ( change.getId ( ) ) ) { add ( RecipientType.BCC , w.getAccountId ( ) ) ; } } catch ( com.google.gwtorm.client.OrmException err ) { } }

Target:
protected void bccStarredBy ( ) { try { for ( com.google.gerrit.reviewdb.client.StarredChange w : args.db.get ( ) . starredChanges ( ) . byChange ( change.getId ( ) ) ) { super . add ( RecipientType.BCC , w.getAccountId ( ) ) ; } } catch ( com.google.gwtorm.server.OrmException err ) { com.google.gerrit.server.mail.ChangeEmail.log.warn ( "Cannot BCC users that starred updated change" , err ) ; } }
Source:
public byte [ ] atomicUpdate ( byte [ ] key , com.google.gwtorm.client.AtomicUpdate < byte [ ] > update ) throws com.google.gwtorm.client.OrmException { db.lock.lock ( ) ; try { final byte [ ] oldData = get ( key ) ; final byte [ ] newData = update.update ( oldData ) ; if ( newData != null ) { upsert ( key , newData ) ; } else if ( oldData != null ) { delete ( key ) ; } return newData ; } finally { db.lock.unlock ( ) ; } }

Target:
public void atomicUpdate ( byte [ ] key , com.google.gwtorm.client.AtomicUpdate < byte [ ] > update ) throws com.google.gwtorm.client.OrmException { db.lock.lock ( ) ; try { final byte [ ] oldData = fetchRow ( key ) ; final byte [ ] newData = update.update ( oldData ) ; if ( newData != null ) { upsert ( key , newData ) ; } else if ( oldData != null ) { delete ( key ) ; } } finally { db.lock.unlock ( ) ; } }
Source:
protected java.util.List < org.eclipse.jgit.revwalk.RevCommit > getRemoteLog ( com.google.gerrit.reviewdb.client.Project.NameKey project , java.lang.String branch ) throws java.io.IOException { try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( project ) ; org.eclipse.jgit.revwalk.RevWalk rw = new org.eclipse.jgit.revwalk.RevWalk ( repo ) ) { rw.markStart ( rw.parseCommit ( repo.getRef ( ( "refs/heads/" + branch ) ) . getObjectId ( ) ) ) ; return com.google.common.collect.Lists.newArrayList ( rw ) ; } }

Target:
protected java.util.List < org.eclipse.jgit.revwalk.RevCommit > getRemoteLog ( com.google.gerrit.reviewdb.client.Project.NameKey project , java.lang.String branch ) throws java.io.IOException { try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( project ) ; org.eclipse.jgit.revwalk.RevWalk rw = new org.eclipse.jgit.revwalk.RevWalk ( repo ) ) { rw.markStart ( rw.parseCommit ( repo.exactRef ( ( "refs/heads/" + branch ) ) . getObjectId ( ) ) ) ; return com.google.common.collect.Lists.newArrayList ( rw ) ; } }
Source:
public void commit ( ) throws com.google.gwtorm.server.OrmException { try { conn.commit ( ) ; } catch ( java.sql.SQLException err ) { throw new com.google.gwtorm.server.OrmException ( "Cannot commit transaction" , err ) ; } finally { try { conn.setAutoCommit ( true ) ; } catch ( java.sql.SQLException err ) { throw new com.google.gwtorm.server.OrmException ( "Cannot set auto commit mode" , err ) ; } } }

Target:
public void commit ( ) throws com.google.gwtorm.server.OrmException { try { if ( ! ( conn.getAutoCommit ( ) ) ) { conn.commit ( ) ; } } catch ( java.sql.SQLException err ) { throw new com.google.gwtorm.server.OrmException ( "Cannot commit transaction" , err ) ; } finally { try { conn.setAutoCommit ( true ) ; } catch ( java.sql.SQLException err ) { throw new com.google.gwtorm.server.OrmException ( "Cannot set auto commit mode" , err ) ; } } }
Source:
private static boolean hasNoHttpd ( java.lang.Class < ? > clazz ) { for ( ; clazz != null ; clazz = clazz.getSuperclass ( ) ) { if ( ( clazz.getAnnotation ( com.google.gerrit.acceptance.NoHttpd.class ) ) != null ) { return true ; } } return false ; }

Target:
private static boolean has ( java.lang.Class annotation , java.lang.Class < ? > clazz ) { for ( ; clazz != null ; clazz = clazz.getSuperclass ( ) ) { if ( ( clazz.getAnnotation ( annotation ) ) != null ) { return true ; } } return false ; }
Source:
public java.lang.String getEncodedKey ( ) { final java.lang.String s = getSshPublicKey ( ) ; if ( ( s == null ) || ( ( s.length ( ) ) == 0 ) ) { return null ; } final java.lang.String [ ] parts = s.split ( " " ) ; if ( ( parts.length ) < 2 ) { return null ; } return parts [ 1 ] ; }

Target:
public java.lang.String getEncodedKey ( ) { return getPublicKeyPart ( 1 , null ) ; }
Source:
public void registerKeys ( ) { super . registerKeys ( ) ; cm.addKeyMap ( net.codemirror.lib.KeyMap.create ( ) . on ( "Ctrl-L" , gotoLine ( ) ) . on ( "Cmd-L" , gotoLine ( ) ) ) ; }

Target:
public void registerKeys ( ) { super . registerKeys ( ) ; cm.addKeyMap ( net.codemirror.lib.KeyMap.create ( ) . on ( "Ctrl-L" , gotoLine ( ) ) . on ( "Cmd-L" , gotoLine ( ) ) . on ( "Cmd-S" , save ( ) ) . on ( "Ctrl-S" , save ( ) ) ) ; }
Source:
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 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 ) ; }

Target:
public static com.google.common.base.Optional < java.lang.String > getChangeId ( org.eclipse.jgit.junit.TestRepository < ? > tr , org.eclipse.jgit.lib.ObjectId id ) throws java.io.IOException { org.eclipse.jgit.revwalk.RevCommit c = tr.getRevWalk ( ) . parseCommit ( id ) ; tr.getRevWalk ( ) . parseBody ( c ) ; java.util.List < java.lang.String > ids = c.getFooterLines ( FooterConstants.CHANGE_ID ) ; if ( ids.isEmpty ( ) ) { return com.google.common.base.Optional.absent ( ) ; } return com.google.common.base.Optional.of ( ids.get ( ( ( ids.size ( ) ) - 1 ) ) ) ; }
Source:
protected void configure ( ) { bind ( com.google.gerrit.server.account.AccountsCollection.class ) ; bind ( com.google.gerrit.server.account.Capabilities.class ) ; com.google.gerrit.extensions.registration.DynamicMap.mapOf ( binder ( ) , com.google.gerrit.server.account.AccountResource.ACCOUNT_KIND ) ; com.google.gerrit.extensions.registration.DynamicMap.mapOf ( binder ( ) , com.google.gerrit.server.account.AccountResource.CAPABILITY_KIND ) ; child ( com.google.gerrit.server.account.AccountResource.ACCOUNT_KIND , "capabilities" ) . to ( com.google.gerrit.server.account.Capabilities.class ) ; get ( com.google.gerrit.server.account.AccountResource.CAPABILITY_KIND ) . to ( GetCapabilities.CheckOne.class ) ; }

Target:
protected void configure ( ) { bind ( com.google.gerrit.server.account.AccountsCollection.class ) ; bind ( com.google.gerrit.server.account.Capabilities.class ) ; com.google.gerrit.extensions.registration.DynamicMap.mapOf ( binder ( ) , com.google.gerrit.server.account.AccountResource.ACCOUNT_KIND ) ; com.google.gerrit.extensions.registration.DynamicMap.mapOf ( binder ( ) , com.google.gerrit.server.account.AccountResource.CAPABILITY_KIND ) ; get ( com.google.gerrit.server.account.AccountResource.ACCOUNT_KIND , "avatar" ) . to ( com.google.gerrit.server.account.GetAvatar.class ) ; child ( com.google.gerrit.server.account.AccountResource.ACCOUNT_KIND , "capabilities" ) . to ( com.google.gerrit.server.account.Capabilities.class ) ; get ( com.google.gerrit.server.account.AccountResource.ACCOUNT_KIND , "groups" ) . to ( com.google.gerrit.server.account.GetGroups.class ) ; get ( com.google.gerrit.server.account.AccountResource.CAPABILITY_KIND ) . to ( GetCapabilities.CheckOne.class ) ; }
Source:
public com.google.gerrit.server.notedb.ChangeNotes createFromIdOnlyWhenNoteDbDisabled ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Change.Id changeId ) throws com.google.gwtorm.server.OrmException { com.google.common.base.Preconditions.checkState ( ( ! ( args.migration.readChanges ( ) ) ) , ( "do not call" + " createFromIdOnlyWhenNoteDbDisabled when NoteDb is enabled" ) ) ; com.google.gerrit.reviewdb.client.Change change = com.google.gerrit.server.notedb.ChangeNotes.Factory.unwrap ( db ) . changes ( ) . get ( changeId ) ; return new com.google.gerrit.server.notedb.ChangeNotes ( args , change.getProject ( ) , change ) . load ( ) ; }

Target:
public com.google.gerrit.server.notedb.ChangeNotes createFromIdOnlyWhenNoteDbDisabled ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Change.Id changeId ) throws com.google.gwtorm.server.OrmException { com.google.common.base.Preconditions.checkState ( ( ! ( args.migration.readChanges ( ) ) ) , ( "do not call" + " createFromIdOnlyWhenNoteDbDisabled when NoteDb is enabled" ) ) ; com.google.gerrit.reviewdb.client.Change change = com.google.gerrit.server.notedb.ChangeNotes.Factory.unwrap ( db ) . changes ( ) . get ( changeId ) ; com.google.common.base.Preconditions.checkArgument ( ( change != null ) , "change %s not found in ReviewDb" , changeId ) ; return new com.google.gerrit.server.notedb.ChangeNotes ( args , change.getProject ( ) , change ) . load ( ) ; }
Source:
public void namedAnchor ( ) throws java.lang.Exception { java.lang.String markdown = "# Section {#debug}\n" + "# Other <a name=\"old-school\"></a>\n" ; repo.branch ( "master" ) . commit ( ) . add ( "index.md" , markdown ) . create ( ) ; java.lang.String html = buildHtml ( "/repo/+doc/master/" ) ; com.google.common.truth.Truth.assertThat ( html ) . contains ( ( "<h1>" + ( "<a class=\"h\" name=\"debug\" href=\"#debug\"><span></span></a>" + "Section</h1>" ) ) ) ; com.google.common.truth.Truth.assertThat ( html ) . contains ( ( "<h1>" + ( "<a class=\"h\" name=\"old-school\" href=\"#old-school\"><span></span></a>" + "Other</h1>" ) ) ) ; }

Target:
public void namedAnchor ( ) throws java.lang.Exception { java.lang.String markdown = "# Section {#debug}\n" + "# Other <a name=\"OLD-SCHOOL\"></a>\n" ; repo.branch ( "master" ) . commit ( ) . add ( "index.md" , markdown ) . create ( ) ; java.lang.String html = buildHtml ( "/repo/+doc/master/" ) ; com.google.common.truth.Truth.assertThat ( html ) . contains ( ( "<h1>" + ( ( "<a class=\"h\" name=\"debug\" href=\"#debug\"><span></span></a>" + "<a class=\"h\" name=\"debug\" href=\"#debug\"><span></span></a>" ) + "Section</h1>" ) ) ) ; com.google.common.truth.Truth.assertThat ( html ) . contains ( ( "<h1>" + ( ( "<a class=\"h\" name=\"OLD-SCHOOL\" href=\"#OLD-SCHOOL\"><span></span></a>" + "<a class=\"h\" name=\"old-school\" href=\"#old-school\"><span></span></a>" ) + "Other</h1>" ) ) ) ; }
Source:
private java.nio.file.FileSystem getDistributionArchive ( ) throws java.io.IOException { java.io.File war ; try { war = com.google.gerrit.launcher.GerritLauncher.getDistributionArchive ( ) ; } catch ( java.io.IOException e ) { if ( ( e instanceof java.io.FileNotFoundException ) && ( GerritLauncher.NOT_ARCHIVED.equals ( e.getMessage ( ) ) ) ) { return null ; } else { com.google.inject.ProvisionException pe = new com.google.inject.ProvisionException ( "Error reading gerrit.war" ) ; pe.initCause ( e ) ; throw pe ; } } return com.google.gerrit.launcher.GerritLauncher.getZipFileSystem ( war.toPath ( ) ) ; }

Target:
private java.io.File getLauncherLoadedFrom ( ) { java.io.File war ; try { war = com.google.gerrit.launcher.GerritLauncher.getDistributionArchive ( ) ; } catch ( java.io.IOException e ) { if ( ( e instanceof java.io.FileNotFoundException ) && ( GerritLauncher.NOT_ARCHIVED.equals ( e.getMessage ( ) ) ) ) { return null ; } else { com.google.inject.ProvisionException pe = new com.google.inject.ProvisionException ( "Error reading gerrit.war" ) ; pe.initCause ( e ) ; throw pe ; } } return war ; }
Source:
public void onDoubleClick ( com.google.gwt.event.dom.client.DoubleClickEvent event ) { if ( patchTableHeader.listA.fileExists ) { onCellDoubleClick ( 0 , com.google.gerrit.client.patches.SideBySideTable.A ) ; } }

Target:
private void populateTableHeader ( final com.google.gerrit.common.data.PatchScript script , final com.google.gerrit.common.data.PatchSetDetail detail ) { initHeaders ( script , detail ) ; table.setWidget ( com.google.gerrit.client.patches.R_HEAD , com.google.gerrit.client.patches.SideBySideTable.A , headerSideA ) ; table.setWidget ( com.google.gerrit.client.patches.R_HEAD , com.google.gerrit.client.patches.SideBySideTable.B , headerSideB ) ; if ( headerSideA.isFile ( ) ) { table.setWidget ( com.google.gerrit.client.patches.R_HEAD , ( ( com.google.gerrit.client.patches.SideBySideTable.A ) - 1 ) , iconA ) ; } if ( headerSideB.isFile ( ) ) { table.setWidget ( com.google.gerrit.client.patches.R_HEAD , ( ( com.google.gerrit.client.patches.SideBySideTable.B ) + 1 ) , iconB ) ; } }
Source:
public void changeIsIndexed ( ) throws java.lang.Exception { setupPostMocks ( com.ericsson.gerrit.plugins.syncindex.SyncIndexRestApiServletTest.CHANGE_EXISTS ) ; verifyPost ( ) ; }

Target:
public void changeIsIndexed ( ) throws java.lang.Exception { setupPostMocks ( com.ericsson.gerrit.plugins.syncindex.SyncIndexRestApiServletTest.CHANGE_EXISTS ) ; syncIndexRestApiServlet.doPost ( req , rsp ) ; org.mockito.Mockito.verify ( indexer , org.mockito.Mockito.times ( 1 ) ) . index ( db , change ) ; org.mockito.Mockito.verify ( rsp ) . setStatus ( javax.servlet.http.HttpServletResponse.SC_NO_CONTENT ) ; }
Source:
void onEdit ( com.google.gwt.event.dom.client.ClickEvent event ) { edit.setEnabled ( false ) ; cancel1.setVisible ( true ) ; com.google.gwt.user.client.ui.UIObject.setVisible ( commitTools , true ) ; accessEditor.setEditing ( true ) ; driver.edit ( access ) ; }

Target:
void onEdit ( com.google.gwt.event.dom.client.ClickEvent event ) { resetEditors ( ) ; edit.setEnabled ( false ) ; cancel1.setVisible ( true ) ; com.google.gwt.user.client.ui.UIObject.setVisible ( commitTools , true ) ; commit.setVisible ( ( ! ( access.getOwnerOf ( ) . isEmpty ( ) ) ) ) ; review.setVisible ( access.canUpload ( ) ) ; accessEditor.setEditing ( true ) ; driver.edit ( access ) ; }
Source:
static com.google.gerrit.acceptance.GerritServer.Description forTestMethod ( com.google.gerrit.acceptance.Description testDesc , java.lang.String configName ) { return new com.google.gerrit.acceptance.AutoValue_GerritServer_Description ( configName , ( ( testDesc.getAnnotation ( com.google.gerrit.acceptance.UseLocalDisk.class ) ) == null ) , ( ( ( testDesc.getAnnotation ( com.google.gerrit.acceptance.NoHttpd.class ) ) == null ) && ( ( testDesc.getTestClass ( ) . getAnnotation ( com.google.gerrit.acceptance.NoHttpd.class ) ) == null ) ) , testDesc.getAnnotation ( com.google.gerrit.acceptance.GerritConfig.class ) , testDesc.getAnnotation ( com.google.gerrit.acceptance.GerritConfigs.class ) ) ; }

Target:
private static boolean hasNoHttpd ( java.lang.Class < ? > clazz ) { for ( ; clazz != null ; clazz = clazz.getSuperclass ( ) ) { if ( ( clazz.getAnnotation ( com.google.gerrit.acceptance.NoHttpd.class ) ) != null ) { return true ; } } return false ; }
Source:
public void appendTo ( java.lang.StringBuffer buffer ) { buffer.append ( "eqEvent(" ) ; buffer.append ( expected.getClass ( ) . getName ( ) ) ; buffer.append ( " with project \"" ) ; buffer.append ( expected.project ) ; buffer.append ( " and ref \"" ) ; buffer.append ( expected.ref ) ; buffer.append ( " and nodesCount \"" ) ; buffer.append ( expected.nodesCount ) ; buffer.append ( "\")" ) ; }

Target:
public void appendTo ( java.lang.StringBuffer buffer ) { buffer.append ( "eqEvent(" ) ; buffer.append ( expected.getClass ( ) . getName ( ) ) ; buffer.append ( " with project \"" ) ; buffer.append ( expected.project ) ; buffer.append ( "\" and ref \"" ) ; buffer.append ( expected.ref ) ; buffer.append ( "\" and nodesCount \"" ) ; buffer.append ( expected.nodesCount ) ; buffer.append ( "\")" ) ; }
Source:
void insertMember ( final com.google.gerrit.reviewdb.AccountGroupMember k ) { final int row = table.getRowCount ( ) ; table.insertRow ( row ) ; applyDataRowStyle ( row ) ; populate ( row , k ) ; }

Target:
void setEnabled ( final boolean enabled ) { this . enabled = enabled ; for ( int row = 1 ; row < ( table.getRowCount ( ) ) ; row ++ ) { final com.google.gerrit.reviewdb.AccountGroupMember k = getRowItem ( row ) ; if ( k != null ) { ( ( com.google.gwt.user.client.ui.CheckBox ) ( table.getWidget ( row , 1 ) ) ) . setEnabled ( enabled ) ; } } }
Source:
private void initPostReview ( com.google.reviewit.app.Change change , @ android.support.annotation.IdRes int id ) { com.google.reviewit.widget.PostReviewView postReview = ( ( com.google.reviewit.widget.PostReviewView ) ( v ( id ) ) ) ; postReview.setChange ( change ) ; postReview.select ( change.getVote ( "Code-Review" , getApp ( ) . getSelf ( ) ) ) ; postReview.setOnVoteListener ( new com.google.reviewit.widget.PostReviewView.OnVoteListener ( ) { @ java.lang.Override public void vote ( int vote ) { display ( com.google.reviewit.PostReviewFragment.create ( vote ) ) ; } } ) ; }

Target:
private void initPostReview ( com.google.reviewit.app.Change change , @ android.support.annotation.IdRes int id ) { com.google.reviewit.widget.SelectCodeReviewView postReview = ( ( com.google.reviewit.widget.SelectCodeReviewView ) ( v ( id ) ) ) ; postReview.setChange ( change ) ; postReview.select ( change.getVote ( "Code-Review" , getApp ( ) . getSelf ( ) ) ) ; postReview.setOnVoteListener ( new com.google.reviewit.widget.SelectCodeReviewView.OnVoteListener ( ) { @ java.lang.Override public void vote ( int vote ) { display ( com.google.reviewit.PostReviewFragment.create ( vote ) ) ; } } ) ; }
Source:
private org.apache.http.impl.client.BasicCredentialsProvider buildCredentials ( ) { java.net.URI uri = java.net.URI.create ( cfg.getUrl ( ) ) ; org.apache.http.impl.client.BasicCredentialsProvider creds = new org.apache.http.impl.client.BasicCredentialsProvider ( ) ; creds.setCredentials ( new org.apache.http.auth.AuthScope ( uri.getHost ( ) , uri.getPort ( ) ) , new org.apache.http.auth.UsernamePasswordCredentials ( cfg.getUser ( ) , cfg.getPassword ( ) ) ) ; return creds ; }

Target:
private org.apache.http.impl.client.BasicCredentialsProvider buildCredentials ( ) { org.apache.http.impl.client.BasicCredentialsProvider creds = new org.apache.http.impl.client.BasicCredentialsProvider ( ) ; creds.setCredentials ( AuthScope.ANY , new org.apache.http.auth.UsernamePasswordCredentials ( cfg.getUser ( ) , cfg.getPassword ( ) ) ) ; return creds ; }
Source:
public com.google.gerrit.server.notedb.ChangeNotes create ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Project.NameKey project , com.google.gerrit.reviewdb.client.Change.Id changeId ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.Change change = com.google.gerrit.reviewdb.server.ReviewDbUtil.unwrapDb ( db ) . changes ( ) . get ( changeId ) ; com.google.common.base.Preconditions.checkNotNull ( change , "change %s not found in ReviewDb" , changeId ) ; com.google.common.base.Preconditions.checkArgument ( change.getProject ( ) . equals ( project ) , ( "passed project %s when creating ChangeNotes for %s, but actual" + " project is %s" ) , project , changeId , change.getProject ( ) ) ; return new com.google.gerrit.server.notedb.ChangeNotes ( args , change ) . load ( ) ; }

Target:
public com.google.gerrit.server.notedb.ChangeNotes create ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Project.NameKey project , com.google.gerrit.reviewdb.client.Change.Id changeId ) throws com.google.gwtorm.server.OrmException { return new com.google.gerrit.server.notedb.ChangeNotes ( args , loadChangeFromDb ( db , project , changeId ) ) . load ( ) ; }
Source:
public void testIsEnabledEventDisabled ( ) { java.lang.String [ ] branches = new java.lang.String [ ] { "^refs/heads/foo.*" } ; setupIsEnabled ( "true" , null , branches ) ; com.google.gerrit.server.events.PatchSetCreatedEvent event = new com.google.gerrit.server.events.PatchSetCreatedEvent ( ) ; event.change = new com.google.gerrit.server.data.ChangeAttribute ( ) ; event.change.project = "testProject" ; event.change.branch = "testBranch" ; com.googlesource.gerrit.plugins.hooks.its.ItsConfig itsConfig = createItsConfig ( ) ; replayMocks ( ) ; assertFalse ( itsConfig.isEnabled ( event ) ) ; }

Target:
public void testIsEnabledEventMultiBranchExact ( ) { java.lang.String [ ] branches = new java.lang.String [ ] { "refs/heads/foo" , "refs/heads/testBranch" } ; setupIsEnabled ( "true" , null , branches ) ; com.google.gerrit.server.events.PatchSetCreatedEvent event = new com.google.gerrit.server.events.PatchSetCreatedEvent ( ) ; event.change = new com.google.gerrit.server.data.ChangeAttribute ( ) ; event.change.project = "testProject" ; event.change.branch = "testBranch" ; com.googlesource.gerrit.plugins.hooks.its.ItsConfig itsConfig = createItsConfig ( ) ; replayMocks ( ) ; assertTrue ( itsConfig.isEnabled ( event ) ) ; }
Source:
private java.util.Set < java.lang.String > getRefNamesAllUsers ( java.lang.String prefix ) throws com.google.gwtorm.server.OrmException { try ( org.eclipse.jgit.lib.Repository repo = repoManager.openMetadataRepository ( allUsers ) ) { org.eclipse.jgit.lib.RefDatabase refDb = repo.getRefDatabase ( ) ; return refDb.getRefs ( prefix ) . keySet ( ) ; } catch ( java.io.IOException e ) { throw new com.google.gwtorm.server.OrmException ( e ) ; } }

Target:
public java.util.Collection < org.eclipse.jgit.lib.Ref > getDraftRefs ( com.google.gerrit.reviewdb.client.Change.Id changeId ) throws com.google.gwtorm.server.OrmException { try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( allUsers ) ) { return getDraftRefs ( repo , changeId ) ; } catch ( java.io.IOException e ) { throw new com.google.gwtorm.server.OrmException ( e ) ; } }