auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void onLoad ( ) { enableForm ( false ) ; super . onLoad ( ) ; Util.PROJECT_SVC.listBranches ( projectId , new com.google.gerrit.client.rpc.GerritCallback < java.util.List < com.google.gerrit.client.reviewdb.Branch > > ( ) { public void onSuccess ( final java.util.List < com.google.gerrit.client.reviewdb.Branch > result ) { enableForm ( true ) ; branches.display ( result ) ; } } ) ; }

Target:
protected void onLoad ( ) { enableForm ( false ) ; super . onLoad ( ) ; Util.PROJECT_SVC.listBranches ( projectId , new com.google.gerrit.client.rpc.GerritCallback < java.util.List < com.google.gerrit.client.reviewdb.Branch > > ( ) { public void onSuccess ( final java.util.List < com.google.gerrit.client.reviewdb.Branch > result ) { enableForm ( true ) ; branches.display ( result ) ; } } ) ; }
Source:
protected synchronized void startThread ( final com.google.gerrit.sshd.BaseCommand.CommandRunnable thunk ) { final com.google.gerrit.sshd.BaseCommand.TaskThunk tt = new com.google.gerrit.sshd.BaseCommand.TaskThunk ( thunk ) ; if ( ( isAdminCommand ( ) ) || ( ( isAdminHighPriorityCommand ( ) ) && ( userProvider.get ( ) . getCapabilities ( ) . canAdministrateServer ( ) ) ) ) { new java.lang.Thread ( tt , tt.toString ( ) ) . start ( ) ; } else { task = executor.submit ( tt ) ; } }

Target:
protected void startThread ( final com.google.gerrit.sshd.BaseCommand.CommandRunnable thunk ) { final com.google.gerrit.sshd.BaseCommand.TaskThunk tt = new com.google.gerrit.sshd.BaseCommand.TaskThunk ( thunk ) ; if ( ( isAdminCommand ( ) ) || ( ( isAdminHighPriorityCommand ( ) ) && ( userProvider.get ( ) . getCapabilities ( ) . canAdministrateServer ( ) ) ) ) { new java.lang.Thread ( tt , tt.toString ( ) ) . start ( ) ; } else { task.set ( executor.submit ( tt ) ) ; } }
Source:
private org.eclipse.jgit.revwalk.RevCommit parse ( org.eclipse.jgit.lib.ObjectId id ) throws java.lang.Exception { try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( project ) ; org.eclipse.jgit.revwalk.RevWalk rw = new org.eclipse.jgit.revwalk.RevWalk ( repo ) ) { org.eclipse.jgit.revwalk.RevCommit c = rw.parseCommit ( id ) ; rw.parseBody ( c ) ; return c ; } finally { } }

Target:
private org.eclipse.jgit.revwalk.RevCommit parse ( org.eclipse.jgit.lib.ObjectId id ) throws java.lang.Exception { try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( project ) ; org.eclipse.jgit.revwalk.RevWalk rw = new org.eclipse.jgit.revwalk.RevWalk ( repo ) ) { org.eclipse.jgit.revwalk.RevCommit c = rw.parseCommit ( id ) ; rw.parseBody ( c ) ; return c ; } }
Source:
private boolean canAddPatchSet ( com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { if ( ( ! ( refControl.asForRef ( ) . testOrFalse ( RefPermission.CREATE_CHANGE ) ) ) || ( isPatchSetLocked ( db ) ) ) { return false ; } if ( isOwner ( ) ) { return true ; } return getRefControl ( ) . canAddPatchSet ( ) ; }

Target:
private boolean canAddPatchSet ( com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { if ( ( ! ( refControl.asForRef ( ) . testOrFalse ( RefPermission.CREATE_CHANGE ) ) ) || ( isPatchSetLocked ( db ) ) ) { return false ; } if ( isOwner ( ) ) { return true ; } return refControl.canAddPatchSet ( ) ; }
Source:
private static org.eclipse.jgit.transport.PushResult pushTag ( org.eclipse.jgit.junit.TestRepository < ? > testRepo , java.lang.String tag , boolean force ) throws org.eclipse.jgit.api.errors.GitAPIException { org.eclipse.jgit.api.PushCommand pushCmd = testRepo.git ( ) . push ( ) ; pushCmd.setForce ( force ) ; pushCmd.setRefSpecs ( new org.eclipse.jgit.transport.RefSpec ( ( ( ( "refs/tags/" + tag ) + ":refs/tags/" ) + tag ) ) ) ; java.lang.Iterable < org.eclipse.jgit.transport.PushResult > r = pushCmd.call ( ) ; return com.google.common.collect.Iterables.getOnlyElement ( r ) ; }

Target:
public static org.eclipse.jgit.transport.PushResult pushTag ( org.eclipse.jgit.junit.TestRepository < ? > testRepo , java.lang.String tag , boolean force ) throws org.eclipse.jgit.api.errors.GitAPIException { org.eclipse.jgit.api.PushCommand pushCmd = testRepo.git ( ) . push ( ) ; pushCmd.setForce ( force ) ; pushCmd.setRefSpecs ( new org.eclipse.jgit.transport.RefSpec ( ( ( ( "refs/tags/" + tag ) + ":refs/tags/" ) + tag ) ) ) ; java.lang.Iterable < org.eclipse.jgit.transport.PushResult > r = pushCmd.call ( ) ; return com.google.common.collect.Iterables.getOnlyElement ( r ) ; }
Source:
public java.lang.Void call ( ) throws com.google.gwtorm.server.OrmException , java.io.IOException { if ( caller == ( java.lang.Thread.currentThread ( ) ) ) { updateGroups ( db ) ; } else { com.google.gerrit.reviewdb.server.ReviewDb db = schemaFactory.open ( ) ; try { updateGroups ( db ) ; } finally { db.close ( ) ; } } return null ; }

Target:
public java.lang.Void call ( ) throws com.google.gwtorm.server.OrmException , java.io.IOException { if ( caller == ( java.lang.Thread.currentThread ( ) ) ) { updateGroups ( db ) ; } else { try ( com.google.gerrit.reviewdb.server.ReviewDb db = schemaFactory.open ( ) ) { updateGroups ( db ) ; } } return null ; }
Source:
void doLinkIdentity ( ) { final com.google.gerrit.client.SignInDialog d = new com.google.gerrit.client.SignInDialog ( new com.google.gerrit.client.rpc.GerritCallback < java.lang.Object > ( ) { public void onSuccess ( final java.lang.Object result ) { refresh ( ) ; } } ) ; d.setMode ( SignInDialog.Mode.LINK_IDENTIY ) ; d.center ( ) ; }

Target:
void doLinkIdentity ( ) { final com.google.gerrit.client.SignInDialog d = new com.google.gerrit.client.SignInDialog ( SignInDialog.Mode.LINK_IDENTIY , new com.google.gerrit.client.rpc.GerritCallback < java.lang.Object > ( ) { public void onSuccess ( final java.lang.Object result ) { refresh ( ) ; } } ) ; d.center ( ) ; }
Source:
private org.eclipse.jgit.treewalk.AbstractTreeIterator getTreeIterator ( org.eclipse.jgit.lib.Repository repo , java.lang.String name ) throws java.io.IOException { org.eclipse.jgit.treewalk.CanonicalTreeParser p = new org.eclipse.jgit.treewalk.CanonicalTreeParser ( ) ; try ( org.eclipse.jgit.lib.ObjectReader or = repo.newObjectReader ( ) ) { p.reset ( or , new org.eclipse.jgit.revwalk.RevWalk ( repo ) . parseTree ( repo.resolve ( name ) ) ) ; return p ; } }

Target:
private org.eclipse.jgit.treewalk.AbstractTreeIterator getTreeIterator ( org.eclipse.jgit.lib.Repository repo , java.lang.String name ) throws java.io.IOException { org.eclipse.jgit.treewalk.CanonicalTreeParser p = new org.eclipse.jgit.treewalk.CanonicalTreeParser ( ) ; try ( org.eclipse.jgit.lib.ObjectReader or = repo.newObjectReader ( ) ; org.eclipse.jgit.revwalk.RevWalk rw = new org.eclipse.jgit.revwalk.RevWalk ( repo ) ) { p.reset ( or , rw.parseTree ( repo.resolve ( name ) ) ) ; return p ; } }
Source:
private void abandonAllOpenChanges ( com.google.gerrit.reviewdb.client.Project.NameKey destProject ) throws com.google.gerrit.server.project.NoSuchChangeException { try { openSchema ( ) ; for ( com.google.gerrit.server.query.change.ChangeData cd : internalChangeQuery.byProjectOpen ( destProject ) ) { abandonOneChange ( cd.change ( ) ) ; } db.close ( ) ; db = null ; } catch ( java.io.IOException | com.google.gwtorm.server.OrmException e ) { logWarn ( "Cannot abandon changes for deleted project " , e ) ; } }

Target:
private void abandonAllOpenChanges ( com.google.gerrit.reviewdb.client.Project.NameKey destProject ) throws com.google.gerrit.server.project.NoSuchChangeException { try { for ( com.google.gerrit.server.query.change.ChangeData cd : internalChangeQuery.byProjectOpen ( destProject ) ) { abandonOneChange ( cd.change ( ) ) ; } } catch ( java.io.IOException | com.google.gwtorm.server.OrmException e ) { logWarn ( "Cannot abandon changes for deleted project " , e ) ; } }
Source:
public com.google.gerrit.server.change.Description getDescription ( com.google.gerrit.server.change.ChangeResource rsrc ) { return new com.google.gerrit.extensions.webui.UiAction.Description ( ) . setLabel ( "Mute" ) . setTitle ( "Mute the change to unhighlight it in the dashboard" ) . setVisible ( ( ( ! ( rsrc.isUserOwner ( ) ) ) && ( isMuteable ( rsrc.getChange ( ) ) ) ) ) ; }

Target:
public com.google.gerrit.server.change.Description getDescription ( com.google.gerrit.server.change.ChangeResource rsrc ) { return new com.google.gerrit.extensions.webui.UiAction.Description ( ) . setLabel ( "Mute" ) . setTitle ( "Mute the change to unhighlight it in the dashboard" ) . setVisible ( ( ( ! ( rsrc.isUserOwner ( ) ) ) && ( isMuteable ( rsrc ) ) ) ) ; }
Source:
public void assertChange ( com.google.gerrit.reviewdb.client.Change.Status expectedStatus , java.lang.String expectedTopic , com.google.gerrit.acceptance.TestAccount ... expectedReviewers ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.Change c = getChange ( ) . change ( ) ; com.google.common.truth.Truth.assertThat ( resSubj ) . isEqualTo ( c.getSubject ( ) ) ; com.google.common.truth.Truth.assertThat ( expectedStatus ) . isEqualTo ( c.getStatus ( ) ) ; com.google.common.truth.Truth.assertThat ( expectedTopic ) . isEqualTo ( com.google.common.base.Strings.emptyToNull ( c.getTopic ( ) ) ) ; assertReviewers ( c , expectedReviewers ) ; }

Target:
public void assertChange ( com.google.gerrit.reviewdb.client.Change.Status expectedStatus , java.lang.String expectedTopic , com.google.gerrit.acceptance.TestAccount ... expectedReviewers ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.Change c = getChange ( ) . change ( ) ; com.google.common.truth.Truth.assertThat ( c.getSubject ( ) ) . isEqualTo ( resSubj ) ; com.google.common.truth.Truth.assertThat ( c.getStatus ( ) ) . isEqualTo ( expectedStatus ) ; com.google.common.truth.Truth.assertThat ( com.google.common.base.Strings.emptyToNull ( c.getTopic ( ) ) ) . isEqualTo ( expectedTopic ) ; assertReviewers ( c , expectedReviewers ) ; }
Source:
private static synchronized void fill ( byte [ ] raw , com.google.gerrit.reviewdb.ReviewDb db ) throws com.google.gwtorm.client.OrmException { if ( ( com.google.gerrit.server.ChangeUtil.uuidSeq ) == 0 ) { com.google.gerrit.server.ChangeUtil.uuidPrefix = db.nextChangeMessageId ( ) ; com.google.gerrit.server.ChangeUtil.uuidSeq = java.lang.Integer.MAX_VALUE ; } org.eclipse.jgit.util.NB.encodeInt32 ( raw , 0 , com.google.gerrit.server.ChangeUtil.uuidPrefix ) ; org.eclipse.jgit.util.NB.encodeInt32 ( raw , 4 , ( ( com.google.gerrit.server.ChangeUtil.uuidSeq ) -- ) ) ; }

Target:
private static synchronized void fill ( byte [ ] raw , com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { if ( ( com.google.gerrit.server.ChangeUtil.uuidSeq ) == 0 ) { com.google.gerrit.server.ChangeUtil.uuidPrefix = db.nextChangeMessageId ( ) ; com.google.gerrit.server.ChangeUtil.uuidSeq = java.lang.Integer.MAX_VALUE ; } org.eclipse.jgit.util.NB.encodeInt32 ( raw , 0 , com.google.gerrit.server.ChangeUtil.uuidPrefix ) ; org.eclipse.jgit.util.NB.encodeInt32 ( raw , 4 , ( ( com.google.gerrit.server.ChangeUtil.uuidSeq ) -- ) ) ; }
Source:
private double align ( double srcTop ) { int line = src.lineAtHeight ( srcTop , "local" ) ; com.google.gerrit.client.diff.LineMapper.AlignedPair p = mapper.align ( srcSide , line ) ; double sy = src.heightAtLine ( p.src , "local" ) ; double dy = dst.heightAtLine ( p.dst , "local" ) ; return java.lang.Math.max ( 0 , ( dy + ( srcTop - sy ) ) ) ; }

Target:
private double align ( double srcTop ) { int line = src.lineAtHeight ( srcTop , "local" ) ; if ( line == 0 ) { return srcTop ; } com.google.gerrit.client.diff.LineMapper.AlignedPair p = mapper.align ( srcSide , line ) ; double sy = src.heightAtLine ( p.src , "local" ) ; double dy = dst.heightAtLine ( p.dst , "local" ) ; return java.lang.Math.max ( 0 , ( dy + ( srcTop - sy ) ) ) ; }
Source:
public void testDirCacheAltersId ( ) throws java.lang.Exception { assertEquals ( ( "a\n" + ( "\n" + "Change-Id: I7fc3876fee63c766a2063df97fbe04a2dddd8d7c\n" ) ) , call ( "a\n" ) ) ; final org.eclipse.jgit.dircache.DirCacheBuilder builder = repository.lockDirCache ( ) . builder ( ) ; builder.add ( file ( "A" ) ) ; assertTrue ( builder.commit ( ) ) ; assertEquals ( ( "a\n" + ( "\n" + "Change-Id: If56597ea9759f23b070677ea6f064c60c38da631\n" ) ) , call ( "a\n" ) ) ; }

Target:
public void testDirCacheAltersId ( ) throws java.lang.Exception { org.junit.Assert.assertEquals ( ( "a\n" + ( "\n" + "Change-Id: I7fc3876fee63c766a2063df97fbe04a2dddd8d7c\n" ) ) , call ( "a\n" ) ) ; final org.eclipse.jgit.dircache.DirCacheBuilder builder = repository.lockDirCache ( ) . builder ( ) ; builder.add ( file ( "A" ) ) ; org.junit.Assert.assertTrue ( builder.commit ( ) ) ; org.junit.Assert.assertEquals ( ( "a\n" + ( "\n" + "Change-Id: If56597ea9759f23b070677ea6f064c60c38da631\n" ) ) , call ( "a\n" ) ) ; }
Source:
public boolean accept ( java.io.File pathname ) { java.lang.String n = pathname.getName ( ) ; return ( ( ( n.endsWith ( ".jar" ) ) || ( n.endsWith ( ".jar.disabled" ) ) ) && ( pathname.isFile ( ) ) ) && ( ( n.indexOf ( "replication" ) ) >= 0 ) ; }

Target:
public boolean accept ( java.io.File pathname ) { java.lang.String n = pathname.getName ( ) ; return ( ( ( n.endsWith ( ".jar" ) ) || ( n.endsWith ( ".jar.disabled" ) ) ) && ( pathname.isFile ( ) ) ) && ( n.contains ( "replication" ) ) ; }
Source:
public int compare ( com.google.gerrit.server.group.GetGroup.GroupInfo a , com.google.gerrit.server.group.GetGroup.GroupInfo b ) { int cmp = com.google.common.base.Strings.nullToEmpty ( a.name ) . compareTo ( com.google.common.base.Strings.nullToEmpty ( b.name ) ) ; if ( cmp != 0 ) { return cmp ; } return com.google.common.base.Strings.nullToEmpty ( a.id ) . compareTo ( com.google.common.base.Strings.nullToEmpty ( b.name ) ) ; }

Target:
public int compare ( com.google.gerrit.server.group.GetGroup.GroupInfo a , com.google.gerrit.server.group.GetGroup.GroupInfo b ) { int cmp = com.google.common.base.Strings.nullToEmpty ( a.name ) . compareTo ( com.google.common.base.Strings.nullToEmpty ( b.name ) ) ; if ( cmp != 0 ) { return cmp ; } return com.google.common.base.Strings.nullToEmpty ( a.id ) . compareTo ( com.google.common.base.Strings.nullToEmpty ( b.id ) ) ; }
Source:
private java.util.Map < java.lang.String , java.util.List < com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.Scope > > getScopes ( org.eclipse.jgit.lib.Config config ) { java.util.Map < java.lang.String , java.util.List < com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.Scope > > scopes = com.google.common.collect.Maps.newHashMap ( ) ; java.util.Set < java.lang.String > configKeys = config.getNames ( com.googlesource.gerrit.plugins.github.oauth.GitHubOAuthConfig.CONF_SECTION , true ) ; for ( java.lang.String key : configKeys ) { if ( key.startsWith ( "scopes" ) ) { java.lang.String scopesString = config.getString ( com.googlesource.gerrit.plugins.github.oauth.GitHubOAuthConfig.CONF_SECTION , null , key ) ; scopes.put ( key , parseScopesString ( scopesString ) ) ; } } return scopes ; }

Target:
private java.util.Map < java.lang.String , java.util.List < com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.Scope > > getScopes ( org.eclipse.jgit.lib.Config config ) { java.util.Map < java.lang.String , java.util.List < com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.Scope > > result = com.google.common.collect.Maps.newHashMap ( ) ; java.util.Set < java.lang.String > configKeys = config.getNames ( com.googlesource.gerrit.plugins.github.oauth.GitHubOAuthConfig.CONF_SECTION , true ) ; for ( java.lang.String key : configKeys ) { if ( key.startsWith ( "scopes" ) ) { java.lang.String scopesString = config.getString ( com.googlesource.gerrit.plugins.github.oauth.GitHubOAuthConfig.CONF_SECTION , null , key ) ; result.put ( key , parseScopesString ( scopesString ) ) ; } } return result ; }
Source:
public com.google.gerrit.server.index.ChangeIndex get ( java.lang.String name ) throws java.io.IOException { return new com.google.gerrit.server.index.ChangeIndex ( ) { @ java.lang.Override public void insert ( com.google.gerrit.server.query.change.ChangeData cd ) throws java.io.IOException { } @ java.lang.Override public void replace ( com.google.gerrit.server.query.change.ChangeData cd ) throws java.io.IOException { } @ java.lang.Override public com.google.gerrit.server.query.change.ChangeDataSource getSource ( com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > p ) throws com.google.gerrit.server.query.QueryParseException { throw new java.lang.UnsupportedOperationException ( ) ; } } ; }

Target:
public void delete ( com.google.gerrit.server.query.change.ChangeData cd ) throws java.io.IOException { }
Source:
public com.google.gerrit.server.config.PluginConfig getFromProjectConfig ( com.google.gerrit.reviewdb.client.Project.NameKey projectName , java.lang.String pluginName ) throws com.google.gerrit.server.project.NoSuchProjectException { com.google.gerrit.server.project.ProjectState projectState = projectCache.get ( projectName ) ; if ( projectState == null ) { throw new com.google.gerrit.server.project.NoSuchProjectException ( projectName ) ; } return projectState.getConfig ( ) . getPluginConfig ( pluginName ) ; }

Target:
public com.google.gerrit.server.config.PluginConfig getFromProjectConfig ( com.google.gerrit.reviewdb.client.Project.NameKey projectName , java.lang.String pluginName ) throws com.google.gerrit.server.project.NoSuchProjectException { com.google.gerrit.server.project.ProjectState projectState = projectCache.get ( projectName ) ; if ( projectState == null ) { throw new com.google.gerrit.server.project.NoSuchProjectException ( projectName ) ; } return getFromProjectConfig ( projectState , pluginName ) ; }
Source:
private void updateSchema ( java.util.List < com.google.gerrit.server.schema.SchemaVersion > pending , com.google.gerrit.server.schema.UpdateUI ui , com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException , java.sql.SQLException { for ( com.google.gerrit.server.schema.SchemaVersion v : pending ) { ui.message ( java.lang.String.format ( "Upgrading schema to %d ..." , v.getVersionNbr ( ) ) ) ; v.preUpdateSchema ( db ) ; } com.google.gwtorm.jdbc.JdbcSchema s = ( ( com.google.gwtorm.jdbc.JdbcSchema ) ( db ) ) ; com.google.gwtorm.jdbc.JdbcExecutor e = new com.google.gwtorm.jdbc.JdbcExecutor ( s ) ; try { s.updateSchema ( e ) ; } finally { e.close ( ) ; } }

Target:
private void updateSchema ( java.util.List < com.google.gerrit.server.schema.SchemaVersion > pending , com.google.gerrit.server.schema.UpdateUI ui , com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException , java.sql.SQLException { for ( com.google.gerrit.server.schema.SchemaVersion v : pending ) { ui.message ( java.lang.String.format ( "Upgrading schema to %d ..." , v.getVersionNbr ( ) ) ) ; v.preUpdateSchema ( db ) ; } com.google.gwtorm.jdbc.JdbcSchema s = ( ( com.google.gwtorm.jdbc.JdbcSchema ) ( db ) ) ; try ( com.google.gwtorm.jdbc.JdbcExecutor e = new com.google.gwtorm.jdbc.JdbcExecutor ( s ) ) { s.updateSchema ( e ) ; } }
Source:
public void printJson ( final java.lang.StringBuffer sb , final java.util.Set < T > o ) { sb.append ( '[' ) ; boolean first = true ; for ( final T item : o ) { if ( first ) { first = false ; } else { sb.append ( ',' ) ; } if ( item != null ) { serializer.printJson ( sb , item ) ; } else { sb.append ( com.google.gwtjsonrpc.client.JS_NULL ) ; } } sb.append ( ']' ) ; }

Target:
public void printJson ( final java.lang.StringBuilder sb , final java.util.Set < T > o ) { sb.append ( '[' ) ; boolean first = true ; for ( final T item : o ) { if ( first ) { first = false ; } else { sb.append ( ',' ) ; } if ( item != null ) { serializer.printJson ( sb , item ) ; } else { sb.append ( com.google.gwtjsonrpc.client.JS_NULL ) ; } } sb.append ( ']' ) ; }
Source:
private static org.eclipse.jgit.lib.ObjectId emptyTree ( final org.eclipse.jgit.lib.Repository repo ) throws java.io.IOException { org.eclipse.jgit.lib.ObjectInserter oi = repo.newObjectInserter ( ) ; try { org.eclipse.jgit.lib.ObjectId id = oi.insert ( Constants.OBJ_TREE , new byte [ ] { } ) ; oi.flush ( ) ; return id ; } finally { oi.release ( ) ; } }

Target:
private static org.eclipse.jgit.lib.ObjectId emptyTree ( final org.eclipse.jgit.lib.Repository repo ) throws java.io.IOException { try ( org.eclipse.jgit.lib.ObjectInserter oi = repo.newObjectInserter ( ) ) { org.eclipse.jgit.lib.ObjectId id = oi.insert ( Constants.OBJ_TREE , new byte [ ] { } ) ; oi.flush ( ) ; return id ; } }
Source:
private org.eclipse.jgit.lib.ObjectId emptyTree ( ) throws java.io.IOException { org.eclipse.jgit.lib.ObjectInserter oi = repo.newObjectInserter ( ) ; try { org.eclipse.jgit.lib.ObjectId id = oi.insert ( Constants.OBJ_TREE , new byte [ ] { } ) ; oi.flush ( ) ; return id ; } finally { oi.release ( ) ; } }

Target:
private org.eclipse.jgit.lib.ObjectId emptyTree ( ) throws java.io.IOException { org.eclipse.jgit.lib.ObjectInserter oi = repo.newObjectInserter ( ) ; try { org.eclipse.jgit.lib.ObjectId id = oi.insert ( Constants.OBJ_TREE , new byte [ ] { } ) ; oi.flush ( ) ; return id ; } finally { oi.close ( ) ; } }
Source:
private java.util.Map < java.lang.String , com.google.gerrit.common.data.LabelType > byId ( ) { if ( ( byId ) == null ) { byId = new java.util.HashMap < java.lang.String , com.google.gerrit.common.data.LabelType > ( ) ; if ( ( labelTypes ) != null ) { for ( final com.google.gerrit.common.data.LabelType t : labelTypes ) { byId.put ( t.getId ( ) , t ) ; } } } return byId ; }

Target:
private java.util.Map < java.lang.String , com.google.gerrit.common.data.LabelType > byId ( ) { if ( ( byId ) == null ) { byId = new java.util.HashMap < java.lang.String , com.google.gerrit.common.data.LabelType > ( ) ; if ( ( labelTypes ) != null ) { for ( com.google.gerrit.common.data.LabelType t : labelTypes ) { if ( ( t.getId ( ) ) != null ) { byId.put ( t.getId ( ) , t ) ; } } } } return byId ; }
Source:
private static java.util.LinkedList < java.lang.String > chain ( com.google.gerrit.sshd.CommandName command ) { java.util.LinkedList < java.lang.String > chain = com.google.common.collect.Lists.newLinkedList ( ) ; while ( command != null ) { chain.addFirst ( command.value ( ) ) ; command = com.google.gerrit.sshd.Commands.parentOf ( command ) ; } chain.removeLast ( ) ; return chain ; }

Target:
private static java.util.LinkedList < java.lang.String > chain ( com.google.gerrit.sshd.CommandName command ) { java.util.LinkedList < java.lang.String > chain = new java.util.LinkedList < > ( ) ; while ( command != null ) { chain.addFirst ( command.value ( ) ) ; command = com.google.gerrit.sshd.Commands.parentOf ( command ) ; } chain.removeLast ( ) ; return chain ; }
Source:
public boolean isGenericAddress ( com.google.gerrit.reviewdb.Account.Id fromId ) { if ( fromId != null ) { final com.google.gerrit.reviewdb.Account account = accountCache.get ( fromId ) . getAccount ( ) ; final java.lang.String name = account.getFullName ( ) ; return ( name == null ) || ( "" . equals ( name ) ) ; } else { return true ; } }

Target:
public boolean isGenericAddress ( com.google.gerrit.reviewdb.Account.Id fromId ) { return false ; }
Source:
void appendReplace ( int aLen , int bLen ) { appendCommon ( java.lang.Math.min ( aLen , bLen ) ) ; if ( aLen < bLen ) { int insertCnt = bLen - aLen ; appendInsert ( insertCnt ) ; } else if ( aLen > bLen ) { int deleteCnt = aLen - bLen ; appendDelete ( deleteCnt ) ; } }

Target:
void appendReplace ( int aLen , int bLen ) { appendCommon ( java.lang.Math.min ( aLen , bLen ) ) ; if ( aLen < bLen ) { appendInsert ( ( bLen - aLen ) ) ; } else if ( aLen > bLen ) { appendDelete ( ( aLen - bLen ) ) ; } }
Source:
public java.lang.String apply ( com.google.gerrit.server.account.AccountResource rsrc ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.ResourceNotFoundException { if ( ( ( self.get ( ) ) != ( rsrc.getUser ( ) ) ) && ( ! ( self.get ( ) . getCapabilities ( ) . canAdministrateServer ( ) ) ) ) { throw new com.google.gerrit.extensions.restapi.AuthException ( "not allowed to get username" ) ; } java.lang.String username = rsrc.getUser ( ) . getAccount ( ) . getUserName ( ) ; if ( username == null ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( ) ; } return username ; }

Target:
public java.lang.String apply ( com.google.gerrit.server.account.AccountResource rsrc ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.ResourceNotFoundException { java.lang.String username = rsrc.getUser ( ) . getAccount ( ) . getUserName ( ) ; if ( username == null ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( ) ; } return username ; }
Source:
public java.util.List < com.google.gerrit.extensions.common.ProjectInfo > apply ( com.google.gerrit.server.project.ProjectResource rsrc ) { if ( recursive ) { return getChildProjectsRecursively ( rsrc.getNameKey ( ) , rsrc.getControl ( ) . getUser ( ) ) ; } else { return getDirectChildProjects ( rsrc.getNameKey ( ) ) ; } }

Target:
public java.util.List < com.google.gerrit.extensions.common.ProjectInfo > apply ( com.google.gerrit.server.project.ProjectResource rsrc ) { if ( recursive ) { return getChildProjectsRecursively ( rsrc.getNameKey ( ) , rsrc.getControl ( ) . getUser ( ) ) ; } return getDirectChildProjects ( rsrc.getNameKey ( ) ) ; }
Source:
public void listTasksWithoutViewQueueCapability ( ) throws java.lang.Exception { com.google.gerrit.acceptance.RestResponse r = userSession.get ( "/config/server/tasks/" ) ; org.junit.Assert.assertEquals ( HttpStatus.SC_OK , r.getStatusCode ( ) ) ; java.util.List < com.google.gerrit.server.config.ListTasks.TaskInfo > result = newGson ( ) . fromJson ( r.getReader ( ) , new com.google.gson.reflect.TypeToken < java.util.List < com.google.gerrit.server.config.ListTasks.TaskInfo > > ( ) { } . getType ( ) ) ; org.junit.Assert.assertTrue ( result.isEmpty ( ) ) ; }

Target:
public void listTasksWithoutViewQueueCapability ( ) throws java.lang.Exception { com.google.gerrit.acceptance.RestResponse r = userSession.get ( "/config/server/tasks/" ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( HttpStatus.SC_OK ) ; java.util.List < com.google.gerrit.server.config.ListTasks.TaskInfo > result = newGson ( ) . fromJson ( r.getReader ( ) , new com.google.gson.reflect.TypeToken < java.util.List < com.google.gerrit.server.config.ListTasks.TaskInfo > > ( ) { } . getType ( ) ) ; com.google.common.truth.Truth.assertThat ( result ) . isEmpty ( ) ; }
Source:
private void walk ( final org.eclipse.jgit.revwalk.RevWalk rw , final org.eclipse.jgit.revwalk.RevFlag VISIBLE , final org.eclipse.jgit.revwalk.RevCommit tagged , final java.util.List < org.eclipse.jgit.revwalk.RevCommit > starts ) throws java.io.IOException , org.eclipse.jgit.errors.IncorrectObjectTypeException , org.eclipse.jgit.errors.MissingObjectException { rw.resetRetain ( VISIBLE ) ; for ( org.eclipse.jgit.revwalk.RevCommit o : starts ) { try { rw.markStart ( o ) ; } catch ( java.io.IOException e ) { } } rw.markUninteresting ( tagged ) ; org.eclipse.jgit.revwalk.RevCommit c ; while ( ( c = rw.next ( ) ) != null ) { } }

Target:
private void walk ( final org.eclipse.jgit.revwalk.RevWalk rw , final org.eclipse.jgit.revwalk.RevFlag VISIBLE , final org.eclipse.jgit.revwalk.RevCommit tagged , final java.util.List < org.eclipse.jgit.revwalk.RevCommit > starts ) throws java.io.IOException , org.eclipse.jgit.errors.IncorrectObjectTypeException , org.eclipse.jgit.errors.MissingObjectException { rw.resetRetain ( VISIBLE ) ; for ( org.eclipse.jgit.revwalk.RevCommit o : starts ) { try { rw.markStart ( o ) ; } catch ( java.io.IOException e ) { } } rw.markUninteresting ( tagged ) ; while ( ( rw.next ( ) ) != null ) { } }
Source:
public static com.google.gerrit.server.query.change.ChangeData createForTest ( com.google.gerrit.reviewdb.client.Change.Id id , int currentPatchSetId ) { com.google.gerrit.server.query.change.ChangeData cd = new com.google.gerrit.server.query.change.ChangeData ( null , null , null , null , null , null , null , null , null , null , null , id ) ; cd.currentPatchSet = new com.google.gerrit.reviewdb.client.PatchSet ( new com.google.gerrit.reviewdb.client.PatchSet.Id ( id , currentPatchSetId ) ) ; return cd ; }

Target:
static com.google.gerrit.server.query.change.ChangeData createForTest ( com.google.gerrit.reviewdb.client.Change.Id id , int currentPatchSetId ) { com.google.gerrit.server.query.change.ChangeData cd = new com.google.gerrit.server.query.change.ChangeData ( null , null , null , null , null , null , null , null , null , null , null , null , null , id ) ; cd.currentPatchSet = new com.google.gerrit.reviewdb.client.PatchSet ( new com.google.gerrit.reviewdb.client.PatchSet.Id ( id , currentPatchSetId ) ) ; return cd ; }
Source:
public void testLoader ( ) throws java.lang.Exception { com.google.common.cache.LoadingCache < java.lang.String , java.util.regex.Pattern > patternCache = com.google.common.cache.CacheBuilder.newBuilder ( ) . build ( new com.googlesource.gerrit.plugins.uploadvalidator.BlockedKeywordValidator.Loader ( ) ) ; for ( java.lang.String pattern : com.googlesource.gerrit.plugins.uploadvalidator.BlockedKeywordValidatorTest.getPatterns ( ) . keySet ( ) ) { org.junit.Assert.assertEquals ( com.googlesource.gerrit.plugins.uploadvalidator.BlockedKeywordValidatorTest.getPatterns ( ) . get ( pattern ) . pattern ( ) , patternCache.get ( pattern ) . pattern ( ) ) ; } }

Target:
public void testLoader ( ) throws java.lang.Exception { com.google.common.cache.LoadingCache < java.lang.String , java.util.regex.Pattern > patternCache = com.google.common.cache.CacheBuilder.newBuilder ( ) . build ( new com.googlesource.gerrit.plugins.uploadvalidator.BlockedKeywordValidator.Loader ( ) ) ; for ( java.lang.String pattern : com.googlesource.gerrit.plugins.uploadvalidator.BlockedKeywordValidatorTest.getPatterns ( ) . keySet ( ) ) { com.google.common.truth.Truth.assertThat ( com.googlesource.gerrit.plugins.uploadvalidator.BlockedKeywordValidatorTest.getPatterns ( ) . get ( pattern ) . pattern ( ) ) . isEqualTo ( patternCache.get ( pattern ) . pattern ( ) ) ; } }
Source:
public void name ( java.lang.String name ) throws com.google.gerrit.extensions.restapi.RestApiException { com.google.gerrit.server.group.PutName.Input in = new com.google.gerrit.server.group.PutName.Input ( ) ; in.name = name ; try { putName.apply ( rsrc , in ) ; } catch ( com.google.gerrit.common.errors.NoSuchGroupException e ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( name , e ) ; } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( "Cannot put group name" , e ) ; } }

Target:
public void name ( java.lang.String name ) throws com.google.gerrit.extensions.restapi.RestApiException { com.google.gerrit.server.group.PutName.Input in = new com.google.gerrit.server.group.PutName.Input ( ) ; in.name = name ; try { putName.apply ( rsrc , in ) ; } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( "Cannot put group name" , e ) ; } }
Source:
public void duplicateEventOfAQueuedEventShouldGetDiscarded ( ) { org.easymock.EasyMock.reset ( poolMock ) ; poolMock.execute ( indexEventHandler.new com.ericsson.gerrit.plugins.syncindex.IndexEventHandler.SyncIndexTask ( com.ericsson.gerrit.plugins.syncindex.IndexEventHandlerTest.CHANGE_ID , false ) ) ; org.easymock.EasyMock.expectLastCall ( ) . once ( ) ; replayAll ( ) ; indexEventHandler.onChangeIndexed ( cd ) ; indexEventHandler.onChangeIndexed ( cd ) ; verifyAll ( ) ; }

Target:
public void duplicateEventOfAQueuedEventShouldGetDiscarded ( ) { org.easymock.EasyMock.reset ( poolMock ) ; poolMock.execute ( indexEventHandler.new com.ericsson.gerrit.plugins.syncindex.IndexEventHandler.SyncIndexTask ( com.ericsson.gerrit.plugins.syncindex.IndexEventHandlerTest.CHANGE_ID , false ) ) ; org.easymock.EasyMock.expectLastCall ( ) . once ( ) ; replayAll ( ) ; indexEventHandler.onChangeIndexed ( id.get ( ) ) ; indexEventHandler.onChangeIndexed ( id.get ( ) ) ; verifyAll ( ) ; }
Source:
protected java.lang.String getGerritHost ( ) { if ( ( getGerritUrl ( ) ) != null ) { try { return new java.net.URL ( getGerritUrl ( ) ) . getHost ( ) ; } catch ( java.net.MalformedURLException e ) { } } return org.eclipse.jgit.util.SystemReader.getInstance ( ) . getHostname ( ) ; }

Target:
public java.lang.String getGerritHost ( ) { if ( ( getGerritUrl ( ) ) != null ) { try { return new java.net.URL ( getGerritUrl ( ) ) . getHost ( ) ; } catch ( java.net.MalformedURLException e ) { } } return org.eclipse.jgit.util.SystemReader.getInstance ( ) . getHostname ( ) ; }
Source:
private < T > T readContentFromJson ( com.google.gerrit.acceptance.RestResponse r , java.lang.Class < T > clazz ) throws java.lang.Exception { r.assertOK ( ) ; com.google.gson.stream.JsonReader jsonReader = new com.google.gson.stream.JsonReader ( r.getReader ( ) ) ; jsonReader.setLenient ( true ) ; return newGson ( ) . fromJson ( jsonReader , clazz ) ; }

Target:
private static < T > T readContentFromJson ( com.google.gerrit.acceptance.RestResponse r , java.lang.Class < T > clazz ) throws java.lang.Exception { r.assertOK ( ) ; com.google.gson.stream.JsonReader jsonReader = new com.google.gson.stream.JsonReader ( r.getReader ( ) ) ; jsonReader.setLenient ( true ) ; return newGson ( ) . fromJson ( jsonReader , clazz ) ; }
Source:
protected void onShowView ( com.google.gerrit.client.ui.Screen view ) { final java.lang.String token = view.getToken ( ) ; if ( ! ( token.equals ( com.google.gwt.user.client.History.getToken ( ) ) ) ) { com.google.gwt.user.client.History.newItem ( token , false ) ; if ( ( com.google.gerrit.client.Gerrit.historyHooks ) != null ) { 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 ) { final java.lang.String token = view.getToken ( ) ; if ( ! ( token.equals ( com.google.gwt.user.client.History.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 ( ) ; }
Source:
private void assertApproval ( com.google.gerrit.acceptance.PushOneCommit.Result r , int expected ) throws java.lang.Exception { com.google.gerrit.extensions.common.ChangeInfo c = get ( r.getChangeId ( ) , com.google.gerrit.extensions.common.ListChangesOption.DETAILED_LABELS ) ; com.google.gerrit.extensions.common.LabelInfo cr = c.labels.get ( "Code-Review" ) ; org.junit.Assert.assertEquals ( 1 , cr.all.size ( ) ) ; org.junit.Assert.assertEquals ( "Administrator" , cr.all.get ( 0 ) . name ) ; org.junit.Assert.assertEquals ( expected , cr.all.get ( 0 ) . value.intValue ( ) ) ; }

Target:
private void assertApproval ( com.google.gerrit.acceptance.PushOneCommit.Result r , int expected ) throws java.lang.Exception { com.google.gerrit.extensions.common.ChangeInfo c = get ( r.getChangeId ( ) ) ; com.google.gerrit.extensions.common.LabelInfo cr = c.labels.get ( "Code-Review" ) ; org.junit.Assert.assertEquals ( 1 , cr.all.size ( ) ) ; org.junit.Assert.assertEquals ( "Administrator" , cr.all.get ( 0 ) . name ) ; org.junit.Assert.assertEquals ( expected , cr.all.get ( 0 ) . value.intValue ( ) ) ; }
Source:
public boolean equals ( final java.lang.Object other ) { if ( ( getClass ( ) ) == ( other.getClass ( ) ) ) { final com.google.gerrit.server.query.IntPredicate < ? > p = ( ( com.google.gerrit.server.query.IntPredicate < ? > ) ( other ) ) ; return ( com.google.gerrit.server.query.IntPredicate.getOperator ( ) . equals ( p.getOperator ( ) ) ) && ( ( intValue ( ) ) == ( p.intValue ( ) ) ) ; } return false ; }

Target:
public boolean equals ( final java.lang.Object other ) { if ( other == null ) return false ; if ( ( getClass ( ) ) == ( other.getClass ( ) ) ) { final com.google.gerrit.server.query.IntPredicate < ? > p = ( ( com.google.gerrit.server.query.IntPredicate < ? > ) ( other ) ) ; return ( com.google.gerrit.server.query.IntPredicate.getOperator ( ) . equals ( p.getOperator ( ) ) ) && ( ( intValue ( ) ) == ( p.intValue ( ) ) ) ; } return false ; }
Source:
public void getRefsHeadsText ( ) throws java.lang.Exception { setUpSimpleRefs ( ) ; com.google.gitiles.FakeHttpServletResponse res = buildText ( "/repo/+refs/heads" ) ; org.junit.Assert.assertEquals ( ( ( ( ( id ( "refs/heads/branch" ) ) + " refs/heads/branch\n" ) + ( id ( "refs/heads/master" ) ) ) + " refs/heads/master\n" ) , res.getActualBodyString ( ) ) ; }

Target:
public void getRefsHeadsText ( ) throws java.lang.Exception { setUpSimpleRefs ( ) ; com.google.gitiles.FakeHttpServletResponse res = buildText ( "/repo/+refs/heads" ) ; com.google.common.truth.Truth.assertThat ( res.getActualBodyString ( ) ) . isEqualTo ( ( ( ( ( id ( "refs/heads/branch" ) ) + " refs/heads/branch\n" ) + ( id ( "refs/heads/master" ) ) ) + " refs/heads/master\n" ) ) ; }
Source:
public static org.eclipse.jgit.revwalk.RevCommit makeCommit ( org.eclipse.jgit.dircache.DirCacheEntry [ ] entries , org.eclipse.jgit.junit.TestRepository < org.eclipse.jgit.lib.Repository > repo , org.eclipse.jgit.revwalk.RevCommit ... parents ) throws java.lang.Exception { final org.eclipse.jgit.revwalk.RevTree ta = repo.tree ( entries ) ; org.eclipse.jgit.revwalk.RevCommit c = ( parents == null ) ? repo.commit ( ta ) : repo.commit ( ta , parents ) ; repo.parseBody ( c ) ; return c ; }

Target:
public static org.eclipse.jgit.revwalk.RevCommit makeCommit ( org.eclipse.jgit.revwalk.RevWalk rw , org.eclipse.jgit.dircache.DirCacheEntry [ ] entries , org.eclipse.jgit.junit.TestRepository < org.eclipse.jgit.lib.Repository > repo , org.eclipse.jgit.revwalk.RevCommit ... parents ) throws java.lang.Exception { final org.eclipse.jgit.revwalk.RevTree ta = repo.tree ( entries ) ; org.eclipse.jgit.revwalk.RevCommit c = ( parents == null ) ? repo.commit ( ta ) : repo.commit ( ta , parents ) ; repo.parseBody ( c ) ; return rw.parseCommit ( c ) ; }
Source:
public java.lang.String getString ( java.lang.String name , java.lang.String defaultValue ) { return com.google.common.base.Objects.firstNonNull ( cfg.getString ( com.google.gerrit.server.config.PluginConfig.PLUGIN , pluginName , name ) , defaultValue ) ; }

Target:
public java.lang.String getString ( java.lang.String name , java.lang.String defaultValue ) { if ( defaultValue == null ) { return cfg.getString ( com.google.gerrit.server.config.PluginConfig.PLUGIN , pluginName , name ) ; } else { return com.google.common.base.Objects.firstNonNull ( cfg.getString ( com.google.gerrit.server.config.PluginConfig.PLUGIN , pluginName , name ) , defaultValue ) ; } }
Source:
private static boolean isTrusted ( final com.google.gerrit.client.reviewdb.AccountExternalId id , final java.util.Collection < com.google.gerrit.client.reviewdb.TrustedExternalId > trusted ) { if ( id.getExternalId ( ) . startsWith ( "Google Account " ) ) { return true ; } if ( id.getExternalId ( ) . startsWith ( "mailto:" ) ) { return true ; } for ( final com.google.gerrit.client.reviewdb.TrustedExternalId t : trusted ) { if ( t.matches ( id ) ) { return true ; } } return false ; }

Target:
public static boolean isTrusted ( final com.google.gerrit.client.reviewdb.AccountExternalId id , final java.util.Collection < com.google.gerrit.client.reviewdb.TrustedExternalId > trusted ) { if ( id.getExternalId ( ) . startsWith ( "Google Account " ) ) { return true ; } if ( id.getExternalId ( ) . startsWith ( "mailto:" ) ) { return true ; } for ( final com.google.gerrit.client.reviewdb.TrustedExternalId t : trusted ) { if ( t.matches ( id ) ) { return true ; } } return false ; }
Source:
private boolean requestRegistration ( final org.openid4java.message.AuthRequest aReq ) { if ( AuthRequest.SELECT_ID.equals ( aReq.getIdentity ( ) ) ) { return true ; } try { return accountManager.exists ( aReq.getIdentity ( ) ) ; } catch ( com.google.gerrit.server.account.AccountException e ) { com.google.gerrit.server.openid.OpenIdServiceImpl.log.warn ( "Cannot determine if user account exists" , e ) ; return true ; } }

Target:
private boolean requestRegistration ( final org.openid4java.message.AuthRequest aReq ) { if ( AuthRequest.SELECT_ID.equals ( aReq.getIdentity ( ) ) ) { return true ; } try { return ! ( accountManager.exists ( aReq.getIdentity ( ) ) ) ; } catch ( com.google.gerrit.server.account.AccountException e ) { com.google.gerrit.server.openid.OpenIdServiceImpl.log.warn ( "Cannot determine if user account exists" , e ) ; return true ; } }
Source:
public void taggedTagTime ( ) throws java.lang.Exception { repo.tick ( 2 ) ; org.eclipse.jgit.revwalk.RevTag tag = repo.tag ( "tag" , repo.commit ( ) . create ( ) ) ; repo.tick ( ( - 1 ) ) ; org.eclipse.jgit.revwalk.RevTag tagTag = repo.tag ( "tagtag" , tag ) ; org.junit.Assert.assertEquals ( ( ( start ) + 3 ) , getTime ( tag ) ) ; org.junit.Assert.assertEquals ( ( ( start ) + 2 ) , getTime ( tagTag ) ) ; }

Target:
public void taggedTagTime ( ) throws java.lang.Exception { repo.tick ( 2 ) ; org.eclipse.jgit.revwalk.RevTag tag = repo.tag ( "tag" , repo.commit ( ) . create ( ) ) ; repo.tick ( ( - 1 ) ) ; org.eclipse.jgit.revwalk.RevTag tagTag = repo.tag ( "tagtag" , tag ) ; com.google.common.truth.Truth.assertThat ( getTime ( tag ) ) . isEqualTo ( ( ( start ) + 3 ) ) ; com.google.common.truth.Truth.assertThat ( getTime ( tagTag ) ) . isEqualTo ( ( ( start ) + 2 ) ) ; }
Source:
public void testFindConflictingSubtree ( ) throws java.lang.Exception { changedPaths = com.google.common.collect.Sets.newHashSet ( "F1/a" ) ; runCheck ( com.googlesource.gerrit.plugins.uploadvalidator.DuplicatePathnameValidatorTest.INITIAL_PATHNAMES , changedPaths , messages , vistedPaths ) ; com.google.common.truth.Truth.assertThat ( com.googlesource.gerrit.plugins.uploadvalidator.TestUtils.transformMessages ( messages ) ) . containsExactly ( com.googlesource.gerrit.plugins.uploadvalidator.TestUtils.transformMessage ( com.googlesource.gerrit.plugins.uploadvalidator.DuplicatePathnameValidator.conflict ( "F1" , "f1" ) ) ) ; com.google.common.truth.Truth.assertThat ( vistedPaths ) . containsExactlyElementsIn ( com.google.common.collect.ImmutableList.of ( "a" , "ab" , "f1" , "f2" ) ) ; }

Target:
public void testFindConflictingSubtree ( ) throws java.lang.Exception { changedPaths = com.google.common.collect.Sets.newHashSet ( "F1/a" ) ; runCheck ( com.googlesource.gerrit.plugins.uploadvalidator.DuplicatePathnameValidatorTest.INITIAL_PATHNAMES , changedPaths , messages , vistedPaths ) ; com.google.common.truth.Truth.assertThat ( com.googlesource.gerrit.plugins.uploadvalidator.TestUtils.transformMessages ( messages ) ) . containsExactly ( com.googlesource.gerrit.plugins.uploadvalidator.TestUtils.transformMessage ( com.googlesource.gerrit.plugins.uploadvalidator.DuplicatePathnameValidator.conflict ( "F1" , "f1" ) ) ) ; com.google.common.truth.Truth.assertThat ( vistedPaths ) . containsExactly ( "a" , "ab" , "f1" , "f2" ) ; }
Source:
public boolean dbExists ( ) throws java.sql.SQLException { java.sql.Connection conn = null ; java.sql.ResultSet tables = null ; try { conn = ds.getConnection ( ) ; tables = conn.getMetaData ( ) . getTables ( null , null , com.ericsson.gerrit.plugins.eventslog.sql.SQLTable.TABLE_NAME.toUpperCase ( ) , null ) ; return tables.next ( ) ; } finally { closeResultSet ( tables ) ; closeConnection ( conn ) ; } }

Target:
public 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 ( ) ; } }
Source:
public com.google.gerrit.server.notedb.ChangeNotes call ( ) throws java.lang.Exception { 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 call ( ) throws java.lang.Exception { 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 , false , null ) . load ( ) ; }
Source:
public com.google.gerrit.server.project.ChangeControl controlFor ( com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.server.CurrentUser user ) throws com.google.gerrit.server.project.NoSuchChangeException { final com.google.gerrit.reviewdb.client.Project.NameKey projectKey = change.getProject ( ) ; try { return projectControl.controlFor ( projectKey , user ) . controlFor ( change ) ; } catch ( com.google.gerrit.server.project.NoSuchProjectException e ) { throw new com.google.gerrit.server.project.NoSuchChangeException ( change.getId ( ) , e ) ; } catch ( java.io.IOException e ) { throw new com.google.gerrit.server.project.NoSuchChangeException ( change.getId ( ) , e ) ; } }

Target:
public com.google.gerrit.server.project.ChangeControl controlFor ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.server.CurrentUser user ) throws com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException { final com.google.gerrit.reviewdb.client.Project.NameKey projectKey = change.getProject ( ) ; try { return projectControl.controlFor ( projectKey , user ) . controlFor ( db , change ) ; } catch ( com.google.gerrit.server.project.NoSuchProjectException e ) { throw new com.google.gerrit.server.project.NoSuchChangeException ( change.getId ( ) , e ) ; } catch ( java.io.IOException e ) { throw new com.google.gerrit.server.project.NoSuchChangeException ( change.getId ( ) , e ) ; } }
Source:
public static int findApproval ( com.googlecode.prolog_cafe.lang.Prolog engine , int minVoteLevel ) { try { com.google.gerrit.server.account.AccountCache accountCache = StoredValues.ACCOUNT_CACHE.get ( engine ) ; com.google.gerrit.server.account.Emails emails = StoredValues.EMAILS.get ( engine ) ; com.google.gerrit.server.query.change.ChangeData changeData = StoredValues.CHANGE_DATA.get ( engine ) ; org.eclipse.jgit.lib.Repository repository = StoredValues.REPOSITORY.get ( engine ) ; return new com.googlesource.gerrit.plugins.findowners.Checker ( repository , changeData , minVoteLevel ) . findApproval ( accountCache , emails ) ; } catch ( com.google.gwtorm.server.OrmException e ) { com.googlesource.gerrit.plugins.findowners.Checker.log.error ( "Exception" , e ) ; return 0 ; } }

Target:
public static int findApproval ( com.googlecode.prolog_cafe.lang.Prolog engine , int minVoteLevel ) { try { com.google.gerrit.server.account.AccountCache accountCache = StoredValues.ACCOUNT_CACHE.get ( engine ) ; com.google.gerrit.server.account.Emails emails = StoredValues.EMAILS.get ( engine ) ; com.google.gerrit.server.query.change.ChangeData changeData = StoredValues.CHANGE_DATA.get ( engine ) ; org.eclipse.jgit.lib.Repository repository = StoredValues.REPOSITORY.get ( engine ) ; return new com.googlesource.gerrit.plugins.findowners.Checker ( repository , changeData , minVoteLevel ) . findApproval ( accountCache , emails ) ; } catch ( com.google.gwtorm.server.OrmException | java.io.IOException e ) { com.googlesource.gerrit.plugins.findowners.Checker.log.error ( "Exception" , e ) ; return 0 ; } }
Source:
public void visit ( int version , int access , java.lang.String name , java.lang.String signature , java.lang.String superName , java.lang.String [ ] interfaces ) { this . className = org.objectweb.asm.Type.getObjectType ( name ) . getClassName ( ) ; this . access = access ; }

Target:
public void visit ( int version , int access , java.lang.String name , java.lang.String signature , java.lang.String superName , java.lang.String [ ] interfaces ) { this . className = org.objectweb.asm.Type.getObjectType ( name ) . getClassName ( ) ; this . access = access ; this . interfaces = interfaces ; }