auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>protected void updateDetailsAvailability() { super.updateDetailsAvailability(); Cluster cluster = getSelectedItem(); boolean clusterSupportsVirtService = cluster != null && cluster.supportsVirtService(); getClusterVmListModel().setIsAvailable(clusterSupportsVirtService); <START> getClusterServiceModel().setIsAvailable(clusterSupportsVirtService); <END> getClusterGlusterHookListModel().setIsAvailable(clusterSupportsVirtService); getAffinityGroupListModel().setIsAvailable(clusterSupportsVirtService); getCpuProfileListModel().setIsAvailable(clusterSupportsVirtService); getAffinityLabelListModel().setIsAvailable(clusterSupportsVirtService); }</code><technical_language>This GlusterService VirtService</technical_language>

Target:
protected void updateDetailsAvailability() { super.updateDetailsAvailability(); Cluster cluster = getSelectedItem(); boolean clusterSupportsVirtService = cluster != null && cluster.supportsVirtService(); boolean clusterSupportsGlusterService = cluster != null && cluster.supportsGlusterService(); getClusterVmListModel().setIsAvailable(clusterSupportsVirtService); getClusterServiceModel().setIsAvailable(clusterSupportsGlusterService); getClusterGlusterHookListModel().setIsAvailable(clusterSupportsGlusterService); getAffinityGroupListModel().setIsAvailable(clusterSupportsVirtService); getCpuProfileListModel().setIsAvailable(clusterSupportsVirtService); getAffinityLabelListModel().setIsAvailable(clusterSupportsVirtService); }
Source:
<code>private Function<PollingContext<DeletedCertificate>, Mono<PollResponse<DeletedCertificate>>> createDeletePollOperation(String keyName) { return pollingContext -> withContext(context -> service.getDeletedCertificatePoller(vaultUrl, keyName, API_VERSION, ACCEPT_LANGUAGE, CONTENT_TYPE_HEADER_VALUE, context) .flatMap(deletedCertificateResponse -> { if (deletedCertificateResponse.getStatusCode() == HttpURLConnection.HTTP_NOT_FOUND) { return Mono.defer(() -> Mono.just(new PollResponse<>(LongRunningOperationStatus.IN_PROGRESS, pollingContext.getLatestResponse().getValue()))); } if (deletedCertificateResponse.getStatusCode() == HttpURLConnection.HTTP_FORBIDDEN) { <START> return Mono.defer(() -> Mono.just(new PollResponse<>(LongRunningOperationStatus.fromString("FORBIDDEN", true), <END> pollingContext.getLatestResponse().getValue()))); } return Mono.defer(() -> Mono.just(new PollResponse<>(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, deletedCertificateResponse.getValue()))); })) .onErrorReturn(new PollResponse<>(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, pollingContext.getLatestResponse().getValue())); }</code><technical_language>Based feedback API review. this is supposed here. This logic is supposed in poll operation of beginCreateCertificate</technical_language>

Target:
private Function<PollingContext<DeletedCertificate>, Mono<PollResponse<DeletedCertificate>>> createDeletePollOperation(String keyName) { return pollingContext -> withContext(context -> service.getDeletedCertificatePoller(vaultUrl, keyName, API_VERSION, ACCEPT_LANGUAGE, CONTENT_TYPE_HEADER_VALUE, context) .flatMap(deletedCertificateResponse -> { if (deletedCertificateResponse.getStatusCode() == HttpURLConnection.HTTP_NOT_FOUND) { return Mono.defer(() -> Mono.just(new PollResponse<>(LongRunningOperationStatus.IN_PROGRESS, pollingContext.getLatestResponse().getValue()))); } if (deletedCertificateResponse.getStatusCode() == HttpURLConnection.HTTP_FORBIDDEN) { return Mono.defer(() -> Mono.just(new PollResponse<>(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, pollingContext.getLatestResponse().getValue()))); } return Mono.defer(() -> Mono.just(new PollResponse<>(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, deletedCertificateResponse.getValue()))); })) .onErrorReturn(new PollResponse<>(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, pollingContext.getLatestResponse().getValue())); }
Source:
<code>public static Mono<BinaryData> fromFlux(Flux<ByteBuffer> data) { <START> Objects.requireNonNull(data, "'data' cannot be null."); <END> return FluxUtil.collectBytesInByteBufferStream(data) .flatMap(bytes -> Mono.just(fromBytes(bytes))); }</code><technical_language>For methods return Mono/Flux, error channel instead of throwing exception</technical_language>

Target:
public static Mono<BinaryData> fromFlux(Flux<ByteBuffer> data) { if (Objects.isNull(data)) { return monoError(LOGGER, new NullPointerException("'data' cannot be null.")); } return FluxUtil.collectBytesInByteBufferStream(data) .flatMap(bytes -> Mono.just(fromBytes(bytes))); }
Source:
<code>public ProcessInstance getProcessInstance(String instanceId) throws WorkflowException { <START> ProcessInstanceImpl instance = repository.getById(instanceId); <END> return instance; }</code><technical_language>![MINOR](<LINK_0> 'Severity: MINOR') Immediately return this expression instead of assigning temporary variable "instance". [![rule](<LINK_1>](<LINK_2></technical_language>

Target:
public ProcessInstance getProcessInstance(String instanceId) throws WorkflowException { return repository.getById(instanceId); }
Source:
<code>private boolean loadDataInMemory() { String value = Optional.ofNullable(GeoServerExtensions.getProperty("WMTS_HISTOGRAM_IN_MEMORY")) <START> .orElse("false"); <END> return Boolean.getBoolean(value); }</code><technical_language>If is NULL, Boolean.getBoolean(value) return FALSE anyway, I understand this is more explicit</technical_language>

Target:
private boolean loadDataInMemory() { String value = GeoServerExtensions.getProperty("WMTS_HISTOGRAM_IN_MEMORY"); return Boolean.getBoolean(value); }
Source:
<code>private LoggingRegistry() { this.map = new ConcurrentHashMap<>(); this.childrenMap = new ConcurrentHashMap<>(); this.fileWriterBuffers = new ConcurrentHashMap<>(); this.registerPurgeQueue = new ConcurrentLinkedQueue<>(); this.lastModificationTime = new Date(); <START> this.maxSize = Const.toInt( EnvUtil.getSystemProperty( "KETTLE_MAX_LOGGING_REGISTRY_SIZE" ), DEFAULT_MAX_SIZE ); <END> this.purgeTimeout = Const.toInt( EnvUtil.getSystemProperty( "KETTLE_LOGGING_REGISTRY_PURGE_TIMEOUT" ), DEFAULT_PURGE_TIMER ); this.purgeTimerCount = 0; this.purgedObjectCount = 0; this.foundCounter = 0; installPurgeTimer(); }</code><technical_language>KETTLE_LOGGING_REGISTRY_PURGE_TIMEOUT a constant in Const.java for consistency other kettle params. I KETTLE_MAX_LOGGING_REGISTRY_SIZE before, defined in Const.java</technical_language>

Target:
private LoggingRegistry() { this.map = new ConcurrentHashMap<>(); this.childrenMap = new ConcurrentHashMap<>(); this.fileWriterBuffers = new ConcurrentHashMap<>(); this.registerPurgeQueue = new ConcurrentLinkedQueue<>(); this.lastModificationTime = new Date(); this.purgeTimerCount = 0; this.purgedObjectCount = 0; this.foundCounter = 0; updateFromProperties(); installPurgeTimer(); }
Source:
<code>public void shouldBeAbleToUseSessionAfterDefaultTransactionFails() throws Exception { User u1 = new User("frantisek"); session.save(u1); session.clear(); try { <START> session.save(new User("frantisek")); <END> } catch (Exception ex) { logger.info("Caught exception", ex); } User loaded = session.load(User.class, u1.getId()); assertThat(loaded).isNotNull(); }</code><technical_language>I I missed Assert.fail() in case save succeeds</technical_language>

Target:
public void shouldBeAbleToUseSessionAfterDefaultTransactionFails() throws Exception { User u1 = new User("frantisek"); session.save(u1); session.clear(); try { session.save(new User("frantisek")); fail("Constraint violation should have make the second save fail"); } catch (Exception ex) { logger.info("Caught exception", ex); } User loaded = session.load(User.class, u1.getId()); assertThat(loaded).isNotNull(); }
Source:
<code>protected String getPackageLocation() { <START> return "com/puppycrawl/tools/checkstyle/filters"; <END> }</code><technical_language>package location name of test in it. com/puppycrawl/tools/checkstyle/filters/xpathfilter</technical_language>

Target:
protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/filters/xpathfilter"; }
Source:
<code>public CXXGetJavaDataScenario(@NonNull Configuration config, @NonNull Context context) { super(config, context); config.setAutoTrackSessions(false); config.addMetadata("notData", "vals", "passMetaData"); config.setAppVersion("passAppVersion"); config.setContext("passContext"); <START> config.setUser("passUser", "passUser", "passUser"); <END> }</code><technical_language>if set passUserId, ...Name ...Email C++ pulled out separately (only name currently)</technical_language>

Target:
public CXXGetJavaDataScenario(@NonNull Configuration config, @NonNull Context context) { super(config, context); config.setAutoTrackSessions(false); config.addMetadata("notData", "vals", "passMetaData"); config.setAppVersion("passAppVersion"); config.setContext("passContext"); config.setUser("passUserId", "passUserEmail", "passUserName"); }
Source:
<code>public void testEmptyDictionary() throws Exception { String doc1 = "doc1"; String key1 = "emptyDict"; MutableDocument mDoc = new MutableDocument(doc1); mDoc.setDictionary(key1, new MutableDictionary()); save(mDoc); final Query query = QueryBuilder.select(SelectResult.property(key1)) .from(DataSource.database(db)) .where(Meta.id.equalTo(Expression.string(doc1))); ResultSet results = query.execute(); <START> for (Result result : results.allResults()) { result.toMap(); } <END> }</code><technical_language>assert if result.toMap() is empty</technical_language>

Target:
public void testEmptyDictionary() throws Exception { String doc1 = "doc1"; String key1 = "emptyDict"; MutableDocument mDoc = new MutableDocument(doc1); mDoc.setDictionary(key1, new MutableDictionary()); save(mDoc); final Query query = QueryBuilder.select(SelectResult.property(key1)) .from(DataSource.database(db)) .where(Meta.id.equalTo(Expression.string(doc1))); ResultSet results = query.execute(); assertNotNull(results); for (Result result : results.allResults()) { assertNotNull(result); assertEquals(1, result.toMap().size()); Dictionary emptyDict = result.getDictionary(key1); assertNotNull(emptyDict); assertTrue(emptyDict.isEmpty()); } }
Source:
<code>private String formattedRule() { <START> if (rule == null) { <END> return ""; } return String.format("[%s]", rule.getName()); }</code><technical_language>This case longer occur, right? In case I removed</technical_language>

Target:
private String formattedRule() { return String.format("[%s]", rule.getName()); }
Source:
<code>public void addLine(Object object) { SortedSet<Method> methods = getSortedMethods(object); for (Method method : methods) { if (method.getName().startsWith("get") && method.getParameterTypes().length == 0) { try { if (method.getReturnType().equals(boolean.class)) { builder.append((Boolean) method.invoke(object)); addSeparator(); } else if (method.getReturnType().equals(int.class)) { builder.append((Integer) method.invoke(object)); addSeparator(); } else if (method.getReturnType().equals(long.class)) { builder.append((Long) method.invoke(object)); addSeparator(); } else if (method.getReturnType().equals(double.class)) { builder.append((Double) method.invoke(object)); addSeparator(); } else if (method.getReturnType().equals(String.class)) { builder.append((String) method.invoke(object)); addSeparator(); } else if (method.getReturnType().equals(Date.class)) { Date value = (Date) method.invoke(object); builder.append(DATE_FORMAT.print(new DateTime(value))); addSeparator(); } else if (method.getReturnType().equals(Map.class)) { Map value = (Map) method.invoke(object); if (value != null) { String map = MiscFormatter.toJson(value).toString(); <START> map = map.replaceAll("[\\{|\\}|\"]", ""); <END> map = map.replaceAll(",", " "); builder.append(map); addSeparator(); } } } catch (IllegalAccessException | InvocationTargetException error) { Log.warning(error); } } } addLineEnding(); }</code><technical_language>do | in regex? I need those</technical_language>

Target:
public void addLine(Object object) { SortedSet<Method> methods = getSortedMethods(object); for (Method method : methods) { if (method.getName().startsWith("get") && method.getParameterTypes().length == 0) { try { if (method.getReturnType().equals(boolean.class)) { builder.append((Boolean) method.invoke(object)); addSeparator(); } else if (method.getReturnType().equals(int.class)) { builder.append((Integer) method.invoke(object)); addSeparator(); } else if (method.getReturnType().equals(long.class)) { builder.append((Long) method.invoke(object)); addSeparator(); } else if (method.getReturnType().equals(double.class)) { builder.append((Double) method.invoke(object)); addSeparator(); } else if (method.getReturnType().equals(String.class)) { builder.append((String) method.invoke(object)); addSeparator(); } else if (method.getReturnType().equals(Date.class)) { Date value = (Date) method.invoke(object); builder.append(DATE_FORMAT.print(new DateTime(value))); addSeparator(); } else if (method.getReturnType().equals(Map.class)) { Map value = (Map) method.invoke(object); if (value != null) { String map = MiscFormatter.toJson(value).toString(); map = map.replaceAll("[\\{\\}\"]", ""); map = map.replaceAll(",", " "); builder.append(map); addSeparator(); } } } catch (IllegalAccessException | InvocationTargetException error) { Log.warning(error); } } } addLineEnding(); }
Source:
<code>static Stream<Arguments> getTestParameters() { <START> CertificateServiceVersion[] filteredKeyServiceVersion = Arrays.stream(CertificateServiceVersion.values()) .filter(CertificateClientTestBase::shouldServiceVersionBeTested) .toArray(CertificateServiceVersion[]::new); boolean rollingServiceVersion = SERVICE_VERSION_FROM_ENV != null && SERVICE_VERSION_FROM_ENV .equalsIgnoreCase(AZURE_TEST_SERVICE_VERSIONS_VALUE_ROLLING); return getArgumentsFromServiceVersion(Arrays.asList(filteredKeyServiceVersion), rollingServiceVersion); <END> }</code><technical_language>I simplify this code moving more of logic getArgumentsFromServiceVersion method. could, for example, pass in ServiceVersion enum, a predicate (i.e. CertificateClientTestBase::shouldServiceVersionBeTested), it. method environment variable</technical_language>

Target:
static Stream<Arguments> getTestParameters() { return getArgumentsFromServiceVersion(CertificateServiceVersion.values(), shouldServiceVersionBeTested, SERVICE_VERSION_FROM_ENV); }
Source:
<code>private void executeTask(DatastreamTask task) { Datastream datastream = task.getDatastreams().get(0); int messageSize = _messageSize; long sleepBetweenSendMs = _sleepBetweenSendMs; long index = 0; if (datastream.hasMetadata()) { StringMap dsMetadata = datastream.getMetadata(); if (dsMetadata.containsKey(CFG_MESSAGE_SIZE_KB)) { messageSize = Integer.parseInt(dsMetadata.get(CFG_MESSAGE_SIZE_KB)); } if (dsMetadata.containsKey(CFG_SLEEP_BETWEEN_SEND_MS)) { sleepBetweenSendMs = Long.parseLong(dsMetadata.get(CFG_SLEEP_BETWEEN_SEND_MS)); } } <START> while (true) { <END> DatastreamProducerRecord record = createDatastreamEvent(index, messageSize); task.getEventProducer().send(record, (metadata, exception) -> { if (exception != null) { LOG.error("Send failed for event " + metadata.getCheckpoint(), exception); } }); try { Thread.sleep(sleepBetweenSendMs); } catch (InterruptedException e) { String msg = "Producer thread is interrupted. Stopping the producer for task " + task; LOG.error(msg, e); throw new DatastreamRuntimeException(msg, e); } index++; } }</code><technical_language>This a volatile flag, I executor servicer shutdown() kill thread</technical_language>

Target:
private void executeTask(DatastreamTask task) { try { Datastream datastream = task.getDatastreams().get(0); int partitions = datastream.getDestination().getPartitions(); int messageSize = _messageSize; long sleepBetweenSendMs = _sleepBetweenSendMs; String checkpoint = task.getCheckpoints().getOrDefault(0, "0"); long index = Long.parseLong(StringUtils.isBlank(checkpoint) ? "0" : checkpoint); LOG.info("Checkpoint string = " + checkpoint + " index = " + index); if (datastream.hasMetadata()) { StringMap dsMetadata = datastream.getMetadata(); if (dsMetadata.containsKey(CFG_MESSAGE_SIZE_BYTES)) { messageSize = Integer.parseInt(dsMetadata.get(CFG_MESSAGE_SIZE_BYTES)); } if (dsMetadata.containsKey(CFG_SLEEP_BETWEEN_SEND_MS)) { sleepBetweenSendMs = Long.parseLong(dsMetadata.get(CFG_SLEEP_BETWEEN_SEND_MS)); } } while (true) { for (int partition = 0; partition < partitions; partition++) { DatastreamProducerRecord record = createDatastreamEvent(index, messageSize, partition); task.getEventProducer().send(record, (metadata, exception) -> { if (exception != null) { LOG.error("Send failed for event " + metadata.getCheckpoint(), exception); } }); try { Thread.sleep(sleepBetweenSendMs); } catch (InterruptedException e) { String msg = "Producer thread is interrupted. Stopping the producer for task " + task; LOG.error(msg, e); throw new DatastreamRuntimeException(msg, e); } } index++; } } catch (Exception ex) { LOG.error("Event producer threw exception ", ex); } }
Source:
<code>public void reactiveCancel() { <START> if (CoAP.isTcpScheme(request.getScheme())) { <END> proactiveCancel(); } else { cancel(); } }</code><technical_language>Do need support this all? understanding of coap+tcp is need actively cancel observation. Client code calling this method for a coap+tcp endpoint simply invokes wrong method, it</technical_language>

Target:
public void reactiveCancel() { if (CoAP.isTcpScheme(request.getScheme())) { LOGGER.log(Level.INFO, "Change to cancel the observe {0} proactive over TCP.", request.getTokenString()); proactiveCancel(); } else { cancel(); } }
Source:
<code>public Map<String, String> getJobMessageProperties() { if (jobProperties == null) { jobProperties = new HashMap<String, String>(); <START> jobProperties.put(VdcObjectType.StoragePool.toString().toLowerCase(), getStoragePoolName()); <END> jobProperties.put(VdcObjectType.VmTemplate.toString().toLowerCase(), getVmTemplateName()); } return jobProperties; }</code><technical_language>please VdcObjectType.StoragePool.name() instead of VdcObjectType.StoragePool.toString()</technical_language>

Target:
public Map<String, String> getJobMessageProperties() { if (jobProperties == null) { jobProperties = new HashMap<String, String>(); jobProperties.put(VdcObjectType.StoragePool.name().toLowerCase(), getStoragePoolName()); jobProperties.put(VdcObjectType.VmTemplate.name().toLowerCase(), getVmTemplateName()); } return jobProperties; }
Source:
<code>public void testUnmarshallEndSignalEvent() throws Exception { Diagram<Graph, Metadata> diagram = unmarshall(BPMN_ENDSIGNALEVENT); assertDiagram(diagram, 2); assertEquals("EndEventAssignments", diagram.getMetadata().getTitle()); Node<? extends Definition, ?> endSignalEventNode = diagram.getGraph().getNode("_C9151E0C-2E3E-4558-AFC2-34038E3A8552"); EndSignalEvent endSignalEvent = (EndSignalEvent) endSignalEventNode.getContent().getDefinition(); DataIOSet dataIOSet = endSignalEvent.getDataIOSet(); AssignmentsInfo assignmentsinfo = dataIOSet.getAssignmentsinfo(); <START> assertEquals("EndSignalEventInput1:String||||[din]employee->EndSignalEventInput1", <END> assignmentsinfo.getValue()); }</code><technical_language>here, move this check testUnmarshallEndSignalEvent() method</technical_language>

Target:
public void testUnmarshallEndSignalEvent() throws Exception { Diagram<Graph, Metadata> diagram = unmarshall(BPMN_ENDSIGNALEVENT); assertDiagram(diagram, 2); assertEquals("EndEventAssignments", diagram.getMetadata().getTitle()); Node<? extends Definition, ?> endSignalEventNode = diagram.getGraph().getNode("_C9151E0C-2E3E-4558-AFC2-34038E3A8552"); EndSignalEvent endSignalEvent = (EndSignalEvent) endSignalEventNode.getContent().getDefinition(); DataIOSet dataIOSet = endSignalEvent.getDataIOSet(); AssignmentsInfo assignmentsinfo = dataIOSet.getAssignmentsinfo(); assertEquals("EndSignalEventInput1:String||||[din]employee->EndSignalEventInput1", assignmentsinfo.getValue()); assertEquals("project", endSignalEvent.getExecutionSet().getSignalScope().getValue()); assertEquals("employee", endSignalEvent.getExecutionSet().getSignalRef().getValue()); }
Source:
<code>public void testMatches() { fFilter.addChild(TRUE_NODE); fFilter.addChild(TRUE_NODE); <START> assertTrue(fFilter.matches(fEvent)); <END> fFilter.replaceChild(0, FALSE_NODE); assertTrue(fFilter.matches(fEvent)); fFilter.setNot(true); assertFalse(fFilter.matches(fEvent)); }</code><technical_language>Test fNot=true TRUE children</technical_language>

Target:
public void testMatches() { fFilter.setNot(false); assertFalse(fFilter.matches(fEvent)); fFilter.setNot(true); assertTrue(fFilter.matches(fEvent)); fFilter.setNot(false); fFilter.addChild(TRUE_NODE); fFilter.addChild(TRUE_NODE); assertTrue(fFilter.matches(fEvent)); fFilter.setNot(true); assertFalse(fFilter.matches(fEvent)); fFilter.replaceChild(0, FALSE_NODE); assertFalse(fFilter.matches(fEvent)); fFilter.replaceChild(1, FALSE_NODE); fFilter.setNot(true); assertTrue(fFilter.matches(fEvent)); fFilter.setNot(false); assertFalse(fFilter.matches(fEvent)); }
Source:
<code><START> private Boolean rowTypesAreEquivalent( <END> MutableRel rel0, MutableRel rel1, Litmus litmus) { assert rel0.rowType.getFieldCount() == rel1.rowType.getFieldCount() : Pair.of(rel0, rel1); for (Pair<RelDataTypeField, RelDataTypeField> pair : Pair.zip(rel0.rowType.getFieldList(), rel0.rowType.getFieldList())) { if (!pair.left.getType().equals(pair.right.getType())) { return litmus.fail(Pair.of(rel0, rel1).toString()); } } return litmus.succeed(); }</code><technical_language>this method return boolean instead of Boolean</technical_language>

Target:
private boolean rowTypesAreEquivalent( MutableRel rel0, MutableRel rel1, Litmus litmus) { if (rel0.rowType.getFieldCount() != rel1.rowType.getFieldCount()) { return litmus.fail("Mismatch for column count: [{}]", Pair.of(rel0, rel1)); } for (Pair<RelDataTypeField, RelDataTypeField> pair : Pair.zip(rel0.rowType.getFieldList(), rel0.rowType.getFieldList())) { if (!pair.left.getType().equals(pair.right.getType())) { return litmus.fail("Mismatch for column type: [{}]", Pair.of(rel0, rel1)); } } return litmus.succeed(); }
Source:
<code>public void testSleep() { long now = System.currentTimeMillis(); Util.sleep(100); assertTrue(System.currentTimeMillis() - now >= 100); now = System.currentTimeMillis(); long then = now + 100; Util.sleepAfter(then, 100); assertTrue(System.currentTimeMillis() - now >= 200); now = System.currentTimeMillis(); then = now - 550; Util.sleepAfter(then, 500); assertTrue(System.currentTimeMillis() - now < 500); String LicenseKeytest = Util.generateLicenseKey(); <START> System.out.println(LicenseKeytest); <END> }</code><technical_language>printing out, assert*() test method. Simplest asserting string is null; possibly String.split() delimiter assert resulting array a length of 4</technical_language>

Target:
public void testSleep() { long now = System.currentTimeMillis(); Util.sleep(100); assertTrue(System.currentTimeMillis() - now >= 100); now = System.currentTimeMillis(); long then = now + 100; Util.sleepAfter(then, 100); assertTrue(System.currentTimeMillis() - now >= 200); now = System.currentTimeMillis(); then = now - 550; Util.sleepAfter(then, 500); assertTrue(System.currentTimeMillis() - now < 500); String computerIdentifier = Util.getComputerIdentifier(); String idParts[] = computerIdentifier.split("-"); assertEquals(4, idParts.length); }
Source:
<code>private byte[] readSequence(final int knownLength) { byte[] bases = (knownLength == -1) ? basesBuffer : new byte[knownLength] ; int sequenceLength = 0; while (!in.eof()) { final boolean sawEoln = in.skipNewlines(); if (in.eof()) { break; } if (sawEoln && in.peekByte() == '>') { break; } sequenceLength += in.readToEndOfOutputBufferOrEoln(bases, sequenceLength); while (sequenceLength > 0 && Character.isWhitespace(StringUtil.byteToChar(bases[sequenceLength - 1]))) { --sequenceLength; } if (sequenceLength == knownLength) { break; } if (sequenceLength == bases.length) { final byte[] tmp = new byte[bases.length * 2]; System.arraycopy(bases, 0, tmp, 0, sequenceLength); bases = tmp; } } <START> skipToEoln(); <END> if (sequenceLength != bases.length || bases == basesBuffer) { final byte[] tmp = new byte[sequenceLength]; System.arraycopy(bases, 0, tmp, 0, sequenceLength); bases = tmp; } return bases; }</code><technical_language>put this in if block line 139 applies 'length is known' case? I matters I defensive</technical_language>

Target:
private byte[] readSequence(final int knownLength) { byte[] bases = (knownLength == -1) ? basesBuffer : new byte[knownLength] ; int sequenceLength = 0; while (!in.eof()) { final boolean sawEoln = in.skipNewlines(); if (in.eof()) { break; } if (sawEoln && in.peekByte() == '>') { break; } sequenceLength += in.readToEndOfOutputBufferOrEoln(bases, sequenceLength); while (sequenceLength > 0 && Character.isWhitespace(StringUtil.byteToChar(bases[sequenceLength - 1]))) { --sequenceLength; } if (sequenceLength == knownLength) { skipToEoln(); break; } if (sequenceLength == bases.length) { final byte[] tmp = new byte[bases.length * 2]; System.arraycopy(bases, 0, tmp, 0, sequenceLength); bases = tmp; } } if (sequenceLength != bases.length || bases == basesBuffer) { final byte[] tmp = new byte[sequenceLength]; System.arraycopy(bases, 0, tmp, 0, sequenceLength); bases = tmp; } return bases; }
Source:
<code>public void beginTree(DetailAST rootAST) { rangeValues.clear(); expressionValues.clear(); processedExpressionRange.resetRange(); currentRangeValue = INITIAL_VALUE; <START> } <END></code><technical_language>please cleanup belongsToRangeValues. class fields (except user defined properties) cleaned, clear state completely for next file processing</technical_language>

Target:
public void beginTree(DetailAST rootAST) { rangeValues.clear(); expressionValues.clear(); isAfterValues.clear(); processingTokenEnd.reset(); currentRangeValue = INITIAL_VALUE; branchVisited = false; }
Source:
<code>public static void main(String[] args) throws Exception { CommandLine cmdLine = new CommandLine(); Config config = cmdLine.loadConfig(cmdLine.parser().parse(args)); LocalApplicationRunner localRunner = new LocalApplicationRunner(config); <START> localRunner.run(new BroadcastExample()); <END> }</code><technical_language>Copy-paste error? this "new MergeExample"</technical_language>

Target:
public static void main(String[] args) throws Exception { CommandLine cmdLine = new CommandLine(); Config config = cmdLine.loadConfig(cmdLine.parser().parse(args)); LocalApplicationRunner localRunner = new LocalApplicationRunner(config); localRunner.run(new MergeExample()); }
Source:
<code><START> public WriteResponse validateApiKey( <END> HttpServletRequest request, HttpServletResponse response, Publisher publisher ) { Maybe<ApplicationConfiguration> possibleConfig; try { possibleConfig = appConfigFetcher.configurationFor(request); } catch (ApiKeyNotFoundException | RevokedApiKeyException | InvalidIpForApiKeyException ex) { return error(request, response, AtlasErrorSummary.forException(ex)); } if (!possibleConfig.isNothing()) { return error( request, response, AtlasErrorSummary.forException(new UnauthorizedException( "API key is unauthorised" )) ); } if (!possibleConfig.requireValue().canWrite(publisher)) { return error( request, response, AtlasErrorSummary.forException(new ForbiddenException( "API key does not have write permission" )) ); } return null; }</code><technical_language>This is duplicating logic exists in other methods in this class. split this methods reuse them. resolve application configuration ensure exists. This happen in #unpublishContent else. validate application access a source happen for case is</technical_language>

Target:
private Optional<AtlasErrorSummary> validateApiKey( HttpServletRequest request, HttpServletResponse response, Publisher publisher ) { if (!possibleConfig.requireValue().canWrite(publisher)) { return Optional.of( AtlasErrorSummary.forException(new ForbiddenException( "API key does not have write permission" )) ); } return Optional.empty(); }
Source:
<code>public void functionsOcrProcess_shouldDetectText() throws IOException { GcsEvent gcsEvent = new GcsEvent(); <START> gcsEvent.bucket = FUNCTIONS_BUCKET; <END> gcsEvent.name = "wakeupcat.jpg"; new OcrProcessImage().accept(gcsEvent, null); List<LogRecord> logs = LOG_HANDLER.getStoredLogRecords(); assertThat(logs.get(1).getMessage()).contains("Extracted text from image: Wake up human!"); assertThat(logs.get(2).getMessage()).contains("Detected language en for file wakeupcat.jpg"); }</code><technical_language>a setter (or constructor) set fields</technical_language>

Target:
public void functionsOcrProcess_shouldDetectText() throws IOException { GcsEvent gcsEvent = new GcsEvent(); gcsEvent.setBucket(FUNCTIONS_BUCKET); gcsEvent.setName("wakeupcat.jpg"); new OcrProcessImage().accept(gcsEvent, null); List<LogRecord> logs = LOG_HANDLER.getStoredLogRecords(); assertThat(logs.get(1).getMessage()).contains("Extracted text from image: Wake up human!"); assertThat(logs.get(2).getMessage()).contains("Detected language en for file wakeupcat.jpg"); }
Source:
<code>private void detectDeadHost() { long current_time = EstTime.currentTimeMillis(); long current_delta = current_time - m_lastMessageMillis.get(); if (current_delta > m_logRate) { rateLimitedLogger.log( "Have not received a message from host " + hostnameAndIPAndPort() + " for " + (current_delta / 1000.0) + " seconds", current_time); } if (m_isUp && current_delta > m_deadHostTimeout) { if (m_deadReportsCount.getAndIncrement() == 0) { hostLog.error("DEAD HOST DETECTED, hostname: " + hostnameAndIPAndPort()); hostLog.info("\tcurrent time: " + current_time); <START> hostLog.info("\tlast message: " + m_lastMessageMillis.get()); <END> hostLog.info("\tdelta (millis): " + current_delta); hostLog.info("\ttimeout value (millis): " + m_deadHostTimeout); VoltDB.dropStackTrace("Timed out foreign host " + hostnameAndIPAndPort() + " with delta " + current_delta); } m_hostMessenger.reportForeignHostFailed(m_hostId); } }</code><technical_language>this print a in calculation</technical_language>

Target:
private void detectDeadHost() { long current_time = EstTime.currentTimeMillis(); long last_time = m_lastMessageMillis.get(); long current_delta = current_time - last_time; if (m_isUp && current_delta > m_deadHostTimeout) { if (m_deadReportsCount.getAndIncrement() == 0) { hostLog.error("DEAD HOST DETECTED, hostname: " + hostnameAndIPAndPort()); hostLog.info("\tcurrent time: " + current_time); hostLog.info("\tlast message: " + last_time); hostLog.info("\tdelta (millis): " + current_delta); hostLog.info("\ttimeout value (millis): " + m_deadHostTimeout); VoltDB.dropStackTrace("Timed out foreign host " + hostnameAndIPAndPort()); } m_hostMessenger.reportForeignHostFailed(m_hostId); } if (current_delta > m_logRate) { rateLimitedLogger.log( "Have not received a message from host " + hostnameAndIPAndPort() + " for " + (current_delta / 1000.0) + " seconds", current_time); } }
Source:
<code>protected PlanNodeStatsEstimate visitInPredicate(InPredicate node, Void context) { <START> if (!(node.getValueList() instanceof InListExpression) || !(node.getValue() instanceof SymbolReference)) { <END> return visitExpression(node, context); } InListExpression inList = (InListExpression) node.getValueList(); PlanNodeStatsEstimate statsSum = inList.getValues().stream() .map(inValue -> process(new ComparisonExpression(EQUAL, node.getValue(), inValue))) .reduce(filterForFalseExpression(), PlanNodeStatsEstimateMath::addStatsAndSumDistinctValues); if (isNaN(statsSum.getOutputRowCount())) { return visitExpression(node, context); } Symbol inValueSymbol = Symbol.from(node.getValue()); SymbolStatsEstimate symbolStats = input.getSymbolStatistics(inValueSymbol); double notNullValuesBeforeIn = input.getOutputRowCount() * (1 - symbolStats.getNullsFraction()); SymbolStatsEstimate newSymbolStats = statsSum.getSymbolStatistics(inValueSymbol) .mapDistinctValuesCount(newDistinctValuesCount -> min(newDistinctValuesCount, symbolStats.getDistinctValuesCount())); return input.mapOutputRowCount(rowCount -> min(statsSum.getOutputRowCount(), notNullValuesBeforeIn)) .mapSymbolColumnStatistics(inValueSymbol, oldSymbolStats -> newSymbolStats); }</code><technical_language>left list right</technical_language>

Target:
protected PlanNodeStatsEstimate visitInPredicate(InPredicate node, Void context) { if (!(node.getValue() instanceof SymbolReference) || !(node.getValueList() instanceof InListExpression)) { return visitExpression(node, context); } InListExpression inList = (InListExpression) node.getValueList(); PlanNodeStatsEstimate statsSum = inList.getValues().stream() .map(inValue -> process(new ComparisonExpression(EQUAL, node.getValue(), inValue))) .reduce(filterForFalseExpression(), PlanNodeStatsEstimateMath::addStatsAndSumDistinctValues); if (isNaN(statsSum.getOutputRowCount())) { return visitExpression(node, context); } Symbol inValueSymbol = Symbol.from(node.getValue()); SymbolStatsEstimate symbolStats = input.getSymbolStatistics(inValueSymbol); double notNullValuesBeforeIn = input.getOutputRowCount() * (1 - symbolStats.getNullsFraction()); SymbolStatsEstimate newSymbolStats = statsSum.getSymbolStatistics(inValueSymbol) .mapDistinctValuesCount(newDistinctValuesCount -> min(newDistinctValuesCount, symbolStats.getDistinctValuesCount())); return input.mapOutputRowCount(rowCount -> min(statsSum.getOutputRowCount(), notNullValuesBeforeIn)) .mapSymbolColumnStatistics(inValueSymbol, oldSymbolStats -> newSymbolStats); }
Source:
<code>private void checkForNewDevices() { logger.debug("Refreshing bluetooth device list..."); Set<String> newAddresses = new HashSet<>(); List<tinyb.BluetoothDevice> tinybDevices = adapter.getDevices(); <START> logger.debug("Found bluetooth devices.", tinybDevices.size()); <END> synchronized (tinybDeviceCache) { tinybDeviceCache.clear(); tinybDevices.stream().forEach(d -> tinybDeviceCache.put(d.getAddress(), d)); } for (tinyb.BluetoothDevice tinybDevice : tinybDevices) { synchronized (devices) { newAddresses.add(tinybDevice.getAddress()); BlueZBluetoothDevice device = (BlueZBluetoothDevice) devices.get(tinybDevice.getAddress()); if (device == null) { createAndRegisterBlueZDevice(tinybDevice); } else { device.setTinybDevice(tinybDevice); notifyDiscoveryListeners(device); } } } synchronized (devices) { Set<String> oldAdresses = devices.keySet(); for (String address : oldAdresses) { if (!newAddresses.contains(address)) { devices.remove(address); } } } }</code><technical_language>Minor detail, consistently spelled **B**luetooth a name</technical_language>

Target:
private void checkForNewDevices() { logger.debug("Refreshing Bluetooth device list..."); Set<String> newAddresses = new HashSet<>(); List<tinyb.BluetoothDevice> tinybDevices = adapter.getDevices(); logger.debug("Found Bluetooth devices.", tinybDevices.size()); synchronized (tinybDeviceCache) { tinybDeviceCache.clear(); tinybDevices.stream().forEach(d -> tinybDeviceCache.put(d.getAddress(), d)); } for (tinyb.BluetoothDevice tinybDevice : tinybDevices) { synchronized (devices) { newAddresses.add(tinybDevice.getAddress()); BlueZBluetoothDevice device = (BlueZBluetoothDevice) devices.get(tinybDevice.getAddress()); if (device == null) { createAndRegisterBlueZDevice(tinybDevice); } else { device.updateTinybDevice(tinybDevice); notifyDiscoveryListeners(device); } } } synchronized (devices) { Set<String> oldAdresses = devices.keySet(); for (String address : oldAdresses) { if (!newAddresses.contains(address)) { devices.remove(address); } } } }
Source:
<code>public boolean isGeneratedSource(@NotNull VirtualFile file, @NotNull Project project) { AndroidProject androidProject = Projects.getAndroidProject(file, project); if (androidProject != null) { return VfsUtilCore.isAncestor(androidProject.getBuildFolder(), <START> VfsUtilCore.virtualToIoFile(file), <END> false); } return false; }</code><technical_language>static import. "VfsUtilCore" provides zero value</technical_language>

Target:
public boolean isGeneratedSource(@NotNull VirtualFile file, @NotNull Project project) { AndroidProject androidProject = Projects.getAndroidModel(file, project); if (androidProject != null) { return isAncestor(androidProject.getBuildFolder(), virtualToIoFile(file), false); } return false; }
Source:
<code>public void testUploadWidget() { <START> UploadWidget.startActivity(intentsTestRule.getActivity(), <END> MainActivity.UPLOAD_WIDGET_REQUEST_CODE, new UploadWidget.LaunchOptions(UploadWidget.RequiredAction.START_NOW, Collections.singletonList(Uri.fromFile(assetFile)))); onView(withId(R.id.crop_action)).perform(click()); onView(withId(R.id.doneButton)).perform(click()); onView(withId(R.id.uploadFab)).perform(click()); }</code><technical_language>test other options</technical_language>

Target:
public void testUploadWidget() { UploadWidget.startActivity(intentsTestRule.getActivity(), MainActivity.UPLOAD_WIDGET_REQUEST_CODE, new UploadWidget.Options(UploadWidget.Action.START_NOW, Collections.singletonList(Uri.fromFile(assetFile)))); onView(withId(R.id.crop_action)).perform(click()); onView(withId(R.id.doneButton)).perform(click()); onView(withId(R.id.uploadFab)).perform(click()); }
Source:
<code>private static Document getIncludeDoc(String loc) throws Exception { Document doc = null; File locFile = null; if (loc.startsWith("http:") || loc.startsWith("https:")) { if (isValidURL(loc)) { URL url = new URL(loc); URLConnection connection = url.openConnection(); doc = getDocumentBuilder().parse(connection.getInputStream()); } } else if (loc.startsWith("file:")) { if (isValidURL(loc)) { locFile = new File(loc); if (locFile.exists()) { InputStream inputStream = new FileInputStream(locFile.getCanonicalPath()); doc = getDocumentBuilder().parse(inputStream); } } } else if (loc.startsWith("ftp:")) { } else { if (configDirectory != null && configDirectory.exists()) { locFile = new File(configDirectory, loc); if (locFile.exists()) { InputStream inputStream = new FileInputStream(locFile.getCanonicalPath()); doc = getDocumentBuilder().parse(inputStream); } } if (locFile == null || !locFile.exists()) { <START> locFile = new File(getServerFile().getParentFile(), loc); <END> InputStream inputStream = new FileInputStream(locFile.getCanonicalPath()); doc = getDocumentBuilder().parse(inputStream); } } return doc; }</code><technical_language>this a problem if loc is absolute path. i.e. <include location"/tmp/serverInclude.xml" /></technical_language>

Target:
private static Document getIncludeDoc(String loc) throws Exception { Document doc = null; File locFile = null; if (loc.startsWith("http:") || loc.startsWith("https:")) { if (isValidURL(loc)) { URL url = new URL(loc); URLConnection connection = url.openConnection(); doc = getDocumentBuilder().parse(connection.getInputStream()); } } else if (loc.startsWith("file:")) { if (isValidURL(loc)) { locFile = new File(loc); if (locFile.exists()) { InputStream inputStream = new FileInputStream(locFile.getCanonicalPath()); doc = getDocumentBuilder().parse(inputStream); } } } else if (loc.startsWith("ftp:")) { } else { locFile = new File(loc); if (locFile.isAbsolute()) { InputStream inputStream = new FileInputStream(locFile.getCanonicalPath()); doc = getDocumentBuilder().parse(inputStream); } else { if (configDirectory != null && configDirectory.exists()) { locFile = new File(configDirectory, loc); } if (locFile == null || !locFile.exists()) { locFile = new File(getServerFile().getParentFile(), loc); } if (locFile != null && locFile.exists()) { InputStream inputStream = new FileInputStream(locFile.getCanonicalPath()); doc = getDocumentBuilder().parse(inputStream); } } } return doc; }
Source:
<code>public void removeOperatorsFromRoamingGroup() throws Exception { Object operatorID1 = operatorRepository.create(new NewOperator("name1", OperatorState.ACTIVE, "description1", "dName1", "fName1", "emergency")); Object operatorID2 = operatorRepository.create(new NewOperator("name2", OperatorState.ACTIVE, "description2", "dName2", "fName2", "emergency")); Object roamingGroupID = roamingRepository.create(new NewRoamingGroup("name", "description", RoamingGroupType.INTERNATIONAL)); roamingRepository.assignOperators(new ID(roamingGroupID), Lists.newArrayList(new ID(operatorID1), new ID(operatorID2))); <START> List<ID> unnecessaryIDs = Lists.newArrayList(new ID(operatorID2)); <END> roamingRepository.removeOperators(new ID(roamingGroupID), unnecessaryIDs); RoamingGroup got = roamingRepository.findById(new ID(roamingGroupID)).get(); Operator operator = new Operator(new ID(operatorID1), "name1", OperatorState.ACTIVE, "description1", "dName1", "fName1", "emergency"); RoamingGroup want = new RoamingGroup(new ID(roamingGroupID), "name", "description", RoamingGroupType.INTERNATIONAL, Lists.newArrayList(operator)); assertThat(got, deepEquals(want)); }</code><technical_language>this removed leave js roamingRepository.removeOperators(new ID(roamingGroupID), Lists.newArrayList(new ID(operatorID2)));</technical_language>

Target:
public void removeOperatorsFromRoamingGroup() throws Exception { Object operID1 = operatorRepository.create(new NewOperator("name1", OperatorState.ACTIVE, "description1", "dName1", "fName1", "emergency")); Object operID2 = operatorRepository.create(new NewOperator("name2", OperatorState.ACTIVE, "description2", "dName2", "fName2", "emergency")); Object groupID = roamingRepository.create(new NewRoamingGroup("name", "description", RoamingGroupType.INTERNATIONAL)); roamingRepository.assignOperators(new ID(groupID), Lists.newArrayList(new ID(operID1), new ID(operID2))); roamingRepository.removeOperators(new ID(groupID), Lists.newArrayList(new ID(operID2))); List<RoamingGroup> got = roamingRepository.findAll(); Operator operator = new Operator(new ID(operID1), "name1", OperatorState.ACTIVE, "description1", "dName1", "fName1", "emergency"); List<RoamingGroup> want = Lists.newArrayList(new RoamingGroup(new ID(groupID), "name", "description", RoamingGroupType.INTERNATIONAL, Lists.newArrayList(operator))); assertThat(got, deepEquals(want)); }
Source:
<code>public static Pair<Long, TimeUnitConverter.TimeUnit> convert(long inValue, TimeUnit inUnit, TimeUnit outUnit) { if(inUnit.getOrder() < outUnit.getOrder()) { for(int i = outUnit.getOrder(); i > inUnit.getOrder(); i-- ) { <START> inValue /= TimeUnit.timeUnits.get(i-1).getSecond(); <END> } } else { for(int i = outUnit.getOrder(); i < inUnit.getOrder(); i++ ) { inValue *= TimeUnit.timeUnits.get(i).getSecond(); } } Pair<Long , TimeUnitConverter.TimeUnit> timePair = new Pair<Long, TimeUnitConverter.TimeUnit>(inValue, outUnit); return timePair; }</code><technical_language>expand this inValue = inValue / TimeUnit.timeUnits.get(i-1).getSecond(); for readability</technical_language>

Target:
public static Pair<Long, TimeUnitConverter.TimeUnit> convert(long inValue, TimeUnit inUnit, TimeUnit outUnit) { if(inUnit.getOrder() < outUnit.getOrder()) { for(int i = outUnit.getOrder(); i > inUnit.getOrder(); i-- ) { inValue = inValue/TimeUnit.timeUnits.get(i-1).getSecond(); } } else { for(int i = outUnit.getOrder(); i < inUnit.getOrder(); i++ ) { inValue = inValue * TimeUnit.timeUnits.get(i).getSecond(); } } Pair<Long , TimeUnitConverter.TimeUnit> timePair = new Pair<Long, TimeUnitConverter.TimeUnit>(inValue, outUnit); return timePair; }
Source:
<code>public Map<String, String> getJobMessageProperties() { if (jobProperties == null) { <START> jobProperties = new HashMap<String, String>(); <END> jobProperties.put(VdcObjectType.VmTemplate.name().toLowerCase(), (getVmTemplateName() == null) ? "" : getVmTemplateName()); } return jobProperties; }</code><technical_language>work well: message says: job.ImportVmTemplate=Importing VM Template ${VmTemplate} Data Center ${StoragePool} provide VmTemplate only. StoragePool set UNKNOWN. handle - providing a omitting message. templates DC level i removed</technical_language>

Target:
public Map<String, String> getJobMessageProperties() { if (jobProperties == null) { jobProperties = new HashMap<String, String>(); jobProperties.put(VdcObjectType.VmTemplate.name().toLowerCase(), (getVmTemplateName() == null) ? "" : getVmTemplateName()); jobProperties.put(VdcObjectType.StoragePool.name().toLowerCase(), getStoragePoolName()); } return jobProperties; }
Source:
<code>public void unselectsSelection() throws Exception { bot.radio("SWT.MULTI").click(); bot.checkBox("Listen").select(); bot.button("Clear").click(); tree = bot.treeInGroup("Tree"); tree.select(new int[] { 1 }); SWTBotText text = bot.textInGroup("Listeners"); bot.button("Clear").click(); tree.unselect(); assertEquals(0, tree.selectionCount()); assertEventMatches(text, "MouseDown [3]: MouseEvent{Tree time=-550222259 data=null button=1 stateMask=0x40000 x=0 y=0 count=1}"); assertEventMatches(text, "Selection [13]: SelectionEvent{Tree time=-550222256 data=null item=TreeItem {Node 2} detail=0 x=0 y=0 width=0 height=0 stateMask=0xc0000 text=null doit=true}"); assertEventMatches(text, "MouseUp [4]: MouseEvent{Tree time=-550222255 data=null button=1 stateMask=0xc0000 x=0 y=0 count=1}"); <START> <END> tree.select(new int[] { 1, 2 }); assertEquals(2, tree.selectionCount()); tree.select(new int[] {}); assertEquals(0, tree.selectionCount()); tree.select(new String[] { "Node 2", "Node 4" }); assertEquals(2, tree.selectionCount()); tree.select(new int[] {}); assertEquals(0, tree.selectionCount()); }</code><technical_language>I code a separate test 'setEmptySelection'</technical_language>

Target:
public void unselectsSelection() throws Exception { bot.radio("SWT.MULTI").click(); bot.checkBox("Listen").select(); bot.button("Clear").click(); tree = bot.treeInGroup("Tree"); tree.select(new int[] { 1 }); SWTBotText text = bot.textInGroup("Listeners"); bot.button("Clear").click(); tree.unselect(); assertEquals(0, tree.selectionCount()); assertEventMatches(text, "MouseDown [3]: MouseEvent{Tree time=0 data=null button=1 stateMask=0x40000 x=0 y=0 count=1}"); assertEventMatches(text, "Selection [13]: SelectionEvent{Tree time=0 data=null item=TreeItem {Node 2} detail=0 x=0 y=0 width=0 height=0 stateMask=0xc0000 text=null doit=true}"); assertEventMatches(text, "MouseUp [4]: MouseEvent{Tree time=0 data=null button=1 stateMask=0xc0000 x=0 y=0 count=1}"); }
Source:
<code>public void load(Map<String, Object> parameters) { super.load(parameters); if ((objectClass = (String) parameters.get(OBJECT_CLASS)) == null) { throw new NullPointerException("Missing param [" + OBJECT_CLASS + "] in the setup"); } if (!isAlphanumeric(objectClass)) { throw new NullPointerException("object class '" + objectClass + "' contains non-alphanumeric characters"); } <START> usernameCnPattern = Pattern.compile("(cn=[a-zA-Z_]+)"); <END> LOGGER.log(Level.FINE, "LdapUser plugin loaded with objectclass={0}", objectClass); }</code><technical_language>in property definition</technical_language>

Target:
public void load(Map<String, Object> parameters) { super.load(parameters); if ((objectClass = (String) parameters.get(OBJECT_CLASS)) == null) { throw new NullPointerException("Missing param [" + OBJECT_CLASS + "] in the setup"); } if (!isAlphanumeric(objectClass)) { throw new NullPointerException("object class '" + objectClass + "' contains non-alphanumeric characters"); } LOGGER.log(Level.FINE, "LdapUser plugin loaded with objectclass={0}", objectClass); }
Source:
<code>private void recordDroppedEvent(EntryEventImpl event) { final boolean isDebugEnabled = logger.isDebugEnabled(); if (this.eventProcessor != null) { this.eventProcessor.registerEventDroppedInPrimaryQueue(event); } else { <START> EntryEventImpl emptyEvent = new EntryEventImpl(event.getKey(), false); <END> emptyEvent.setRegion(event.getRegion()); emptyEvent.setTailKey(event.getTailKey()); tmpDroppedEvents.add(emptyEvent); if (isDebugEnabled) { logger.debug("added to tmpDroppedEvents event: {}", event); } } }</code><technical_language>Again, clone a new event. In new code change, "else" executed in small time windows. proved sender is shutdown, eventProcessor kept. enqueue "else". worry tmpDroppedEvents big</technical_language>

Target:
private void recordDroppedEvent(EntryEventImpl event) { if (this.eventProcessor != null) { this.eventProcessor.registerEventDroppedInPrimaryQueue(event); } else { tmpDroppedEvents.add(event); if (logger.isDebugEnabled()) { logger.debug("added to tmpDroppedEvents event: {}", event); } } }