auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void testDifferentLength() { assertFunction( "zip_with(ARRAY[1], ARRAY['a', 'bc'], (x, y) -> (y, x))", new ArrayType(RowType.anonymous(ImmutableList.of(createVarcharType(2), INTEGER))), <START> ImmutableList.of(ImmutableList.of("a", 1), unmodifiableList(asList("bc", null)))); <END> assertFunction( "zip_with(ARRAY[NULL, 2], ARRAY['a'], (x, y) -> (y, x))", new ArrayType(RowType.anonymous(ImmutableList.of(createVarcharType(1), INTEGER))), ImmutableList.of(unmodifiableList(asList("a", null)), unmodifiableList(asList(null, 2)))); assertFunction( "zip_with(ARRAY[NULL, NULL], ARRAY[NULL, 2, 1], (x, y) -> x + y)", new ArrayType(INTEGER), unmodifiableList(asList(null, null, null))); }</code><technical_language>unmodifiableList(...) is unnecessary</technical_language>

Target:
public void testDifferentLength() { assertFunction( "zip_with(ARRAY[1], ARRAY['a', 'bc'], (x, y) -> (y, x))", new ArrayType(RowType.anonymous(ImmutableList.of(createVarcharType(2), INTEGER))), ImmutableList.of(ImmutableList.of("a", 1), asList("bc", null))); assertFunction( "zip_with(ARRAY[NULL, 2], ARRAY['a'], (x, y) -> (y, x))", new ArrayType(RowType.anonymous(ImmutableList.of(createVarcharType(1), INTEGER))), ImmutableList.of(asList("a", null), asList(null, 2))); assertFunction( "zip_with(ARRAY[NULL, NULL], ARRAY[NULL, 2, 1], (x, y) -> x + y)", new ArrayType(INTEGER), asList(null, null, null)); }
Source:
<code>public List<List<Double>> getRubricWeights() { if (hasAssignedWeights && rubricWeightsForEachCell.isEmpty()) { if (rubricWeights.size() != numOfRubricChoices || rubricWeights.isEmpty()) { return new ArrayList<>(); } for (int i = 0; i < numOfRubricSubQuestions; i++) { rubricWeightsForEachCell.add(new ArrayList<Double>()); for (int j = 0; j < numOfRubricChoices; j++) { rubricWeightsForEachCell.get(i).add(rubricWeights.get(j)); } } return new ArrayList<>(rubricWeightsForEachCell); } else if (hasAssignedWeights && !rubricWeightsForEachCell.isEmpty()) { <START> return new ArrayList<>(rubricWeightsForEachCell); <END> } return new ArrayList<>(); }</code><technical_language>return rubricWeightsForEachCell</technical_language>

Target:
public List<List<Double>> getRubricWeights() { if (hasAssignedWeights && rubricWeightsForEachCell.isEmpty()) { if (rubricWeights.size() != numOfRubricChoices || rubricWeights.isEmpty()) { return new ArrayList<>(); } List<List<Double>> weights = new ArrayList<>(); for (int i = 0; i < numOfRubricSubQuestions; i++) { weights.add(new ArrayList<Double>()); for (int j = 0; j < numOfRubricChoices; j++) { weights.get(i).add(rubricWeights.get(j)); } } return weights; } else if (hasAssignedWeights && !rubricWeightsForEachCell.isEmpty()) { return rubricWeightsForEachCell; } return new ArrayList<>(); }
Source:
<code>public PagedFlux<ChatParticipant> listParticipants(ListParticipantsOptions listParticipantsOptions) { try { return pagedFluxConvert(new PagedFlux<>( () -> withContext(context -> this.threadClient.listChatParticipantsSinglePageAsync( chatThreadId, <START> listParticipantsOptions.getMaxPageSize(), <END> listParticipantsOptions.getSkip(), context)), nextLink -> withContext(context -> this.threadClient.listChatParticipantsNextSinglePageAsync(nextLink, context))), f -> ChatParticipantConverter.convert(f)); } catch (RuntimeException ex) { return new PagedFlux<>(() -> monoError(logger, ex)); } }</code><technical_language>(and do listParticipantsOptions.get...) a null check listParticipantsOptions Check out other methods pagination already, null checks invoking threadClient options</technical_language>

Target:
public PagedFlux<ChatParticipant> listParticipants(ListParticipantsOptions listParticipantsOptions) { final ListParticipantsOptions serviceListParticipantsOptions = listParticipantsOptions == null ? new ListParticipantsOptions() : listParticipantsOptions; try { return pagedFluxConvert(new PagedFlux<>( () -> withContext(context -> this.chatThreadClient.listChatParticipantsSinglePageAsync( chatThreadId, serviceListParticipantsOptions.getMaxPageSize(), serviceListParticipantsOptions.getSkip(), context)), nextLink -> withContext(context -> this.chatThreadClient.listChatParticipantsNextSinglePageAsync(nextLink, context))), f -> ChatParticipantConverter.convert(f)); } catch (RuntimeException ex) { return new PagedFlux<>(() -> monoError(logger, ex)); } }
Source:
<code>public void processRedirectUrl(final WebView view, String url) { if (isBrokerRequest(getIntent())) { Logger.i(TAG, "It is a broker request", ""); displaySpinnerWithMessage(AuthenticationActivity.this .getText(AuthenticationActivity.this.getResources().getIdentifier( "broker_processing", "string", getPackageName()))); view.stopLoading(); new TokenTask(mWebRequestHandler, mAuthRequest, mCallingPackage, mCallingUID) .execute(url); <START> return; <END> } Logger.i(TAG, "It is not a broker request", ""); Intent resultIntent = new Intent(); resultIntent.putExtra(AuthenticationConstants.Browser.RESPONSE_FINAL_URL, url); resultIntent.putExtra(AuthenticationConstants.Browser.RESPONSE_REQUEST_INFO, mAuthRequest); returnToCaller(AuthenticationConstants.UIResponse.BROWSER_CODE_COMPLETE, resultIntent); view.stopLoading(); }</code><technical_language>this code cleaner? Adding early return in if void else in a non-trivial if block, i understand is benefit of dong this. #Closed</technical_language>

Target:
public void processRedirectUrl(final WebView view, String url) { if (!isBrokerRequest(getIntent())) { Logger.i(TAG, "It is not a broker request", ""); Intent resultIntent = new Intent(); resultIntent.putExtra(AuthenticationConstants.Browser.RESPONSE_FINAL_URL, url); resultIntent.putExtra(AuthenticationConstants.Browser.RESPONSE_REQUEST_INFO, mAuthRequest); returnToCaller(AuthenticationConstants.UIResponse.BROWSER_CODE_COMPLETE, resultIntent); view.stopLoading(); } else { Logger.i(TAG, "It is a broker request", ""); displaySpinnerWithMessage(AuthenticationActivity.this .getText(AuthenticationActivity.this.getResources().getIdentifier( "broker_processing", "string", getPackageName()))); view.stopLoading(); new TokenTask(mWebRequestHandler, mAuthRequest, mCallingPackage, mCallingUID) .execute(url); } }
Source:
<code><START> public synchronized Endpoint getDefaultEndpoint(String uriScheme) throws IllegalArgumentException { <END> if (null == uriScheme) { uriScheme = CoAP.COAP_URI_SCHEME; } if (!CoAP.isSupportedScheme(uriScheme)) { throw new IllegalArgumentException("URI scheme " + uriScheme + " not supported!"); } uriScheme = uriScheme.toLowerCase(); Endpoint endpoint = endpoints.get(uriScheme); if (null == endpoint) { endpoint = createDefaultEndpoint(uriScheme); } return endpoint; }</code><technical_language>do declare RuntimeExceptions thrown</technical_language>

Target:
public synchronized Endpoint getDefaultEndpoint(String uriScheme) { if (null == uriScheme) { uriScheme = CoAP.COAP_URI_SCHEME; } if (!CoAP.isSupportedScheme(uriScheme)) { throw new IllegalArgumentException("URI scheme " + uriScheme + " not supported!"); } uriScheme = uriScheme.toLowerCase(); Endpoint endpoint = endpoints.get(uriScheme); if (null == endpoint) { endpoint = createDefaultEndpoint(uriScheme); } return endpoint; }
Source:
<code>public SamzaMonitorService(SamzaRestConfig config, MetricsRegistry metricsRegistry) { this.config = config; this.metricsRegistry = metricsRegistry; <START> scheduledExecutors = new ArrayList<>(); <END> }</code><technical_language>is this list updated</technical_language>

Target:
public SamzaMonitorService(SamzaRestConfig config, MetricsRegistry metricsRegistry) { this.config = config; this.metricsRegistry = metricsRegistry; this.scheduledExecutors = new ArrayList<>(); }
Source:
<code>private Map<String, InterMineBag> filterBagsByType(Map<String, InterMineBag> bags, String type, boolean onlyCurrent, boolean includeSupers) { <START> Set<String> classAndSubs = new HashSet<String>(); <END> classAndSubs.add(type); ClassDescriptor bagTypeCld = model.getClassDescriptorByName(type); if (bagTypeCld == null) { throw new NullPointerException("Could not find ClassDescriptor for name " + type); } for (ClassDescriptor cld : model.getAllSubs(bagTypeCld)) { classAndSubs.add(cld.getUnqualifiedName()); } if( includeSupers ){ for (ClassDescriptor cld : bagTypeCld.getAllSuperDescriptors()) { classAndSubs.add(cld.getUnqualifiedName()); } } Map<String, InterMineBag> bagsOfType = new HashMap<String, InterMineBag>(); for (Map.Entry<String, InterMineBag> entry : bags.entrySet()) { InterMineBag bag = entry.getValue(); if (classAndSubs.contains(bag.getType())) { if ((onlyCurrent && bag.isCurrent()) || !onlyCurrent) { bagsOfType.put(entry.getKey(), bag); } } } return bagsOfType; }</code><technical_language>rename classAndSubs acceptableTypes</technical_language>

Target:
private Map<String, InterMineBag> filterBagsByType(Map<String, InterMineBag> bags, String type, boolean onlyCurrent, boolean includeSupers) { Set<String> acceptableTypes = new HashSet<String>(); acceptableTypes.add(type); ClassDescriptor bagTypeCld = model.getClassDescriptorByName(type); if (bagTypeCld == null) { throw new NullPointerException("Could not find ClassDescriptor for name " + type); } for (ClassDescriptor cld : model.getAllSubs(bagTypeCld)) { acceptableTypes.add(cld.getUnqualifiedName()); } if (includeSupers) { for (ClassDescriptor cld : bagTypeCld.getAllSuperDescriptors()) { acceptableTypes.add(cld.getUnqualifiedName()); } } Map<String, InterMineBag> bagsOfType = new HashMap<String, InterMineBag>(); for (Map.Entry<String, InterMineBag> entry : bags.entrySet()) { InterMineBag bag = entry.getValue(); if (acceptableTypes.contains(bag.getType())) { if ((onlyCurrent && bag.isCurrent()) || !onlyCurrent) { bagsOfType.put(entry.getKey(), bag); } } } return bagsOfType; }
Source:
<code>public SessionDatum getNeededDatum(Entry entry) { Vector<SessionDatum> allDatumsNeeded = entry.getSessionDataReqs(); OrderedHashtable datumsSoFar = getCollectedDatums(); <START> if (datumsSoFar.size() >= allDatumsNeeded.size()) { <END> return null; } return getFirstMissingDatum(datumsSoFar, allDatumsNeeded); }</code><technical_language>This a sufficient check, frame additional data is irrelevant (is kind of a long story). way, prefer stick full check</technical_language>

Target:
public SessionDatum getNeededDatum(Entry entry) { return getFirstMissingDatum(getData(), entry.getSessionDataReqs()); }
Source:
<code>protected Schema getSchema(String topic) { Schema schema; if (schemaSubjectOverride != null && !schemaSubjectOverride.isEmpty()) { schema = schemaRegistryClient.getSchema(schemaSubjectOverride); } else { try { <START> schema = schemaRegistryClient.getSchema(topic); <END> } catch (IllegalStateException exc) { topic += schemaSubjectSuffix; schema = schemaRegistryClient.getSchema(topic); } } return schema; }</code><technical_language>Is this call expensive? involve remote RPC? this schemaRegistryClient.getSchema() happening multiple times in this routine</technical_language>

Target:
protected Schema getSchema(String topic) { String subjectOverride = getSchemaSubjectOverride(topic); if (!subjectOverride.isEmpty()) { topic = subjectOverride; } else if (!schemaSubjectSuffix.isEmpty()) { topic += schemaSubjectSuffix; } return schemaRegistryClient.getSchema(topic); }
Source:
<code>protected void performLiquibaseTask(Liquibase liquibase) throws LiquibaseException { if (! hasProLicense()) { return; } Database database = liquibase.getDatabase(); LiquibaseCommand liquibaseCommand = (CommandFactory.getInstance().getCommand("rollbackOneChangeSet")); AbstractSelfConfiguratingCommand configuratingCommand = (AbstractSelfConfiguratingCommand)liquibaseCommand; Map<String, Object> argsMap = getCommandArgsObjectMap(liquibase); ChangeLogParameters clp = new ChangeLogParameters(database); argsMap.put("changeLogParameters", clp); <START> if (force != null) { <END> argsMap.put("force", Boolean.TRUE); } configuratingCommand.configure(argsMap); try { liquibaseCommand.execute(); } catch (CommandExecutionException cee) { throw new LiquibaseException("Error executing rollbackOneChangeSet", cee); } }</code><technical_language>pass force=true argument, "true"</technical_language>

Target:
protected void performLiquibaseTask(Liquibase liquibase) throws LiquibaseException { if (! hasProLicense()) { throw new LiquibaseException("The command 'rollbackOneChangeSet' requires a Liquibase Pro License, available at <LINK_0>"); } Database database = liquibase.getDatabase(); LiquibaseCommand liquibaseCommand = (CommandFactory.getInstance().getCommand("rollbackOneChangeSet")); AbstractSelfConfiguratingCommand configuratingCommand = (AbstractSelfConfiguratingCommand)liquibaseCommand; Map<String, Object> argsMap = getCommandArgsObjectMap(liquibase); ChangeLogParameters clp = new ChangeLogParameters(database); argsMap.put("changeLogParameters", clp); if (force == null || (force != null && ! Boolean.parseBoolean(force))) { throw new LiquibaseException("Invalid value for --force. You must specify 'liquibase.force=true' to use rollbackOneChangeSet."); } argsMap.put("force", Boolean.TRUE); argsMap.put("liquibase", liquibase); configuratingCommand.configure(argsMap); try { liquibaseCommand.execute(); } catch (CommandExecutionException cee) { throw new LiquibaseException("Error executing rollbackOneChangeSet", cee); } }
Source:
<code><START> public IScheduledFuture<?> scheduleOnKeyOwnerAtFixedRate(@Nonnull Runnable command, <END> @Nonnull Object key, long initialDelay, long period, @Nonnull TimeUnit unit) { checkNotNull(command, "Command is null"); checkNotNull(key, "Key is null"); checkNotNull(unit, "Unit is null"); initializeManagedContext(command); String name = extractNameOrGenerateOne(command); int partitionId = getKeyPartitionId(key); ScheduledRunnableAdapter<?> adapter = createScheduledRunnableAdapter(command); TaskDefinition definition = new TaskDefinition(TaskDefinition.Type.AT_FIXED_RATE, name, adapter, initialDelay, period, unit); return submitOnPartitionSync(name, new ScheduleTaskOperation(getName(), definition), partitionId); }</code><technical_language>introduce a generic type V (and in similar methods) consistent other methods</technical_language>

Target:
public <V> IScheduledFuture<V> scheduleOnKeyOwnerAtFixedRate(@Nonnull Runnable command, @Nonnull Object key, long initialDelay, long period, @Nonnull TimeUnit unit) { checkNotNull(command, "Command is null"); checkNotNull(key, "Key is null"); checkNotNull(unit, "Unit is null"); initializeManagedContext(command); String name = extractNameOrGenerateOne(command); int partitionId = getKeyPartitionId(key); ScheduledRunnableAdapter<?> adapter = createScheduledRunnableAdapter(command); TaskDefinition definition = new TaskDefinition(TaskDefinition.Type.AT_FIXED_RATE, name, adapter, initialDelay, period, unit); return submitOnPartitionSync(name, new ScheduleTaskOperation(getName(), definition), partitionId); }
Source:
<code>private String requestTicketGrantingTicket(final String username, final String password) { HttpURLConnection connection = null; try { connection = HttpUtils.openConnection(endpointURL); final String payload = HttpUtils.encodeQueryParam("username", username) + "&" + HttpUtils.encodeQueryParam("password", password); final BufferedWriter out = new BufferedWriter(new OutputStreamWriter(connection.getOutputStream())); out.write(payload); out.close(); final String locationHeader = connection.getHeaderField("location"); final int responseCode = connection.getResponseCode(); if (locationHeader != null && responseCode == HttpStatus.SC_CREATED) { return locationHeader.substring(locationHeader.lastIndexOf("/") + 1); } throw new IllegalStateException("Ticket granting ticket request failed: " + HttpUtils.buildHttpErrorMessage(connection)); } catch (final IOException e) { <START> throw new RuntimeException(e); <END> } finally { HttpUtils.closeConnection(connection); } }</code><technical_language>If a technical exception happens, a TechnicalException thrown catched DirectHttpClient. If a functional exception happens, a CredentialsException a subclass of thrown catched DirectHttpClient</technical_language>

Target:
private String requestTicketGrantingTicket(final String username, final String password) { HttpURLConnection connection = null; try { connection = HttpUtils.openConnection(new URL(getCasRestUrl())); final String payload = HttpUtils.encodeQueryParam(getUsernameParameter(), username) + "&" + HttpUtils.encodeQueryParam(getPasswordParameter(), password); final BufferedWriter out = new BufferedWriter(new OutputStreamWriter(connection.getOutputStream())); out.write(payload); out.close(); final String locationHeader = connection.getHeaderField("location"); final int responseCode = connection.getResponseCode(); if (locationHeader != null && responseCode == HttpStatus.SC_CREATED) { return locationHeader.substring(locationHeader.lastIndexOf("/") + 1); } throw new TechnicalException("Ticket granting ticket request failed: " + locationHeader + " " + responseCode + HttpUtils.buildHttpErrorMessage(connection)); } catch (final IOException e) { throw new TechnicalException(e); } finally { HttpUtils.closeConnection(connection); } }
Source:
<code>public void preprocess(DataSetLookup lookup) { if (identityProvider == null || userGroupCallback == null) { return; } ColumnFilter columnFilter; List<Comparable> orgEntities = new ArrayList<>(); if (lookup.getFirstFilterOp() != null) { List<String> potOwners = new ArrayList<String>(); List<CoreFunctionFilter> columnFilters = extractCoreFunctionFilter(lookup.getFirstFilterOp().getColumnFilterList()); Iterator<CoreFunctionFilter> it = columnFilters.iterator(); while (orgEntities.isEmpty() && it.hasNext()) { CoreFunctionFilter column = it.next(); if (column.getColumnId().toUpperCase().equals(columnId)) { potOwners.addAll(column.getParameters()); for (String potOwner : potOwners) { addUserAndGroupsFromIdentityProvider(orgEntities, potOwner); } } <START> removeCoreFunctionFilter(lookup.getFirstFilterOp().getColumnFilterList(), column); <END> } if (orgEntities.isEmpty()) { addUserAndGroupsFromIdentityProvider(orgEntities, identityProvider.getName()); } columnFilter = AND(in(COLUMN_POTOWNER, orgEntities)); lookup.getFirstFilterOp().addFilterColumn(columnFilter); } else { DataSetFilter filter = new DataSetFilter(); addUserAndGroupsFromIdentityProvider(orgEntities, identityProvider.getName()); columnFilter = AND(in(COLUMN_POTOWNER, orgEntities)); filter.addFilterColumn(columnFilter); lookup.addOperation(filter); } LOGGER.debug("Adding column filter: {}", columnFilter); super.preprocess(lookup); }</code><technical_language>this in exact location 'it.remove()' before</technical_language>

Target:
public void preprocess(DataSetLookup lookup) { if (identityProvider == null || userGroupCallback == null) { return; } ColumnFilter columnFilter; List<Comparable> orgEntities = new ArrayList<>(); if (lookup.getFirstFilterOp() != null) { List<String> potOwners = new ArrayList<String>(); List<CoreFunctionFilter> columnFilters = extractCoreFunctionFilter(lookup.getFirstFilterOp().getColumnFilterList()); Iterator<CoreFunctionFilter> it = columnFilters.iterator(); while (orgEntities.isEmpty() && it.hasNext()) { CoreFunctionFilter column = it.next(); if (column.getColumnId().toUpperCase().equals(columnId)) { potOwners.addAll(column.getParameters()); for (String potOwner : potOwners) { addUserAndGroupsFromIdentityProvider(orgEntities, potOwner); } removeCoreFunctionFilter(lookup.getFirstFilterOp().getColumnFilterList(), column); } } if (orgEntities.isEmpty()) { addUserAndGroupsFromIdentityProvider(orgEntities, identityProvider.getName()); } columnFilter = AND(in(COLUMN_POTOWNER, orgEntities)); lookup.getFirstFilterOp().addFilterColumn(columnFilter); } else { DataSetFilter filter = new DataSetFilter(); addUserAndGroupsFromIdentityProvider(orgEntities, identityProvider.getName()); columnFilter = AND(in(COLUMN_POTOWNER, orgEntities)); filter.addFilterColumn(columnFilter); lookup.addOperation(filter); } LOGGER.debug("Adding column filter: {}", columnFilter); super.preprocess(lookup); }
Source:
<code>public void verifyKafkaRpcWithIcmpServiceDetection() throws Exception { DetectorsOnMinionIT.addRequisition(restClient, "MINION", LOCALHOST); await().atMost(3, MINUTES).pollInterval(15, SECONDS) <START> .until(this::detectJdbcAtLocationMinion, containsString("'JDBC' WAS detected on localhost")); <END> }</code><technical_language>opt *add* JDBC instead of changing ICMP JDBC</technical_language>

Target:
public void verifyKafkaRpcWithIcmpServiceDetection() throws Exception { DetectorsOnMinionIT.addRequisition(restClient, "MINION", LOCALHOST); await().atMost(3, MINUTES).pollInterval(15, SECONDS) .until(this::detectIcmpAtLocationMinion, containsString("'ICMP' WAS detected on 127.0.0.1")); }
Source:
<code>public void testAdaptWithTable(){ int maxVersion = 1; GCRules.GCRule gcRule = GCRULES.maxVersions(maxVersion); ColumnFamily columnFamily = ColumnFamily.newBuilder() .setGcRule(gcRule.toProto()).build(); <START> Table table = Table.fromProto(com.google.bigtable.admin.v2.Table.newBuilder() <END> .setName(TABLE_NAME) .putColumnFamilies(COLUMN_FAMILY, columnFamily).build()); TableDescriptor actualTableDesc = tableAdapter2x.adapt(table); TableDescriptor expected = new HTableDescriptor(TableName.valueOf(TABLE_ID)) .addFamily(new HColumnDescriptor(COLUMN_FAMILY)); Assert.assertEquals(expected, actualTableDesc); }</code><technical_language>This wrong. construct a mode.Table</technical_language>

Target:
public void testAdaptWithTable(){ int maxVersion = 1; GCRules.GCRule gcRule = GCRULES.maxVersions(maxVersion); ColumnFamily columnFamily = ColumnFamily.newBuilder() .setGcRule(gcRule.toProto()).build(); Table table = Table.newBuilder() .setName(TABLE_NAME) .putColumnFamilies(COLUMN_FAMILY, columnFamily).build(); TableDescriptor actualTableDesc = tableAdapter2x.adapt( com.google.cloud.bigtable.admin.v2.models.Table.fromProto(table)); TableDescriptor expected = new HTableDescriptor(TableName.valueOf(TABLE_ID)) .addFamily(new HColumnDescriptor(COLUMN_FAMILY)); Assert.assertEquals(expected, actualTableDesc); }
Source:
<code>public void testGetCatalogEntityPlusVersionDetails() { CatalogEntitySummary details = client().resource( URI.create("/v1/catalog/entities/brooklyn.entity.nosql.redis.RedisStore:0.0.0.SNAPSHOT")) .get(CatalogEntitySummary.class); assertTrue(details.toString().contains("redis.port"), "expected more config, only got: "+details); <START> String iconUrl = "/v1/catalog/icon/" + details.getSymbolicName(); <END> assertTrue(details.getIconUrl().contains(iconUrl), "expected brooklyn URL for icon image, but got: "+details.getIconUrl()); }</code><technical_language>versioned API - "/v1/catalog/icon/" + details.getSymbolicName() + "/" + details.getVersion() current URL return latest item (not necessarily expect)</technical_language>

Target:
public void testGetCatalogEntityPlusVersionDetails() { CatalogEntitySummary details = client().resource( URI.create("/v1/catalog/entities/brooklyn.entity.nosql.redis.RedisStore:0.0.0.SNAPSHOT")) .get(CatalogEntitySummary.class); assertTrue(details.toString().contains("redis.port"), "expected more config, only got: "+details); String expectedIconUrl = "/v1/catalog/icon/" + details.getSymbolicName() + "/" + details.getVersion(); assertEquals(details.getIconUrl(), expectedIconUrl, "expected brooklyn URL for icon image ("+expectedIconUrl+"), but got: "+details.getIconUrl()); }
Source:
<code>private void startFileIngestProgressBar() { if (this.doUI) { synchronized (this.fileIngestProgressLock) { String displayName = NbBundle.getMessage(this.getClass(), "IngestJob.progress.fileIngest.displayName", <START> getDataSourceName()); <END> this.fileIngestProgress = ProgressHandle.createHandle(displayName, new Cancellable() { @Override public boolean cancel() { IngestJobPipeline.this.cancel(IngestJob.CancellationReason.USER_CANCELLED); return true; } }); this.fileIngestProgress.start(); this.fileIngestProgress.switchToDeterminate((int) this.estimatedFilesToProcess); } } }</code><technical_language>a data source now</technical_language>

Target:
private void startFileIngestProgressBar() { if (this.doUI) { synchronized (this.fileIngestProgressLock) { String displayName = NbBundle.getMessage(this.getClass(), "IngestJob.progress.fileIngest.displayName", this.dataSource.getName()); this.fileIngestProgress = ProgressHandle.createHandle(displayName, new Cancellable() { @Override public boolean cancel() { IngestJobPipeline.this.cancel(IngestJob.CancellationReason.USER_CANCELLED); return true; } }); this.fileIngestProgress.start(); this.fileIngestProgress.switchToDeterminate((int) this.estimatedFilesToProcess); } } }
Source:
<code>public TokenTag(String token, String tag, String[] addtionalData) { <START> this.token = token; <END> this.tag = tag; this.addtionalData = addtionalData; }</code><technical_language>need copy array object immutable</technical_language>

Target:
public TokenTag(String token, String tag, String[] addtionalData) { this.token = token; this.tag = tag; if (addtionalData != null) { this.addtionalData = Arrays.copyOf(addtionalData, addtionalData.length); } else { this.addtionalData = null; } }
Source:
<code>public E addEdge(V vertex, V targetVertex, Object... attributes) { <START> final VertexInfo<V, E> outInfo = vertexOutMap.get(vertex); <END> if (outInfo == null) { throw new IllegalArgumentException("no vertex " + vertex); } final VertexInfo<V, E> inInfo = vertexInMap.get(targetVertex); if (inInfo == null) { throw new IllegalArgumentException("no vertex " + targetVertex); } @SuppressWarnings("unchecked") final AttributedEdgeFactory<V, E> f = (AttributedEdgeFactory) this.edgeFactory; final E edge = f.createEdge(vertex, targetVertex, attributes); if (edges.add(edge)) { outInfo.edges.add(edge); inInfo.edges.add(edge); return edge; } else { return null; } }</code><technical_language>addEdge(), removeEdge() logics base class. do need override here</technical_language>

Target:
public E addEdge(V vertex, V targetVertex, Object... attributes) { final VertexInfo<V, E> srcInfo = vertexMap.get(vertex); if (srcInfo == null) { throw new IllegalArgumentException("no vertex " + vertex); } final VertexInfo<V, E> dstInfo = vertexMap.get(targetVertex); if (dstInfo == null) { throw new IllegalArgumentException("no vertex " + targetVertex); } @SuppressWarnings("unchecked") final AttributedEdgeFactory<V, E> f = (AttributedEdgeFactory) this.edgeFactory; final E edge = f.createEdge(vertex, targetVertex, attributes); if (edges.add(edge)) { srcInfo.outEdges.add(edge); dstInfo.inEdges.add(edge); return edge; } else { return null; } }
Source:
<code>public List<InputSplit> allocateWork(List<CamusRequest> requests, JobContext context) throws IOException { int numTasks = context.getConfiguration() .getInt("mapred.map.tasks", 30); List<InputSplit> kafkaETLSplits = new ArrayList<InputSplit>(); for (int i = 0; i < numTasks; i++) { if (requests.size() > 0) { kafkaETLSplits.add(new EtlSplit()); } } <START> long avgSize = getAvgRequestSize(requests); <END> Set<String> smallTopics = getSmallTopicList(requests, avgSize); List<CamusRequest> groupedRequests = groupSmallRequest(requests, smallTopics); reverseSortRequests(groupedRequests); for (CamusRequest r : requests) { EtlSplit split = getSmallestMultiSplit(kafkaETLSplits); if (r instanceof GroupedRequest){ for (CamusRequest r1 : (GroupedRequest)r) { split.addRequest(r1); } } else { split.addRequest(r); } } return kafkaETLSplits; }</code><technical_language>avg size puts 1/2 of items small items, this bar high? Especially put partitions belong topic small group, more 1/2. threshold set 1/3 1/4 of total items</technical_language>

Target:
public List<InputSplit> allocateWork(List<CamusRequest> requests, JobContext context) throws IOException { int numTasks = context.getConfiguration() .getInt("mapred.map.tasks", 30); List<InputSplit> kafkaETLSplits = new ArrayList<InputSplit>(); for (int i = 0; i < numTasks; i++) { if (requests.size() > 0) { kafkaETLSplits.add(new EtlSplit()); } } long avgSize = getAvgRequestSize(requests); List<CamusRequest> groupedRequests = groupSmallRequest(requests, avgSize); reverseSortRequests(groupedRequests); for (CamusRequest r : requests) { EtlSplit split = getSmallestMultiSplit(kafkaETLSplits); if (r instanceof GroupedRequest){ for (CamusRequest r1 : (GroupedRequest)r) { split.addRequest(r1); } } else { split.addRequest(r); } } return kafkaETLSplits; }
Source:
<code><START> protected static Tick nextTick() { <END> Calendar calendar = new GregorianCalendar(); calendar.setTimeInMillis(EnvironmentEdgeManager.currentTime()); int currentHour = calendar.get(Calendar.HOUR_OF_DAY); moveToNextHour(calendar); return new Tick(currentHour, calendar.getTimeInMillis()); }</code><technical_language>remove protected qualifier? want package private right</technical_language>

Target:
static Tick nextTick() { Calendar calendar = new GregorianCalendar(); calendar.setTimeInMillis(EnvironmentEdgeManager.currentTime()); int currentHour = calendar.get(Calendar.HOUR_OF_DAY); moveToNextHour(calendar); return new Tick(currentHour, calendar.getTimeInMillis()); }
Source:
<code>private static List<FormField> toFieldValueArray(List<FieldValue> valueArray, List<ReadResult> readResults) { return valueArray.stream() <START> .map(fieldValue -> setFormField(fieldValue.getText(), null, fieldValue, readResults)) <END> .collect(Collectors.toList()); }</code><technical_language>For a list labelData is null</technical_language>

Target:
private static List<FormField> toFieldValueArray(List<FieldValue> valueArray, List<ReadResult> readResults) { return valueArray.stream() .map(fieldValue -> { FieldData valueData = null; if (ARRAY != fieldValue.getType()) { valueData = new FieldData(fieldValue.getText(), toBoundingBox(fieldValue.getBoundingBox()), fieldValue.getPage() == null ? 1 : fieldValue.getPage(), setReferenceElements(fieldValue.getElements(), readResults)); } return setFormField(null, valueData, fieldValue, readResults); }) .collect(Collectors.toList()); }
Source:
<code>public <T> T construct(Class<T> componentType) { if (!configuration.clustering().cacheMode().isClustered()) { return null; } else if (configuration.transaction().transactionMode().isTransactional() && configuration.transaction().transactionProtocol().isTotalOrder()) { return (T) new TotalOrderTxPerCacheInboundInvocationHandler(); <START> } else if (configuration.transaction().transactionMode().isTransactional()){ <END> return (T) new TxNonTotalOrderPerCacheInboundInvocationHandler(); } else { return (T) new NonTotalOrderPerCacheInboundInvocationHandler(); } }</code><technical_language>put another if of else if. a more clear I confused calling isTransactional twice</technical_language>

Target:
public <T> T construct(Class<T> componentType) { if (!configuration.clustering().cacheMode().isClustered()) { return null; } else if (configuration.transaction().transactionMode().isTransactional()) { return configuration.transaction().transactionProtocol().isTotalOrder() ? (T) new TotalOrderTxPerCacheInboundInvocationHandler() : (T) new NonTotalOrderTxPerCacheInboundInvocationHandler(); } else { return (T) new NonTotalOrderPerCacheInboundInvocationHandler(); } }
Source:
<code>private InstanceId createInstance(Spanner spanner) throws InterruptedException, ExecutionException { InstanceConfigId instanceConfig = InstanceConfigId.of(PROJECT_NAME, "emulator-config"); InstanceId instanceId = InstanceId.of(PROJECT_NAME, INSTANCE_NAME); InstanceAdminClient insAdminClient = spanner.getInstanceAdminClient(); Instance instance = insAdminClient.createInstance(InstanceInfo.newBuilder(instanceId).setInstanceConfigId(instanceConfig).build()).get(); <START> System.out.println(">>>" + instance.getState()); <END> return instanceId; }</code><technical_language>remove printlns slf4j</technical_language>

Target:
private InstanceId createInstance(Spanner spanner) throws InterruptedException, ExecutionException { InstanceConfigId instanceConfig = InstanceConfigId.of(PROJECT_NAME, "emulator-config"); InstanceId instanceId = InstanceId.of(PROJECT_NAME, INSTANCE_NAME); InstanceAdminClient insAdminClient = spanner.getInstanceAdminClient(); Instance instance = insAdminClient.createInstance(InstanceInfo.newBuilder(instanceId).setNodeCount(1).setDisplayName("Test instance").setInstanceConfigId(instanceConfig).build()).get(); return instanceId; }
Source:
<code>public void setupRoutes() { path(controllerPath(), () -> { before("", mimeType, this::setContentType); before("/*", mimeType, this::setContentType); before("", this::verifyContentType); before("/*", this::verifyContentType); before(Routes.Stage.TRIGGER_STAGE_PATH, mimeType, apiAuthenticationHelper::checkPipelineGroupOperateUserAnd403); before(Routes.Stage.TRIGGER_FAILED_JOBS_PATH, mimeType, apiAuthenticationHelper::checkPipelineGroupOperateUserAnd403); before(Routes.Stage.TRIGGER_SELECTED_JOBS_PATH, mimeType, apiAuthenticationHelper::checkPipelineGroupOperateUserAnd403); before(Routes.Stage.TRIGGER_SELECTED_JOBS_PATH, mimeType, (req, res) -> { JsonReader requestBody = GsonTransformer.getInstance().jsonReaderFrom(req.body()); if (!requestBody.hasJsonObject(JOB_NAMES_PROPERTY)) { throw HaltApiResponses.haltBecauseOfReason(String.format("Could not read property '%s' in request body", JOB_NAMES_PROPERTY)); } <START> requestBody.readStringArrayIfPresent(JOB_NAMES_PROPERTY); <END> }); post(Routes.Stage.TRIGGER_STAGE_PATH, mimeType, this::triggerStage); post(Routes.Stage.TRIGGER_FAILED_JOBS_PATH, mimeType, this::rerunFailedJobs); post(Routes.Stage.TRIGGER_SELECTED_JOBS_PATH, mimeType, this::rerunSelectedJobs); }); }</code><technical_language>Ideally do this validation in controller itself</technical_language>

Target:
public void setupRoutes() { path(controllerPath(), () -> { before("", mimeType, this::setContentType); before("/*", mimeType, this::setContentType); before("", this::verifyContentType); before("/*", this::verifyContentType); before(Routes.Stage.TRIGGER_STAGE_PATH, mimeType, apiAuthenticationHelper::checkPipelineGroupOperateUserAnd403); before(Routes.Stage.TRIGGER_FAILED_JOBS_PATH, mimeType, apiAuthenticationHelper::checkPipelineGroupOperateUserAnd403); before(Routes.Stage.TRIGGER_SELECTED_JOBS_PATH, mimeType, apiAuthenticationHelper::checkPipelineGroupOperateUserAnd403); post(Routes.Stage.TRIGGER_STAGE_PATH, mimeType, this::triggerStage); post(Routes.Stage.TRIGGER_FAILED_JOBS_PATH, mimeType, this::rerunFailedJobs); post(Routes.Stage.TRIGGER_SELECTED_JOBS_PATH, mimeType, this::rerunSelectedJobs); exception(RecordNotFoundException.class, this::notFound); }); }
Source:
<code>public void testGetVmHostCount() throws Exception { <START> Guid guid = Guid.createGuidFromString("b399944a-81ab-4ec5-8266-e19ba7c3c9d1"); <END> List<VDSGroup> vdsGroups = new ArrayList<>(); vdsGroups.add(dao.get(guid)); List<VDSGroup> data = ((VdsGroupDAODbFacadeImpl) dao).getHostsAndVmsForClusters(vdsGroups); assertEquals("Incorrect number of VMs in cluster", data.get(0).getGroupHostsAndVms().getVms(), 11); assertEquals("Incorrect number of Hosts in cluster", data.get(0).getGroupHostsAndVms().getHosts(), 1); }</code><technical_language>I this FixturesTool FixturesTool.VDS_GROUP_RHEL6_ISCSI</technical_language>

Target:
public void testGetVmHostCount() throws Exception { Guid guid = FixturesTool.VDS_GROUP_RHEL6_ISCSI; List<VDSGroup> vdsGroups = new ArrayList<>(); vdsGroups.add(dao.get(guid)); List<VDSGroup> data = ((VdsGroupDAODbFacadeImpl) dao).getHostsAndVmsForClusters(vdsGroups); assertEquals("Incorrect number of VMs in cluster", data.get(0).getGroupHostsAndVms().getVms(), 11); assertEquals("Incorrect number of Hosts in cluster", data.get(0).getGroupHostsAndVms().getHosts(), 1); }
Source:
<code>public long count(String login, String loginPattern, Integer role, Integer status) { final CriteriaBuilder cb = criteriaBuilder(); final CriteriaQuery<User> criteria = cb.createQuery(User.class); final Root<User> from = criteria.from(User.class); final Predicate[] predicates = CriteriaHelper.userListPredicates(cb, from, ofNullable(login), ofNullable(loginPattern), ofNullable(role), ofNullable(status)); criteria.where(predicates); final TypedQuery<User> query = createQuery(criteria); <START> return query.getResultList().size(); <END> }</code><technical_language>Change getResultList().size() predicate count</technical_language>

Target:
public long count(String login, String loginPattern, Integer role, Integer status) { final CriteriaBuilder cb = criteriaBuilder(); final CriteriaQuery<Long> criteria = cb.createQuery(Long.class); final Root<User> from = criteria.from(User.class); final Predicate[] predicates = CriteriaHelper.userListPredicates(cb, from, ofNullable(login), ofNullable(loginPattern), ofNullable(role), ofNullable(status)); criteria.where(predicates); criteria.select(cb.count(from)); return count(criteria); }
Source:
<code>private void assertExecutionResults(Class<?> testClass, boolean nested) { EngineTestKit.engine("junit-jupiter") .selectors(selectClass(testClass)) <START> .configurationParameter("junit.jupiter.conditions.deactivate", "org.junit.jupiter.engine.extension.DisabledCondition") <END> .execute().tests() .assertStatistics(stats -> stats.started(nested ? 8 : 4).succeeded(nested ? 4 : 2).failed(nested ? 4 : 2)) .failed() .assertThatEvents().haveExactly(nested ? 2 : 1, event(test("multipleFailures"), finishedWithFailure(instanceOf(AssertJMultipleFailuresError.class), message(msg -> msg.contains("Multiple Failures (2 failures)"))))) .haveExactly(nested ? 2 : 1, event(test("parameterizedTest"), finishedWithFailure(instanceOf(AssertJMultipleFailuresError.class), message(msg -> msg.contains("Multiple Failures (1 failure)"))))); }</code><technical_language>DisabledCondition.class.getName() avoid relying a String DisabledCondition is public, is making public considered ? This is a blocker for this PR ;-)</technical_language>

Target:
private void assertExecutionResults(Class<?> testClass, boolean nested) { EngineTestKit.engine("junit-jupiter") .selectors(selectClass(testClass)) .configurationParameter("junit.jupiter.conditions.deactivate", "*") .execute().tests() .assertStatistics(stats -> stats.started(nested ? 8 : 4).succeeded(nested ? 4 : 2).failed(nested ? 4 : 2)) .failed() .assertThatEvents().haveExactly(nested ? 2 : 1, event(test("multipleFailures"), finishedWithFailure(instanceOf(AssertJMultipleFailuresError.class), message(msg -> msg.contains("Multiple Failures (2 failures)"))))) .haveExactly(nested ? 2 : 1, event(test("parameterizedTest"), finishedWithFailure(instanceOf(AssertJMultipleFailuresError.class), message(msg -> msg.contains("Multiple Failures (1 failure)"))))); }
Source:
<code>public boolean add(@NonNull Disposable disposable) { <START> ObjectHelper.requireNonNull(disposable, "Disposable item is null"); <END> if (!disposed) { synchronized (this) { if (!disposed) { OpenHashSet<Disposable> set = resources; if (set == null) { set = new OpenHashSet<Disposable>(); resources = set; } set.add(disposable); return true; } } } disposable.dispose(); return false; }</code><technical_language>disposable is null</technical_language>

Target:
public boolean add(@NonNull Disposable disposable) { ObjectHelper.requireNonNull(disposable, "disposable is null"); if (!disposed) { synchronized (this) { if (!disposed) { OpenHashSet<Disposable> set = resources; if (set == null) { set = new OpenHashSet<Disposable>(); resources = set; } set.add(disposable); return true; } } } disposable.dispose(); return false; }
Source:
<code>private SqlSingleOperandTypeChecker getChecker(SqlCallBinding callBinding) { final RelDataType operandType = callBinding.getOperandType(0); switch (operandType.getSqlTypeName()) { case ARRAY: return OperandTypes.family(SqlTypeFamily.INTEGER); case MAP: return OperandTypes.family( operandType.getKeyType().getSqlTypeName().getFamily()); case ROW: <START> return OperandTypes.STRING; <END> case ANY: case DYNAMIC_STAR: return OperandTypes.or( OperandTypes.family(SqlTypeFamily.INTEGER), OperandTypes.family(SqlTypeFamily.CHARACTER)); default: throw callBinding.newValidationSignatureError(); } }</code><technical_language>OperandTypeChecker for STRING allows BINARY VARBINARY types, types allowed there, CHARACTER type checker used</technical_language>

Target:
private SqlSingleOperandTypeChecker getChecker(SqlCallBinding callBinding) { final RelDataType operandType = callBinding.getOperandType(0); switch (operandType.getSqlTypeName()) { case ARRAY: return OperandTypes.family(SqlTypeFamily.INTEGER); case MAP: return OperandTypes.family( operandType.getKeyType().getSqlTypeName().getFamily()); case ROW: return OperandTypes.CHARACTER; case ANY: case DYNAMIC_STAR: return OperandTypes.or( OperandTypes.family(SqlTypeFamily.INTEGER), OperandTypes.family(SqlTypeFamily.CHARACTER)); default: throw callBinding.newValidationSignatureError(); } }
Source:
<code>public void onRollback() { log.debug("Rollback <START> occured, releasing <END> macs {}.", Arrays.toString(super.macs.toArray())); releaseMacs(); }</code><technical_language>s/occured/occurred/</technical_language>

Target:
public void onRollback() { log.debug("Rollback occurred, releasing macs {}.", super.macs); releaseMacs(); }
Source:
<code>int maybeCommitPerUserRequested() { int committed = 0; RuntimeException firstException = null; for (final StreamTask task : running.values()) { try { if (task.commitRequested() && task.commitNeeded()) { task.commit(); <START> committed++; <END> log.debug("Committed active task per user request in", task.id()); } } catch (final TaskMigratedException e) { log.info("Failed to commit since it got migrated to another thread already. " + "Will trigger a new rebalance and close all tasks as zombies together.", task.id()); throw e; } catch (final RuntimeException t) { log.error("Failed to commit StreamTask due to the following error:", task.id(), t); if (firstException == null) { firstException = t; } } } if (firstException != null) { throw firstException; } return committed; }</code><technical_language>better</technical_language>

Target:
int maybeCommitPerUserRequested() { int committed = 0; RuntimeException firstException = null; for (final StreamTask task : running.values()) { try { if (task.commitRequested() && task.commitNeeded()) { task.commit(); committed++; log.debug("Committed stream task per user request in", task.id()); } } catch (final TaskMigratedException e) { log.info("Failed to commit stream task since it got migrated to another thread already. " + "Will trigger a new rebalance and close all tasks as zombies together.", task.id()); throw e; } catch (final RuntimeException t) { log.error("Failed to commit stream task due to the following error:", task.id(), t); if (firstException == null) { firstException = t; } } } if (firstException != null) { throw firstException; } return committed; }
Source:
<code>public LinuxSensors() { for (String sensor : SENSORS) { final String sensorPrefix = sensor; getSensorFilesFromPath(HWMON, sensor, new FileFilter() { @Override public boolean accept(File f) { try { return f.getName().startsWith(sensorPrefix) && f.getName().endsWith("_input") && FileUtil.getIntFromFile(f.getCanonicalPath()) > 0; } <START> catch(Exception e) { <END> return false; } } }); } if (!this.sensorsMap.containsKey(TEMP)) { getSensorFilesFromPath(THERMAL_ZONE, TEMP, new FileFilter() { @Override public boolean accept(File f) { return f.getName().equals(TEMP); } }); } }</code><technical_language>I catching exceptions here. narrow this actual exception thrown? log a message other returning</technical_language>

Target:
public LinuxSensors() { for (String sensor : SENSORS) { final String sensorPrefix = sensor; getSensorFilesFromPath(HWMON, sensor, new FileFilter() { @Override public boolean accept(File f) { try { return f.getName().startsWith(sensorPrefix) && f.getName().endsWith("_input") && FileUtil.getIntFromFile(f.getCanonicalPath()) > 0; } catch (IOException e) { return false; } } }); } if (!this.sensorsMap.containsKey(TEMP)) { getSensorFilesFromPath(THERMAL_ZONE, TEMP, new FileFilter() { @Override public boolean accept(File f) { return f.getName().equals(TEMP); } }); } }
Source:
<code>public boolean equals(Object other) { if (other == this) { return true; } else if (other instanceof AggregateMetadata) { AggregateMetadata that = (AggregateMetadata) other; return Objects.equals(this.keyspace, that.getKeyspace()) && Objects.equals(this.signature, that.getSignature()) <START> && Objects.equals(this.finalFuncSignature, that.getFinalFuncSignature().orElse(null)) <END> && Objects.equals(this.initCond, that.getInitCond()) && Objects.equals(this.returnType, that.getReturnType()) && Objects.equals(this.stateFuncSignature, that.getStateFuncSignature()) && Objects.equals(this.stateType, that.getStateType()); } else { return false; } }</code><technical_language>Good catch. for initCond next line. a bit unnerving this is a compile-time error :( EDIT -- I checked a structural search: Objects.equals($o1$, $o2$) a constraint o2's expression type java\.util\.Optional. This is occurrence</technical_language>

Target:
public boolean equals(Object other) { if (other == this) { return true; } else if (other instanceof AggregateMetadata) { AggregateMetadata that = (AggregateMetadata) other; return Objects.equals(this.keyspace, that.getKeyspace()) && Objects.equals(this.signature, that.getSignature()) && Objects.equals(this.finalFuncSignature, that.getFinalFuncSignature().orElse(null)) && Objects.equals(this.initCond, that.getInitCond().orElse(null)) && Objects.equals(this.returnType, that.getReturnType()) && Objects.equals(this.stateFuncSignature, that.getStateFuncSignature()) && Objects.equals(this.stateType, that.getStateType()); } else { return false; } }
Source:
<code>public Mapping<String, V> build() { <START> return new ImmutableDomainWildcardMapping<V>(defaultValue, new LinkedHashMap<String, V>(map)); <END> }</code><technical_language>pass map ImmutableDomainWildcardMapping constructor (it copy internally)</technical_language>

Target:
public Mapping<String, V> build() { return new ImmutableDomainWildcardMapping<V>(defaultValue, map); }
Source:
<code><START> RequestSpec sslContext(Factory<SSLContext> factory) throws Exception; <END> MutableHeaders getHeaders(); RequestSpec headers(Action<? super MutableHeaders> action) throws Exception; RequestSpec method(String method); URI getUrl(); default RequestSpec readTimeoutSeconds(int seconds) { return readTimeout(Duration.of(seconds, SECONDS)); }</code><technical_language>this is warranted, invoke factory immediately (i.e. a user do this). If is needed, implemented interface default method</technical_language>

Target:
default RequestSpec sslContext(Factory<SSLContext> factory) throws Exception { return sslContext(factory.create()); }