auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void submitOnPushMergeConflict ( ) throws java.lang.Exception { org.eclipse.jgit.lib.ObjectId objectId = repo ( ) . getRef ( "HEAD" ) . getObjectId ( ) ; push ( "refs/heads/master" , "one change" , "a.txt" , "some content" ) ; testRepo.reset ( objectId ) ; grant ( Permission.SUBMIT , project , "refs/for/refs/heads/master" ) ; com.google.gerrit.acceptance.PushOneCommit.Result r = push ( "refs/for/master%submit" , "other change" , "a.txt" , "other content" ) ; r.assertErrorStatus ( ) ; r.assertChange ( Change.Status.NEW , null , admin ) ; r.assertMessage ( CommitMergeStatus.PATH_CONFLICT.getMessage ( ) ) ; }

Target:
public void submitOnPushMergeConflict ( ) throws java.lang.Exception { org.eclipse.jgit.lib.ObjectId objectId = repo ( ) . getRef ( "HEAD" ) . getObjectId ( ) ; push ( "refs/heads/master" , "one change" , "a.txt" , "some content" ) ; testRepo.reset ( objectId ) ; grant ( Permission.SUBMIT , project , "refs/for/refs/heads/master" ) ; com.google.gerrit.acceptance.PushOneCommit.Result r = push ( "refs/for/master%submit" , "other change" , "a.txt" , "other content" ) ; r.assertErrorStatus ( ) ; r.assertChange ( Change.Status.NEW , null ) ; r.assertMessage ( CommitMergeStatus.PATH_CONFLICT.getMessage ( ) ) ; }
Source:
public void setNonExistingParent_UnprocessibleEntity ( ) throws java.lang.Exception { com.google.gerrit.acceptance.RestResponse r = adminSession.put ( ( ( "/projects/" + ( project.get ( ) ) ) + "/parent" ) , newParentInput ( "non-existing" ) ) ; org.junit.Assert.assertEquals ( HttpStatus.SC_UNPROCESSABLE_ENTITY , r.getStatusCode ( ) ) ; r.consume ( ) ; }

Target:
public void setNonExistingParent_UnprocessibleEntity ( ) throws java.lang.Exception { com.google.gerrit.acceptance.RestResponse r = adminSession.put ( ( ( "/projects/" + ( project.get ( ) ) ) + "/parent" ) , newParentInput ( "non-existing" ) ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( HttpStatus.SC_UNPROCESSABLE_ENTITY ) ; r.consume ( ) ; }
Source:
public int compareTo ( com.google.gerrit.common.data.Permission b ) { int cmp = ( com.google.gerrit.common.data.Permission.index ( this ) ) - ( com.google.gerrit.common.data.Permission.index ( b ) ) ; if ( cmp == 0 ) getName ( ) . compareTo ( b.getName ( ) ) ; return cmp ; }

Target:
public int compareTo ( com.google.gerrit.common.data.Permission b ) { int cmp = ( com.google.gerrit.common.data.Permission.index ( this ) ) - ( com.google.gerrit.common.data.Permission.index ( b ) ) ; if ( cmp == 0 ) { cmp = getName ( ) . compareTo ( b.getName ( ) ) ; } return cmp ; }
Source:
public int compare ( com.google.gerrit.reviewdb.client.PatchLineComment c1 , com.google.gerrit.reviewdb.client.PatchLineComment c2 ) { java.lang.String filename1 = c1.getKey ( ) . getParentKey ( ) . get ( ) ; java.lang.String filename2 = c2.getKey ( ) . getParentKey ( ) . get ( ) ; return com.google.common.collect.ComparisonChain.start ( ) . compare ( c1.getLine ( ) , c2.getLine ( ) ) . compare ( filename1 , filename2 ) . compare ( c1.getWrittenOn ( ) , c2.getWrittenOn ( ) ) . result ( ) ; }

Target:
public int compare ( com.google.gerrit.reviewdb.client.PatchLineComment c1 , com.google.gerrit.reviewdb.client.PatchLineComment c2 ) { java.lang.String filename1 = c1.getKey ( ) . getParentKey ( ) . get ( ) ; java.lang.String filename2 = c2.getKey ( ) . getParentKey ( ) . get ( ) ; return com.google.common.collect.ComparisonChain.start ( ) . compare ( filename1 , filename2 ) . compare ( c1.getLine ( ) , c2.getLine ( ) ) . compare ( c1.getWrittenOn ( ) , c2.getWrittenOn ( ) ) . result ( ) ; }
Source:
Account.Id getAccountId ( ) { com.google.gerrit.reviewdb.client.Account.Id id = get ( 0 ) . who ; for ( int i = 1 ; i < ( size ( ) ) ; i ++ ) { com.google.common.base.Preconditions.checkState ( java.util.Objects.equals ( id , get ( i ) . who ) , "mismatched users in EventList: %s != %s" , id , get ( i ) . who ) ; } return id ; }

Target:
Account.Id getAccountId ( ) { com.google.gerrit.reviewdb.client.Account.Id id = get ( 0 ) . user ; for ( int i = 1 ; i < ( size ( ) ) ; i ++ ) { com.google.common.base.Preconditions.checkState ( java.util.Objects.equals ( id , get ( i ) . user ) , "mismatched users in EventList: %s != %s" , id , get ( i ) . user ) ; } return id ; }
Source:
public java.util.Set < java.lang.String > reviewed ( ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return com.google.common.collect.ImmutableSet.copyOf ( ( ( java.lang.Iterable < java.lang.String > ) ( listFiles.get ( ) . setReviewed ( true ) . apply ( revision ) . value ( ) ) ) ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot list reviewed files" , e ) ; } }

Target:
public java.util.Set < java.lang.String > reviewed ( ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return com.google.common.collect.ImmutableSet.copyOf ( ( ( java.lang.Iterable < java.lang.String > ) ( listFiles.get ( ) . setReviewed ( true ) . apply ( revision ) . value ( ) ) ) ) ; } catch ( com.google.gwtorm.server.OrmException | java.io.IOException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot list reviewed files" , e ) ; } }
Source:
public java.lang.Object createEntry ( final java.lang.Object objKey ) throws java.lang.Exception { try { final java.util.List < ? > list = manager.discover ( ( ( java.lang.String ) ( objKey ) ) ) ; return ( list != null ) && ( ! ( list.isEmpty ( ) ) ) ? list : null ; } catch ( org.openid4java.discovery.DiscoveryException e ) { return null ; } }

Target:
protected java.util.List createEntry ( final java.lang.String url ) throws java.lang.Exception { try { final java.util.List < ? > list = manager.discover ( url ) ; return ( list != null ) && ( ! ( list.isEmpty ( ) ) ) ? list : null ; } catch ( org.openid4java.discovery.DiscoveryException e ) { return null ; } }
Source:
public Project.NameKey getParentName ( ) { if ( ( project.getParent ( ) ) != null ) { return project.getParent ( ) ; } if ( project.getNameKey ( ) . equals ( allProjectsName ) ) { return null ; } return allProjectsName ; }

Target:
public Project.NameKey getParentName ( ) { return project.getParent ( allProjectsName ) ; }
Source:
protected void configure ( ) { factory ( AgreementInfoFactory.Factory.class ) ; factory ( CreateGroup.Factory.class ) ; factory ( DeleteExternalIds.Factory.class ) ; factory ( ExternalIdDetailFactory.Factory.class ) ; factory ( GroupDetailHandler.Factory.class ) ; factory ( MyGroupsFactory.Factory.class ) ; factory ( RegisterNewEmailSender.Factory.class ) ; factory ( RenameGroup.Factory.class ) ; factory ( VisibleGroupsHandler.Factory.class ) ; }

Target:
protected void configure ( ) { factory ( AgreementInfoFactory.Factory.class ) ; factory ( CreateGroup.Factory.class ) ; factory ( DeleteExternalIds.Factory.class ) ; factory ( ExternalIdDetailFactory.Factory.class ) ; factory ( GroupDetailHandler.Factory.class ) ; factory ( RegisterNewEmailSender.Factory.class ) ; factory ( RenameGroup.Factory.class ) ; }
Source:
private com.google.inject.Injector createSshInjector ( ) { final java.util.List < com.google.inject.Module > modules = new java.util.ArrayList < com.google.inject.Module > ( ) ; modules.add ( new com.google.gerrit.sshd.SshModule ( ) ) ; modules.add ( new com.google.gerrit.sshd.commands.MasterCommandModule ( ) ) ; modules.add ( new com.google.gerrit.server.config.GerritMasterLifecycle ( ) ) ; return sysInjector.createChildInjector ( modules ) ; }

Target:
private com.google.inject.Injector createSshInjector ( ) { final java.util.List < com.google.inject.Module > modules = new java.util.ArrayList < com.google.inject.Module > ( ) ; modules.add ( new com.google.gerrit.sshd.SshModule ( ) ) ; modules.add ( new com.google.gerrit.sshd.commands.MasterCommandModule ( ) ) ; return sysInjector.createChildInjector ( modules ) ; }
Source:
public void starChange ( java.lang.String id ) throws com.google.gerrit.extensions.restapi.RestApiException { try { com.google.gerrit.server.change.ChangeResource rsrc = changes.parse ( TopLevelResource.INSTANCE , com.google.gerrit.extensions.restapi.IdString.fromUrl ( id ) ) ; starredChangesCreate.setChange ( rsrc ) ; starredChangesCreate.apply ( account , new com.google.gerrit.server.account.StarredChanges.EmptyInput ( ) ) ; } catch ( com.google.gwtorm.server.OrmException | java.io.IOException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot star change" , e ) ; } }

Target:
public void starChange ( java.lang.String changeId ) throws com.google.gerrit.extensions.restapi.RestApiException { try { com.google.gerrit.server.change.ChangeResource rsrc = changes.parse ( TopLevelResource.INSTANCE , com.google.gerrit.extensions.restapi.IdString.fromUrl ( changeId ) ) ; starredChangesCreate.setChange ( rsrc ) ; starredChangesCreate.apply ( account , new com.google.gerrit.server.account.StarredChanges.EmptyInput ( ) ) ; } catch ( com.google.gwtorm.server.OrmException | java.io.IOException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot star change" , e ) ; } }
Source:
public void testHtmlInFind ( ) { java.lang.String rawFind = "<b>&quot;bold&quot;</b>" ; com.google.gwtexpui.safehtml.client.LinkFindReplace a = new com.google.gwtexpui.safehtml.client.LinkFindReplace ( rawFind , "/bold" ) ; assertEquals ( rawFind , a.pattern ( ) . getSource ( ) ) ; assertEquals ( ( ( "<a href=\"/bold\">" + rawFind ) + "</a>" ) , a.replace ( rawFind ) ) ; }

Target:
public void testHtmlInFind ( ) { java.lang.String rawFind = "<b>&quot;bold&quot;</b>" ; com.google.gwtexpui.safehtml.client.LinkFindReplace a = new com.google.gwtexpui.safehtml.client.LinkFindReplace ( rawFind , "/bold" ) ; org.junit.Assert.assertEquals ( rawFind , a.pattern ( ) . getSource ( ) ) ; org.junit.Assert.assertEquals ( ( ( "<a href=\"/bold\">" + rawFind ) + "</a>" ) , a.replace ( rawFind ) ) ; }
Source:
private java.nio.file.FileSystem getDistributionArchive ( ) throws java.io.IOException { java.io.File war ; try { war = com.google.gerrit.launcher.GerritLauncher.getDistributionArchive ( ) ; } catch ( java.io.IOException e ) { if ( ( e instanceof java.io.FileNotFoundException ) && ( GerritLauncher.NOT_ARCHIVED.equals ( e.getMessage ( ) ) ) ) { return null ; } else { com.google.inject.ProvisionException pe = new com.google.inject.ProvisionException ( "Error reading gerrit.war" ) ; pe.initCause ( e ) ; throw pe ; } } return com.google.gerrit.launcher.GerritLauncher.getZipFileSystem ( war.toPath ( ) ) ; }

Target:
private java.nio.file.FileSystem getDistributionArchive ( java.io.File war ) throws java.io.IOException { if ( war == null ) { return null ; } return com.google.gerrit.launcher.GerritLauncher.getZipFileSystem ( war.toPath ( ) ) ; }
Source:
private void initBranchLink ( com.google.gerrit.client.changes.ChangeInfo info ) { branchLink.setText ( info.branch ( ) ) ; branchLink.setTargetHistoryToken ( com.google.gerrit.common.PageLinks.toChangeQuery ( com.google.gerrit.client.ui.BranchLink.query ( info.project_name_key ( ) , info.status ( ) , info.branch ( ) , info.topic ( ) ) ) ) ; }

Target:
private void initBranchLink ( com.google.gerrit.client.changes.ChangeInfo info ) { branchLink.setText ( info.branch ( ) ) ; branchLink.setTargetHistoryToken ( com.google.gerrit.common.PageLinks.toChangeQuery ( com.google.gerrit.client.ui.BranchLink.query ( info.project_name_key ( ) , info.status ( ) , info.branch ( ) , null ) ) ) ; }
Source:
public void run ( ) { cmA.setHeight ( height ) ; cmB.setHeight ( height ) ; cmA.refresh ( ) ; cmB.refresh ( ) ; cmB.setCursor ( net.codemirror.lib.LineCharacter.create ( 0 ) ) ; cmB.focus ( ) ; }

Target:
public void run ( ) { cmA.setHeight ( height ) ; cmB.setHeight ( height ) ; cmA.refresh ( ) ; cmB.refresh ( ) ; }
Source:
private static org.apache.lucene.search.Query notTimestampQuery ( com.google.gerrit.server.index.TimestampRangePredicate < com.google.gerrit.server.query.change.ChangeData > r ) throws com.google.gerrit.server.query.QueryParseException { if ( ( r.getMinTimestamp ( ) . getTime ( ) ) == 0 ) { return org.apache.lucene.search.NumericRangeQuery.newIntRange ( r.getField ( ) . getName ( ) , com.google.gerrit.lucene.LuceneChangeIndex.toIndexTime ( r.getMaxTimestamp ( ) ) , java.lang.Integer.MAX_VALUE , true , true ) ; } throw new com.google.gerrit.server.query.QueryParseException ( ( "cannot negate: " + r ) ) ; }

Target:
private static org.apache.lucene.search.Query notTimestampQuery ( com.google.gerrit.server.index.TimestampRangePredicate < com.google.gerrit.server.query.change.ChangeData > r ) throws com.google.gerrit.server.query.QueryParseException { if ( ( r.getMinTimestamp ( ) . getTime ( ) ) == 0 ) { return org.apache.lucene.search.NumericRangeQuery.newIntRange ( r.getField ( ) . getName ( ) , com.google.gerrit.lucene.LuceneChangeIndex.toIndexTime ( r.getMaxTimestamp ( ) ) , null , true , true ) ; } throw new com.google.gerrit.server.query.QueryParseException ( ( "cannot negate: " + r ) ) ; }
Source:
public com.google.gerrit.extensions.common.ChangeInfo get ( java.util.EnumSet < com.google.gerrit.extensions.common.ListChangesOption > s ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return ChangeInfoMapper.INSTANCE.apply ( changeJson.addOptions ( s ) . format ( change ) ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot retrieve change" , e ) ; } }

Target:
public com.google.gerrit.extensions.common.ChangeInfo get ( java.util.EnumSet < com.google.gerrit.extensions.common.ListChangesOption > s ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return ChangeInfoMapper.INSTANCE.apply ( changeJson.get ( ) . addOptions ( s ) . format ( change ) ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot retrieve change" , e ) ; } }
Source:
public void addPatchSets ( com.google.gerrit.server.data.ChangeAttribute ca , java.util.Collection < com.google.gerrit.reviewdb.client.PatchSet > ps , java.util.Map < com.google.gerrit.reviewdb.client.PatchSet.Id , java.util.Collection < com.google.gerrit.reviewdb.client.PatchSetApproval > > approvals , com.google.gerrit.common.data.LabelTypes labelTypes ) { addPatchSets ( ca , ps , approvals , false , null , labelTypes ) ; }

Target:
public void addPatchSets ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.data.ChangeAttribute ca , java.util.Collection < com.google.gerrit.reviewdb.client.PatchSet > ps , java.util.Map < com.google.gerrit.reviewdb.client.PatchSet.Id , java.util.Collection < com.google.gerrit.reviewdb.client.PatchSetApproval > > approvals , com.google.gerrit.common.data.LabelTypes labelTypes ) { addPatchSets ( db , ca , ps , approvals , false , null , labelTypes ) ; }
Source:
public static void replyError ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse res , int statusCode , java.lang.String msg , com.google.gerrit.extensions.restapi.CacheControl c ) throws java.io.IOException { res.setStatus ( statusCode ) ; com.google.gerrit.httpd.restapi.RestApiServlet.configureCaching ( req , res , c ) ; com.google.gerrit.httpd.restapi.RestApiServlet.replyText ( null , res , msg ) ; }

Target:
public static void replyError ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse res , int statusCode , java.lang.String msg , com.google.gerrit.extensions.restapi.CacheControl c ) throws java.io.IOException { res.setStatus ( statusCode ) ; com.google.gerrit.httpd.restapi.RestApiServlet.configureCaching ( req , res , null , c ) ; com.google.gerrit.httpd.restapi.RestApiServlet.replyText ( null , res , msg ) ; }
Source:
private java.util.List < com.google.gerrit.extensions.common.AccountInfo > GET ( java.lang.String endpoint ) throws java.io.IOException { com.google.gerrit.acceptance.RestResponse r = adminSession.get ( endpoint ) ; org.junit.Assert.assertEquals ( HttpStatus.SC_OK , r.getStatusCode ( ) ) ; return newGson ( ) . fromJson ( r.getReader ( ) , new com.google.gson.reflect.TypeToken < java.util.List < com.google.gerrit.extensions.common.AccountInfo > > ( ) { } . getType ( ) ) ; }

Target:
private java.util.List < com.google.gerrit.extensions.common.AccountInfo > GET ( java.lang.String endpoint ) throws java.io.IOException { com.google.gerrit.acceptance.RestResponse r = adminSession.get ( endpoint ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( HttpStatus.SC_OK ) ; return newGson ( ) . fromJson ( r.getReader ( ) , new com.google.gson.reflect.TypeToken < java.util.List < com.google.gerrit.extensions.common.AccountInfo > > ( ) { } . getType ( ) ) ; }
Source:
public void stop ( ) { if ( ( scanner ) != null ) { scanner.end ( ) ; } srvInfoImpl.state = ServerInformation.State.SHUTDOWN ; synchronized ( this ) { for ( com.google.gerrit.server.plugins.Plugin p : running.values ( ) ) { p.stop ( ) ; } running.clear ( ) ; disabled.clear ( ) ; broken.clear ( ) ; if ( ( cleanupHandles.size ( ) ) > ( running.size ( ) ) ) { java.lang.System.gc ( ) ; processPendingCleanups ( ) ; } } }

Target:
public com.google.gerrit.server.plugins.Plugin get ( java.lang.String name ) { com.google.gerrit.server.plugins.Plugin p = running.get ( name ) ; if ( p != null ) { return p ; } return disabled.get ( name ) ; }
Source:
public com.google.gerrit.extensions.api.changes.IncludedInInfo apply ( com.google.gerrit.server.project.CommitResource rsrc ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gwtorm.server.OrmException , java.io.IOException { org.eclipse.jgit.revwalk.RevCommit commit = rsrc.getCommit ( ) ; com.google.gerrit.reviewdb.client.Project.NameKey project = rsrc.getProjectState ( ) . getProject ( ) . getNameKey ( ) ; return includedIn.apply ( project , commit.getId ( ) . getName ( ) ) ; }

Target:
public com.google.gerrit.extensions.api.changes.IncludedInInfo apply ( com.google.gerrit.server.project.CommitResource rsrc ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gwtorm.server.OrmException , java.io.IOException { org.eclipse.jgit.revwalk.RevCommit commit = rsrc.getCommit ( ) ; com.google.gerrit.reviewdb.client.Project.NameKey project = rsrc.getProjectState ( ) . getNameKey ( ) ; return includedIn.apply ( project , commit.getId ( ) . getName ( ) ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { org.mockito.Mockito.when ( config.getUrl ( ) ) . thenReturn ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpClientProviderTest.EMPTY ) ; org.mockito.Mockito.when ( config.getUser ( ) ) . thenReturn ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpClientProviderTest.EMPTY ) ; org.mockito.Mockito.when ( config.getPassword ( ) ) . thenReturn ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpClientProviderTest.EMPTY ) ; org.mockito.Mockito.when ( config.getConnectionTimeout ( ) ) . thenReturn ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpClientProviderTest.TIME_INTERVAL ) ; org.mockito.Mockito.when ( config.getSocketTimeout ( ) ) . thenReturn ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpClientProviderTest.TIME_INTERVAL ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { org.mockito.Mockito.when ( config.getUser ( ) ) . thenReturn ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpClientProviderTest.EMPTY ) ; org.mockito.Mockito.when ( config.getPassword ( ) ) . thenReturn ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpClientProviderTest.EMPTY ) ; org.mockito.Mockito.when ( config.getConnectionTimeout ( ) ) . thenReturn ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpClientProviderTest.TIME_INTERVAL ) ; org.mockito.Mockito.when ( config.getSocketTimeout ( ) ) . thenReturn ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpClientProviderTest.TIME_INTERVAL ) ; }
Source:
public static com.google.gerrit.reviewdb.server.ReviewDb unwrapDb ( com.google.gerrit.reviewdb.server.ReviewDb db ) { if ( db instanceof com.google.gerrit.reviewdb.server.DisallowReadFromChangesReviewDbWrapper ) { return com.google.gerrit.reviewdb.server.ReviewDbUtil.unwrapDb ( ( ( com.google.gerrit.reviewdb.server.DisallowReadFromChangesReviewDbWrapper ) ( db ) ) . unsafeGetDelegate ( ) ) ; } if ( db instanceof com.google.gerrit.reviewdb.server.DisallowReadFromGroupsReviewDbWrapper ) { return com.google.gerrit.reviewdb.server.ReviewDbUtil.unwrapDb ( ( ( com.google.gerrit.reviewdb.server.DisallowReadFromGroupsReviewDbWrapper ) ( db ) ) . unsafeGetDelegate ( ) ) ; } return db ; }

Target:
public static com.google.gerrit.reviewdb.server.ReviewDb unwrapDb ( com.google.gerrit.reviewdb.server.ReviewDb db ) { if ( db instanceof com.google.gerrit.reviewdb.server.DisallowReadFromChangesReviewDbWrapper ) { return com.google.gerrit.reviewdb.server.ReviewDbUtil.unwrapDb ( ( ( com.google.gerrit.reviewdb.server.DisallowReadFromChangesReviewDbWrapper ) ( db ) ) . unsafeGetDelegate ( ) ) ; } return db ; }
Source:
private void addExtensionPoints ( com.google.gerrit.client.info.ChangeInfo change , com.google.gerrit.client.info.ChangeInfo.RevisionInfo rev ) { addExtensionPoint ( GerritUiExtensionPoint.CHANGE_SCREEN_HEADER , headerExtension , change , rev ) ; addExtensionPoint ( GerritUiExtensionPoint.CHANGE_SCREEN_HEADER_RIGHT_OF_BUTTONS , headerExtensionMiddle , change , rev ) ; addExtensionPoint ( GerritUiExtensionPoint.CHANGE_SCREEN_HEADER_RIGHT_OF_POP_DOWNS , headerExtensionRight , change , rev ) ; addExtensionPoint ( GerritUiExtensionPoint.CHANGE_SCREEN_BELOW_CHANGE_INFO_BLOCK , changeExtension , change , rev ) ; }

Target:
private void addExtensionPoints ( com.google.gerrit.client.info.ChangeInfo change ) { addExtensionPoint ( GerritUiExtensionPoint.CHANGE_SCREEN_HEADER , headerExtension , change ) ; addExtensionPoint ( GerritUiExtensionPoint.CHANGE_SCREEN_HEADER_RIGHT_OF_BUTTONS , headerExtensionMiddle , change ) ; addExtensionPoint ( GerritUiExtensionPoint.CHANGE_SCREEN_HEADER_RIGHT_OF_POP_DOWNS , headerExtensionRight , change ) ; addExtensionPoint ( GerritUiExtensionPoint.CHANGE_SCREEN_BELOW_CHANGE_INFO_BLOCK , changeExtension , change ) ; }
Source:
public void testNameValue ( ) { final java.lang.String name = "author" ; final java.lang.String value = "alice" ; final com.google.gerrit.server.query.OperatorPredicate < java.lang.String > f = com.google.gerrit.server.query.FieldPredicateTest.f ( name , value ) ; assertSame ( name , f.getOperator ( ) ) ; assertSame ( value , f.getValue ( ) ) ; assertEquals ( 0 , f.getChildren ( ) . size ( ) ) ; }

Target:
public void testNameValue ( ) { final java.lang.String name = "author" ; final java.lang.String value = "alice" ; final com.google.gerrit.server.query.OperatorPredicate < java.lang.String > f = com.google.gerrit.server.query.FieldPredicateTest.f ( name , value ) ; org.junit.Assert.assertSame ( name , f.getOperator ( ) ) ; org.junit.Assert.assertSame ( value , f.getValue ( ) ) ; org.junit.Assert.assertEquals ( 0 , f.getChildren ( ) . size ( ) ) ; }
Source:
protected void service ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse res ) throws java.io.IOException , javax.servlet.ServletException { if ( ( filter ) == null ) { com.google.gwtexpui.server.CacheHeaders.setNotCacheable ( res ) ; res.sendError ( javax.servlet.http.HttpServletResponse.SC_NOT_IMPLEMENTED ) ; return ; } filter.doFilter ( req , res , chain ) ; }

Target:
protected void service ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse res ) throws java.io.IOException , javax.servlet.ServletException { if ( ( filter.get ( ) ) == null ) { com.google.gwtexpui.server.CacheHeaders.setNotCacheable ( res ) ; res.sendError ( javax.servlet.http.HttpServletResponse.SC_NOT_IMPLEMENTED ) ; return ; } filter.get ( ) . doFilter ( req , res , chain ) ; }
Source:
public java.util.List < java.lang.String > lookup ( com.google.gerrit.reviewdb.client.PatchSet.Id psId ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.Change c = db.changes ( ) . get ( psId.getParentKey ( ) ) ; if ( c == null ) { return null ; } com.google.gerrit.server.notedb.ChangeNotes notes = notesFactory.create ( c ) ; com.google.gerrit.reviewdb.client.PatchSet ps = psUtil.get ( db , notes , psId ) ; return ps != null ? ps.getGroups ( ) : null ; }

Target:
public java.util.List < java.lang.String > lookup ( com.google.gerrit.reviewdb.client.PatchSet.Id psId ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.Change c = db.changes ( ) . get ( psId.getParentKey ( ) ) ; if ( c == null ) { return null ; } com.google.gerrit.server.notedb.ChangeNotes notes = notesFactory.create ( db , c ) ; com.google.gerrit.reviewdb.client.PatchSet ps = psUtil.get ( db , notes , psId ) ; return ps != null ? ps.getGroups ( ) : null ; }
Source:
private java.util.List < com.google.gerrit.common.data.SubmitRecord > ruleError ( java.lang.String err , java.lang.Exception e ) { if ( logErrors ) { com.google.gerrit.server.project.SubmitRuleEvaluator.log.error ( err , e ) ; return com.google.gerrit.server.project.SubmitRuleEvaluator.defaultRuleError ( ) ; } else { return com.google.gerrit.server.project.SubmitRuleEvaluator.createRuleError ( err ) ; } }

Target:
private java.util.List < com.google.gerrit.common.data.SubmitRecord > ruleError ( java.lang.String err , java.lang.Exception e ) { if ( logErrors ) { if ( e == null ) { com.google.gerrit.server.project.SubmitRuleEvaluator.log.error ( err ) ; } else { com.google.gerrit.server.project.SubmitRuleEvaluator.log.error ( err , e ) ; } return com.google.gerrit.server.project.SubmitRuleEvaluator.defaultRuleError ( ) ; } else { return com.google.gerrit.server.project.SubmitRuleEvaluator.createRuleError ( err ) ; } }
Source:
protected void throwUnauthorizedOp ( java.lang.String op , com.google.gerrit.server.project.ProjectState state , com.google.gerrit.server.CurrentUser user ) throws org.eclipse.jgit.lfs.errors.LfsUnauthorized { java.lang.String project = state.getProject ( ) . getName ( ) ; java.lang.String userName = ( com.google.common.base.Strings.isNullOrEmpty ( user.getUserName ( ) ) ) ? "anonymous" : user.getUserName ( ) ; com.googlesource.gerrit.plugins.lfs.locks.LfsLocksAction.log.debug ( java.lang.String.format ( "operation %s unauthorized for user %s on project %s" , op , userName , project ) ) ; throw new org.eclipse.jgit.lfs.errors.LfsUnauthorized ( op , project ) ; }

Target:
private void throwUnauthorizedOp ( java.lang.String op , com.google.gerrit.server.project.ProjectState state , com.google.gerrit.server.CurrentUser user ) throws org.eclipse.jgit.lfs.errors.LfsUnauthorized { java.lang.String project = state.getProject ( ) . getName ( ) ; java.lang.String userName = ( com.google.common.base.Strings.isNullOrEmpty ( user.getUserName ( ) ) ) ? "anonymous" : user.getUserName ( ) ; com.googlesource.gerrit.plugins.lfs.locks.LfsLocksAction.log.debug ( java.lang.String.format ( "operation %s unauthorized for user %s on project %s" , op , userName , project ) ) ; throw new org.eclipse.jgit.lfs.errors.LfsUnauthorized ( op , project ) ; }
Source:
public void deleteReviewerFromReviewableChangeByAdminCcingSelf ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; setEmailStrategy ( admin , EmailStrategy.CC_ON_OWN_COMMENTS ) ; setApiUser ( admin ) ; removeReviewer ( sc , extraReviewer ) ; assertThat ( sender ) . sent ( "deleteReviewer" , sc ) . to ( sc.owner , extraReviewer ) . to ( sc.reviewerByEmail ) . cc ( admin , extraCcer , sc.reviewer , sc.ccer ) . cc ( sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; }

Target:
public void deleteReviewerFromReviewableChangeByAdminCcingSelf ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; setEmailStrategy ( admin , EmailStrategy.CC_ON_OWN_COMMENTS ) ; setApiUser ( admin ) ; removeReviewer ( sc , extraReviewer ) ; assertThat ( sender ) . sent ( "deleteReviewer" , sc ) . to ( sc.owner , extraReviewer ) . cc ( admin , extraCcer , sc.reviewer , sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; }
Source:
private void saveChange ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx ) throws com.google.gwtorm.server.OrmException { change = ctx.getChange ( ) ; com.google.gerrit.server.notedb.ChangeUpdate update = ctx.getUpdate ( ) ; wasDraftChange = ( change.getStatus ( ) ) == ( Change.Status.DRAFT ) ; if ( wasDraftChange ) { change.setStatus ( Change.Status.NEW ) ; update.setStatus ( change.getStatus ( ) ) ; com.google.gerrit.server.ChangeUtil.updated ( change ) ; ctx.getDb ( ) . changes ( ) . update ( java.util.Collections.singleton ( change ) ) ; } }

Target:
private void saveChange ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx ) throws com.google.gwtorm.server.OrmException { change = ctx.getChange ( ) ; com.google.gerrit.server.notedb.ChangeUpdate update = ctx.getUpdate ( psId ) ; wasDraftChange = ( change.getStatus ( ) ) == ( Change.Status.DRAFT ) ; if ( wasDraftChange ) { change.setStatus ( Change.Status.NEW ) ; update.setStatus ( change.getStatus ( ) ) ; com.google.gerrit.server.ChangeUtil.updated ( change ) ; ctx.getDb ( ) . changes ( ) . update ( java.util.Collections.singleton ( change ) ) ; } }
Source:
private com.google.common.truth.IterableSubject < ? extends com.google.common.truth.IterableSubject < ? , java.lang.String , java.lang.Iterable < java.lang.String > > , java.lang.String , java.lang.Iterable < java.lang.String > > assertThatGet ( com.google.gerrit.acceptance.PushOneCommit.Result r ) throws java.lang.Exception { return com.google.common.truth.Truth.assertThat ( ( ( java.lang.Iterable < java.lang.String > ) ( gApi.changes ( ) . id ( r.getChange ( ) . getId ( ) . get ( ) ) . getHashtags ( ) ) ) ) ; }

Target:
private com.google.common.truth.IterableSubject < ? extends com.google.common.truth.IterableSubject < ? , java.lang.String , java.lang.Iterable < java.lang.String > > , java.lang.String , java.lang.Iterable < java.lang.String > > assertThatGet ( com.google.gerrit.acceptance.PushOneCommit.Result r ) throws java.lang.Exception { return com.google.common.truth.Truth.assertThat ( gApi.changes ( ) . id ( r.getChange ( ) . getId ( ) . get ( ) ) . getHashtags ( ) ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { site = new com.google.gerrit.server.config.SitePaths ( com.google.gerrit.testutil.TempFileUtil.createTempDirectory ( ) . toPath ( ) ) ; site.resolve ( "git" ) . toFile ( ) . mkdir ( ) ; cfg = new org.eclipse.jgit.lib.Config ( ) ; cfg.setString ( "gerrit" , null , "basePath" , "git" ) ; repoManager = new com.google.gerrit.server.git.LocalDiskRepositoryManager ( site , cfg , createNiceMock ( com.google.gerrit.server.notedb.NotesMigration.class ) ) ; repoManager.start ( ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { site = new com.google.gerrit.server.config.SitePaths ( com.google.gerrit.testutil.TempFileUtil.createTempDirectory ( ) . toPath ( ) ) ; site.resolve ( "git" ) . toFile ( ) . mkdir ( ) ; cfg = new org.eclipse.jgit.lib.Config ( ) ; cfg.setString ( "gerrit" , null , "basePath" , "git" ) ; repoManager = new com.google.gerrit.server.git.LocalDiskRepositoryManager ( site , cfg ) ; repoManager.start ( ) ; }
Source:
protected < K extends java.io.Serializable , V extends java.io.Serializable > com.google.gerrit.server.cache.NamedCacheBinding < K , V > disk ( final com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < K , V > > type , final java.lang.String name ) { return disk ( com.google.inject.Key.get ( type , com.google.inject.name.Names.named ( name ) ) ) . name ( name ) ; }

Target:
protected < K extends java.io.Serializable , V extends java.io.Serializable > com.google.gerrit.server.cache.NamedCacheBinding < K , V > disk ( final com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < K , V > > type , final java.lang.String name ) { return disk ( com.google.inject.Key.get ( type , com.google.inject.name.Names.named ( name ) ) , type ) . name ( name ) ; }
Source:
public com.google.gerrit.server.CurrentUser getUser ( ) { final com.google.gerrit.server.CurrentUser user = session.getUser ( ) ; if ( ( user != null ) && ( user.isIdentifiedUser ( ) ) ) { com.google.gerrit.server.IdentifiedUser identifiedUser = userFactory.create ( ( ( com.google.gerrit.server.IdentifiedUser ) ( user ) ) . getAccountId ( ) ) ; identifiedUser.setAccessPath ( user.getAccessPath ( ) ) ; return identifiedUser ; } return user ; }

Target:
public com.google.gerrit.server.CurrentUser getUser ( ) { com.google.gerrit.server.CurrentUser user = session.getUser ( ) ; if ( ( user != null ) && ( user.isIdentifiedUser ( ) ) ) { com.google.gerrit.server.IdentifiedUser identifiedUser = userFactory.create ( user.getAccountId ( ) ) ; identifiedUser.setAccessPath ( user.getAccessPath ( ) ) ; return identifiedUser ; } return user ; }
Source:
public void doFilter ( javax.servlet.ServletRequest req , javax.servlet.ServletResponse rsp , javax.servlet.FilterChain chain ) throws java.io.IOException , javax.servlet.ServletException { com.google.gerrit.httpd.WebSession s = ( user.get ( ) . isIdentifiedUser ( ) ) ? session.get ( ) : null ; com.google.gerrit.httpd.XsrfCookieFilter.setXsrfTokenCookie ( ( ( javax.servlet.http.HttpServletRequest ) ( req ) ) , ( ( javax.servlet.http.HttpServletResponse ) ( rsp ) ) , s ) ; chain.doFilter ( req , rsp ) ; }

Target:
public void doFilter ( javax.servlet.ServletRequest req , javax.servlet.ServletResponse rsp , javax.servlet.FilterChain chain ) throws java.io.IOException , javax.servlet.ServletException { com.google.gerrit.httpd.WebSession s = ( user.get ( ) . isIdentifiedUser ( ) ) ? session.get ( ) : null ; setXsrfTokenCookie ( ( ( javax.servlet.http.HttpServletRequest ) ( req ) ) , ( ( javax.servlet.http.HttpServletResponse ) ( rsp ) ) , s ) ; chain.doFilter ( req , rsp ) ; }
Source:
public void delete ( int id ) throws java.io.IOException { org.apache.lucene.index.Term idTerm = com.google.gerrit.lucene.QueryBuilder.idTerm ( id ) ; try { com.google.common.util.concurrent.Futures.allAsList ( openIndex.delete ( idTerm ) , closedIndex.delete ( idTerm ) ) . get ( ) ; } catch ( java.util.concurrent.ExecutionException | java.lang.InterruptedException e ) { throw new java.io.IOException ( e ) ; } }

Target:
public void delete ( com.google.gerrit.reviewdb.client.Change.Id id ) throws java.io.IOException { org.apache.lucene.index.Term idTerm = com.google.gerrit.lucene.QueryBuilder.idTerm ( id ) ; try { com.google.common.util.concurrent.Futures.allAsList ( openIndex.delete ( idTerm ) , closedIndex.delete ( idTerm ) ) . get ( ) ; } catch ( java.util.concurrent.ExecutionException | java.lang.InterruptedException e ) { throw new java.io.IOException ( e ) ; } }
Source:
private static long getFileSize ( org.eclipse.jgit.lib.Repository repo , org.eclipse.jgit.lib.ObjectReader reader , org.eclipse.jgit.lib.FileMode mode , java.lang.String path , org.eclipse.jgit.revwalk.RevTree t ) throws java.io.IOException { if ( ! ( com.google.gerrit.server.patch.PatchListLoader.isBlob ( mode ) ) ) { return 0 ; } try ( org.eclipse.jgit.treewalk.TreeWalk tw = org.eclipse.jgit.treewalk.TreeWalk.forPath ( reader , path , t ) ) { return tw != null ? repo.open ( tw.getObjectId ( 0 ) , org.eclipse.jgit.lib.Constants.OBJ_BLOB ) . getSize ( ) : 0 ; } }

Target:
private static long getFileSize ( org.eclipse.jgit.lib.ObjectReader reader , org.eclipse.jgit.lib.FileMode mode , java.lang.String path , org.eclipse.jgit.revwalk.RevTree t ) throws java.io.IOException { if ( ! ( com.google.gerrit.server.patch.PatchListLoader.isBlob ( mode ) ) ) { return 0 ; } try ( org.eclipse.jgit.treewalk.TreeWalk tw = org.eclipse.jgit.treewalk.TreeWalk.forPath ( reader , path , t ) ) { return tw != null ? reader.open ( tw.getObjectId ( 0 ) , org.eclipse.jgit.lib.Constants.OBJ_BLOB ) . getSize ( ) : 0 ; } }
Source:
private static byte [ ] readResource ( final org.apache.velocity.runtime.resource.Resource p ) throws java.io.IOException { final java.io.InputStream in = p.getResourceLoader ( ) . getResourceStream ( p.getName ( ) ) ; java.io.ByteArrayOutputStream byteOut = new java.io.ByteArrayOutputStream ( ) ; try { org.apache.commons.io.IOUtils.copy ( in , byteOut ) ; } finally { in.close ( ) ; byteOut.close ( ) ; } return byteOut.toByteArray ( ) ; }

Target:
private static byte [ ] readResource ( final org.apache.velocity.runtime.resource.Resource p ) throws java.io.IOException { try ( java.io.InputStream in = p.getResourceLoader ( ) . getResourceStream ( p.getName ( ) ) ; java.io.ByteArrayOutputStream byteOut = new java.io.ByteArrayOutputStream ( ) ) { org.apache.commons.io.IOUtils.copy ( in , byteOut ) ; return byteOut.toByteArray ( ) ; } }
Source:
private java.util.List < ? > buildTagsSoyData ( ) throws java.lang.Exception { org.eclipse.jgit.revwalk.RevWalk rw = new org.eclipse.jgit.revwalk.RevWalk ( repo.getRepository ( ) ) ; try { return com.google.gitiles.RefServlet.getTagsSoyData ( buildSoyRequest ( ) , new com.google.gitiles.TimeCache ( com.google.gitiles.TimeCache.defaultBuilder ( ) ) , rw , java.lang.Integer.MAX_VALUE ) ; } finally { rw.release ( ) ; } }

Target:
private java.util.List < ? > buildTagsSoyData ( ) throws java.lang.Exception { try ( org.eclipse.jgit.revwalk.RevWalk rw = new org.eclipse.jgit.revwalk.RevWalk ( repo.getRepository ( ) ) ) { return com.google.gitiles.RefServlet.getTagsSoyData ( buildSoyRequest ( ) , new com.google.gitiles.TimeCache ( com.google.gitiles.TimeCache.defaultBuilder ( ) ) , rw , java.lang.Integer.MAX_VALUE ) ; } }
Source:
private void updateSubscriptions ( ) throws com.google.gerrit.server.git.MergeException { if ( ( ( mergeTip ) != null ) && ( ( ( branchTip ) == null ) || ( ( branchTip ) != ( mergeTip ) ) ) ) { com.google.gerrit.server.git.SubmoduleOp subOp = subOpFactory.create ( destBranch , mergeTip , rw , db , destProject , submitted , commits ) ; try { subOp.update ( ) ; } catch ( com.google.gerrit.server.git.SubmoduleException e ) { com.google.gerrit.server.git.MergeOp.log.error ( ( "The gitLinks were not updated according to the subscriptions " + ( e.getMessage ( ) ) ) ) ; } } }

Target:
private void updateSubscriptions ( ) throws com.google.gerrit.server.git.MergeException { if ( ( ( mergeTip ) != null ) && ( ( ( branchTip ) == null ) || ( ( branchTip ) != ( mergeTip ) ) ) ) { com.google.gerrit.server.git.SubmoduleOp subOp = subOpFactory.create ( destBranch , mergeTip , rw , repo , destProject , submitted , commits ) ; try { subOp.update ( ) ; } catch ( com.google.gerrit.server.git.SubmoduleException e ) { com.google.gerrit.server.git.MergeOp.log.error ( ( "The gitLinks were not updated according to the subscriptions " + ( e.getMessage ( ) ) ) ) ; } } }
Source:
private org.eclipse.jgit.revwalk.RevCommit getHead ( org.eclipse.jgit.lib.Repository repo , java.lang.String name ) throws java.io.IOException { try { org.eclipse.jgit.revwalk.RevWalk rw = new org.eclipse.jgit.revwalk.RevWalk ( repo ) ; try { return rw.parseCommit ( repo.getRef ( name ) . getObjectId ( ) ) ; } finally { rw.release ( ) ; } } finally { repo.close ( ) ; } }

Target:
private org.eclipse.jgit.revwalk.RevCommit getHead ( org.eclipse.jgit.lib.Repository repo , java.lang.String name ) throws java.io.IOException { try ( org.eclipse.jgit.revwalk.RevWalk rw = new org.eclipse.jgit.revwalk.RevWalk ( repo ) ) { return rw.parseCommit ( repo.getRef ( name ) . getObjectId ( ) ) ; } }
Source:
public com.google.gerrit.server.cache.Cache < K , V > get ( ) { if ( ( cache ) == null ) { throw new com.google.inject.ProvisionException ( ( ( "Cache \"" + ( cacheName ) ) + "\" not available" ) ) ; } if ( ( entryCreator ) != null ) { return new com.google.gerrit.server.cache.PopulatingCache < K , V > ( cache , entryCreator.get ( ) ) ; } return new com.google.gerrit.server.cache.SimpleCache < K , V > ( cache ) ; }

Target:
public com.google.gerrit.server.cache.Cache < K , V > get ( ) { if ( ( cache ) == null ) { throw new com.google.inject.ProvisionException ( ( ( "Cache \"" + ( cacheName ) ) + "\" not available" ) ) ; } return cache ; }
Source:
public void deleteReviewerFromReviewableChangeByOwnerCcingSelf ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; setEmailStrategy ( sc.owner , EmailStrategy.CC_ON_OWN_COMMENTS ) ; removeReviewer ( sc , extraReviewer ) ; assertThat ( sender ) . sent ( "deleteReviewer" , sc ) . to ( sc.owner , extraReviewer ) . to ( sc.reviewerByEmail ) . cc ( extraCcer , sc.reviewer , sc.ccer ) . cc ( sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; }

Target:
public void deleteReviewerFromReviewableChangeByOwnerCcingSelf ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; setEmailStrategy ( sc.owner , EmailStrategy.CC_ON_OWN_COMMENTS ) ; removeReviewer ( sc , extraReviewer ) ; assertThat ( sender ) . sent ( "deleteReviewer" , sc ) . to ( sc.owner , extraReviewer ) . cc ( extraCcer , sc.reviewer , sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; }
Source:
public java.util.Set < com.google.gerrit.reviewdb.client.Account.Id > draftsByUser ( ) throws com.google.gwtorm.server.OrmException { if ( ( draftsByUser ) == null ) { com.google.gerrit.reviewdb.client.Change c = change ( ) ; if ( c == null ) { return java.util.Collections.emptySet ( ) ; } draftsByUser = new java.util.HashSet < > ( ) ; for ( com.google.gerrit.reviewdb.client.PatchLineComment sc : plcUtil.draftByChange ( db , notes ) ) { draftsByUser.add ( sc.getAuthor ( ) ) ; } } return draftsByUser ; }

Target:
public java.util.Set < com.google.gerrit.reviewdb.client.Account.Id > draftsByUser ( ) throws com.google.gwtorm.server.OrmException { if ( ( draftsByUser ) == null ) { com.google.gerrit.reviewdb.client.Change c = change ( ) ; if ( c == null ) { return java.util.Collections.emptySet ( ) ; } draftsByUser = new java.util.HashSet < > ( ) ; for ( com.google.gerrit.reviewdb.client.PatchLineComment sc : plcUtil.draftByChange ( db , notes ( ) ) ) { draftsByUser.add ( sc.getAuthor ( ) ) ; } } return draftsByUser ; }
Source:
public com.google.gerrit.extensions.restapi.Response < java.lang.String > apply ( com.google.gerrit.server.change.ChangeResource rsrc , com.google.gerrit.server.change.Ignore.Input input ) throws com.google.gerrit.extensions.restapi.RestApiException { try { if ( rsrc.isUserOwner ( ) ) { throw new com.google.gerrit.extensions.restapi.BadRequestException ( "cannot ignore own change" ) ; } if ( ! ( isIgnored ( rsrc ) ) ) { stars.ignore ( rsrc ) ; } return com.google.gerrit.extensions.restapi.Response.ok ( "" ) ; } catch ( com.google.gerrit.server.StarredChangesUtil.MutuallyExclusiveLabelsException e ) { throw new com.google.gerrit.extensions.restapi.ResourceConflictException ( e.getMessage ( ) ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "failed to ignore change" , e ) ; } }

Target:
public com.google.gerrit.extensions.restapi.Response < java.lang.String > apply ( com.google.gerrit.server.change.ChangeResource rsrc , com.google.gerrit.server.change.Ignore.Input input ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gwtorm.server.OrmException { try { if ( rsrc.isUserOwner ( ) ) { throw new com.google.gerrit.extensions.restapi.BadRequestException ( "cannot ignore own change" ) ; } if ( ! ( isIgnored ( rsrc ) ) ) { stars.ignore ( rsrc ) ; } return com.google.gerrit.extensions.restapi.Response.ok ( "" ) ; } catch ( com.google.gerrit.server.StarredChangesUtil.MutuallyExclusiveLabelsException e ) { throw new com.google.gerrit.extensions.restapi.ResourceConflictException ( e.getMessage ( ) ) ; } }
Source:
public void testCreate_NotExisting ( ) throws java.io.IOException { final java.nio.file.Path root = com.google.gerrit.server.config.SitePathsTest.random ( ) ; final com.google.gerrit.server.config.SitePaths site = new com.google.gerrit.server.config.SitePaths ( root ) ; org.junit.Assert.assertTrue ( site.isNew ) ; org.junit.Assert.assertEquals ( root.toFile ( ) , site.site_path ) ; org.junit.Assert.assertEquals ( root.resolve ( "etc" ) . toFile ( ) , site.etc_dir ) ; }

Target:
public void testCreate_NotExisting ( ) throws java.io.IOException { final java.nio.file.Path root = com.google.gerrit.server.config.SitePathsTest.random ( ) ; final com.google.gerrit.server.config.SitePaths site = new com.google.gerrit.server.config.SitePaths ( root ) ; org.junit.Assert.assertTrue ( site.isNew ) ; org.junit.Assert.assertEquals ( root.toFile ( ) , site.site_path ) ; org.junit.Assert.assertEquals ( root.resolve ( "etc" ) , site.etc_dir ) ; }
Source:
public void onShowView ( ) { super . onShowView ( ) ; related.setMaxHeight ( commit.getElement ( ) . getParentElement ( ) . getOffsetHeight ( ) ) ; if ( openReplyBox ) { onReply ( ) ; } else { java.lang.String prior = com.google.gerrit.client.Gerrit.getPriorView ( ) ; if ( ( prior != null ) && ( prior.startsWith ( "/c/" ) ) ) { scrollToPath ( prior.substring ( 3 ) ) ; } } startPoller ( ) ; }

Target:
public void onShowView ( ) { super . onShowView ( ) ; commit.onShowView ( ) ; related.setMaxHeight ( commit.getElement ( ) . getParentElement ( ) . getOffsetHeight ( ) ) ; if ( openReplyBox ) { onReply ( ) ; } else { java.lang.String prior = com.google.gerrit.client.Gerrit.getPriorView ( ) ; if ( ( prior != null ) && ( prior.startsWith ( "/c/" ) ) ) { scrollToPath ( prior.substring ( 3 ) ) ; } } startPoller ( ) ; }
Source:
private java.util.Set < java.lang.String > getAllGroups ( com.google.gerrit.server.notedb.ChangeNotes notes ) throws com.google.gwtorm.server.OrmException { java.util.Set < java.lang.String > result = new java.util.HashSet < > ( ) ; for ( com.google.gerrit.reviewdb.client.PatchSet ps : psUtil.byChange ( db.get ( ) , notes ) ) { java.util.List < java.lang.String > groups = ps.getGroups ( ) ; if ( groups != null ) { result.addAll ( groups ) ; } } return result ; }

Target:
private java.util.Set < java.lang.String > getAllGroups ( com.google.gerrit.server.notedb.ChangeNotes notes ) throws com.google.gwtorm.server.OrmException { java.util.Set < java.lang.String > result = new java.util.HashSet < > ( ) ; for ( com.google.gerrit.reviewdb.client.PatchSet ps : psUtil.byChange ( db.get ( ) , notes ) ) { result.addAll ( ps.getGroups ( ) ) ; } return result ; }
Source:
public boolean isReviewer ( com.google.gerrit.reviewdb.server.ReviewDb db , @ com.google.gerrit.common.Nullable com.google.gerrit.server.query.change.ChangeData cd ) throws com.google.gwtorm.server.OrmException { if ( getUser ( ) . isIdentifiedUser ( ) ) { java.util.Collection < com.google.gerrit.reviewdb.client.Account.Id > results = changeData ( db , cd ) . reviewers ( ) . values ( ) ; com.google.gerrit.server.IdentifiedUser user = ( ( com.google.gerrit.server.IdentifiedUser ) ( getUser ( ) ) ) ; return results.contains ( user.getAccountId ( ) ) ; } return false ; }

Target:
public boolean isReviewer ( com.google.gerrit.reviewdb.server.ReviewDb db , @ com.google.gerrit.common.Nullable com.google.gerrit.server.query.change.ChangeData cd ) throws com.google.gwtorm.server.OrmException { if ( getUser ( ) . isIdentifiedUser ( ) ) { java.util.Collection < com.google.gerrit.reviewdb.client.Account.Id > results = changeData ( db , cd ) . reviewers ( ) . values ( ) ; return results.contains ( getUser ( ) . getAccountId ( ) ) ; } return false ; }