auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public GetObjectsOnTapeResult call() { try { final GetBlobsOnTapeSpectraS3Response response = getClient().getBlobsOnTapeSpectraS3(new GetBlobsOnTapeSpectraS3Request(null, this.tapeId)); return new GetObjectsOnTapeResult(this.tapeId, response.getBulkObjectListResult().getObjects().iterator()); } catch (final IOException e) { <START> if (CommandExceptionFactory.hasStatusCode(e, 404)) { <END> CommandExceptionFactory.getInstance().handleException(this.getClass().getSimpleName(), new CommandException("Unknown tape '" + this.tapeId +"'", e), true); } else { CommandExceptionFactory.getInstance().handleException(this.getClass().getSimpleName(), e, true); } return null; } }</code><technical_language>This is logic in of exception handlers</technical_language>

Target:
public GetObjectsOnTapeResult call() throws CommandException, IOException { try { final GetBlobsOnTapeSpectraS3Response response = getClient().getBlobsOnTapeSpectraS3(new GetBlobsOnTapeSpectraS3Request(null, this.tapeId)); return new GetObjectsOnTapeResult(this.tapeId, response.getBulkObjectListResult().getObjects().iterator()); } catch (final FailedRequestException e) { if (e.getStatusCode() == 404) { throw new CommandException("Unknown tape '" + this.tapeId +"'", e); } throw e; } }
Source:
<code>public boolean isRamValueValid() { <START> final String validationAttribute = "aria-invalid"; <END> return seleniumWebDriverHelper .waitVisibilityAndGetAttribute(waitRamTextField(), validationAttribute) .equals("false"); }</code><technical_language>I is more 'invalidRamFlagAtribute'</technical_language>

Target:
public boolean isRamValueValid() { final String invalidRamFlagAttribute = "aria-invalid"; return seleniumWebDriverHelper .waitVisibilityAndGetAttribute(waitRamTextField(), invalidRamFlagAttribute) .equals("false"); }
Source:
<code>public TransactionController getReadOnlyTransaction(ContextManager cm, long id) throws StandardException { String transName = AccessFactoryGlobals.USER_TRANS_NAME; if (LOG.isDebugEnabled()) LOG.debug("in SpliceAccessManager - getAndNameTransaction, transName=" + transName); if (cm == null) <START> return null; END> SpliceTransactionManagerContext rtc = (SpliceTransactionManagerContext) cm.getContext(AccessFactoryGlobals.RAMXACT_CONTEXT_ID); if (rtc != null) return rtc.getTransactionManager(); if (LOG.isDebugEnabled()) LOG.debug("in SpliceAccessManager - getAndNameTransaction, SpliceTransactionManagerContext is null"); Transaction rawtran = rawstore.createPastTransaction(cm, transName, id); SpliceTransactionManager rt = new SpliceTransactionManager(this, rawtran, null); rtc = new SpliceTransactionManagerContext(cm, AccessFactoryGlobals.RAMXACT_CONTEXT_ID, rt, false ); TransactionController tc = rtc.getTransactionManager(); if (xactProperties != null) { rawtran.setup(tc); } return tc; }</code><technical_language>throw exception? In case, this XXX addressed removed. wanna replace assert cm != null</technical_language>

Target:
public TransactionController getReadOnlyTransaction(ContextManager cm, long id) throws StandardException { String transName = AccessFactoryGlobals.USER_TRANS_NAME; if (LOG.isDebugEnabled()) LOG.debug("in SpliceAccessManager - getReadOnlyTransaction, transName=" + transName); if (cm == null) throw new NullPointerException("ContextManager cannot be null"); SpliceTransactionManagerContext rtc = (SpliceTransactionManagerContext) cm.getContext(AccessFactoryGlobals.RAMXACT_CONTEXT_ID); if (rtc != null) return rtc.getTransactionManager(); if (LOG.isDebugEnabled()) LOG.debug("in SpliceAccessManager - getReadOnlyTransaction, SpliceTransactionManagerContext is null"); Transaction rawtran = rawstore.createPastTransaction(cm, transName, id); SpliceTransactionManager rt = new SpliceTransactionManager(this, rawtran, null); rtc = new SpliceTransactionManagerContext(cm, AccessFactoryGlobals.RAMXACT_CONTEXT_ID, rt, false ); TransactionController tc = rtc.getTransactionManager(); if (xactProperties != null) { rawtran.setup(tc); } return tc; }
Source:
<code>public FormValidation doCheckTargetApiURL(@QueryParameter("targetApiURL") final String targetApiURL) { <START> if(StringUtils.isNotBlank(targetApiURL) && !DatadogHttpClient.validateTargetURL(targetApiURL)) { <END> return FormValidation.error("The field must be configured in the form <http|https>://<url>/"); } return FormValidation.ok("Valid URL"); }</code><technical_language>I separate concerns more here: - FormValidation ensures in fields sense if display a meaningful error message. - DatadogClient checks connectivity provided endpoint for example this function check string a valid url, url is a datadog one, is reachable</technical_language>

Target:
public FormValidation doCheckTargetApiURL(@QueryParameter("targetApiURL") final String targetApiURL) { if(!validateURL(targetApiURL)) { return FormValidation.error("The field must be configured in the form <http|https>://<url>/"); } return FormValidation.ok("Valid URL"); }
Source:
<code>private void rename(MetaDataUpdate md) throws IOException, ConfigInvalidException { boolean success = false; for (int attempts = 0; !success && attempts < MAX_TRIES; attempts++) { ProjectConfig config = ProjectConfig.read(md); GroupReference ref = config.getGroup(uuid); if (ref == null || newName.equals(ref.getName())) { projectCache.evict(config.getProject()); return; } ref.setName(newName); md.getCommitBuilder().setAuthor(author); md.setMessage("Rename group " + oldName + " to " + newName + "\n"); try { config.commit(md); projectCache.evict(config.getProject()); success = true; <START> } catch (IOException e) { <END> try { Thread.sleep(25 ); } catch (InterruptedException wakeUp) { continue; } } } if (!success) { if (tryingAgain) { log.warn("Could not rename group " + oldName + " to " + newName + " in " + md.getProjectName().get()); } else { retryOn.add(md.getProjectName()); } } }</code><technical_language>If a repository is corrupt writable lose error commit. I if log this of time. refs/meta/config branch is busy verbose if is message log</technical_language>

Target:
private void rename(MetaDataUpdate md) throws IOException, ConfigInvalidException { boolean success = false; for (int attempts = 0; !success && attempts < MAX_TRIES; attempts++) { ProjectConfig config = ProjectConfig.read(md); GroupReference ref = config.getGroup(uuid); if (ref == null || newName.equals(ref.getName())) { projectCache.evict(config.getProject()); return; } ref.setName(newName); md.getCommitBuilder().setAuthor(author); md.setMessage("Rename group " + oldName + " to " + newName + "\n"); try { config.commit(md); projectCache.evict(config.getProject()); success = true; } catch (IOException e) { log.error("Could not commit rename of group " + oldName + " to " + newName + " in " + md.getProjectName().get(), e); try { Thread.sleep(25 ); } catch (InterruptedException wakeUp) { continue; } } } if (!success) { if (tryingAgain) { log.warn("Could not rename group " + oldName + " to " + newName + " in " + md.getProjectName().get()); } else { retryOn.add(md.getProjectName()); } } }
Source:
<code>public void testValidateLabels(){ <START> Nic nicWithUnmanagedNetwork = new Nic(); <END> nicWithUnmanagedNetwork.setName("eth_unmanaged"); NicLabel label = new NicLabel(null, "eth1", "label1"); NicLabel labelWithUnmanagedNetwork = new NicLabel(null, "eth_unmanaged", "labelOnUnmanaged"); Set<NicLabel> labels = new HashSet<>(Arrays.asList(label, labelWithUnmanagedNetwork)); ValidationResult result = validator.validateLabels(nicWithUnmanagedNetwork, labels); assertThat(result, failsWith(EngineMessage.ACTION_TYPE_FAILED_HOST_NETWORK_LABEL_ON_UNMANAGED_NETWORK, ReplacementUtils.createSetVariableString(LABEL, "labelOnUnmanaged"), ReplacementUtils.createSetVariableString(NIC, "eth_unmanaged"))); NicLabel labelWithoutUnmanaged = new NicLabel(null, "eth_other", "label1"); Set<NicLabel> labelsNotOnUnmanagedNetwork = new HashSet<>(Arrays.asList(labelWithoutUnmanaged)); result = validator.validateLabels(nicWithUnmanagedNetwork, labelsNotOnUnmanagedNetwork); assertTrue(result.isValid()); }</code><technical_language>'createNic(..);</technical_language>

Target:
public void testValidateLabels(){ String nicWithUnmanagedNetwork = "eth_unmanaged"; NicLabel label = new NicLabel(null, "eth1", "label1"); NicLabel labelWithUnmanagedNetwork = new NicLabel(null, nicWithUnmanagedNetwork, "labelOnUnmanaged"); Collection<NicLabel> labels = Arrays.asList(label, labelWithUnmanagedNetwork); ValidationResult result = validator.validateLabels(nicWithUnmanagedNetwork, labels); assertThat(result, failsWith(EngineMessage.ACTION_TYPE_FAILED_HOST_NETWORK_LABEL_ON_UNMANAGED_NETWORK, ReplacementUtils.createSetVariableString(LABEL, "labelOnUnmanaged"), ReplacementUtils.createSetVariableString(NIC, "eth_unmanaged"))); NicLabel labelWithoutUnmanaged = new NicLabel(null, "eth_other", "label1"); Collection<NicLabel> labelsNotOnUnmanagedNetwork = Arrays.asList(labelWithoutUnmanaged); result = validator.validateLabels(nicWithUnmanagedNetwork, labelsNotOnUnmanagedNetwork); assertTrue(result.isValid()); }
Source:
<code>protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mMapView = findViewById(R.id.mapView); mRasterFunctionButton = findViewById(R.id.rasterButton); mRasterFunctionButton.setEnabled(false); map = new ArcGISMap(Basemap.createDarkGrayCanvasVector()); final ImageServiceRaster imageServiceRaster = new ImageServiceRaster(getString(R.string.image_service_raster_url)); final RasterLayer imageRasterLayer = new RasterLayer(imageServiceRaster); map.getOperationalLayers().add(imageRasterLayer); imageRasterLayer.addDoneLoadingListener(() -> { if (imageRasterLayer.getLoadStatus() == LoadStatus.LOADED) { Point centerPnt = imageServiceRaster.getServiceInfo().getFullExtent().getCenter(); mMapView.setViewpointCenterAsync(centerPnt, 55000000); mRasterFunctionButton.setEnabled(true); <START> } <END> }); mRasterFunctionButton.setOnClickListener(v -> applyRasterFunction(imageServiceRaster)); mMapView.setMap(map); }</code><technical_language>else { String error = "Error loading image raster layer: " + imageRasterLayer.getLoadError(); Log.e(TAG, error); Toast error, }</technical_language>

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mMapView = findViewById(R.id.mapView); mRasterFunctionButton = findViewById(R.id.rasterButton); mRasterFunctionButton.setEnabled(false); ArcGISMap map = new ArcGISMap(Basemap.createDarkGrayCanvasVector()); final ImageServiceRaster imageServiceRaster = new ImageServiceRaster(getString(R.string.image_service_raster_url)); final RasterLayer imageRasterLayer = new RasterLayer(imageServiceRaster); map.getOperationalLayers().add(imageRasterLayer); imageRasterLayer.addDoneLoadingListener(() -> { if (imageRasterLayer.getLoadStatus() == LoadStatus.LOADED) { Point centerPnt = imageServiceRaster.getServiceInfo().getFullExtent().getCenter(); mMapView.setViewpointCenterAsync(centerPnt, 55000000); mRasterFunctionButton.setEnabled(true); } else { String error = "Error loading image raster layer: " + imageRasterLayer.getLoadError(); Log.e(TAG, error); Toast.makeText(this, error, Toast.LENGTH_LONG).show(); } }); mRasterFunctionButton.setOnClickListener(v -> applyRasterFunction(imageServiceRaster)); mMapView.setMap(map); }
Source:
<code>private boolean openSerialPort(final String serialPortName, int baudRate) { logger.debug("Connecting to serial port '{}'", serialPortName); try { SerialPortIdentifier portIdentifier = serialPortManager.getIdentifier(serialPortName); if (portIdentifier == null) { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, "Port does not exist"); return false; } <START> serialPort = portIdentifier.open("org.openhab.binding.zigbee", 2000); <END> serialPort.setSerialPortParams(baudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.enableReceiveTimeout(2000); serialPort.notifyOnDataAvailable(true); logger.info("Connected to serial port '{}'.", serialPortName); } catch (PortInUseException e) { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.OFFLINE.CONFIGURATION_ERROR, "Serial Error: Port in use"); return false; } catch (UnsupportedCommOperationException e) { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.OFFLINE.COMMUNICATION_ERROR, "Serial Error: Unsupported operation"); return false; } try { inputStream = new BufferedInputStream(serialPort.getInputStream()); outputStream = serialPort.getOutputStream(); } catch (IOException e) { logger.error("Error getting serial streams", e); return false; } return true; }</code><technical_language>Is this a copy&paste error do call "zigbee" in a bluetooth binding</technical_language>

Target:
private boolean openSerialPort(final String serialPortName, int baudRate) { logger.debug("Connecting to serial port '{}'", serialPortName); try { SerialPortIdentifier portIdentifier = serialPortManager.getIdentifier(serialPortName); if (portIdentifier == null) { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, "Port does not exist"); return false; } SerialPort sp = portIdentifier.open("org.openhab.binding.bluetooth.bluegiga", 2000); sp.setSerialPortParams(baudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); sp.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); sp.enableReceiveThreshold(1); sp.enableReceiveTimeout(2000); sp.notifyOnDataAvailable(true); logger.info("Connected to serial port '{}'.", serialPortName); try { inputStream = new BufferedInputStream(sp.getInputStream()); outputStream = sp.getOutputStream(); } catch (IOException e) { logger.error("Error getting serial streams", e); return false; } this.serialPort = sp; return true; } catch (PortInUseException e) { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.OFFLINE.CONFIGURATION_ERROR, "Serial Error: Port in use"); return false; } catch (UnsupportedCommOperationException e) { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.OFFLINE.COMMUNICATION_ERROR, "Serial Error: Unsupported operation"); return false; } }
Source:
<code>private String buildAuthorizationRequestUri() { MultiValueMap<String, String> parameters = new LinkedMultiValueMap<>(); <START> parameters.set(OAuth2ParameterNames.RESPONSE_TYPE, percentEncode(this.responseType.getValue())); <END> parameters.set(OAuth2ParameterNames.CLIENT_ID, percentEncode(this.clientId)); if (!CollectionUtils.isEmpty(this.scopes)) { parameters.set(OAuth2ParameterNames.SCOPE, percentEncode(StringUtils.collectionToDelimitedString(this.scopes, " "))); } if (this.state != null) { parameters.set(OAuth2ParameterNames.STATE, percentEncode(this.state)); } if (this.redirectUri != null) { parameters.set(OAuth2ParameterNames.REDIRECT_URI, percentEncode(this.redirectUri)); } if (!CollectionUtils.isEmpty(this.additionalParameters)) { this.additionalParameters.forEach((k, v) -> parameters.set(percentEncode(k), percentEncode(v.toString()))); } return UriComponentsBuilder.fromHttpUrl(this.authorizationUri) .queryParams(parameters) .build() .toUriString(); }</code><technical_language>Please replace percentEncode Spring's UriUtils.encodeQueryParam(paramValue, StandardCharsets.UTF_8)</technical_language>

Target:
private String buildAuthorizationRequestUri() { MultiValueMap<String, String> parameters = new LinkedMultiValueMap<>(); parameters.set(OAuth2ParameterNames.RESPONSE_TYPE, encodeQueryParam(this.responseType.getValue())); parameters.set(OAuth2ParameterNames.CLIENT_ID, encodeQueryParam(this.clientId)); if (!CollectionUtils.isEmpty(this.scopes)) { parameters.set(OAuth2ParameterNames.SCOPE, encodeQueryParam(StringUtils.collectionToDelimitedString(this.scopes, " "))); } if (this.state != null) { parameters.set(OAuth2ParameterNames.STATE, encodeQueryParam(this.state)); } if (this.redirectUri != null) { parameters.set(OAuth2ParameterNames.REDIRECT_URI, encodeQueryParam(this.redirectUri)); } if (!CollectionUtils.isEmpty(this.additionalParameters)) { this.additionalParameters.forEach((k, v) -> parameters.set(encodeQueryParam(k), encodeQueryParam(v.toString()))); } return UriComponentsBuilder.fromHttpUrl(this.authorizationUri) .queryParams(parameters) .build() .toUriString(); }
Source:
<code>public static ByteRange fromOffsetRange(long startOffset, long endOffset) { if (startOffset < 0 || endOffset < startOffset) { throw new IllegalArgumentException( "Invalid range offsets provided for ByteRange; startOffset=" + startOffset + ", endOffset=" + endOffset); } <START> return new OffsetRange(startOffset, endOffset); <END> }</code><technical_language>abstract class create instances of subclasses. static constructors moved a factory class eg. ByteRangeFactory</technical_language>

Target:
public static ByteRange fromOffsetRange(long startOffset, long endOffset) { return ByteRanges.fromOffsetRange(startOffset, endOffset); }
Source:
<code>public void checkValid(String value) throws InvalidConditionParameterException{ <START> if(!allowAdditions){ <END> if(!options.containsKey(value)) throw new InvalidConditionParameterException("Parameter '%s' is not allowed. Additions are not allowed on the dropdown",value); } }</code><technical_language>Join conditions: if( !allowAddtions && !options.containsKey(value) ) Mmm. thought, this be: if(allowAdditions) { this.getDataType().checkValid(value); } else if( !options.containsKey(value) ){ throw }</technical_language>

Target:
public void checkValid(String value) throws InvalidConditionParameterException, RuleEngineException{ if(allowAdditions) try{ this.getDataType().checkValid(value); }catch(Exception e){ Logger.error(this.getClass(), e.getMessage(), e); throw new RuleEngineException(e.getMessage()); } else if(!options.containsKey(value)) throw new InvalidConditionParameterException("Parameter '%s' is not allowed. Additions are not allowed on the dropdown",value); }
Source:
<code>SubscriptionImpl subscribe(String subject, String queue, MessageHandler cb, BlockingQueue<Message> ch) { final SubscriptionImpl sub; mu.lock(); try { if (closed()) { throw new IllegalStateException(ERR_CONNECTION_CLOSED); } if (cb == null && ch == null) { throw new IllegalArgumentException(ERR_BAD_SUBSCRIPTION); } if (cb != null) { MsgDeliveryPool msgDlvPool = null; final boolean useDlvPool = (this.opts.useGlobalMsgDelivery && ((msgDlvPool = Nats.getMsgDeliveryThreadPool()) != null)); sub = new AsyncSubscriptionImpl(this, subject, queue, cb, useDlvPool); if (useDlvPool) { msgDlvPool.assignDeliveryWorker((AsyncSubscriptionImpl) sub); } else { subexec.submit(new Runnable() { public void run() { try { waitForMsgs((AsyncSubscriptionImpl) sub); } catch (InterruptedException e) { <START> Thread.currentThread().interrupt(); <END> } } }); } } else { sub = new SyncSubscriptionImpl(this, subject, queue); sub.setChannel(ch); } addSubscription(sub); if (!reconnecting()) { sendSubscriptionMessage(sub); } kickFlusher(); return sub; } finally { mu.unlock(); } }</code><technical_language>do besides setting interrupt flag? Is this handled elsewhere</technical_language>

Target:
SubscriptionImpl subscribe(String subject, String queue, MessageHandler cb, BlockingQueue<Message> ch) { final SubscriptionImpl sub; mu.lock(); try { if (closed()) { throw new IllegalStateException(ERR_CONNECTION_CLOSED); } if (cb == null && ch == null) { throw new IllegalArgumentException(ERR_BAD_SUBSCRIPTION); } if (cb != null) { MsgDeliveryPool msgDlvPool = null; final boolean useDlvPool = (this.opts.useGlobalMsgDelivery && ((msgDlvPool = Nats.getMsgDeliveryThreadPool()) != null)); sub = new AsyncSubscriptionImpl(this, subject, queue, cb, useDlvPool); if (useDlvPool) { msgDlvPool.assignDeliveryWorker((AsyncSubscriptionImpl) sub); } else { subexec.submit(new Runnable() { public void run() { waitForMsgs((AsyncSubscriptionImpl) sub); } }); } } else { sub = new SyncSubscriptionImpl(this, subject, queue); sub.setChannel(ch); } addSubscription(sub); if (!reconnecting()) { sendSubscriptionMessage(sub); } kickFlusher(); return sub; } finally { mu.unlock(); } }
Source:
<code>private void enforceTaskLimits() { int totalRunningTaskCount = 0; int highestRunningTaskCount = 0; Optional<T> highestRunningTaskQuery = Optional.empty(); for (T query : queries.values()) { if (query.isDone()) { continue; } int runningTaskCount = query.getRunningTask(); totalRunningTaskCount += runningTaskCount; if (runningTaskCount > highestRunningTaskCount) { highestRunningTaskCount = runningTaskCount; highestRunningTaskQuery = Optional.of(query); } } runningTaskCount.set(totalRunningTaskCount); if (totalRunningTaskCount > maxTotalRunningTaskCount && highestRunningTaskCount > maxQueryRunningTaskCount && highestRunningTaskQuery.isPresent()) { highestRunningTaskQuery.get().fail(new PrestoException(QUERY_HAS_TOO_MANY_STAGES, format( <START> "Cluster is overloaded with too many tasks (%s), query with highest running tasks is killed (%s). " + TOO_MANY_STAGES_MESSAGE, <END> totalRunningTaskCount, highestRunningTaskCount))); queriesKilledDueToTooManyTask.incrementAndGet(); } }</code><technical_language>This format string wrong modifiers mixes formatting concatenation. I assume this unit test coverage if fail format this message</technical_language>

Target:
private void enforceTaskLimits() { int totalRunningTaskCount = 0; int highestRunningTaskCount = 0; Optional<T> highestRunningTaskQuery = Optional.empty(); for (T query : queries.values()) { if (query.isDone()) { continue; } int runningTaskCount = query.getRunningTaskCount(); totalRunningTaskCount += runningTaskCount; if (runningTaskCount > highestRunningTaskCount) { highestRunningTaskCount = runningTaskCount; highestRunningTaskQuery = Optional.of(query); } } runningTaskCount.set(totalRunningTaskCount); if (totalRunningTaskCount > maxTotalRunningTaskCount && highestRunningTaskCount > maxQueryRunningTaskCount && highestRunningTaskQuery.isPresent()) { highestRunningTaskQuery.get().fail(new PrestoException(QUERY_HAS_TOO_MANY_STAGES, format( "Query killed because the cluster is overloaded with too many tasks (%s) and this query was running with the highest number of tasks (%s). %s Otherwise, please try again later.", totalRunningTaskCount, highestRunningTaskCount, TOO_MANY_STAGES_MESSAGE))); queriesKilledDueToTooManyTask.incrementAndGet(); } }
Source:
<code>public Optional<String> getCountryCode(String wktLocation, int radius) <START> throws GeoEntryQueryException, ParseException { <END> String countryCode = null; try (final Directory directory = openDirectoryAndCheckForIndex()) { Shape shape = getShape(wktLocation); countryCode = doGetCountryCode(shape, radius, directory); } catch (IOException e) { LOGGER.warn("Could not get directory"); } catch (ParseException e) { LOGGER.warn("Could not get shape from {}", wktLocation); } return Optional.ofNullable(countryCode); }</code><technical_language>this ParseException removed. Do need GeoEntriesQueryException anymore either</technical_language>

Target:
public Optional<String> getCountryCode(String wktLocation, int radius) throws GeoEntryQueryException { String countryCode = null; try (final Directory directory = openDirectoryAndCheckForIndex()) { Shape shape = getShape(wktLocation); countryCode = doGetCountryCode(shape, radius, directory); } catch (IOException e) { LOGGER.warn("Could not get directory"); } catch (ParseException e) { LOGGER.warn("Could not get shape from {}", wktLocation); } return Optional.ofNullable(countryCode); }
Source:
<code>public void CompletePcapPacketTest() throws IOException, BadPcapFileException, BadPacketException { PcapTestTrace trace = PcapTestTrace.MOSTLY_UDP; assumeTrue(trace.exists()); <START> PcapFile file = trace.getTrace(); <END> file.seekPacket(36); PcapPacket packet = file.parseNextPacket(); if (packet == null) { fail("CompletePcapPacketTest has failed!"); return; } assertEquals(PcapProtocol.PCAP, packet.getProtocol()); assertTrue(packet.hasProtocol(PcapProtocol.PCAP)); assertTrue(packet.hasProtocol(PcapProtocol.UNKNOWN)); assertFalse(packet.hasProtocol(PcapProtocol.TCP)); assertTrue(packet.validate()); assertEquals(86567859, packet.hashCode()); assertFalse(packet.equals(null)); assertFalse(packet.equals(file.parseNextPacket())); assertEquals(EXPECTED_FIELDS, packet.getFields()); assertEquals(EXPECTED_TOSTRING, packet.toString()); assertEquals("Frame 36: 75 bytes on wire, 75 bytes captured", packet.getLocalSummaryString()); assertEquals("Source Port: 2719, Destination Port: 53", packet.getGlobalSummaryString()); assertEquals(new PcapEndpoint(packet, true), packet.getSourceEndpoint()); assertEquals(new PcapEndpoint(packet, false), packet.getDestinationEndpoint()); ByteBuffer payload = packet.getPayload(); if (payload == null) { fail("CompletePcapPacketTest has failed!"); return; } assertEquals(fPayload, payload.flip()); assertEquals(36, packet.getIndex()); assertEquals(75, packet.getOriginalLength()); assertEquals(75, packet.getIncludedLength()); assertEquals(1120469632829277L, packet.getTimestamp()); assertFalse(packet.isTruncated()); }</code><technical_language>I try</technical_language>

Target:
public void CompletePcapPacketTest() throws IOException, BadPcapFileException, BadPacketException { PcapTestTrace trace = PcapTestTrace.MOSTLY_UDP; assumeTrue(trace.exists()); try (PcapFile file = trace.getTrace();) { file.seekPacket(36); PcapPacket packet = file.parseNextPacket(); if (packet == null) { fail("CompletePcapPacketTest has failed!"); return; } assertEquals(PcapProtocol.PCAP, packet.getProtocol()); assertTrue(packet.hasProtocol(PcapProtocol.PCAP)); assertTrue(packet.hasProtocol(PcapProtocol.UNKNOWN)); assertFalse(packet.hasProtocol(PcapProtocol.TCP)); assertTrue(packet.validate()); assertEquals(86567859, packet.hashCode()); assertFalse(packet.equals(null)); assertFalse(packet.equals(file.parseNextPacket())); assertEquals(EXPECTED_FIELDS, packet.getFields()); assertEquals(EXPECTED_TOSTRING, packet.toString()); assertEquals("Frame 36: 75 bytes on wire, 75 bytes captured", packet.getLocalSummaryString()); assertEquals("Source Port: 2719, Destination Port: 53", packet.getGlobalSummaryString()); assertEquals(new PcapEndpoint(packet, true), packet.getSourceEndpoint()); assertEquals(new PcapEndpoint(packet, false), packet.getDestinationEndpoint()); ByteBuffer payload = packet.getPayload(); if (payload == null) { fail("CompletePcapPacketTest has failed!"); return; } assertEquals(fPayload, payload.flip()); assertEquals(36, packet.getIndex()); assertEquals(75, packet.getOriginalLength()); assertEquals(75, packet.getIncludedLength()); assertEquals(1120469632829277L, packet.getTimestamp()); assertFalse(packet.isTruncated()); } }
Source:
<code>public void dispose() { <START> super.dispose(); ResourcesPlugin.getWorkspace().removeResourceChangeListener(this); <END> getSite().getPage().removePartListener(fListener); }</code><technical_language>remove tabs</technical_language>

Target:
public void dispose() { super.dispose(); ResourcesPlugin.getWorkspace().removeResourceChangeListener(this); getSite().getPage().removePartListener(fPartListener); }
Source:
<code>public List<VmNumaNode> getAllPinnedVmNumaNodeByVdsNumaNodeId(Guid vdsNumaNodeId) { List<VmNumaNode> vmNumaNodes = <START> multipleResults(entityManager.createNativeQuery("select * from GetVmNumaNodeByVdsNumaNodeIdWithPinnedInfo(CAST( CAST (? AS text) AS uuid),?)", <END> VmNumaNode.class) .setParameter(1, vdsNumaNodeId.toString()) .setParameter(2, true)); return vmNumaNodes; }</code><technical_language>1. a nicer provide Guid parameter a named query ? double casting is needed ? 2. split query lines ? exceeds line's limit</technical_language>

Target:
public List<VmNumaNode> getAllPinnedVmNumaNodeByVdsNumaNodeId(Guid vdsNumaNodeId) { List<VmNumaNode> vmNumaNodes = multipleResults(entityManager.createNativeQuery("select * " + "from GetVmNumaNodeByVdsNumaNodeIdWithPinnedInfo(CAST( CAST (? AS text) AS uuid),?)", VmNumaNode.class) .setParameter(1, vdsNumaNodeId.toString()) .setParameter(2, true)); return vmNumaNodes; }
Source:
<code>private void showDeletePageOnboarding() { FeedbackUtil.makeSnackbar(getView(), getString(R.string.reading_lists_onboarding_page_delete), Snackbar.LENGTH_INDEFINITE) .setAction(R.string.reading_lists_onboarding_got_it, new View.OnClickListener() { @Override public void onClick(View v) { } }).show(); <START> Prefs.setReadingListPageDeleteTutorialEnabled(false); <END> }</code><technical_language>it, this shown if user click "got it," pattern is showing user clicks "got it" show require acknowledgement</technical_language>

Target:
private void showDeletePageOnboarding() { FeedbackUtil.makeSnackbar(getView(), getString(R.string.reading_lists_onboarding_page_delete), Snackbar.LENGTH_INDEFINITE) .setAction(R.string.reading_lists_onboarding_got_it, new View.OnClickListener() { @Override public void onClick(View v) { Prefs.setReadingListPageDeleteTutorialEnabled(false); } }).show(); }
Source:
<code><START> public RemoteFilesList getRemoteFilesList(String capabilityListUri, String authString) <END> throws IOException, CantRetrieveFileException { List<UrlItem> capabilityList = getRsFile(capabilityListUri, authString).getItemList(); List<RemoteFile> changes = new ArrayList<>(); List<RemoteFile> resources = new ArrayList<>(); for (UrlItem capabilityListItem : capabilityList) { if (capabilityListItem.getMetadata().getCapability().equals(Capability.CHANGELIST.getXmlValue())) { UrlSet rsFile = getRsFile(capabilityListItem.getLoc(), authString); String changeListExtension = ".*.nqud"; for (UrlItem changeListItem : rsFile.getItemList()) { if (changeListItem.getMetadata().getMimeType().equals(MIME_TYPE_FOR_EXTENSION.get(changeListExtension)) || changeListItem.getLoc().matches(changeListExtension)) { RemoteFile remoteFile = getRemoteFile(new Tuple<>(changeListItem.getLoc(), changeListItem.getMetadata()), authString); changes.add(remoteFile); } } } else if (capabilityListItem.getMetadata().getCapability().equals(Capability.RESOURCELIST.getXmlValue())) { UrlSet rsFile = getRsFile(capabilityListItem.getLoc(), authString); for (UrlItem resourceListItem : rsFile.getItemList()) { if (MIME_TYPE_FOR_EXTENSION.values().contains(resourceListItem.getMetadata().getMimeType()) || RdfExtensions.createFromFile(resourceListItem.getLoc()) != null) { resources.add(getRemoteFile(new Tuple<>(resourceListItem.getLoc(), resourceListItem.getMetadata()), authString)); } } } } return new RemoteFilesList(changes, resources); }</code><technical_language>A name for authString authToken</technical_language>

Target:
public RemoteFilesList getRemoteFilesList(String capabilityListUri, String authString) throws IOException, CantRetrieveFileException { List<UrlItem> capabilityList = getRsFile(capabilityListUri, authString).getItemList(); List<RemoteFile> changes = new ArrayList<>(); List<RemoteFile> resources = new ArrayList<>(); for (UrlItem capabilityListItem : capabilityList) { if (capabilityListItem.getMetadata().getCapability().equals(Capability.CHANGELIST.getXmlValue())) { UrlSet rsFile = getRsFile(capabilityListItem.getLoc(), authString); String changeListExtension = ".*.nqud"; for (UrlItem changeListItem : rsFile.getItemList()) { if (changeListItem.getMetadata().getMimeType().equals(MIME_TYPE_FOR_EXTENSION.get("nqud")) || changeListItem.getLoc().matches(changeListExtension)) { RemoteFile remoteFile = getRemoteFile(new Tuple<>(changeListItem.getLoc(), changeListItem.getMetadata()), authString); changes.add(remoteFile); } } } else if (capabilityListItem.getMetadata().getCapability().equals(Capability.RESOURCELIST.getXmlValue())) { UrlSet rsFile = getRsFile(capabilityListItem.getLoc(), authString); for (UrlItem resourceListItem : rsFile.getItemList()) { if (MIME_TYPE_FOR_EXTENSION.values().contains(resourceListItem.getMetadata().getMimeType()) || RdfExtensions.createFromFile(resourceListItem.getLoc()) != null) { resources.add(getRemoteFile(new Tuple<>(resourceListItem.getLoc(), resourceListItem.getMetadata()), authString)); } } } } return new RemoteFilesList(changes, resources); }
Source:
<code>public static void addCast(IItemStack output, IIngredient[][] ingredients, int fluidInput, @Optional IItemStack plan) { FluidStack fluid = FluidRegistry.getFluidStack("glass", fluidInput); if (fluid == null){ <START> LogHelper.logWarning("Liquid Class is null for the Thermionic Fabricator"); <END> return; } ShapedRecipeCustom patternRecipe = new ShapedRecipeCustom(toStack(output), MTInputHelper.toShapedObjects(ingredients)); NonNullList<NonNullList<ItemStack>> ingredientsList = patternRecipe.getRawIngredients(); IFabricatorRecipe recipe = new FabricatorRecipe(toStack(plan), fluid, toStack(output), ingredientsList, patternRecipe.getOreDicts(), patternRecipe.getWidth(), patternRecipe.getHeight()); ModTweaker.LATE_ADDITIONS.add(new AddCast(recipe)); }</code><technical_language>I "Liquid Glass"</technical_language>

Target:
public static void addCast(IItemStack output, IIngredient[][] ingredients, int fluidInput, @Optional IItemStack plan) { FluidStack fluid = FluidRegistry.getFluidStack("glass", fluidInput); if (fluid == null){ LogHelper.logWarning("Liquid Glass is null for the Thermionic Fabricator"); return; } ShapedRecipeCustom patternRecipe = new ShapedRecipeCustom(toStack(output), toShapedObjects(ingredients)); NonNullList<NonNullList<ItemStack>> ingredientsList = patternRecipe.getRawIngredients(); IFabricatorRecipe recipe = new FabricatorRecipe(toStack(plan), fluid, toStack(output), ingredientsList, patternRecipe.getOreDicts(), patternRecipe.getWidth(), patternRecipe.getHeight()); ModTweaker.LATE_ADDITIONS.add(new AddCast(recipe)); }
Source:
<code>public MethodNode deepResolveMethod(@NotNull MethodInfo mth) { ClassNode cls = resolveClass(mth.getDeclClass()); if (cls == null) { <START> return null; <END> } MethodNode resolved; DexNode declDex = cls.dex(); resolved = declDex.deepResolveMethod(cls, mth); if (resolved != null){ return resolved; } for (DexNode dexNode : dexNodes) { if(dexNodes == declDex) { continue; } resolved = dexNode.deepResolveMethod(cls, mth); if (resolved != null){ return resolved; } } return null; }</code><technical_language>this change is needed. is fault code is clear, deepResolveMethod DexNode rely dex dex specific scope. I resolve* methods DexNode moved RootNode</technical_language>

Target:
public MethodNode deepResolveMethod(@NotNull MethodInfo mth) { ClassNode cls = resolveClass(mth.getDeclClass()); if (cls == null) { return null; } return cls.dex().deepResolveMethod(cls, mth.makeSignature(false)); }
Source:
<code>public ThrottleJobProperty(Integer maxConcurrentPerNode, Integer maxConcurrentTotal, List<String> categories, boolean throttleEnabled, String throttleOption, boolean limitOneJobWithMatchingParams, String paramsToUseForLimit, @CheckForNull ThrottleMatrixProjectOptions matrixOptions ) { this.maxConcurrentPerNode = maxConcurrentPerNode == null ? 0 : maxConcurrentPerNode; this.maxConcurrentTotal = maxConcurrentTotal == null ? 0 : maxConcurrentTotal; this.categories = categories == null ? new CopyOnWriteArrayList<String>() : new CopyOnWriteArrayList<String>(categories); this.throttleEnabled = throttleEnabled; this.throttleOption = throttleOption; this.limitOneJobWithMatchingParams = limitOneJobWithMatchingParams; this.matrixOptions = matrixOptions; this.paramsToUseForLimit = paramsToUseForLimit; if ((this.paramsToUseForLimit != null)) { if ((this.paramsToUseForLimit.length() > 0)) { this.paramsToCompare = Arrays.asList(this.paramsToUseForLimit.split(",")); } else { this.paramsToCompare = new ArrayList<String>(); } } else { this.paramsToCompare = new ArrayList<String>(); <START> } <END> }</code><technical_language>StringUtils.split provides split + null check. ArrayUtils.nullToEmpty converts null empty array. you</technical_language>

Target:
public ThrottleJobProperty(Integer maxConcurrentPerNode, Integer maxConcurrentTotal, List<String> categories, boolean throttleEnabled, String throttleOption, boolean limitOneJobWithMatchingParams, String paramsToUseForLimit, @CheckForNull ThrottleMatrixProjectOptions matrixOptions ) { this.maxConcurrentPerNode = maxConcurrentPerNode == null ? 0 : maxConcurrentPerNode; this.maxConcurrentTotal = maxConcurrentTotal == null ? 0 : maxConcurrentTotal; this.categories = categories == null ? new CopyOnWriteArrayList<String>() : new CopyOnWriteArrayList<String>(categories); this.throttleEnabled = throttleEnabled; this.throttleOption = throttleOption; this.limitOneJobWithMatchingParams = limitOneJobWithMatchingParams; this.matrixOptions = matrixOptions; this.paramsToUseForLimit = paramsToUseForLimit; if ((this.paramsToUseForLimit != null)) { if ((this.paramsToUseForLimit.length() > 0)) { this.paramsToCompare = Arrays.asList(ArrayUtils.nullToEmpty(StringUtils.split(this.paramsToUseForLimit))); } else { this.paramsToCompare = new ArrayList<String>(); } } else { this.paramsToCompare = new ArrayList<String>(); } }
Source:
<code>public List<DMNRuntimeEventListener> getListeners() { List<DMNRuntimeEventListener> results = new ArrayList<>(); if (knowledgeBase != null && knowledgeBase instanceof KnowledgeBaseImpl) { KnowledgeBaseImpl knowledgeBaseImpl = (KnowledgeBaseImpl) knowledgeBase; KieContainerImpl kieContainer = (KieContainerImpl) knowledgeBaseImpl.getKieContainer(); if (kieContainer != null) { KieBaseModelImpl kieBaseModel = (KieBaseModelImpl) kieContainer.getKieProject().getKieBaseModel(knowledgeBase.getId()); <START> for (Entry<String, String> kv : kieBaseModel.getKModule().getConfigurationProperties().entrySet()) { <END> String k = kv.getKey(); if (k != null && k.startsWith(DMNAssemblerService.DMN_RUNTIME_LISTENER_PREFIX)) { if (ClassLoaderUtil.CAN_PLATFORM_CLASSLOAD) { try { DMNRuntimeEventListener runtimeListenerInstance = (DMNRuntimeEventListener) knowledgeBase.getRootClassLoader().loadClass(kv.getValue()).newInstance(); results.add(runtimeListenerInstance); } catch (Exception e) { logger.error("Cannot perform classloading of runtime listener: {}", kv, e); } } else { logger.error("This platform does not support classloading of runtime listener: {}", kv); } } } } } else { logger.warn("No DMNRuntime Listener can be provided, as created without a reference to KnowledgeBase"); } return results; }</code><technical_language>replace this stream API</technical_language>

Target:
public List<DMNRuntimeEventListener> getListeners() { if (knowledgeBase != null && knowledgeBase instanceof KnowledgeBaseImpl && ((KnowledgeBaseImpl) knowledgeBase).getKieContainer() instanceof KieContainerImpl) { KieBaseModelImpl kieBaseModel = (KieBaseModelImpl) ((KieContainerImpl) ((KnowledgeBaseImpl) knowledgeBase).getKieContainer()).getKieProject().getKieBaseModel(knowledgeBase.getId()); return kieBaseModel.getKModule().getConfigurationProperties().entrySet().stream() .filter(kv -> kv.getKey() != null && kv.getKey().startsWith(DMNAssemblerService.DMN_RUNTIME_LISTENER_PREFIX)) .map(Entry::getValue) .map(this::loadEventListener) .flatMap(o -> o.map(Stream::of).orElseGet(Stream::empty)) .collect(Collectors.toList()); } else { logger.warn("No DMNRuntime Listener can be provided, as created without a reference to KnowledgeBase"); } return Collections.emptyList(); }
Source:
<code>private Throwable createException() { Iterator<?> realSequenceIterator = TestSequence.getRealSequence().iterator(); Iterator<?> expectedSequenceIterator = getExpectedSequence().iterator(); int i = 0; while (realSequenceIterator.hasNext() && expectedSequenceIterator.hasNext()){ Object real = realSequenceIterator.next(); Object expected = expectedSequenceIterator.next(); <START> System.out.println(real.toString() + " vs. " + expected.toString()); <END> if (!real.equals(expected)){ return new AssertionFailedError("Expected and real sequence differ at index " + i + ". Expected: " + expected + ", real: " + real); } i++; } if (realSequenceIterator.hasNext()){ return new AssertionFailedError("Real sequence contains more items than the expected one"); } else { return new AssertionFailedError("Expected sequence contains more items than the real one"); } }</code><technical_language>log</technical_language>

Target:
private Throwable createException() { Iterator<?> realSequenceIterator = TestSequence.getRealSequence().iterator(); Iterator<?> expectedSequenceIterator = getExpectedSequence().iterator(); int i = 0; while (realSequenceIterator.hasNext() && expectedSequenceIterator.hasNext()){ Object real = realSequenceIterator.next(); Object expected = expectedSequenceIterator.next(); if (!real.equals(expected)){ return new AssertionFailedError("Expected and real sequence differ at index " + i + ". Expected: " + expected + ", real: " + real); } i++; } if (realSequenceIterator.hasNext()){ return new AssertionFailedError("Real sequence contains more items than the expected one"); } else { return new AssertionFailedError("Expected sequence contains more items than the real one"); } }
Source:
<code>public void handleStepDown( long term, String dbName ) { boolean wasLeaderForTerm = Objects.equals( myself, leaderInfo.memberId() ) && term == leaderInfo.term(); if ( wasLeaderForTerm ) { <START> log.info( String.format( "Step down event detected. This topology member, with MemberId %s, was leader in term %s, now moving " + <END> "to follower.", myself, leaderInfo.term() ) ); HazelcastClusterTopology.casLeaders( hazelcastInstance, leaderInfo.stepDown(), dbName, log); } }</code><technical_language>need String.format</technical_language>

Target:
public void handleStepDown( long term, String dbName ) { boolean wasLeaderForTerm = Objects.equals( myself, leaderInfo.memberId() ) && term == leaderInfo.term(); if ( wasLeaderForTerm ) { log.info( "Step down event detected. This topology member, with MemberId %s, was leader in term %s, now moving " + "to follower.", myself, leaderInfo.term() ); HazelcastClusterTopology.casLeaders( hazelcastInstance, leaderInfo.stepDown(), dbName ); } }
Source:
<code>public void onOpen() { super.onOpen(); <START> filterSettingsManager.defaultActiveFilterInit(filterSettings -> addActiveFilters(filterSettings), <END> filterSettings -> { setFilterSettings(filterSettings, table -> { setupActiveSearchFilters(); addDataDisplay(table); }); }); }</code><technical_language>filter manager handle default filter.... if doesnt exist consider creating it, based default filter apply</technical_language>

Target:
public void onOpen() { super.onOpen(); if (existActiveSearchFilters()) { clearAllActiveFiltersEvent.fire(new ClearAllActiveFiltersEvent()); setFilterSettings(filterSettingsManager.createDefaultFilterSettingsPrototype(), table -> { setupActiveSearchFilters(); addDataDisplay(table); }); } else { filterSettingsManager.defaultActiveFilterInit(filterSettings -> addActiveFilters(filterSettings)); } }
Source:
<code><START> public boolean isArchived() { <END> return getLifecycleFlags().getArchived(); }</code><technical_language>I methods final</technical_language>

Target:
public final boolean isArchived() { return getLifecycleFlags().getArchived(); }
Source:
<code>private void setToCButtonFadedIn(boolean shouldFadeIn) { <START> if (!ApiUtil.hasHoneyComb()) { <END> return; } if (shouldFadeIn && !isToCButtonFadedIn) { Animation anim = AnimationUtils.loadAnimation(getActivity(), R.anim.fade_in_toc); tocButton.startAnimation(anim); isToCButtonFadedIn = true; } else if (!shouldFadeIn && isToCButtonFadedIn) { Animation anim = AnimationUtils.loadAnimation(getActivity(), R.anim.fade_out_toc); tocButton.startAnimation(anim); isToCButtonFadedIn = false; } }</code><technical_language>(!ApiUtil.hasHoneyComb || shouldFadeIn == isTocButtonFadedIn)</technical_language>

Target:
private void setToCButtonFadedIn(boolean shouldFadeIn) { if (!ApiUtil.hasHoneyComb() || shouldFadeIn == isToCButtonFadedIn) { return; } if (shouldFadeIn) { Animation anim = AnimationUtils.loadAnimation(getActivity(), R.anim.fade_in_toc); tocButton.startAnimation(anim); isToCButtonFadedIn = true; } else { Animation anim = AnimationUtils.loadAnimation(getActivity(), R.anim.fade_out_toc); tocButton.startAnimation(anim); isToCButtonFadedIn = false; } }
Source:
<code>public void seekToUs(long positionUs) { lastSeekPositionUs = positionUs; boolean seekInsideBuffer = !isPendingReset() && <START> sampleQueue.skipToKeyframeBefore(positionUs, isWithinLastChunk(positionUs)); <END> if (seekInsideBuffer) { while (mediaChunks.size() > 1 && mediaChunks.get(1).getFirstSampleIndex() <= sampleQueue.getReadIndex()) { mediaChunks.removeFirst(); } } else { pendingResetPositionUs = positionUs; loadingFinished = false; mediaChunks.clear(); if (loader.isLoading()) { loader.cancelLoading(); } else { sampleQueue.reset(true); } } }</code><technical_language>need sophisticated checking position is chunk. sufficient pass positionUs < getNextLoadPositionUs() argument? I passing true harm in cases positionUs is *earlier* chunk. This allows remove isWithinLastChunk getCurrentLoadPosition methods ;)</technical_language>

Target:
public void seekToUs(long positionUs) { lastSeekPositionUs = positionUs; boolean seekInsideBuffer = !isPendingReset() && sampleQueue.skipToKeyframeBefore(positionUs, (positionUs < getNextLoadPositionUs())); if (seekInsideBuffer) { while (mediaChunks.size() > 1 && mediaChunks.get(1).getFirstSampleIndex() <= sampleQueue.getReadIndex()) { mediaChunks.removeFirst(); } } else { pendingResetPositionUs = positionUs; loadingFinished = false; mediaChunks.clear(); if (loader.isLoading()) { loader.cancelLoading(); } else { sampleQueue.reset(true); } } }
Source:
<code>public void sweep(Collection<WriteInfo> unfilteredWrites, Sweeper sweeper) { Collection<WriteInfo> writes = filter.filter(unfilteredWrites); Map<TableReference, Map<Cell, TimestampRangeDelete>> maxTimestampByCell = writesPerTable(writes, sweeper); for (Map.Entry<TableReference, Map<Cell, TimestampRangeDelete>> entry : maxTimestampByCell.entrySet()) { try { Iterables.partition(entry.getValue().keySet(), SweepQueueUtils.BATCH_SIZE_KVS) .forEach(cells -> { Map<Cell, TimestampRangeDelete> maxTimestampByCellPartition = cells.stream() .collect(Collectors.toMap(Function.identity(), entry.getValue()::get)); follower.run(entry.getKey(), maxTimestampByCellPartition.keySet()); if (sweeper.shouldAddSentinels()) { kvs.addGarbageCollectionSentinelValues(entry.getKey(), maxTimestampByCellPartition.keySet()); <START> kvs.deleteAllTimestamps(entry.getKey(), maxTimestampByCellPartition); <END> } else { kvs.deleteAllTimestamps(entry.getKey(), maxTimestampByCellPartition); } }); } catch (Exception e) { if (tableWasDropped(entry.getKey())) { log.info("The table has been deleted.", LoggingArgs.tableRef(entry.getKey()), e); } else { throw e; } } } }</code><technical_language>nit: pull shared call out of if statement</technical_language>

Target:
public void sweep(Collection<WriteInfo> unfilteredWrites, Sweeper sweeper) { Collection<WriteInfo> writes = filter.filter(unfilteredWrites); Map<TableReference, Map<Cell, TimestampRangeDelete>> maxTimestampByCell = writesPerTable(writes, sweeper); for (Map.Entry<TableReference, Map<Cell, TimestampRangeDelete>> entry : maxTimestampByCell.entrySet()) { try { Iterables.partition(entry.getValue().keySet(), SweepQueueUtils.BATCH_SIZE_KVS) .forEach(cells -> { Map<Cell, TimestampRangeDelete> maxTimestampByCellPartition = cells.stream() .collect(Collectors.toMap(Function.identity(), entry.getValue()::get)); follower.run(entry.getKey(), maxTimestampByCellPartition.keySet()); if (sweeper.shouldAddSentinels()) { kvs.addGarbageCollectionSentinelValues(entry.getKey(), maxTimestampByCellPartition.keySet()); } kvs.deleteAllTimestamps(entry.getKey(), maxTimestampByCellPartition); }); } catch (Exception e) { if (tableWasDropped(entry.getKey())) { log.info("The table has been deleted.", LoggingArgs.tableRef(entry.getKey()), e); } else { throw e; } } } }
Source:
<code>public void testInstantiation() { NuxeoMetricSet metrics = new NuxeoMetricSet(); <START> assertEquals(null, metrics.getPrefixName()); <END> assertNotNull(metrics.getMetrics()); assertTrue(metrics.getMetrics().isEmpty()); }</code><technical_language>assertNull</technical_language>

Target:
public void testInstantiation() { NuxeoMetricSet metrics = new NuxeoMetricSet(); assertNull(metrics.getPrefixName()); assertNotNull(metrics.getMetrics()); assertTrue(metrics.getMetrics().isEmpty()); }