auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static com.google.gitiles.BaseServlet notFoundServlet ( ) { return new com.google.gitiles.BaseServlet ( new org.eclipse.jgit.lib.Config ( ) , null ) { private static final long serialVersionUID = 1L ; @ java.lang.Override public void service ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse res ) { res.setStatus ( javax.servlet.http.HttpServletResponse.SC_NOT_FOUND ) ; } } ; }

Target:
public static com.google.gitiles.BaseServlet notFoundServlet ( ) { return new com.google.gitiles.BaseServlet ( null ) { private static final long serialVersionUID = 1L ; @ java.lang.Override public void service ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse res ) { res.setStatus ( javax.servlet.http.HttpServletResponse.SC_NOT_FOUND ) ; } } ; }
Source:
public com.google.gerrit.server.events.PatchSetAttribute asPatchSetAttribute ( final com.google.gerrit.reviewdb.PatchSet patchSet ) { com.google.gerrit.server.events.PatchSetAttribute p = new com.google.gerrit.server.events.PatchSetAttribute ( ) ; p.revision = patchSet.getRevision ( ) . get ( ) ; p.number = java.lang.Integer.toString ( patchSet.getPatchSetId ( ) ) ; p.ref = patchSet.getRefName ( ) ; final com.google.gerrit.server.account.AccountState uploader = accountCache.get ( patchSet.getUploader ( ) ) ; p.uploader = asAccountAttribute ( uploader.getAccount ( ) ) ; return p ; }

Target:
public com.google.gerrit.server.events.PatchSetAttribute asPatchSetAttribute ( final com.google.gerrit.reviewdb.PatchSet patchSet ) { com.google.gerrit.server.events.PatchSetAttribute p = new com.google.gerrit.server.events.PatchSetAttribute ( ) ; p.revision = patchSet.getRevision ( ) . get ( ) ; p.number = java.lang.Integer.toString ( patchSet.getPatchSetId ( ) ) ; p.ref = patchSet.getRefName ( ) ; p.uploader = asAccountAttribute ( patchSet.getUploader ( ) ) ; return p ; }
Source:
public void testAppend_int ( ) { final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder b = new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) ; assertSame ( b , b.append ( 4 ) ) ; assertSame ( b , b.append ( 2 ) ) ; assertSame ( b , b.append ( ( - 100 ) ) ) ; assertEquals ( "42-100" , b.asString ( ) ) ; }

Target:
public void testAppend_int ( ) { final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder b = new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) ; org.junit.Assert.assertSame ( b , b.append ( 4 ) ) ; org.junit.Assert.assertSame ( b , b.append ( 2 ) ) ; org.junit.Assert.assertSame ( b , b.append ( ( - 100 ) ) ) ; org.junit.Assert.assertEquals ( "42-100" , b.asString ( ) ) ; }
Source:
public java.lang.String getStatusDescription ( ) { if ( ( exception ) != null ) { return getErrorDescription ( exception ) ; } switch ( status.getStatus ( ) ) { case COMPLETE : return "Cloned (100%)" ; case CANCELLED : return "Cancelled" ; default : return ( ( ( ( ( "Phase-" + ( currTask ) ) + " / " ) + ( task ) ) + " (" ) + ( lastPercentage ) ) + "%)" ; } }

Target:
public java.lang.String getStatusDescription ( ) { if ( ( exception ) != null ) { return getErrorDescription ( exception ) ; } else { switch ( status.getStatus ( ) ) { case COMPLETE : return "Cloned (100%)" ; case CANCELLED : return "Cancelled" ; default : return ( ( ( ( ( "Phase-" + ( currTask ) ) + " / " ) + ( task ) ) + " (" ) + ( lastPercentage ) ) + "%)" ; } } }
Source:
private org.eclipse.jgit.lib.ObjectId getEditRev ( ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.server.project.NoSuchChangeException , java.io.IOException { com.google.common.base.Optional < com.google.gerrit.server.edit.ChangeEdit > edit = editReader.byChange ( change ) ; if ( edit.isPresent ( ) ) { return edit.get ( ) . getRef ( ) . getObjectId ( ) ; } throw new com.google.gerrit.server.project.NoSuchChangeException ( change.getId ( ) ) ; }

Target:
private org.eclipse.jgit.lib.ObjectId getEditRev ( ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.server.project.NoSuchChangeException , java.io.IOException { edit = editReader.byChange ( change ) ; if ( edit.isPresent ( ) ) { return edit.get ( ) . getRef ( ) . getObjectId ( ) ; } throw new com.google.gerrit.server.project.NoSuchChangeException ( change.getId ( ) ) ; }
Source:
public boolean equals ( final java.lang.Object obj ) { if ( ( ! ( super . equals ( obj ) ) ) || ( ! ( obj instanceof com.google.gerrit.common.data.AccessSection ) ) ) { return false ; } return new java.util.HashSet < com.google.gerrit.common.data.Permission > ( getPermissions ( ) ) . equals ( new java.util.HashSet < com.google.gerrit.common.data.Permission > ( ( ( com.google.gerrit.common.data.AccessSection ) ( obj ) ) . getPermissions ( ) ) ) ; }

Target:
public boolean equals ( final java.lang.Object obj ) { if ( ( ! ( super . equals ( obj ) ) ) || ( ! ( obj instanceof com.google.gerrit.common.data.AccessSection ) ) ) { return false ; } return new java.util.HashSet < com.google.gerrit.common.data.Permission > ( getPermissions ( ) ) . equals ( new java.util.HashSet ( ( ( com.google.gerrit.common.data.AccessSection ) ( obj ) ) . getPermissions ( ) ) ) ; }
Source:
public void skipWhenUserBelongsToGroupName ( ) throws java.lang.Exception { java.lang.String config = "[plugin \"uploadvalidator\"]\n" + ( "skipValidation=testOp\n" + "skipGroup=testGroupName\n" ) ; com.googlesource.gerrit.plugins.uploadvalidator.ValidatorConfig validatorConfig = new com.googlesource.gerrit.plugins.uploadvalidator.ValidatorConfig ( new com.googlesource.gerrit.plugins.uploadvalidator.FakeConfigFactory ( projectName , config ) , new com.googlesource.gerrit.plugins.uploadvalidator.FakeUserProvider ( "testGroupId" ) , new com.googlesource.gerrit.plugins.uploadvalidator.FakeGroupCacheUUIDByName ( new com.google.gerrit.reviewdb.client.AccountGroup ( new com.google.gerrit.reviewdb.client.AccountGroup.NameKey ( "testGroupName" ) , new com.google.gerrit.reviewdb.client.AccountGroup.Id ( 1 ) , new com.google.gerrit.reviewdb.client.AccountGroup.UUID ( "testGroupId" ) ) ) ) ; com.google.common.truth.Truth.assertThat ( validatorConfig.isEnabledForRef ( projectName , "anyRef" , "testOp" ) ) . isFalse ( ) ; }

Target:
public void skipWhenUserBelongsToGroupName ( ) throws java.lang.Exception { java.lang.String config = "[plugin \"uploadvalidator\"]\n" + ( "skipValidation=testOp\n" + "skipGroup=testGroupName\n" ) ; com.googlesource.gerrit.plugins.uploadvalidator.ValidatorConfig validatorConfig = new com.googlesource.gerrit.plugins.uploadvalidator.ValidatorConfig ( new com.googlesource.gerrit.plugins.uploadvalidator.FakeConfigFactory ( projectName , config ) , new com.googlesource.gerrit.plugins.uploadvalidator.FakeGroupCacheUUIDByName ( new com.google.gerrit.reviewdb.client.AccountGroup ( new com.google.gerrit.reviewdb.client.AccountGroup.NameKey ( "testGroupName" ) , new com.google.gerrit.reviewdb.client.AccountGroup.Id ( 1 ) , new com.google.gerrit.reviewdb.client.AccountGroup.UUID ( "testGroupId" ) ) ) ) ; com.google.common.truth.Truth.assertThat ( validatorConfig.isEnabledForRef ( new com.googlesource.gerrit.plugins.uploadvalidator.FakeUserProvider ( "testGroupId" ) . get ( ) , projectName , "anyRef" , "testOp" ) ) . isFalse ( ) ; }
Source:
public void testNoEscaping ( ) { java.lang.String find = "find" ; java.lang.String link = "link" ; com.google.gwtexpui.safehtml.client.LinkFindReplace a = new com.google.gwtexpui.safehtml.client.LinkFindReplace ( find , link ) ; assertEquals ( find , a.pattern ( ) . getSource ( ) ) ; assertEquals ( "<a href=\"link\">find</a>" , a.replace ( find ) ) ; assertEquals ( ( ( ( "find = " + find ) + ", link = " ) + link ) , a.toString ( ) ) ; }

Target:
public void testNoEscaping ( ) { java.lang.String find = "find" ; java.lang.String link = "link" ; com.google.gwtexpui.safehtml.client.LinkFindReplace a = new com.google.gwtexpui.safehtml.client.LinkFindReplace ( find , link ) ; org.junit.Assert.assertEquals ( find , a.pattern ( ) . getSource ( ) ) ; org.junit.Assert.assertEquals ( "<a href=\"link\">find</a>" , a.replace ( find ) ) ; org.junit.Assert.assertEquals ( ( ( ( "find = " + find ) + ", link = " ) + link ) , a.toString ( ) ) ; }
Source:
private void init ( final com.google.reviewit.app.Change change ) { android.support.v4.widget.SwipeRefreshLayout swipeRefreshLayout = ( ( android.support.v4.widget.SwipeRefreshLayout ) ( v ( R.id.swipeRefreshLayout ) ) ) ; swipeRefreshLayout.setColorSchemeColors ( R.color.progressBar ) ; swipeRefreshLayout.setRefreshing ( true ) ; swipeRefreshLayout.setOnRefreshListener ( new android.support.v4.widget.SwipeRefreshLayout.OnRefreshListener ( ) { @ java.lang.Override public void onRefresh ( ) { refresh ( change ) ; } } ) ; tv ( R.id.commitMessage ) . setLinksClickable ( true ) ; }

Target:
private void init ( final com.google.reviewit.app.Change change ) { android.support.v4.widget.SwipeRefreshLayout swipeRefreshLayout = ( ( android.support.v4.widget.SwipeRefreshLayout ) ( v ( R.id.swipeRefreshLayout ) ) ) ; swipeRefreshLayout.setColorSchemeColors ( R.color.progressBar ) ; swipeRefreshLayout.setRefreshing ( true ) ; swipeRefreshLayout.setOnRefreshListener ( new android.support.v4.widget.SwipeRefreshLayout.OnRefreshListener ( ) { @ java.lang.Override public void onRefresh ( ) { refresh ( change ) ; } } ) ; }
Source:
void onSave ( @ java.lang.SuppressWarnings ( value = "unused" ) com.google.gwt.event.dom.client.ClickEvent e ) { com.google.gerrit.client.account.AccountApi.putEditPreferences ( prefs , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.account.EditPreferences > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.account.EditPreferences p ) { com.google.gerrit.client.Gerrit.setEditPreferences ( p.copyTo ( new com.google.gerrit.extensions.client.EditPreferencesInfo ( ) ) ) ; } } ) ; close ( ) ; }

Target:
void onSave ( @ java.lang.SuppressWarnings ( value = "unused" ) com.google.gwt.event.dom.client.ClickEvent e ) { com.google.gerrit.client.account.AccountApi.putEditPreferences ( prefs , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.account.EditPreferences > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.account.EditPreferences p ) { com.google.gerrit.client.Gerrit.setEditPreferences ( p.copyTo ( new com.google.gerrit.extensions.client.EditPreferencesInfo ( ) ) ) ; } } ) ; if ( ( view ) != null ) { close ( ) ; } }
Source:
public java.util.List < com.google.gerrit.extensions.common.SshKeyInfo > apply ( com.google.gerrit.server.IdentifiedUser user ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException , org.eclipse.jgit.errors.RepositoryNotFoundException { return com.google.common.collect.Lists.transform ( authorizedKeys.getKeys ( user.getAccountId ( ) ) , new com.google.common.base.Function < com.google.gerrit.reviewdb.client.AccountSshKey , com.google.gerrit.extensions.common.SshKeyInfo > ( ) { @ java.lang.Override public com.google.gerrit.extensions.common.SshKeyInfo apply ( com.google.gerrit.reviewdb.client.AccountSshKey key ) { return com.google.gerrit.server.account.GetSshKeys.newSshKeyInfo ( key ) ; } } ) ; }

Target:
public java.util.List < com.google.gerrit.extensions.common.SshKeyInfo > apply ( com.google.gerrit.server.IdentifiedUser user ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException , org.eclipse.jgit.errors.RepositoryNotFoundException { return com.google.common.collect.Lists.transform ( authorizedKeys.getKeys ( user.getAccountId ( ) ) , com.google.gerrit.server.account.GetSshKeys :: newSshKeyInfo ) ; }
Source:
private static boolean needsSuperSerializer ( com.google.gwt.core.ext.typeinfo.JClassType type ) { type = type.getSuperclass ( ) ; while ( ! ( java.lang.Object.class . getName ( ) . equals ( type.getQualifiedSourceName ( ) ) ) ) { if ( ( com.google.gwtjsonrpc.rebind.SerializerCreator.sortFields ( type ) . length ) > 0 ) { return true ; } type = type.getSuperclass ( ) ; } return false ; }

Target:
private static boolean needsSuperSerializer ( com.google.gwt.core.ext.typeinfo.JClassType type ) { com.google.gwt.core.ext.typeinfo.JClassType t = type.getSuperclass ( ) ; while ( ! ( java.lang.Object.class . getName ( ) . equals ( t.getQualifiedSourceName ( ) ) ) ) { if ( ( com.google.gwtjsonrpc.rebind.SerializerCreator.sortFields ( t ) . length ) > 0 ) { return true ; } t = type.getSuperclass ( ) ; } return false ; }
Source:
public void testEmpty1 ( ) { final java.lang.String name = "empty-file" ; final com.google.gerrit.server.patch.PatchListEntry e = com.google.gerrit.server.patch.PatchListEntry.empty ( name ) ; assertNull ( e.getOldName ( ) ) ; assertEquals ( name , e.getNewName ( ) ) ; assertSame ( Patch.PatchType.UNIFIED , e.getPatchType ( ) ) ; assertSame ( Patch.ChangeType.MODIFIED , e.getChangeType ( ) ) ; assertTrue ( e.getEdits ( ) . isEmpty ( ) ) ; }

Target:
public void testEmpty1 ( ) { final java.lang.String name = "empty-file" ; final com.google.gerrit.server.patch.PatchListEntry e = com.google.gerrit.server.patch.PatchListEntry.empty ( name ) ; org.junit.Assert.assertNull ( e.getOldName ( ) ) ; org.junit.Assert.assertEquals ( name , e.getNewName ( ) ) ; org.junit.Assert.assertSame ( Patch.PatchType.UNIFIED , e.getPatchType ( ) ) ; org.junit.Assert.assertSame ( Patch.ChangeType.MODIFIED , e.getChangeType ( ) ) ; org.junit.Assert.assertTrue ( e.getEdits ( ) . isEmpty ( ) ) ; }
Source:
protected void setUp ( ) throws java.lang.Exception { repo = new org.eclipse.jgit.junit.TestRepository < org.eclipse.jgit.internal.storage.dfs.DfsRepository > ( new org.eclipse.jgit.internal.storage.dfs.InMemoryRepository ( new org.eclipse.jgit.internal.storage.dfs.DfsRepositoryDescription ( "test" ) ) ) ; parser = new com.google.gitiles.RevisionParser ( repo.getRepository ( ) , new com.google.gitiles.TestGitilesAccess ( repo.getRepository ( ) ) . forRequest ( null ) , new com.google.gitiles.VisibilityCache ( false , com.google.common.cache.CacheBuilder.newBuilder ( ) . maximumSize ( 0 ) ) ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { repo = new org.eclipse.jgit.junit.TestRepository < org.eclipse.jgit.internal.storage.dfs.DfsRepository > ( new org.eclipse.jgit.internal.storage.dfs.InMemoryRepository ( new org.eclipse.jgit.internal.storage.dfs.DfsRepositoryDescription ( "test" ) ) ) ; parser = new com.google.gitiles.RevisionParser ( repo.getRepository ( ) , new com.google.gitiles.TestGitilesAccess ( repo.getRepository ( ) ) . forRequest ( null ) , new com.google.gitiles.VisibilityCache ( false , com.google.common.cache.CacheBuilder.newBuilder ( ) . maximumSize ( 0 ) ) ) ; }
Source:
public int weigh ( com.google.gerrit.server.patch.PatchListKey key , com.google.gerrit.server.patch.PatchList value ) { int size = ( ( ( ( ( 16 + ( 4 * 8 ) ) + ( 2 * 36 ) ) + 16 ) + ( 3 * 8 ) ) + ( 3 * 4 ) ) + 20 ; for ( com.google.gerrit.server.patch.PatchListEntry e : value.getPatches ( ) ) { size += e.weigh ( ) ; } return size ; }

Target:
public int weigh ( com.google.gerrit.server.patch.PatchListKey key , com.google.gerrit.server.patch.PatchList value ) { int size = ( ( ( ( ( ( 16 + ( 4 * 8 ) ) + ( 2 * 36 ) ) + 8 ) + 16 ) + ( 3 * 8 ) ) + ( 3 * 4 ) ) + 20 ; for ( com.google.gerrit.server.patch.PatchListEntry e : value.getPatches ( ) ) { size += e.weigh ( ) ; } return size ; }
Source:
private < T > boolean callHander ( com.googlesource.gerrit.plugins.github.notification.WebhookEventHandler < T > handler , java.lang.String jsonBody ) throws java.io.IOException { T payload = gson.fromJson ( jsonBody , handler.getPayloadType ( ) ) ; if ( payload != null ) { return handler.doAction ( payload ) ; } else { com.googlesource.gerrit.plugins.github.notification.WebhookServlet.logger.error ( ( ( ( "Cannot decode JSON payload '" + jsonBody ) + "' into " ) + ( handler.getPayloadType ( ) . getName ( ) ) ) ) ; return false ; } }

Target:
private < T > boolean callHander ( com.googlesource.gerrit.plugins.github.notification.WebhookEventHandler < T > handler , java.lang.String jsonBody ) throws java.io.IOException { T payload = gson.fromJson ( jsonBody , handler.getPayloadType ( ) ) ; if ( payload != null ) { return handler.doAction ( payload ) ; } com.googlesource.gerrit.plugins.github.notification.WebhookServlet.logger.error ( ( ( ( "Cannot decode JSON payload '" + jsonBody ) + "' into " ) + ( handler.getPayloadType ( ) . getName ( ) ) ) ) ; return false ; }
Source:
private void setDefaultBlameCache ( ) { if ( ( blameCache ) == null ) { if ( config.getSubsections ( "cache" ) . contains ( "blame" ) ) { blameCache = new com.google.gitiles.blame.BlameCacheImpl ( com.google.gitiles.ConfigUtil.getCacheBuilder ( com.google.gitiles.blame.BlameCacheImpl.newBuilder ( ) , config , "blame" ) ) ; } else { blameCache = new com.google.gitiles.blame.BlameCacheImpl ( ) ; } } }

Target:
private void setDefaultBlameCache ( ) { if ( ( blameCache ) == null ) { if ( config.getSubsections ( "cache" ) . contains ( "blame" ) ) { blameCache = new com.google.gitiles.blame.BlameCacheImpl ( com.google.gitiles.ConfigUtil.getCacheBuilder ( config , "blame" ) ) ; } else { blameCache = new com.google.gitiles.blame.BlameCacheImpl ( ) ; } } }
Source:
protected void onShowView ( com.google.gerrit.client.ui.Screen view ) { com.google.gerrit.client.Gerrit.lastViewToken = com.google.gwt.user.client.History.getToken ( ) ; java.lang.String token = view.getToken ( ) ; if ( ! ( token.equals ( com.google.gerrit.client.Gerrit.lastViewToken ) ) ) { com.google.gwt.user.client.History.newItem ( token , false ) ; com.google.gerrit.client.Gerrit.dispatchHistoryHooks ( token ) ; } if ( view instanceof com.google.gerrit.client.changes.ChangeListScreen ) { com.google.gerrit.client.Gerrit.lastChangeListToken = token ; } super . onShowView ( view ) ; view.onShowView ( ) ; }

Target:
protected void onShowView ( com.google.gerrit.client.ui.Screen view ) { java.lang.String token = view.getToken ( ) ; com.google.gwt.user.client.History.newItem ( token , false ) ; com.google.gerrit.client.Gerrit.dispatchHistoryHooks ( token ) ; if ( view instanceof com.google.gerrit.client.changes.ChangeListScreen ) { com.google.gerrit.client.Gerrit.lastChangeListToken = token ; } super . onShowView ( view ) ; view.onShowView ( ) ; com.google.gerrit.client.Gerrit.lastViewToken = token ; }
Source:
private void computeAllowed ( ) { final java.util.Set < com.google.gerrit.client.reviewdb.AccountGroup.Id > am = user.getEffectiveGroups ( ) ; final com.google.gerrit.server.project.ProjectState pe = projectCache.get ( change.getDest ( ) . getParentKey ( ) ) ; computeAllowed ( am , pe.getRights ( ) ) ; computeAllowed ( am , projectCache.getWildcardRights ( ) ) ; }

Target:
private void computeAllowed ( ) { final java.util.Set < com.google.gerrit.client.reviewdb.AccountGroup.Id > am = user.getEffectiveGroups ( ) ; final com.google.gerrit.server.project.ProjectState pe = projectCache.get ( change.getProject ( ) ) ; computeAllowed ( am , pe.getRights ( ) ) ; computeAllowed ( am , projectCache.getWildcardRights ( ) ) ; }
Source:
protected void selectProtocol ( com.google.gerrit.acceptance.git.AbstractPushForReview.Protocol p ) throws java.lang.Exception { java.lang.String url ; switch ( p ) { case SSH : url = sshUrl ; break ; case HTTP : url = admin.getHttpUrl ( server ) ; break ; default : throw new java.lang.IllegalArgumentException ( ( "unexpected protocol: " + p ) ) ; } setRepo ( com.google.gerrit.acceptance.GitUtil.cloneProject ( ( ( url + "/" ) + ( project.get ( ) ) ) ) ) ; }

Target:
protected void selectProtocol ( com.google.gerrit.acceptance.git.AbstractPushForReview.Protocol p ) throws java.lang.Exception { java.lang.String url ; switch ( p ) { case SSH : url = sshUrl ; break ; case HTTP : url = admin.getHttpUrl ( server ) ; break ; default : throw new java.lang.IllegalArgumentException ( ( "unexpected protocol: " + p ) ) ; } setRepo ( com.google.gerrit.acceptance.GitUtil.cloneProject ( project , ( ( url + "/" ) + ( project.get ( ) ) ) ) ) ; }
Source:
public static void submit ( int id , java.lang.String commit , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.changes.SubmitInfo > cb ) { com.google.gwt.core.client.JavaScriptObject in = com.google.gwt.core.client.JavaScriptObject.createObject ( ) ; com.google.gerrit.client.changes.ChangeApi.call ( id , commit , "submit" ) . post ( in , cb ) ; }

Target:
public static void submit ( @ com.google.gerrit.common.Nullable java.lang.String project , int id , java.lang.String commit , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.changes.SubmitInfo > cb ) { com.google.gwt.core.client.JavaScriptObject in = com.google.gwt.core.client.JavaScriptObject.createObject ( ) ; com.google.gerrit.client.changes.ChangeApi.call ( project , id , commit , "submit" ) . post ( in , cb ) ; }
Source:
private void writeToBatch ( com.google.gerrit.server.git.VersionedMetaData.BatchMetaDataUpdate batch , com.google.gerrit.server.notedb.AbstractChangeUpdate update , org.eclipse.jgit.lib.Repository repo ) throws com.google.gwtorm.server.OrmException , java.io.IOException { org.eclipse.jgit.lib.ObjectInserter inserter = repo.newObjectInserter ( ) ; try { update.setInserter ( inserter ) ; update.writeCommit ( batch ) ; } finally { inserter.release ( ) ; } }

Target:
private void writeToBatch ( com.google.gerrit.server.git.VersionedMetaData.BatchMetaDataUpdate batch , com.google.gerrit.server.notedb.AbstractChangeUpdate update , org.eclipse.jgit.lib.Repository repo ) throws com.google.gwtorm.server.OrmException , java.io.IOException { try ( org.eclipse.jgit.lib.ObjectInserter inserter = repo.newObjectInserter ( ) ) { update.setInserter ( inserter ) ; update.writeCommit ( batch ) ; } }
Source:
private void checkCanRunAs ( ) throws com.google.gerrit.sshd.UnloggedFailure { if ( ( caller.get ( ) ) instanceof com.google.gerrit.server.PeerDaemonUser ) { } else if ( ! ( enableRunAs ) ) { throw new com.google.gerrit.sshd.UnloggedFailure ( 1 , "fatal: suexec disabled by auth.enableRunAs = false" ) ; } else if ( ! ( caller.get ( ) . getCapabilities ( ) . canRunAs ( ) ) ) { throw new com.google.gerrit.sshd.UnloggedFailure ( 1 , "fatal: suexec not permitted" ) ; } }

Target:
private void checkCanRunAs ( ) throws com.google.gerrit.sshd.UnloggedFailure { if ( ( caller ) instanceof com.google.gerrit.server.PeerDaemonUser ) { } else if ( ! ( enableRunAs ) ) { throw new com.google.gerrit.sshd.UnloggedFailure ( 1 , "fatal: suexec disabled by auth.enableRunAs = false" ) ; } else if ( ! ( caller.getCapabilities ( ) . canRunAs ( ) ) ) { throw new com.google.gerrit.sshd.UnloggedFailure ( 1 , "fatal: suexec not permitted" ) ; } }
Source:
private void assertParseFails ( org.eclipse.jgit.revwalk.RevCommit commit ) throws java.lang.Exception { try ( com.google.gerrit.server.notedb.ChangeNotesParser parser = newParser ( commit ) ) { parser.parseAll ( ) ; org.junit.Assert.fail ( ( "Expected parse to fail:\n" + ( commit.getFullMessage ( ) ) ) ) ; } catch ( org.eclipse.jgit.errors.ConfigInvalidException e ) { } }

Target:
private void assertParseFails ( org.eclipse.jgit.revwalk.RevCommit commit ) throws java.lang.Exception { try { newParser ( commit ) . parseAll ( ) ; org.junit.Assert.fail ( ( "Expected parse to fail:\n" + ( commit.getFullMessage ( ) ) ) ) ; } catch ( org.eclipse.jgit.errors.ConfigInvalidException e ) { } }
Source:
void setShowLineNumbers ( boolean b ) { cmA.setOption ( "lineNumbers" , b ) ; cmB.setOption ( "lineNumbers" , b ) ; if ( b ) { diffTable.addStyleName ( SideBySideTable.style.showLineNumbers ( ) ) ; } else { diffTable.removeStyleName ( SideBySideTable.style.showLineNumbers ( ) ) ; } }

Target:
void setShowLineNumbers ( boolean b ) { super . setShowLineNumbers ( b ) ; cmA.setOption ( "lineNumbers" , b ) ; cmB.setOption ( "lineNumbers" , b ) ; }
Source:
private static java.util.Collection < java.security.PublicKey > computeHostKeys ( ) { final org.apache.sshd.common.KeyPairProvider p = com.google.gerrit.server.ssh.GerritSshDaemon.sshd.getKeyPairProvider ( ) ; final java.util.List < java.security.PublicKey > keys = new java.util.ArrayList < java.security.PublicKey > ( 2 ) ; com.google.gerrit.server.ssh.GerritSshDaemon.addPublicKey ( keys , p , KeyPairProvider.SSH_DSS ) ; com.google.gerrit.server.ssh.GerritSshDaemon.addPublicKey ( keys , p , KeyPairProvider.SSH_RSA ) ; return java.util.Collections.unmodifiableList ( keys ) ; }

Target:
private java.util.Collection < java.security.PublicKey > computeHostKeys ( ) { final org.apache.sshd.common.KeyPairProvider p = getKeyPairProvider ( ) ; final java.util.List < java.security.PublicKey > keys = new java.util.ArrayList < java.security.PublicKey > ( 2 ) ; com.google.gerrit.server.ssh.GerritSshDaemon.addPublicKey ( keys , p , KeyPairProvider.SSH_DSS ) ; com.google.gerrit.server.ssh.GerritSshDaemon.addPublicKey ( keys , p , KeyPairProvider.SSH_RSA ) ; return java.util.Collections.unmodifiableList ( keys ) ; }
Source:
public void onLoad ( ) { if ( ( projects ) == null ) { initUI ( ) ; } Util.PROJECT_SVC.ownedProjects ( new com.google.gerrit.client.rpc.ScreenLoadCallback < java.util.List < com.google.gerrit.client.reviewdb.Project > > ( this ) { @ java.lang.Override protected void preDisplay ( final java.util.List < com.google.gerrit.client.reviewdb.Project > result ) { projects.display ( result ) ; projects.finishDisplay ( true ) ; } } ) ; }

Target:
public void onLoad ( ) { super . onLoad ( ) ; Util.PROJECT_SVC.ownedProjects ( new com.google.gerrit.client.rpc.ScreenLoadCallback < java.util.List < com.google.gerrit.client.reviewdb.Project > > ( this ) { @ java.lang.Override protected void preDisplay ( final java.util.List < com.google.gerrit.client.reviewdb.Project > result ) { projects.display ( result ) ; projects.finishDisplay ( true ) ; } } ) ; }
Source:
public static com.google.gerrit.client.rpc.RestApi change ( int id ) { return new com.google.gerrit.client.rpc.RestApi ( "/changes/" ) . id ( java.lang.String.valueOf ( id ) ) ; }

Target:
public static com.google.gerrit.client.rpc.RestApi change ( @ com.google.gerrit.common.Nullable java.lang.String project , int id ) { if ( project == null ) { return new com.google.gerrit.client.rpc.RestApi ( "/changes/" ) . id ( java.lang.String.valueOf ( id ) ) ; } else { return new com.google.gerrit.client.rpc.RestApi ( "/changes/" ) . id ( project , id ) ; } }
Source:
public java.lang.String string ( final java.lang.String title , final java.lang.String name , final java.lang.String dv , final boolean nullIfDefault ) { final java.lang.String ov = get ( name ) ; java.lang.String nv = ui.readString ( ( ov != null ? ov : dv ) , "%s" , title ) ; if ( nullIfDefault && ( nv == dv ) ) { nv = null ; } if ( ! ( com.google.gerrit.pgm.init.Section.eq ( ov , nv ) ) ) { set ( name , nv ) ; } return nv ; }

Target:
public java.lang.String string ( final java.lang.String title , final java.lang.String name , final java.lang.String dv , final boolean nullIfDefault ) { final java.lang.String ov = get ( name ) ; java.lang.String nv = ui.readString ( ( ov != null ? ov : dv ) , "%s" , title ) ; if ( nullIfDefault && ( nv.equals ( dv ) ) ) { nv = null ; } if ( ! ( com.google.gerrit.pgm.init.Section.eq ( ov , nv ) ) ) { set ( name , nv ) ; } return nv ; }
Source:
private static int guessVersion ( java.lang.Class < ? > c ) { java.lang.String n = c.getName ( ) ; n = n.substring ( ( ( n.lastIndexOf ( '_' ) ) + 1 ) ) ; while ( n.startsWith ( "0" ) ) n = n.substring ( 1 ) ; return java.lang.Integer.parseInt ( n ) ; }

Target:
public static int guessVersion ( java.lang.Class < ? > c ) { java.lang.String n = c.getName ( ) ; n = n.substring ( ( ( n.lastIndexOf ( '_' ) ) + 1 ) ) ; while ( n.startsWith ( "0" ) ) n = n.substring ( 1 ) ; return java.lang.Integer.parseInt ( n ) ; }
Source:
public com.google.gerrit.extensions.registration.ReloadableRegistrationHandle < T > add ( com.google.inject.Key < T > key , com.google.inject.Provider < T > item ) { java.util.concurrent.atomic.AtomicReference < com.google.inject.Provider < T > > ref = new java.util.concurrent.atomic.AtomicReference < com.google.inject.Provider < T > > ( item ) ; items.add ( ref ) ; return new ReloadableHandle ( ref , key , item ) ; }

Target:
public com.google.gerrit.extensions.registration.ReloadableRegistrationHandle < T > add ( com.google.inject.Key < T > key , com.google.inject.Provider < T > item ) { java.util.concurrent.atomic.AtomicReference < com.google.inject.Provider < T > > ref = new java.util.concurrent.atomic.AtomicReference ( item ) ; items.add ( ref ) ; return new ReloadableHandle ( ref , key , item ) ; }
Source:
private java.util.List < com.google.gerrit.common.data.GroupReference > suggestAccountGroup ( @ javax.annotation.Nullable final com.google.gerrit.server.project.ProjectControl projectControl , final java.lang.String query , final int limit ) { final int n = ( limit <= 0 ) ? 10 : java.lang.Math.min ( limit , 10 ) ; return com.google.common.collect.Lists.newArrayList ( com.google.common.collect.Iterables.limit ( groupBackend.suggest ( query ) , n ) ) ; }

Target:
private java.util.List < com.google.gerrit.common.data.GroupReference > suggestAccountGroup ( @ javax.annotation.Nullable final com.google.gerrit.server.project.ProjectControl projectControl , final java.lang.String query , final int limit ) { return com.google.common.collect.Lists.newArrayList ( com.google.common.collect.Iterables.limit ( groupBackend.suggest ( query , projectControl ) , ( limit <= 0 ? 10 : java.lang.Math.min ( limit , 10 ) ) ) ) ; }
Source:
public com.google.gerrit.extensions.restapi.Response < ? > apply ( com.google.gerrit.server.change.ChangeEditResource rsrc , com.google.gerrit.server.change.ChangeEdits.Put.Input input ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.ResourceConflictException , java.io.IOException { if ( ( input.content ) == null ) { throw new com.google.gerrit.extensions.restapi.ResourceConflictException ( "no input provided" ) ; } try { editModifier.modifyFile ( rsrc.getChangeEdit ( ) , rsrc.getPath ( ) , com.google.common.io.ByteStreams.toByteArray ( input.content.getInputStream ( ) ) ) ; } catch ( com.google.gerrit.server.project.InvalidChangeOperationException | java.io.IOException e ) { throw new com.google.gerrit.extensions.restapi.ResourceConflictException ( e.getMessage ( ) ) ; } return com.google.gerrit.extensions.restapi.Response.none ( ) ; }

Target:
public com.google.gerrit.extensions.restapi.Response < ? > apply ( com.google.gerrit.server.change.ChangeEditResource rsrc , com.google.gerrit.server.change.ChangeEdits.Put.Input input ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.ResourceConflictException , java.io.IOException { try { editModifier.modifyFile ( rsrc.getChangeEdit ( ) , rsrc.getPath ( ) , com.google.common.io.ByteStreams.toByteArray ( input.content.getInputStream ( ) ) ) ; } catch ( com.google.gerrit.server.project.InvalidChangeOperationException | java.io.IOException e ) { throw new com.google.gerrit.extensions.restapi.ResourceConflictException ( e.getMessage ( ) ) ; } return com.google.gerrit.extensions.restapi.Response.none ( ) ; }
Source:
public void testUnblockLargerScope_Fails ( ) { com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.ANONYMOUS , "refs/heads/master" ) . setBlock ( ) ; com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; assertFalse ( "u can't push" , u.controlForRef ( "refs/heads/master" ) . canUpdate ( ) ) ; }

Target:
public void testUnblockLargerScope_Fails ( ) { com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.ANONYMOUS , "refs/heads/master" ) . setBlock ( ) ; com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; org.junit.Assert.assertFalse ( "u can't push" , u.controlForRef ( "refs/heads/master" ) . canUpdate ( ) ) ; }
Source:
private void statesCleanUp ( ) { if ( ( ! ( stateMap.isEmpty ( ) ) ) && ( ! ( isRetrying ( ) ) ) ) { for ( java.util.Map.Entry < java.lang.String , com.googlesource.gerrit.plugins.replication.ReplicationState > entry : stateMap.entries ( ) ) { entry.getValue ( ) . notifyRefReplicated ( projectName.get ( ) , entry.getKey ( ) , uri , RefPushResult.FAILED ) ; } } }

Target:
private void statesCleanUp ( ) { if ( ( ! ( stateMap.isEmpty ( ) ) ) && ( ! ( isRetrying ( ) ) ) ) { for ( java.util.Map.Entry < java.lang.String , com.googlesource.gerrit.plugins.replication.ReplicationState > entry : stateMap.entries ( ) ) { entry.getValue ( ) . notifyRefReplicated ( projectName.get ( ) , entry.getKey ( ) , uri , RefPushResult.FAILED , null ) ; } } }
Source:
boolean dbExists ( ) throws java.sql.SQLException { try ( java.sql.Connection conn = ds.getConnection ( ) ; java.sql.ResultSet tables = conn.getMetaData ( ) . getTables ( null , null , com.ericsson.gerrit.plugins.eventslog.sql.SQLTable.TABLE_NAME.toUpperCase ( ) , null ) ) { return tables.next ( ) ; } }

Target:
boolean dbExists ( ) throws java.sql.SQLException { try ( java.sql.Connection conn = ds.getConnection ( ) ; java.sql.ResultSet tables = conn.getMetaData ( ) . getTables ( null , null , com.ericsson.gerrit.plugins.eventslog.sql.SQLTable.TABLE_NAME , null ) ) { return tables.next ( ) ; } }
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 , UiType.POLYGERRIT ) ; } else if ( "0" . equals ( param ) ) { return setPolyGerritCookie ( req , res , UiType.GWT ) ; } else { return isPolyGerritCookie ( req ) ; } }

Target:
private boolean isPolyGerritEnabled ( javax.servlet.http.HttpServletRequest req ) { return ( ! ( options.enableGwtUi ( ) ) ) || ( isPolyGerritCookie ( req ) ) ; }
Source:
public void testCreateSchema_LabelTypes ( ) throws java.lang.Exception { java.util.List < java.lang.String > labels = com.google.common.collect.Lists.newArrayList ( ) ; for ( com.google.gerrit.common.data.LabelType label : getLabelTypes ( ) . getLabelTypes ( ) ) { labels.add ( label.getName ( ) ) ; } assertEquals ( com.google.common.collect.ImmutableList.of ( "Verified" , "Code-Review" ) , labels ) ; }

Target:
public void testCreateSchema_LabelTypes ( ) throws java.lang.Exception { java.util.List < java.lang.String > labels = com.google.common.collect.Lists.newArrayList ( ) ; for ( com.google.gerrit.common.data.LabelType label : getLabelTypes ( ) . getLabelTypes ( ) ) { labels.add ( label.getName ( ) ) ; } assertEquals ( com.google.common.collect.ImmutableList.of ( "Code-Review" ) , labels ) ; }
Source:
public void setEnableIntralineDifference ( final boolean on ) { enableIntralineDifference = on ; if ( enableIntralineDifference ) { intralineDifference.setValue ( getValue ( ) . isIntralineDifference ( ) ) ; } else { intralineDifference.setValue ( false ) ; } toggleEnabledStatus ( save.isEnabled ( ) ) ; }

Target:
public void setEnableIntralineDifference ( final boolean on ) { enableIntralineDifference = on ; if ( enableIntralineDifference ) { intralineDifference.setValue ( getValue ( ) . intralineDifference ) ; } else { intralineDifference.setValue ( false ) ; } toggleEnabledStatus ( save.isEnabled ( ) ) ; }
Source:
public void onSuccess ( com.google.gerrit.client.rpc.NativeMap < com.googlesource.gerrit.plugins.verifystatus.client.VerificationInfo > result ) { if ( ! ( result.isEmpty ( ) ) ) { java.util.Map < java.lang.String , com.googlesource.gerrit.plugins.verifystatus.client.VerificationInfo > jobs = new java.util.TreeMap < > ( ) ; for ( java.lang.String key : result.keySet ( ) ) { jobs.put ( key , result.get ( key ) ) ; } display ( jobs ) ; } }

Target:
public void onSuccess ( com.google.gerrit.client.rpc.NativeMap < com.googlesource.gerrit.plugins.verifystatus.client.VerificationInfo > result ) { if ( ! ( result.isEmpty ( ) ) ) { display ( result ) ; } }
Source:
public void fire ( com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.reviewdb.client.PatchSet patchSet , com.google.gerrit.reviewdb.client.Account.Id uploader , java.sql.Timestamp when , com.google.gerrit.extensions.api.changes.NotifyHandling notify ) { if ( ! ( listeners.iterator ( ) . hasNext ( ) ) ) { return ; } try { fire ( util.changeInfo ( change ) , util.revisionInfo ( change.getProject ( ) , patchSet ) , util.accountInfo ( uploader ) , when , notify ) ; } catch ( com.google.gerrit.server.patch.PatchListNotAvailableException | com.google.gerrit.server.GpgException | java.io.IOException | com.google.gwtorm.server.OrmException e ) { com.google.gerrit.server.extensions.events.RevisionCreated.log.error ( "Couldn't fire event" , e ) ; } }

Target:
public void fire ( com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.reviewdb.client.PatchSet patchSet , com.google.gerrit.reviewdb.client.Account uploader , java.sql.Timestamp when , com.google.gerrit.extensions.api.changes.NotifyHandling notify ) { if ( ! ( listeners.iterator ( ) . hasNext ( ) ) ) { return ; } try { fire ( util.changeInfo ( change ) , util.revisionInfo ( change.getProject ( ) , patchSet ) , util.accountInfo ( uploader ) , when , notify ) ; } catch ( com.google.gerrit.server.patch.PatchListNotAvailableException | com.google.gerrit.server.GpgException | java.io.IOException | com.google.gwtorm.server.OrmException e ) { com.google.gerrit.server.extensions.events.RevisionCreated.log.error ( "Couldn't fire event" , e ) ; } }
Source:
private void onOpen ( ) { if ( ( 0 <= ( currentRow ) ) && ( ( currentRow ) < ( table.getRowCount ( ) ) ) ) { final RowItem item = getRowItem ( currentRow ) ; if ( item != null ) { onOpenItem ( item ) ; } } }

Target:
protected void onOpen ( ) { if ( ( 0 <= ( currentRow ) ) && ( ( currentRow ) < ( table.getRowCount ( ) ) ) ) { final RowItem item = getRowItem ( currentRow ) ; if ( item != null ) { onOpenItem ( item ) ; } } }
Source:
private static java.lang.String time ( final long now , final long time ) { if ( ( time - now ) < ( ( ( 24 * 60 ) * 60 ) * 1000L ) ) { return new java.text.SimpleDateFormat ( "HH:mm:ss" ) . format ( new java.util.Date ( time ) ) ; } return new java.text.SimpleDateFormat ( "MMM-dd" ) . format ( new java.util.Date ( time ) ) ; }

Target:
private static java.lang.String time ( final long now , final long time ) { if ( ( now - time ) < ( ( ( 24 * 60 ) * 60 ) * 1000L ) ) { return new java.text.SimpleDateFormat ( "HH:mm:ss" ) . format ( new java.util.Date ( time ) ) ; } return new java.text.SimpleDateFormat ( "MMM-dd" ) . format ( new java.util.Date ( time ) ) ; }
Source:
public void testOwnerProject ( ) { local.add ( grant ( com.google.gerrit.reviewdb.ApprovalCategory.OWN , admin , "refs/*" , 1 ) ) ; com.google.gerrit.server.project.ProjectControl uBlah = user ( devs ) ; com.google.gerrit.server.project.ProjectControl uAdmin = user ( devs , admin ) ; assertFalse ( "not owner" , uBlah.isOwner ( ) ) ; assertTrue ( "is owner" , uAdmin.isOwner ( ) ) ; }

Target:
public void testOwnerProject ( ) { grant ( local , com.google.gerrit.reviewdb.ApprovalCategory.OWN , admin , "refs/*" , 1 ) ; com.google.gerrit.server.project.ProjectControl uBlah = user ( devs ) ; com.google.gerrit.server.project.ProjectControl uAdmin = user ( devs , admin ) ; assertFalse ( "not owner" , uBlah.isOwner ( ) ) ; assertTrue ( "is owner" , uAdmin.isOwner ( ) ) ; }
Source:
public com.google.gerrit.server.CurrentUser runAs ( java.net.SocketAddress remotePeer , com.google.gerrit.reviewdb.client.Account.Id id , @ com.google.gerrit.common.Nullable com.google.gerrit.server.CurrentUser caller ) { return new com.google.gerrit.server.IdentifiedUser ( capabilityControlFactory , starredChangesUtil , authConfig , realm , anonymousCowardName , canonicalUrl , accountCache , groupBackend , disableReverseDnsLookup , com.google.inject.util.Providers.of ( remotePeer ) , null , id , caller ) ; }

Target:
public com.google.gerrit.server.IdentifiedUser runAs ( java.net.SocketAddress remotePeer , com.google.gerrit.reviewdb.client.Account.Id id , @ com.google.gerrit.common.Nullable com.google.gerrit.server.CurrentUser caller ) { return new com.google.gerrit.server.IdentifiedUser ( capabilityControlFactory , starredChangesUtil , authConfig , realm , anonymousCowardName , canonicalUrl , accountCache , groupBackend , disableReverseDnsLookup , com.google.inject.util.Providers.of ( remotePeer ) , id , caller ) ; }
Source:
public void onSuccess ( com.google.gerrit.client.changes.ReviewInput result ) { com.google.gerrit.reviewdb.client.Change.Id changeId = psId.getParentKey ( ) ; java.lang.String rev = java.lang.String.valueOf ( psId.get ( ) ) ; com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( changeId , rev ) , new com.google.gerrit.client.change.ChangeScreen2 ( changeId , null , rev , false , submit ) ) ; }

Target:
public void onSuccess ( com.google.gerrit.client.changes.ReviewInput result ) { com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( psId.getParentKey ( ) , java.lang.String.valueOf ( psId.get ( ) ) ) ) ; }
Source:
private static boolean isFile ( org.eclipse.jgit.revwalk.RevWalk walk , com.google.gitiles.GitilesView view ) throws java.io.IOException { if ( view.getPathPart ( ) . equals ( "" ) ) { return false ; } org.eclipse.jgit.treewalk.TreeWalk tw = org.eclipse.jgit.treewalk.TreeWalk.forPath ( walk.getObjectReader ( ) , view.getPathPart ( ) , walk.parseTree ( view.getRevision ( ) . getId ( ) ) ) ; try { return ( ( tw.getRawMode ( 0 ) ) & ( org.eclipse.jgit.lib.FileMode.TYPE_FILE ) ) > 0 ; } finally { tw.release ( ) ; } }

Target:
private static boolean isFile ( org.eclipse.jgit.treewalk.TreeWalk tw ) { return ( ( tw.getRawMode ( 0 ) ) & ( org.eclipse.jgit.lib.FileMode.TYPE_FILE ) ) > 0 ; }
Source:
public void setUp ( ) throws java.lang.Exception { testEnv.getInjector ( ) . injectMembers ( this ) ; db = testEnv.getDb ( ) ; com.google.common.truth.TruthJUnit.assume ( ) . that ( ( ( db ) instanceof com.google.gwtorm.jdbc.JdbcSchema ) ) . isTrue ( ) ; connection = ( ( com.google.gwtorm.jdbc.JdbcSchema ) ( db ) ) . getConnection ( ) ; createdOnRetrieval = connection.prepareStatement ( "SELECT created_on FROM account_groups WHERE group_id = ?" ) ; createdOnUpdate = connection.prepareStatement ( "UPDATE account_groups SET created_on = ? WHERE group_id = ?" ) ; auditEntryDeletion = connection.prepareStatement ( "DELETE FROM account_group_members_audit WHERE group_id = ?" ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( ( ( db ) instanceof com.google.gwtorm.jdbc.JdbcSchema ) ) . isTrue ( ) ; connection = ( ( com.google.gwtorm.jdbc.JdbcSchema ) ( db ) ) . getConnection ( ) ; createdOnRetrieval = connection.prepareStatement ( "SELECT created_on FROM account_groups WHERE group_id = ?" ) ; createdOnUpdate = connection.prepareStatement ( "UPDATE account_groups SET created_on = ? WHERE group_id = ?" ) ; auditEntryDeletion = connection.prepareStatement ( "DELETE FROM account_group_members_audit WHERE group_id = ?" ) ; }
Source:
public void voteOnBehalfOfInvalidLabel ( ) throws java.lang.Exception { allowCodeReviewOnBehalfOf ( ) ; com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; com.google.gerrit.extensions.api.changes.RevisionApi revision = gApi.changes ( ) . id ( r.getChangeId ( ) ) . current ( ) ; com.google.gerrit.extensions.api.changes.ReviewInput in = new com.google.gerrit.extensions.api.changes.ReviewInput ( ) ; in.onBehalfOf = user.id.toString ( ) ; in.strictLabels = true ; in.label ( "Not-A-Label" , 5 ) ; exception.expect ( com.google.gerrit.extensions.restapi.BadRequestException.class ) ; exception.expectMessage ( "label \"Not-A-Label\" is not a configured label" ) ; revision.review ( in ) ; }

Target:
public void voteOnBehalfOfInvalidLabel ( ) throws java.lang.Exception { allowCodeReviewOnBehalfOf ( ) ; com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; com.google.gerrit.extensions.api.changes.RevisionApi revision = gApi.changes ( ) . id ( r.getChangeId ( ) ) . current ( ) ; com.google.gerrit.extensions.api.changes.ReviewInput in = new com.google.gerrit.extensions.api.changes.ReviewInput ( ) ; in.onBehalfOf = user.id.toString ( ) ; in.label ( "Not-A-Label" , 5 ) ; exception.expect ( com.google.gerrit.extensions.restapi.BadRequestException.class ) ; exception.expectMessage ( "label \"Not-A-Label\" is not a configured label" ) ; revision.review ( in ) ; }
Source:
protected void run ( ) throws com.google.gerrit.sshd.commands.UnloggedFailure { try { if ( luceneVersionManager.activateLatestIndex ( ) ) { stdout.println ( "Activated latest index version" ) ; } else { stdout.println ( "Not activating index, already using latest version" ) ; } } catch ( com.google.gerrit.lucene.ReindexerAlreadyRunningException e ) { throw new com.google.gerrit.sshd.commands.UnloggedFailure ( ( "Failed to activate latest index: " + ( e.getMessage ( ) ) ) ) ; } }

Target:
protected void run ( ) throws com.google.gerrit.sshd.commands.UnloggedFailure { try { if ( luceneVersionManager.activateLatestIndex ( name ) ) { stdout.println ( "Activated latest index version" ) ; } else { stdout.println ( "Not activating index, already using latest version" ) ; } } catch ( com.google.gerrit.lucene.ReindexerAlreadyRunningException e ) { throw new com.google.gerrit.sshd.commands.UnloggedFailure ( ( "Failed to activate latest index: " + ( e.getMessage ( ) ) ) ) ; } }
Source:
protected void insert ( int row , com.google.gerrit.client.projects.ProjectInfo k ) { super . insert ( row , k ) ; if ( ( com.google.gerrit.client.Gerrit.getGitwebLink ( ) ) != null ) { table.getFlexCellFormatter ( ) . addStyleName ( row , ProjectsTable.C_REPO_BROWSER , Gerrit.RESOURCES.css ( ) . dataCell ( ) ) ; } }

Target:
protected void insert ( int row , com.google.gerrit.client.projects.ProjectInfo k ) { super . insert ( row , k ) ; table.getFlexCellFormatter ( ) . addStyleName ( row , ProjectsTable.C_REPO_BROWSER , Gerrit.RESOURCES.css ( ) . dataCell ( ) ) ; }
Source:
private static java.util.Set < org.eclipse.jgit.revwalk.RevCommit > alreadyAccepted ( org.eclipse.jgit.revwalk.RevWalk rw , java.lang.Iterable < org.eclipse.jgit.lib.Ref > refs ) throws java.io.IOException , org.eclipse.jgit.errors.MissingObjectException { java.util.Set < org.eclipse.jgit.revwalk.RevCommit > accepted = com.google.common.collect.Sets.newHashSet ( ) ; for ( org.eclipse.jgit.lib.Ref r : refs ) { try { accepted.add ( rw.parseCommit ( r.getObjectId ( ) ) ) ; } catch ( org.eclipse.jgit.errors.IncorrectObjectTypeException nonCommit ) { } } return accepted ; }

Target:
private java.util.Set < org.eclipse.jgit.revwalk.RevCommit > alreadyAccepted ( org.eclipse.jgit.revwalk.RevWalk rw , java.lang.Iterable < org.eclipse.jgit.lib.Ref > refs ) throws java.io.IOException , org.eclipse.jgit.errors.MissingObjectException { java.util.Set < org.eclipse.jgit.revwalk.RevCommit > accepted = com.google.common.collect.Sets.newHashSet ( ) ; for ( org.eclipse.jgit.lib.Ref r : refs ) { try { accepted.add ( rw.parseCommit ( r.getObjectId ( ) ) ) ; } catch ( org.eclipse.jgit.errors.IncorrectObjectTypeException nonCommit ) { } } return accepted ; }