auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private T doPut(T row, boolean needOld) throws IgniteCheckedException { checkDestroyed(); Put p = new Put(row, needOld); try { for (;;) { p.init(); Result res = putDown(p, p.rootId, 0L, p.rootLvl); switch (res) { case RETRY: case RETRY_ROOT: checkInterrupted(); continue; case FOUND: if (!p.isFinished()) { assert p.btmLvl <= getRootLevel(); checkInterrupted(); continue; } return p.oldRow; default: throw new IllegalStateException("Result: " + res); } } } <START> catch (IgniteCheckedException | IgniteSQLException e) { <END> throw new IgniteCheckedException("Runtime failure on row: " + row, e); } catch (RuntimeException | AssertionError e) { throw corruptedTreeException("Runtime failure on row: " + row, e, grpId, p.pageId); } finally { checkDestroyed(); } }</code><technical_language>please remove this new exception here? I unused left previous fix attempt. Thank you</technical_language>

Target:
private T doPut(T row, boolean needOld) throws IgniteCheckedException { checkDestroyed(); Put p = new Put(row, needOld); try { for (;;) { p.init(); Result res = putDown(p, p.rootId, 0L, p.rootLvl); switch (res) { case RETRY: case RETRY_ROOT: checkInterrupted(); continue; case FOUND: if (!p.isFinished()) { assert p.btmLvl <= getRootLevel(); checkInterrupted(); continue; } return p.oldRow; default: throw new IllegalStateException("Result: " + res); } } } catch (IgniteCheckedException e) { throw new IgniteCheckedException("Runtime failure on row: " + row, e); } catch (RuntimeException | AssertionError e) { throw corruptedTreeException("Runtime failure on row: " + row, e, grpId, p.pageId); } finally { checkDestroyed(); } }
Source:
<code>public void andThenSingleSubscribeOn() { TestSubscriber<String> ts = new TestSubscriber<String>(0); TestScheduler scheduler = new TestScheduler(); Completable.complete().andThen(Single.just("foo").delay(1, TimeUnit.SECONDS, scheduler)).subscribe(ts); ts.requestMore(1); ts.assertNoValues(); ts.assertNoTerminalEvent(); scheduler.advanceTimeBy(1, TimeUnit.SECONDS); ts.assertValue("foo"); ts.assertCompleted(); ts.assertNoErrors(); <START> } <END></code><technical_language>Please check unsubscribe works in phase of a running subscription</technical_language>

Target:
public void andThenSingleSubscribeOn() { TestSubscriber<String> ts = new TestSubscriber<String>(0); TestScheduler scheduler = new TestScheduler(); Completable.complete().andThen(Single.just("foo").delay(1, TimeUnit.SECONDS, scheduler)).subscribe(ts); ts.requestMore(1); ts.assertNoValues(); ts.assertNoTerminalEvent(); scheduler.advanceTimeBy(1, TimeUnit.SECONDS); ts.assertValue("foo"); ts.assertCompleted(); ts.assertNoErrors(); ts.assertUnsubscribed(); }
Source:
<code>private void loadPaths(DeploymentType deployment) throws IOException { String voltdbRoot = (new VoltFile(deployment.getPaths().getVoltdbroot().getPath())).getCanonicalPath(); <START> m_pathList.put(deployment.getPaths().getVoltdbroot().getKey(), voltdbRoot); <END> File path = new VoltFile(deployment.getPaths().getCommandlog().getPath()); if (!path.isAbsolute()) { path = new VoltFile(voltdbRoot, path.getPath()); } m_pathList.put(deployment.getPaths().getCommandlog().getKey(), path.getCanonicalPath()); path = new VoltFile(deployment.getPaths().getCommandlogsnapshot().getPath()); if (!path.isAbsolute()) { path = new VoltFile(voltdbRoot, path.getPath()); } m_pathList.put(deployment.getPaths().getCommandlogsnapshot().getKey(), path.getCanonicalPath()); path = new VoltFile(deployment.getPaths().getSnapshots().getPath()); if (!path.isAbsolute()) { path = new VoltFile(voltdbRoot, path.getPath()); } m_pathList.put(deployment.getPaths().getSnapshots().getKey(), path.getCanonicalPath()); path = new VoltFile(deployment.getPaths().getExportoverflow().getPath()); if (!path.isAbsolute()) { path = new VoltFile(voltdbRoot, path.getPath()); } m_pathList.put(deployment.getPaths().getExportoverflow().getKey(), path.getCanonicalPath()); path = new VoltFile(deployment.getPaths().getDroverflow().getPath()); if (!path.isAbsolute()) { path = new VoltFile(voltdbRoot, path.getPath()); } m_pathList.put(deployment.getPaths().getDroverflow().getKey(), path.getCanonicalPath()); }</code><technical_language>m_pathList is a good case for immutable map</technical_language>

Target:
private void loadPaths(DeploymentType deployment) throws IOException { String voltdbRoot = (new VoltFile(deployment.getPaths().getVoltdbroot().getPath())).getCanonicalPath(); m_pathList.put(VoltDB.VOLTDBROOT_PATH_KEY, voltdbRoot); File path = new File(deployment.getPaths().getCommandlog().getPath()); if (!path.isAbsolute()) { path = new VoltFile(voltdbRoot, path.getPath()); } m_pathList.put(VoltDB.CL_PATH_KEY, path.getCanonicalPath()); path = new File(deployment.getPaths().getCommandlogsnapshot().getPath()); if (!path.isAbsolute()) { path = new VoltFile(voltdbRoot, path.getPath()); } m_pathList.put(VoltDB.CL_SNAPSHOT_PATH_KEY, path.getCanonicalPath()); path = new File(deployment.getPaths().getSnapshots().getPath()); if (!path.isAbsolute()) { path = new VoltFile(voltdbRoot, path.getPath()); } m_pathList.put(VoltDB.SNAPTHOT_PATH_KEY, path.getCanonicalPath()); path = new File(deployment.getPaths().getExportoverflow().getPath()); if (!path.isAbsolute()) { path = new VoltFile(voltdbRoot, path.getPath()); } m_pathList.put(VoltDB.EXPORT_OVERFLOW_PATH_KEY, path.getCanonicalPath()); path = new File(deployment.getPaths().getDroverflow().getPath()); if (!path.isAbsolute()) { path = new VoltFile(voltdbRoot, path.getPath()); } m_pathList.put(VoltDB.DR_OVERFLOW_PATH_KEY, path.getCanonicalPath()); }
Source:
<code>public void prepareWorkspace() { if (!projectHelper.projectExists(PROJECT_NAME)) { CDIProjectWizard cw = new CDIProjectWizard(); cw.open(); WebProjectFirstPage fp = new WebProjectFirstPage(cw); fp.setProjectName(PROJECT_NAME); if (CDIVersion.equals("2.0")) { new DefaultCombo(2).setSelection("Dynamic Web Project with CDI 2.0 (Contexts and Dependency Injection)"); } fp.setTargetRuntime(sr.getRuntimeName()); if (isJavaLE8() || CDIVersion.equals("1.0")) { fp.activateFacet("1.8", "Java"); } else { fp.activateFacet("11", "Java"); } fp.activateFacet(CDIVersion, "CDI (Contexts and Dependency Injection)"); cw.finish(); new WaitUntil(new JobIsRunning(), TimePeriod.DEFAULT, false); new WaitWhile(new JobIsRunning(), TimePeriod.LONG); <START> setWorkspaceDefaultJREForJava8(); <END> } }</code><technical_language>set default is JRE 8 machine</technical_language>

Target:
public void prepareWorkspace() { if (!projectHelper.projectExists(PROJECT_NAME)) { CDIProjectWizard pw = new CDIProjectWizard(); pw.open(); WebProjectFirstPage fp = new WebProjectFirstPage(pw); fp.setProjectName(PROJECT_NAME); if (CDIVersion.equals("2.0")) { new DefaultCombo(2).setSelection("Dynamic Web Project with CDI 2.0 (Contexts and Dependency Injection)"); } fp.setTargetRuntime(sr.getRuntimeName()); activateFacets(fp); fp.activateFacet(CDIVersion, "CDI (Contexts and Dependency Injection)"); pw.finish(); new WaitWhile(new JobIsRunning(), TimePeriod.LONG); } }
Source:
<code>protected String getToExpression(ConversionContext conversionContext) { <START> return "new java.sql.Timestamp( <SOURCE>.getTime() )"; <END> }</code><technical_language>FQN needed here, instead simple name suffice returning required import getImports()</technical_language>

Target:
protected String getToExpression(ConversionContext conversionContext) { return "new Timestamp( <SOURCE>.getTime() )"; }
Source:
<code>public Type visitGroupingOperation(GroupingOperation node, StackableAstVisitorContext<Context> context) { if (node.getGroupingColumns().size() > MAX_NUMBER_GROUPING_ARGUMENTS) { <START> throw new SemanticException(INVALID_PROCEDURE_ARGUMENTS, node, "GROUPING supports up to 63 column arguments"); <END> } for (Expression columnArgument : node.getGroupingColumns()) { process(columnArgument, context); } expressionTypes.put(node, INTEGER); return INTEGER; }</code><technical_language>constant construct message get out of sync if adjust value</technical_language>

Target:
public Type visitGroupingOperation(GroupingOperation node, StackableAstVisitorContext<Context> context) { if (node.getGroupingColumns().size() > MAX_NUMBER_GROUPING_ARGUMENTS_BIGINT) { throw new SemanticException(INVALID_PROCEDURE_ARGUMENTS, node, String.format("GROUPING supports up to %d column arguments", MAX_NUMBER_GROUPING_ARGUMENTS_BIGINT)); } for (Expression columnArgument : node.getGroupingColumns()) { process(columnArgument, context); } if (node.getGroupingColumns().size() <= MAX_NUMBER_GROUPING_ARGUMENTS_INTEGER) { expressionTypes.put(node, INTEGER); return INTEGER; } else { expressionTypes.put(node, BIGINT); return BIGINT; } }
Source:
<code>public TaskManifest findTaskManifestById(Long id) { TaskExecution taskExecution = this.taskExplorer.getTaskExecution(id); <START> return this.dataflowTaskExecutionMetadataDao.getLatestManifest(taskExecution.getTaskName()); <END> }</code><technical_language>get changed then</technical_language>

Target:
public TaskManifest findTaskManifestById(Long id) { TaskExecution taskExecution = this.taskExplorer.getTaskExecution(id); return this.dataflowTaskExecutionMetadataDao.findManifestById(taskExecution.getExecutionId()); }
Source:
<code><START> public static BondMode getBondMode(String bondOptions){ <END> if(bondOptions == null){ return BOND0; } String bondModeValue = findMode(bondOptions); if (bondModeValue == null){ return BOND0; } for (BondMode bondMode : BondMode.values()){ if (bondMode.getValue().equals(bondModeValue)){ return bondMode; } } return BOND0; }</code><technical_language>Please check if usages of this method this class. If not, please private</technical_language>

Target:
public static BondMode getBondMode(String bondOptions){ if(bondOptions == null){ return null; } String bondModeValue = findMode(bondOptions); if (bondModeValue == null){ return null; } for (BondMode bondMode : BondMode.values()){ if (bondMode.getValue().equals(bondModeValue)){ return bondMode; } } return null; }
Source:
<code>public void createPaymentRefund_responseWith400_whenConnectorResponseIsErrorDueToAmountRequestedIsNotAvailableForRefund() throws IOException { int amount = 1000; String externalChargeId = "charge_12345"; connectorMock.respondWithChargeFound(amount, GATEWAY_ACCOUNT_ID, externalChargeId, null, null, null, null, <START> null, null, null, SupportedLanguage.ENGLISH, Boolean.FALSE,null, <END> new RefundSummary("available", REFUND_AMOUNT_AVAILABLE, 1000), null, CARD_DETAILS); connectorMock.respondBadRequest_whenCreateARefund("full", amount, REFUND_AMOUNT_AVAILABLE, GATEWAY_ACCOUNT_ID, externalChargeId); String refundRequest = "{\"amount\":" + amount + "}"; InputStream body = postPaymentRefundAndThen(API_KEY, externalChargeId, refundRequest) .statusCode(400) .contentType(JSON) .extract() .body().asInputStream(); JsonAssert.with(body) .assertThat("$.*", hasSize(2)) .assertThat("$.code", is("P0603")) .assertThat("$.description", is("The payment is not available for refund. Payment refund status: full")); }</code><technical_language>space commas</technical_language>

Target:
public void createPaymentRefund_responseWith400_whenConnectorResponseIsErrorDueToAmountRequestedIsNotAvailableForRefund() throws IOException { int amount = 1000; String externalChargeId = "charge_12345"; connectorMock.respondWithChargeFound(amount, GATEWAY_ACCOUNT_ID, externalChargeId, null, null, null, null, null, null, null, SupportedLanguage.ENGLISH, false, null, new RefundSummary("available", REFUND_AMOUNT_AVAILABLE, 1000), null, CARD_DETAILS); connectorMock.respondBadRequest_whenCreateARefund("full", amount, REFUND_AMOUNT_AVAILABLE, GATEWAY_ACCOUNT_ID, externalChargeId); String refundRequest = "{\"amount\":" + amount + "}"; InputStream body = postPaymentRefundAndThen(API_KEY, externalChargeId, refundRequest) .statusCode(400) .contentType(JSON) .extract() .body().asInputStream(); JsonAssert.with(body) .assertThat("$.*", hasSize(2)) .assertThat("$.code", is("P0603")) .assertThat("$.description", is("The payment is not available for refund. Payment refund status: full")); }
Source:
<code>private String resolveNodeToTypeString(ASTNode node) { IBinding b = resolveNodeToBinding(node); if (b != null) { <START> return new String(b.getName()); <END> } return OBJECT_SIGNATURE; }</code><technical_language>getQualifiedName()</technical_language>

Target:
private String resolveNodeToTypeString(ASTNode node) { ITypeBinding b = resolveNodeToBinding(node); if (b != null) { return new String(b.getQualifiedName()); } return OBJECT_SIGNATURE; }
Source:
<code>public static <K, V> void putIfAbsentDataContainer(InternalCacheEntry<K, V> ice, DataContainer<K, V> dataContainer, TimeService timeService, int segment) { if (ice == null) { throw new NullPointerException("Entry must be non null"); <START> } <END> K key = ice.getKey(); DataContainer.ComputeAction<K, V> putIfAbsentOrExpired = (k, oldEntry, factory) -> { if (oldEntry != null && (!oldEntry.canExpire() || !oldEntry.isExpired(timeService.wallClockTime()))) { return oldEntry; } return ice; }; if (segment != SEGMENT_NOT_PROVIDED && dataContainer instanceof InternalDataContainer) { ((InternalDataContainer<K, V>) dataContainer).compute(segment, key, putIfAbsentOrExpired); } else { dataContainer.compute(key, putIfAbsentOrExpired); } }</code><technical_language>Objects.requireNonNull</technical_language>

Target:
public static <K, V> void putIfAbsentDataContainer(InternalCacheEntry<K, V> ice, DataContainer<K, V> dataContainer, TimeService timeService, int segment) { K key = ice.getKey(); DataContainer.ComputeAction<K, V> putIfAbsentOrExpired = (k, oldEntry, factory) -> { if (oldEntry != null && (!oldEntry.canExpire() || !oldEntry.isExpired(timeService.wallClockTime()))) { return oldEntry; } return ice; }; if (segment != SEGMENT_NOT_PROVIDED && dataContainer instanceof InternalDataContainer) { ((InternalDataContainer<K, V>) dataContainer).compute(segment, key, putIfAbsentOrExpired); } else { dataContainer.compute(key, putIfAbsentOrExpired); } }
Source:
<code>private static void setUnsafe(boolean value) throws Exception { UnsafeAvailChecker.overrideUnsafeAvail(value); Field field = UnsafeAvailChecker.class.getDeclaredField("unaligned"); field.setAccessible(true); Field modifiersField = Field.class.getDeclaredField("modifiers"); modifiersField.setAccessible(true); int oldModifiers = field.getModifiers(); modifiersField.setInt(field, oldModifiers & ~Modifier.FINAL); try { field.set(null, value); } finally { modifiersField.setInt(field, oldModifiers); } assertEquals(UnsafeAvailChecker.unaligned(), value); <START> } <END></code><technical_language>While here, this is a requirement (I've approved PR), good a small new unit test confirms new configuration parameter in fact disable Unsafe usage it</technical_language>

Target:
private static void setUnsafe(boolean value) throws Exception { Field field = Bytes.class.getDeclaredField("UNSAFE_UNALIGNED"); field.setAccessible(true); Field modifiersField = Field.class.getDeclaredField("modifiers"); modifiersField.setAccessible(true); int oldModifiers = field.getModifiers(); modifiersField.setInt(field, oldModifiers & ~Modifier.FINAL); try { field.set(null, value); } finally { modifiersField.setInt(field, oldModifiers); } assertEquals(Bytes.UNSAFE_UNALIGNED, value); }
Source:
<code>private void countDownChildren(RootProcedureState<TEnvironment> procStack, Procedure<TEnvironment> procedure) { Procedure<TEnvironment> parent = procedures.get(procedure.getParentProcId()); if (parent == null) { assert procStack.isRollingback(); return; } if (parent.tryRunnable()) { store.update(parent); scheduler.addFront(parent); LOG.info("Finished subprocedure pid={}, resume processing parent {}", <START> procedure.getProcId(), parent.toString().replace("pid=","ppid=")); <END> return; } }</code><technical_language>Oh, I see. Good find. "Finished subprocedure (pid={}), resume processing of parent (ppid={}), parent.getProcId() instead of string replace</technical_language>

Target:
private void countDownChildren(RootProcedureState<TEnvironment> procStack, Procedure<TEnvironment> procedure) { Procedure<TEnvironment> parent = procedures.get(procedure.getParentProcId()); if (parent == null) { assert procStack.isRollingback(); return; } if (parent.tryRunnable()) { store.update(parent); scheduler.addFront(parent); LOG.info("Finished subprocedure (pid={}), resume processing parent (ppid={})", procedure.getProcId(), parent.getProcId()); return; } }
Source:
<code>private void managePrestartedVmsInPool(vm_pools vmPool) { int prestartedVms; int missingPrestartedVms; int vmsToPrestart; Guid vmGuid; prestartedVms = VmPoolCommandBase.getNumOfPrestartedVmsInPool(vmPool.getvm_pool_id()); missingPrestartedVms = vmPool.getPrestartedVms() - prestartedVms; if (missingPrestartedVms > 0) { int batchSize = Config.<Integer> GetValue(ConfigValues.VmPoolMonitorBatchSize); if (missingPrestartedVms > batchSize) { vmsToPrestart = batchSize; } else { vmsToPrestart = missingPrestartedVms; } log.infoFormat("Missing {0} prestarted Vms, attempting to prestart {1} Vms", missingPrestartedVms, vmsToPrestart); <START> for (int i = 0; i < vmsToPrestart; i++) { <END> vmGuid = VmPoolCommandBase.getNonPrestartedVmToAttach(vmPool.getvm_pool_id()); if (vmGuid != Guid.Empty) { if (!prestartVm(vmGuid)) { break; } } else { log.infoFormat("No Vms avaialable for prestarting"); break; } } } }</code><technical_language>please retrieve prestarted vms put loop retutn a vm id, queries DB retrieved information</technical_language>

Target:
private void managePrestartedVmsInPool(vm_pools vmPool) { int prestartedVms; int missingPrestartedVms; int numOfVmsToPrestart; prestartedVms = VmPoolCommandBase.getNumOfPrestartedVmsInPool(vmPool.getvm_pool_id()); missingPrestartedVms = vmPool.getPrestartedVms() - prestartedVms; if (missingPrestartedVms > 0) { int batchSize = Config.<Integer> GetValue(ConfigValues.VmPoolMonitorBatchSize); if (missingPrestartedVms > batchSize) { numOfVmsToPrestart = batchSize; } else { numOfVmsToPrestart = missingPrestartedVms; } log.infoFormat("VmPool {0} is missing {1} prestarted Vms, attempting to prestart {2} Vms", vmPool.getvm_pool_id(), missingPrestartedVms, numOfVmsToPrestart); prestartVms(vmPool, numOfVmsToPrestart); } }
Source:
<code>private List<VariableInstanceLog> filterLastVarInstanceLogs(List<VariableInstanceLog> varLogs) { List<VariableInstanceLog> retVarLogs = new ArrayList<>(); Map<String, List<VariableInstanceLog>> varlogsMap = new HashMap<String, List<VariableInstanceLog>>(); for( VariableInstanceLog vlog : varLogs ) { if( !varlogsMap.containsKey(vlog.getVariableId()) ) { ArrayList<VariableInstanceLog> varlogsList = new ArrayList<VariableInstanceLog>(); varlogsList.add( vlog ); varlogsMap.put( vlog.getVariableId(), varlogsList ); } else { varlogsMap.get( vlog.getVariableId() ).add( vlog ); } } for( Map.Entry<String, List<VariableInstanceLog>> entry : varlogsMap.entrySet() ) { List<VariableInstanceLog> value = entry.getValue(); Collections.sort(value, Collections.reverseOrder(new VariableInstanceLogIDComparator())); <START> entry.getValue().subList(1, entry.getValue().size()).clear(); <END> retVarLogs.addAll( entry.getValue() ); } return retVarLogs; }</code><technical_language>simpler call entry.getValue().get(0)</technical_language>

Target:
private List<VariableInstanceLog> filterLastVarInstanceLogs(List<VariableInstanceLog> varLogs) { List<VariableInstanceLog> retVarLogs = new ArrayList<>(); Map<String, List<VariableInstanceLog>> varlogsMap = new HashMap<String, List<VariableInstanceLog>>(); for( VariableInstanceLog vlog : varLogs ) { if( !varlogsMap.containsKey(vlog.getVariableId()) ) { ArrayList<VariableInstanceLog> varlogsList = new ArrayList<VariableInstanceLog>(); varlogsList.add( vlog ); varlogsMap.put( vlog.getVariableId(), varlogsList ); } else { varlogsMap.get( vlog.getVariableId() ).add( vlog ); } } for( Map.Entry<String, List<VariableInstanceLog>> entry : varlogsMap.entrySet() ) { List<VariableInstanceLog> value = entry.getValue(); if(value != null && value.size() > 0) { Collections.sort(value, Collections.reverseOrder(new VariableInstanceLogIDComparator())); retVarLogs.add(value.get(0)); } } return retVarLogs; }
Source:
<code>public MockMediaGateway() { super(); system = context().system(); connectionToEndpointMap = new ConcurrentHashMap<ActorRef, ActorRef>(); <START> connEndpointMap = new ConcurrentHashMap<String, String>(); <END> }</code><technical_language>considering this is Actor state, concurrency solved Actor model, is intention ConcurrentHashMap?</technical_language>

Target:
public MockMediaGateway() { super(); system = context().system(); connEndpointMap = new ConcurrentHashMap<String, String>(); }
Source:
<code>public void execute(ActivityExecution execution) throws Exception { <START> List<EventSubscriptionEntity> subscriptions = ((ExecutionEntity)execution).getEventSubscriptions(); <END> for(EventSubscriptionEntity subscription: subscriptions) { if(Context.getCommandContext().getAttribute(subscription.getEventName()) != null) { subscription.eventReceived(null, false); } } }</code><technical_language>code block added (lines 29 38) is identical code added for EventBasedGatewayActivityBehavior, excepted fact a break clause. Is this difference intentional? If not, this code extracted a separated class is injected necessary avoid logic duplication. In case injecting a class is intrusive in current code structure imagine a method in a common super class well. do think</technical_language>

Target:
public void execute(ActivityExecution execution) throws Exception { List<EventSubscriptionEntity> subscriptions = ((ExecutionEntity)execution).getEventSubscriptions(); if(!subscriptions.isEmpty()) { EventSubscriptionEntity subscription = subscriptions.get(0); if(isSignalEventAlreadyFired(execution, subscription)) { subscription.eventReceived(null, false); } } }
Source:
<code>public void doWrite(Query query) throws Exception { for (final Result result : query.getResults()) { if (result.getValues() != null) { for (final Map.Entry<String, Object> resultValue : result.getValues().entrySet()) { final String name = JmxUtils.getKeyString2(query, result, resultValue, getTypeNames(), null); final String value = resultValue.getValue().toString(); <START> log.debug("Sending Ganglia metric {}={}", host+": "+ name, value); <END> new GMetric( host, port, addressingMode, ttl, v31, null, spoofedHostName ).announce( name, value, getType(resultValue.getValue()), units, slope, tmax, dmax, groupName ); } } } }</code><technical_language>small formatting issue, please consistent spaces + be: host + ": " + name</technical_language>

Target:
public void doWrite(Query query) throws Exception { for (final Result result : query.getResults()) { if (result.getValues() != null) { for (final Map.Entry<String, Object> resultValue : result.getValues().entrySet()) { final String name = JmxUtils.getKeyString2(query, result, resultValue, getTypeNames(), null); final String value = resultValue.getValue().toString(); log.debug("Sending Ganglia metric {}={}", name, value); new GMetric( host, port, addressingMode, ttl, v31, null, spoofedHostName ).announce( name, value, getType(resultValue.getValue()), units, slope, tmax, dmax, groupName ); } } } }
Source:
<code>public synchronized void close() { if (!open) { return; } open = false; closeOpenIterators(); if (configSetter != null) { configSetter.close(name, userSpecifiedOptions); configSetter = null; } dbAccessor.close(); <START> db.close(); <END> userSpecifiedOptions.close(); wOptions.close(); fOptions.close(); filter.close(); cache.close(); dbAccessor = null; userSpecifiedOptions = null; wOptions = null; fOptions = null; db = null; filter = null; cache = null; }</code><technical_language>docs <LINK_0> I if order is completely correct. doc ColumnFamilyHandle > RocksDB > DBOptions > ColumnFamilyOptions code ColumnFamilyHandle > ColumnFamilyOptions > DBOptions > RocksDB due userSpecifiedOptions. Additionally, some set null afterwards, this a special reason</technical_language>

Target:
public synchronized void close() { if (!open) { return; } open = false; closeOpenIterators(); if (configSetter != null) { configSetter.close(name, userSpecifiedOptions); configSetter = null; } dbAccessor.close(); userSpecifiedOptions.close(); wOptions.close(); fOptions.close(); db.close(); filter.close(); cache.close(); dbAccessor = null; userSpecifiedOptions = null; wOptions = null; fOptions = null; db = null; filter = null; cache = null; }
Source:
<code>public void onListItemClick(ListView lv, View v, int position, long id) { <START> if(position == 0){ <END> switchFragment(new PlaylistFragment()); } else if(position == 1) switchFragment(new MusicLibraryFragment()); }</code><technical_language>Lets replace magical numbers strings represent them. top of code spacing java private final String PLAYLIST = "Playlist"; private final String MUSICLIBRARY = "MusicLibrary"; private final Map<String, Integer> DRAWER =new HashMap<String, Integer>(){ { put(PLAYLIST, 0); put(MUSICLIBRARY,1) } }; java if(position.equals(DRAWER.get(PLAYLIST)){ //more code } if's braces {}</technical_language>

Target:
public void onListItemClick(ListView lv, View v, int position, long id) { if(DRAWER.get(PLAYLIST) == position){ switchFragment(new PlaylistFragment()); } else if(DRAWER.get(MUSICLIBRARY) == position){ switchFragment(new MusicLibraryFragment()); } }
Source:
<code>private EventTypeProxy convert(final EventType et) { return new EventTypeProxy( et, <START> JsonUtils.serializeDateTime(objectMapper, et.getUpdatedAt()) <END> ); }</code><technical_language>updatedAt for versioning assuming system clock is good enough indication of order, concurrent changes frequent, right</technical_language>

Target:
private VersionedEventType convert(final EventType et) { return new VersionedEventType( et, JsonUtils.serializeDateTime(objectMapper, et.getUpdatedAt()) ); }
Source:
<code>private String selectFirstEntityTypeAsTarget(List<String> entityTypeIds) { Optional<String> findFirst = entityTypeIds.stream().findFirst(); <START> if (findFirst.isPresent()) <END> { return findFirst.get(); } else { throw new IllegalStateException("There are no entities available!"); } }</code><technical_language>do .orElseThrow</technical_language>

Target:
private String selectFirstEntityTypeAsTarget(List<String> entityTypeIds) { return entityTypeIds.stream() .findFirst() .orElseThrow(() -> new IllegalStateException("There are no entities available!")); }
Source:
<code><START> long consumerLag() { <END> return consumerLag; }</code><technical_language>suggest private</technical_language>

Target:
private long consumerLag() { return consumerLag; }
Source:
<code>public boolean canConnectRedstone(IBlockState state, IBlockAccess world, BlockPos pos, @Nullable EnumFacing side) { if (side == null) return false; TilePipeHolder tile = getPipe(world, pos, false); if (tile != null) { PipePluggable pluggable = tile.getPluggable(side.getOpposite()); <START> return pluggable != null && pluggable.definition == BCTransportPlugs.gate; <END> } return false; }</code><technical_language>Is some this hardcoded? support other pluggables other types of PipeBehaviour connect redstone</technical_language>

Target:
public boolean canConnectRedstone(IBlockState state, IBlockAccess world, BlockPos pos, @Nullable EnumFacing side) { if (side == null) return false; TilePipeHolder tile = getPipe(world, pos, false); if (tile != null) { PipePluggable pluggable = tile.getPluggable(side.getOpposite()); return pluggable != null && pluggable.canConnectToRedstone(side); } return false; }
Source:
<code>public void testNotCachingOfResultForOtherResolveOption() throws Exception { Bndrun bndrun = Bndrun.createBndrun(workspace, IO.getFile(tmp, "resolver.bndrun")); bndrun.setProperty("-resolve", "manual"); bndrun.unsetProperty("-runbundles"); RunResolution.clearCache(bndrun.getWorkspace()); ProjectLauncher pl = bndrun.getProjectLauncher(); assertNotNull(pl); Collection<Container> runbundles = pl.getProject() .getRunbundles(); assertThat(runbundles).isEmpty(); if (IO.isWindows()) <START> assertThat(bndrun.check()).isTrue(); <END> else assertThat(bndrun.check("Download java.io.FileNotFoundException:")).isTrue(); }</code><technical_language>do result Windows? find file windows *ix</technical_language>

Target:
public void testNotCachingOfResultForOtherResolveOption() throws Exception { Bndrun bndrun = Bndrun.createBndrun(workspace, IO.getFile(tmp, "resolver.bndrun")); bndrun.setProperty("-resolve", "manual"); bndrun.unsetProperty("-runbundles"); RunResolution.clearCache(bndrun.getWorkspace()); ProjectLauncher pl = bndrun.getProjectLauncher(); assertNotNull(pl); Collection<Container> runbundles = pl.getProject() .getRunbundles(); assertThat(runbundles).isEmpty(); assertThat(bndrun.check("(Download java.io.FileNotFoundException:)?")).isTrue(); }
Source:
<code>public SoulStrings(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{X}{B}"); Effect effect = new DoUnlessAnyPlayerPaysEffect( new ReturnFromGraveyardToHandTargetEffect(), new VariableManaCost() ); this.getSpellAbility().addEffect(effect); <START> this.getSpellAbility().addTarget(new TargetCardInGraveyard(2, new FilterCreatureCard("creature cards from your graveyard"))); <END> }</code><technical_language>TargetCardInYourGraveyard</technical_language>

Target:
public SoulStrings(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{X}{B}"); Effect effect = new DoUnlessAnyPlayerPaysEffect( new ReturnFromGraveyardToHandTargetEffect(), new VariableManaCost() ); this.getSpellAbility().addEffect(effect); this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(2, new FilterCreatureCard("creature cards from your graveyard"))); }
Source:
<code>public void resolveTaxon() throws IndexBuilderException { logger.info("Resolving taxa"); final Collection<TaxonConceptInstance> allInstances = this.instances.values(); final Set<RankType> rs = allInstances.parallelStream().map(TaxonConceptInstance::getRank).collect(Collectors.toSet()); List<RankType> ranks = new ArrayList<>(rs); <START> Collections.sort(ranks, (r1, r2) -> r1.getSortOrder() - r2.getSortOrder()); <END> long prevResolved = 0; long resolved = 0; do { for (RankType rank : ranks) { Set<TaxonConcept> concepts = allInstances.parallelStream().filter(instance -> instance.getRank() == rank).map(TaxonConceptInstance::getContainer).collect(Collectors.toSet()); concepts.parallelStream().forEach(tc -> tc.resolveTaxon(this)); } prevResolved = resolved; resolved = allInstances.stream().filter(instance -> instance.isResolved()).count(); logger.debug("Resolved " + prevResolved + " -> " + resolved); } while (resolved != prevResolved); Set<TaxonConcept> unresolvedConcepts = allInstances.parallelStream().map(TaxonConceptInstance::getContainer).filter(tc -> !tc.isResolved()).collect(Collectors.toSet()); logger.info("Found " + unresolvedConcepts.size() + " un-resolved concepts"); unresolvedConcepts.parallelStream().forEach(tc -> { tc.resolveTaxon(this); this.report(IssueType.PROBLEM, "taxonConcept.unresolved", tc); }); logger.info("Finished resolving taxa"); }</code><technical_language>if this needs overflow checking</technical_language>

Target:
public void resolveTaxon() throws IndexBuilderException { logger.info("Resolving taxa"); final Collection<TaxonConceptInstance> allInstances = this.instances.values(); final Set<RankType> rs = allInstances.stream().map(TaxonConceptInstance::getRank).collect(Collectors.toSet()); List<RankType> ranks = new ArrayList<>(rs); Collections.sort(ranks, (r1, r2) -> r1.getSortOrder() - r2.getSortOrder()); long prevResolved = 0; long resolved = 0; do { for (RankType rank : ranks) { Set<TaxonConcept> concepts = allInstances.stream().filter(instance -> instance.getRank() == rank).map(TaxonConceptInstance::getContainer).collect(Collectors.toSet()); concepts.parallelStream().forEach(tc -> tc.resolveTaxon(this)); } prevResolved = resolved; resolved = allInstances.stream().filter(instance -> instance.isResolved()).count(); logger.debug("Resolved " + prevResolved + " -> " + resolved); } while (resolved != prevResolved); Set<TaxonConcept> unresolvedConcepts = allInstances.stream().map(TaxonConceptInstance::getContainer).filter(tc -> !tc.isResolved()).collect(Collectors.toSet()); logger.info("Found " + unresolvedConcepts.size() + " un-resolved concepts"); unresolvedConcepts.parallelStream().forEach(tc -> { tc.resolveTaxon(this); this.report(IssueType.PROBLEM, "taxonConcept.unresolved", tc); }); logger.info("Finished resolving taxa"); }
Source:
<code>private void setEntryTypeForReturnAndClose(Optional<BibEntryType> entryType) { type = entryType.map(BibEntryType::getType).orElse(null); viewModel.stopFetching(); <START> this.basePanel.frame().getGlobalSearchBar().endSearch(); <END> this.close(); }</code><technical_language>A solution Inject StateManager call clearSearchQuery (For inject for example LinkedFileEditDialogView dialog)</technical_language>

Target:
private void setEntryTypeForReturnAndClose(Optional<BibEntryType> entryType) { type = entryType.map(BibEntryType::getType).orElse(null); viewModel.stopFetching(); this.stateManager.clearSearchQuery(); this.close(); }
Source:
<code>private void emitInsertObjectToRealmMethod(JavaWriter writer) throws IOException { writer.emitAnnotation("Override"); writer.beginMethod( "void", <START> "insertToRealm", <END> EnumSet.of(Modifier.PUBLIC), "Realm", "realm", "RealmModel", "type", "Map<RealmModel, Long>", "cache"); writer.emitSingleLineComment("This cast is correct because obj is either"); writer.emitSingleLineComment("generated by RealmProxy or the original type extending directly from RealmObject"); writer.emitStatement("@SuppressWarnings(\"unchecked\") Class<RealmModel> clazz = (Class<RealmModel>) ((type instanceof RealmObjectProxy) ? type.getClass().getSuperclass() : type.getClass())"); writer.emitEmptyLine(); emitMediatorSwitch(new ProxySwitchStatement() { @Override public void emitStatement(int i, JavaWriter writer) throws IOException { writer.emitStatement("%s.insert(realm, (%s) type, cache)", proxyClasses.get(i), simpleModelClasses.get(i)); } }, writer, false); writer.endMethod(); writer.emitEmptyLine(); }</code><technical_language>InsertToRealm sounds wrong somehow. InsertInRealm? InsertObject</technical_language>

Target:
private void emitInsertObjectToRealmMethod(JavaWriter writer) throws IOException { writer.emitAnnotation("Override"); writer.beginMethod( "void", "insert", EnumSet.of(Modifier.PUBLIC), "Realm", "realm", "RealmModel", "object", "Map<RealmModel, Long>", "cache"); writer.emitSingleLineComment("This cast is correct because obj is either"); writer.emitSingleLineComment("generated by RealmProxy or the original type extending directly from RealmObject"); writer.emitStatement("@SuppressWarnings(\"unchecked\") Class<RealmModel> clazz = (Class<RealmModel>) ((object instanceof RealmObjectProxy) ? object.getClass().getSuperclass() : object.getClass())"); writer.emitEmptyLine(); emitMediatorSwitch(new ProxySwitchStatement() { @Override public void emitStatement(int i, JavaWriter writer) throws IOException { writer.emitStatement("%s.insert(realm, (%s) object, cache)", proxyClasses.get(i), simpleModelClasses.get(i)); } }, writer, false); writer.endMethod(); writer.emitEmptyLine(); }
Source:
<code>public void changePassword(User user, String newPassword) throws APIException { <START> changePassword(user, null, newPassword); <END> }</code><technical_language>This call DAO in 1.11</technical_language>

Target:
public void changePassword(User user, String newPassword) throws APIException { dao.changePassword(user, newPassword); }
Source:
<code>public void setUp() throws Exception { super.setUp(); <START> when(Config.GetValue(ConfigValues.DefaultTimeZone)).thenReturn("Israel Standard Time"); <END> }</code><technical_language>extracting this variable checked on</technical_language>

Target:
public void setUp() throws Exception { super.setUp(); when(Config.GetValue(ConfigValues.DefaultTimeZone)).thenReturn(DEFAULT_TIME_ZONE); }
Source:
<code>public DataSegment( @JsonProperty("dataSource") String dataSource, @JsonProperty("interval") Interval interval, @JsonProperty("version") String version, @JsonProperty("loadSpec") Map<String, Object> loadSpec, @JsonProperty("dimensions") @JsonDeserialize(using = CommaListJoinDeserializer.class) List<String> dimensions, @JsonProperty("metrics") @JsonDeserialize(using = CommaListJoinDeserializer.class) List<String> metrics, @JsonProperty("shardSpec") ShardSpec shardSpec, @JsonProperty("binaryVersion") Integer binaryVersion, @JsonProperty("size") long size ) { final Predicate<String> nonEmpty = new Predicate<String>() { @Override public boolean apply(String input) { return input != null && !input.isEmpty(); } }; this.dataSource = STRING_INTERNER.intern(dataSource); this.interval = interval; this.loadSpec = loadSpec; this.version = version; this.dimensions = dimensions == null ? ImmutableList.<String>of() : internFn(Lists.newArrayList(Iterables.filter(dimensions, nonEmpty))); this.metrics = metrics == null ? ImmutableList.<String>of() <START> : internFn(Lists.newArrayList(Iterables.filter(metrics, nonEmpty))); <END> this.shardSpec = (shardSpec == null) ? NoneShardSpec.INSTANCE : shardSpec; this.binaryVersion = binaryVersion; this.size = size; this.identifier = makeDataSegmentIdentifier( this.dataSource, this.interval.getStart(), this.interval.getEnd(), this.version, this.shardSpec ); }</code><technical_language>Ordering.natural().immutableSortedCopy(...), incurs copies Ordering docs</technical_language>

Target:
public DataSegment( @JsonProperty("dataSource") String dataSource, @JsonProperty("interval") Interval interval, @JsonProperty("version") String version, @JsonProperty("loadSpec") Map<String, Object> loadSpec, @JsonProperty("dimensions") @JsonDeserialize(using = CommaListJoinDeserializer.class) List<String> dimensions, @JsonProperty("metrics") @JsonDeserialize(using = CommaListJoinDeserializer.class) List<String> metrics, @JsonProperty("shardSpec") ShardSpec shardSpec, @JsonProperty("binaryVersion") Integer binaryVersion, @JsonProperty("size") long size ) { final Predicate<String> nonEmpty = new Predicate<String>() { @Override public boolean apply(String input) { return input != null && !input.isEmpty(); } }; this.dataSource = STRING_INTERNER.intern(dataSource); this.interval = interval; this.loadSpec = loadSpec; this.version = version; this.dimensions = dimensions == null ? ImmutableList.<String>of() : LIST_INTERNER.intern(Ordering.natural() .immutableSortedCopy(Iterables.filter(dimensions, nonEmpty))); this.metrics = metrics == null ? ImmutableList.<String>of() : LIST_INTERNER.intern(Ordering.natural().immutableSortedCopy(Iterables.filter(metrics, nonEmpty))); this.shardSpec = (shardSpec == null) ? NoneShardSpec.INSTANCE : shardSpec; this.binaryVersion = binaryVersion; this.size = size; this.identifier = makeDataSegmentIdentifier( this.dataSource, this.interval.getStart(), this.interval.getEnd(), this.version, this.shardSpec ); }
Source:
<code>public void testPostEvent() throws Exception { OcspChecker ocspChecker = new OcspChecker(factory, eventAdmin); Response response = mock(Response.class); ocspChecker.createOcspResponse(response); <START> verify(eventAdmin, times(1)).postEvent(any()); <END> }</code><technical_language>If createOcspResponse line 168 is throwing exception test expects, this line get called removed</technical_language>

Target:
public void testPostEvent() throws Exception { OcspChecker ocspChecker = new OcspChecker(factory, eventAdmin); Response response = mock(Response.class); ocspChecker.createOcspResponse(response); }
Source:
<code>public void disable() { if (useDefaultDisplayVsync) { vsyncSampler.removeObserver(); } <START> unregisterDisplayListener(); <END> }</code><technical_language>registerDisplayListener is in if block in enable, this in if block in disable also</technical_language>

Target:
public void disable() { if (useDefaultDisplayVsync) { vsyncSampler.removeObserver(); if (defaultDisplayListener != null) defaultDisplayListener.unregister(); } }
Source:
<code>public Object getInternalProperty(String key) { Configuration firstMatchingConfiguration = null; for (Configuration config : configList) { <START> try { <END> if (config.containsKey(key)) { firstMatchingConfiguration = config; break; } } catch (Exception e) { e.printStackTrace(); } } if (firstMatchingConfiguration != null) { return firstMatchingConfiguration.getProperty(key); } else { return null; } }</code><technical_language>Is do a non-empty check remove try block</technical_language>

Target:
public Object getInternalProperty(String key) { Configuration firstMatchingConfiguration = null; for (Configuration config : configList) { try { if (config.containsKey(key)) { firstMatchingConfiguration = config; break; } } catch (Exception e) { logger.error("Error when trying to get value for key " + key + " from " + config + ", will continue to try the next one."); } } if (firstMatchingConfiguration != null) { return firstMatchingConfiguration.getProperty(key); } else { return null; } }
Source:
<code>public void refresh(IResource[] resources, int depth, IProgressMonitor monitor) throws TeamException { for (IResource resource : resources) { if (resource.getType() == IResource.ROOT) { GitSyncCache newCache = GitSyncCache.getAllData(gsds, monitor); cache.merge(newCache); super.refresh(resources, depth, monitor); return; } } List<String> paths = new ArrayList<String>(); for (IResource resource : resources) { IProject project = resource.getProject(); if (gsds.contains(project)) { String path = RepositoryMapping.getMapping(project) .getRepoRelativePath(resource); <START> if (!path.equals("")) { END> paths.add(path); } } } if (!paths.isEmpty()) { GitSyncCache newCache = GitSyncCache.getAllData(gsds, paths, monitor); cache.merge(newCache); } super.refresh(resources, depth, monitor); }</code><technical_language>use: path.length() == 0</technical_language>

Target:
public void refresh(IResource[] resources, int depth, IProgressMonitor monitor) throws TeamException { for (IResource resource : resources) { if (resource.getType() == IResource.ROOT) { GitSyncCache newCache = GitSyncCache.getAllData(gsds, monitor); cache.merge(newCache); super.refresh(resources, depth, monitor); return; } } List<String> paths = new ArrayList<String>(); for (IResource resource : resources) { IProject project = resource.getProject(); if (gsds.contains(project)) { RepositoryMapping mapping = RepositoryMapping .getMapping(project); if (mapping != null) { String path = mapping.getRepoRelativePath(resource); if (path.length() != 0) { paths.add(path); } } } } if (!paths.isEmpty()) { GitSyncCache newCache = GitSyncCache.getAllData(gsds, paths, monitor); cache.merge(newCache); } super.refresh(resources, depth, monitor); }
Source:
<code>public <T> T tryWritingVault(Supplier<T> action) throws Retry.ActionFailedException { Optional<Span> optionalSpan = initSpan("write"); return optionalSpan.map(span -> { try (Scope ignored = tracer.activateSpan(span)) { try { return action.get(); } catch (RuntimeException e) { LOGGER.error("Exception during writing vault", e); span.setTag(TracingUtil.ERROR, true); span.setTag(TracingUtil.MESSAGE, e.getMessage()); metricService.incrementMetricCounter(MetricType.VAULT_READ_FAILED); throw new Retry.ActionFailedException(e.getMessage()); } } finally { span.finish(); } <START> }).orElseGet(action::get); <END> }</code><technical_language>This throw RuntimeException</technical_language>

Target:
public <T> T tryWritingVault(Supplier<T> action) throws Retry.ActionFailedException { return executeVaultOperationWithTrace(action, "write", MetricType.VAULT_WRITE_FAILED); }
Source:
<code>public void testIsWorkspaceMetacard() { MetacardImpl metacard = new MetacardImpl(); metacard.setTags(ImmutableSet.of("workspace")); boolean isWorkspace = WorkspaceMetacardImpl.isWorkspaceMetacard(metacard); <START> assertTrue(isWorkspace); <END> }</code><technical_language>assertTrue()/assertFalse(), variant takes a failure message provide more information test fails (otherwise printed failure message "expected true false")</technical_language>

Target:
public void testIsWorkspaceMetacard() { MetacardImpl metacard = new MetacardImpl(); metacard.setTags(ImmutableSet.of("workspace")); boolean isWorkspace = WorkspaceMetacardImpl.isWorkspaceMetacard(metacard); assertThat(isWorkspace, is(true)); }
Source:
<code>public static long arrayPosition( @TypeParameter("T") Type type, @OperatorDependency(operator = EQUAL, argumentTypes = {"T", "T"}) MethodHandle equalMethodHandle, @SqlType("array(T)") Block array, @SqlType("T") Block element) { int size = array.getPositionCount(); for (int i = 0; i < size; i++) { if (!array.isNull(i)) { Object arrayValue = type.getObject(array, i); try { Boolean result = (Boolean) equalMethodHandle.invoke(arrayValue, element); if (result == null) { <START> throw new PrestoException(NOT_SUPPORTED, "array_position does not support element of array type that contains null"); <END> } if (result) { return i + 1; } } catch (Throwable t) { throw internalError(t); } } } return 0; }</code><technical_language>array_position support elements of complex types null? In theory T a map a row</technical_language>

Target:
public static long arrayPosition( @TypeParameter("T") Type type, @OperatorDependency(operator = EQUAL, argumentTypes = {"T", "T"}) MethodHandle equalMethodHandle, @SqlType("array(T)") Block array, @SqlType("T") Block element) { int size = array.getPositionCount(); for (int i = 0; i < size; i++) { if (!array.isNull(i)) { Object arrayValue = type.getObject(array, i); try { Boolean result = (Boolean) equalMethodHandle.invoke(arrayValue, element); if (result == null) { throw new PrestoException(NOT_SUPPORTED, "array_position does not support elements of complex types that contain null"); } if (result) { return i + 1; } } catch (Throwable t) { throw internalError(t); } } } return 0; }
Source:
<code>public void addTrackers(Collection<Tracker> trackers) { if (!storage.isPropertySet(TRACKERS)) <START> this.clearTrackers(); <END> storage.get(TRACKERS).addAll(trackers); }</code><technical_language>I idea, I worried getTrackers() method returning fake data. users attempt call .getTrackers() add item collection, behavior depend trackers before: return a new **modifiable** hashset, **unmodifiable** set if some trackers stored already. option return unmodifiable empty set</technical_language>

Target:
public Project addTrackers(Collection<Tracker> trackers) { if (!storage.isPropertySet(TRACKERS)) storage.set(TRACKERS, new HashSet<>()); storage.get(TRACKERS).addAll(trackers); return this; }
Source:
<code>private boolean noteTextSizeIsWithinLimit(String noteText) { <START> return (noteText.length() <= PaymentWorksConstants.NOTE_TEXT_DEFAULT_MAX_LENGTH); <END> }</code><technical_language>I wondering if this include a null check well. StringUtils.length(noteText), return zero if noteText is null, return length of string</technical_language>

Target:
private boolean noteTextSizeIsWithinLimit(String noteText) { return (noteTextIsNotBlank(noteText) && (noteText.length() <= PaymentWorksConstants.NOTE_TEXT_DEFAULT_MAX_LENGTH)); }
Source:
<code>protected Collection<String> mapToColumnNames(String propertyName) { Locale locale = getLocale(); <START> List<String> columnName = new ArrayList<>(5); <END> columnName.add(propertyName); StringBuilder propertyNameWithUnderscores = new StringBuilder(); propertyNameWithUnderscores.append(propertyName.substring(0, 1)); for (int i = 1; i < propertyName.length(); i++) { String s = propertyName.substring(i, i + 1); String slc = s.toLowerCase(locale); if (!s.equals(slc)) { propertyNameWithUnderscores.append("_").append(slc); } else { propertyNameWithUnderscores.append(s); } } columnName.add(propertyNameWithUnderscores.toString()); return columnName; }</code><technical_language>This sized 2 seems, a nitpick</technical_language>

Target:
protected Collection<String> mapToColumnNames(String propertyName) { Locale locale = getLocale(); List<String> columnNames = new ArrayList<>(5); columnNames.add(propertyName); StringBuilder propertyNameWithUnderscores = new StringBuilder(); propertyNameWithUnderscores.append(propertyName.substring(0, 1)); for (int i = 1; i < propertyName.length(); i++) { String s = propertyName.substring(i, i + 1); String slc = s.toLowerCase(locale); if (!s.equals(slc)) { propertyNameWithUnderscores.append("_").append(slc); } else { propertyNameWithUnderscores.append(s); } } columnNames.add(propertyNameWithUnderscores.toString()); return columnNames; }