auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void sendTo(OutputStream<M> outputStream) { <START> String opId = this.graph.getNextOpId(OpCode.SEND_TO, null); <END> OutputOperatorSpec<M> op = OperatorSpecs.createSendToOperatorSpec((OutputStreamImpl<M>) outputStream, opId); this.operatorSpec.registerNextOperatorSpec(op); }</code><technical_language>Minor: cleaner overload instead of multiple null versions</technical_language>

Target:
public void sendTo(OutputStream<M> outputStream) { String opId = this.graph.getNextOpId(OpCode.SEND_TO); OutputOperatorSpec<M> op = OperatorSpecs.createSendToOperatorSpec((OutputStreamImpl<M>) outputStream, opId); this.operatorSpec.registerNextOperatorSpec(op); }
Source:
<code>public static String toStr(Object o) { if (o instanceof byte[]) { return printArray((byte[]) o, false); <START> } else if (o == null) { <END> return "null"; } else if (o.getClass().isArray()) { int length = Array.getLength(o); if (length == 0) return "[]"; StringBuilder sb = new StringBuilder("[").append(Array.get(o, 0)); for (int i = 1; i < length; ++i) sb.append(", ").append(Array.get(o, i)); return sb.append("]").toString(); } else { return o.toString(); } }</code><technical_language>I mean, Arrays.toString() *cof* *cof* for some reason, I a generic printArray :(</technical_language>

Target:
public static String toStr(Object o) { if (o == null) { return "null"; } else if (o.getClass().isArray()) { if (o.getClass().getComponentType().isPrimitive()) { if (o instanceof byte[]) { return printArray((byte[]) o, false); } else if (o instanceof int[]) { return Arrays.toString((int[]) o); } else if (o instanceof long[]) { return Arrays.toString((long[]) o); } else if (o instanceof short[]) { return Arrays.toString((short[]) o); } else if (o instanceof double[]) { return Arrays.toString((double[]) o); } else if (o instanceof float[]) { return Arrays.toString((float[]) o); } else if (o instanceof char[]) { return Arrays.toString((char[]) o); } else if (o instanceof boolean[]) { return Arrays.toString((boolean[]) o); } } return Arrays.toString((Object[]) o); } else { return o.toString(); } }
Source:
<code>public void should_get_attributes() { final String documentWithAttributes = "= Document Title\n" + ":docattr: docvalue\n" + "\n" + "preamble\n" + "\n" + "== Section A\n" + "\n" + "paragraph\n" + "\n"; Document document = asciidoctor.load(documentWithAttributes, new HashMap<String, Object>()); <START> List<? extends StructuralNode> blocks = document.getBlocks(); <END> Section section = (Section) blocks.get(1); section.setAttribute("testattr", "testvalue", true); assertThat(document.hasAttribute("testattr"), is(false)); assertThat(section.hasAttribute("testattr"), is(true)); assertThat(section.hasAttribute("testattr", true), is(true)); assertThat(section.hasAttribute("testattr", false), is(true)); assertThat(section.isAttribute("testattr", "testvalue"), is(true)); assertThat(section.hasAttribute("docattr", true), is(true)); assertThat(section.hasAttribute("docattr", false), is(false)); }</code><technical_language>Ah ok, worries. I thought this intentional :-)</technical_language>

Target:
public void should_get_attributes() { final String documentWithAttributes = "= Document Title\n" + ":docattr: docvalue\n" + "\n" + "preamble\n" + "\n" + "== Section A\n" + "\n" + "paragraph\n" + "\n"; Document document = asciidoctor.load(documentWithAttributes, new HashMap<String, Object>()); List<StructuralNode> blocks = document.getBlocks(); Section section = (Section) blocks.get(1); section.setAttribute("testattr", "testvalue", true); assertThat(document.hasAttribute("testattr"), is(false)); assertThat(section.hasAttribute("testattr"), is(true)); assertThat(section.hasAttribute("testattr", true), is(true)); assertThat(section.hasAttribute("testattr", false), is(true)); assertThat(section.isAttribute("testattr", "testvalue"), is(true)); assertThat(section.hasAttribute("docattr", true), is(true)); assertThat(section.hasAttribute("docattr", false), is(false)); }
Source:
<code>protected FilterResults performFiltering(CharSequence searchTerm) { mSearchTerm = searchTerm; FilterResults results = new FilterResults(); Locale locale = Locale.getDefault(); if ((searchTerm == null) || (searchTerm.length() == 0)) { List<FolderInfoHolder> list = new ArrayList<FolderInfoHolder>(mFolders); results.values = list; results.count = list.size(); } else { final String searchTermString = searchTerm.toString().toLowerCase(locale); final String[] words = searchTermString.split(" "); final int wordCount = words.length; final List<FolderInfoHolder> newValues = new ArrayList<FolderInfoHolder>(); for (final FolderInfoHolder value : mFolders) { if (value.displayName == null) { continue; } final String valueText = value.displayName.toLowerCase(locale); <START> for (String word : words) { <END> if (valueText.contains(word)) { newValues.add(value); break; } } } results.values = newValues; results.count = newValues.size(); } return results; }</code><technical_language>In this specific case existing code. indexed loop avoids creation of Iterator instance</technical_language>

Target:
protected FilterResults performFiltering(CharSequence searchTerm) { mSearchTerm = searchTerm; FilterResults results = new FilterResults(); Locale locale = Locale.getDefault(); if ((searchTerm == null) || (searchTerm.length() == 0)) { List<FolderInfoHolder> list = new ArrayList<FolderInfoHolder>(mFolders); results.values = list; results.count = list.size(); } else { final String searchTermString = searchTerm.toString().toLowerCase(locale); final String[] words = searchTermString.split(" "); final int wordCount = words.length; final List<FolderInfoHolder> newValues = new ArrayList<FolderInfoHolder>(); for (final FolderInfoHolder value : mFolders) { if (value.displayName == null) { continue; } final String valueText = value.displayName.toLowerCase(locale); for (int k = 0; k < wordCount; k++) { if (valueText.contains(words[k])) { newValues.add(value); break; } } } results.values = newValues; results.count = newValues.size(); } return results; }
Source:
<code>public void warnMemorySizeLegal(VmBase vm, Version clusterVersion) { if (! VmValidationUtils.isMemorySizeLegal(vm.getOsId(), vm.getMemSizeMb(), clusterVersion)) { AuditLogableBase logable = new AuditLogableBase(); <START> logable.setVmId(vm.getId()); <END> logable.addCustomValue("VmName", vm.getName()); logable.addCustomValue("VmMemInMb", String.valueOf(vm.getMemSizeMb())); logable.addCustomValue("VmMinMemInMb", String.valueOf(VmValidationUtils.getMinMemorySizeInMb(vm.getOsId(), clusterVersion))); logable.addCustomValue("VmMaxMemInMb", String.valueOf(VmValidationUtils.getMaxMemorySizeInMb(vm.getOsId(), clusterVersion))); auditLogDirector.log(logable, AuditLogType.VM_MEMORY_NOT_IN_RECOMMENDED_RANGE); } }</code><technical_language>This line removed then, vm-id anymore query for vm's name</technical_language>

Target:
public void warnMemorySizeLegal(VmBase vm, Version clusterVersion) { if (! VmValidationUtils.isMemorySizeLegal(vm.getOsId(), vm.getMemSizeMb(), clusterVersion)) { AuditLogableBase logable = new AuditLogableBase(); logable.addCustomValue("VmName", vm.getName()); logable.addCustomValue("VmMemInMb", String.valueOf(vm.getMemSizeMb())); logable.addCustomValue("VmMinMemInMb", String.valueOf(VmValidationUtils.getMinMemorySizeInMb(vm.getOsId(), clusterVersion))); logable.addCustomValue("VmMaxMemInMb", String.valueOf(VmValidationUtils.getMaxMemorySizeInMb(vm.getOsId(), clusterVersion))); auditLogDirector.log(logable, AuditLogType.VM_MEMORY_NOT_IN_RECOMMENDED_RANGE); } }
Source:
<code>public NoCRSPanel(String id, final IModel<ImportTask> model) { super(id, model); Form form = new Form("form"); add(form); form.add(new CRSPanel("crs", new SRSToCRSModel(new PropertyModel(model, "layer.resource.sRS"))) { @Override protected CoordinateReferenceSystem fromSRS(String srs) { try { return CRS.decode(srs); } catch(Exception e) { error(e); return null; } } }); form.add(new AjaxSubmitLink("apply") { @Override protected void onError(AjaxRequestTarget target, Form<?> form) { target.add(feedbackPanel); } @Override protected void onSubmit(AjaxRequestTarget target, Form<?> form) { target.add(feedbackPanel); ImportTask item = model.getObject(); try { ImporterWebUtils.importer().changed(item); } catch (IOException e) { <START> throw new RuntimeException(e); <END> } target.add(ImportTaskTable.this); onItemFixed(item, target); } }); }</code><technical_language>I arbitrary RuntimeException thrown</technical_language>

Target:
public NoCRSPanel(String id, final IModel<ImportTask> model) { super(id, model); Form form = new Form("form"); add(form); form.add(new CRSPanel("crs", new SRSToCRSModel(new PropertyModel(model, "layer.resource.sRS"))) { @Override protected CoordinateReferenceSystem fromSRS(String srs) { try { return CRS.decode(srs); } catch(Exception e) { error(e); return null; } } }); form.add(new AjaxSubmitLink("apply") { @Override protected void onError(AjaxRequestTarget target, Form<?> form) { target.add(feedbackPanel); } @Override protected void onSubmit(AjaxRequestTarget target, Form<?> form) { target.add(feedbackPanel); ImportTask item = model.getObject(); try { ImporterWebUtils.importer().changed(item); } catch (IOException e) { error(e); } target.add(ImportTaskTable.this); onItemFixed(item, target); } }); }
Source:
<code>public CRAMIterator(final SeekableStream seekableStream, final CRAMReferenceSource referenceSource, final long[] coordinates, final ValidationStringency validationStringency) throws IOException { if (null == referenceSource) { throw new CRAMException("A reference source is required for CRAM files"); } this.countingInputStream = new CountingInputStream(seekableStream); this.referenceSource = referenceSource; this.validationStringency = validationStringency; final CramSpanContainerIterator containerIterator = CramSpanContainerIterator.fromFileSpan(seekableStream, coordinates); cramHeader = containerIterator.getCramHeader(); this.containerIterator = containerIterator; firstContainerOffset = containerIterator.getFirstContainerOffset(); <START> records = new ArrayList<SAMRecord>(); <END> normalizer = new CramNormalizer(cramHeader.getSamFileHeader(), referenceSource); parser = new ContainerParser(cramHeader.getSamFileHeader()); }</code><technical_language>records expected in container? This some performance effect, I understand is explanation for magic number. extracted default constant class level argument iterator</technical_language>

Target:
public CRAMIterator(final SeekableStream seekableStream, final CRAMReferenceSource referenceSource, final long[] coordinates, final ValidationStringency validationStringency) throws IOException { if (null == referenceSource) { throw new CRAMException("A reference source is required for CRAM files"); } this.countingInputStream = new CountingInputStream(seekableStream); this.referenceSource = referenceSource; this.validationStringency = validationStringency; final CramSpanContainerIterator containerIterator = CramSpanContainerIterator.fromFileSpan(seekableStream, coordinates); cramHeader = containerIterator.getCramHeader(); this.containerIterator = containerIterator; firstContainerOffset = containerIterator.getFirstContainerOffset(); records = new ArrayList<SAMRecord>(CRAMContainerStreamWriter.DEFAULT_RECORDS_PER_SLICE); normalizer = new CramNormalizer(cramHeader.getSamFileHeader(), referenceSource); parser = new ContainerParser(cramHeader.getSamFileHeader()); }
Source:
<code>public static String getFingerPrint(Digest d, PublicKey key) throws Exception { if (key == null) { return null; } Buffer buffer = new ByteArrayBuffer(); buffer.putRawPublicKey(key); d.init(); d.update(buffer.array(), 0, buffer.wpos()); byte[] data = d.digest(); if ("MD5".equals(d.getAlgorithm())) { return "MD5:" + BufferUtils.printHex(':', data); } else { return d.getAlgorithm().replace("-", "").toUpperCase() + ":" + Base64.encodeToString(data).replaceAll("=", ""); } <START> } <END></code><technical_language>I recommend (D.R.Y ...): java String algo = d.getAlgorithm(); if (BuiltinDigests.md5.getAlgorithm().equals(algo)) { return algo + ":" + BufferUtils.printHex(':', data); } else { return algo.replace("-", "").toUpperCase() + ":" + Base64.encodeToString(data).replaceAll("=", ""); }</technical_language>

Target:
public static String getFingerPrint(Digest d, PublicKey key) throws Exception { if (key == null) { return null; } Buffer buffer = new ByteArrayBuffer(); buffer.putRawPublicKey(key); d.init(); d.update(buffer.array(), 0, buffer.wpos()); byte[] data = d.digest(); String algo = d.getAlgorithm(); if (BuiltinDigests.md5.getAlgorithm().equals(algo)) { return algo + ":" + BufferUtils.printHex(':', data); } else { return algo.replace("-", "").toUpperCase() + ":" + Base64.encodeToString(data).replaceAll("=", ""); } }
Source:
<code>public static Either<Exception, DMNImportPMMLInfo> from(InputStream is, DMNModelImpl model, Import i) { try { PMML pmml = org.jpmml.model.PMMLUtil.unmarshal(is); Map<String, String> headerExtensions = new HashMap<>(); for (Extension ex : pmml.getHeader().getExtensions()) { headerExtensions.put(ex.getName(), ex.getValue()); } PMMLHeaderInfo h = new PMMLHeaderInfo("<LINK_0>" + pmml.getBaseVersion().replace(".", "_"), headerExtensions); List<DMNPMMLModelInfo> models = new ArrayList<>(); for (Model pm : pmml.getModels()) { MiningSchema miningSchema = pm.getMiningSchema(); Map<String, DMNType> inputFields = new HashMap<>(); miningSchema.getMiningFields() .stream() .filter(mf -> mf.getUsageType() == UsageType.ACTIVE) .forEach(fn -> inputFields.put(fn.getName().getValue(), model.getTypeRegistry().unknown())); Collection<String> outputFields = new ArrayList<>(); pm.getOutput().getOutputFields().forEach(of -> outputFields.add(of.getName().getValue())); models.add(new DMNPMMLModelInfo(pm.getModelName(), inputFields, outputFields)); } DataDictionary dd = pmml.getDataDictionary(); for (DataField df : dd.getDataFields()) { BuiltInType baseFeelType = BuiltInType.UNKNOWN; switch (df.getDataType()) { case BOOLEAN: baseFeelType = BuiltInType.BOOLEAN; break; case DOUBLE: case FLOAT: case INTEGER: baseFeelType = BuiltInType.NUMBER; break; case STRING: baseFeelType = BuiltInType.STRING; break; default: LOG.warn("{}", df.getDataType()); break; } <START> if (df.getOpType() == OpType.CATEGORICAL) { <END> } } DMNImportPMMLInfo info = new DMNImportPMMLInfo(i, models, h); return Either.ofRight(info); } catch (Throwable e) { return Either.ofLeft(new Exception(e)); } }</code><technical_language>Empty if condition here. Please remove add code it</technical_language>

Target:
public static Either<Exception, DMNImportPMMLInfo> from(InputStream is, DMNModelImpl model, Import i) { try { PMMLInfo<?> prototype = PMMLInfo.from(is); PMMLHeaderInfo h = prototype.getHeader(); List<DMNPMMLModelInfo> models = prototype.getModels().stream().map(proto -> DMNPMMLModelInfo.from(proto, model)).collect(Collectors.toList()); DMNImportPMMLInfo info = new DMNImportPMMLInfo(i, models, h); return Either.ofRight(info); } catch (Throwable e) { return Either.ofLeft(new Exception(e)); } }
Source:
<code>public void onStartup(final Set<Class<?>> c, final ServletContext servletContext) throws ServletException { <START> ServerConfiguration configuration = ConfigurationFileLoader.loadConfiguration(); <END> PlatformBootstrap bootstrap = new PlatformBootstrap(); bootstrap.init(servletContext, configuration); }</code><technical_language>Add final keyword</technical_language>

Target:
public void onStartup(final Set<Class<?>> c, final ServletContext servletContext) throws ServletException { final ServerConfiguration configuration = ConfigurationFileLoader.loadConfiguration(); final PlatformBootstrap bootstrap = new PlatformBootstrap(); bootstrap.init(servletContext, configuration); }
Source:
<code>public String encode(String plainText) { String copy = plainText; StringBuilder ciphertext = new StringBuilder(plainText.length()); while (copy.length() > 0) { for (int i = 0; i < Math.min(copy.length(), key.length()); i++) { ciphertext.append(encodeCharacter(copy, i)); } <START> copy = plainText.substring(ciphertext.length(), plainText.length()); <END> } return ciphertext.toString(); }</code><technical_language>this instead of for loop</technical_language>

Target:
public String encode(String plainText) { StringBuilder ciphertext = new StringBuilder(plainText.length()); String sameLengthKey = getSufficientlyLongKeyForPlaintext(plainText, key); for (int index = 0; index < plainText.length(); index++) { ciphertext.append(encodeCharacter(plainText, index, sameLengthKey)); } return ciphertext.toString(); }
Source:
<code>public byte[] call(final byte[] memento) throws Exception { LOG.log(Level.INFO, "{0} starting...", taskId); memoryStoreInitializer.initialize(); trainer.initialize(); synchronizer.globalBarrier(); workerClock.initialize(); for (int epoch = 0; epoch < maxEpochs; ++epoch) { if (aborted) { LOG.log(Level.INFO, "Abort a thread to completely close the task"); workerClock.recordClockNetworkWaitingTime(); return null; } if (workerClock.getWorkerClock() > maxEpochs * numMiniBatchPerEpoch) { break; } trainingDataDivider.onEpochStart(); trainer.onEpochStart(epoch); for (int minibatch = 0; minibatch < numMiniBatchPerEpoch; minibatch++) { if (workerClock.getWorkerClock() > maxEpochs * numMiniBatchPerEpoch) { break; } <START> trainer.run(minibatch); <END> miniBatchParameterWorker.onMiniBatchEnd(); trainingDataDivider.onMiniBatchEnd(); workerClock.clock(); } trainer.onEpochEnd(epoch); } synchronizer.globalBarrier(); trainer.cleanup(); workerClock.recordClockNetworkWaitingTime(); return null; }</code><technical_language>style? Trainer need know/use TrainingDataDivider. final Iterator<DataSplit> splitItr = trainingDataDivider.getTrainingDataSplits(); for (splitItr.hasNext() { trainer.run(splitItr.next()); // other stuffs for wrapping a batch )</technical_language>

Target:
public byte[] call(final byte[] memento) throws Exception { LOG.log(Level.INFO, "{0} starting...", taskId); trainingDataInitializer.initialize(); trainer.initialize(); workerClock.initialize(); synchronizer.globalBarrier(); int currentEpoch = workerClock.getWorkerClock(); final int maxIterationCount = maxEpochs * numMiniBatchPerEpoch; final int initialIteration = currentEpoch * numMiniBatchPerEpoch; for (int iteration = initialIteration; iteration < maxIterationCount; ++iteration) { if (aborted) { LOG.log(Level.INFO, "Abort a thread to completely close the task"); workerClock.recordClockNetworkWaitingTime(); return null; } final boolean isEpochStart = iteration % numMiniBatchPerEpoch == 0; if (isEpochStart) { trainingDataSplitter.prepareSplitsForEpoch(); trainer.initEpochVariables(currentEpoch); } trainer.run(); miniBatchParameterWorker.flushLocalUpdates(); final boolean isEpochEnd = (iteration + 1) % numMiniBatchPerEpoch == 0; if (isEpochEnd) { trainer.wrapUpEpochVariables(currentEpoch); workerClock.clock(); currentEpoch++; } } synchronizer.globalBarrier(); trainer.cleanup(); workerClock.recordClockNetworkWaitingTime(); return null; }
Source:
<code>public MapSqlParameterMapper<GlusterServerService> getBatchMapper() { <START> throw new RuntimeException("Unsupported operation"); <END> }</code><technical_language>please NotImplementedException()</technical_language>

Target:
public MapSqlParameterMapper<GlusterServerService> getBatchMapper() { throw new NotImplementedException("Unsupported operation"); }
Source:
<code>public boolean isPageComplete() { boolean isComplete = true; <START> String name = helper.getDefaultTableName(); <END> String type = helper.getTableType(); String errorMessage = null; StringBuffer buffer = new StringBuffer(); if (name.isEmpty()) { buffer.append(Messages.EditGenericNattableConfigurationFieldsNattableWizardPage_nameMustBeSetError); } if (type.isEmpty()) { buffer.append(Messages.EditGenericNattableConfigurationFieldsNattableWizardPage_typeMustBeSetError); } errorMessage = buffer.toString(); if (errorMessage.isEmpty()) { setErrorMessage(null); } else { setErrorMessage(errorMessage.toString()); } isComplete = !name.isEmpty() && !type.isEmpty(); return isComplete; }</code><technical_language>final</technical_language>

Target:
public boolean isPageComplete() { boolean isComplete = true; final String name = helper.getDefaultTableName(); final String type = helper.getTableType(); String errorMessage = null; StringBuffer buffer = new StringBuffer(); if (name.isEmpty()) { buffer.append(Messages.EditGenericNattableConfigurationFieldsNattableWizardPage_nameMustBeSetError); } if (type.isEmpty()) { buffer.append(Messages.EditGenericNattableConfigurationFieldsNattableWizardPage_typeMustBeSetError); } errorMessage = buffer.toString(); if (errorMessage.isEmpty()) { setErrorMessage(null); } else { setErrorMessage(errorMessage.toString()); } isComplete = !name.isEmpty() && !type.isEmpty(); return isComplete; }
Source:
<code>public void next(T value) { if (!terminated) { list.addLast(enterTransform.call(nl.next(value))); evictionPolicy.evict(list); <START> TAIL_UPDATER.lazySet(this, list.tail); <END> } }</code><technical_language>Again, is this safe do? tail() method want consistent reads this</technical_language>

Target:
public void next(T value) { if (!terminated) { list.addLast(enterTransform.call(nl.next(value))); evictionPolicy.evict(list); tail = list.tail; } }
Source:
<code>protected void executeCommand() { if (!moveParametersList.isEmpty()) { vdcReturnValues.addAll(Backend.getInstance().RunMultipleActions(VdcActionType.MoveOrCopyDisk, <START> new ArrayList<VdcActionParametersBase>(getMoveDisksParametersList()), false)); <END> } if (!vmsLiveMigrateParametersMap.isEmpty()) { vdcReturnValues.addAll(Backend.getInstance().RunMultipleActions(VdcActionType.LiveMigrateVmDisks, new ArrayList<VdcActionParametersBase>(getLiveMigrateDisksParametersList()), false)); } handleChildReturnValue(); setSucceeded(true); }</code><technical_language>1. do need create new arraylist here? 2. do need getter? this member is accessed internally only.</technical_language>

Target:
protected void executeCommand() { if (!moveParametersList.isEmpty()) { vdcReturnValues.addAll(Backend.getInstance().RunMultipleActions(VdcActionType.MoveOrCopyDisk, getMoveDisksParametersList(), false)); } if (!vmsLiveMigrateParametersList.isEmpty()) { vdcReturnValues.addAll(Backend.getInstance().RunMultipleActions(VdcActionType.LiveMigrateVmDisks, getLiveMigrateDisksParametersList(), false)); } handleChildReturnValue(); setSucceeded(true); }
Source:
<code><START> public static String parseGitHubReference(String gitReference) { <END> Pattern pattern = Pattern.compile("^refs/(tags|heads)/([a-zA-Z0-9]+([./_-]?[a-zA-Z0-9]+)*)$"); Matcher matcher = pattern.matcher(gitReference); if (!matcher.find()) { String msg = "Reference " + gitReference + " is not of the valid form"; LOG.error(msg); throw new CustomWebApplicationException(msg, LAMBDA_FAILURE); } String gitBranchName = matcher.group(2); return gitBranchName; }</code><technical_language>I this return Optional<String>, caller responsible for throwing exception. odd lambda exception thrown a method parses a string</technical_language>

Target:
public static Optional<String> parseGitHubReference(String gitReference) { Pattern pattern = Pattern.compile("^refs/(tags|heads)/([a-zA-Z0-9]+([./_-]?[a-zA-Z0-9]+)*)$"); Matcher matcher = pattern.matcher(gitReference); if (!matcher.find()) { return Optional.empty(); } String gitBranchName = matcher.group(2); return Optional.of(gitBranchName); }
Source:
<code><START> public static ImageFigureWithAlpha createImageFigure(final ContainerStyle containerStyle) { <END> if (containerStyle instanceof FlatContainerStyle) { FlatContainerStyle style = (FlatContainerStyle) containerStyle; SVGWorkspaceImageFigure fig = new SVGWorkspaceImageFigure(); fig.refreshFigure(style); return fig; } return null; }</code><technical_language>I find call for this method. change this</technical_language>

Target:
public static SVGWorkspaceImageFigure createImageFigure(final ContainerStyle containerStyle) { if (containerStyle instanceof FlatContainerStyle) { FlatContainerStyle style = (FlatContainerStyle) containerStyle; SVGWorkspaceImageFigure fig = new SVGWorkspaceImageFigure(); fig.refreshFigure(style); return fig; } return null; }
Source:
<code>void handleQuery(@Nonnull RequestMsg req, @Nonnull ChannelHandlerContext ctx, @Nonnull IServerRouter r) { final UUID workflowId = getUUID(req.getPayload().getOrchestratorRequest().getQuery().getWorkflowId()); boolean isActive = false; <START> if (activeWorkflows.containsKey(workflowId)) isActive = true; <END> log.trace("handleQuery[{}]: isActive={} for workflowId={}", req.getHeader().getRequestId(), isActive, workflowId); HeaderMsg responseHeader = getHeaderMsg(req.getHeader(), false, true); ResponseMsg response = getResponseMsg(responseHeader, getQueriedWorkflowResponseMsg(isActive)); r.sendResponse(response, ctx); }</code><technical_language>Danger. curly braces. <LINK_0></technical_language>

Target:
void handleQuery(@Nonnull RequestMsg req, @Nonnull ChannelHandlerContext ctx, @Nonnull IServerRouter r) { final UUID workflowId = getUUID(req.getPayload().getOrchestratorRequest().getQuery().getWorkflowId()); boolean isActive = false; if (activeWorkflows.containsKey(workflowId)) { isActive = true; } log.trace("handleQuery[{}]: isActive={} for workflowId={}", req.getHeader().getRequestId(), isActive, workflowId); HeaderMsg responseHeader = getHeaderMsg(req.getHeader(), false, true); ResponseMsg response = getResponseMsg(responseHeader, getQueriedWorkflowResponseMsg(isActive)); r.sendResponse(response, ctx); }
Source:
<code>public void fetchAllDocuments(final KuzzleOptions options, @NonNull final KuzzleResponseListener<KuzzleDocumentList> listener) { if (listener == null) { throw new IllegalArgumentException("KuzzleDataCollection.fetchAllDocuments: listener required"); } <START> this.advancedSearch(new JSONObject(), options, listener); <END> }</code><technical_language>advancedSearch removed in another PR</technical_language>

Target:
public void fetchAllDocuments(final KuzzleOptions options, @NonNull final KuzzleResponseListener<KuzzleDocumentList> listener) { if (listener == null) { throw new IllegalArgumentException("KuzzleDataCollection.fetchAllDocuments: listener required"); } this.search(new JSONObject(), options, listener); }
Source:
<code>public void onMessage(org.springframework.amqp.core.Message amqpMessage, Channel channel) throws Exception { Message<?> message = toMessagingMessage(amqpMessage); if (logger.isDebugEnabled()) { logger.debug("Processing [" + message + "]"); } InvocationResult result = null; try { result = invokeHandler(amqpMessage, channel, message); if (result.getReturnValue() != null) { handleResult(result, amqpMessage, channel, message); } else { logger.trace("No result object given - no result to handle"); } } catch (ListenerExecutionFailedException e) { if (this.errorHandler != null) { try { message = MessageBuilder.fromMessage(message) .setHeader(AmqpHeaders.CHANNEL, channel) .build(); Object errorResult = this.errorHandler.handleError(amqpMessage, message, e); if (errorResult != null) { handleResult(new InvocationResult(errorResult, <START> this.handlerAdapter.getSendToForPayload(message.getPayload()), null), <END> amqpMessage, channel, message); } else { logger.trace("Error handler returned no result"); } } catch (Exception ex) { returnOrThrow(amqpMessage, channel, message, ex, ex); } } else { returnOrThrow(amqpMessage, channel, message, e.getCause(), e); } } }</code><technical_language>Type send is null. Do work POJOs, If type is send</technical_language>

Target:
public void onMessage(org.springframework.amqp.core.Message amqpMessage, Channel channel) throws Exception { Message<?> message = toMessagingMessage(amqpMessage); if (logger.isDebugEnabled()) { logger.debug("Processing [" + message + "]"); } InvocationResult result = null; try { result = invokeHandler(amqpMessage, channel, message); if (result.getReturnValue() != null) { handleResult(result, amqpMessage, channel, message); } else { logger.trace("No result object given - no result to handle"); } } catch (ListenerExecutionFailedException e) { if (this.errorHandler != null) { try { message = MessageBuilder.fromMessage(message) .setHeader(AmqpHeaders.CHANNEL, channel) .build(); Object errorResult = this.errorHandler.handleError(amqpMessage, message, e); if (errorResult != null) { handleResult(this.handlerAdapter.getInvocationResultFor(errorResult, message.getPayload()), amqpMessage, channel, message); } else { logger.trace("Error handler returned no result"); } } catch (Exception ex) { returnOrThrow(amqpMessage, channel, message, ex, ex); } } else { returnOrThrow(amqpMessage, channel, message, e.getCause(), e); } } }
Source:
<code>public BlobStatus getStatus(ManagedBlob blob) throws IOException { String key = stripBlobKeyPrefix(blob.getKey()); String objectKey; String versionId; int seppos = key.indexOf(VER_SEP); if (seppos < 0) { objectKey = key; versionId = null; } else { objectKey = key.substring(0, seppos); versionId = key.substring(seppos + 1); } String bucketKey = config.bucketPrefix + objectKey; GetObjectMetadataRequest request = new GetObjectMetadataRequest(config.bucketName, bucketKey); <START> request.setVersionId(versionId); <END> ObjectMetadata metadata; try { metadata = config.amazonS3.getObjectMetadata(request); } catch (AmazonServiceException e) { if (S3BlobStore.isMissingKey(e)) { log.error("Failed to get information on blob: " + key, e); return new BlobStatus(); } throw e; } String storageClass = defaultIfEmpty(metadata.getStorageClass(), StorageClass.Standard.toString()); Boolean ongoingRestore = metadata.getOngoingRestore(); boolean downloadable = !TRUE.equals(ongoingRestore); Date date = metadata.getRestoreExpirationTime(); Instant downloadableUntil = date == null ? null : date.toInstant(); return new BlobStatus().withStorageClass(storageClass) .withDownloadable(downloadable) .withDownloadableUntil(downloadableUntil); }</code><technical_language>constructor args ( public GetObjectMetadataRequest(String bucketName, String key, String versionId)</technical_language>

Target:
public BlobStatus getStatus(ManagedBlob blob) throws IOException { String key = stripBlobKeyPrefix(blob.getKey()); String objectKey; String versionId; int seppos = key.indexOf(VER_SEP); if (seppos < 0) { objectKey = key; versionId = null; } else { objectKey = key.substring(0, seppos); versionId = key.substring(seppos + 1); } String bucketKey = config.bucketPrefix + objectKey; GetObjectMetadataRequest request = new GetObjectMetadataRequest(config.bucketName, bucketKey, versionId); ObjectMetadata metadata; try { metadata = config.amazonS3.getObjectMetadata(request); } catch (AmazonServiceException e) { if (S3BlobStore.isMissingKey(e)) { log.error("Failed to get information on blob: {}", key, e); return new BlobStatus().withDownloadable(false); } throw new IOException(e); } String storageClass = metadata.getStorageClass(); if (StorageClass.Standard.toString().equals(storageClass)) { storageClass = null; } Boolean ongoingRestore = metadata.getOngoingRestore(); boolean downloadable = !TRUE.equals(ongoingRestore); Date date = metadata.getRestoreExpirationTime(); Instant downloadableUntil = date == null ? null : date.toInstant(); return new BlobStatus().withStorageClass(storageClass) .withDownloadable(downloadable) .withDownloadableUntil(downloadableUntil); }
Source:
<code>private static ImmutableList<Entry<Cell, byte[]>> mergeInLocalWrites( Iterator<Entry<Cell, byte[]>> postFilterIterator, Iterator<Entry<Cell, byte[]>> localWritesInRange, <START> boolean isReverse) { <END> Ordering<Entry<Cell, byte[]>> ordering = Ordering.natural().onResultOf(MapEntries.getKeyFunction()); ImmutableList<Entry<Cell, byte[]>> mergedList = ImmutableList.copyOf(IteratorUtils.mergeIterators( postFilterIterator, localWritesInRange, isReverse ? ordering.reverse() : ordering, from -> from.rhSide)); ImmutableList<Entry<Cell, byte[]>> mergedListWithoutEmptyValues = ImmutableList.copyOf(Iterators.filter( mergedList.iterator(), Predicates.compose(Predicates.not(Value.IS_EMPTY), MapEntries.getValueFunction()))); getEmptyValuesCountMeter().mark(mergedList.size() - mergedListWithoutEmptyValues.size()); return mergedListWithoutEmptyValues; }</code><technical_language>super concerned collecting empty values memory, unnecessary list allocation copy here. alternative do like: Iterator merged = create merged iterator List list = new list while (merged next) { if next is empty increment empty count else add list } return list</technical_language>

Target:
private static List<Entry<Cell, byte[]>> mergeInLocalWrites( Iterator<Entry<Cell, byte[]>> postFilterIterator, Iterator<Entry<Cell, byte[]>> localWritesInRange, boolean isReverse) { Ordering<Entry<Cell, byte[]>> ordering = Ordering.natural().onResultOf(MapEntries.getKeyFunction()); Iterator<Entry<Cell, byte[]>> mergeIterators = IteratorUtils.mergeIterators( postFilterIterator, localWritesInRange, isReverse ? ordering.reverse() : ordering, from -> from.rhSide); return postFilterEmptyValues(mergeIterators); }
Source:
<code>public void updateExtentsOnBlockItemBoxShape(OnAddedComponent event, EntityRef itemEntity, BlockItemComponent blockItemComponent, BoxShapeComponent boxShapeComponent) { BlockFamily blockFamily = blockItemComponent.blockFamily; if (blockFamily == null) { LOGGER.warn("Prefab " + itemEntity.getParentPrefab().getName() + " does not have a block family"); return; } if (blockFamily.getArchetypeBlock().getCollisionShape() instanceof BoxShape) { <START> Vector3f extents = ((BoxShape) blockFamily.getArchetypeBlock().getCollisionShape()).getHalfExtentsWithoutMargin(new Vector3f()); <END> extents.scale(2.0f); extents.x = Math.max(extents.x, 0.5f); extents.y = Math.max(extents.y, 0.5f); extents.z = Math.max(extents.z, 0.5f); boxShapeComponent.extents.set(extents); itemEntity.saveComponent(boxShapeComponent); } }</code><technical_language>break this line in two: line get collision shape, other get extents</technical_language>

Target:
public void updateExtentsOnBlockItemBoxShape(OnAddedComponent event, EntityRef itemEntity, BlockItemComponent blockItemComponent, BoxShapeComponent boxShapeComponent) { BlockFamily blockFamily = blockItemComponent.blockFamily; if (blockFamily == null) { LOGGER.warn("Prefab " + itemEntity.getParentPrefab().getName() + " does not have a block family"); return; } if (blockFamily.getArchetypeBlock().getCollisionShape() instanceof BoxShape) { BoxShape collisionShape = (BoxShape) blockFamily.getArchetypeBlock().getCollisionShape(); Vector3f extents = collisionShape.getHalfExtentsWithoutMargin(); extents.scale(2.0f); extents.x = Math.max(extents.x, 0.5f); extents.y = Math.max(extents.y, 0.5f); extents.z = Math.max(extents.z, 0.5f); boxShapeComponent.extents.set(extents); itemEntity.saveComponent(boxShapeComponent); } }
Source:
<code>private void startMiniAccumulo() { try { MiniAccumuloConfig cfg = new MiniAccumuloConfig(new File(config.getMiniDataDir()), PASSWORD); cluster = new MiniAccumuloCluster(cfg); cluster.start(); log.info("Started MiniAccumulo(accumulo="+cluster.getInstanceName()+" zk="+cluster.getZooKeepers()+")"); <START> config.setAccumuloInstance(cluster.getInstanceName()); <END> config.setAccumuloUser(USER); config.setAccumuloPassword(PASSWORD); config.setAccumuloZookeepers(cluster.getZooKeepers()); config.setZookeepers(cluster.getZooKeepers()+"/fluo"); if ((config.containsKey(FluoConfiguration.ADMIN_ACCUMULO_TABLE_PROP) == false) || config.getAccumuloTable().trim().isEmpty()) { config.setAccumuloTable("fluo"); } FluoFactory.newAdmin(config).initialize(); log.info("Initialized Fluo for MiniAccumulo"); } catch (Exception e) { throw new RuntimeException(e); } }</code><technical_language>exception thrown if accumulo props set? I 100% this. I of situation annoying.... I of situations mini fluo accumulo instance I expected</technical_language>

Target:
private void startMiniAccumulo() { try { MiniAccumuloConfig cfg = new MiniAccumuloConfig(new File(config.getMiniDataDir()), PASSWORD); cluster = new MiniAccumuloCluster(cfg); cluster.start(); log.debug("Started MiniAccumulo(accumulo="+cluster.getInstanceName()+" zk="+cluster.getZooKeepers()+")"); config.setAccumuloInstance(cluster.getInstanceName()); config.setAccumuloUser(USER); config.setAccumuloPassword(PASSWORD); config.setAccumuloZookeepers(cluster.getZooKeepers()); config.setZookeepers(cluster.getZooKeepers()+"/fluo"); if ((config.containsKey(FluoConfiguration.ADMIN_ACCUMULO_TABLE_PROP) == false) || config.getAccumuloTable().trim().isEmpty()) { config.setAccumuloTable("fluo"); } FluoFactory.newAdmin(config).initialize(); File miniProps = new File(config.getMiniDataDir()+"/client.properties"); PropertiesConfiguration connConfig = new PropertiesConfiguration(); connConfig.append(config.getClientConfiguration()); connConfig.save(miniProps); log.debug("Wrote MiniFluo client properties to {}", miniProps.getAbsolutePath()); } catch (Exception e) { throw new RuntimeException(e); } }
Source:
<code><START> public static Repo repo() { <END> final String key = System.getProperty("failsafe.github.key"); Assume.assumeThat(key, Matchers.notNullValue()); final String keyrepo = System.getProperty("failsafe.github.repo"); Assume.assumeThat(keyrepo, Matchers.notNullValue()); return new RtGithub(key).repos().get(new Coordinates.Simple(keyrepo)); }</code><technical_language>This method private in visibility</technical_language>

Target:
private static Repo repo() { final String key = System.getProperty("failsafe.github.key"); Assume.assumeThat(key, Matchers.notNullValue()); final String keyrepo = System.getProperty("failsafe.github.repo"); Assume.assumeThat(keyrepo, Matchers.notNullValue()); return new RtGithub(key).repos().get(new Coordinates.Simple(keyrepo)); }
Source:
<code>private Values<String> resolveValue(final String stringValue) { if (stringValue != null && !stringValue.isEmpty()) { if (conditionColumn.getOperator() != null && (conditionColumn.getOperator() .equals("in") || conditionColumn.getOperator() <START> .equals("not in"))) { <END> final Values values = new Values(); for (final String item : stringValue.split(",")) { values.add(item.trim()); } return values; } else { return new Values<>(stringValue); } } else { return new Values<>(); } }</code><technical_language>please this %% || condition a lline method self-explaining name code more readable</technical_language>

Target:
private Values<String> resolveValue(final String stringValue) { if (stringValue != null && !stringValue.isEmpty()) { if (conditionColumn.getOperator() != null && isOperatorForList()) { final Values values = new Values(); for (final String item : stringValue.split(",")) { values.add(item.trim()); } return values; } else { return new Values<>(stringValue); } } else { return new Values<>(); } }
Source:
<code>private void verifyServiceOfferingByUuid(String offeringUuid) { logger.debug("Verifying router service offering with uuid : " + offeringUuid); ServiceOfferingVO serviceOffering = serviceOfferingDao.findByUuid(offeringUuid); if (serviceOffering != null && serviceOffering.isSystemUse()) { boolean isLocalStorage = ConfigurationManagerImpl.SystemVMUseLocalStorage.valueIn(dest.getDataCenter().getId()); if (isLocalStorage == serviceOffering.isUseLocalStorage()) { <START> logger.debug("service offering " + serviceOffering.getId() + " will be used on virtual router"); <END> serviceOfferingId = serviceOffering.getId(); } } }</code><technical_language>offeringUuid id in log message. LGTM</technical_language>

Target:
private void verifyServiceOfferingByUuid(String offeringUuid) { logger.debug("Verifying router service offering with uuid : " + offeringUuid); ServiceOfferingVO serviceOffering = serviceOfferingDao.findByUuid(offeringUuid); if (serviceOffering != null && serviceOffering.isSystemUse()) { boolean isLocalStorage = ConfigurationManagerImpl.SystemVMUseLocalStorage.valueIn(dest.getDataCenter().getId()); if (isLocalStorage == serviceOffering.isUseLocalStorage()) { logger.debug(String.format("Service offering %s (uuid: %s) will be used on virtual router", serviceOffering.getName(), serviceOffering.getUuid())); serviceOfferingId = serviceOffering.getId(); } } }
Source:
<code>protected AbstractAttributeEditor createAttributeEditor(TaskAttribute attribute) { if (attribute == null) { return null; } String type = attribute.getMetaData().getType(); <START> if (TaskAttribute.KIND_DEFAULT.equals(attribute.getMetaData().getKind())) { <END> TaskRepository repository = taskEditorPage.getTaskRepository(); Map<String, String> properties = repository.getProperties(); String hiddenVar = properties.get(IRepositoryConstants.PROPERTY_HIDDEN); System.out.println(repository.getProperty(IRepositoryConstants.PROPERTY_HIDDEN)); } if (taskEditorPage.getTaskRepository().getProperties().get(IRepositoryConstants.PROPERTY_HIDDEN) != null) { if (taskEditorPage.getTaskRepository() .getProperties() .get(IRepositoryConstants.PROPERTY_HIDDEN) .indexOf(attribute.getId()) == -1) { if (type != null) { AttributeEditorFactory attributeEditorFactory = getTaskEditorPage().getAttributeEditorFactory(); AbstractAttributeEditor editor = attributeEditorFactory.createEditor(type, attribute); if (editor instanceof RichTextAttributeEditor) { boolean spellChecking = getTaskEditorPage().getAttributeEditorToolkit() .hasSpellChecking(attribute); ((RichTextAttributeEditor) editor).setSpellCheckingEnabled(spellChecking); } attributeIds.add(attribute.getId()); return editor; } } } return null; }</code><technical_language>delete this block</technical_language>

Target:
protected AbstractAttributeEditor createAttributeEditor(TaskAttribute attribute) { if (attribute == null) { return null; } String type = attribute.getMetaData().getType(); int index = taskEditorPage.getTaskRepository() .getProperties() .get(IRepositoryConstants.PROPERTY_HIDDEN) .indexOf(attribute.getId()); if (index == -1) { if (type != null) { AttributeEditorFactory attributeEditorFactory = getTaskEditorPage().getAttributeEditorFactory(); AbstractAttributeEditor editor = attributeEditorFactory.createEditor(type, attribute); if (editor instanceof RichTextAttributeEditor) { boolean spellChecking = getTaskEditorPage().getAttributeEditorToolkit().hasSpellChecking(attribute); ((RichTextAttributeEditor) editor).setSpellCheckingEnabled(spellChecking); } attributeIds.add(attribute.getId()); return editor; } } return null; }
Source:
<code>public void setup() { catalogFramework = mock(CatalogFramework.class); workspaceTransformer = mock(WorkspaceTransformerImpl.class); securityService = mock(SecurityService.class); <START> persistentStore = mock(PersistentStore.class); <END> workspaceQueryBuilder = mock(WorkspaceQueryBuilder.class); WorkspaceMetacardFilter workspaceMetacardFilter = mock(WorkspaceMetacardFilter.class); when(workspaceMetacardFilter.filter(any())).thenReturn(true); workspaceService = new WorkspaceServiceImpl( catalogFramework, workspaceTransformer, workspaceQueryBuilder, securityService, persistentStore, MAX_SUBSCRIPTIONS); }</code><technical_language>enough mock objects in worth @Mock annotations instead</technical_language>

Target:
public void setup() { when(workspaceMetacardFilter.filter(any())).thenReturn(true); workspaceServiceImpl = new WorkspaceServiceImpl( catalogFramework, workspaceTransformer, workspaceQueryBuilder, securityService, persistentStore); workspaceServiceImpl.setMaxSubscriptions(100); }
Source:
<code>public void testNullHeaderReferenceName() { SAMRecord sam = new SAMRecordSetBuilder().addFrag("test", 0, 1, false, false, "3S9M", null, 2); final SAMFileHeader samHeader = sam.getHeader(); Assert.assertTrue(null != samHeader); final String originalRefName = sam.getReferenceName(); int originalRefIndex = sam.getReferenceIndex(); sam.setHeader(null); <START> Assert.assertTrue(originalRefName.equals(sam.getReferenceName())); <END> sam.setHeader(samHeader); Assert.assertTrue(sam.getReferenceIndex().equals(originalRefIndex)); sam.setHeader(null); sam.setReferenceName(SAMRecord.NO_ALIGNMENT_REFERENCE_NAME); Assert.assertTrue(sam.getReferenceName().equals(SAMRecord.NO_ALIGNMENT_REFERENCE_NAME)); Assert.assertTrue(sam.getReferenceIndex().equals(SAMRecord.NO_ALIGNMENT_REFERENCE_INDEX)); final String unresolvableRefName = "unresolvable"; sam.setReferenceName(unresolvableRefName); Assert.assertTrue(unresolvableRefName.equals(sam.getReferenceName())); }</code><technical_language>SAMRecord.mReferenceIndex is protected, in package, able assert setHeader(null) call cleared reference index</technical_language>

Target:
public void testNullHeaderReferenceName() { final SAMRecord sam = createTestRecordHelper(); final SAMFileHeader samHeader = sam.getHeader(); Assert.assertTrue(null != samHeader); final String originalRefName = sam.getReferenceName(); sam.setHeader(null); Assert.assertTrue(originalRefName.equals(sam.getReferenceName())); sam.setReferenceName(SAMRecord.NO_ALIGNMENT_REFERENCE_NAME); Assert.assertTrue(sam.getReferenceName().equals(SAMRecord.NO_ALIGNMENT_REFERENCE_NAME)); Assert.assertTrue(sam.getReferenceIndex().equals(SAMRecord.NO_ALIGNMENT_REFERENCE_INDEX)); sam.setReferenceName(originalRefName); Assert.assertTrue(sam.getReferenceName().equals(originalRefName)); }
Source:
<code>KafkaSpoutConfig<String, String> createSpoutConfig() { return SingleTopicKafkaSpoutConfiguration.setCommonSpoutConfigNullTuples( KafkaSpoutConfig.builder("127.0.0.1:" + kafkaUnitRule.getKafkaUnit().getKafkaPort(), Pattern.compile(SingleTopicKafkaSpoutConfiguration.TOPIC))) .setOffsetCommitPeriodMs(commitOffsetPeriodMs) <START> .setRetry(new KafkaSpoutRetryExponentialBackoff(KafkaSpoutRetryExponentialBackoff.TimeInterval.seconds(0), KafkaSpoutRetryExponentialBackoff.TimeInterval.seconds(0), <END> maxRetries, KafkaSpoutRetryExponentialBackoff.TimeInterval.seconds(0))) .setProp(ConsumerConfig.MAX_POLL_RECORDS_CONFIG, maxPollRecords) .build(); }</code><technical_language>Nit: important test, leave this config out SingleTopicKafkaSpoutConfiguration utility set common configuration. for maxPollRecords</technical_language>

Target:
KafkaSpoutConfig<String, String> createSpoutConfig() { return KafkaSpoutConfig.builder("127.0.0.1:" + kafkaUnitRule.getKafkaUnit().getKafkaPort(), Pattern.compile(SingleTopicKafkaSpoutConfiguration.TOPIC)) .setOffsetCommitPeriodMs(commitOffsetPeriodMs) .setRecordTranslator(new NullRecordExtractor()) .build(); }
Source:
<code>public ScheduledFuture scheduleTask() { return scheduler.scheduleWithFixedDelay(() -> { try { <START> LOG.info("Updating heartbeat for processor ID: " + processorId + " and job model version: " + currentJMVersion.get()); <END> table.updateHeartbeat(currentJMVersion.get(), processorId); } catch (Exception e) { errorHandler.accept("Exception in Heartbeat Scheduler. Stopping the processor..."); } }, HEARTBEAT_DELAY_SEC, HEARTBEAT_DELAY_SEC, TimeUnit.SECONDS); }</code><technical_language>I currentJMVersion change log line updateHeartbeat call. misleading. read currentJMVersion store in a local variable then, in Line 64 65? String currentVersion = currentJMVersion.get(); LOG.info(" ...." + currentVersion + " ..."); table.updateHeartbeat(currentVersion, procesorId);</technical_language>

Target:
public ScheduledFuture scheduleTask() { return scheduler.scheduleWithFixedDelay(() -> { try { String currJVM = currentJMVersion.get(); LOG.info("Updating heartbeat for processor ID: " + processorId + " and job model version: " + currJVM); table.updateHeartbeat(currJVM, processorId); } catch (Exception e) { errorHandler.accept("Exception in Heartbeat Scheduler. Stopping the processor..."); } }, HEARTBEAT_DELAY_SEC, HEARTBEAT_DELAY_SEC, TimeUnit.SECONDS); }
Source:
<code>public void close() { try { if (channel != null) { channel.close(); } <START> } catch (final IOException e) { END> } finally { channel = null; isClosed = true; } }</code><technical_language>parameters though. I do want final, configured checkstyle do that. I a big benefit, I accidentally modified exception reference in a catch clause</technical_language>

Target:
public void close() { try { if (channel != null) { channel.close(); } } catch (IOException e) { } finally { channel = null; isClosed = true; } }
Source:
<code>static RuntimeException methodError(Method method, String message, Object... args) { if (args.length > 0) { <START> message = String.format(message, args); <END> } return new IllegalArgumentException( method.getDeclaringClass().getSimpleName() + "." + method.getName() + ": " + message); }</code><technical_language>Do this unconditionally? %n weird</technical_language>

Target:
static RuntimeException methodError(Method method, String message, Object... args) { message = String.format(message, args); return new IllegalArgumentException(message + "\n for method " + method.getDeclaringClass().getSimpleName() + "." + method.getName()); }