auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private SourceMapImpl() { <START> smapFiles.forEach(sm -> sm.getLineSection().forEach(lineInfo -> { <END> for (int i = 0; i < lineInfo.repeatCount; i++) { int inputLine = lineInfo.inputStartLine + i; Path inputFile = Paths.get(sm.getFileSection().get(lineInfo.lineFileId).sourcePath); LocationImpl location = new LocationImpl(inputFile, inputLine, inputLine); int outputStart = lineInfo.outputStartLine + (i * lineInfo.outputLineIncrement); int outputEnd = lineInfo.outputStartLine + ((i + 1) * lineInfo.outputLineIncrement) - 1; outputEnd = Math.max(outputStart, outputEnd); for (int j = outputStart; j <= outputEnd; j++) { lines.merge(j, location, LocationImpl::mergeLocations); } } })); }</code><technical_language>a big fan of double-nesting lambdas. I strongly feel debugging either. rewrite in a more traditional foreach loop : for(SmapFile sm : smapFiles) { ... } extract big block a dedicated method</technical_language>

Target:
private SourceMapImpl() { for (SmapFile sm : smapFiles) { for (SmapFile.LineInfo lineInfo : sm.getLineSection()) { for (int i = 0; i < lineInfo.repeatCount; i++) { int inputLine = lineInfo.inputStartLine + i; Path inputFile = Paths.get(sm.getFileSection().get(lineInfo.lineFileId).sourcePath); LocationImpl location = new LocationImpl(inputFile, inputLine, inputLine); int outputStart = lineInfo.outputStartLine + (i * lineInfo.outputLineIncrement); int outputEnd = lineInfo.outputStartLine + ((i + 1) * lineInfo.outputLineIncrement) - 1; outputEnd = max(outputStart, outputEnd); for (int j = outputStart; j <= outputEnd; j++) { lines.merge(j, location, LocationImpl::mergeLocations); } } } } }
Source:
<code>private JLabel makeDiceRolledLabel(final List<Die> dice, final int value) { <START> int hits = 0; for (final Die die : dice) { if (die.getType() == Die.DieType.HIT) { hits++; } } <END> final String countString = dice.size() == 1 ? "1 die" : dice.size() + " dice"; String hitsString = hits == 1 ? "1 hit" : hits + " hits"; if (hits != 0) { hitsString = "<font color='#8B0000'>" + hitsString + "</font>"; } return new JLabel("<html><b>Rolled " + countString + " at " + value + " (" + hitsString + "):"); }</code><technical_language>If want for streams suggestion final long hits = dice.stream().map(Die::getType).filter(Die.DieType.HIT::equals).count();</technical_language>

Target:
private JLabel makeDiceRolledLabel(final List<Die> dice, final int value) { final long hits = dice.stream().map(Die::getType).filter(Die.DieType.HIT::equals).count(); final String countString = dice.size() == 1 ? "1 die" : dice.size() + " dice"; final String hitsString = colorizeHitString(hits == 1 ? "1 hit" : hits + " hits"); return new JLabel("<html><b>Rolled " + countString + " at " + value + " (" + hitsString + "):"); }
Source:
<code>public KubernetesLeaderElectionDriver( FlinkKubeClient kubeClient, KubernetesLeaderElectionConfiguration leaderConfig, LeaderElectionEventHandler leaderElectionEventHandler, FatalErrorHandler fatalErrorHandler) { this.kubeClient = checkNotNull(kubeClient, "Kubernetes client"); checkNotNull(leaderConfig, "Leader election configuration"); this.leaderElectionEventHandler = checkNotNull(leaderElectionEventHandler, "LeaderElectionEventHandler"); this.fatalErrorHandler = checkNotNull(fatalErrorHandler); this.configMapName = leaderConfig.getConfigMapName(); this.lockIdentity = leaderConfig.getLockIdentity(); this.leaderElector = kubeClient.createLeaderElector(leaderConfig, new LeaderCallbackHandlerImpl()); this.configMapLabels = KubernetesUtils.getConfigMapLabels( leaderConfig.getClusterId(), LABEL_CONFIGMAP_TYPE_HIGH_AVAILABILITY); leaderElector.run(); <START> kubernetesWatch = kubeClient.watchConfigMaps(configMapName, new ConfigMapCallbackHandlerImpl()); <END> running = true; }</code><technical_language>call run thing? callbacks running is set true</technical_language>

Target:
public KubernetesLeaderElectionDriver( FlinkKubeClient kubeClient, KubernetesLeaderElectionConfiguration leaderConfig, LeaderElectionEventHandler leaderElectionEventHandler, FatalErrorHandler fatalErrorHandler) { this.kubeClient = checkNotNull(kubeClient, "Kubernetes client"); checkNotNull(leaderConfig, "Leader election configuration"); this.leaderElectionEventHandler = checkNotNull(leaderElectionEventHandler, "LeaderElectionEventHandler"); this.fatalErrorHandler = checkNotNull(fatalErrorHandler); this.configMapName = leaderConfig.getConfigMapName(); this.lockIdentity = leaderConfig.getLockIdentity(); this.leaderElector = kubeClient.createLeaderElector(leaderConfig, new LeaderCallbackHandlerImpl()); this.configMapLabels = KubernetesUtils.getConfigMapLabels( leaderConfig.getClusterId(), LABEL_CONFIGMAP_TYPE_HIGH_AVAILABILITY); running = true; leaderElector.run(); kubernetesWatch = kubeClient.watchConfigMaps(configMapName, new ConfigMapCallbackHandlerImpl()); }
Source:
<code>public void showContentInfo() throws EditorFragmentNotAddedException { if (!isAdded()) { throw new EditorFragmentNotAddedException(); } getGutenbergContainerFragment().triggerGetContentInfo(new OnContentInfoReceivedListener() { @Override public void onContentInfoFailed() { <START> ToastUtils.showToast(getActivity(), R.string.toast_content_info_failed); <END> } @Override public void onEditorNotReady() { ToastUtils.showToast(getActivity(), R.string.toast_content_info_editor_not_ready); } @Override public void onContentInfoReceived(HashMap<String, Object> contentInfo) { int blockCount = (int) Double.parseDouble(contentInfo.get("blockCount").toString()); int wordCount = (int) Double.parseDouble(contentInfo.get("wordCount").toString()); int charCount = (int) Double.parseDouble(contentInfo.get("characterCount").toString()); if (getActivity() != null) { getActivity().runOnUiThread(() -> { AlertDialog.Builder builder = new MaterialAlertDialogBuilder(getActivity()); builder.setTitle(getString(R.string.dialog_content_info_title)); builder.setMessage( getString(R.string.dialog_content_info_body, blockCount, wordCount, charCount)); builder.setPositiveButton(getString(R.string.dialog_button_ok), null); builder.show(); }); } } }); }</code><technical_language>wave: @hypest onContentInfoReceived callback this onContentInfoFailed callback get invoked background thread is created in WPAndroidGlueCode::triggerGetContentInfo. means need switch main thread do in onContentInfoReceived in order avoid a crash try create toast, right</technical_language>

Target:
public void showContentInfo() throws EditorFragmentNotAddedException { if (!isAdded()) { throw new EditorFragmentNotAddedException(); } getGutenbergContainerFragment().triggerGetContentInfo(new OnContentInfoReceivedListener() { @Override public void onContentInfoFailed() { if (getActivity() != null) { getActivity().runOnUiThread(() -> { ToastUtils.showToast(getActivity(), R.string.toast_content_info_failed); }); } } @Override public void onEditorNotReady() { if (getActivity() != null) { getActivity().runOnUiThread(() -> { ToastUtils.showToast(getActivity(), R.string.toast_content_info_editor_not_ready); }); } } @Override public void onContentInfoReceived(HashMap<String, Object> contentInfo) { int blockCount = (int) Double.parseDouble(contentInfo.get("blockCount").toString()); int wordCount = (int) Double.parseDouble(contentInfo.get("wordCount").toString()); int charCount = (int) Double.parseDouble(contentInfo.get("characterCount").toString()); if (getActivity() != null) { getActivity().runOnUiThread(() -> { AlertDialog.Builder builder = new MaterialAlertDialogBuilder(getActivity()); builder.setTitle(getString(R.string.dialog_content_info_title)); builder.setMessage( getString(R.string.dialog_content_info_body, blockCount, wordCount, charCount)); builder.setPositiveButton(getString(R.string.dialog_button_ok), null); builder.show(); }); } } }); }
Source:
<code><START> public InstallationModel createAndroidInstallation(final Context context) { <END> final InstallationModel d = createModel(null); d.deviceType = InstallationModel.DEVICE_TYPE_ANDROID; final String appName = context.getPackageName(); try { d.appVersion = context.getPackageManager() .getPackageInfo(appName, 0) .versionName; } catch (final PackageManager.NameNotFoundException e) { } d.status = InstallationModel.STATUS_ACTIVE; return d; }</code><technical_language>A big :+1: for this pre-fill strategy</technical_language>

Target:
public Installation createAndroidInstallation(final Context context) { final Installation d = createModel(null); final String appName = context.getPackageName(); try { d.appVersion = context.getPackageManager() .getPackageInfo(appName, 0) .versionName; } catch (final PackageManager.NameNotFoundException e) { } d.status = Installation.STATUS_ACTIVE; return d; }
Source:
<code>public TieredQueueSlas(Map<Integer, ResAllocs> tierCapacities, Map<Integer, Map<String, ResAllocs>> slas) { Map<Integer, TierSla> tmpResAllocsMap = new HashMap<>(); if (!slas.isEmpty()) { for (Map.Entry<Integer, Map<String, ResAllocs>> entry : slas.entrySet()) { Integer tierIndex = entry.getKey(); <START> if (!tierCapacities.containsKey(tierIndex)) { <END> throw new IllegalArgumentException("Total capacity not defined for tear " + tierIndex); } final Map<String, ResAllocs> tierAllocs = entry.getValue(); TierSla tierSla = new TierSla(); tierSla.setTierAllocs(tierCapacities.get(tierIndex)); tmpResAllocsMap.put(tierIndex, tierSla); for (Map.Entry<String, ResAllocs> e : tierAllocs.entrySet()) { tierSla.setAlloc(e.getKey(), e.getValue()); } } } tierCapacities.forEach((tierIndex, capacity) -> { if (!tmpResAllocsMap.containsKey(tierIndex)) { TierSla tierSla = new TierSla(); tierSla.setTierAllocs(tierCapacities.get(tierIndex)); tmpResAllocsMap.put(tierIndex, tierSla); } }); this.slas = tmpResAllocsMap; }</code><technical_language>agreed change this sum of bucket allocs if tier level is absent</technical_language>

Target:
public TieredQueueSlas(Map<Integer, ResAllocs> tierCapacities, Map<Integer, Map<String, ResAllocs>> slas) { Map<Integer, TierSla> tmpResAllocsMap = new HashMap<>(); if (!slas.isEmpty()) { for (Map.Entry<Integer, Map<String, ResAllocs>> entry : slas.entrySet()) { int tierNumber = entry.getKey(); final Map<String, ResAllocs> tierAllocs = entry.getValue(); TierSla tierSla = new TierSla(); tierSla.setTierCapacity(getOrComputeTierCapacity(tierNumber, tierCapacities.get(tierNumber), tierAllocs)); for (Map.Entry<String, ResAllocs> e : tierAllocs.entrySet()) { tierSla.setAlloc(e.getKey(), e.getValue()); } tmpResAllocsMap.put(tierNumber, tierSla); } } tierCapacities.forEach((tierIndex, capacity) -> { if (!tmpResAllocsMap.containsKey(tierIndex)) { TierSla tierSla = new TierSla(); tierSla.setTierCapacity(tierCapacities.get(tierIndex)); tmpResAllocsMap.put(tierIndex, tierSla); } }); this.slas = tmpResAllocsMap; }
Source:
<code>public List<ResponseInfo> sendAndPoll(List<RequestInfo> requestInfos) throws IOException { <START> logger.trace("Initiating Send and poll at " + time.milliseconds()); <END> long startTime = time.milliseconds(); try { if (closed) { throw new IllegalStateException("The NetworkClient is closed."); } List<ResponseInfo> responseInfoList = new ArrayList<ResponseInfo>(); for (RequestInfo requestInfo : requestInfos) { ClientNetworkRequestMetrics clientNetworkRequestMetrics = new ClientNetworkRequestMetrics(networkMetrics.requestQueueTime, networkMetrics.requestSendTime, networkMetrics.requestSendTotalTime, 0); pendingRequests.add(new RequestMetadata(time.milliseconds(), requestInfo, clientNetworkRequestMetrics)); } List<NetworkSend> sends = prepareSends(responseInfoList); selector.poll(POLL_TIMEOUT_MS, sends); handleSelectorEvents(responseInfoList); return responseInfoList; } finally { numPendingRequests.set(pendingRequests.size()); networkMetrics.networkClientSendAndPollTime.update(time.milliseconds() - startTime); logger.trace("Time taken for this Send and poll cycle " + (time.milliseconds() - startTime)); } }</code><technical_language>startTime in this log message? do want include logging time in networkClientSendAndPollTime</technical_language>

Target:
public List<ResponseInfo> sendAndPoll(List<RequestInfo> requestInfos) throws IOException { long startTime = time.milliseconds(); try { if (closed) { throw new IllegalStateException("The NetworkClient is closed."); } List<ResponseInfo> responseInfoList = new ArrayList<ResponseInfo>(); for (RequestInfo requestInfo : requestInfos) { ClientNetworkRequestMetrics clientNetworkRequestMetrics = new ClientNetworkRequestMetrics(networkMetrics.requestQueueTime, networkMetrics.requestSendTime, networkMetrics.requestSendTotalTime, 0); pendingRequests.add(new RequestMetadata(time.milliseconds(), requestInfo, clientNetworkRequestMetrics)); } List<NetworkSend> sends = prepareSends(responseInfoList); selector.poll(POLL_TIMEOUT_MS, sends); handleSelectorEvents(responseInfoList); return responseInfoList; } finally { numPendingRequests.set(pendingRequests.size()); networkMetrics.networkClientSendAndPollTime.update(time.milliseconds() - startTime); logger.trace("Completing a send and poll cycle "); } }
Source:
<code>public static Struct toStruct(final Ds3Type ds3Type) throws ParseException { <START> final StructConverter converter = new StructConverter(ds3Type); <END> return converter.convert(); }</code><technical_language>creating instance of class perform conversion? a static method. This creating unnecessary object</technical_language>

Target:
public static Struct toStruct(final Ds3Type ds3Type) throws ParseException { final ImmutableList<StructMember> variablesList = StructHelper.convertDs3Elements(ds3Type.getElements()); return new Struct( ds3Type.getName(), variablesList); }
Source:
<code>public void unsetRM3Reranker() { this.isRerank = false; <START> cascade = new RerankerCascade("default"); <END> cascade.add(new ScoreTiesAdjusterReranker()); }</code><technical_language>Sorry, missed this</technical_language>

Target:
public void unsetRM3Reranker() { this.isRerank = false; cascade = new RerankerCascade(); cascade.add(new ScoreTiesAdjusterReranker()); }
Source:
<code>public void replaceTypeToResponse() throws IOException { final String type = "text/plain"; MatcherAssert.assertThat( new RsPrint( new RsWithType( new RsWithType(new RsEmpty(), "text/xml"), type ) ).print(), Matchers.equalTo( Joiner.on(CRLF).join( <START> "HTTP/1.1 200 OK", <END> String.format("Content-Type: %s", type), "", "" ) ) ); }</code><technical_language>@ekondrashev indentation for lines 61-64, move spaces</technical_language>

Target:
public void replaceTypeToResponse() throws Exception { final String type = "text/plain"; MatcherAssert.assertThat( new RsPrint( new RsWithType( new RsWithType(new RsEmpty(), "text/xml"), type ) ).print(), Matchers.equalTo( Joiner.on(CRLF).join( "HTTP/1.1 200 OK", String.format("Content-Type: %s", type), "", "" ) ) ); }
Source:
<code>public void voidLastState(ProgramWorkflow workflow, User voidBy, Date voidDate, String voidReason) { List<PatientState> states = statesInWorkflow(workflow, false); if (voidDate == null) { voidDate = new Date(); } PatientState last = null; PatientState nextToLast = null; <START> if (!states.isEmpty()) { <END> last = states.get(states.size() - 1); } if (states.size() > 1) { nextToLast = states.get(states.size() - 2); } if (last != null) { last.setVoided(true); last.setVoidedBy(voidBy); last.setDateVoided(voidDate); last.setVoidReason(voidReason); } if (nextToLast != null && nextToLast.getEndDate() != null) { nextToLast.setEndDate(null); nextToLast.setDateChanged(voidDate); nextToLast.setChangedBy(voidBy); } }</code><technical_language>CollectionUtils.isNotEmpty()</technical_language>

Target:
public void voidLastState(ProgramWorkflow workflow, User voidBy, Date voidDate, String voidReason) { List<PatientState> states = statesInWorkflow(workflow, false); if (voidDate == null) { voidDate = new Date(); } PatientState last = null; PatientState nextToLast = null; if (CollectionUtils.isNotEmpty(states)) { last = states.get(states.size() - 1); } if (states.size() > 1) { nextToLast = states.get(states.size() - 2); } if (last != null) { last.setVoided(true); last.setVoidedBy(voidBy); last.setDateVoided(voidDate); last.setVoidReason(voidReason); } if (nextToLast != null && nextToLast.getEndDate() != null) { nextToLast.setEndDate(null); nextToLast.setDateChanged(voidDate); nextToLast.setChangedBy(voidBy); } }
Source:
<code>public GroupedExecutionProperties visitJoin(JoinNode node, Void context) <START> { <END> GroupedExecutionProperties left = node.getLeft().accept(this, null); GroupedExecutionProperties right = node.getRight().accept(this, null); if (Optional.empty().equals(node.getDistributionType())) { return new GroupedExecutionProperties(false, false); } if (Optional.of(JoinNode.DistributionType.REPLICATED).equals(node.getDistributionType())) { checkState(!right.currentNodeCapable); return left; } if (Optional.of(JoinNode.DistributionType.PARTITIONED).equals(node.getDistributionType())) { if (left.currentNodeCapable && right.currentNodeCapable) { return new GroupedExecutionProperties(true, true); } return left; } throw new UnsupportedOperationException("Unknown distribution type: " + node.getDistributionType()); }</code><technical_language>I able pull DetermineJoinDistributionType DetermineSemiJoinDistributionType of if (!forceSingleNode) check in PlanOptimizers</technical_language>

Target:
public GroupedExecutionProperties visitJoin(JoinNode node, Void context) { GroupedExecutionProperties left = node.getLeft().accept(this, null); GroupedExecutionProperties right = node.getRight().accept(this, null); if (!node.getDistributionType().isPresent()) { return new GroupedExecutionProperties(false, false); } switch (node.getDistributionType().get()) { case REPLICATED: checkState(!right.currentNodeCapable); return left; case PARTITIONED: if (left.currentNodeCapable && right.currentNodeCapable) { return new GroupedExecutionProperties(true, true); } return left; default: throw new UnsupportedOperationException("Unknown distribution type: " + node.getDistributionType()); } }
Source:
<code>public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { final PathAddress address = PathAddress.pathAddress(operation.get(OP_ADDR)); <START> final ModelNode config = Resource.Tools.readModel(context.readResourceFromRoot(address)); <END> if (definition.getName().equals(BUFFER_PER_SLICE.getName())) context.getResult().set( returnConfigIfDefinedOrDefaultValueFor(BUFFER_PER_SLICE.getName(), config, DEFAULT_BUFFERS_PER_REGION)); else if (definition.getName().equals(BUFFER_SIZE.getName())) context.getResult().set( returnConfigIfDefinedOrDefaultValueFor(BUFFER_SIZE.getName(), config, DEFAULT_BUFFER_SIZE)); else if (definition.getName().equals(DIRECT_BUFFERS.getName())) context.getResult().set( returnConfigIfDefinedOrDefaultValueFor(DIRECT_BUFFERS.getName(), config, DEFAULT_DIRECT_BUFFERS)); else throw new IllegalArgumentException("No such attributes [" + definition + " in " + ATTRIBUTES); }</code><technical_language>code a bit convoluted. call definition.resolveModelAttribute(context, model)? If is defined, returns value, else, returns of DEFAULT_XXX pass class instantiate attribute definition</technical_language>

Target:
public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { if ( definition.getType() == ModelType.INT ) context.getResult().set(new ModelNode(definition.getDefaultValue().asInt())); else if ( definition.getType() == ModelType.BOOLEAN ) context.getResult().set(new ModelNode(definition.getDefaultValue().asBoolean())); else throw new IllegalArgumentException("Arguments type can only be INT or BOOL: " + ATTRIBUTES ); }
Source:
<code>protected void executeQueryCommand() { List<VM> vms = DbFacade.getInstance().getVmDao().getAllForVdsGroup(getParameters().getId()); <START> Integer activeVms = 0; <END> for (VM vm : vms) { if (vm.getStatus() != VMStatus.Down) { ++activeVms; } } getQueryReturnValue().setReturnValue(activeVms); }</code><technical_language>primitive int</technical_language>

Target:
protected void executeQueryCommand() { List<VM> vms = DbFacade.getInstance().getVmDao().getAllForVdsGroup(getParameters().getId()); int activeVms = 0; for (VM vm : vms) { if (vm.getStatus() != VMStatus.Down && vm.getStatus() != VMStatus.ImageLocked) { ++activeVms; } } getQueryReturnValue().setReturnValue(activeVms); }
Source:
<code>public Node parent() { <START> return parents.isEmpty() ? null : Lists.newArrayList(parents.keySet()).get(0); <END> }</code><technical_language>getParents().get(0) here</technical_language>

Target:
public Node parent() { return parents.isEmpty() ? null : getParents().get(0); }
Source:
<code>public void validate() { <START> for (Builder<?> validatable : asList(globalJmxStatistics, transport, serialization, shutdown, site)) { <END> validatable.validate(); } for (Builder<?> m : modules) { m.validate(); } }</code><technical_language>thread pools configuration is validated? I sense validate it, i.e. check number of threads is valid (higher zero), timeouts..</technical_language>

Target:
public void validate() { for (Builder<?> validatable : asList(evictionThreadPool, listenerThreadPool, replicationQueueThreadPool, persistenceThreadPool, globalJmxStatistics, transport, serialization, shutdown, site)) { validatable.validate(); } for (Builder<?> m : modules) { m.validate(); } }
Source:
<code>protected boolean setAndValidateDiskProfiles() { if (getParameters().getVm().getDiskMap() != null) { Map<DiskImage, Guid> map = new HashMap<>(); for (Disk disk : getParameters().getVm().getDiskMap().values()) { <START> if (disk instanceof DiskImage) { <END> DiskImage diskImage = (DiskImage) disk; map.put(diskImage, imageToDestinationDomainMap.get(diskImage.getId())); } } return validate(DiskProfileHelper.setAndValidateDiskProfiles(map)); } return true; }</code><technical_language>check this - disk,getDiskStorageType() == DiskStorageType.IMAGE</technical_language>

Target:
protected boolean setAndValidateDiskProfiles() { if (getParameters().getVm().getDiskMap() != null) { Map<DiskImage, Guid> map = new HashMap<>(); for (Disk disk : getParameters().getVm().getDiskMap().values()) { if (disk.getDiskStorageType() == DiskStorageType.IMAGE) { DiskImage diskImage = (DiskImage) disk; map.put(diskImage, imageToDestinationDomainMap.get(diskImage.getId())); } } return validate(DiskProfileHelper.setAndValidateDiskProfiles(map)); } return true; }
Source:
<code><START> public void parse(InputStream in, boolean recurse, MimeConfig parserConfig) throws IOException, MessagingException { <END> mHeader.clear(); mFrom = null; mTo = null; mCc = null; mBcc = null; mReplyTo = null; xOriginalTo = null; deliveredTo = null; xEnvelopeTo = null; mMessageId = null; mReferences = null; mInReplyTo = null; mSentDate = null; mBody = null; MimeStreamParser parser = new MimeStreamParser(parserConfig); parser.setContentHandler(new MimeMessageBuilder(new DefaultBodyFactory())); if (recurse) { parser.setRecurse(); } try { parser.parse(new EOLConvertingInputStream(in)); } catch (MimeException me) { throw new MessagingException(me.getMessage(), me); } }</code><technical_language>If move MessageTest internet package (and rename MimeMessageTest, is is), package-local. please annotate @VisibleForTesting</technical_language>

Target:
void parse(InputStream in, boolean recurse, MimeConfig parserConfig) throws IOException, MessagingException { mHeader.clear(); mFrom = null; mTo = null; mCc = null; mBcc = null; mReplyTo = null; xOriginalTo = null; deliveredTo = null; xEnvelopeTo = null; mMessageId = null; mReferences = null; mInReplyTo = null; mSentDate = null; mBody = null; MimeStreamParser parser = new MimeStreamParser(parserConfig); parser.setContentHandler(new MimeMessageBuilder(new DefaultBodyFactory())); if (recurse) { parser.setRecurse(); } try { parser.parse(new EOLConvertingInputStream(in)); } catch (MimeException me) { throw new MessagingException(me.getMessage(), me); } }
Source:
<code>private void flushCurrentSortBuffer() throws IOException { if (currentSortBuffer == null || !currentSortBuffer.hasRemaining()) { releaseCurrentSortBuffer(); return; } currentSortBuffer.finish(); PartitionedFileWriter fileWriter = getPartitionedFileWriter(); while (currentSortBuffer.hasRemaining()) { BufferWithChannel bufferWithChannel = currentSortBuffer.copyData(writeBuffer); Buffer buffer = bufferWithChannel.getBuffer(); int subpartitionIndex = bufferWithChannel.getChannelIndex(); writeCompressedBufferIfPossible(buffer, fileWriter, subpartitionIndex); <START> updateStatistics(buffer, subpartitionIndex); <END> } releaseCurrentSortBuffer(); }</code><technical_language>nit: updateStatistics covered writeCompressedBufferIfPossible #writeLargeRecord #flushCurrentSortBuffer usages, deduplicate code a bit</technical_language>

Target:
private void flushCurrentSortBuffer() throws IOException { if (currentSortBuffer == null) { return; } currentSortBuffer.finish(); if (currentSortBuffer.hasRemaining()) { fileWriter.startNewRegion(); while (currentSortBuffer.hasRemaining()) { BufferWithChannel bufferWithChannel = currentSortBuffer.copyIntoSegment(writeBuffer); Buffer buffer = bufferWithChannel.getBuffer(); int subpartitionIndex = bufferWithChannel.getChannelIndex(); writeCompressedBufferIfPossible(buffer, subpartitionIndex); } } currentSortBuffer.release(); }
Source:
<code>public BaseChangeEvent<T> getNext() throws IOException { <START> if (lock.tryLock()) { <END> try { eventStream = getEventStream(); return eventStream.getNextEvent(); } finally { lock.unlock(); } } throw new RuntimeException("Resource already open"); }</code><technical_language>this implementation, change Async/Sync execution. I if this intended? E.g ... this work: watcher.getNext() watcher.getAsync() If intended, named getNextAsync()? Alternatively, set a mode boolean calling getNext/getAsync() throw if wrong get method is called. choose a mode calling get method. Thoughts</technical_language>

Target:
public synchronized BaseChangeEvent<T> getNext() throws AppException, IOException { eventStream = getEventStream(); return eventStream.getNextEvent(); }
Source:
<code>static int getDataSerializedSize(Message amqpMessage) { if (amqpMessage == null) { return 0; } int payloadSize = getPayloadSize(amqpMessage); final MessageAnnotations messageAnnotations = amqpMessage.getMessageAnnotations(); final ApplicationProperties applicationProperties = amqpMessage.getApplicationProperties(); int annotationsSize = 0; int applicationPropertiesSize = 0; if (messageAnnotations != null) { for (Symbol value : messageAnnotations.getValue().keySet()) { annotationsSize += sizeof(value); } for (Object value : messageAnnotations.getValue().values()) { annotationsSize += sizeof(value); <START> } <END> } if (applicationProperties != null) { for (Object value : applicationProperties.getValue().keySet()) { applicationPropertiesSize += sizeof(value); } for (Object value : applicationProperties.getValue().values()) { applicationPropertiesSize += sizeof(value); } } return annotationsSize + applicationPropertiesSize + payloadSize; }</code><technical_language>I investigated messageAnnotations.getValue() method returns, a bit a Map (with keySet() values()). considered instead calling entrySet() do O(n) operation O(n) operations</technical_language>

Target:
static int getDataSerializedSize(Message amqpMessage) { if (amqpMessage == null) { return 0; } int payloadSize = getPayloadSize(amqpMessage); final MessageAnnotations messageAnnotations = amqpMessage.getMessageAnnotations(); final ApplicationProperties applicationProperties = amqpMessage.getApplicationProperties(); int annotationsSize = 0; int applicationPropertiesSize = 0; if (messageAnnotations != null) { final Map<Symbol, Object> map = messageAnnotations.getValue(); for (Symbol key : map.keySet()) { final int size = sizeof(key) + sizeof(map.get(key)); annotationsSize += size; } } if (applicationProperties != null) { final Map<String, Object> map = applicationProperties.getValue(); for (String key : map.keySet()) { final int size = sizeof(key) + sizeof(map.get(key)); applicationPropertiesSize += size; } } return annotationsSize + applicationPropertiesSize + payloadSize; }
Source:
<code>public void throwsExceptionWhenNotCorrectlyCreated() <START> throws IOException { <END> new RqForm.Fake( new RqFake(), "param" ); }</code><technical_language>@erimerturk too, declare throws Exception, recommendation [in this post](<LINK_0></technical_language>

Target:
public void throwsExceptionWhenNotCorrectlyCreated() throws Exception { new RqForm.Fake( new RqFake(), "param" ); }
Source:
<code>void setSubject(String subject) { if (subject != null) { this.subject = subject; if(subject.matches("^[R|r][E|e].*?:.*")) { this.simplifiedSubject = subject.replaceAll("[R|r][E|e].*?:", "").trim(); isReplySubject = true; } else { this.simplifiedSubject = subject; } } else { <START> this.simplifiedSubject = null; <END> } }</code><technical_language>set this empty string, subject is</technical_language>

Target:
void setSubject(String subject) { if (subject != null) { this.subject = subject; if(subject.matches("^[R|r][E|e].*?:.*")) { this.simplifiedSubject = subject.replaceAll("[R|r][E|e].*?:", "").trim(); replySubject = true; } else { this.simplifiedSubject = subject; } } else { this.simplifiedSubject = ""; } }
Source:
<code>public void cancel(Object brokerConsumer, Message message, boolean updateCounts) throws Exception { OperationContext oldContext = recoverContext(); try { try { ((ServerConsumer) brokerConsumer).individualCancel(message.getMessageID(), updateCounts); } catch (IllegalStateException e) { <START> } <END> ((ServerConsumer) brokerConsumer).getQueue().forceDelivery(); } finally { resetContext(oldContext); } }</code><technical_language>nit-pick: log.debug instead? I ammend merging</technical_language>

Target:
public void cancel(Object brokerConsumer, Message message, boolean updateCounts) throws Exception { OperationContext oldContext = recoverContext(); try { try { ((ServerConsumer) brokerConsumer).individualCancel(message.getMessageID(), updateCounts); ((ServerConsumer) brokerConsumer).getQueue().forceDelivery(); } catch (IllegalStateException e) { if (logger.isDebugEnabled()) { logger.debug("silently ignoring cancel", e); } } } finally { resetContext(oldContext); } }
Source:
<code>boolean isKernelFipsMode(Guid vdsGuid) { boolean fips = vdsDynamicDao.get(vdsGuid).isFipsEnabled(); <START> log.info("Kernel FIPS - Guid: " + vdsGuid + " fips: " + fips); <END> return fips; }</code><technical_language>Please standard pass parameters logging framework: log.info("Kernel FIPS - Guid: fips: {}", vdsGuid, fips); main concern is, is this message useful for administrators? useful for debugging? If so, move do debug mode</technical_language>

Target:
boolean isKernelFipsMode(Guid vdsGuid) { boolean fips = vdsDynamicDao.get(vdsGuid).isFipsEnabled(); log.debug("Kernel FIPS - Guid: fips: {}", vdsGuid, fips); return fips; }
Source:
<code>public static Class<?> _forName(String className) throws ClassNotFoundException { try { switch(className){ case "boolean": return boolean.class; case "byte": return byte.class; case "char": return char.class; case "short": return short.class; case "int": return int.class; case "long": return long.class; case "float": return float.class; case "double": return double.class; case "boolean[]": return boolean[].class; case "byte[]": return byte[].class; case "char[]": return char[].class; case "short[]": return short[].class; case "int[]": return int[].class; case "long[]": return long[].class; case "float[]": return float[].class; case "double[]": return double[].class; default: <START> return arrayForName(className); <END> } } catch (ClassNotFoundException e) { if (className.indexOf('.') == -1) { try { return arrayForName("java.lang." + className); } catch (ClassNotFoundException e2) { } } throw e; } }</code><technical_language>IMO, try catch block effect default case</technical_language>

Target:
public static Class<?> _forName(String className) throws ClassNotFoundException { switch(className){ case "boolean": return boolean.class; case "byte": return byte.class; case "char": return char.class; case "short": return short.class; case "int": return int.class; case "long": return long.class; case "float": return float.class; case "double": return double.class; case "boolean[]": return boolean[].class; case "byte[]": return byte[].class; case "char[]": return char[].class; case "short[]": return short[].class; case "int[]": return int[].class; case "long[]": return long[].class; case "float[]": return float[].class; case "double[]": return double[].class; } try { return arrayForName(className); } catch (ClassNotFoundException e) { if (className.indexOf('.') == -1) { try { return arrayForName("java.lang." + className); } catch (ClassNotFoundException e2) { } } throw e; } }
Source:
<code>public void setMaxZoom(final int level) <START> { <END> if (this.maxZoom != level) { this.maxZoom = level; AjaxRequestTarget target = getRequestCycle().find(AjaxRequestTarget.class); if (target != null && findPage() != null) { target.appendJavaScript(getJSsetMaxZoom(maxZoom)); } } }</code><technical_language>Do want check parameter non-negative some max ? I guess Google Maps support a range of values for min/max zoom</technical_language>

Target:
public void setMaxZoom(final int level) { if (this.maxZoom != level) { this.maxZoom = level >= 0 ? level : 0; AjaxRequestTarget target = getRequestCycle().find(AjaxRequestTarget.class); if (target != null && findPage() != null) { target.appendJavaScript(getJSsetMaxZoom(maxZoom)); } } }
Source:
<code>public void initSequence(String key, long id) { <START> while ((getNextLong(key)) < id) { <END> continue; } }</code><technical_language>edited this line, remove extra parenthesis please</technical_language>

Target:
public void initSequence(String key, long id) { while (getNextLong(key) < id) { continue; } }
Source:
<code>public static Result verify( DataSource apk, ApkUtils.ZipSections zipSections, int minSdkVersion, int maxSdkVersion) throws IOException, ApkFormatException, NoSuchAlgorithmException, ApkSigningBlockUtils.SignatureNotFoundException { Result result = new Result(); <START> SignatureInfo signatureInfo = ApkSigningBlockUtils.findSignature(apk, zipSections, <END> APK_SIGNATURE_SCHEME_V2_BLOCK_ID , result); DataSource beforeApkSigningBlock = apk.slice(0, signatureInfo.apkSigningBlockOffset); DataSource centralDir = apk.slice( signatureInfo.centralDirOffset, signatureInfo.eocdOffset - signatureInfo.centralDirOffset); ByteBuffer eocd = signatureInfo.eocd; verify(beforeApkSigningBlock, signatureInfo.signatureBlock, centralDir, eocd, minSdkVersion, maxSdkVersion, result); return result; }</code><technical_language>Java style: prefer break higher semantic level. In this case, assignment operator</technical_language>

Target:
public static ApkSigningBlockUtils.Result verify( DataSource apk, ApkUtils.ZipSections zipSections, int minSdkVersion, int maxSdkVersion) throws IOException, ApkFormatException, NoSuchAlgorithmException, ApkSigningBlockUtils.SignatureNotFoundException { ApkSigningBlockUtils.Result result = new ApkSigningBlockUtils.Result(); SignatureInfo signatureInfo = ApkSigningBlockUtils.findSignature(apk, zipSections, APK_SIGNATURE_SCHEME_V2_BLOCK_ID , result); DataSource beforeApkSigningBlock = apk.slice(0, signatureInfo.apkSigningBlockOffset); DataSource centralDir = apk.slice( signatureInfo.centralDirOffset, signatureInfo.eocdOffset - signatureInfo.centralDirOffset); ByteBuffer eocd = signatureInfo.eocd; verify(beforeApkSigningBlock, signatureInfo.signatureBlock, centralDir, eocd, minSdkVersion, maxSdkVersion, result); return result; }
Source:
<code>protected void after() { try { <START> for (RealmConfiguration configuration : configurations) { <END> } } catch (IllegalStateException e) { if (!isUnitTestFailed()) { throw e; } } finally { super.after(); } }</code><technical_language>remove iteration delete Realms this is fixed Core fix</technical_language>

Target:
protected void after() { try { for (RealmConfiguration configuration : configurations) { Realm.deleteRealm(configuration); } } catch (IllegalStateException e) { if (!isUnitTestFailed()) { throw e; } } finally { super.after(); } }
Source:
<code>private void packageListBoxSetup() { final String path = presenter.getPath().toURI(); if ( thereIsAnActiveProject() && isAProjectResource( path ) ) { <START> packageListBox.setContext( context, true, new Command() { <END> @Override public void execute() { copyButton.setEnabled( true ); } } ); } }</code><technical_language>@paulovmr a lambda :)</technical_language>

Target:
void packageListBoxSetup() { final String path = presenter.getPath().toURI(); if ( thereIsAnActiveProject() && isAProjectResource( path ) ) { copyButton().setEnabled( false ); packageListBox.setContext( context, true, () -> copyButton.setEnabled( true ) ); } }
Source:
<code>private void setDefaultValues() { fCharsetEditor.loadDefault(); fWideCharsetEditor.loadDefault(); <START> String defaultSourceShow = <END> DefaultScope.INSTANCE.getNode(CCorePlugin.PLUGIN_ID) .get(CCorePreferenceConstants.SHOW_SOURCE_FILES_IN_BINARIES, "all_time"); switch (defaultSourceShow) { case "all_time": fShowSourceNotFoundAllTime.setSelection(true); break; case "sometimes": fShowSourceNotFoundOnlyCaseSourceNotFound.setSelection(true); break; case "never": fShowSourceNotFoundNever.setSelection(true); break; } }</code><technical_language>good default scope</technical_language>

Target:
private void setDefaultValues() { fCharsetEditor.loadDefault(); fWideCharsetEditor.loadDefault(); String defaultSourceShow = DefaultScope.INSTANCE.getNode(CCorePlugin.PLUGIN_ID) .get(CCorePreferenceConstants.SHOW_SOURCE_FILES_IN_BINARIES, "all_time"); setShowEditorButtons(defaultSourceShow); }
Source:
<code>public ITypeMapper getTypeMapper(String contributorId) { ITypeMapper legacyPropertyTypeMapper = null; Collection<IItemDescriptor> values = this.id2descriptors.values(); for (IItemDescriptor itemDescriptor : values) { if (itemDescriptor instanceof LegacyPropertyContributorItemDescriptor) { if (contributorId != null && contributorId.equals(itemDescriptor.getId())) { <START> legacyPropertyTypeMapper = ((LegacyPropertyContributorItemDescriptor) itemDescriptor).getTypeMapper(); <END> } } } return legacyPropertyTypeMapper; }</code><technical_language>return/break early match, is intended continue possibly find others (and return one)</technical_language>

Target:
public ITypeMapper getTypeMapper(String contributorId) { Collection<IItemDescriptor> values = this.id2descriptors.values(); for (IItemDescriptor itemDescriptor : values) { if (itemDescriptor instanceof LegacyPropertyContributorItemDescriptor) { if (contributorId != null && contributorId.equals(itemDescriptor.getId())) { return ((LegacyPropertyContributorItemDescriptor) itemDescriptor).getTypeMapper(); } } } return null; }
Source:
<code>private void checkExcludedScopes(List<String> excludedScopes) { <START> if (excludedScopes != null && excludedScopes.size() > 0) { <END> excludedScopes.stream().forEach(scope -> { if (scope.startsWith(SCOPE_REVERSE_STR)) { throw new IllegalArgumentException("excludedScope " + scope + " cannot start with " + SCOPE_REVERSE_STR); } }); } }</code><technical_language>NIT: CollectionUtils.isEmpty() simplify</technical_language>

Target:
private void checkExcludedScopes(List<String> excludedScopes) { if (!CollectionUtils.isEmpty(excludedScopes)) { excludedScopes.stream().forEach(scope -> { if (scope.startsWith(SCOPE_REVERSE_STR)) { throw new IllegalArgumentException("excludedScope " + scope + " cannot start with " + SCOPE_REVERSE_STR); } }); } }
Source:
<code>private String getKeepAliveProperty() { try { return getPropertyAccessor().getProperty(NhincConstants.GATEWAY_PROPERTY_FILE, NhincConstants.KEEP_ALIVE_PROP); } catch (PropertyAccessException ex) { <START> LOG.warn("Unable to access property: {}", NhincConstants.KEEP_ALIVE_PROP, ex); <END> return null; } }</code><technical_language>try LOG.warn("Unable access property: {}", NhincConstants.KEEP_ALIVE_PROP, ex.getLocalizedMessage(),ex);</technical_language>

Target:
private String getKeepAliveProperty() { try { return getPropertyAccessor().getProperty(NhincConstants.GATEWAY_PROPERTY_FILE, NhincConstants.KEEP_ALIVE_PROP); } catch (PropertyAccessException ex) { LOG.warn("Unable to access property: {}", NhincConstants.KEEP_ALIVE_PROP, ex.getLocalizedMessage(),ex); return null; } }
Source:
<code>public byte[] getCacheKey() { <START> byte[] previousStopBytes = StringUtils.toUtf8(getPreviousStop()); <END> return ByteBuffer.allocate(1 + previousStopBytes.length) .put(CACHE_TYPE_ID) .put(previousStopBytes) .array(); }</code><technical_language>i this throw NPE if previousStop is null</technical_language>

Target:
public byte[] getCacheKey() { byte[] previousStopBytes = getPreviousStop() == null ? new byte[]{} : StringUtils.toUtf8(getPreviousStop()); return ByteBuffer.allocate(1 + previousStopBytes.length) .put(CACHE_TYPE_ID) .put(previousStopBytes) .array(); }
Source:
<code>private double sumSquaredDeviation() { double m = mean(); double result = 0.0; for (Entry<ImmutableBytesPtr, Integer> entry : valueVsCount.entrySet()) { <START> double colValue = ((Number) this.stdDevColExp.getDataType().toObject(entry.getKey())) <END> .doubleValue(); double delta = colValue - m; result += (delta * delta) * entry.getValue(); } return result; }</code><technical_language>FYI, pulled in Jingcheng's implementation of DOUBLE/FLOAT. this.stdDevColExp.getDataType().getCodec().decodeDouble(entry.getKey()) instead</technical_language>

Target:
private double sumSquaredDeviation() { double m = mean(); double result = 0.0; for (Entry<ImmutableBytesPtr, Integer> entry : valueVsCount.entrySet()) { double colValue = this.stdDevColExp.getDataType().getCodec().decodeDouble(entry.getKey(), null); double delta = colValue - m; result += (delta * delta) * entry.getValue(); } return result; }
Source:
<code>GlobalConfigurationBuilder(PathAddress address) { super(CONFIGURATION, address); this.name = address.getLastElement().getValue(); this.module = new InjectedValueDependency<>(CacheContainerComponent.MODULE.getServiceName(address), Module.class); this.transport = new InjectedValueDependency<>(CacheContainerComponent.TRANSPORT.getServiceName(address), TransportConfiguration.class); this.site = new InjectedValueDependency<>(CacheContainerComponent.SITE.getServiceName(address), SiteConfiguration.class); <START> for (ThreadPoolResourceDefinition threadPoolResourceDefinition : EnumSet.allOf(ThreadPoolResourceDefinition.class)) { <END> this.pools.put(threadPoolResourceDefinition, new InjectedValueDependency<>(threadPoolResourceDefinition.getServiceName(address), ThreadPoolConfiguration.class)); } for (ScheduledThreadPoolResourceDefinition pool : EnumSet.allOf(ScheduledThreadPoolResourceDefinition.class)) { this.schedulers.put(pool, new InjectedValueDependency<>(pool.getServiceName(address), ThreadPoolConfiguration.class)); } }</code><technical_language>Rename "pool"</technical_language>

Target:
GlobalConfigurationBuilder(PathAddress address) { super(CONFIGURATION, address); this.name = address.getLastElement().getValue(); this.module = new InjectedValueDependency<>(CacheContainerComponent.MODULE.getServiceName(address), Module.class); this.transport = new InjectedValueDependency<>(CacheContainerComponent.TRANSPORT.getServiceName(address), TransportConfiguration.class); this.site = new InjectedValueDependency<>(CacheContainerComponent.SITE.getServiceName(address), SiteConfiguration.class); for (ThreadPoolResourceDefinition pool : EnumSet.allOf(ThreadPoolResourceDefinition.class)) { this.pools.put(pool, new InjectedValueDependency<>(pool.getServiceName(address), ThreadPoolConfiguration.class)); } for (ScheduledThreadPoolResourceDefinition pool : EnumSet.allOf(ScheduledThreadPoolResourceDefinition.class)) { this.schedulers.put(pool, new InjectedValueDependency<>(pool.getServiceName(address), ThreadPoolConfiguration.class)); } }
Source:
<code>private static Map<VariableReferenceExpression, VariableReferenceExpression> computeIdentityTranslations(Map<VariableReferenceExpression, RowExpression> assignments) { Map<VariableReferenceExpression, VariableReferenceExpression> outputToInput = new HashMap<>(); for (Map.Entry<VariableReferenceExpression, RowExpression> assignment : assignments.entrySet()) { if (assignment.getValue() instanceof VariableReferenceExpression) { outputToInput.put(assignment.getKey(), (VariableReferenceExpression) assignment.getValue()); } <START> } <END> return outputToInput; }</code><technical_language>Is helpful verify assignment.getValue() is OriginalExpression here</technical_language>

Target:
private static Map<VariableReferenceExpression, VariableReferenceExpression> computeIdentityTranslations(Map<VariableReferenceExpression, RowExpression> assignments) { Map<VariableReferenceExpression, VariableReferenceExpression> outputToInput = new HashMap<>(); for (Map.Entry<VariableReferenceExpression, RowExpression> assignment : assignments.entrySet()) { checkArgument(!isExpression(assignment.getValue()), "Cannot have OriginalExpression in assignments"); if (assignment.getValue() instanceof VariableReferenceExpression) { outputToInput.put(assignment.getKey(), (VariableReferenceExpression) assignment.getValue()); } } return outputToInput; }
Source:
<code>public void doesNotInvokeDelegateIfNoValidTimestamps() { Map<Long, Long> result = preStartHandlingService.get(TWO_INVALID_TIMESTAMPS); <START> assertThat(result).containsExactlyInAnyOrderEntriesOf( <END> ImmutableMap.of( ZERO_TIMESTAMP, BEFORE_TIME_TIMESTAMP, NEGATIVE_TIMESTAMP, BEFORE_TIME_TIMESTAMP)); }</code><technical_language>nit: containsOnly, this right semantics, minimises diff</technical_language>

Target:
public void doesNotInvokeDelegateIfNoValidTimestamps() { Map<Long, Long> result = preStartHandlingService.get(TWO_INVALID_TIMESTAMPS); assertThat(result).containsOnly( Maps.immutableEntry(ZERO_TIMESTAMP, BEFORE_TIME_TIMESTAMP), Maps.immutableEntry(NEGATIVE_TIMESTAMP, BEFORE_TIME_TIMESTAMP)); }
Source:
<code>public Condition getConditionById(String uuid) { <START> String conceptsAsConditions = Context.getAdministrationService().getGlobalProperty("fhir.concepts.conditions"); <END> List<String> concepts = new ArrayList<String>(); if (StringUtils.isNotBlank(conceptsAsConditions)) { concepts = Arrays.asList(conceptsAsConditions.split(",")); } Obs obs = Context.getObsService().getObsByUuid(uuid); String conceptID = Integer.toString(obs.getConcept().getId()); if (obs == null || obs.isVoided() || !concepts.contains(conceptID)) { return null; } return generateFHIRConditionForOpenMRSObs(obs); }</code><technical_language>move global property name a constants class</technical_language>

Target:
public Condition getConditionById(String uuid) { int[] conceptsAsConditions = FHIRUtils.getConceptIdsOfConditions(); Obs obs = Context.getObsService().getObsByUuid(uuid); if (obs == null || obs.isVoided() || conceptsAsConditions == null || !ArrayUtils.contains (conceptsAsConditions, obs.getConcept().getId())) { return null; } return generateFHIRConditionForOpenMRSObs(obs); }
Source:
<code>public void testDdlFailIfRenameFromNotExists() throws IOException { addWorkflow(projectDir, "acceptance/td/td_ddl/rename_not_exists.dig"); CommandStatus runStatus = runWorkflow("rename_not_exists"); <START> assertThat(runStatus.errUtf8(), runStatus.code(), not(0)); <END> }</code><technical_language>Check actual failure cause</technical_language>

Target:
public void testDdlFailIfRenameFromNotExists() throws IOException { addWorkflow(projectDir, "acceptance/td/td_ddl/rename_not_exists.dig"); CommandStatus runStatus = runWorkflow("rename_not_exists", "database=" + database); assertThat(runStatus.errUtf8(), runStatus.code(), is(not(0))); assertThat(runStatus.errUtf8(), containsString("Renaming table " + database + ".rename_table_from doesn't exist")); }