auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void testRebuildIndexesInRepository(@MavenRepository(repositoryId = REPOSITORY_RELEASES_1, setup = MavenIndexedRepositorySetup.class) Repository repository, @MavenTestArtifact(repositoryId = REPOSITORY_RELEASES_1, id = GROUP_ID + ":" + ARTIFACT_ID1, versions = { VERSION }) Path artifact1, @MavenTestArtifact(repositoryId = REPOSITORY_RELEASES_1, id = GROUP_ID + ":" + ARTIFACT_ID2, versions = { VERSION }) Path artifact2) throws Exception { final UUID jobKey = expectedJobKey; final String jobName = expectedJobName; jobManager.registerExecutionListener(jobKey.toString(), (jobKey1, statusExecuted) -> { if (StringUtils.equals(jobKey1, jobKey.toString()) && statusExecuted) { try { RepositoryPath indexPath = repositoryIndexDirectoryPathResolver.resolve(repository); RepositoryPath packedIndexPath = indexPath.resolve(IndexingContext.INDEX_FILE_PREFIX + ".gz"); <START> Assertions.assertThat(packedIndexPath).matches(Files::exists); <END> } catch (Exception e) { throw new UndeclaredThrowableException(e); } } }); addCronJobConfig(jobKey, jobName, RebuildMavenIndexesCronJob.class, STORAGE0, repository.getId()); await().atMost(EVENT_TIMEOUT_SECONDS, TimeUnit.SECONDS).untilTrue(receivedExpectedEvent()); }</code><technical_language>Cosmetic: mind static import statements for assertion methods? Thanks! :)</technical_language>

Target:
public void testRebuildIndexesInRepository(@MavenRepository(repositoryId = REPOSITORY_RELEASES_1, setup = MavenIndexedRepositorySetup.class) Repository repository, @MavenTestArtifact(repositoryId = REPOSITORY_RELEASES_1, id = GROUP_ID + ":" + ARTIFACT_ID1, versions = { VERSION }) Path artifact1, @MavenTestArtifact(repositoryId = REPOSITORY_RELEASES_1, id = GROUP_ID + ":" + ARTIFACT_ID2, versions = { VERSION }) Path artifact2) throws Exception { final UUID jobKey = expectedJobKey; final String jobName = expectedJobName; jobManager.registerExecutionListener(jobKey.toString(), (jobKey1, statusExecuted) -> { if (StringUtils.equals(jobKey1, jobKey.toString()) && statusExecuted) { try { RepositoryPath indexPath = repositoryIndexDirectoryPathResolver.resolve(repository); RepositoryPath packedIndexPath = indexPath.resolve(IndexingContext.INDEX_FILE_PREFIX + ".gz"); assertThat(packedIndexPath).matches(Files::exists); } catch (Exception e) { throw new UndeclaredThrowableException(e); } } }); addCronJobConfig(jobKey, jobName, RebuildMavenIndexesCronJob.class, STORAGE0, repository.getId()); await().atMost(EVENT_TIMEOUT_SECONDS, TimeUnit.SECONDS).untilTrue(receivedExpectedEvent()); }
Source:
<code>public void collect(RowData physicalValueRow) { if (keyProjection.length == 0) { emitRow(null, (GenericRowData) physicalValueRow); return; } for (RowData physicalKeyRow : physicalKeyRows) { if (physicalValueRow == null) { <START> physicalKeyRow.setRowKind(RowKind.DELETE); <END> } emitRow((GenericRowData) physicalKeyRow, (GenericRowData) physicalValueRow); } }</code><technical_language>need set RowKind keyRow, it</technical_language>

Target:
public void collect(RowData physicalValueRow) { if (keyProjection.length == 0) { emitRow(null, (GenericRowData) physicalValueRow); return; } for (RowData physicalKeyRow : physicalKeyRows) { emitRow((GenericRowData) physicalKeyRow, (GenericRowData) physicalValueRow); } }
Source:
<code>public Cache<ImmutableBytesPtr,PTable> getMetaDataCache() { Cache<ImmutableBytesPtr,PTable> result = metaDataCache; if (result == null) { synchronized(this) { result = metaDataCache; if(result == null) { long maxSize = config.getLong(QueryServices.MAX_SERVER_METADATA_CACHE_SIZE_ATTRIB, QueryServicesOptions.DEFAULT_MAX_SERVER_METADATA_CACHE_SIZE); <START> long maxTTL = config.getLong(QueryServices.STATS_UPDATE_FREQ_MS_ATTRIB, <END> QueryServicesOptions.DEFAULT_STATS_UPDATE_FREQ_MS); metaDataCache = result = CacheBuilder.newBuilder() .maximumWeight(maxSize) .expireAfterAccess(maxTTL, TimeUnit.MILLISECONDS) .weigher(new Weigher<ImmutableBytesPtr, PTable>() { @Override public int weigh(ImmutableBytesPtr key, PTable table) { return SizedUtil.IMMUTABLE_BYTES_PTR_SIZE + key.getLength() + table.getEstimatedSize(); } }) .build(); } } } return result; }</code><technical_language>this config prop removed purpose</technical_language>

Target:
public Cache<ImmutableBytesPtr,PTable> getMetaDataCache() { Cache<ImmutableBytesPtr,PTable> result = metaDataCache; if (result == null) { synchronized(this) { result = metaDataCache; if(result == null) { long maxTTL = Math.min(config.getLong( QueryServices.MAX_SERVER_METADATA_CACHE_TIME_TO_LIVE_MS_ATTRIB, QueryServicesOptions.DEFAULT_MAX_SERVER_METADATA_CACHE_TIME_TO_LIVE_MS), config.getLong( QueryServices.STATS_UPDATE_FREQ_MS_ATTRIB, QueryServicesOptions.DEFAULT_STATS_UPDATE_FREQ_MS)); long maxSize = config.getLong(QueryServices.MAX_SERVER_METADATA_CACHE_SIZE_ATTRIB, QueryServicesOptions.DEFAULT_MAX_SERVER_METADATA_CACHE_SIZE); metaDataCache = result = CacheBuilder.newBuilder() .maximumWeight(maxSize) .expireAfterAccess(maxTTL, TimeUnit.MILLISECONDS) .weigher(new Weigher<ImmutableBytesPtr, PTable>() { @Override public int weigh(ImmutableBytesPtr key, PTable table) { return SizedUtil.IMMUTABLE_BYTES_PTR_SIZE + key.getLength() + table.getEstimatedSize(); } }) .build(); } } } return result; }
Source:
<code>public Set<Diagnostic> validate(Iterator<EObject> eObjectsIterator) throws ValidationCanceledException { final Set<Diagnostic> diagnostics = new LinkedHashSet<Diagnostic>(); if (validationRunning) { return diagnostics; } validationRunning = true; try { final boolean isTreeIterator = eObjectsIterator instanceof TreeIterator<?>; while (!cancelationRequested && eObjectsIterator.hasNext()) { boolean isSubtreePruned = false; final EObject eObject = eObjectsIterator.next(); <START> if (isTreeIterator && isSkipSubtree(eObject, null)) { <END> ((TreeIterator<?>) eObjectsIterator).prune(); isSubtreePruned = true; } if (isFiltered(eObject)) { continue; } final Diagnostic diagnostic = doValidate(eObject); if (isTreeIterator && !isSubtreePruned && isSkipSubtree(eObject, diagnostic)) { ((TreeIterator<?>) eObjectsIterator).prune(); } if (isIgnored(eObject, diagnostic)) { continue; } diagnostics.add(diagnostic); invokeValidationResultListeners(eObject, diagnostic, true); } } finally { validationRunning = false; } if (cancelationRequested) { throw new ValidationCanceledException(); } return diagnostics; }</code><technical_language>I skip subtrees for TreeIterators</technical_language>

Target:
public Set<Diagnostic> validate(Iterator<EObject> eObjectsIterator) throws ValidationCanceledException { final Set<Diagnostic> diagnostics = new LinkedHashSet<Diagnostic>(); if (validationRunning) { return diagnostics; } validationRunning = true; try { final boolean isTreeIterator = eObjectsIterator instanceof TreeIterator<?>; while (!cancelationRequested && eObjectsIterator.hasNext()) { final EObject eObject = eObjectsIterator.next(); Diagnostic diagnostic = null; boolean isSubtreePruned = false; if (isTreeIterator && isSkipSubtree(eObject, Optional.ofNullable(diagnostic))) { ((TreeIterator<?>) eObjectsIterator).prune(); isSubtreePruned = true; } if (isFiltered(eObject)) { continue; } diagnostic = doValidate(eObject); if (isTreeIterator && !isSubtreePruned && isSkipSubtree(eObject, Optional.of(diagnostic))) { ((TreeIterator<?>) eObjectsIterator).prune(); } if (isIgnored(eObject, diagnostic)) { continue; } diagnostics.add(diagnostic); invokeValidationResultListeners(eObject, diagnostic, true); } } finally { validationRunning = false; } if (cancelationRequested) { throw new ValidationCanceledException(); } return diagnostics; }
Source:
<code>private void configureButtons(AlertDialog.Builder builder) { builder.setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dismiss(); } }); builder.setPositiveButton(R.string.delete, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { Fragment target = getTargetFragment(); if (target != null) { <START> target.onActivityResult(getTargetRequestCode(), Activity.RESULT_OK, new Intent()); <END> } dismiss(); } }); }</code><technical_language>Do if data null instead check for this of if (data != null) statement? I care data, accidentally remove new Intent() "looks" kind of pointless here. a big deal extra memory (a tiny bit, is :P )</technical_language>

Target:
private void configureButtons(AlertDialog.Builder builder) { builder.setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dismiss(); } }); builder.setPositiveButton(R.string.delete, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { Fragment target = getTargetFragment(); if (target != null) { target.onActivityResult(getTargetRequestCode(), Activity.RESULT_OK, null); } dismiss(); } }); }
Source:
<code>public URL addParameters(Map<String, String> parameters) { if (CollectionUtils.isEmptyMap(parameters)) { return this; } boolean hasAndEqual = true; for (Map.Entry<String, String> entry : parameters.entrySet()) { String value = getParameters().get(entry.getKey()); if (value == null) { if (entry.getValue() != null) { hasAndEqual = false; break; } } else { if (!value.equals(entry.getValue())) { hasAndEqual = false; break; } } } if (hasAndEqual) { return this; } if (frozen) { Map<String, String> map = new HashMap<>(getParameters()); <START> map.putAll(parameters); <END> return new URL(protocol, username, password, host, port, path, map); } else { getParameters().putAll(parameters); resetMethodParameters(); return this; } }</code><technical_language>Create map expect size reduce memory, this: Map<String, String> srcParams = getParameters(); Map<String, String> newMap = new HashMap<>((int)((srcParams.size() + parameters.size) / 0.75 + 1)); newMap.putAll(srcParams); newMap.putAll(parameters);</technical_language>

Target:
public URL addParameters(Map<String, String> parameters) { if (CollectionUtils.isEmptyMap(parameters)) { return this; } boolean hasAndEqual = true; for (Map.Entry<String, String> entry : parameters.entrySet()) { String value = getParameters().get(entry.getKey()); if (value == null) { if (entry.getValue() != null) { hasAndEqual = false; break; } } else { if (!value.equals(entry.getValue())) { hasAndEqual = false; break; } } } if (hasAndEqual) { return this; } Map<String, String> srcParams = getParameters(); Map<String, String> newMap = new HashMap<>((int) ((srcParams.size() + parameters.size()) / 0.75 + 1)); newMap.putAll(srcParams); newMap.putAll(parameters); return new URL(protocol, username, password, host, port, path, newMap); }
Source:
<code>private void checkSymbolUsage(ImportTree importTree, String importName) { IdentifierTree id = null; if (importTree.qualifiedIdentifier().is(Tree.Kind.IDENTIFIER)) { id = (IdentifierTree) importTree.qualifiedIdentifier(); } else if (importTree.qualifiedIdentifier().is(Tree.Kind.MEMBER_SELECT)) { id = ((MemberSelectExpressionTree) importTree.qualifiedIdentifier()).identifier(); } if (id != null) { SemanticModel semanticModel = (SemanticModel) context.getSemanticModel(); <START> Symbol symbol = semanticModel.getSymbol(importTree); <END> Symbol owner = symbol.owner(); if (symbol.isVariableSymbol() && symbol.usages().stream().allMatch(identifierTree -> semanticModel.getEnclosingClass(identifierTree) == owner)) { context.reportIssue(this, importTree, "Remove this unused import '" + importName + "'."); } } }</code><technical_language>ensure semanticModeland symbol null it, alternatively run rule semantic is ensure verifyNoIssueWithoutSemantic</technical_language>

Target:
private void checkSymbolUsage(ImportTree importTree, String importName) { IdentifierTree id = null; if (importTree.qualifiedIdentifier().is(Tree.Kind.IDENTIFIER)) { id = (IdentifierTree) importTree.qualifiedIdentifier(); } else if (importTree.qualifiedIdentifier().is(Tree.Kind.MEMBER_SELECT)) { id = ((MemberSelectExpressionTree) importTree.qualifiedIdentifier()).identifier(); } if (id != null) { SemanticModel semanticModel = (SemanticModel) context.getSemanticModel(); if (semanticModel != null) { Symbol symbol = semanticModel.getSymbol(importTree); if (symbol != null) { Symbol owner = symbol.owner(); if (symbol.isVariableSymbol() && symbol.usages().stream().allMatch(identifierTree -> semanticModel.getEnclosingClass(identifierTree) == owner)) { context.reportIssue(this, importTree, "Remove this unused import '" + importName + "'."); } } } } }
Source:
<code>public CohortDefinition getEncounterSearchAdvanced() { EncounterCohortDefinition cd = new EncounterCohortDefinition(); cd.addParameter(new Parameter("onOrAfter", "reporting.parameter.startDate", Date.class)); <START> cd.addParameter(new Parameter("onOrBefore", "reporting.parameter.endDate", Date.class)); <END> cd.addParameter(new Parameter("atLeastCount", "reporting.parameter.atleast", Integer.class)); cd.addParameter(new Parameter("atMostCount", "reporting.parameter.atMost", Integer.class)); cd.addParameter(new Parameter("encounterTypeList", "reporting.parameter.encounterTypeList", EncounterType.class, List.class, null)); cd.addParameter(new Parameter("formList", "reporting.parameter.formList", Form.class, List.class, null)); cd.addParameter(new Parameter("locationList", "reporting.parameter.location", Location.class, List.class, null)); cd.addParameter(new Parameter("timeQualifier", "reporting.parameter.timeQualifier", TimeQualifier.class)); return cd; }</code><technical_language>Please label reporting.parameter.onOrAfter reporting.parameter.onOrBefore</technical_language>

Target:
public CohortDefinition getEncounterSearchAdvanced() { EncounterCohortDefinition cd = new EncounterCohortDefinition(); cd.addParameter(new Parameter("onOrAfter", "reporting.parameter.onOrAfter", Date.class)); cd.addParameter(new Parameter("onOrBefore", "reporting.parameter.onOrBefore", Date.class)); cd.addParameter(new Parameter("atLeastCount", "reporting.parameter.atLeastCount", Integer.class)); cd.addParameter(new Parameter("atMostCount", "reporting.parameter.atMostCount", Integer.class)); cd.addParameter(new Parameter("encounterTypeList", "reporting.parameter.encounterTypeList", EncounterType.class, List.class, null)); cd.addParameter(new Parameter("formList", "reporting.parameter.formList", Form.class, List.class, null)); cd.addParameter(new Parameter("locationList", "reporting.parameter.locationList", Location.class, List.class, null)); cd.addParameter(new Parameter("timeQualifier", "reporting.parameter.timeQualifier", TimeQualifier.class)); return cd; }
Source:
<code><START> public SshAuthRequest(String username, SocketAddress clientAddress) { <END> this(username, null, clientAddress); }</code><technical_language>Done, added new constructors, public key password public key</technical_language>

Target:
public SshAuthRequest(String username, SocketAddress clientAddress) { this(username, null, null, clientAddress); }
Source:
<code>private void connect() throws IOException { if (socket != null) return; Socket newSocket = new Socket(); newSocket.connect(new InetSocketAddress(hostname, 7818)); newSocket.setSoTimeout(30000); newSocket.setTcpNoDelay(true); socket = newSocket; outStream = new DataOutputStream(new BufferedOutputStream(socket.getOutputStream())); inStream = new DataInputStream(new BufferedInputStream(socket.getInputStream())); if (transcodeMode != null && transcodeMode.length() > 0) { outStream.write(("XCODE_SETUP " + transcodeMode + "\r\n").getBytes(Sage.BYTE_CHARSET)); outStream.flush(); String response = Sage.readLineBytes(inStream); if (!"OK".equals(response)) throw new java.io.IOException("Error with remote transcode setup for " + transcodeMode + " of: " + response); } <START> outStream.write("OPENW ".getBytes(Sage.BYTE_CHARSET)); <END> outStream.write(remoteFilename.getBytes(StandardCharsets.UTF_16BE)); outStream.write("\r\n".getBytes(Sage.BYTE_CHARSET)); outStream.flush(); String response = Sage.readLineBytes(inStream); if (!"OK".equals(response)) { disconnect(); throw new IOException("Error opening remote file of:" + response); } }</code><technical_language>I curious do 'readonly' field here. :) open a remote file media server...you open in read mode write mode; time (although MediaServer extended support a case easily opening a RandomAccessFile channel a FileOuptutStream object in openWriteFile method). this is currently done; calls write method in fail files opened in read mode server always. other work in here...I'd change MediaServer a RandomAccessFile's channel instead of FileOutputStream (the uploadStream field); this OPENWRITEW instead of OPENW if readonly is set false (and prior that, request upload key server grant write access). _should_ performance implications</technical_language>

Target:
private void connect() throws IOException { if (socket != null) return; Socket newSocket = new Socket(); newSocket.connect(new InetSocketAddress(hostname, 7818)); newSocket.setSoTimeout(30000); newSocket.setTcpNoDelay(true); socket = newSocket; outStream = new DataOutputStream(new BufferedOutputStream(socket.getOutputStream())); inStream = new DataInputStream(new BufferedInputStream(socket.getInputStream())); if (transcodeMode != null && transcodeMode.length() > 0) { outStream.write(("XCODE_SETUP " + transcodeMode + "\r\n").getBytes(Sage.BYTE_CHARSET)); outStream.flush(); String response = Sage.readLineBytes(inStream); if (!"OK".equals(response)) throw new java.io.IOException("Error with remote transcode setup for " + transcodeMode + " of: " + response); } if (readonly) { outStream.write("OPENW ".getBytes(Sage.BYTE_CHARSET)); outStream.write(remoteFilename.getBytes(StandardCharsets.UTF_16BE)); } else { outStream.write("WRITEOPENW ".getBytes(Sage.BYTE_CHARSET)); outStream.write(remoteFilename.getBytes(StandardCharsets.UTF_16BE)); outStream.write((" " + Integer.toString(uploadId)).getBytes(Sage.BYTE_CHARSET)); } outStream.write("\r\n".getBytes(Sage.BYTE_CHARSET)); outStream.flush(); String response = Sage.readLineBytes(inStream); if (!"OK".equals(response)) { disconnect(); throw new IOException("Error opening remote file of:" + response); } }
Source:
<code>public void onProcessComplete(int exitValue) { <START> LOGGER.info("Model run complete."); <END> }</code><technical_language>For consistency, this a LOG_MODEL_RUN_COMPLETE</technical_language>

Target:
public void onProcessComplete(int exitValue) { LOGGER.info(LOG_MODEL_RUN_COMPLETE); }
Source:
<code>private VdsDynamic createVdsDynamic(V1Node node) { Map<String, String> labels = node.getMetadata().getLabels(); VdsDynamic dynamic = new VdsDynamic(); dynamic.setId(vdsManager.getVdsId()); dynamic.setStatus("true".equals(labels.get("kubevirt.io/schedulable")) ? VDSStatus.Up : <START> VDSStatus.NonOperational); <END> dynamic.setCpuThreads(node.getStatus().getCapacity().getOrDefault("cpu", new Quantity("0")).getNumber().intValue()); dynamic.setPhysicalMemMb(4809); dynamic.setKernelVersion(node.getStatus().getNodeInfo().getKernelVersion()); return dynamic; }</code><technical_language>update non-operational status is done SetNonOperationalVdsCommand for rhv hosts. here, kubevirt node status expected change of this context. I if include reasoning (just error message in log audit log event) explaining host status is non-operational. Also, if issues node, include log</technical_language>

Target:
private VdsDynamic createVdsDynamic(V1Node node) { Map<String, String> labels = node.getMetadata().getLabels(); VdsDynamic dynamic = new VdsDynamic(); dynamic.setId(vdsManager.getVdsId()); if ("true".equals(labels.get("kubevirt.io/schedulable"))) { dynamic.setStatus(VDSStatus.Up); } else { dynamic.setStatus(VDSStatus.NonOperational); dynamic.setNonOperationalReason(NonOperationalReason.KUBEVIRT_NOT_SCHEDULABLE); } dynamic.setCpuThreads(node.getStatus().getCapacity().getOrDefault("cpu", new Quantity("0")).getNumber().intValue()); dynamic.setPhysicalMemMb(4809); dynamic.setKernelVersion(node.getStatus().getNodeInfo().getKernelVersion()); return dynamic; }
Source:
<code>public static ImmutableMap<String, Ds3Type> removeDollarSignFromTypeMap( final ImmutableMap<String, Ds3Type> map) throws TypeRenamingConflictException { if (isEmpty(map)) { return ImmutableMap.of(); } final ImmutableMap.Builder<String, Ds3Type> builder = ImmutableMap.builder(); <START> for (Map.Entry<String, Ds3Type> entry : map.entrySet()) { <END> final String typeName = removeDollarSignFromName(entry.getKey()); final Ds3Type type = removeDollarSignFromType(entry.getValue()); if (!containsType(typeName, entry.getValue(), builder.build())) { builder.put(typeName, type); } } return builder.build(); }</code><technical_language>Missing final</technical_language>

Target:
public static ImmutableMap<String, Ds3Type> removeDollarSignFromTypeMap( final ImmutableMap<String, Ds3Type> map) throws TypeRenamingConflictException { if (isEmpty(map)) { return ImmutableMap.of(); } final ImmutableMap.Builder<String, Ds3Type> builder = ImmutableMap.builder(); for (final Map.Entry<String, Ds3Type> entry : map.entrySet()) { final String typeName = removeDollarSignFromName(entry.getKey()); final Ds3Type type = removeDollarSignFromType(entry.getValue()); if (!containsType(typeName, entry.getValue(), builder.build())) { builder.put(typeName, type); } } return builder.build(); }
Source:
<code>protected void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { Integer applicationMode = getApplicationMode(getEngineSessionId(request)); request.setAttribute(ATTR_APPLICATION_MODE, getApplicationModeObject(applicationMode)); List<PluginData> pluginData = getPluginData(); request.setAttribute(ATTR_PLUGIN_DEFS, getPluginDefinitionsArray(pluginData)); request.setAttribute(ATTR_ENGINE_REPORTS_BASE_URL, getReportInit(reportRedirectUrl.substring(reportBaseUrl.length()), reportRightClickRedirectUrl.substring(reportBaseUrl.length()))); request.setAttribute(ATTR_DISPLAY_SUPPORTED_BROWSER_WARNING, <START> getValueObject(String.valueOf(getDisplaySupportedBrowserWarning()))); <END> super.doGet(request, response); }</code><technical_language>This effectively embed String, embed JS boolean instead? this change, GWT host page contain: var displaySupportedBrowserWarning = { value: "true" }; snippet below, simply: var displaySupportedBrowserWarning = true; Java servlet code snippet: request.setAttribute(ATTR_DISPLAY_SUPPORTED_BROWSER_WARNING, getDisplaySupportedBrowserWarning() ? BooleanNode.TRUE : BooleanNode.FALSE);</technical_language>

Target:
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { Integer applicationMode = getApplicationMode(getEngineSessionId(request)); request.setAttribute(ATTR_APPLICATION_MODE, getApplicationModeObject(applicationMode)); List<PluginData> pluginData = getPluginData(); request.setAttribute(ATTR_PLUGIN_DEFS, getPluginDefinitionsArray(pluginData)); request.setAttribute(ATTR_ENGINE_REPORTS_BASE_URL, getReportInit(reportRedirectUrl.substring(reportBaseUrl.length()), reportRightClickRedirectUrl.substring(reportBaseUrl.length()))); request.setAttribute(ATTR_DISPLAY_SUPPORTED_BROWSER_WARNING, getDisplaySupportedBrowserWarning() ? BooleanNode.TRUE : BooleanNode.FALSE); super.doGet(request, response); }
Source:
<code>public void recreateMediaStreamTracks() { <START> final ArrayList<SourceGroupPacketExtension> sourceGroups = new ArrayList<>(); <END> final ArrayList<SourcePacketExtension> sources = new ArrayList<>(); for (ChannelShim channelShim : channelShims) { if (MediaType.VIDEO.equals(channelShim.getMediaType())) { final Collection<SourceGroupPacketExtension> channelSourceGroups = channelShim.getSourceGroups(); if (channelSourceGroups != null) { sourceGroups.addAll(channelSourceGroups); } final Collection<SourcePacketExtension> channelSources = channelShim.getSources(); if (channelSources != null) { sources.addAll(channelSources); } } } if (!sources.isEmpty() || !sourceGroups.isEmpty()) { MediaStreamTrackDesc[] tracks = MediaStreamTrackFactory.createMediaStreamTracks( sources, sourceGroups); setMediaStreamTracks(tracks); } }</code><technical_language>please simplify this a bit? this work: Stream<ChannelShim> videoChannels = channelShims.stream().filter(c -> MediaType.VIDEO.equals(c.getMediaType())); List<SourcePacketExtension> sources = videoChannels.map(ChannelShim::getSources).filter(Objects::nonNull) .flatMap(s -> s.stream()).collect(Collectors.toList());</technical_language>

Target:
public void recreateMediaStreamTracks() { final Supplier<Stream<ChannelShim>> videoChannels = () -> channelShims .stream() .filter(c -> MediaType.VIDEO.equals(c.getMediaType())); final List<SourcePacketExtension> sources = videoChannels .get() .map(ChannelShim::getSources) .filter(Objects::nonNull) .flatMap(Collection::stream) .collect(Collectors.toList()); final List<SourceGroupPacketExtension> sourceGroups = videoChannels .get() .map(ChannelShim::getSourceGroups) .filter(Objects::nonNull) .flatMap(Collection::stream) .collect(Collectors.toList()); if (!sources.isEmpty() || !sourceGroups.isEmpty()) { MediaStreamTrackDesc[] tracks = MediaStreamTrackFactory.createMediaStreamTracks( sources, sourceGroups); setMediaStreamTracks(tracks); } }
Source:
<code><START> boolean verifySignatureFor(String algorithm, byte[] secretBytes, String header, String payload, byte[] signatureBytes) throws NoSuchAlgorithmException, InvalidKeyException { <END> return verifySignatureFor(algorithm, secretBytes, header.getBytes(Charsets.UTF_8), payload.getBytes(Charsets.UTF_8), signatureBytes); }</code><technical_language>missing something, this method safely deleted byte[] header payload variant instead</technical_language>

Target:
boolean verifySignatureFor(String algorithm, byte[] secretBytes, String header, String payload, byte[] signatureBytes) throws NoSuchAlgorithmException, InvalidKeyException { return verifySignatureFor(algorithm, secretBytes, header.getBytes(StandardCharsets.UTF_8), payload.getBytes(StandardCharsets.UTF_8), signatureBytes); }
Source:
<code>public void close() { boolean success = false; writeLockAll(); try { clear(); <START> success = true; <END> } finally { writeUnlockAll(); if (success) { segments.clear(); } } }</code><technical_language>this buys us? is _expected_ failure path managed writeLockAll() simply move segments.clear() finally block</technical_language>

Target:
public void close() { writeLockAll(); try { clear(); } finally { writeUnlockAll(); } segments.clear(); }
Source:
<code>public T setUrl(String url) { if (!url.contains("://")){ <START> url = "<LINK_0>" + url; <END> } return setUri(Uri.create(url)); }</code><technical_language>this</technical_language>

Target:
public T setUrl(String url) { return setUri(Uri.create(url)); }
Source:
<code>private void highlightActiveMenuItem() { <START> int highlightItem = -1; <END> if (page.getTopFragment() instanceof HistoryFragment) { highlightItem = R.id.nav_item_history; } else if (page.getTopFragment() instanceof SavedPagesFragment) { highlightItem = R.id.nav_item_saved_pages; } else if (page.getTopFragment() instanceof NearbyFragment) { highlightItem = R.id.nav_item_nearby; } else if (page.getTopFragment() instanceof PageViewFragmentInternal) { PageViewFragmentInternal fragment = (PageViewFragmentInternal) page.getTopFragment(); if (fragment.getHistoryEntry() != null) { if (fragment.getHistoryEntry().getSource() == HistoryEntry.SOURCE_MAIN_PAGE) { highlightItem = R.id.nav_item_today; } else if (fragment.getHistoryEntry().getSource() == HistoryEntry.SOURCE_RANDOM) { highlightItem = R.id.nav_item_random; } } } if (highlightItem != -1) { page.getNavDrawer().getMenu().findItem(highlightItem).setChecked(true); } }</code><technical_language>Minor: consider View.NO_ID @ResId annotation</technical_language>

Target:
private void highlightActiveMenuItem() { for (int id : ACTION_ITEMS_ALL) { page.getNavDrawer().getMenu().findItem(id).setCheckable(true) .setChecked(false); } int highlightItem = -1; if (page.getTopFragment() instanceof HistoryFragment) { highlightItem = R.id.nav_item_history; } else if (page.getTopFragment() instanceof SavedPagesFragment) { highlightItem = R.id.nav_item_saved_pages; } else if (page.getTopFragment() instanceof NearbyFragment) { highlightItem = R.id.nav_item_nearby; } else if (page.getTopFragment() instanceof PageViewFragmentInternal) { PageViewFragmentInternal fragment = (PageViewFragmentInternal) page.getTopFragment(); if (fragment.getHistoryEntry() != null) { if (fragment.getHistoryEntry().getSource() == HistoryEntry.SOURCE_MAIN_PAGE) { highlightItem = R.id.nav_item_today; } else if (fragment.getHistoryEntry().getSource() == HistoryEntry.SOURCE_RANDOM) { highlightItem = R.id.nav_item_random; } } } if (highlightItem != -1) { page.getNavDrawer().getMenu().findItem(highlightItem).setChecked(true); } }
Source:
<code>public boolean matches(ITmfEvent event) { if (event == null || fEventAspect == null) { return false; } Object value = fEventAspect.resolve(event); if (value == null) { return false; } if (fType == Type.NUM) { if (fValueNumber != null) { if (value instanceof Number) { <START> double valueDouble = ((Number) value).doubleValue(); <END> return (Double.compare(valueDouble, fValueNumber.doubleValue()) == fResult) ^ fNot; } try { double valueDouble = Long.decode(value.toString()).doubleValue(); return (Double.compare(valueDouble, fValueNumber.doubleValue()) == fResult) ^ fNot; } catch (NumberFormatException e) { } try { double valueDouble = NumberFormat.getInstance().parse(value.toString()).doubleValue(); return (Double.compare(valueDouble, fValueNumber.doubleValue()) == fResult) ^ fNot; } catch (ParseException e) { } } } else if (fType == Type.ALPHA) { String valueString = value.toString(); int comp = (int) Math.signum(valueString.compareTo(fValue.toString())); return (comp == fResult) ^ fNot; } else if (fType == Type.TIMESTAMP) { if (fValueTimestamp != null) { if (value instanceof ITmfTimestamp) { ITmfTimestamp valueTimestamp = (ITmfTimestamp) value; return (valueTimestamp.compareTo(fValueTimestamp) == fResult) ^ fNot; } try { ITmfTimestamp valueTimestamp = new TmfNanoTimestamp((long) (1E9 * NumberFormat .getInstance().parse(value.toString()).doubleValue())); return (valueTimestamp.compareTo(fValueTimestamp) == fResult) ^ fNot; } catch (ParseException e) { } } } return false; }</code><technical_language>do compare double? In of tests fValueNumber is Long. If compare double give expected result of loss of precission</technical_language>

Target:
public boolean matches(ITmfEvent event) { if (event == null || fEventAspect == null) { return false; } Object value = fEventAspect.resolve(event); if (value == null) { return false; } if (fType == Type.NUM) { if (fValueNumber instanceof Double) { Number valueNumber = toNumber(value); if (valueNumber != null) { return (Double.compare(valueNumber.doubleValue(), fValueNumber.doubleValue()) == fResult) ^ fNot; } } else if (fValueNumber != null) { Number valueNumber = toNumber(value); if (valueNumber instanceof Double || valueNumber instanceof Float) { return (Double.compare(valueNumber.doubleValue(), fValueNumber.doubleValue()) == fResult) ^ fNot; } else if (valueNumber != null) { return (Long.compare(valueNumber.longValue(), fValueNumber.longValue()) == fResult) ^ fNot; } } } else if (fType == Type.ALPHA) { String valueString = value.toString(); int comp = (int) Math.signum(valueString.compareTo(fValue.toString())); return (comp == fResult) ^ fNot; } else if (fType == Type.TIMESTAMP) { if (fValueTimestamp != null) { ITmfTimestamp valueTimestamp = toTimestamp(value); if (valueTimestamp != null) { int comp = (int) Math.signum(valueTimestamp.compareTo(fValueTimestamp)); return (comp == fResult) ^ fNot; } } } return false; }
Source:
<code>public void onFileChange(File file) { try { if (isXmlTypeDescriptorFile(file.getAbsolutePath())) { XmlDescriptorParser.parse(file.getAbsolutePath()).forEach(simpleDescriptor -> { <START> topologyService.deployDescriptor(simpleDescriptor.getName() + ".json", JsonUtils.renderAsJsonString(simpleDescriptor)); <END> }); } else { Map<String, File> result = SimpleDescriptorHandler.handle(gatewayConfig, file, topologiesDir, GatewayServer.getGatewayServices(), aliasService); log.generatedTopologyForDescriptorChange(result.get(SimpleDescriptorHandler.RESULT_TOPOLOGY).getName(), file.getName()); String providerConfig = FilenameUtils.normalize(result.get(SimpleDescriptorHandler.RESULT_REFERENCE).getAbsolutePath()); if (!providerConfigReferences.containsKey(providerConfig)) { providerConfigReferences.put(providerConfig, new ArrayList<>()); } List<String> refs = providerConfigReferences.get(providerConfig); String descriptorName = FilenameUtils.normalize(file.getAbsolutePath()); if (!refs.contains(descriptorName)) { for (List<String> descs : providerConfigReferences.values()) { descs.remove(descriptorName); } refs.add(descriptorName); log.addedProviderConfigurationReference(descriptorName, providerConfig); } } } catch (IllegalArgumentException e) { log.simpleDescriptorHandlingError(file.getName(), e); String descriptorName = FilenameUtils.normalize(file.getAbsolutePath()); for (List<String> descs : providerConfigReferences.values()) { descs.remove(descriptorName); } } catch (Exception e) { log.simpleDescriptorHandlingError(file.getName(), e); } }</code><technical_language>Is .json correct here? This is in xml type descriptor</technical_language>

Target:
public void onFileChange(File file) { try { Map<String, File> result = SimpleDescriptorHandler.handle(gatewayConfig, file, topologiesDir, aliasService); log.generatedTopologyForDescriptorChange(result.get(SimpleDescriptorHandler.RESULT_TOPOLOGY).getName(), file.getName()); String providerConfig = FilenameUtils.normalize(result.get(SimpleDescriptorHandler.RESULT_REFERENCE).getAbsolutePath()); if (!providerConfigReferences.containsKey(providerConfig)) { providerConfigReferences.put(providerConfig, new ArrayList<>()); } List<String> refs = providerConfigReferences.get(providerConfig); String descriptorName = FilenameUtils.normalize(file.getAbsolutePath()); if (!refs.contains(descriptorName)) { for (List<String> descs : providerConfigReferences.values()) { descs.remove(descriptorName); } refs.add(descriptorName); log.addedProviderConfigurationReference(descriptorName, providerConfig); } } catch (IllegalArgumentException e) { log.simpleDescriptorHandlingError(file.getName(), e); String descriptorName = FilenameUtils.normalize(file.getAbsolutePath()); for (List<String> descs : providerConfigReferences.values()) { descs.remove(descriptorName); } } catch (Exception e) { log.simpleDescriptorHandlingError(file.getName(), e); } }
Source:
<code>private void saveToStorage(final Location coordinates) { <START> Schedulers.io().scheduleDirect(() -> { <END> DataStore.saveTrailpoint(coordinates); }); }</code><technical_language>For other calls of scheduleDirect, use: suggestion Schedulers.io().scheduleDirect(new Runnable() {</technical_language>

Target:
private void saveToStorage(final Location coordinates) { Schedulers.io().scheduleDirect(new Runnable() { @Override public void run() { DataStore.saveTrailpoint(coordinates); } }); }
Source:
<code><START> private static <END> Version readWorkspaceVersion(URL workspace) { File versionFile = getVersionFile(workspace, false); if (versionFile == null || !versionFile.exists()) { return null; } try { Properties props = new Properties(); FileInputStream is = new FileInputStream(versionFile); try { props.load(is); } finally { is.close(); } String versionString = props.getProperty(WORKSPACE_CHECK_REFERENCE_BUNDLE_NAME); if (versionString != null) { return Version.parseVersion(versionString); } versionString= props.getProperty(WORKSPACE_CHECK_REFERENCE_BUNDLE_NAME_LEGACY); if (versionString != null) { return Version.parseVersion(versionString); } return null; } catch (IOException e) { IDEWorkbenchPlugin.log("Could not read version file " + versionFile, new Status( IStatus.ERROR, IDEWorkbenchPlugin.IDE_WORKBENCH, IStatus.ERROR, e.getMessage() == null ? "" : e.getMessage(), e)); return null; } catch (IllegalArgumentException e) { IDEWorkbenchPlugin.log("Could not parse version in " + versionFile, new Status( IStatus.ERROR, IDEWorkbenchPlugin.IDE_WORKBENCH, IStatus.ERROR, e.getMessage() == null ? "" : e.getMessage(), e)); return null; } }</code><technical_language>I want this protected</technical_language>

Target:
protected static Version readWorkspaceVersion(URL workspace) { File versionFile = getVersionFile(workspace, false); if (versionFile == null || !versionFile.exists()) { return null; } try { Properties props = new Properties(); FileInputStream is = new FileInputStream(versionFile); try { props.load(is); } finally { is.close(); } String versionString = props.getProperty(WORKSPACE_CHECK_REFERENCE_BUNDLE_NAME); if (versionString != null) { return Version.parseVersion(versionString); } versionString= props.getProperty(WORKSPACE_CHECK_REFERENCE_BUNDLE_NAME_LEGACY); if (versionString != null) { return Version.parseVersion(versionString); } return null; } catch (IOException e) { IDEWorkbenchPlugin.log("Could not read version file " + versionFile, new Status( IStatus.ERROR, IDEWorkbenchPlugin.IDE_WORKBENCH, IStatus.ERROR, e.getMessage() == null ? "" : e.getMessage(), e)); return null; } catch (IllegalArgumentException e) { IDEWorkbenchPlugin.log("Could not parse version in " + versionFile, new Status( IStatus.ERROR, IDEWorkbenchPlugin.IDE_WORKBENCH, IStatus.ERROR, e.getMessage() == null ? "" : e.getMessage(), e)); return null; } }
Source:
<code>public int prepare(Xid externalXid) throws XAException { <START> return joinAndRethrowXAException(CompletableFuture.supplyAsync(() -> txTable.prepare(externalXid), executor)); <END> }</code><technical_language>CompletableFutures.COMPLETED_NULL.thenComposeAsync(...) avoid double wrapping result. worth adding a static method in CompletableFutures</technical_language>

Target:
public int prepare(Xid externalXid) throws XAException { return runAsyncAndJoinRethrowingXAException(ignore -> txTable.prepare(externalXid)); }
Source:
<code>public void sendOffsetsToTransaction(Map<TopicPartition, OffsetAndMetadata> offsets, ConsumerGroupMetadata groupMetadata) <START> throws ProducerFencedException, <END> CommitFailedException, FencedInstanceIdException { sendOffsetsToTransactionInternal(offsets, groupMetadata); }</code><technical_language>nit: mentioned elsewhere, I need add of exceptions method. runtime exceptions, user read docs</technical_language>

Target:
public void sendOffsetsToTransaction(Map<TopicPartition, OffsetAndMetadata> offsets, ConsumerGroupMetadata groupMetadata) throws ProducerFencedException { throwIfInvalidGroupMetadata(groupMetadata); throwIfNoTransactionManager(); throwIfProducerClosed(); TransactionalRequestResult result = transactionManager.sendOffsetsToTransaction(offsets, groupMetadata); sender.wakeup(); result.await(); }
Source:
<code>public Transceiver readSyndications(String journalKey, List<String> statuses) throws IOException { <START> return new Transceiver() { <END> @Override protected Object getData() throws IOException { List<Syndication> syndications = getSyndications(journalKey, statuses); return syndications.stream() .map(new SyndicationOutputView.Factory()::createSyndicationView) .collect(Collectors.toList()); } @Override protected Calendar getLastModifiedDate() throws IOException { return null; } }; }</code><technical_language>If extend EntityCollectionTransceiver instead, care of view-mapping apply "last modified date" logic too. need adapt Timestamped interface EntityTransceiver</technical_language>

Target:
public Transceiver readSyndications(String journalKey, List<String> statuses) throws IOException { return new EntityCollectionTransceiver<Syndication>() { @Override protected Object getView(Collection<? extends Syndication> syndications) { return syndications.stream() .map(SyndicationOutputView::createSyndicationView) .collect(Collectors.toList()); } @Override protected Collection<? extends Syndication> fetchEntities() { return getSyndications(journalKey, statuses); } @Override protected Calendar getLastModifiedDate() throws IOException { return null; } }; }
Source:
<code>public CommitOrgAction(Project project, boolean isDeveloperAction) { <START> super(DEFAULT_ID, "Commit Org" + (isDeveloperAction ? " [DEVELOPER]" : ""), null, null); <END> this.project = project; }</code><technical_language>Developer tag a prefix</technical_language>

Target:
public CommitOrgAction(Project project, boolean isDeveloperAction) { super(DEFAULT_ID, (isDeveloperAction ? "[DEVELOPER] " : "") + "Commit Org", null, null); this.project = project; }
Source:
<code>private void fireEventsFor(OLogSequenceNumber lsn) { final ConcurrentNavigableMap<OLogSequenceNumber, Runnable> eventsToFire = events.headMap(lsn, true); for (Runnable runnable : eventsToFire.values()) runnable.run(); <START> eventsToFire.clear(); <END> }</code><technical_language>a situation some events lost. I meant eventsToFire map moment of call of method more elements processed in loop eventsToFire is backed events map</technical_language>

Target:
private void fireEventsFor(OLogSequenceNumber lsn) { final Iterator<Runnable> eventsToFire = events.headMap(lsn, true).values().iterator(); while (eventsToFire.hasNext()) { eventsToFire.next().run(); eventsToFire.remove(); } }
Source:
<code><START> protected void setCustomFields(Map<String, Object> fields) { <END> }</code><technical_language>throw new UnsupportedOperationException if empty. deprecate in AbstractMemento.setCustomFields. is deprecated in sub-types</technical_language>

Target:
protected void setCustomFields(Map<String, Object> fields) { if (!fields.isEmpty()) { throw new UnsupportedOperationException("Cannot set custom fields on " + this + ". " + "Fields=" + Joiner.on(", ").join(fields.keySet())); } }
Source:
<code>public static LeaderInformation known(UUID leaderSessionID, String leaderAddress) { return new LeaderInformation(leaderSessionID, leaderAddress); <START> } <END></code><technical_language>add assert leaderSessionID leaderAddress is null. this method allow break isEmpty</technical_language>

Target:
public static LeaderInformation known(UUID leaderSessionID, String leaderAddress) { return new LeaderInformation(checkNotNull(leaderSessionID), checkNotNull(leaderAddress)); }
Source:
<code>private boolean checkForChangedDerivedProducts(Pool pool, Pool existingPool, Map<String, Product> changedProducts) { boolean productsChanged = false; if (pool.getDerivedProduct() != null) { productsChanged = !pool.getDerivedProduct().getId() .equals(existingPool.getDerivedProduct().getId()); productsChanged = productsChanged || (changedProducts != null && changedProducts.containsKey(pool.getDerivedProduct().getId())); } Set<Product> currentProvided = productCurator.getPoolDerivedProvidedProductsCached(existingPool); Set<Product> incomingProvided = new HashSet<Product>(); if (pool.getDerivedProvidedProducts() != null) { for (Product p : pool.getDerivedProvidedProducts()) { incomingProvided.add(p); } } <START> productsChanged = productsChanged || !currentProvided.equals(incomingProvided) || <END> changedProductsInSet(incomingProvided, changedProducts); if (productsChanged) { if (pool.getDerivedProduct() != null) { existingPool.setDerivedProduct(pool.getDerivedProduct()); } else { existingPool.setDerivedProduct(null); } existingPool.getDerivedProvidedProducts().clear(); if (incomingProvided != null && !incomingProvided.isEmpty()) { existingPool.getDerivedProvidedProducts().addAll(incomingProvided); } } return productsChanged; }</code><technical_language>required, |= here</technical_language>

Target:
private boolean checkForChangedDerivedProducts(Pool pool, Pool existingPool, Map<String, Product> changedProducts) { boolean productsChanged = false; if (pool.getDerivedProduct() != null) { productsChanged = !pool.getDerivedProduct().getId() .equals(existingPool.getDerivedProduct().getId()); productsChanged |= (changedProducts != null && changedProducts.containsKey(pool.getDerivedProduct().getId())); } Set<Product> currentProvided = productCurator.getPoolDerivedProvidedProductsCached(existingPool); Set<Product> incomingProvided = new HashSet<Product>(); if (pool.getDerivedProvidedProducts() != null) { for (Product p : pool.getDerivedProvidedProducts()) { incomingProvided.add(p); } } productsChanged |= !currentProvided.equals(incomingProvided) || changedProductsInSet(incomingProvided, changedProducts); if (productsChanged) { if (pool.getDerivedProduct() != null) { existingPool.setDerivedProduct(pool.getDerivedProduct()); } else { existingPool.setDerivedProduct(null); } existingPool.getDerivedProvidedProducts().clear(); if (incomingProvided != null && !incomingProvided.isEmpty()) { existingPool.getDerivedProvidedProducts().addAll(incomingProvided); } } return productsChanged; }
Source:
<code>public File getSQLDialect(DatabaseType db_type) { String xmlNames[] = { (db_type != null ? db_type.name().toLowerCase() : "") + "-dialects.xml", this.benchmarkName + "-dialects.xml", }; for(String xmlName : xmlNames) { URL ddlURL = this.getClass().getResource( DIALECTS_DIR + File.separator + xmlName); if (ddlURL != null) return new File(ddlURL.getPath()); if (LOG.isDebugEnabled()) LOG.warn(String.format("Failed to find SQL Dialect XML file '%s'", xmlName)); } <START> LOG.info("Failed to find SQL Dialect XML file "); <END> return (null); }</code><technical_language>added a log statement this file remove pull request</technical_language>

Target:
public File getSQLDialect(DatabaseType db_type) { String xmlNames[] = { (db_type != null ? db_type.name().toLowerCase() : "") + "-dialects.xml", this.benchmarkName + "-dialects.xml", }; for(String xmlName : xmlNames) { URL ddlURL = this.getClass().getResource( DIALECTS_DIR + File.separator + xmlName); if (ddlURL != null) return new File(ddlURL.getPath()); if (LOG.isDebugEnabled()) LOG.warn(String.format("Failed to find SQL Dialect XML file '%s'", xmlName)); } return (null); }
Source:
<code>public void configure() throws Exception { from("{{fcrepo.stream}}") .routeId("CdrMetaServicesRouter") .to("direct-vm:index.start") .to("direct:process.enhancement"); from("direct:process.enhancement") .routeId("ProcessEnhancement") .filter(simple("${headers[org.fcrepo.jms.eventType]} contains 'ResourceCreation'" + " && ${headers[org.fcrepo.jms.identifier]} regex '.*original_file'" + " && ${headers[org.fcrepo.jms.resourceType]} contains '" + Binary.getURI() + "'")) .threads(enhancementThreads, enhancementThreads, "CdrEnhancementThread") .delay(simple("{{cdr.enhancement.postIndexingDelay}}")) .to("direct:process.binary.original"); from("direct:process.binary.original") .routeId("ProcessOriginalBinary") .log(LoggingLevel.DEBUG, "Processing binary metadata for ${headers[org.fcrepo.jms.identifier]}") .removeHeaders("CamelHttp*") .to("fcrepo:{{fcrepo.baseUrl}}?preferInclude=ServerManaged&accept=text/turtle") .process(mdProcessor) .multicast() <START> .to("direct-vm:imageEnhancements","direct-vm:extractFulltext", "direct-vm:replication"); <END> }</code><technical_language>This replicate FITS extracts applies original_files, need break replication a separate route original binary processing. suggest kicking indexing enhancements. realizing MODS files get processed original file... decide if issue. need addressed right though</technical_language>

Target:
public void configure() throws Exception { from("{{fcrepo.stream}}") .routeId("CdrMetaServicesRouter") .to("direct-vm:index.start") .to("direct:process.ingest"); from("direct:process.ingest") .routeId("ProcessIngest") .filter(simple("${headers[org.fcrepo.jms.eventType]} contains 'ResourceCreation'" + " && ${headers[org.fcrepo.jms.identifier]} regex '.*(original_file|techmd_fits)'" + " && ${headers[org.fcrepo.jms.resourceType]} contains '" + Binary.getURI() + "'")) .threads(enhancementThreads, enhancementThreads, "CdrEnhancementThread") .delay(simple("{{cdr.enhancement.postIndexingDelay}}")) .to("direct:process.creation"); from("direct:process.creation") .routeId("ProcessCreationEvent") .log(LoggingLevel.DEBUG, "Processing binary metadata for ${headers[org.fcrepo.jms.identifier]}") .removeHeaders("CamelHttp*") .to("fcrepo:{{fcrepo.baseUrl}}?preferInclude=ServerManaged&accept=text/turtle") .process(mdProcessor) .choice() .when(simple("${headers[org.fcrepo.jms.identifier]} regex '.*original_file'")) .to("direct-vm:replication") .to("direct:process.enhancements") .when(simple("${headers[org.fcrepo.jms.identifier]} regex '.*techmd_fits'")) .to("direct-vm:replication") .otherwise() .log(LoggingLevel.WARN, "Cannot process binary metadata for ${headers[org.fcrepo.jms.identifier]}") .end(); from("direct:process.enhancements") .routeId("ProcessEnhancements") .multicast() .to("direct-vm:imageEnhancements","direct-vm:extractFulltext"); }