auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void fire ( com.google.gerrit.extensions.common.ChangeInfo change , com.google.gerrit.extensions.common.RevisionInfo revision , com.google.gerrit.extensions.common.AccountInfo uploader , java.sql.Timestamp when ) { if ( ! ( listeners.iterator ( ) . hasNext ( ) ) ) { return ; } com.google.gerrit.server.extensions.events.RevisionCreated.Event event = new com.google.gerrit.server.extensions.events.RevisionCreated.Event ( change , revision , uploader , when ) ; for ( com.google.gerrit.extensions.events.RevisionCreatedListener l : listeners ) { try { l.onRevisionCreated ( event ) ; } catch ( java.lang.Exception e ) { com.google.gerrit.server.extensions.events.RevisionCreated.log.warn ( "Error in event listener" , e ) ; } } }

Target:
public void fire ( com.google.gerrit.extensions.common.ChangeInfo change , com.google.gerrit.extensions.common.RevisionInfo revision , com.google.gerrit.extensions.common.AccountInfo uploader , java.sql.Timestamp when , com.google.gerrit.extensions.api.changes.NotifyHandling notify ) { if ( ! ( listeners.iterator ( ) . hasNext ( ) ) ) { return ; } com.google.gerrit.server.extensions.events.RevisionCreated.Event event = new com.google.gerrit.server.extensions.events.RevisionCreated.Event ( change , revision , uploader , when , notify ) ; for ( com.google.gerrit.extensions.events.RevisionCreatedListener l : listeners ) { try { l.onRevisionCreated ( event ) ; } catch ( java.lang.Exception e ) { com.google.gerrit.server.extensions.events.RevisionCreated.log.warn ( "Error in event listener" , e ) ; } } }
Source:
private void decodeStarredBy ( com.google.common.collect.Multimap < java.lang.String , org.apache.lucene.index.IndexableField > doc , com.google.gerrit.server.query.change.ChangeData cd ) { java.util.Collection < org.apache.lucene.index.IndexableField > starredBy = doc.get ( com.google.gerrit.lucene.LuceneChangeIndex.STARREDBY_FIELD ) ; java.util.Set < com.google.gerrit.reviewdb.client.Account.Id > accounts = com.google.common.collect.Sets.newHashSetWithExpectedSize ( starredBy.size ( ) ) ; for ( org.apache.lucene.index.IndexableField r : starredBy ) { accounts.add ( new com.google.gerrit.reviewdb.client.Account.Id ( r.numericValue ( ) . intValue ( ) ) ) ; } cd.setStarredBy ( accounts ) ; }

Target:
public void run ( ) { closedIndex.close ( ) ; }
Source:
public void rebuildEmptySite ( ) throws java.lang.Exception { initSite ( ) ; com.google.common.io.Files.asCharSink ( new java.io.File ( sitePath.toString ( ) , "etc/gerrit.config" ) , java.nio.charset.StandardCharsets.UTF_8 , com.google.common.io.FileWriteMode.APPEND ) . write ( com.google.gerrit.server.notedb.ConfigNotesMigration.allEnabledConfig ( ) . toText ( ) ) ; com.google.gerrit.acceptance.pgm.RebuildNoteDbIT.runGerrit ( "RebuildNoteDb" , "-d" , sitePath.toString ( ) , "--show-stack-trace" ) ; }

Target:
public void rebuildEmptySiteStartingWithNoteDbEnabled ( ) throws java.lang.Exception { initSite ( ) ; setNotesMigrationState ( NotesMigrationState.NOTE_DB_UNFUSED ) ; com.google.gerrit.acceptance.pgm.RebuildNoteDbIT.runGerrit ( "RebuildNoteDb" , "-d" , sitePath , "--show-stack-trace" ) ; }
Source:
public void deleteDraftChange ( ) throws java.lang.Exception { java.lang.String changeId = createDraftChange ( ) ; java.lang.String triplet = "p~master~" + changeId ; com.google.gerrit.extensions.common.ChangeInfo c = get ( triplet ) ; org.junit.Assert.assertEquals ( triplet , c.id ) ; org.junit.Assert.assertEquals ( ChangeStatus.DRAFT , c.status ) ; com.google.gerrit.acceptance.RestResponse r = com.google.gerrit.acceptance.rest.change.DeleteDraftChangeIT.deleteChange ( changeId , adminSession ) ; org.junit.Assert.assertEquals ( 204 , r.getStatusCode ( ) ) ; }

Target:
public void deleteDraftChange ( ) throws java.lang.Exception { java.lang.String changeId = createDraftChange ( ) ; java.lang.String triplet = "p~master~" + changeId ; com.google.gerrit.extensions.common.ChangeInfo c = get ( triplet ) ; com.google.common.truth.Truth.assertThat ( c.id ) . isEqualTo ( triplet ) ; com.google.common.truth.Truth.assertThat ( c.status ) . isEqualTo ( ChangeStatus.DRAFT ) ; com.google.gerrit.acceptance.RestResponse r = com.google.gerrit.acceptance.rest.change.DeleteDraftChangeIT.deleteChange ( changeId , adminSession ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( HttpStatus.SC_NO_CONTENT ) ; }
Source:
public void signatureByExpiredKeyBeforeExpiration ( ) throws java.lang.Exception { com.google.gerrit.gpg.testutil.TestKey key3 = com.google.gerrit.gpg.testutil.TestKeys.expiredKey ( ) ; java.util.Date now = new java.text.SimpleDateFormat ( "YYYY-MM-dd HH:mm:ss Z" ) . parse ( "2005-07-10 12:00:00 -0400" ) ; org.eclipse.jgit.transport.PushCertificate cert = newSignedCert ( validNonce ( ) , key3 , now ) ; assertProblems ( cert ) ; }

Target:
public void signatureByExpiredKeyBeforeExpiration ( ) throws java.lang.Exception { com.google.gerrit.gpg.testutil.TestKey key3 = com.google.gerrit.gpg.testutil.TestKeys.expiredKey ( ) ; java.util.Date now = new java.text.SimpleDateFormat ( "YYYY-MM-dd HH:mm:ss Z" ) . parse ( "2005-07-10 12:00:00 -0400" ) ; org.eclipse.jgit.transport.PushCertificate cert = newSignedCert ( validNonce ( ) , key3 , now ) ; assertNoProblems ( cert ) ; }
Source:
private static com.google.gerrit.extensions.restapi.BinaryResult base64 ( com.google.gerrit.extensions.restapi.BinaryResult bin ) throws java.io.IOException { int max = 4 * ( com.google.common.math.IntMath.divide ( ( ( int ) ( bin.getContentLength ( ) ) ) , 3 , java.math.RoundingMode.CEILING ) ) ; org.eclipse.jgit.util.TemporaryBuffer.Heap buf = com.google.gerrit.httpd.restapi.RestApiServlet.heap ( max ) ; java.io.OutputStream encoded = com.google.common.io.BaseEncoding.base64 ( ) . encodingStream ( new java.io.OutputStreamWriter ( buf , java.nio.charset.StandardCharsets.ISO_8859_1 ) ) ; bin.writeTo ( encoded ) ; encoded.close ( ) ; return com.google.gerrit.httpd.restapi.RestApiServlet.asBinaryResult ( buf ) ; }

Target:
private static int base64MaxSize ( long n ) { return 4 * ( com.google.common.math.IntMath.divide ( ( ( int ) ( n ) ) , 3 , java.math.RoundingMode.CEILING ) ) ; }
Source:
public static < T > void itemOf ( com.google.inject.Binder binder , com.google.inject.TypeLiteral < T > member ) { @ java.lang.SuppressWarnings ( value = "unchecked" ) com.google.inject.Key < com.google.gerrit.extensions.registration.DynamicItem < T > > key = ( ( com.google.inject.Key < com.google.gerrit.extensions.registration.DynamicItem < T > > ) ( com.google.inject.Key.get ( com.google.inject.util.Types.newParameterizedType ( com.google.gerrit.extensions.registration.DynamicItem.class , member.getType ( ) ) ) ) ) ; binder.bind ( key ) . toProvider ( new com.google.gerrit.extensions.registration.DynamicItemProvider ( member , key ) ) . in ( Scopes.SINGLETON ) ; }

Target:
private static < T > com.google.inject.Key < com.google.gerrit.extensions.registration.DynamicItem < T > > keyFor ( com.google.inject.TypeLiteral < T > member ) { return ( ( com.google.inject.Key < com.google.gerrit.extensions.registration.DynamicItem < T > > ) ( com.google.inject.Key.get ( com.google.inject.util.Types.newParameterizedType ( com.google.gerrit.extensions.registration.DynamicItem.class , member.getType ( ) ) ) ) ) ; }
Source:
private void initMode ( ) { for ( java.util.Map.Entry < java.lang.String , java.lang.String > e : com.google.gerrit.client.diff.PreferencesBox.NAME_TO_MODE.entrySet ( ) ) { mode.addItem ( e.getKey ( ) , e.getValue ( ) ) ; } }

Target:
private void initMode ( ) { mode.addItem ( "" , "" ) ; for ( java.util.Map.Entry < java.lang.String , java.lang.String > e : com.google.gerrit.client.diff.PreferencesBox.NAME_TO_MODE.entrySet ( ) ) { mode.addItem ( e.getKey ( ) , e.getValue ( ) ) ; } }
Source:
public com.googlesource.gerrit.plugins.its.phabricator.conduit.results.ConduitPing conduitPing ( ) throws com.googlesource.gerrit.plugins.its.phabricator.conduit.ConduitException { com.google.gson.JsonElement callResult = conduitConnection.call ( "conduit.ping" ) ; com.google.gson.JsonObject callResultWrapper = new com.google.gson.JsonObject ( ) ; callResultWrapper.add ( "hostname" , callResult ) ; com.googlesource.gerrit.plugins.its.phabricator.conduit.results.ConduitPing result = gson.fromJson ( callResultWrapper , com.googlesource.gerrit.plugins.its.phabricator.conduit.results.ConduitPing.class ) ; return result ; }

Target:
public com.googlesource.gerrit.plugins.its.phabricator.conduit.results.ConduitPing conduitPing ( ) throws com.googlesource.gerrit.plugins.its.phabricator.conduit.ConduitException { java.util.Map < java.lang.String , java.lang.Object > params = new java.util.HashMap < > ( ) ; com.google.gson.JsonElement callResult = conduitConnection.call ( "conduit.ping" , params , token ) ; com.google.gson.JsonObject callResultWrapper = new com.google.gson.JsonObject ( ) ; callResultWrapper.add ( "hostname" , callResult ) ; com.googlesource.gerrit.plugins.its.phabricator.conduit.results.ConduitPing result = gson.fromJson ( callResultWrapper , com.googlesource.gerrit.plugins.its.phabricator.conduit.results.ConduitPing.class ) ; return result ; }
Source:
private static boolean sameUpdate ( com.google.gerrit.server.notedb.ChangeRebuilder.Event event , com.google.gerrit.server.notedb.AbstractChangeUpdate update ) { return ( ( ( ( update != null ) && ( ( com.google.gerrit.server.notedb.ChangeRebuilder.round ( event.when ) ) == ( com.google.gerrit.server.notedb.ChangeRebuilder.round ( update.getWhen ( ) ) ) ) ) && ( event.who.equals ( update.getUser ( ) . getAccountId ( ) ) ) ) && ( event.psId.equals ( update.getPatchSetId ( ) ) ) ) && ( ! ( event instanceof com.google.gerrit.server.notedb.ChangeRebuilder.FinalUpdatesEvent ) ) ; }

Target:
public int compare ( com.google.gerrit.server.notedb.ChangeRebuilder.Event a , com.google.gerrit.server.notedb.ChangeRebuilder.Event b ) { return com.google.common.collect.ComparisonChain.start ( ) . compare ( a.when , b.when ) . compare ( a.who.get ( ) , b.who.get ( ) ) . compare ( a.psId.get ( ) , b.psId.get ( ) ) . result ( ) ; }
Source:
public void doPut ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse res ) throws java.io.IOException { if ( ! ( isValidPath ( req ) ) ) { res.setStatus ( HttpServletResponse.SC_FORBIDDEN ) ; return ; } if ( isGerritConfig ( req ) ) { writeFileAndFireAuditEvent ( req , res ) ; } else { writeFile ( req , res ) ; } }

Target:
public void doPut ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse res ) throws java.io.IOException { if ( ! ( isAllowedPath ( req ) ) ) { res.setStatus ( HttpServletResponse.SC_FORBIDDEN ) ; return ; } if ( isGerritConfig ( req ) ) { writeFileAndFireAuditEvent ( req , res ) ; } else { writeFile ( req , res ) ; } }
Source:
public com.google.gerrit.server.account.AccountResource parse ( com.google.gerrit.extensions.restapi.TopLevelResource root , com.google.gerrit.extensions.restapi.IdString id ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.ResourceNotFoundException , com.google.gwtorm.server.OrmException { com.google.gerrit.server.IdentifiedUser user = _parse ( id.get ( ) ) ; if ( user == null ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( id ) ; } else if ( ! ( accountControlFactory.get ( ) . canSee ( user.getAccount ( ) ) ) ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( id ) ; } return new com.google.gerrit.server.account.AccountResource ( user ) ; }

Target:
public com.google.gerrit.server.account.AccountResource parse ( com.google.gerrit.extensions.restapi.TopLevelResource root , com.google.gerrit.extensions.restapi.IdString id ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.ResourceNotFoundException , com.google.gwtorm.server.OrmException { com.google.gerrit.server.IdentifiedUser user = parseId ( id.get ( ) ) ; if ( user == null ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( id ) ; } else if ( ! ( accountControlFactory.get ( ) . canSee ( user.getAccount ( ) ) ) ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( id ) ; } return new com.google.gerrit.server.account.AccountResource ( user ) ; }
Source:
private int getEffectiveLimit ( com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > p ) { java.util.List < java.lang.Integer > possibleLimits = new java.util.ArrayList < > ( 4 ) ; possibleLimits.add ( getBackendSupportedLimit ( ) ) ; possibleLimits.add ( getPermittedLimit ( ) ) ; if ( ( limitFromCaller ) > 0 ) { possibleLimits.add ( limitFromCaller ) ; } java.lang.Integer limitFromPredicate = com.google.gerrit.server.query.change.LimitPredicate.getLimit ( p ) ; if ( limitFromPredicate != null ) { possibleLimits.add ( limitFromPredicate ) ; } return com.google.common.collect.Ordering.natural ( ) . min ( possibleLimits ) ; }

Target:
private int getEffectiveLimit ( com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > p ) { java.util.List < java.lang.Integer > possibleLimits = new java.util.ArrayList < > ( 4 ) ; possibleLimits.add ( getBackendSupportedLimit ( ) ) ; possibleLimits.add ( getPermittedLimit ( ) ) ; if ( ( limitFromCaller ) > 0 ) { possibleLimits.add ( limitFromCaller ) ; } java.lang.Integer limitFromPredicate = com.google.gerrit.server.query.LimitPredicate.getLimit ( com.google.gerrit.server.query.change.ChangeQueryBuilder.FIELD_LIMIT , p ) ; if ( limitFromPredicate != null ) { possibleLimits.add ( limitFromPredicate ) ; } return com.google.common.collect.Ordering.natural ( ) . min ( possibleLimits ) ; }
Source:
public void onSuccess ( final com.google.gerrit.common.data.HostPageData result ) { com.google.gwt.dom.client.Document.get ( ) . getElementById ( "gerrit_hostpagedata" ) . removeFromParent ( ) ; com.google.gerrit.client.Gerrit.myTheme = result.theme ; com.google.gerrit.client.Gerrit.isNoteDbEnabled = result.isNoteDbEnabled ; if ( ( result.account ) != null ) { com.google.gerrit.client.Gerrit.myAccount = result.account ; com.google.gerrit.client.Gerrit.xGerritAuth = result.xGerritAuth ; } if ( ( result.accountDiffPref ) != null ) { com.google.gerrit.client.Gerrit.myAccountDiffPref = result.accountDiffPref ; com.google.gerrit.client.Gerrit.applyUserPreferences ( ) ; } onModuleLoad2 ( result ) ; }

Target:
public void onSuccess ( com.google.gerrit.client.info.AccountPreferencesInfo prefs ) { com.google.gerrit.client.Gerrit.myPrefs = prefs ; onModuleLoad2 ( result ) ; }
Source:
public void deleteComment ( com.google.gerrit.reviewdb.client.PatchLineComment c ) { verifyComment ( c ) ; if ( migration.readComments ( ) ) { com.google.common.base.Preconditions.checkArgument ( draftNotes.containsComment ( c ) , ( "Cannot delete this comment" + " because it didn't previously exist as a draft" ) ) ; } if ( migration.write ( ) ) { if ( draftNotes.containsComment ( c ) ) { deleteComments.add ( c ) ; } } }

Target:
public void deleteComment ( com.google.gerrit.reviewdb.client.PatchLineComment c ) throws com.google.gwtorm.server.OrmException { verifyComment ( c ) ; if ( migration.readChanges ( ) ) { com.google.common.base.Preconditions.checkArgument ( draftNotes.load ( ) . containsComment ( c ) , ( "Cannot delete this comment because it didn't previously exist as a" + " draft" ) ) ; } if ( migration.writeChanges ( ) ) { if ( draftNotes.load ( ) . containsComment ( c ) ) { deleteComments.add ( c ) ; } } }
Source:
public void testInsertOneException ( ) throws com.google.gwtorm.client.OrmException , java.sql.SQLException { stubExecuteBatchException ( com.google.gwtorm.jdbc.TestJdbcAccess.INSERT , new java.sql.BatchUpdateException ( ) ) ; try { createClassUnderTest ( ) . insert ( com.google.gwtorm.jdbc.TestJdbcAccess.ONE_ROW ) ; org.junit.Assert.fail ( "missingException" ) ; } catch ( com.google.gwtorm.client.OrmException e ) { } }

Target:
public void testUpsertTwoNotExistingZeroLengthArray ( ) throws com.google.gwtorm.server.OrmException , java.sql.SQLException { java.sql.PreparedStatement update = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.TestJdbcAccess.UPDATE ) ; java.sql.PreparedStatement insert = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.TestJdbcAccess.INSERT , 1 , 1 ) ; createClassUnderTest ( ) . upsert ( twoRows ) ; com.google.gwtorm.jdbc.TestJdbcAccess.assertUsedBatchingOnly ( update ) ; com.google.gwtorm.jdbc.TestJdbcAccess.assertUsedBatchingOnly ( insert ) ; com.google.gwtorm.jdbc.TestJdbcAccess.assertExpectedIdsUsed ( insert , 1 , 2 ) ; }
Source:
public java.lang.Iterable < com.google.gerrit.server.query.change.ChangeData > byCommitsOnBranchNotMerged ( org.eclipse.jgit.lib.Repository repo , com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Branch.NameKey branch , java.util.List < java.lang.String > hashes ) throws com.google.gwtorm.server.OrmException , java.io.IOException { return byCommitsOnBranchNotMerged ( repo , db , branch , hashes , ( ( indexConfig.maxTerms ( ) ) - 3 ) ) ; }

Target:
public java.lang.Iterable < com.google.gerrit.server.query.change.ChangeData > byCommitsOnBranchNotMerged ( org.eclipse.jgit.lib.Repository repo , com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Branch.NameKey branch , java.util.Collection < java.lang.String > hashes ) throws com.google.gwtorm.server.OrmException , java.io.IOException { return byCommitsOnBranchNotMerged ( repo , db , branch , hashes , ( ( indexConfig.maxTerms ( ) ) - 3 ) ) ; }
Source:
public boolean equals ( java.lang.Object o ) { if ( o instanceof com.google.gerrit.server.git.LabelNormalizer.Result ) { com.google.gerrit.server.git.LabelNormalizer.Result r = ( ( com.google.gerrit.server.git.LabelNormalizer.Result ) ( o ) ) ; return ( ( com.google.common.base.Objects.equal ( unchanged , r.unchanged ) ) && ( com.google.common.base.Objects.equal ( updated , r.updated ) ) ) && ( com.google.common.base.Objects.equal ( deleted , r.deleted ) ) ; } return false ; }

Target:
public boolean equals ( java.lang.Object o ) { if ( o instanceof com.google.gerrit.server.git.LabelNormalizer.Result ) { com.google.gerrit.server.git.LabelNormalizer.Result r = ( ( com.google.gerrit.server.git.LabelNormalizer.Result ) ( o ) ) ; return ( ( java.util.Objects.equals ( unchanged , r.unchanged ) ) && ( java.util.Objects.equals ( updated , r.updated ) ) ) && ( java.util.Objects.equals ( deleted , r.deleted ) ) ; } return false ; }
Source:
com.ericsson.gerrit.plugins.eventslog.sql.SQLClient provideLocalSqlClient ( com.ericsson.gerrit.plugins.eventslog.EventsLogConfig cfg ) { java.lang.String path = cfg.getLocalStorePath ( ) . toString ( ) ; path = ( path.endsWith ( "/" ) ) ? path : path + "/" ; return new com.ericsson.gerrit.plugins.eventslog.sql.SQLClient ( cfg.getLocalStoreDriver ( ) , ( ( com.ericsson.gerrit.plugins.eventslog.sql.SqlModule.H2_DB_PREFIX ) + path ) , cfg.getUrlOptions ( ) ) ; }

Target:
com.ericsson.gerrit.plugins.eventslog.sql.SQLClient provideLocalSqlClient ( com.ericsson.gerrit.plugins.eventslog.EventsLogConfig cfg ) { java.lang.String path = cfg.getLocalStorePath ( ) . toString ( ) ; path = ( path.endsWith ( "/" ) ) ? path : path + "/" ; return new com.ericsson.gerrit.plugins.eventslog.sql.SQLClient ( cfg.getLocalStoreDriver ( ) , ( ( com.ericsson.gerrit.plugins.eventslog.sql.SQLModule.H2_DB_PREFIX ) + path ) , cfg.getUrlOptions ( ) ) ; }
Source:
private boolean allowedValueForRef ( java.util.Set < com.google.gerrit.reviewdb.AccountGroup.Id > groups , short level ) { for ( com.google.gerrit.reviewdb.RefRight right : rights ) { if ( ( groups.contains ( right.getAccountGroupId ( ) ) ) && ( ( right.getMaxValue ( ) ) >= level ) ) { return true ; } } return false ; }

Target:
private boolean allowedValueForRef ( java.util.Set < com.google.gerrit.reviewdb.AccountGroup.UUID > groups , short level ) { for ( com.google.gerrit.reviewdb.RefRight right : rights ) { if ( ( groups.contains ( right.getAccountGroupUUID ( ) ) ) && ( ( right.getMaxValue ( ) ) >= level ) ) { return true ; } } return false ; }
Source:
public com.google.gerrit.extensions.common.GroupInfo apply ( com.google.gerrit.server.group.GroupResource resource ) throws com.google.gerrit.extensions.restapi.MethodNotAllowedException , com.google.gerrit.extensions.restapi.ResourceNotFoundException , com.google.gwtorm.server.OrmException { com.google.gerrit.common.data.GroupDescription.Internal group = resource.asInternalGroup ( ) . orElseThrow ( MethodNotAllowedException :: new ) ; try { com.google.gerrit.server.account.GroupControl c = controlFactory.validateFor ( group.getOwnerGroupUUID ( ) ) ; return json.format ( c.getGroup ( ) ) ; } catch ( com.google.gerrit.common.errors.NoSuchGroupException e ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( ) ; } }

Target:
public com.google.gerrit.extensions.common.GroupInfo apply ( com.google.gerrit.server.group.GroupResource resource ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException , com.google.gerrit.server.restapi.group.NotInternalGroupException , com.google.gwtorm.server.OrmException { com.google.gerrit.common.data.GroupDescription.Internal group = resource.asInternalGroup ( ) . orElseThrow ( NotInternalGroupException :: new ) ; try { com.google.gerrit.server.account.GroupControl c = controlFactory.validateFor ( group.getOwnerGroupUUID ( ) ) ; return json.format ( c.getGroup ( ) ) ; } catch ( com.google.gerrit.common.errors.NoSuchGroupException e ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( ) ; } }
Source:
private void saveChange ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx ) throws com.google.gwtorm.server.OrmException { change = ctx.getChange ( ) ; wasDraftChange = ( change.getStatus ( ) ) == ( Change.Status.DRAFT ) ; if ( wasDraftChange ) { change.setStatus ( Change.Status.NEW ) ; 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.getChangeUpdate ( ) ; 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 java.lang.String url ( com.google.gerrit.client.diff.FileInfo info ) { return info.binary ( ) ? com.google.gerrit.client.Dispatcher.toUnified ( base , curr , info.path ( ) ) : ( mode ) == ( com.google.gerrit.client.change.FileTable.Mode.REVIEW ) ? com.google.gerrit.client.Dispatcher.toSideBySide ( base , curr , info.path ( ) ) : com.google.gerrit.client.Dispatcher.toEditScreen ( curr , info.path ( ) ) ; }

Target:
private java.lang.String url ( com.google.gerrit.client.info.FileInfo info ) { return info.binary ( ) ? com.google.gerrit.client.Dispatcher.toUnified ( base , curr , info.path ( ) ) : ( mode ) == ( com.google.gerrit.client.change.FileTable.Mode.REVIEW ) ? com.google.gerrit.client.Dispatcher.toSideBySide ( base , curr , info.path ( ) ) : com.google.gerrit.client.Dispatcher.toEditScreen ( curr , info.path ( ) ) ; }
Source:
public void login ( final com.google.gerrit.server.account.AuthResult res , final boolean rememberMe ) { final com.google.gerrit.reviewdb.Account.Id id = res.getAccountId ( ) ; final com.google.gerrit.reviewdb.AccountExternalId.Key identity = res.getExternalId ( ) ; if ( ( val ) != null ) { manager.destroy ( key ) ; key = null ; val = null ; } key = manager.createKey ( id ) ; val = manager.createVal ( key , id , rememberMe , identity ) ; saveCookie ( ) ; }

Target:
public boolean isTokenValid ( final java.lang.String inputToken ) { return ( ( isSignedIn ( ) ) && ( ( val.getXsrfToken ( ) ) != null ) ) && ( val.getXsrfToken ( ) . equals ( inputToken ) ) ; }
Source:
net.codemirror.lib.CodeMirror getCmA ( ) { return cmA ; }

Target:
void updateRenderEntireFile ( ) { cmA.removeKeyMap ( com.google.gerrit.client.diff.SideBySide2.RENDER_ENTIRE_FILE_KEYMAP ) ; cmB.removeKeyMap ( com.google.gerrit.client.diff.SideBySide2.RENDER_ENTIRE_FILE_KEYMAP ) ; if ( prefs.renderEntireFile ( ) ) { cmA.addKeyMap ( com.google.gerrit.client.diff.SideBySide2.RENDER_ENTIRE_FILE_KEYMAP ) ; cmB.addKeyMap ( com.google.gerrit.client.diff.SideBySide2.RENDER_ENTIRE_FILE_KEYMAP ) ; } cmA.setOption ( "viewportMargin" , ( prefs.renderEntireFile ( ) ? java.lang.Double.POSITIVE_INFINITY : 10 ) ) ; cmB.setOption ( "viewportMargin" , ( prefs.renderEntireFile ( ) ? java.lang.Double.POSITIVE_INFINITY : 10 ) ) ; }
Source:
private static java.lang.reflect.Field getParameterField ( java.lang.Class < ? > clazz ) { java.util.List < java.lang.reflect.Field > fields = com.google.common.collect.Lists.newArrayListWithExpectedSize ( 1 ) ; for ( java.lang.reflect.Field f : clazz.getFields ( ) ) { if ( ( f.getAnnotation ( com.google.gerrit.testutil.ConfigSuite.Parameter.class ) ) != null ) { fields.add ( f ) ; } } com.google.common.base.Preconditions.checkArgument ( ( ( fields.size ( ) ) == 1 ) , "expected 1 @ConfigSuite.Parameter field, found: %s" , fields ) ; return fields.get ( 0 ) ; }

Target:
private static java.lang.reflect.Field getOnlyField ( java.lang.Class < ? > clazz , java.lang.Class < ? extends java.lang.annotation.Annotation > ann ) { java.util.List < java.lang.reflect.Field > fields = com.google.common.collect.Lists.newArrayListWithExpectedSize ( 1 ) ; for ( java.lang.reflect.Field f : clazz.getFields ( ) ) { if ( ( f.getAnnotation ( ann ) ) != null ) { fields.add ( f ) ; } } com.google.common.base.Preconditions.checkArgument ( ( ( fields.size ( ) ) <= 1 ) , "expected 1 @ConfigSuite.%s field, found: %s" , ann.getSimpleName ( ) , fields ) ; return com.google.common.collect.Iterables.getFirst ( fields , null ) ; }
Source:
private void renderSelected ( int row , boolean selected ) { com.google.gwt.user.client.Element e = getRow ( row ) ; if ( e != null ) { if ( selected ) { e.addClassName ( RelatedChanges.R.css ( ) . activeRow ( ) ) ; } else { e.removeClassName ( RelatedChanges.R.css ( ) . activeRow ( ) ) ; } } }

Target:
private void renderSelected ( int row , boolean selected ) { com.google.gwt.dom.client.Element e = getRow ( row ) ; if ( e != null ) { if ( selected ) { e.addClassName ( RelatedChanges.R.css ( ) . activeRow ( ) ) ; } else { e.removeClassName ( RelatedChanges.R.css ( ) . activeRow ( ) ) ; } } }
Source:
public org.eclipse.jgit.transport.UploadPack create ( javax.servlet.http.HttpServletRequest req , org.eclipse.jgit.lib.Repository repo ) throws org.eclipse.jgit.http.server.resolver.ServiceNotEnabledException { com.google.gerrit.server.project.ProjectControl pc = com.google.gerrit.httpd.ProjectServlet.getProjectControl ( req ) ; org.eclipse.jgit.transport.UploadPack up = new org.eclipse.jgit.transport.UploadPack ( repo ) ; if ( ! ( pc.allRefsAreVisible ( ) ) ) { up.setRefFilter ( new com.google.gerrit.server.git.VisibleRefFilter ( repo , pc , db.get ( ) ) ) ; } return up ; }

Target:
public org.eclipse.jgit.transport.UploadPack create ( javax.servlet.http.HttpServletRequest req , org.eclipse.jgit.lib.Repository repo ) throws org.eclipse.jgit.http.server.resolver.ServiceNotAuthorizedException , org.eclipse.jgit.http.server.resolver.ServiceNotEnabledException { com.google.gerrit.server.project.ProjectControl pc = com.google.gerrit.httpd.ProjectServlet.getProjectControl ( req ) ; if ( ! ( pc.canRunUploadPack ( ) ) ) { throw new org.eclipse.jgit.http.server.resolver.ServiceNotAuthorizedException ( ) ; } org.eclipse.jgit.transport.UploadPack up = new org.eclipse.jgit.transport.UploadPack ( repo ) ; up.setPackConfig ( packConfig ) ; if ( ! ( pc.allRefsAreVisible ( ) ) ) { up.setRefFilter ( new com.google.gerrit.server.git.VisibleRefFilter ( repo , pc , db.get ( ) ) ) ; } return up ; }
Source:
public static java.lang.String encode ( java.lang.String component ) { if ( component != null ) { try { return java.net.URLEncoder.encode ( component , "UTF-8" ) ; } catch ( java.io.UnsupportedEncodingException e ) { throw new java.lang.RuntimeException ( "JVM must support UTF-8" , e ) ; } } return null ; }

Target:
public static java.lang.String encode ( java.lang.String component ) { if ( component != null ) { try { return java.net.URLEncoder.encode ( component , java.nio.charset.StandardCharsets.UTF_8.name ( ) ) ; } catch ( java.io.UnsupportedEncodingException e ) { throw new java.lang.RuntimeException ( "JVM must support UTF-8" , e ) ; } } return null ; }
Source:
private void checkCanRunAs ( ) throws com.google.gerrit.sshd.UnloggedFailure { if ( ( caller ) instanceof com.google.gerrit.server.PeerDaemonUser ) { } else if ( ! ( enableRunAs ) ) { throw new com.google.gerrit.sshd.UnloggedFailure ( 1 , "fatal: suexec disabled by auth.enableRunAs = false" ) ; } else if ( ! ( caller.getCapabilities ( ) . canRunAs ( ) ) ) { throw new com.google.gerrit.sshd.UnloggedFailure ( 1 , "fatal: suexec not permitted" ) ; } }

Target:
private void checkCanRunAs ( ) throws com.google.gerrit.sshd.UnloggedFailure { if ( ( caller ) instanceof com.google.gerrit.server.PeerDaemonUser ) { } else if ( ! ( enableRunAs ) ) { throw die ( "suexec disabled by auth.enableRunAs = false" ) ; } else if ( ! ( caller.getCapabilities ( ) . canRunAs ( ) ) ) { throw die ( "suexec not permitted" ) ; } }
Source:
public com.google.gerrit.server.tools.ToolsCatalog.Entry get ( java.lang.String name ) { if ( name.startsWith ( "/" ) ) { name = name.substring ( 1 ) ; } if ( name.endsWith ( "/" ) ) { name = name.substring ( 0 , ( ( name.length ( ) ) - 1 ) ) ; } return toc.get ( name ) ; }

Target:
public com.google.gerrit.server.tools.ToolsCatalog.Entry get ( @ com.google.gerrit.common.Nullable java.lang.String name ) { if ( com.google.common.base.Strings.isNullOrEmpty ( name ) ) { return null ; } if ( name.startsWith ( "/" ) ) { name = name.substring ( 1 ) ; } if ( name.endsWith ( "/" ) ) { name = name.substring ( 0 , ( ( name.length ( ) ) - 1 ) ) ; } return toc.get ( name ) ; }
Source:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { com.google.gerrit.client.changes.ChangeApi.revision ( changeId.get ( ) , revision ) . view ( "review" ) . post ( input , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.changes.ReviewInput > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.changes.ReviewInput result ) { com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( changeId ) ) ; } } ) ; }

Target:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { if ( ( replyAction ) != null ) { input.message ( replyAction.getMessage ( ) ) ; } com.google.gerrit.client.changes.ChangeApi.revision ( changeId.get ( ) , revision ) . view ( "review" ) . post ( input , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.changes.ReviewInput > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.changes.ReviewInput result ) { com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( changeId ) ) ; } } ) ; }
Source:
private boolean isVisibleTo ( com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.server.CurrentUser user , com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { final com.google.gerrit.server.project.ProjectState pe = projectCache.get ( change.getProject ( ) ) ; if ( pe == null ) { return false ; } final com.google.gerrit.server.project.ProjectControl pc = pe.controlFor ( user ) ; return pc.controlFor ( change ) . isVisible ( db ) ; }

Target:
public com.google.gerrit.server.data.PatchSetAttribute get ( ) { try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( change.getProject ( ) ) ; org.eclipse.jgit.revwalk.RevWalk revWalk = new org.eclipse.jgit.revwalk.RevWalk ( repo ) ) { return eventFactory.asPatchSetAttribute ( revWalk , change , patchSet ) ; } catch ( java.io.IOException e ) { throw com.google.common.base.Throwables.propagate ( e ) ; } }
Source:
public java.lang.String getFunctionName ( ) { return functionName ; }

Target:
public com.google.gerrit.common.data.LabelFunction getFunction ( ) { if ( ( functionName ) == null ) { return null ; } java.util.Optional < com.google.gerrit.common.data.LabelFunction > f = com.google.gerrit.common.data.LabelFunction.parse ( functionName ) ; if ( ! ( f.isPresent ( ) ) ) { throw new java.lang.IllegalStateException ( ( "Unsupported functionName: " + ( functionName ) ) ) ; } return f.get ( ) ; }
Source:
public com.google.gerrit.reviewdb.client.ChangeMessage getConflictMessage ( com.google.gerrit.server.change.RevisionResource rsrc ) throws com.google.gwtorm.server.OrmException { return com.google.common.collect.Iterables.getFirst ( com.google.common.collect.Iterables.filter ( com.google.common.collect.Lists.reverse ( dbProvider.get ( ) . changeMessages ( ) . byChange ( rsrc.getChange ( ) . getId ( ) ) . toList ( ) ) , new com.google.common.base.Predicate < com.google.gerrit.reviewdb.client.ChangeMessage > ( ) { @ java.lang.Override public boolean apply ( com.google.gerrit.reviewdb.client.ChangeMessage input ) { return ( input.getAuthor ( ) ) == null ; } } ) , null ) ; }

Target:
public com.google.gerrit.reviewdb.client.ChangeMessage getConflictMessage ( com.google.gerrit.server.change.RevisionResource rsrc ) throws com.google.gwtorm.server.OrmException { return com.google.common.collect.FluentIterable.from ( cmUtil.byPatchSet ( dbProvider.get ( ) , rsrc.getNotes ( ) , rsrc.getPatchSet ( ) . getId ( ) ) ) . filter ( new com.google.common.base.Predicate < com.google.gerrit.reviewdb.client.ChangeMessage > ( ) { @ java.lang.Override public boolean apply ( com.google.gerrit.reviewdb.client.ChangeMessage input ) { return ( input.getAuthor ( ) ) == null ; } } ) . last ( ) . orNull ( ) ; }
Source:
public void queryChangesMultipleTerms ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r1 = createChange ( ) ; createChange ( ) ; java.util.List < com.google.gerrit.extensions.common.ChangeInfo > results = query ( ( "status:open " + ( r1.getChangeId ( ) ) ) ) ; com.google.common.truth.Truth.assertThat ( com.google.common.collect.Iterables.getOnlyElement ( results ) . changeId ) . isEqualTo ( r1.getChangeId ( ) ) ; }

Target:
public void queryChanges ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r1 = createChange ( ) ; createChange ( ) ; java.util.List < com.google.gerrit.extensions.common.ChangeInfo > results = query ( ( ( ( "project:{" + ( project.get ( ) ) ) + "} " ) + ( r1.getChangeId ( ) ) ) ) ; com.google.common.truth.Truth.assertThat ( com.google.common.collect.Iterables.getOnlyElement ( results ) . changeId ) . isEqualTo ( r1.getChangeId ( ) ) ; }
Source:
HEAD ( ) { }

Target:
private com.google.inject.Key < javax.servlet.http.HttpServlet > registerScreen ( final java.lang.Boolean slash ) { return key ( new javax.servlet.http.HttpServlet ( ) { private static final long serialVersionUID = 1L ; @ java.lang.Override protected void doGet ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse rsp ) throws java.io.IOException { java.lang.String path = java.lang.String.format ( "/register%s" , ( slash ? req.getPathInfo ( ) : "" ) ) ; com.google.gerrit.httpd.UrlModule.toGerrit ( path , req , rsp ) ; } } ) ; }
Source:
public com.google.gerrit.server.change.CommentResource parse ( com.google.gerrit.server.change.RevisionResource rev , com.google.gerrit.extensions.restapi.IdString id ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException , com.google.gwtorm.server.OrmException { java.lang.String uuid = id.get ( ) ; for ( com.google.gerrit.reviewdb.client.PatchLineComment c : dbProvider.get ( ) . patchComments ( ) . publishedByPatchSet ( rev.getPatchSet ( ) . getId ( ) ) ) { if ( uuid.equals ( c.getKey ( ) . get ( ) ) ) { return new com.google.gerrit.server.change.CommentResource ( rev , c ) ; } } throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( id ) ; }

Target:
public com.google.gerrit.server.change.CommentResource parse ( com.google.gerrit.server.change.RevisionResource rev , com.google.gerrit.extensions.restapi.IdString id ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException , com.google.gwtorm.server.OrmException { java.lang.String uuid = id.get ( ) ; com.google.gerrit.server.notedb.ChangeNotes notes = rev.getNotes ( ) ; for ( com.google.gerrit.reviewdb.client.PatchLineComment c : plcUtil.publishedByPatchSet ( dbProvider.get ( ) , notes , rev.getPatchSet ( ) . getId ( ) ) ) { if ( uuid.equals ( c.getKey ( ) . get ( ) ) ) { return new com.google.gerrit.server.change.CommentResource ( rev , c ) ; } } throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( id ) ; }
Source:
public void formatYearsMonths ( ) { com.google.gerrit.client.RelativeDateFormatterTest.assertFormat ( 366 , com.google.gerrit.client.RelativeDateFormatter.DAY_IN_MILLIS , "1 year ago" ) ; com.google.gerrit.client.RelativeDateFormatterTest.assertFormat ( 380 , com.google.gerrit.client.RelativeDateFormatter.DAY_IN_MILLIS , "1 year, 1 month ago" ) ; com.google.gerrit.client.RelativeDateFormatterTest.assertFormat ( 410 , com.google.gerrit.client.RelativeDateFormatter.DAY_IN_MILLIS , "1 year, 2 months ago" ) ; com.google.gerrit.client.RelativeDateFormatterTest.assertFormat ( 2 , com.google.gerrit.client.RelativeDateFormatter.YEAR_IN_MILLIS , "2 years ago" ) ; com.google.gerrit.client.RelativeDateFormatterTest.assertFormat ( 1824 , com.google.gerrit.client.RelativeDateFormatter.DAY_IN_MILLIS , "5 years ago" ) ; }

Target:
public void formatYearsMonths ( ) { com.google.gerrit.client.RelativeDateFormatterTest.assertFormat ( 366 , com.google.gerrit.client.RelativeDateFormatter.DAY_IN_MILLIS , "1 year ago" ) ; com.google.gerrit.client.RelativeDateFormatterTest.assertFormat ( 380 , com.google.gerrit.client.RelativeDateFormatter.DAY_IN_MILLIS , "1 year, 1 month ago" ) ; com.google.gerrit.client.RelativeDateFormatterTest.assertFormat ( 410 , com.google.gerrit.client.RelativeDateFormatter.DAY_IN_MILLIS , "1 year, 2 months ago" ) ; com.google.gerrit.client.RelativeDateFormatterTest.assertFormat ( 2 , com.google.gerrit.client.RelativeDateFormatter.YEAR_IN_MILLIS , "2 years ago" ) ; com.google.gerrit.client.RelativeDateFormatterTest.assertFormat ( 1824 , com.google.gerrit.client.RelativeDateFormatter.DAY_IN_MILLIS , "5 years ago" ) ; com.google.gerrit.client.RelativeDateFormatterTest.assertFormat ( ( ( 2 * 365 ) - 10 ) , com.google.gerrit.client.RelativeDateFormatter.DAY_IN_MILLIS , "2 years ago" ) ; }
Source:
public void save ( ) throws java.lang.Exception { com.google.gerrit.server.git.gpg.TestKey key1 = com.google.gerrit.server.git.gpg.TestKey.key1 ( ) ; com.google.gerrit.server.git.gpg.TestKey key2 = com.google.gerrit.server.git.gpg.TestKey.key2 ( ) ; store.add ( key1.getPublicKeyRing ( ) ) ; store.add ( key2.getPublicKeyRing ( ) ) ; org.eclipse.jgit.lib.CommitBuilder cb = new org.eclipse.jgit.lib.CommitBuilder ( ) ; org.eclipse.jgit.lib.PersonIdent ident = new org.eclipse.jgit.lib.PersonIdent ( "A U Thor" , "author@example.com" ) ; cb.setAuthor ( ident ) ; cb.setCommitter ( ident ) ; org.junit.Assert.assertEquals ( RefUpdate.Result.NEW , store.save ( cb ) ) ; assertKeys ( key1.getKeyId ( ) , key1 ) ; assertKeys ( key2.getKeyId ( ) , key2 ) ; }

Target:
public void save ( ) throws java.lang.Exception { com.google.gerrit.server.git.gpg.TestKey key1 = com.google.gerrit.server.git.gpg.TestKey.key1 ( ) ; com.google.gerrit.server.git.gpg.TestKey key2 = com.google.gerrit.server.git.gpg.TestKey.key2 ( ) ; store.add ( key1.getPublicKeyRing ( ) ) ; store.add ( key2.getPublicKeyRing ( ) ) ; org.junit.Assert.assertEquals ( RefUpdate.Result.NEW , store.save ( newCommitBuilder ( ) ) ) ; assertKeys ( key1.getKeyId ( ) , key1 ) ; assertKeys ( key2.getKeyId ( ) , key2 ) ; }
Source:
public void deletingNonExistingEditRest ( ) throws java.lang.Exception { com.google.gerrit.acceptance.RestResponse r = adminSession.delete ( urlEdit ( ) ) ; org.junit.Assert.assertEquals ( org.apache.http.HttpStatus.SC_NOT_FOUND , r.getStatusCode ( ) ) ; }

Target:
public void createEditByDeletingExistingFileRest ( ) throws java.lang.Exception { com.google.gerrit.acceptance.RestResponse r = adminSession.delete ( urlEditFile ( ) ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( org.apache.http.HttpStatus.SC_NO_CONTENT ) ; com.google.common.base.Optional < com.google.gerrit.server.edit.ChangeEdit > edit = editUtil.byChange ( change ) ; try { fileUtil.getContent ( edit.get ( ) . getChange ( ) . getProject ( ) , edit.get ( ) . getRevision ( ) . get ( ) , com.google.gerrit.acceptance.edit.ChangeEditIT.FILE_NAME ) ; org.junit.Assert.fail ( "ResourceNotFoundException expected" ) ; } catch ( com.google.gerrit.extensions.restapi.ResourceNotFoundException rnfe ) { } }
Source:
private static void a2b ( com.google.gerrit.client.rpc.NativeMap < com.google.gerrit.client.actions.ActionInfo > actions , java.lang.String a , com.google.gwt.user.client.ui.Button b ) { if ( actions.containsKey ( a ) ) { b.setVisible ( true ) ; b.setTitle ( actions.get ( a ) . title ( ) ) ; } }

Target:
private static void a2b ( com.google.gerrit.client.rpc.NativeMap < com.google.gerrit.client.actions.ActionInfo > actions , java.lang.String a , com.google.gwt.user.client.ui.Button b ) { if ( actions.containsKey ( a ) ) { b.setVisible ( true ) ; com.google.gerrit.client.actions.ActionInfo actionInfo = actions.get ( a ) ; b.setTitle ( actionInfo.title ( ) ) ; b.setEnabled ( actionInfo.enabled ( ) ) ; } }
Source:
private void setStyleName ( final int row , final int col , final java.lang.String name ) { table.getFlexCellFormatter ( ) . setStyleName ( row , col , name ) ; }

Target:
private void insertChangeRow ( final int row ) { insertRow ( row ) ; final com.google.gwt.user.client.ui.FlexTable.FlexCellFormatter fmt = table.getFlexCellFormatter ( ) ; fmt.addStyleName ( row , com.google.gerrit.client.changes.ChangeTable.C_ARROW , com.google.gerrit.client.changes.ChangeTable.S_ICON_CELL ) ; fmt.addStyleName ( row , com.google.gerrit.client.changes.ChangeTable.C_STAR , com.google.gerrit.client.changes.ChangeTable.S_ICON_CELL ) ; for ( int i = com.google.gerrit.client.changes.ChangeTable.C_ID ; i < ( com.google.gerrit.client.changes.ChangeTable.COLUMNS ) ; i ++ ) { fmt.addStyleName ( row , i , com.google.gerrit.client.changes.ChangeTable.S_DATA_CELL ) ; } fmt.addStyleName ( row , com.google.gerrit.client.changes.ChangeTable.C_ID , com.google.gerrit.client.changes.ChangeTable.S_C_ID ) ; }
Source:
public org.eclipse.jgit.revwalk.RevCommit next ( ) throws java.io.IOException , org.eclipse.jgit.errors.IncorrectObjectTypeException , org.eclipse.jgit.errors.MissingObjectException { if ( done ) { return null ; } org.eclipse.jgit.revwalk.RevCommit commit ; if ( ( first ) != null ) { commit = first ; first = null ; } else { commit = walk.next ( ) ; } if ( ( ++ ( n ) ) == ( limit ) ) { nextStart = walk.next ( ) ; done = true ; } else if ( commit == null ) { done = true ; } return commit ; }

Target:
private org.eclipse.jgit.revwalk.RevCommit nextWithRename ( ) throws java.io.IOException { org.eclipse.jgit.revwalk.RevCommit next = walk.next ( ) ; if ( ( renameWatcher ) != null ) { org.eclipse.jgit.diff.DiffEntry entry = renameWatcher.getAndClear ( ) ; if ( entry != null ) { if ( ( renamed ) == null ) { renamed = new java.util.HashMap < > ( ) ; } renamed.put ( next.copy ( ) , entry ) ; } } return next ; }
Source:
public java.util.Optional < com.googlesource.gerrit.plugins.manager.gson.SmartJson > getOptional ( java.lang.String fieldName ) { if ( ( ( jsonElem ) != null ) && ( ( jsonElem.getAsJsonObject ( ) . get ( fieldName ) ) != null ) ) { return java.util.Optional.of ( com.googlesource.gerrit.plugins.manager.gson.SmartJson.of ( jsonElem.getAsJsonObject ( ) . get ( fieldName ) ) ) ; } return java.util.Optional.empty ( ) ; }

Target:
public java.util.Optional < com.googlesource.gerrit.plugins.manager.gson.SmartJson > getOptional ( java.lang.String fieldName ) { if ( ( ( ( jsonElem ) != null ) && ( ! ( jsonElem.isJsonNull ( ) ) ) ) && ( ( jsonElem.getAsJsonObject ( ) . get ( fieldName ) ) != null ) ) { return java.util.Optional.of ( com.googlesource.gerrit.plugins.manager.gson.SmartJson.of ( jsonElem.getAsJsonObject ( ) . get ( fieldName ) ) ) ; } return java.util.Optional.empty ( ) ; }
Source:
private void commit ( org.eclipse.jgit.lib.Repository allUsersRepo , com.google.gerrit.server.group.db.GroupConfig groupConfig , com.google.gerrit.server.group.db.GroupNameNotes groupNameNotes ) throws java.io.IOException { org.eclipse.jgit.lib.BatchRefUpdate batchRefUpdate = allUsersRepo.getRefDatabase ( ) . newBatchUpdate ( ) ; try ( com.google.gerrit.server.git.MetaDataUpdate metaDataUpdate = createMetaDataUpdate ( allUsersRepo , batchRefUpdate ) ) { groupConfig.commit ( metaDataUpdate ) ; } try ( com.google.gerrit.server.git.MetaDataUpdate metaDataUpdate = createMetaDataUpdate ( allUsersRepo , batchRefUpdate ) ) { groupNameNotes.commit ( metaDataUpdate ) ; } com.google.gerrit.server.update.RefUpdateUtil.executeChecked ( batchRefUpdate , allUsersRepo ) ; }

Target:
private void commit ( org.eclipse.jgit.lib.Repository allUsersRepo , com.google.gerrit.server.group.db.GroupConfig groupConfig , com.google.gerrit.server.group.db.GroupNameNotes groupNameNotes ) throws java.io.IOException { org.eclipse.jgit.lib.BatchRefUpdate batchRefUpdate = allUsersRepo.getRefDatabase ( ) . newBatchUpdate ( ) ; try ( com.google.gerrit.server.git.meta.MetaDataUpdate metaDataUpdate = createMetaDataUpdate ( allUsersRepo , batchRefUpdate ) ) { groupConfig.commit ( metaDataUpdate ) ; } try ( com.google.gerrit.server.git.meta.MetaDataUpdate metaDataUpdate = createMetaDataUpdate ( allUsersRepo , batchRefUpdate ) ) { groupNameNotes.commit ( metaDataUpdate ) ; } com.google.gerrit.server.update.RefUpdateUtil.executeChecked ( batchRefUpdate , allUsersRepo ) ; }
Source:
private com.google.inject.Injector createSshInjector ( ) { final java.util.List < com.google.inject.Module > modules = new java.util.ArrayList < com.google.inject.Module > ( ) ; if ( sshd ) { modules.add ( new com.google.gerrit.sshd.SshModule ( ) ) ; if ( slave ) { modules.add ( new com.google.gerrit.sshd.commands.SlaveCommandModule ( ) ) ; } else { modules.add ( new com.google.gerrit.sshd.commands.MasterCommandModule ( ) ) ; } } else { modules.add ( new com.google.gerrit.server.ssh.NoSshModule ( ) ) ; } 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 > ( ) ; if ( sshd ) { modules.add ( new com.google.gerrit.sshd.SshModule ( ) ) ; if ( slave ) { modules.add ( new com.google.gerrit.sshd.commands.SlaveCommandModule ( ) ) ; } else { modules.add ( new com.google.gerrit.sshd.commands.MasterCommandModule ( ) ) ; modules.add ( cfgInjector.getInstance ( com.google.gerrit.sshd.commands.MasterPluginsModule.class ) ) ; } } else { modules.add ( new com.google.gerrit.server.ssh.NoSshModule ( ) ) ; } return sysInjector.createChildInjector ( modules ) ; }
Source:
private boolean eq ( com.google.gerrit.reviewdb.client.AccountGroup.UUID a , com.google.gerrit.reviewdb.client.AccountGroup.UUID b ) { return ( ( a != null ) && ( b != null ) ) && ( a.equals ( b ) ) ; }

Target:
static com.google.gerrit.server.project.PermissionCollection.SeenRule create ( com.google.gerrit.common.data.AccessSection section , com.google.gerrit.common.data.Permission permission , @ com.google.gerrit.common.Nullable com.google.gerrit.common.data.PermissionRule rule ) { com.google.gerrit.reviewdb.client.AccountGroup.UUID group = ( ( rule != null ) && ( ( rule.getGroup ( ) ) != null ) ) ? rule.getGroup ( ) . getUUID ( ) : null ; return new com.google.gerrit.server.project.AutoValue_PermissionCollection_SeenRule ( section.getName ( ) , permission.getName ( ) , group ) ; }