auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void test() throws Exception { <START> TestCase tcin = new TestCase(tc.getConfig()); <END> tcin.setFolder("Indexing/Partition-1/"); tcin.setName("showIndexes"); TestCaseResult result = tr.run(tcin); result = tr.run(tc); switch (result.state) { case EXPECTED_ERROR_GOT_DIFFERENT_ERROR: case EXPECTED_ERROR_GOT_FAILURE: case EXPECTED_ERROR_GOT_RESULT: case EXPECTED_RESULT_GOT_DIFFERENT_RESULT: case EXPECTED_RESULT_GOT_ERROR: case EXPECTED_RESULT_GOT_FAILURE: fail(result.state + " (" + result.time + " ms): " + result.testCase.getXQueryDisplayName() + " " + result.error); break; case EXPECTED_ERROR_GOT_SAME_ERROR: case EXPECTED_RESULT_GOT_SAME_RESULT: break; case NO_RESULT_FILE: fail(result.state + " (" + result.time + " ms): " + result.testCase.getXQueryDisplayName()); break; } }</code><technical_language>This testing code removed later</technical_language>

Target:
public void test() throws Exception { TestCaseResult result = tr.run(tc); switch (result.state) { case EXPECTED_ERROR_GOT_DIFFERENT_ERROR: case EXPECTED_ERROR_GOT_FAILURE: case EXPECTED_ERROR_GOT_RESULT: case EXPECTED_RESULT_GOT_DIFFERENT_RESULT: case EXPECTED_RESULT_GOT_ERROR: case EXPECTED_RESULT_GOT_FAILURE: fail(result.state + " (" + result.time + " ms): " + result.testCase.getXQueryDisplayName() + " " + result.error); break; case EXPECTED_ERROR_GOT_SAME_ERROR: case EXPECTED_RESULT_GOT_SAME_RESULT: break; case NO_RESULT_FILE: fail(result.state + " (" + result.time + " ms): " + result.testCase.getXQueryDisplayName()); break; } }
Source:
<code>public V get(K key) { V value = cache.get(key); if (value != null) { return value; } <START> locker.computeIfAbsent(key, (k) -> { <END> if (cache.get(key) == null) { cache.put(key, rdTable.get(key)); } return null; }); return cache.get(key); }</code><technical_language>this work item is evicted underlying cache, is in locker</technical_language>

Target:
public V get(K key) { V value = cache.get(key); if (value == null) { ++missCount; value = atomicGet(key); } else { ++hitCount; } return value; }
Source:
<code>public Enumeration<URL> findResources(String name) throws IOException { final Channel channel = channel(); if(channel == null || !channel.isRemoteClassLoadingAllowed()) return EMPTY_ENUMERATION; Vector<URLish> v = resourcesMap.get(name); if(v!=null) { Vector<URL> urls = toURLs(v); if(urls!=null) return urls.elements(); } long startTime = System.nanoTime(); ResourceFile[] images = proxy.getResources2(name); channel.resourceLoadingTime.addAndGet(System.nanoTime()-startTime); channel.resourceLoadingCount.incrementAndGet(); v = new Vector<URLish>(); for( ResourceFile image: images ) try { v.add(image.image.resolveURL(channel,name).get()); } catch (InterruptedException e) { <START> throw (Error) new Error("Failed to load resources "+name, e); <END> } catch (ExecutionException e) { throw (Error) new Error("Failed to load resources "+name, e); } resourcesMap.put(name,v); Vector<URL> resURLs = toURLs(v); if (resURLs == null) { throw new IOException("One of the URLish objects cannot be converted to URL"); } return resURLs.elements(); }</code><technical_language>suggestion throw new Error("Failed load resources "+name, e);</technical_language>

Target:
public Enumeration<URL> findResources(String name) throws IOException { final Channel channel = channel(); if(channel == null || !channel.isRemoteClassLoadingAllowed()) return EMPTY_ENUMERATION; Vector<URLish> v = resourcesMap.get(name); if(v!=null) { Vector<URL> urls = toURLs(v); if(urls!=null) return urls.elements(); } long startTime = System.nanoTime(); ResourceFile[] images = proxy.getResources2(name); channel.resourceLoadingTime.addAndGet(System.nanoTime()-startTime); channel.resourceLoadingCount.incrementAndGet(); v = new Vector<URLish>(); for( ResourceFile image: images ) try { v.add(image.image.resolveURL(channel,name).get()); } catch (InterruptedException e) { throw new Error("Failed to load resources "+name, e); } catch (ExecutionException e) { throw new Error("Failed to load resources "+name, e); } resourcesMap.put(name,v); Vector<URL> resURLs = toURLs(v); if (resURLs == null) { throw new IOException("One of the URLish objects cannot be converted to URL"); } return resURLs.elements(); }
Source:
<code>public void run() { RunAsClassLoader.run(classLoader, () -> { try { runHooks(ProcessStep.Validating); for (Method m : onValidate) { if (m.getReturnType() == List.class) { addError((List<String>)m.invoke(handler)); } else if (m.getReturnType() == boolean.class) { if (!(boolean)m.invoke(handler)) addError("Validator " + m.getName() + " returned false"); } else { throw new RuntimeException("onValidate method " + m.getName() + " has wrong return type " + m.getReturnType()); } } if (errors.size() > 0) { <START> runHooks(ProcessStep.Invalid); <END> return; } else { runHooks(ProcessStep.Processing); for (Method m : onMessage) { m.invoke(handler, new Object[] {}); } } } catch (Throwable e) { log.info("Error processing", e); if (e.getCause() != null) addError(e.getCause().getMessage()); else addError(e.getMessage()); } if (errors.size() > 0) { getErrors().stream().forEach(e -> log.error(e)); try { for (Method m : onProcessStep.get(ProcessStep.Error)) { m.invoke(handler); } } catch (Throwable e) { log.error("Error in @On(ProcessStep.Error) handler.", e); } LifeCycleMonitors.call(ProcessStep.Error, this); } else { try { runHooks(ProcessStep.Complete); } catch (Throwable e) { log.error("Error in @On(ProcessStep.Complete) handler.", e); LifeCycleMonitors.call(ProcessStep.Error, this); } } try { msg.getJmsMsg().acknowledge(); } catch (JMSException e) { log.error("Error while acking message.", e); } }); }</code><technical_language>This output errors log anymore</technical_language>

Target:
public void run() { RunAsClassLoader.run(classLoader, () -> { runHooks(ProcessStep.Validating); LifeCycleMonitors.call(ProcessStep.Validating, this); for (Method m : onValidate) { if (m.getReturnType() == List.class) { addError(runLoggingErrors(() -> (List<String>)m.invoke(handler))); } else if (m.getReturnType() == boolean.class) { boolean valid = runLoggingErrors(() -> (boolean)m.invoke(handler)); if (!valid) addError("Validator " + m.getName() + " returned false"); } else { addError("onValidate method " + m.getName() + " has wrong return type " + m.getReturnType()); } } if (errors.size() > 0) { runHooks(ProcessStep.Invalid); LifeCycleMonitors.call(ProcessStep.Invalid, this); } else { runHooks(ProcessStep.Processing); LifeCycleMonitors.call(ProcessStep.Processing, this); for (Method m : onMessage) { runLoggingErrors(() -> m.invoke(handler)); } if (errors.size() > 0) { runHooks(ProcessStep.Error); LifeCycleMonitors.call(ProcessStep.Error, this); } else { runHooks(ProcessStep.Complete); LifeCycleMonitors.call(ProcessStep.Complete, this); } } getErrors().stream().forEach(e -> log.error(e)); try { msg.getJmsMsg().acknowledge(); } catch (JMSException e) { log.error("Error while acking message.", e); } }); }
Source:
<code>public boolean isCompacted() { <START> return compactedChain != null; <END> }</code><technical_language>Please no, compactedChain null legal. is buying exactly</technical_language>

Target:
public boolean isCompacted() { return compacted; }
Source:
<code>public Response content(@PathParam("path") String path) { Response response; String mediaType = getMediaTypeFromPath(path); if (path.isEmpty() || path.equals("index.html")) { response = Response.ok().entity(getIndex()).type(mediaType).build(); } else { mediaType = getMediaTypeFromPath(path); if (path.endsWith("png") || path.endsWith("gif")) { byte[] content = FileUtils.readAllBytesFromResource(swaggerResource + path); if (content != null) { response = Response.ok().entity(content).type(mediaType).build(); } else { response = Response.status(Response.Status.NOT_FOUND).build(); } } else { String content = FileUtils.readAllTextFromResource(swaggerResource + path); <START> if (content != null) { <END> response = Response.ok().entity(content).type(mediaType).build(); } else { response = Response.status(Response.Status.NOT_FOUND).build(); } } } return response; }</code><technical_language>I StringUtils.isNotEmpty verify if content is null empty</technical_language>

Target:
public Response content(@PathParam("path") String path) { Response response; String mediaType = getMediaTypeFromPath(path); if (path.isEmpty() || path.equals("index.html")) { response = Response.ok().entity(getIndex()).type(mediaType).build(); } else { mediaType = getMediaTypeFromPath(path); if (path.endsWith("png") || path.endsWith("gif")) { byte[] content = FileUtils.readAllBytesFromResource(swaggerResource + path); if (content != null) { response = Response.ok().entity(content).type(mediaType).build(); } else { response = Response.status(Response.Status.NOT_FOUND).build(); } } else { String content = FileUtils.readAllTextFromResource(swaggerResource + path); if (StringUtils.isNotEmpty(content)) { response = Response.ok().entity(content).type(mediaType).build(); } else { response = Response.status(Response.Status.NOT_FOUND).build(); } } } return response; }
Source:
<code>private void highlightSearchPattern() { if (searchHighlightPattern.isPresent()) { String pattern = searchHighlightPattern.get().pattern(); previewView.getEngine().executeScript( "var markInstance = new Mark(document.getElementById(\"content\"));" + "markInstance.unmark({" + " done: function(){" + <START> " markInstance.markRegExp(/" + pattern.replaceAll("(?<!\\\\)/", "\\\\/") + "/gmi);" + <END> " }" + " });" ); } else { previewView.getEngine().executeScript( "var markInstance = new Mark(document.getElementById(\"content\"));" + "markInstance.unmark()" ); } }</code><technical_language>@k3KAW8Pnf7mkmdSMPHz27 Source level is jdk14, textblock function is preview. jdk15 for compiling jpackage stuff. (except for windows, jdk14 is required due a jdk jpackage bug)</technical_language>

Target:
private void highlightSearchPattern() { String callbackForUnmark = ""; if (searchHighlightPattern.isPresent()) { String javaScriptRegex = createJavaScriptRegex(searchHighlightPattern.get()); callbackForUnmark = String.format(JS_MARK_REG_EXP_CALLBACK, javaScriptRegex); } String unmarkInstance = String.format(JS_UNMARK_WITH_CALLBACK, callbackForUnmark); previewView.getEngine().executeScript(unmarkInstance); }
Source:
<code>private boolean hasPayload() { <START> return getPayload().exists(); <END> }</code><technical_language>isDirectory()</technical_language>

Target:
private boolean hasPayload() { return getPayloadDir().isDirectory(); }
Source:
<code>private JfrInstrumentedByteBufAllocator(ByteBufAllocator wrapped) { <START> this.wrapped = wrapped; <END> }</code><technical_language>add null check</technical_language>

Target:
private JfrInstrumentedByteBufAllocator(ByteBufAllocator wrapped) { this.wrapped = ObjectUtil.checkNotNull(wrapped, "wrapped");; }
Source:
<code>private void populateHeadersMap() { <START> Map<String, String> headersMap = getRequestHeadersMap(); <END> ManagedArtifact instance = getManagedArtifactInstance(); Map<String, Boolean> artifactHeaders = instance.getRequestParameters().getParameters(); for (FileItem fileItem : fileItems) { if (fileItem.isFormField()) { String parameter = fileItem.getFieldName().trim(); if (artifactHeaders.containsKey(parameter)) { headersMap.put(parameter, fileItem.getString().trim()); } } else { headersMap.put(ManagedArtifact.ARTIFACT_FILE_NAME, isNotBlank(fileItem.getName().trim())); } } checkForRequiredParameters(headersMap); transferContext.setHeadersMap(headersMap); }</code><technical_language>ManagedArtifact's instance is created next line, change this code a single instance? ManagedArtifact instance = getManagedArtifactInstance(); Map<String, String> headersMap = getRequestHeadersMap(instance); modification getRequestHeadersMap() required</technical_language>

Target:
private void populateHeadersMap() { Map<String, String> headersMap = getRequestHeadersMap(); Map<String, Boolean> artifactParams = managedArtifactRequestParameters.getParameters(); for (FileItem fileItem : fileItems) { if (fileItem.isFormField()) { String parameter = fileItem.getFieldName().trim(); if (artifactParams.containsKey(parameter)) { headersMap.put(parameter, fileItem.getString().trim()); } } else { headersMap.put(ManagedArtifact.ARTIFACT_FILE_NAME, isNotBlank(fileItem.getName().trim())); } } checkForRequiredParameters(headersMap); transferContext.setHeadersMap(headersMap); }
Source:
<code>private void editIssue(String key, Object value) throws IOException { <START> root.retrieve().method("POST").with(key, value).method("PATCH").withUrlPath(getIssuesApiRoute()).to(); <END> }</code><technical_language>Multiple method(*) methods</technical_language>

Target:
private void editIssue(String key, Object value) throws IOException { root.createRequest().with(key, value).method("PATCH").withUrlPath(getIssuesApiRoute()).send(); }
Source:
<code>public boolean validateHostIsTrusted(VDS vds) { Set<String> hosts = new HashSet<String>(); <START> hosts.add(vds.gethost_name()); <END> List<AttestationValue> valueList = attestHosts(hosts); if (valueList.get(0).getTrustLevel() == AttestationResultEnum.TRUSTED) { return true; } else { return false; } }</code><technical_language>please rebased. this method renamed Feb 11</technical_language>

Target:
public boolean validateHostIsTrusted(VDS vds) { List<String> hosts = new ArrayList<String>(); hosts.add(vds.gethost_name()); List<AttestationValue> valueList = attestHosts(hosts); return valueList.get(0).getTrustLevel() == AttestationResultEnum.TRUSTED; }
Source:
<code>public Properties getProducerProperties(String outputChannelName) { if (isPartitionedProducer(outputChannelName)) { Properties channelProducerProperties = new Properties(); <START> if (this.producerProperties != null) { <END> channelProducerProperties.putAll(this.producerProperties); } channelProducerProperties.put(BinderProperties.MIN_PARTITION_COUNT, Integer.toString(getPartitionCount(outputChannelName))); channelProducerProperties.setProperty(BinderProperties.NEXT_MODULE_COUNT, Integer.toString(getPartitionCount(outputChannelName))); copyChannelBindingProperty(outputChannelName, channelProducerProperties, BinderProperties.PARTITION_KEY_EXPRESSION); copyChannelBindingProperty(outputChannelName, channelProducerProperties, BinderProperties.PARTITION_KEY_EXTRACTOR_CLASS); copyChannelBindingProperty(outputChannelName, channelProducerProperties, BinderProperties.PARTITION_SELECTOR_CLASS); copyChannelBindingProperty(outputChannelName, channelProducerProperties, BinderProperties.PARTITION_SELECTOR_EXPRESSION); return channelProducerProperties; } else { return this.producerProperties; } }</code><technical_language>for empty check instead of null check</technical_language>

Target:
public Properties getProducerProperties(String outputChannelName) { if (isPartitionedProducer(outputChannelName)) { Properties channelProducerProperties = new Properties(); channelProducerProperties.putAll(this.producerProperties); channelProducerProperties.setProperty(BinderProperties.NEXT_MODULE_COUNT, Integer.toString(getPartitionCount(outputChannelName))); copyChannelBindingProperty(outputChannelName, channelProducerProperties, BinderProperties.PARTITION_KEY_EXPRESSION); copyChannelBindingProperty(outputChannelName, channelProducerProperties, BinderProperties.PARTITION_KEY_EXTRACTOR_CLASS); copyChannelBindingProperty(outputChannelName, channelProducerProperties, BinderProperties.PARTITION_SELECTOR_CLASS); copyChannelBindingProperty(outputChannelName, channelProducerProperties, BinderProperties.PARTITION_SELECTOR_EXPRESSION); return channelProducerProperties; } else { return this.producerProperties; } }
Source:
<code>protected Boolean doInBackground(Void... params) { final AccessibilityManager accessibility = (AccessibilityManager) context .getSystemService(Context.ACCESSIBILITY_SERVICE); if (!accessibility.isEnabled()) { return Boolean.FALSE; } final Intent screenReaderIntent = new Intent(SCREENREADER_INTENT_ACTION); screenReaderIntent.addCategory(SCREENREADER_INTENT_CATEGORY); final ContentResolver cr = context.getContentResolver(); final List<ResolveInfo> screenReaders = context.getPackageManager().queryIntentServices( screenReaderIntent, 0); boolean foundScreenReader = false; for (ResolveInfo screenReader : screenReaders) { final Cursor cursor = cr.query( Uri.parse("content://" + screenReader.serviceInfo.packageName + ".providers.StatusProvider"), null, null, null, null); if (cursor != null) { <START> if (cursor.moveToFirst()) { <END> final int status = cursor.getInt(0); cursor.close(); if (status == 1) { foundScreenReader = true; break; } } else { cursor.close(); } } } if (foundScreenReader) { mControlCodes = Pattern.compile(CONTROL_CODE_PATTERN); } return foundScreenReader; }</code><technical_language>this a: try { cursor.moveToFirst(); ... } finally { cursor.close(); }</technical_language>

Target:
protected Boolean doInBackground(Void... params) { final AccessibilityManager accessibility = (AccessibilityManager) context .getSystemService(Context.ACCESSIBILITY_SERVICE); if (!accessibility.isEnabled()) { return Boolean.FALSE; } final Intent screenReaderIntent = new Intent(SCREENREADER_INTENT_ACTION); screenReaderIntent.addCategory(SCREENREADER_INTENT_CATEGORY); final ContentResolver cr = context.getContentResolver(); final List<ResolveInfo> screenReaders = context.getPackageManager().queryIntentServices( screenReaderIntent, 0); boolean foundScreenReader = false; for (ResolveInfo screenReader : screenReaders) { final Cursor cursor = cr.query( Uri.parse("content://" + screenReader.serviceInfo.packageName + ".providers.StatusProvider"), null, null, null, null); if (cursor != null) { try { cursor.moveToFirst(); final int status = cursor.getInt(0); if (status == 1) { foundScreenReader = true; break; } } finally { cursor.close(); } } } if (foundScreenReader) { mControlCodes = Pattern.compile(CONTROL_CODE_PATTERN); } return foundScreenReader; }
Source:
<code>public MethodHandle find() { Field field; try { field = invocation.receiverClass().getDeclaredField(invocation.name()); } catch (NoSuchFieldException e) { return null; } <START> if (invocation.arguments().length == 1) { <END> return findMethodForGetter(field); } return findMethodForSetter(field); }</code><technical_language>invocation.arity()</technical_language>

Target:
public MethodHandle find() { if (invocation.arity() == 1) { return findMethodForGetter(); } return findMethodForSetter(); }
Source:
<code>public void setDimmer(Command command, String number) { if (command instanceof DecimalType) { int value = (int)((double)((DecimalType) command).intValue() * 2.54); <START> HttpUtil.executeUrl(GET, createURL() <END> + "/" + XML_PATH + "?" + SUFFIX_PASSWORD + getPassword() + "&" + SUFFIX_DIMMER + number + "=" + value, this.timeOut); } else { logger.error("Unsupported command type"); } }</code><technical_language>Please extrace generated url a variable calling HttpUtil.executeUrl(), this debugging easier</technical_language>

Target:
public void setDimmer(Command command, String number) { if (command instanceof DecimalType) { int value = (int)((double)((DecimalType) command).intValue() * 2.54); String URL = createURL() + "/" + XML_PATH + "?" + SUFFIX_PASSWORD + getPassword() + "&" + SUFFIX_DIMMER + number + "=" + value; HttpUtil.executeUrl(GET, URL, this.timeOut); } else { logger.error("Unsupported command type"); } }
Source:
<code>public Object execute() throws Exception { if( this.agents != null ) { for( AgentMessagingInterface agent : this.agents ) { try { <START> agent.agentStatus(); <END> } catch( Exception e ) { this.logger.warning( "An error occurred while giving agent status. " + e.getMessage()); Utils.logException( this.logger, e ); } } } return null; }</code><technical_language>here, perform sysout (with a line break separate agents). java System.out.println( agent.agentStatus()); System.out.println( "" );</technical_language>

Target:
public Object execute() throws Exception { if( this.agents != null ) { for( AgentMessagingInterface agent : this.agents ) { try { System.out.println( agent.agentStatus() ); System.out.println( "" ); } catch( Exception e ) { this.logger.warning( "An error occurred while giving agent status. " + e.getMessage()); Utils.logException( this.logger, e ); } } } return null; }
Source:
<code><START> private boolean upgradeTwoThree(SQLiteDatabase db) { <END> return upgradeAppRecords(db) && upgradeProviderDb(db, ProviderUtils.ProviderType.TYPE_FORMS) && upgradeProviderDb(db, ProviderUtils.ProviderType.TYPE_INSTANCES); }</code><technical_language>Hey, In mind depends do independently. I if do upgrade a v3 (IE: Not-released, v3 pushed), more work move upgrade v4 fine multiple-bumps in a cycle. If depending pre-v3 state do operations, though, sense here</technical_language>

Target:
private boolean upgradeTwoThree(SQLiteDatabase db) { db.beginTransaction(); try { SqlStorage<Persistable> storage = new SqlStorage<Persistable>( ApplicationRecord.STORAGE_KEY, ApplicationRecordV1.class, new ConcreteDbHelper(c, db)); if (multipleInstalledAppRecords(storage)) { throw new MigrationException(true); } for (Persistable r : storage) { ApplicationRecordV1 oldRecord = (ApplicationRecordV1) r; ApplicationRecord newRecord = new ApplicationRecord(oldRecord.getApplicationId(), oldRecord.getStatus()); newRecord.setID(oldRecord.getID()); newRecord.setResourcesStatus(true); newRecord.setArchiveStatus(false); newRecord.setUniqueId(""); newRecord.setDisplayName(""); newRecord.setVersionNumber(-1); newRecord.setConvertedByDbUpgrader(true); newRecord.setPreMultipleAppsProfile(true); storage.write(newRecord); } if (upgradeProviderDb(db, ProviderUtils.ProviderType.FORMS) && upgradeProviderDb(db, ProviderUtils.ProviderType.INSTANCES)) { db.setTransactionSuccessful(); return true; } return false; } finally { db.endTransaction(); } }
Source:
<code>protected Map<String, IndicatorValue> parseIndicatorData(String data) throws ActionException { if (data == null) { return null; } try { Map<String, Double> values = MAPPER.readValue(data, new TypeReference<Map<String, Double>>(){}); return values.entrySet().stream() .collect(Collectors .toMap( e -> e.getKey(), e -> new IndicatorValueFloat(e.getValue()))); } catch (IOException e) { <START> throw new ActionParamsException("Invalid parameter value for key: " + StatisticsHelper.PARAM_SELECTORS + " - expected JSON object"); <END> } }</code><technical_language>PARAM_DATA is retrieve data, PARAM_SELECTORS is in error message</technical_language>

Target:
protected Map<String, IndicatorValue> parseIndicatorData(String data) throws ActionException { try { Map<String, Double> values = MAPPER.readValue(data, new TypeReference<Map<String, Double>>(){}); return values.entrySet().stream() .collect(Collectors .toMap( e -> e.getKey(), e -> new IndicatorValueFloat(e.getValue()))); } catch (IOException e) { throw new ActionParamsException("Invalid parameter value for key: " + PARAM_DATA + " - expected JSON object"); } }
Source:
<code>protected boolean isLeafMatch(Viewer viewer, Object element) { boolean result = false; IQuickOutlineLabelProvider labelProvider = (IQuickOutlineLabelProvider) ((StructuredViewer) viewer).getLabelProvider(); String labelText = labelProvider.getText(element); if (labelText != null) { result = wordMatches(labelText); } EObject eObj = (EObject) element; boolean match; for (EAttribute attribute : eObj.eClass().getEAllAttributes()) { if <START> (attribute.getEAttributeType().getName().equals("EString") && <END> eObj.eGet(attribute) != null) { match = wordMatches(eObj.eGet(attribute).toString()); if (match) { labelProvider.addMatch(eObj, attribute.getName()); } result = result || match; } } return result; }</code><technical_language>attribute.getEAttributeType() == EcorePackage.eINSTANCE.getEString() instead of relying name. more robust</technical_language>

Target:
protected boolean isLeafMatch(Viewer viewer, Object element) { boolean result = false; IQuickOutlineLabelProvider labelProvider = (IQuickOutlineLabelProvider) ((StructuredViewer) viewer).getLabelProvider(); String labelText = labelProvider.getText(element); if (labelText != null) { result = wordMatches(labelText); } EObject eObj = (EObject) element; boolean match; for (EAttribute attribute : eObj.eClass().getEAllAttributes()) { if (attribute.getEAttributeType() == EcorePackage.eINSTANCE.getEString() && eObj.eGet(attribute) != null) { match = wordMatches(eObj.eGet(attribute).toString()); if (match) { labelProvider.addMatch(eObj, attribute.getName()); } result = result || match; } } return result; }
Source:
<code>public boolean exists() { boolean exists = super.exists(); if (!exists && <START> getSession(false) <END> != null) { URI resourceURI = getURI().trimFragment(); for (Resource resource : getSession(false).getAllSessionResources()) { if (resource.getURI().equals(resourceURI)) { exists = true; break; } } } return exists; }</code><technical_language>I if this do job done in for block</technical_language>

Target:
public boolean exists() { boolean exists = super.exists(); if (!exists) { EObject input = getInput(false); if (input != null) { Resource resource = input.eResource(); if (resource != null) { exists = resource.getResourceSet().getURIConverter().exists(resource.getURI(), null); } } } return exists; }
Source:
<code>public void run() { Firehose firehose = null; FirehoseV2 firehoseV2 = null; <START> boolean normalExit = true; <END> initPlumber(); try { Object metadata = plumber.startJob(); if (fireDepartment.checkFirehoseV2()) { firehoseV2 = initFirehoseV2(metadata); runFirehoseV2(firehoseV2); } else { firehose = initFirehose(); runFirehose(firehose); } } catch (RuntimeException e) { log.makeAlert( e, "[%s] aborted realtime processing[%s]", e.getClass().getSimpleName(), fireDepartment.getDataSchema().getDataSource() ).emit(); normalExit = false; throw Throwables.propagate(e); } catch (Error e) { log.makeAlert(e, "Error aborted realtime processing[%s]", fireDepartment.getDataSchema().getDataSource()) .emit(); normalExit = false; throw e; } finally { CloseQuietly.close(firehose); CloseQuietly.close(firehoseV2); if (normalExit) { plumber.finishJob(); } } }</code><technical_language>Saner set normalExit = false initially, set true in end of try block. Throwable is a RuntimeException in try block is qualified "normal exit"</technical_language>

Target:
public void run() { initPlumber(); try { final Closer closer = Closer.create(); try { Object metadata = plumber.startJob(); Firehose firehose; FirehoseV2 firehoseV2; final boolean success; if (fireDepartment.checkFirehoseV2()) { firehoseV2 = initFirehoseV2(metadata); closer.register(firehoseV2); success = runFirehoseV2(firehoseV2); } else { firehose = initFirehose(); closer.register(firehose); success = runFirehose(firehose); } if (success) { closer.register(() -> plumber.finishJob()); } } catch (InterruptedException e) { log.warn("Interrupted while running a firehose"); throw closer.rethrow(e); } catch (Exception e) { log.makeAlert( e, "[%s] aborted realtime processing[%s]", e.getClass().getSimpleName(), fireDepartment.getDataSchema().getDataSource() ).emit(); throw closer.rethrow(e); } catch (Error e) { log.makeAlert(e, "Error aborted realtime processing[%s]", fireDepartment.getDataSchema().getDataSource()) .emit(); throw closer.rethrow(e); } finally { closer.close(); } } catch (IOException e) { throw Throwables.propagate(e); } }
Source:
<code>public void onLeft(LeftItem li) { DockerJobTemplateProperty jobTemplate = getJobTemplate(li); if (jobTemplate != null) { Cloud cloud = DockerCloud.getCloudByName(jobTemplate.getCloudname()); <START> if ((cloud != null) && (cloud instanceof DockerCloud)) { <END> ((DockerCloud) cloud).removeJobTemplate(li.getId()); } } }</code><technical_language>instanceof is null check itself</technical_language>

Target:
public void onLeft(LeftItem li) { DockerJobTemplateProperty jobTemplate = getJobTemplate(li); if (jobTemplate != null) { Cloud cloud = DockerCloud.getCloudByName(jobTemplate.getCloudname()); if (cloud instanceof DockerCloud) { ((DockerCloud) cloud).removeJobTemplate(li.getId()); } } }
Source:
<code>public TestFileUtilsImpl() { this.tempFolder = null; try { this.outputStream = getOutputFile(null); } catch (final IOException e) { LOG.error("unable to create ByteArrayOutputStream", e); <START> e.printStackTrace(); <END> } }</code><technical_language>need print stack trace logged</technical_language>

Target:
public TestFileUtilsImpl() { this.tempFolder = null; try { this.outputStream = getOutputFile(null); } catch (final IOException e) { LOG.error("unable to create ByteArrayOutputStream", e); } }
Source:
<code>protected JMenu buildSketchMenu() { JMenuItem item; sketchMenu = new JMenu(_("Sketch")); item = newJMenuItem(_("Verify / Compile"), 'R'); item.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { handleRun(false); } }); sketchMenu.add(item); item = newJMenuItem(_("Upload"), 'U'); item.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { handleExport(false); } }); sketchMenu.add(item); item = newJMenuItemShift(_("Upload Using Programmer"), 'U'); item.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { handleExport(true); } }); sketchMenu.add(item); <START> item = newJMenuItemAlt("Export compiled Binary", 'S'); <END> item.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { handleRunAndSave(true); } }); sketchMenu.add(item); sketchMenu.addSeparator(); if (importMenu == null) { importMenu = new JMenu(_("Import Library...")); MenuScroller.setScrollerFor(importMenu); base.rebuildImportMenu(importMenu); } sketchMenu.add(importMenu); item = newJMenuItem(_("Show Sketch Folder"), 'K'); item.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { Base.openFolder(sketch.getFolder()); } }); sketchMenu.add(item); item.setEnabled(Base.openFolderAvailable()); item = new JMenuItem(_("Add File...")); item.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { sketch.handleAddFile(); } }); sketchMenu.add(item); return sketchMenu; }</code><technical_language>add _("....") syntax? menu string translated</technical_language>

Target:
protected JMenu buildSketchMenu() { JMenuItem item; sketchMenu = new JMenu(_("Sketch")); item = newJMenuItem(_("Verify / Compile"), 'R'); item.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { handleRun(false); } }); sketchMenu.add(item); item = newJMenuItem(_("Upload"), 'U'); item.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { handleExport(false); } }); sketchMenu.add(item); item = newJMenuItemShift(_("Upload Using Programmer"), 'U'); item.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { handleExport(true); } }); sketchMenu.add(item); item = newJMenuItemAlt(_("Export compiled Binary"), 'S'); item.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { handleRunAndSave(true); } }); sketchMenu.add(item); sketchMenu.addSeparator(); if (importMenu == null) { importMenu = new JMenu(_("Import Library...")); MenuScroller.setScrollerFor(importMenu); base.rebuildImportMenu(importMenu); } sketchMenu.add(importMenu); item = newJMenuItem(_("Show Sketch Folder"), 'K'); item.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { Base.openFolder(sketch.getFolder()); } }); sketchMenu.add(item); item.setEnabled(Base.openFolderAvailable()); item = new JMenuItem(_("Add File...")); item.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { sketch.handleAddFile(); } }); sketchMenu.add(item); return sketchMenu; }
Source:
<code>public HttpResponseException buildHttpResponseException( String error, @Nullable String errorDescription, @Nullable String errorUri) throws IOException { <START> ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); JsonGenerator jsonGenerator = OAuth2Utils.JSON_FACTORY.createJsonGenerator( byteArrayOutputStream, Charset.defaultCharset()); jsonGenerator.writeStartObject(); jsonGenerator.writeFieldName("error"); jsonGenerator.writeString(error); if (errorDescription != null) { jsonGenerator.writeFieldName("error_description"); jsonGenerator.writeString(errorDescription); } if (errorUri != null) { jsonGenerator.writeFieldName("error_uri"); jsonGenerator.writeString(errorUri); } jsonGenerator.writeEndObject(); jsonGenerator.close(); <END> return new HttpResponseException.Builder( 400, "statusMessage", new HttpHeaders()) .setContent(byteArrayOutputStream.toString()) .build(); }</code><technical_language>easier [GenericJson](<LINK_0> java GenericJson genericJson = new GenericJson(); genericJson.setFactory(OAuth2Utils.JSON_FACTORY); String content = genericJson .set("foo", "bar") .set("asdf", "qwer") .toString();</technical_language>

Target:
public HttpResponseException buildHttpResponseException( String error, @Nullable String errorDescription, @Nullable String errorUri) throws IOException { GenericJson json = new GenericJson(); json.setFactory(OAuth2Utils.JSON_FACTORY); json.set("error", error); if (errorDescription != null) { json.set("error_description", errorDescription); } if (errorUri != null) { json.set("error_uri", errorUri); } return new HttpResponseException.Builder( 400, "statusMessage", new HttpHeaders()) .setContent(json.toPrettyString()) .build(); }
Source:
<code>void poll(RequestRegistrationCallback<GetOperation> requestRegistrationCallback) { if (operationCompleted) { return; } if (firstChunk.isReady() || firstChunk.isInProgress()) { firstChunk.poll(requestRegistrationCallback); } if (firstChunk.isComplete()) { <START> maybeWriteToChannel(); <END> if (dataChunks != null) { for (GetChunk dataChunk : dataChunks) { if (dataChunk.isFree() && chunkIdIterator.hasNext()) { dataChunk.initialize(chunkIdIterator.nextIndex(), (BlobId) chunkIdIterator.next()); } if (dataChunk.isInProgress() || (dataChunk.isReady() && numChunksRetrieved - numChunksWrittenOut.get() < NonBlockingRouter.MAX_IN_MEM_CHUNKS)) { dataChunk.poll(requestRegistrationCallback); } } } } if (operationException.get() != null) { abort(operationException.get()); } }</code><technical_language>write channel (do IO) a poll(). this affect throughput</technical_language>

Target:
void poll(RequestRegistrationCallback<GetOperation> requestRegistrationCallback) { if (operationCompleted) { return; } if (operationException.get() == null) { if (firstChunk.isReady() || firstChunk.isInProgress()) { firstChunk.poll(requestRegistrationCallback); } if (firstChunk.isComplete()) { if (getBlobResult != null) { getBlobResult.maybeWriteToChannel(); } if (dataChunks != null) { for (GetChunk dataChunk : dataChunks) { if (dataChunk.isFree() && chunkIdIterator.hasNext()) { dataChunk.initialize(chunkIdIterator.nextIndex(), (BlobId) chunkIdIterator.next()); } if (dataChunk.isInProgress() || (dataChunk.isReady() && numChunksRetrieved - getBlobResult.getNumChunksWrittenOut() < NonBlockingRouter.MAX_IN_MEM_CHUNKS)) { dataChunk.poll(requestRegistrationCallback); if (dataChunk.isComplete()) { onChunkOperationComplete(dataChunk); if (operationCompleted) { break; } } } } } } } if (operationException.get() != null) { abort(operationException.get()); } }
Source:
<code>public ExternalBinary getReleaseForVersion(String version) throws Exception { String url = projectUrl + RELEASES_URL; int pageNumber = 1; List<String> availableVersions = new ArrayList<>(); while (true) { HttpClient.Response response = sentGetRequestWithPagination(url, pageNumber++, Collections.emptyMap()); JsonElement releases = gson.fromJson(response.getPayload(), JsonElement.class); if (releases != null && releases.isJsonArray() && releases.getAsJsonArray().size() > 0) { ExternalBinary releaseForVersion = getReleaseForVersion(version, releases.getAsJsonArray(), availableVersions); if (releaseForVersion != null) { return releaseForVersion; } } else { break; } } throw new IllegalArgumentException( <START> "There wasn't found any release for the version: " + version + " in the repository: " + projectUrl <END> + " Available versions are: " + availableVersions); }</code><technical_language>"No release matching version xxx in repository yy......"</technical_language>

Target:
public ExternalBinary getReleaseForVersion(String version) throws Exception { String url = projectUrl + RELEASES_URL; int pageNumber = 1; List<String> availableVersions = new ArrayList<>(); JsonElement releases = getReleasesJson(url, pageNumber); while (containsSubElements(releases)) { ExternalBinary releaseForVersion = getReleaseForVersion(version, releases.getAsJsonArray(), availableVersions); if (releaseForVersion != null) { return releaseForVersion; } releases = getReleasesJson(url, ++pageNumber); } throw new IllegalArgumentException( "No release matching version " + version + " has been found in the repository" + projectUrl + " Available versions are: " + availableVersions); }
Source:
<code>public void doDestroy() { if (!destroyed.compareAndSet(false, true)) { return; } <START> unregister(); <END> AbstractRegistryFactory.destroyAll(); destroyProtocols(); }</code><technical_language>call unregister here. shutdown hook runs, lead IllegalStateException if try remove hook. java static synchronized void add(Thread hook) { if(hooks == null) throw new IllegalStateException("Shutdown in progress"); if (hook.isAlive()) throw new IllegalArgumentException("Hook running"); if (hooks.containsKey(hook)) throw new IllegalArgumentException("Hook previously registered"); hooks.put(hook, hook); }</technical_language>

Target:
public void doDestroy() { if (!destroyed.compareAndSet(false, true)) { return; } AbstractRegistryFactory.destroyAll(); destroyProtocols(); }
Source:
<code>public void onMediaTransfer(Frame buffer) throws IOException { <START> inbandDetector.detect(buffer.getData(), buffer.getDuration() / 1000000, 0); <END> oobDetector.detect(buffer.getData(), buffer.getDuration() / 1000000, buffer.getSequenceNumber()); }</code><technical_language>need figure out type of data is passed correct detector</technical_language>

Target:
public void onMediaTransfer(Frame buffer) throws IOException { if (buffer.getLength() == 4) inbandDetector.detect(buffer.getData(), buffer.getDuration() / 1000000); else oobDetector.detect(buffer.getData(), buffer.getDuration() / 1000000); }
Source:
<code><START> public ImmutableList<ProjectJson> getProjects() <END> { return projects; }</code><technical_language>List</technical_language>

Target:
public List<ProjectJson> getProjects() { return projects; }
Source:
<code>protected boolean canDoAction() { <START> if (getVdsId() == null || getVdsId().equals(Guid.Empty)) { <END> return validate(new ValidationResult(VdcBllMessages.VDS_INVALID_SERVER_ID)); } if (getVds() == null) { return validate(new ValidationResult(VdcBllMessages.ACTION_TYPE_FAILED_HOST_NOT_EXIST)); } if (isOvirtReInstallOrUpgrade()) { if (getVds().getStatus() == VDSStatus.NonOperational) { return validate(new ValidationResult(VdcBllMessages.VDS_CANNOT_INSTALL_STATUS_ILLEGAL)); } File iso = resolveISO(getParameters().getoVirtIsoFile()); if (iso == null) { return validate(new ValidationResult(VdcBllMessages.VDS_CANNOT_INSTALL_MISSING_IMAGE_FILE)); } RpmVersion ovirtHostOsVersion = VdsHandler.getOvirtHostOsVersion(getVds()); if (!isISOCompatible(iso, ovirtHostOsVersion)) { return validate(new ValidationResult( VdcBllMessages.VDS_CANNOT_UPGRADE_BETWEEN_MAJOR_VERSION, String.format("$IsoVersion %1$s", ovirtHostOsVersion.getMajor()) )); } _iso = iso; } return validate(ValidationResult.VALID); }</code><technical_language>Validator usage is a bit wrong IMHO. I said, I do want block patch this, still... some ideas..</technical_language>

Target:
protected boolean canDoAction() { if (getVdsId() == null || getVdsId().equals(Guid.Empty)) { return failCanDoAction(VdcBllMessages.VDS_INVALID_SERVER_ID); } if (getVds() == null) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_HOST_NOT_EXIST); } if (isOvirtReInstallOrUpgrade()) { if (getVds().getStatus() == VDSStatus.NonOperational) { return failCanDoAction(VdcBllMessages.VDS_CANNOT_INSTALL_STATUS_ILLEGAL); } File iso = resolveISO(getParameters().getoVirtIsoFile()); if (iso == null) { return failCanDoAction(VdcBllMessages.VDS_CANNOT_INSTALL_MISSING_IMAGE_FILE); } RpmVersion ovirtHostOsVersion = VdsHandler.getOvirtHostOsVersion(getVds()); if (!isISOCompatible(iso, ovirtHostOsVersion)) { addCanDoActionMessage(VdcBllMessages.VDS_CANNOT_UPGRADE_BETWEEN_MAJOR_VERSION); addCanDoActionMessage(String.format("$IsoVersion %1$s", ovirtHostOsVersion.getMajor())); return false; } _iso = iso; } return true; }
Source:
<code>public Study getStudy(String identifier) { checkNotNull(identifier); String redisKey = RedisKey.STUDY.getRedisKey(identifier); <START> return getObject(redisKey, Study.class); <END> }</code><technical_language>this set expiration</technical_language>

Target:
public Study getStudy(String identifier) { checkNotNull(identifier); String redisKey = RedisKey.STUDY.getRedisKey(identifier); return getObject(redisKey, Study.class, BridgeConstants.BRIDGE_SESSION_EXPIRE_IN_SECONDS); }
Source:
<code>public void setAnnotationLayers(List<AnnotationLayer> aAnnotationLayers) { annotationLayers = unmodifiableList(new ArrayList<>(aAnnotationLayers)); if (!annotationLayers.contains(selectedAnnotationLayer)) { if (!annotationLayers.isEmpty()) { <START> for (AnnotationLayer layer : annotationLayers) { <END> if (layer.getType().equals(WebAnnoConst.SPAN_TYPE)) { selectedAnnotationLayer = layer; break; } } } else { selectedAnnotationLayer = null; } defaultAnnotationLayer = selectedAnnotationLayer; } }</code><technical_language>annotationLayers.stream().filter(is a span type).findFirst().orElse(null)</technical_language>

Target:
public void setAnnotationLayers(List<AnnotationLayer> aAnnotationLayers) { annotationLayers = unmodifiableList(new ArrayList<>(aAnnotationLayers)); if (!annotationLayers.contains(selectedAnnotationLayer)) { selectedAnnotationLayer = annotationLayers.stream() .filter(layer -> layer.getType().equals(WebAnnoConst.SPAN_TYPE)) .findFirst() .orElse(null); defaultAnnotationLayer = selectedAnnotationLayer; } }
Source:
<code>public SubnetSelectionResult chooseSubnets(Collection<CloudSubnet> subnetMetas, SubnetSelectionParameters subnetSelectionParameters) { LOGGER.debug("Trying to choose subnets from: {}.", subnetMetas); SubnetSelectionResult subnetSelectionResult = filterSubnets(subnetMetas, subnetSelectionParameters); if (subnetSelectionResult.hasResult()) { LOGGER.debug("There are subnets in the subnet selection: {}.", subnetSelectionResult); if (subnetSelectionParameters.isHa()) { return selectForHAScenario(subnetSelectionResult.getResult()); } else { return selectForNonHAScenario(subnetSelectionResult.getResult()); <START> } <END> } else { LOGGER.debug("There is no result in the subnet selection: {}.", subnetSelectionResult); return subnetSelectionResult; } }</code><technical_language>I info log selected subnets useful</technical_language>

Target:
public SubnetSelectionResult chooseSubnets(Collection<CloudSubnet> subnetMetas, SubnetSelectionParameters subnetSelectionParameters) { LOGGER.debug("Trying to choose subnets from: {}.", subnetMetas); SubnetSelectionResult subnetSelectionResult = filterSubnets(subnetMetas, subnetSelectionParameters); if (subnetSelectionResult.hasResult()) { LOGGER.debug("There are subnets in the subnet selection: {}.", subnetSelectionResult); if (subnetSelectionParameters.isHa()) { subnetSelectionResult = selectForHAScenario(subnetSelectionResult.getResult()); } else { subnetSelectionResult = selectForNonHAScenario(subnetSelectionResult.getResult()); } } LOGGER.info("The subnet selection is: {}.", subnetSelectionResult); return subnetSelectionResult; }
Source:
<code>public void testSimpleStoreFlushFrequencyWithoutCoalescing() throws Exception { initStore(1, false); long writeBehindFlushFrequencyNanos = FLUSH_FREQUENCY * 1000 * 1000; int threshold = store.getWriteBehindStoreBatchSize() / 10; try { long start = System.nanoTime(); <START> for (int i =0; i < threshold / 2; i++) <END> store.write(new CacheEntryImpl<>(i, "v" + i)); U.sleep(FLUSH_FREQUENCY + 300); for (int i = threshold / 2; i < threshold; i++) store.write(new CacheEntryImpl<>(i, "v" + i)); long elapsed = System.nanoTime() - start; U.sleep(FLUSH_FREQUENCY + 300); int expectedFlushOps = (int)(1 + elapsed / writeBehindFlushFrequencyNanos); assertTrue(delegate.getPutAllCount() <= expectedFlushOps); } finally { shutdownStore(); } }</code><technical_language>code reformat (including automatic) useful</technical_language>

Target:
public void testSimpleStoreFlushFrequencyWithoutCoalescing() throws Exception { initStore(1, false); long writeBehindFlushFreqNanos = FLUSH_FREQUENCY * 1000 * 1000; int threshold = store.getWriteBehindStoreBatchSize() / 10; try { long start = System.nanoTime(); for (int i = 0; i < threshold / 2; i++) store.write(new CacheEntryImpl<>(i, "v" + i)); U.sleep(FLUSH_FREQUENCY + 300); for (int i = threshold / 2; i < threshold; i++) store.write(new CacheEntryImpl<>(i, "v" + i)); long elapsed = System.nanoTime() - start; U.sleep(FLUSH_FREQUENCY + 300); int expFlushOps = (int)(1 + elapsed / writeBehindFlushFreqNanos); assertTrue(delegate.getPutAllCount() <= expFlushOps); } finally { shutdownStore(); } }
Source:
<code>public ChangeDetail call() throws OrmException, NoSuchEntityException, IllegalStateException, InvalidChangeOperationException, PatchSetInfoNotAvailableException, NoSuchChangeException { final ReviewResult result = submitFactory.create(patchSetId).call(); if (result.getErrors().size() > 0) { throw new IllegalStateException("Cannot submit " <START> + result.getErrors().get(0)); <END> } return changeDetailFactory.create(result.getChangeId()).call(); }</code><technical_language>[optional] message of IllegalStateException get displayed end user in Gerrit WebUI. E.g. user clicks 'Publish Submit' button change is ready for submit, message is displayed: submit SUBMIT_NOT_READY change 172: needs Verified; change 172: needs Code-Review 'SUBMIT_NOT_READY' a bit displaced here. This is I propose this: final ReviewResult.Error error = result.getErrors().get(0); if (error.getMessage() != null) { throw new IllegalStateException("Cannot submit: " + error.getMessage()); } else { throw new IllegalStateException("Cannot submit: " + error); }</technical_language>

Target:
public ChangeDetail call() throws OrmException, NoSuchEntityException, IllegalStateException, InvalidChangeOperationException, PatchSetInfoNotAvailableException, NoSuchChangeException { final ReviewResult result = submitFactory.create(patchSetId).call(); if (result.getErrors().size() > 0) { throw new IllegalStateException( "Cannot submit " + result.getErrors().get(0).getMessageOrType()); } return changeDetailFactory.create(result.getChangeId()).call(); }
Source:
<code><START> private void enforceMinReportingInterval(TreeSet<Data> orderedData) { <END> Data prev = null; for (Iterator<Data> i = orderedData.iterator(); i.hasNext();) { Data d = i.next(); if (null == prev || !(prev.getId().equals(d.getId()) && prev.getTenantId().equals(d.getTenantId()))) { prev = d; } else { if ((d.getTimestamp() - prev.getTimestamp()) < minReportingInterval) { i.remove(); } } } }</code><technical_language>I testing this one. I is working fine. fix proposed, cluster is working enforceMinReportingInterval is filtering expected. I debugging it, I post insights</technical_language>

Target:
private void enforceMinReportingInterval(TreeSet<Data> orderedData) { int beforeSize = orderedData.size(); Data prev = null; for (Iterator<Data> i = orderedData.iterator(); i.hasNext();) { Data d = i.next(); if (!d.same(prev)) { prev = d; } else { if ((d.getTimestamp() - prev.getTimestamp()) < minReportingInterval) { log.tracef("MinReportingInterval violation, prev: %s, removed: %s", prev, d); i.remove(); } } } if (log.isDebugEnabled() && beforeSize != orderedData.size()) { log.debugf("MinReportingInterval Data violations: [%d]", beforeSize - orderedData.size()); } }