auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void start() { String disableReceiver = System.getProperty(DISABLE_RECEIVER); <START> if (disableReceiver != null && Boolean.parseBoolean(disableReceiver)) { <END> log.info("Receiver disabled."); return; } try { ThriftDataReceiverConfiguration thriftDataReceiverConfiguration = new ThriftDataReceiverConfiguration( ServiceHolder.getDataBridgeReceiverService().getInitialConfig(), ServiceHolder.getCarbonRuntime().getConfiguration().getPortsConfig().getOffset()); if (ServiceHolder.getDataReceiver() == null) { ServiceHolder.setDataReceiver(new ThriftDataReceiverFactory().createAgentServer( thriftDataReceiverConfiguration, ServiceHolder.getDataBridgeReceiverService())); String hostName = thriftDataReceiverConfiguration.getReceiverHostName(); if (null == hostName) { hostName = HostAddressFinder.findAddress("localhost"); } ServiceHolder.getDataReceiver().start(hostName); } } catch (DataBridgeException e) { log.error("Can not create and start Agent Server ", e); } catch (RuntimeException e) { log.error("Error in starting Agent Server ", e); } catch (Throwable e) { log.error("Unexpected Error in starting Agent Server ", e); } }</code><technical_language>Boolean.parseBoolean() a null check inside, do need do a null check I guess</technical_language>

Target:
public void start() { String disableReceiver = System.getProperty(DISABLE_RECEIVER); if (Boolean.parseBoolean(disableReceiver)) { log.info("Receiver disabled."); return; } try { ThriftDataReceiverConfiguration thriftDataReceiverConfiguration = new ThriftDataReceiverConfiguration( ServiceHolder.getDataBridgeReceiverService().getInitialConfig(), ServiceHolder.getCarbonRuntime().getConfiguration().getPortsConfig().getOffset()); if (ServiceHolder.getDataReceiver() == null) { ServiceHolder.setDataReceiver(new ThriftDataReceiverFactory().createAgentServer( thriftDataReceiverConfiguration, ServiceHolder.getDataBridgeReceiverService())); String hostName = thriftDataReceiverConfiguration.getReceiverHostName(); if (null == hostName) { hostName = HostAddressFinder.findAddress("localhost"); } ServiceHolder.getDataReceiver().start(hostName); isStarted = true; } } catch (DataBridgeException e) { log.error("Can not create and start Agent Server ", e); } catch (RuntimeException e) { log.error("Error in starting Agent Server ", e); } catch (Throwable e) { log.error("Unexpected Error in starting Agent Server ", e); } }
Source:
<code>public static void input(@AggregationState HyperLogLogState state, @SqlType(StandardTypes.BIGINT) long value, @SqlType(StandardTypes.DOUBLE) double maxStandardError) { HyperLogLog hll = ApproximateCountDistinctAggregation.getOrCreateHyperLogLog(state, maxStandardError); state.addMemoryUsage(-hll.estimatedInMemorySize()); hll.add(value); <START> state.addMemoryUsage(hll.estimatedInMemorySize()); <END> }</code><technical_language>throw IllegalArgumentException in combine method below, show internal error in Presto (something happen), this show a user error. I repackaged: throw new PrestoException(INVALID_FUNCTION_ARGUMENT, e.getMessage(), e);</technical_language>

Target:
public static void input(@AggregationState HyperLogLogState state, @SqlType(StandardTypes.BIGINT) long value, @SqlType(StandardTypes.DOUBLE) double maxStandardError) { HyperLogLog hll = HyperLogLogUtils.getOrCreateHyperLogLog(state, maxStandardError); state.addMemoryUsage(-hll.estimatedInMemorySize()); hll.add(value); state.addMemoryUsage(hll.estimatedInMemorySize()); }
Source:
<code>public ProfileEntryValue convert( final com.alliander.osgp.domain.core.valueobjects.smartmetering.ProfileEntryValue source, final Type<? extends ProfileEntryValue> destinationType) { final ProfileEntryValue result = new ProfileEntryValue(); if (source.getValue() instanceof Date) { result.getStringValueOrDateValueOrFloatValue().add( <START> DateConverter.createXMLGregorianCalendar((Date) source.getValue())); <END> } else { result.getStringValueOrDateValueOrFloatValue().add(source.getValue()); } return result; }</code><technical_language>Register orika converter map Date XmlGregorianCalander</technical_language>

Target:
public ProfileEntryValue convert( final com.alliander.osgp.domain.core.valueobjects.smartmetering.ProfileEntryValue source, final Type<? extends ProfileEntryValue> destinationType) { final ProfileEntryValue result = new ProfileEntryValue(); if (source.getValue() instanceof Date) { final XMLGregorianCalendar xmlGregCal = this.mapperFacade .map(source.getValue(), XMLGregorianCalendar.class); result.getStringValueOrDateValueOrFloatValue().add(xmlGregCal); } else { result.getStringValueOrDateValueOrFloatValue().add(source.getValue()); } return result; }
Source:
<code>public void testCreate() throws StripeException { Map<String, Object> params = new HashMap<String, Object>(); params.put("amount", 100); params.put("currency", "usd"); params.put("destination", "acct_123"); <START> Transfer transfer = Transfer.create(params); <END> assertNotNull(transfer); verifyRequest( APIResource.RequestMethod.POST, "/v1/transfers", params ); }</code><technical_language>named resource</technical_language>

Target:
public void testCreate() throws StripeException { final Map<String, Object> params = new HashMap<String, Object>(); params.put("amount", 100); params.put("currency", "usd"); params.put("destination", "acct_123"); final Transfer transfer = Transfer.create(params); assertNotNull(transfer); verifyRequest( APIResource.RequestMethod.POST, "/v1/transfers", params ); }
Source:
<code>public DefaultLogger(String className) { String classPath; try { classPath = Class.forName(className).getCanonicalName(); } catch (ClassNotFoundException e) { classPath = className; } this.classPath = classPath; <START> this.configuredLogLevel = LogLevel.fromString(Configuration.getGlobalConfiguration().get(Configuration.PROPERTY_AZURE_LOG_LEVEL)) .getLogLevel(); <END> }</code><technical_language>configuredLogLevel is set in constructor. I if is worth a micro-optimisation determine log levels valid pre-compute boolean conditions here, simplify isTraceEnabled, methods</technical_language>

Target:
public DefaultLogger(String className) { String classPath; try { classPath = Class.forName(className).getCanonicalName(); } catch (ClassNotFoundException e) { classPath = className; } this.classPath = classPath; int configuredLogLevel = LogLevel.fromString(Configuration.getGlobalConfiguration().get(Configuration.PROPERTY_AZURE_LOG_LEVEL)) .getLogLevel(); isTraceEnabled = LogLevel.VERBOSE.getLogLevel() > configuredLogLevel; isDebugEnabled = LogLevel.VERBOSE.getLogLevel() >= configuredLogLevel; isInfoEnabled = LogLevel.INFORMATIONAL.getLogLevel() >= configuredLogLevel; isWarnEnabled = LogLevel.WARNING.getLogLevel() >= configuredLogLevel; isErrorEnabled = LogLevel.ERROR.getLogLevel() >= configuredLogLevel; }
Source:
<code>private static PlanFragment createTableScanPlanFragment(String name) { Symbol symbol = new Symbol("column"); PlanNode planNode = new TableScanNode( new PlanNodeId(name), <START> new TableHandle(new ConnectorId("test"), new TestingMetadata.TestingTableHandle()), <END> ImmutableList.of(symbol), ImmutableMap.of(symbol, new TestingColumnHandle("column")), Optional.empty(), TupleDomain.all(), null); return createFragment(planNode); }</code><technical_language>static import</technical_language>

Target:
private static PlanFragment createTableScanPlanFragment(String name) { Symbol symbol = new Symbol("column"); PlanNode planNode = new TableScanNode( new PlanNodeId(name), new TableHandle(new ConnectorId("test"), new TestingTableHandle()), ImmutableList.of(symbol), ImmutableMap.of(symbol, new TestingColumnHandle("column")), Optional.empty(), TupleDomain.all(), null); return createFragment(planNode); }
Source:
<code>private String getErrorPrefix() { <START> String toRet = "In presenter " + presenterInspector.getPresenterClassName() <END> + ", method " + functionName + " annotated with @" + ProxyEvent.class.getSimpleName(); if (classParameter != Null.class) { toRet += ", signed with one class parameter,"; } return toRet; }</code><technical_language>refactor toRet toReturn</technical_language>

Target:
private String getErrorPrefix() { String toReturn = "In presenter " + presenterInspector.getPresenterClassName() + ", method " + functionName + " annotated with @" + ProxyEvent.class.getSimpleName(); if (classParameter != Null.class) { toReturn += ", signed with one class parameter,"; } return toReturn; }
Source:
<code>public void testSingleTypeElement() throws IOException, ParserException { final TestFileUtilsImpl fileUtils = new TestFileUtilsImpl(); final Ds3SpecParser parser = new Ds3SpecParserImpl(); final Ds3ApiSpec spec = parser.getSpec(CCodeGenerator_Test.class.getResourceAsStream("/input/TypeElement.xml")); final CCodeGenerator codeGenerator = new CCodeGenerator(); codeGenerator.generate(spec, fileUtils, null); final ByteArrayOutputStream bstream = (ByteArrayOutputStream) fileUtils.getOutputStream(); final String output = new String(bstream.toByteArray()); LOG.info("Generated code:\n" + output); assertTrue(output.contains("typedef enum {")); assertTrue(output.contains(" ds3_str* api_version;")); assertTrue(output.contains(" ds3_bool backend_activated;")); assertTrue(output.contains(" ds3_build_information* build_information;")); assertTrue(output.contains(" ds3_str* serial_number;")); <START> assertTrue(output.contains("}")); <END> }</code><technical_language>checking for enum name</technical_language>

Target:
public void testSingleTypeElement() throws IOException, ParserException { final TestFileUtilsImpl fileUtils = new TestFileUtilsImpl(); final Ds3SpecParser parser = new Ds3SpecParserImpl(); final Ds3ApiSpec spec = parser.getSpec(CCodeGenerator_Test.class.getResourceAsStream("/input/TypeElement.xml")); final CCodeGenerator codeGenerator = new CCodeGenerator(); codeGenerator.generate(spec, fileUtils, null); final ByteArrayOutputStream bstream = (ByteArrayOutputStream) fileUtils.getOutputStream(); final String output = new String(bstream.toByteArray()); LOG.info("Generated code:\n" + output); assertTrue(output.contains("typedef enum {")); assertTrue(output.contains(" ds3_str* api_version;")); assertTrue(output.contains(" ds3_bool backend_activated;")); assertTrue(output.contains(" ds3_build_information* build_information;")); assertTrue(output.contains(" ds3_str* serial_number;")); assertTrue(output.contains("}ds3_get_system_information_response;")); }
Source:
<code>public List<CompletePaxosHistoryForNamespaceAndUseCase> getHistory() { Map<NamespaceAndUseCase, Long> lastVerifiedSequences = getNamespaceAndUseCaseToLastVerifiedSeqMap(); PaxosHistoryOnSingleNode localPaxosHistory = localHistoryLoader.getLocalPaxosHistory(lastVerifiedSequences); List<HistoryQuery> historyQueries = getHistoryQueryListForRemoteServers(lastVerifiedSequences); List<PaxosHistoryOnRemote> rawHistoryFromAllRemotes = getHistoriesFromRemoteServers(historyQueries); List<NamespaceAndUseCaseWiseConsolidatedLearnerAndAcceptorRecords> historyFromAllRemotes = buildHistoryFromRemoteResponses(rawHistoryFromAllRemotes); return consolidateAndGetHistoriesAcrossAllNodes( lastVerifiedSequences, localPaxosHistory, historyFromAllRemotes); <START> } <END></code><technical_language>This is a heavy class feels parts translating PaxosHistoryOnRemote CompletePaxosHistoryForNamespaceAndUseCase a bit of a separate concern data parts do. split this up, fine this in long track this return this project on</technical_language>

Target:
public List<CompletePaxosHistoryForNamespaceAndUseCase> getHistory() { Map<NamespaceAndUseCase, Long> lastVerifiedSequences = getNamespaceAndUseCaseToLastVerifiedSeqMap(); PaxosHistoryOnSingleNode localPaxosHistory = localHistoryLoader.getLocalPaxosHistory(lastVerifiedSequences); List<HistoryQuery> historyQueries = getHistoryQueryListForRemoteServers(lastVerifiedSequences); List<PaxosHistoryOnRemote> rawHistoryFromAllRemotes = getHistoriesFromRemoteServers(historyQueries); List<ConsolidatedPaxosHistoryOnSingleNode> historyFromAllRemotes = buildHistoryFromRemoteResponses(rawHistoryFromAllRemotes); return consolidateAndGetHistoriesAcrossAllNodes( lastVerifiedSequences, localPaxosHistory, historyFromAllRemotes); }
Source:
<code>private RowExpression toRowExpression(Session session, Expression projectionExpression) { Map<NodeRef<Expression>, Type> expressionTypes = getExpressionTypes( session, metadata, SQL_PARSER, <START> TypeProvider.copyOf(INPUT_TYPES), <END> projectionExpression, ImmutableList.of(), WarningCollector.NOOP); return toRowExpression(projectionExpression, expressionTypes, INPUT_MAPPING); }</code><technical_language>Wait, this SYMBOL_TYPES? confused..</technical_language>

Target:
private RowExpression toRowExpression(Session session, Expression projectionExpression) { Map<NodeRef<Expression>, Type> expressionTypes = getExpressionTypes( session, metadata, SQL_PARSER, SYMBOL_TYPES, projectionExpression, ImmutableList.of(), WarningCollector.NOOP); return toRowExpression(projectionExpression, expressionTypes, INPUT_MAPPING); }
Source:
<code>protected boolean checkBillingFrequency() { boolean success = true; String newBillingFrequencyCode = newAwardCopy.getBillingFrequencyCode(); String oldBillingFrequencyCode = oldAwardCopy.getBillingFrequencyCode(); <START> if (!org.apache.commons.lang3.StringUtils.equals(newBillingFrequencyCode, oldBillingFrequencyCode)) { <END> if (org.apache.commons.lang3.StringUtils.equals(oldBillingFrequencyCode, CGConstants.MILESTONE_BILLING_SCHEDULE_CODE) && SpringContext.getBean(AccountsReceivableModuleBillingService.class).hasActiveMilestones(newAwardCopy.getProposalNumber())) { success = false; putFieldError(CGPropertyConstants.AwardFields.BILLING_FREQUENCY_CODE, CGKeyConstants.AwardConstants.ERROR_CG_ACTIVE_MILESTONES_EXIST, getBillingFrequencyDescription(newAwardCopy)); } else if (org.apache.commons.lang3.StringUtils.equals(oldBillingFrequencyCode, CGConstants.PREDETERMINED_BILLING_SCHEDULE_CODE) && SpringContext.getBean(AccountsReceivableModuleBillingService.class).hasActiveBills(newAwardCopy.getProposalNumber())) { success = false; putFieldError(CGPropertyConstants.AwardFields.BILLING_FREQUENCY_CODE, CGKeyConstants.AwardConstants.ERROR_CG_ACTIVE_BILLS_EXIST, getBillingFrequencyDescription(newAwardCopy)); } } return success; }</code><technical_language>I change StringUtils import org.apache.commons.lang3.StringUtils needed changes</technical_language>

Target:
protected boolean checkBillingFrequency() { boolean success = true; String newBillingFrequencyCode = newAwardCopy.getBillingFrequencyCode(); String oldBillingFrequencyCode = oldAwardCopy.getBillingFrequencyCode(); if (!StringUtils.equals(newBillingFrequencyCode, oldBillingFrequencyCode)) { if (StringUtils.equals(oldBillingFrequencyCode, CGConstants.MILESTONE_BILLING_SCHEDULE_CODE) && SpringContext.getBean(AccountsReceivableModuleBillingService.class).hasActiveMilestones(newAwardCopy.getProposalNumber())) { success = false; putFieldError(CGPropertyConstants.AwardFields.BILLING_FREQUENCY_CODE, CGKeyConstants.AwardConstants.ERROR_CG_ACTIVE_MILESTONES_EXIST, getBillingFrequencyDescription(newAwardCopy)); } else if (StringUtils.equals(oldBillingFrequencyCode, CGConstants.PREDETERMINED_BILLING_SCHEDULE_CODE) && SpringContext.getBean(AccountsReceivableModuleBillingService.class).hasActiveBills(newAwardCopy.getProposalNumber())) { success = false; putFieldError(CGPropertyConstants.AwardFields.BILLING_FREQUENCY_CODE, CGKeyConstants.AwardConstants.ERROR_CG_ACTIVE_BILLS_EXIST, getBillingFrequencyDescription(newAwardCopy)); } } return success; }
Source:
<code><START> public void setNumerator(final long value) { <END> numerator.dec(numerator.getCount()); numerator.inc(value); }</code><technical_language>Method used, is included for completeness sake</technical_language>

Target:
public void setNumerator(final long value) { numerator.set(value); }
Source:
<code>private OnHeapValueHolder<V> putIfAbsent(final K key, final V value, boolean returnInCacheHolder) throws CacheAccessException { putIfAbsentObserver.begin(); checkKey(key); checkValue(value); final AtomicReference<OnHeapValueHolder<V>> returnValue = new AtomicReference<OnHeapValueHolder<V>>(null); final AtomicBoolean entryActuallyAdded = new AtomicBoolean(); final long now = timeSource.getTimeMillis(); try { OnHeapValueHolder<V> inCache = map.compute(key, new BiFunction<K, OnHeapValueHolder<V>, OnHeapValueHolder<V>>() { @Override public OnHeapValueHolder<V> apply(K mappedKey, OnHeapValueHolder<V> mappedValue) { if (mappedValue == null || mappedValue.isExpired(now, TimeUnit.MILLISECONDS)) { if (mappedValue != null) { onExpiration(mappedKey, mappedValue); } entryActuallyAdded.set(true); return newCreateValueHolder(key, value, now); } returnValue.set(mappedValue); <START> if (setAccessTimeAndExpiry(key, mappedValue, now) == null) { <END> onExpiration(mappedKey, mappedValue); return null; } return mappedValue; } }); if (entryActuallyAdded.get()) { putIfAbsentObserver.end(StoreOperationOutcomes.PutIfAbsentOutcome.PUT); enforceCapacity(1); } else { putIfAbsentObserver.end(StoreOperationOutcomes.PutIfAbsentOutcome.HIT); } if (returnInCacheHolder) { return inCache; } } catch (RuntimeException re) { handleRuntimeException(re); } return returnValue.get(); }</code><technical_language>a number of changes same. Refactor a new method setAccessTimeAndExpiryThenReturnMapping clarifies intent includes expiration notification needed. places differently invoke a refactored setAccessTimeAndExpiry</technical_language>

Target:
private OnHeapValueHolder<V> putIfAbsent(final K key, final V value, boolean returnInCacheHolder) throws CacheAccessException { putIfAbsentObserver.begin(); checkKey(key); checkValue(value); final AtomicReference<OnHeapValueHolder<V>> returnValue = new AtomicReference<OnHeapValueHolder<V>>(null); final AtomicBoolean entryActuallyAdded = new AtomicBoolean(); final long now = timeSource.getTimeMillis(); try { OnHeapValueHolder<V> inCache = map.compute(key, new BiFunction<K, OnHeapValueHolder<V>, OnHeapValueHolder<V>>() { @Override public OnHeapValueHolder<V> apply(K mappedKey, OnHeapValueHolder<V> mappedValue) { if (mappedValue == null || mappedValue.isExpired(now, TimeUnit.MILLISECONDS)) { if (mappedValue != null) { onExpiration(mappedKey, mappedValue); } entryActuallyAdded.set(true); return newCreateValueHolder(key, value, now); } returnValue.set(mappedValue); return setAccessTimeAndExpiryThenReturnMapping(key, mappedValue, now, false); } }); if (entryActuallyAdded.get()) { putIfAbsentObserver.end(StoreOperationOutcomes.PutIfAbsentOutcome.PUT); enforceCapacity(1); } else { putIfAbsentObserver.end(StoreOperationOutcomes.PutIfAbsentOutcome.HIT); } if (returnInCacheHolder) { return inCache; } } catch (RuntimeException re) { handleRuntimeException(re); } return returnValue.get(); }
Source:
<code>public EngineBackupLog getLastSuccessfulEngineBackup(String dbName) { <START> TypedQuery query <END> = entityManager.createNamedQuery("EngineBackupLog.getLatest", EngineBackupLog.class).setParameter("dbName", dbName); query.setMaxResults(1); EngineBackupLog log = singleResult(query); return log; }</code><technical_language>TypedQuery, name reminds, is parameterized, please TypedQuery<EngineBackupLog></technical_language>

Target:
public EngineBackupLog getLastSuccessfulEngineBackup(String dbName) { TypedQuery<EngineBackupLog> query = entityManager.createNamedQuery("EngineBackupLog.getLatest", EngineBackupLog.class).setParameter("dbName", dbName).setMaxResults(1); return singleResult(query); }
Source:
<code>public Mono<ResponseEntity<?>> setSignal(@ApiParam("Internal id for workflow instance") @PathVariable("id") long id, @RequestBody @Valid @ApiParam("New signal value") SetSignalRequest req) { return handleExceptions(() -> { <START> return wrapBlocking(() -> { <END> SetSignalResponse response = new SetSignalResponse(); response.setSignalSuccess = workflowInstances.setSignal(id, ofNullable(req.signal), req.reason, WorkflowActionType.externalChange); return ok(response); }); }); }</code><technical_language>remove unnecessary { return x; } wrapBlocking</technical_language>

Target:
public Mono<ResponseEntity<?>> setSignal(@ApiParam("Internal id for workflow instance") @PathVariable("id") long id, @RequestBody @Valid @ApiParam("New signal value") SetSignalRequest req) { return handleExceptions(() -> wrapBlocking(() -> { SetSignalResponse response = new SetSignalResponse(); response.setSignalSuccess = workflowInstances.setSignal(id, ofNullable(req.signal), req.reason, WorkflowActionType.externalChange); return ok(response); })); }
Source:
<code>@Test public void topPrivateDomain() { assertThat(parse("<LINK_0>").topPrivateDomain()).isEqualTo("google.com"); assertThat(parse("<LINK_6>").topPrivateDomain()) .isEqualTo("google.co.uk"); assertThat(parse("https://栃.栃木.jp").topPrivateDomain()) .isEqualTo("xn--ewv.xn--4pvxs.jp"); assertThat(parse("<LINK_1>").topPrivateDomain()) .isEqualTo("xn--ewv.xn--4pvxs.jp"); assertThat(parse("<LINK_4>").topPrivateDomain()).isNull(); assertThat(parse("https://square").topPrivateDomain()).isNull(); assertThat(parse("https://栃木.jp").topPrivateDomain()).isNull(); assertThat(parse("<LINK_2>").topPrivateDomain()).isNull(); assertThat(parse("https://localhost").topPrivateDomain()).isNull(); assertThat(parse("<LINK_3>").topPrivateDomain()).isNull(); <START> assertThat(parse("http://a./").topPrivateDomain()).isNull(); <END> }</code><technical_language>test these? a.. ..a a..b .a . .</technical_language>

Target:
@Test public void topPrivateDomain() { assertThat(parse("<LINK_0>").topPrivateDomain()).isEqualTo("google.com"); assertThat(parse("<LINK_6>").topPrivateDomain()) .isEqualTo("google.co.uk"); assertThat(parse("https://栃.栃木.jp").topPrivateDomain()) .isEqualTo("xn--ewv.xn--4pvxs.jp"); assertThat(parse("<LINK_1>").topPrivateDomain()) .isEqualTo("xn--ewv.xn--4pvxs.jp"); assertThat(parse("<LINK_4>").topPrivateDomain()).isNull(); assertThat(parse("https://square").topPrivateDomain()).isNull(); assertThat(parse("https://栃木.jp").topPrivateDomain()).isNull(); assertThat(parse("<LINK_2>").topPrivateDomain()).isNull(); assertThat(parse("https://localhost").topPrivateDomain()).isNull(); assertThat(parse("<LINK_3>").topPrivateDomain()).isNull(); assertThat(parse("http://a./").topPrivateDomain()).isNull(); assertThat(parse("http://./").topPrivateDomain()).isNull(); assertThat(parse("<LINK_5>").topPrivateDomain()).isEqualTo("squareup.com"); }
Source:
<code>public void validate(SourceStorage source, FactoryParameter.Version version) throws ConflictException { for (Map.Entry<String, String> entry : source.getParameters().entrySet()) { switch (entry.getKey()) { case "keepVcs": final String keepVcs = entry.getValue(); if (!"true".equals(keepVcs) && !"false".equals(keepVcs)) { throw new ConflictException( format( PARAMETRIZED_ILLEGAL_PARAMETER_VALUE_MESSAGE, "source.project.parameters.keepVcs", entry.getValue())); } break; case "skipFirstLevel": final String skipFirstLevel = entry.getValue(); if (!"true".equals(skipFirstLevel) && !"false".equals(skipFirstLevel)) { throw new ConflictException( format( PARAMETRIZED_ILLEGAL_PARAMETER_VALUE_MESSAGE, <START> "source.project.parameters.skipFirstLevel", <END> entry.getValue())); } break; case "branch": case "startPoint": case "commitId": case "keepDir": case "fetch": case "branchMerge": break; default: throw new ConflictException( format( PARAMETRIZED_INVALID_PARAMETER_MESSAGE, "source.project.parameters." + entry.getKey(), version)); } } }</code><technical_language>I is project field in source object while project object source field. "project.source.parameters.skipFirstLevel"</technical_language>

Target:
public void validate(SourceStorage source, FactoryParameter.Version version) throws ConflictException { for (Map.Entry<String, String> entry : source.getParameters().entrySet()) { switch (entry.getKey()) { case "keepVcs": final String keepVcs = entry.getValue(); if (!"true".equals(keepVcs) && !"false".equals(keepVcs)) { throw new ConflictException( format( PARAMETRIZED_ILLEGAL_PARAMETER_VALUE_MESSAGE, "source.project.parameters.keepVcs", entry.getValue())); } break; case "skipFirstLevel": final String skipFirstLevel = entry.getValue(); if (!"true".equals(skipFirstLevel) && !"false".equals(skipFirstLevel)) { throw new ConflictException( format( PARAMETRIZED_ILLEGAL_PARAMETER_VALUE_MESSAGE, "project.source.parameters.skipFirstLevel", entry.getValue())); } break; case "branch": case "startPoint": case "commitId": case "keepDir": case "fetch": case "branchMerge": break; default: throw new ConflictException( format( PARAMETRIZED_INVALID_PARAMETER_MESSAGE, "source.project.parameters." + entry.getKey(), version)); } } }
Source:
<code>public void setUp() { this.registration1 = TestClientRegistrations.clientRegistration().build(); this.registration2 = TestClientRegistrations.clientRegistration2().build(); <START> this.registration3 = TestClientRegistrations.clientRegistration3().build(); <END> this.pkceRegistration = TestClientRegistrations.clientRegistration() .registrationId("pkce-client-registration-id") .clientId("pkce-client-id") .clientAuthenticationMethod(ClientAuthenticationMethod.NONE) .clientSecret(null) .build(); this.clientRegistrationRepository = new InMemoryClientRegistrationRepository( this.registration1, this.registration2, this.registration3, this.pkceRegistration); this.resolver = new DefaultOAuth2AuthorizationRequestResolver( this.clientRegistrationRepository, this.authorizationRequestBaseUri); }</code><technical_language>registration1 care other is registration. For this case, registration3 needs new variables, (if is around) named more explicitly</technical_language>

Target:
public void setUp() { this.registration1 = TestClientRegistrations.clientRegistration().build(); this.registration2 = TestClientRegistrations.clientRegistration2().build(); this.fineRedirectUriTemplateRegistration = fineRedirectUriTemplateClientRegistration().build(); this.pkceRegistration = TestClientRegistrations.clientRegistration() .registrationId("pkce-client-registration-id") .clientId("pkce-client-id") .clientAuthenticationMethod(ClientAuthenticationMethod.NONE) .clientSecret(null) .build(); this.clientRegistrationRepository = new InMemoryClientRegistrationRepository( this.registration1, this.registration2, this.fineRedirectUriTemplateRegistration, this.pkceRegistration); this.resolver = new DefaultOAuth2AuthorizationRequestResolver( this.clientRegistrationRepository, this.authorizationRequestBaseUri); }
Source:
<code>public MetadataResponse resubmitMessage(EsbMessage esbMessage) { ResubmitRequest request = new ResubmitRequest(); EsbMessageEntity persistedMessage = entityMgr.find(EsbMessageEntity.class, esbMessage.getId()); request.setHeaders( reduceToEsbHeaders(persistedMessage) ); request.setDestination( persistedMessage.getHeader("esbResubmitDestination").getValue() ); request.setSystem( persistedMessage.getSourceSystem() ); if( persistedMessage == null ){ throw new IllegalArgumentException("Message {\n}"+esbMessage.toString()+"\n} does not exist in backend store, cannot update."); } if( isEditableMessage(esbMessage) ){ <START> request.setPayload( esbMessage.getPayload() ); <END> } else { request .setPayload( persistedMessage.getPayload() ); } saveAuditEvent( new AuditEvent(DEFAULT_USER, RESUBMIT_EVENT, "", "", "", request.getPayload().toString() ) ); MetadataResponse result = sendMessageToResubmitGateway( request.toString() ); persistedMessage.setResubmittedOn(new Date()); entityMgr.flush(); return result; }</code><technical_language>need (un-encrypt and) re-inject sensitive information previously extracted message (when persisted) resubmitting. This happen message is editable</technical_language>

Target:
public MetadataResponse resubmitMessage(EsbMessage esbMessage) { ResubmitRequest request = new ResubmitRequest(); EsbMessageEntity persistedMessage = entityMgr.find(EsbMessageEntity.class, esbMessage.getId()); if( persistedMessage == null ){ throw new IllegalArgumentException("Message {\n}"+esbMessage.toString()+"\n} does not exist in backend store, cannot update."); } try{ request.setDestination( persistedMessage.getHeader( getResubmitControlHeader() ).getValue() ); }catch(Exception e){ LOG.warn("Warning: Message that was resubmitted lacked configured control header! Message ID: " + new Long(esbMessage.getId()).toString() ); MetadataResponse result = new MetadataResponse(); result.setErrorMessage("Unable to resubmit message due to configured resubmit control header not being present on message."); return result; } request.setHeaders( reduceToEsbHeaders(persistedMessage) ); request.setSystem( persistedMessage.getSourceSystem() ); LOG.warn(esbMessage.toString()); if( isEditableMessage(persistedMessage) ){ request.setPayload( esbMessage.getPayload() ); } else { request.setPayload( persistedMessage.getPayload() ); } saveAuditEvent( new AuditEvent(DEFAULT_USER, RESUBMIT_EVENT, "", "", "", request.getPayload().toString() ) ); MetadataResponse result = sendMessageToResubmitGateway( request.toString() ); persistedMessage.setResubmittedOn(new Date()); entityMgr.flush(); return result; }
Source:
<code>public void verify(DecodedJWT jwt) throws SignatureVerificationException { byte[] contentBytes = String.format("%s.%s", jwt.getHeader(), jwt.getPayload()).getBytes(Charset.forName("UTF-8")); byte[] signatureBytes = Base64.decodeBase64(jwt.getSignature()); try { ECPublicKey publicKey = keyProvider.getPublicKeyById(jwt.getKeyId()); if (publicKey == null) { throw new IllegalStateException("The given Public Key is null."); } boolean valid = crypto.verifySignatureFor(getDescription(), publicKey, contentBytes, JOSEToDER(signatureBytes)); if (!valid) { throw new SignatureVerificationException(this); } <START> } catch (Exception e) { <END> throw new SignatureVerificationException(this, e); } }</code><technical_language>expand catch clause instead of capturing a generic Exception. Capture of do same. (Throw a wrapped exception in this case)</technical_language>

Target:
public void verify(DecodedJWT jwt) throws SignatureVerificationException { byte[] contentBytes = String.format("%s.%s", jwt.getHeader(), jwt.getPayload()).getBytes(Charset.forName(Charsets.UTF_8)); byte[] signatureBytes = Base64.decodeBase64(jwt.getSignature()); try { ECPublicKey publicKey = keyProvider.getPublicKeyById(jwt.getKeyId()); if (publicKey == null) { throw new IllegalStateException("The given Public Key is null."); } boolean valid = crypto.verifySignatureFor(getDescription(), publicKey, contentBytes, JOSEToDER(signatureBytes)); if (!valid) { throw new SignatureVerificationException(this); } } catch (NoSuchAlgorithmException e) { throw new SignatureVerificationException(this, e); } catch (SignatureException e) { throw new SignatureVerificationException(this, e); } catch (InvalidKeyException e) { throw new SignatureVerificationException(this, e); } catch (IllegalStateException e) { throw new SignatureVerificationException(this, e); } }
Source:
<code>protected CompilationUnit assertNoCompilationError(ICompilationUnit cu) { ASTParser parser= ASTParser.newParser(IASTSharedValues.SHARED_AST_LEVEL); parser.setSource(cu); parser.setResolveBindings(true); CompilationUnit root= (CompilationUnit) parser.createAST(null); IProblem[] problems= root.getProblems(); boolean hasProblems= false; for (IProblem prob : problems) { if (prob.isWarning() || prob.isInfo()) { continue; } switch (prob.getID()) { case IProblem.MethodNameClash: continue; case IProblem.MethodMustOverride: continue; default: hasProblems= true; break; } } if (hasProblems) { StringBuilder buf= new StringBuilder(); buf.append(cu.getElementName() + " has compilation problems: \n"); for (IProblem <START> problem : <END> problems) { buf.append(problem.getMessage()).append('\n'); } assertTrue(buf.toString(), false); } return root; }</code><technical_language>rename prob others problem (consistency)</technical_language>

Target:
protected CompilationUnit assertNoCompilationError(ICompilationUnit cu) { ASTParser parser= ASTParser.newParser(IASTSharedValues.SHARED_AST_LEVEL); parser.setSource(cu); parser.setResolveBindings(true); CompilationUnit root= (CompilationUnit) parser.createAST(null); IProblem[] problems= root.getProblems(); boolean hasProblems= false; for (IProblem prob : problems) { if (prob.isWarning() || prob.isInfo()) { continue; } switch (prob.getID()) { case IProblem.MethodNameClash: continue; case IProblem.MethodMustOverride: continue; default: hasProblems= true; break; } } if (hasProblems) { StringBuilder buf= new StringBuilder(); buf.append(cu.getElementName() + " has compilation problems: \n"); for (IProblem prob : problems) { buf.append(prob.getMessage()).append('\n'); } assertTrue(buf.toString(), false); } return root; }
Source:
<code>@Override public BinaryObjectImpl deserialize(JsonParser parser, DeserializationContext dCtx) throws IOException { String type = (String)dCtx.findInjectableValue(BINARY_TYPE_PROPERTY, null, null); String cacheName = (String)dCtx.findInjectableValue(CACHE_NAME_PROPERTY, null, null); assert type != null; <START> assert !ctx.marshallerContext().isSystemType(type); <END> ObjectCodec mapper = parser.getCodec(); JsonNode jsonTree = mapper.readTree(parser); return (BinaryObjectImpl)deserialize0(cacheName, type, jsonTree, mapper); }</code><technical_language>throw exception correct message, assert this value, user pass system type check before</technical_language>

Target:
@Override public BinaryObject deserialize(JsonParser parser, DeserializationContext dCtx) throws IOException { String type = (String)dCtx.findInjectableValue(BINARY_TYPE_PROPERTY, null, null); String cacheName = (String)dCtx.findInjectableValue(CACHE_NAME_PROPERTY, null, null); assert type != null; JsonNode tree = parser.readValueAsTree(); ObjectCodec mapper = parser.getCodec(); Map<String, BinaryFieldMetadata> binFields = binaryFields(type); Map<String, Class<?>> qryFields = queryFields(cacheName, type); BinaryObjectBuilder builder = ctx.cacheObjects().builder(type); Iterator<Map.Entry<String, JsonNode>> itr = tree.fields(); while (itr.hasNext()) { Map.Entry<String, JsonNode> entry = itr.next(); String field = entry.getKey(); JsonNode node = entry.getValue(); BinaryFieldMetadata meta = binFields.get(field); Class<?> fieldCls = meta != null ? BinaryUtils.FLAG_TO_CLASS.get((byte)meta.typeId()) : null; if (fieldCls == null) fieldCls = qryFields.getOrDefault(QueryUtils.normalizeObjectName(field, true), Object.class); builder.setField(field, mapper.treeToValue(node, fieldCls)); } return builder.build(); }
Source:
<code>public boolean canEnable() throws JavaModelException { if (fPackageFragments.length == 0) return false; for (IPackageFragment <START> fPackageFragment : <END> fPackageFragments) { if (JavaElementUtil.isDefaultPackage(fPackageFragment) || fPackageFragment.isReadOnly()) { return false; } } if (ReorgUtils.containsLinkedResources(fPackageFragments)) return false; return true; }</code><technical_language>rename pack</technical_language>

Target:
public boolean canEnable() throws JavaModelException { if (fPackageFragments.length == 0) return false; for (IPackageFragment pack : fPackageFragments) { if (JavaElementUtil.isDefaultPackage(pack) || pack.isReadOnly()) { return false; } } if (ReorgUtils.containsLinkedResources(fPackageFragments)) return false; return true; }
Source:
<code>public Matrix(String matrixAsString) { String[] rows = matrixAsString.split("\\n"); matrix = new int[rows.length][]; for (int i = 0; i < rows.length; i++) { <START> String[] columnValues = rows[i].split(" "); <END> matrix[i] = new int[columnValues.length]; for (int j = 0; j < columnValues.length; j++) { matrix[i][j] = Integer.valueOf(columnValues[j]); } } }</code><technical_language>Another FYI, a required change: note some "gotchas" String.split a regex. [Here's a nice breakdown](<LINK_0> If this high-performance code, want compile Pattern of time, split instead. I learned this a couple months back</technical_language>

Target:
public Matrix(String matrixAsString) { String[] rows = newlinePattern.split(matrixAsString); matrix = new int[rows.length][]; for (int i = 0; i < rows.length; i++) { String[] columnValues = spacePattern.split(rows[i]); matrix[i] = new int[columnValues.length]; for (int j = 0; j < columnValues.length; j++) { matrix[i][j] = Integer.parseInt(columnValues[j]); } } }
Source:
<code>public ASTNode() { location = null; <START> metadataSet = new HashSet<>(); <END> }</code><technical_language>replace statements "this(null)"</technical_language>

Target:
public ASTNode() { this((FileLocation)null); }
Source:
<code><START> public List<Class<?>> getParameters() { <END> throw new UnsupportedOperationException( "Use getDefinedParameters instead."); }</code><technical_language>![INFO](<LINK_1> 'Severity: INFO') Do forget remove this deprecated code someday. [![rule](<LINK_2>](<LINK_0></technical_language>

Target:
public List<Class<?>> getParameters() { final List<String> parametersRegex = parameters.values().stream() .map(RouteParameterData::getRegex).map(Optional::get) .collect(Collectors.toList()); return HasUrlParameterFormat.getParameterTypes(parametersRegex); }
Source:
<code>static <T> Iterator<? extends T> reverseIterator(Iterable<? extends T> iterable) { if (iterable instanceof java.util.List) { java.util.List<T> list = (java.util.List<T>) iterable; return new Iterator<T>() { <START> java.util.ListIterator<T> delegate = list.listIterator(list.size()); <END> @Override public boolean hasNext() { return delegate.hasPrevious(); } @Override public T next() { return delegate.previous(); } }; } else { return seq(iterable).reverseIterator(); } }</code><technical_language>good</technical_language>

Target:
static <T> Iterator<? extends T> reverseIterator(Iterable<? extends T> iterable) { if (iterable instanceof java.util.List) { final java.util.List<T> list = (java.util.List<T>) iterable; return new Iterator<T>() { java.util.ListIterator<T> delegate = list.listIterator(list.size()); @Override public boolean hasNext() { return delegate.hasPrevious(); } @Override public T next() { return delegate.previous(); } }; } else { final Seq<? extends T> result = (iterable instanceof Seq) ? (Seq<T>) iterable : Vector.ofAll(iterable); return result.reverseIterator(); } }
Source:
<code>public void onClosed(Channel channel, IOException cause) { event.fireChannelClosed(cause); try { <START> event.getSocket().close(); <END> } catch (IOException e) { } }</code><technical_language>do remove listener in this method done for nClosed(ProtocolStack stack, IOException cause)</technical_language>

Target:
public void onClosed(Channel channel, IOException cause) { if (channel != event.getChannel()) { return; } event.fireChannelClosed(cause); channel.removeListener(this); try { event.getSocket().close(); } catch (IOException e) { } }
Source:
<code>public TestSuiteProgress() { <START> useColor = System.getenv("JENKINS_HOME") == null; <END> out = new PrintStream(new FileOutputStream(FileDescriptor.out)); }</code><technical_language>I if this is necessary... jansi [isatty](<LINK_0> avoid writing escape codes output is redirected</technical_language>

Target:
public TestSuiteProgress() { useColor = !Boolean.getBoolean("jansi.strip"); prefix = System.out.getClass().equals(PrintStream.class) ? "" : "H ,"; out = new PrintStream(new FileOutputStream(FileDescriptor.out)); }
Source:
<code>public ServiceResponse(HttpResponse response) throws IOException { BufferedReader reader = new BufferedReader(new InputStreamReader(response.getEntity().getContent())); String line; StringBuilder string_response = new StringBuilder(); while ((line = reader.readLine()) != null) { string_response.append(line); } this.message = string_response.toString(); this.code = response.getStatusLine().getStatusCode(); this.response = response; <START> logger.info( <END> "The web service response status is " + code); logger.info("The web service response is:\n" + Util.prettyPrintXmlOrJson(message)); }</code><technical_language>If want do this move base request class get it. log request response headers in info mode turn http client debug logs info duplicate data is there</technical_language>

Target:
public ServiceResponse(HttpResponse response) throws IOException { BufferedReader reader = new BufferedReader(new InputStreamReader(response.getEntity().getContent())); String line; StringBuilder string_response = new StringBuilder(); while ((line = reader.readLine()) != null) { string_response.append(line); } this.message = string_response.toString(); this.code = response.getStatusLine().getStatusCode(); this.response = response; logger.info("The web service response is:\n" + Util.prettyPrintXmlOrJson(message)); }
Source:
<code>public PieChartViewerStateNoContentSelected(final TmfPieChartViewer context) { if (context.isDisposed()) { return; } Display.getDefault().asyncExec(new Runnable() { @Override public void run() { <START> synchronized (context.getMutexLayoutChange()) { <END> if (!context.isDisposed()) { if (context.getTimeRangePC() != null) { if (!context.getTimeRangePC().isDisposed()) { context.getTimeRangePC().dispose(); } context.setTimeRangePC(null); } context.updateGlobalPieChart(); context.getGlobalPC().getLegend().setPosition(SWT.RIGHT); context.layout(); } } } }); }</code><technical_language>context synch obj</technical_language>

Target:
public PieChartViewerStateNoContentSelected(final TmfPieChartViewer context) { if (context.isDisposed()) { return; } Display.getDefault().asyncExec(new Runnable() { @Override public void run() { synchronized (context) { if (!context.isDisposed()) { if (context.getTimeRangePC() != null) { if (!context.getTimeRangePC().isDisposed()) { context.getTimeRangePC().dispose(); } context.setTimeRangePC(null); } context.updateGlobalPieChart(); context.getGlobalPC().getLegend().setPosition(SWT.RIGHT); context.layout(); } } } }); }
Source:
<code><START> public void enableAccelerometer(byte[] config) { <END> BluetoothLeGattCharacteristic enableChar; if (this.cc2650) { try { enableChar = this.gattServices.get(MOVEMENT).findCharacteristic(TiSensorTagGatt.UUID_MOV_SENSOR_ENABLE); writeOnCharacteristic(config, enableChar); } catch (KuraException e) { logger.error(MOV_ERROR_MESSAGE, e); } } else { try { enableChar = this.gattServices.get(ACCELEROMETER) .findCharacteristic(TiSensorTagGatt.UUID_ACC_SENSOR_ENABLE); enableChar.writeValue(config); } catch (KuraException e) { logger.error("Accelerometer enable failed", e); } } }</code><technical_language>Similar</technical_language>

Target:
public boolean enableAccelerometer(byte[] config) { boolean result = false; BluetoothLeGattCharacteristic enableChar; if (this.cc2650) { try { enableChar = this.gattServices.get(MOVEMENT).findCharacteristic(TiSensorTagGatt.UUID_MOV_SENSOR_ENABLE); writeOnCharacteristic(config, enableChar); result = true; } catch (KuraException e) { logger.error(MOV_ERROR_MESSAGE, e); } } else { try { enableChar = this.gattServices.get(ACCELEROMETER) .findCharacteristic(TiSensorTagGatt.UUID_ACC_SENSOR_ENABLE); enableChar.writeValue(config); result = true; } catch (KuraException e) { logger.error("Accelerometer enable failed", e); } } return result; }
Source:
<code>public void start() throws Exception { <START> this.executorService = Executors.newFixedThreadPool(1); <END> }</code><technical_language>give thread a name Executors.newSingleThreadExecutor(new ExecutorThreadFactory("the name want"));</technical_language>

Target:
public void start() throws Exception { this.executorService = Executors.newSingleThreadExecutor( new ExecutorThreadFactory( "collect-sink-operator-coordinator-executor-thread-pool")); }
Source:
<code>private void initGlobalDefaultValues() { if (system.getEnvironmentVariable(BITBUCKET_CLOUD_ENV_VAR) != null) { <START> setGlobalDefaultValue(ScannerProperties.HOST_URL, SONARCLOUD_HOST); <END> } else { setGlobalDefaultValue(ScannerProperties.HOST_URL, "http://localhost:9000"); } }</code><technical_language>add a log (in debug) understanding on? like: > Bitbucket Cloud Pipelines detected</technical_language>

Target:
private void initGlobalDefaultValues() { if (system.getEnvironmentVariable(BITBUCKET_CLOUD_ENV_VAR) != null) { setGlobalDefaultValue(ScannerProperties.HOST_URL, SONARCLOUD_HOST); logger.info("Bitbucket Cloud Pipelines detected"); } else { setGlobalDefaultValue(ScannerProperties.HOST_URL, "http://localhost:9000"); } }
Source:
<code>public void testEmptyGrammar() throws Exception { Grammar.NonTerminalId ntistart = new Grammar.NonTerminalId("StartNT"); Grammar.StateId stistart = new Grammar.StateId("StartState"); Grammar.StateId stiend = new Grammar.StateId("EndState"); Grammar.State.OrderingInfo oinf2 = new Grammar.State.OrderingInfo(2); Grammar.State.OrderingInfo oinf3 = new Grammar.State.OrderingInfo(3); Grammar.NonTerminal nt1 = new Grammar.NonTerminal(ntistart, stistart, oinf2, stiend, oinf3); nt1.entryState.next.add(nt1.exitState); ParseState ps = new ParseState(""); Parser parser = new Parser(ps); Term result = parser.parse(nt1, 0); Term expected = amb(klist(amb(KList.EMPTY))); assertEquals("Empty Grammar check: ", expected, result); <START> assertEquals("Expected Nullable NTs", 1, NullabilityCheck.getReachableNullableNT(nt1).size()); <END> }</code><technical_language>Please assert nullable state is</technical_language>

Target:
public void testEmptyGrammar() throws Exception { Grammar.NonTerminalId ntistart = new Grammar.NonTerminalId("StartNT"); Grammar.StateId stistart = new Grammar.StateId("StartState"); Grammar.StateId stiend = new Grammar.StateId("EndState"); Grammar.State.OrderingInfo oinf2 = new Grammar.State.OrderingInfo(2); Grammar.State.OrderingInfo oinf3 = new Grammar.State.OrderingInfo(3); Grammar.NonTerminal nt1 = new Grammar.NonTerminal(ntistart, stistart, oinf2, stiend, oinf3); nt1.entryState.next.add(nt1.exitState); ParseState ps = new ParseState(""); Parser parser = new Parser(ps); Term result = parser.parse(nt1, 0); Term expected = amb(klist(amb(KList.EMPTY))); Assert.assertEquals("Empty Grammar check: ", expected, result); Assert.assertEquals("Expected Nullable NTs", nt1, NullabilityCheck.getReachableNullableNT(nt1).iterator().next()); }
Source:
<code><START> void recordMetaData(final SliceBAIMetadata sliceMetadata) { <END> final int alignmentStart = sliceMetadata.getAlignmentStart(); if (alignmentStart == SAMRecord.NO_ALIGNMENT_START) { noCoordinateRecords += sliceMetadata.getRecordCount(); return; } final long start = sliceMetadata.getByteOffset(); final long end = sliceMetadata.getByteOffset() + sliceMetadata.getByteSize(); if (sliceMetadata.getAlignmentSpan() == SliceHeader.NO_ALIGNMENT_SPAN) { unAlignedRecords += sliceMetadata.getRecordCount(); } else { alignedRecords += sliceMetadata.getRecordCount(); } if (BlockCompressedFilePointerUtil.compare(start, firstOffset) < 1 || firstOffset == -1) { this.firstOffset = start; } if (BlockCompressedFilePointerUtil.compare(lastOffset, end) < 1) { this.lastOffset = end; } }</code><technical_language>I fake slices in multiref code path (?), multi-ref grafted existing code. this a slice, delegated Slice</technical_language>

Target:
void recordMetaData(final SliceBAIMetadata sliceMetadata) { final int alignmentStart = sliceMetadata.getAlignmentStart(); if (alignmentStart == SAMRecord.NO_ALIGNMENT_START) { noCoordinateRecords += sliceMetadata.getRecordCount(); return; } final long start = sliceMetadata.getByteOffset(); final long end = start; if (sliceMetadata.getAlignmentSpan() == SliceHeader.NO_ALIGNMENT_SPAN) { unAlignedRecords += sliceMetadata.getRecordCount(); } else { alignedRecords += sliceMetadata.getRecordCount(); } if (BlockCompressedFilePointerUtil.compare(start, firstOffset) < 1 || firstOffset == -1) { this.firstOffset = start; } if (BlockCompressedFilePointerUtil.compare(lastOffset, end) < 1) { this.lastOffset = end; } }
Source:
<code>private String extractWhat(final Audit note, final String methodName) { String what = note.action(); if (what.length() == 0) { boolean ccase = Character.isLowerCase(methodName.charAt(0)); StringBuilder sb = new StringBuilder(); for (int i = 0; i < methodName.length(); i++) { char c = methodName.charAt(i); if (Character.isLowerCase(c) != ccase) { sb.append(' '); } sb.append(Character.toLowerCase(c)); } <START> what = sb.toString(); <END> } return what; }</code><technical_language>this formatting sense if method name is camel-case? e.g. 'SetText' formatted 's e tt e x t'? this formatting done if ccase == true</technical_language>

Target:
private String extractWhat(final Audit note, final String methodName) { String what = note.action(); if (what.length() == 0) { boolean ccase = Character.isLowerCase(methodName.charAt(0)); StringBuilder sb = new StringBuilder(); for (int i = 0; i < methodName.length(); i++) { char c = methodName.charAt(i); if (ccase && !Character.isLowerCase(c)) { sb.append(' '); } sb.append(Character.toLowerCase(c)); } what = sb.toString(); } return what; }