auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void updated(Dictionary<String, ?> config) throws ConfigurationException { <START> Set<String> names = getNames(config); <END> for (String name : names) { String value = Objects.toString(config.get(name + ".serialPort"), null); String serialPort = value != null ? value : MeterConfig.DEFAULT_SERIAL_PORT; value = Objects.toString(config.get(name + ".initMessage"), null); byte[] initMessage = value != null ? DatatypeConverter.parseHexBinary(value) : null; value = Objects.toString(config.get(name + ".baudRateChangeDelay"), null); int baudRateChangeDelay = value != null ? Integer.valueOf(value) : MeterConfig.DEFAULT_BAUD_RATE_CHANGE_DELAY; value = Objects.toString(config.get(name + ".echoHandling"), null); boolean echoHandling = value != null ? Boolean.valueOf(value) : MeterConfig.DEFAULT_ECHO_HANDLING; Meter meterConfig = createIec6205621MeterConfig(name, new MeterConfig(serialPort, initMessage, baudRateChangeDelay, echoHandling)); if (meterDeviceConfigurtions.put(meterConfig.getName(), meterConfig) != null) { logger.info("Recreated reader with {}!", meterConfig.getName(), meterConfig.getConfig()); } else { logger.info("Created reader with {}!", meterConfig.getName(), meterConfig.getConfig()); } } String refreshStr = Objects.toString(config.get("refresh"), null); if (StringUtils.isNotBlank(refreshStr)) { refreshInterval = Long.parseLong(refreshStr); } setProperlyConfigured(true); }</code><technical_language>positive updated called a null for config parameter, for reason. safest simply return in case</technical_language>

Target:
public void updated(Dictionary<String, ?> config) throws ConfigurationException { if (config == null || config.isEmpty()) { return; } Set<String> names = getNames(config); for (String name : names) { String value = Objects.toString(config.get(name + ".serialPort"), null); String serialPort = value != null ? value : MeterConfig.DEFAULT_SERIAL_PORT; value = Objects.toString(config.get(name + ".initMessage"), null); byte[] initMessage = value != null ? DatatypeConverter.parseHexBinary(value) : null; value = Objects.toString(config.get(name + ".baudRateChangeDelay"), null); int baudRateChangeDelay = value != null ? Integer.valueOf(value) : MeterConfig.DEFAULT_BAUD_RATE_CHANGE_DELAY; value = Objects.toString(config.get(name + ".echoHandling"), null); boolean echoHandling = value != null ? Boolean.valueOf(value) : MeterConfig.DEFAULT_ECHO_HANDLING; Meter meterConfig = createIec6205621MeterConfig(name, new MeterConfig(serialPort, initMessage, baudRateChangeDelay, echoHandling)); if (meterDeviceConfigurtions.put(meterConfig.getName(), meterConfig) != null) { logger.info("Recreated reader with {}!", meterConfig.getName(), meterConfig.getConfig()); } else { logger.info("Created reader with {}!", meterConfig.getName(), meterConfig.getConfig()); } } String refreshStr = Objects.toString(config.get("refresh"), null); if (StringUtils.isNotBlank(refreshStr)) { refreshInterval = Long.parseLong(refreshStr); } setProperlyConfigured(true); }
Source:
<code>public static Deployment getDeployment(IService service) { List<IRoute> routes = ConnectionsRegistryUtil.getConnectionFor(service).getResources(ResourceKind.ROUTE, service.getNamespace()); List<IPod> pods = service.getPods(); <START> List<IRoute> appRoutes = routes.stream() <END> .filter(r->r.getServiceName().equals(service.getName())).collect(Collectors.toList()); return new Deployment(service, appRoutes, pods); }</code><technical_language>refactor filtering part, in getDeployments -> filter(routes, serviceName)</technical_language>

Target:
public static Deployment getDeployment(IService service) { List<IRoute> routes = ConnectionsRegistryUtil.getConnectionFor(service).getResources(ResourceKind.ROUTE, service.getNamespace()); return getDeployment(service, routes); }
Source:
<code>private void runWithRerun( final ITestInvocationListener listener, Collection<TestDescription> expectedTests) throws DeviceNotAvailableException { CollectingTestListener testTracker = new CollectingTestListener(); mDevice.runInstrumentationTests( mRunner, new LogcatCrashResultForwarder(getDevice(), listener, testTracker) { @Override public void testRunStarted(String runName, int testCount) { if (testCount == 0 && !expectedTests.isEmpty()) { CLog.e( "Run reported 0 tests while we collected %s", expectedTests.size()); super.testRunStarted(runName, expectedTests.size()); } else { super.testRunStarted(runName, testCount); } } }); TestRunResult testRun = testTracker.getCurrentRunResults(); if (testRun.isRunFailure() || !testRun.getCompletedTests().containsAll(expectedTests)) { if (mBugreportOnRunFailure) { String name = (mTestClassName != null) ? mTestClassName : mPackageName; boolean res = mDevice.logBugreport( String.format("bugreport-on-run-failure-%s", name), listener); if (!res) { CLog.e( "Failed to capture a bugreport for the run failure of '%s'", testRun.getName()); } } if (!mCoverage) { expectedTests.removeAll(testTracker.getCurrentRunResults().getCompletedTests()); IRetryDecision decision = mConfiguration.getRetryDecision(); if (!RetryStrategy.NO_RETRY.equals(decision.getRetryStrategy()) && decision.getMaxRetryCount() > 1) { return; <START> } <END> } rerunTests(expectedTests, listener); } }</code><technical_language>this block is "if (!mCoverage)"? logic do line 996 If mCoverage is true, need InstrumentationTest rerun</technical_language>

Target:
private void runWithRerun( final ITestInvocationListener listener, Collection<TestDescription> expectedTests) throws DeviceNotAvailableException { CollectingTestListener testTracker = new CollectingTestListener(); mDevice.runInstrumentationTests( mRunner, new LogcatCrashResultForwarder(getDevice(), listener, testTracker) { @Override public void testRunStarted(String runName, int testCount) { if (testCount == 0 && !expectedTests.isEmpty()) { CLog.e( "Run reported 0 tests while we collected %s", expectedTests.size()); super.testRunStarted(runName, expectedTests.size()); } else { super.testRunStarted(runName, testCount); } } }); TestRunResult testRun = testTracker.getCurrentRunResults(); if (testRun.isRunFailure() || !testRun.getCompletedTests().containsAll(expectedTests)) { if (mBugreportOnRunFailure) { String name = (mTestClassName != null) ? mTestClassName : mPackageName; boolean res = mDevice.logBugreport( String.format("bugreport-on-run-failure-%s", name), listener); if (!res) { CLog.e( "Failed to capture a bugreport for the run failure of '%s'", testRun.getName()); } } if (!mConfig.getCoverageOptions().isCoverageEnabled()) { expectedTests.removeAll(testTracker.getCurrentRunResults().getCompletedTests()); IRetryDecision decision = mConfig.getRetryDecision(); if (!RetryStrategy.NO_RETRY.equals(decision.getRetryStrategy()) && decision.getMaxRetryCount() > 1) { return; } } rerunTests(expectedTests, listener); } }
Source:
<code>public void onTableButtonClicked() { gamesTableController = uiService.loadFxml("theme/play/games_table.fxml"); gamesTableController.selectedGameProperty().addListener((observable, oldValue, newValue) -> setSelectedGame(newValue)); Platform.runLater(() -> { gamesTableController.initializeGameTable(filteredItems); Node root = gamesTableController.getRoot(); populateContainer(root); }); if (!preferencesService.getPreferences().isShowGameDetailsSidePane()) { <START> onToggleSidePaneButtonClicked(); <END> } }</code><technical_language>I do understand here. a click a table implicitly click a button? If onToggleSidePaneButtonClicked multiple uses, method name is misleading</technical_language>

Target:
public void onTableButtonClicked() { gamesTableController = uiService.loadFxml("theme/play/games_table.fxml"); gamesTableController.selectedGameProperty().addListener((observable, oldValue, newValue) -> setSelectedGame(newValue)); Platform.runLater(() -> { gamesTableController.initializeGameTable(filteredItems); Node root = gamesTableController.getRoot(); populateContainer(root); }); if (!preferencesService.getPreferences().isShowGameDetailsSidePane()) { toggleSidePane(); } }
Source:
<code>protected void produceOutput(Object reply, Message<?> requestMessage) { MessageHeaders requestHeaders = requestMessage.getHeaders(); Object replyChannel = null; if (getOutputChannel() == null) { @SuppressWarnings("unchecked") Map<List<Object>, Integer> routingSlipHeader = requestHeaders.get(IntegrationMessageHeaderAccessor.ROUTING_SLIP, Map.class); if (routingSlipHeader != null) { List<Object> routingSlip = routingSlipHeader.keySet().iterator().next(); AtomicInteger routingSlipIndex = new AtomicInteger(routingSlipHeader.values().iterator().next()); replyChannel = getOutputChannelFromRoutingSlip(reply, requestMessage, routingSlip, routingSlipIndex); if (replyChannel != null) { AbstractIntegrationMessageBuilder<?> builder = null; if (reply instanceof Message) { builder = this.getMessageBuilderFactory().fromMessage((Message<?>) reply); } else if (reply instanceof AbstractIntegrationMessageBuilder) { <START> builder = (AbstractIntegrationMessageBuilder) reply; <END> } else { builder = this.getMessageBuilderFactory().withPayload(reply); } builder.setHeader(IntegrationMessageHeaderAccessor.ROUTING_SLIP, Collections.singletonMap(routingSlip, routingSlipIndex.get())); reply = builder; } } if (replyChannel == null) { replyChannel = requestHeaders.getReplyChannel(); } } Message<?> replyMessage = createOutputMessage(reply, requestHeaders); sendOutput(replyMessage, replyChannel); }</code><technical_language>..Builder<?>)</technical_language>

Target:
protected void produceOutput(Object reply, Message<?> requestMessage) { MessageHeaders requestHeaders = requestMessage.getHeaders(); Object replyChannel = null; if (getOutputChannel() == null) { Map<?, ?> routingSlipHeader = requestHeaders.get(IntegrationMessageHeaderAccessor.ROUTING_SLIP, Map.class); if (routingSlipHeader != null) { Assert.isTrue(routingSlipHeader.size() == 1, "The RoutingSlip header value must be a SingletonMap"); Object key = routingSlipHeader.keySet().iterator().next(); Object value = routingSlipHeader.values().iterator().next(); Assert.isInstanceOf(List.class, key, "The RoutingSlip key must be List"); Assert.isInstanceOf(Integer.class, value, "The RoutingSlip value must be Integer"); List<?> routingSlip = (List<?>) key; AtomicInteger routingSlipIndex = new AtomicInteger((Integer) value); replyChannel = getOutputChannelFromRoutingSlip(reply, requestMessage, routingSlip, routingSlipIndex); if (replyChannel != null) { AbstractIntegrationMessageBuilder<?> builder = null; if (reply instanceof Message) { builder = this.getMessageBuilderFactory().fromMessage((Message<?>) reply); } else if (reply instanceof AbstractIntegrationMessageBuilder) { builder = (AbstractIntegrationMessageBuilder<?>) reply; } else { builder = this.getMessageBuilderFactory().withPayload(reply); } builder.setHeader(IntegrationMessageHeaderAccessor.ROUTING_SLIP, Collections.singletonMap(routingSlip, routingSlipIndex.get())); reply = builder; } } if (replyChannel == null) { replyChannel = requestHeaders.getReplyChannel(); } } Message<?> replyMessage = createOutputMessage(reply, requestHeaders); sendOutput(replyMessage, replyChannel); }
Source:
<code>public void start(MetricRegistry registry, MetricFilter filter, Set<MetricAttribute> deniedExpansions) { Transport transport; if (getOptionAsBoolean("udp", false)) { String host = requireOption("host", " when using UDP"); int port = getOptionAsInt("port", 8125); log.warn("Connecting using UDP {}:{} reporting every {}s from {}", host, port, pollInterval, hostname); transport = new UdpTransport.Builder().withStatsdHost(host).withPort(port).withRetryingLookup(true).build(); } else { String apiKey = requireOption("apiKey", " when using HTTP"); transport = new HttpTransport.Builder().withApiKey(apiKey).build(); <END> <START> log.debug("Connecting using HTTP transport using apiKey reporting every {}s from {}", pollInterval, hostname); log.warn("Connecting using HTTP transport using apiKey reporting every {}s from {}", pollInterval, hostname); } reporter = NuxeoDatadogReporter.forRegistry(registry) .withHost(hostname) .withTags(tags) .withTransport(transport) .withExpansions(getExpansions(deniedExpansions)) .filter(filter) .withMetricNameFormatter(new DefaultMetricNameFormatter()) .build(); reporter.start(getPollInterval(), TimeUnit.SECONDS); }</code><technical_language>Do need debug warn</technical_language>

Target:
public void start(MetricRegistry registry, MetricFilter filter, Set<MetricAttribute> deniedExpansions) { Transport transport; if (getOptionAsBoolean("udp", false)) { String host = requireOption("host", "when using UDP"); int port = getOptionAsInt("port", 8125); log.warn("Connecting using UDP {}:{} reporting every {}s from {}", host, port, pollInterval, hostname); transport = new UdpTransport.Builder().withStatsdHost(host).withPort(port).withRetryingLookup(true).build(); } else { String apiKey = requireOption("apiKey", "when using HTTP"); transport = new HttpTransport.Builder().withApiKey(apiKey).build(); log.warn("Connecting using HTTP transport using apiKey reporting every {}s from {}", pollInterval, hostname); } reporter = NuxeoDatadogReporter.forRegistry(registry) .withHost(hostname) .withTags(tags) .withTransport(transport) .withExpansions(getExpansions(deniedExpansions)) .filter(filter) .withMetricNameFormatter(new DefaultMetricNameFormatter()) .build(); reporter.start(getPollInterval(), TimeUnit.SECONDS); }
Source:
<code>private Map<String, IPath> importSourceArchives(IProject project, IPluginModelBase model, int mode, IProgressMonitor monitor) throws CoreException { String[] libraries = getLibraryNames(model); SubMonitor subMonitor = SubMonitor.convert(monitor, PDEUIMessages.ImportWizard_operation_importingSource, libraries.length); Map<String, IPath> sourceMap = new HashMap<>(libraries.length); SourceLocationManager manager = getSourceManager(model); if (manager != null) { for (int i = 0; i < libraries.length; i++) { <START> String zipName = ClasspathUtilCore.getSourceZipName(libraries[i]); <END> IPluginBase pluginBase = model.getPluginBase(); IPath srcPath = manager.findSourcePath(pluginBase, new Path(zipName)); if (srcPath != null) { zipName = srcPath.lastSegment(); IPath dstPath = new Path(zipName); sourceMap.put(libraries[i], dstPath); if (project.findMember(dstPath) == null) { if (mode == IMPORT_BINARY) { PluginImportHelper.copyArchive(new File(srcPath.toOSString()), project.getFile(dstPath), subMonitor.newChild(1)); } else if (mode == IMPORT_BINARY_WITH_LINKS) { IFile dstFile = project.getFile(dstPath); dstFile.createLink(srcPath, IResource.NONE, subMonitor.newChild(1)); } } } } } return sourceMap; }</code><technical_language>Consider calling subMonitor.setWorkRemaining(libraries.length - i) handle case srcPath == null</technical_language>

Target:
private Map<String, IPath> importSourceArchives(IProject project, IPluginModelBase model, int mode, IProgressMonitor monitor) throws CoreException { String[] libraries = getLibraryNames(model); SubMonitor subMonitor = SubMonitor.convert(monitor, PDEUIMessages.ImportWizard_operation_importingSource, libraries.length); Map<String, IPath> sourceMap = new HashMap<>(libraries.length); SourceLocationManager manager = getSourceManager(model); if (manager != null) { for (int i = 0; i < libraries.length; i++) { subMonitor.setWorkRemaining(libraries.length - i); String zipName = ClasspathUtilCore.getSourceZipName(libraries[i]); IPluginBase pluginBase = model.getPluginBase(); IPath srcPath = manager.findSourcePath(pluginBase, new Path(zipName)); if (srcPath != null) { zipName = srcPath.lastSegment(); IPath dstPath = new Path(zipName); sourceMap.put(libraries[i], dstPath); if (project.findMember(dstPath) == null) { if (mode == IMPORT_BINARY) { PluginImportHelper.copyArchive(new File(srcPath.toOSString()), project.getFile(dstPath), subMonitor.newChild(1)); } else if (mode == IMPORT_BINARY_WITH_LINKS) { IFile dstFile = project.getFile(dstPath); dstFile.createLink(srcPath, IResource.NONE, subMonitor.newChild(1)); } } } } } return sourceMap; }
Source:
<code>public void testPurgeObject() throws Exception { for (String regionId : regions) { String objectName = "testPurge"; <START> Payload payload = Payloads.newByteSourcePayload(ByteSource.wrap(new byte[]{1,2,3})); <END> ObjectApi objectApi = api.objectApiInRegionForContainer(regionId, name); assertNotNull(objectApi.replace(objectName, payload, ImmutableMap.<String, String>of())); CDNApi cdnApi = api.cdnApiInRegion(regionId); assertTrue(cdnApi.purgeObject(name, "testPurge", ImmutableList.<String>of())); objectApi.delete(objectName); assertNull(objectApi.get(objectName, GetOptions.NONE)); } }</code><technical_language>[minor] Space {</technical_language>

Target:
public void testPurgeObject() throws Exception { for (String regionId : regions) { String objectName = "testPurge"; Payload payload = Payloads.newByteSourcePayload(ByteSource.wrap(new byte[] {1,2,3})); ObjectApi objectApi = api.objectApiInRegionForContainer(regionId, name); objectApi.replace(objectName, payload, ImmutableMap.<String, String>of()); CDNApi cdnApi = api.cdnApiInRegion(regionId); assertTrue(cdnApi.purgeObject(name, "testPurge", ImmutableList.<String>of())); objectApi.delete(objectName); assertNull(objectApi.get(objectName, GetOptions.NONE)); } }
Source:
<code>private void setup() { <START> globalPlaceholders.put("total_achievements", this::getTotalAchievements); <END> placeholderWithArgs.put("unlocked", this::unlockedPlaceholder); placeholderWithArgs.put("goal", this::getGoal); placeholderWithArgs.put("message", this::getMessage); placeholderWithArgs.put("displayname", this::getDisplayName); placeholderWithArgs.put("requirement", this::getRequirement); placeholderWithArgs.put("goalscompleted", this::getCompleted); placeholderWithArgs.put("receiveddate", this::getCompletedDate); placeholderWithoutArgs.put("achievements", this::getAchievements); placeholderWithoutArgs.put("achievements_percentage", this::getAchievementsPercentage); }</code><technical_language>This pattern easy placeholders navigate implementation</technical_language>

Target:
private void setup() { globalPlaceholders.put("total_achievements", this::getTotalAchievements); placeholderWithArgs.put("unlocked", this::unlockedPlaceholder); placeholderWithArgs.put("goal", this::getGoal); placeholderWithArgs.put("message", this::getMessage); placeholderWithArgs.put("displayname", this::getDisplayName); placeholderWithArgs.put("requirement", this::getRequirement); placeholderWithArgs.put("goalscompleted", this::getCompleted); placeholderWithArgs.put("receiveddate", this::getCompletedDate); placeholderWithArgs.put("progressformatted", this::getProgressFormatted); placeholderWithoutArgs.put("achievements", this::getAchievements); placeholderWithoutArgs.put("achievements_percentage", this::getAchievementsPercentage); }
Source:
<code>public static File archiveTARFiles(File base, Iterable<File> files, String archiveNameWithOutExtension) throws IOException { File tarFile = new File(FileUtils.getTempDirectoryPath(), archiveNameWithOutExtension + ".tar"); tarFile.deleteOnExit(); <START> TarArchiveOutputStream tos = new TarArchiveOutputStream(new GZIPOutputStream( <END> new BufferedOutputStream(new FileOutputStream(tarFile)))); try { tos.setLongFileMode(TarArchiveOutputStream.LONGFILE_GNU); for (File file : files) { TarArchiveEntry tarEntry = new TarArchiveEntry(file); tarEntry.setName(relativize(base, file)); if (!file.isDirectory()) { if (file.canExecute()) { tarEntry.setMode(tarEntry.getMode() | 0755); } } tos.putArchiveEntry(tarEntry); if (!file.isDirectory()) { FileUtils.copyFile(file, tos); } tos.closeArchiveEntry(); } } finally { tos.close(); } return tarFile; }</code><technical_language>i need wrap try resources</technical_language>

Target:
public static File archiveTARFiles(File base, Iterable<File> files, String archiveNameWithOutExtension) throws IOException { File tarFile = new File(FileUtils.getTempDirectoryPath(), archiveNameWithOutExtension + ".tar"); tarFile.deleteOnExit(); try(TarArchiveOutputStream tos = new TarArchiveOutputStream(new GZIPOutputStream( new BufferedOutputStream(new FileOutputStream(tarFile))))) { tos.setLongFileMode(TarArchiveOutputStream.LONGFILE_GNU); for (File file : files) { TarArchiveEntry tarEntry = new TarArchiveEntry(file); tarEntry.setName(relativize(base, file)); if (!file.isDirectory()) { if (file.canExecute()) { tarEntry.setMode(tarEntry.getMode() | 0755); } } tos.putArchiveEntry(tarEntry); if (!file.isDirectory()) { FileUtils.copyFile(file, tos); } tos.closeArchiveEntry(); } } return tarFile; }
Source:
<code>private void attachKafkaAppender(KafkaLog4jAppender appender) { <START> if (kafkaAppender.isPresent()) { <END> removeAppender(kafkaAppender); flowLogger.info("Removed old Kafka appender for job " + this.jobId); } kafkaAppender = Optional.of(appender); logger.addAppender(kafkaAppender.get()); logger.setAdditivity(false); flowLogger.info("Attached new Kafka appender for job " + this.jobId); }</code><technical_language>If expect this happen, change assert</technical_language>

Target:
private void attachKafkaAppender(KafkaLog4jAppender appender) { assert(!kafkaAppender.isPresent()); kafkaAppender = Optional.of(appender); logger.addAppender(kafkaAppender.get()); logger.setAdditivity(false); flowLogger.info("Attached new Kafka appender for job " + this.jobId); }
Source:
<code>private void preOrderPrint(PrintWriter writer, boolean printIntervals, HTNode currentNode, int curDepth, long ts) { writer.println(currentNode.toString()); if (printIntervals && (ts <= 0 || (ts >= currentNode.getNodeStart() && ts <= currentNode.getNodeEnd()))) { currentNode.debugPrintIntervals(writer); } switch (currentNode.getNodeType()) { case LEAF: return; case CORE: try { final CoreNode node = (CoreNode) currentNode; int extension = node.getExtensionSequenceNumber(); <START> while (extension != -1) { <END> HTNode nextNode = getTreeIO().readNode(extension); preOrderPrint(writer, printIntervals, nextNode, curDepth, ts); } for (int i = 0; i < node.getNbChildren(); i++) { HTNode nextNode = getTreeIO().readNode(node.getChild(i)); for (int j = 0; j < curDepth; j++) { writer.print(" "); } writer.print("+-"); preOrderPrint(writer, printIntervals, nextNode, curDepth + 1, ts); } } catch (ClosedChannelException e) { Activator.getDefault().logError(e.getMessage()); } break; default: break; } }</code><technical_language>this Coverity issue fixed long (infinite loop)? Brought while merge conflict resolution</technical_language>

Target:
private void preOrderPrint(PrintWriter writer, boolean printIntervals, HTNode currentNode, int curDepth, long ts) { writer.println(currentNode.toString()); if (printIntervals && (ts <= 0 || (ts >= currentNode.getNodeStart() && ts <= currentNode.getNodeEnd()))) { currentNode.debugPrintIntervals(writer); } switch (currentNode.getNodeType()) { case LEAF: return; case CORE: try { final CoreNode node = (CoreNode) currentNode; for (int i = 0; i < node.getNbChildren(); i++) { HTNode nextNode = getTreeIO().readNode(node.getChild(i)); for (int j = 0; j < curDepth; j++) { writer.print(" "); } writer.print("+-"); preOrderPrint(writer, printIntervals, nextNode, curDepth + 1, ts); } } catch (ClosedChannelException e) { Activator.getDefault().logError(e.getMessage()); } break; default: break; } }
Source:
<code>synchronized PackBitmapIndex getBitmapIndex() throws IOException { if (invalid || invalidBitmap) return null; if (bitmapIdx == null && hasExt(BITMAP_INDEX)) { final PackBitmapIndex idx = PackBitmapIndex.open( extFile(BITMAP_INDEX), idx(), getReverseIdx()); <START> if (!Arrays.equals(packChecksum, idx.packChecksum)) <END> invalidBitmap = true; else bitmapIdx = idx; } return bitmapIdx; }</code><technical_language>if good, do bad, else do good</technical_language>

Target:
synchronized PackBitmapIndex getBitmapIndex() throws IOException { if (invalid || invalidBitmap) return null; if (bitmapIdx == null && hasExt(BITMAP_INDEX)) { final PackBitmapIndex idx = PackBitmapIndex.open( extFile(BITMAP_INDEX), idx(), getReverseIdx()); if (Arrays.equals(packChecksum, idx.packChecksum)) bitmapIdx = idx; else invalidBitmap = true; } return bitmapIdx; }
Source:
<code>private void handleGitObjectComparison(GitModelBlob obj, boolean reseEditor) { ITypedElement left; ITypedElement right; if (obj instanceof GitModelWorkingFile) { IFile file = (IFile) obj.getResource(); <START> if (isNonWorksapce(file)) <END> left = new LocalNonWorkspaceTypedElement(file.getFullPath().toString()); else left= SaveableCompareEditorInput.createFileElement(file); right = getCachedFileElement(file); } else { oldAction.run(); return; } GitCompareFileRevisionEditorInput in = new GitCompareFileRevisionEditorInput( left, right, null); IWorkbenchPage page = getWorkbenchPage(conf.getSite()); OpenInCompareAction.openCompareEditor(in, page, reseEditor); }</code><technical_language>typo</technical_language>

Target:
private void handleGitObjectComparison(GitModelBlob obj, boolean reseEditor) { ITypedElement left; ITypedElement right; if (obj instanceof GitModelWorkingFile) { IFile file = (IFile) obj.getResource(); if (isNonWorkspace(file)) left = new LocalNonWorkspaceTypedElement(file.getFullPath().toString()); else left= SaveableCompareEditorInput.createFileElement(file); right = getCachedFileElement(file); } else { oldAction.run(); return; } GitCompareFileRevisionEditorInput in = new GitCompareFileRevisionEditorInput( left, right, null); IWorkbenchPage page = getWorkbenchPage(conf.getSite()); OpenInCompareAction.openCompareEditor(in, page, reseEditor); }
Source:
<code>protected EditableConfiguration transform(Configuration value) { try { return new EditableConfiguration( value, valueOrEmptyCollection(configServer.iocs()), valueOrEmptyCollection(configServer.componentDetails()), valueOrEmptyCollection(configServer.pvs())); } catch (RuntimeException e) { <START> LoggerUtils.logErrorWithStackTrace(IsisLog.getLogger(getClass()), e.getMessage(), e); <END> throw e; } }</code><technical_language>static LOG</technical_language>

Target:
protected EditableConfiguration transform(Configuration value) { try { return new EditableConfiguration( value, valueOrEmptyCollection(configServer.iocs()), valueOrEmptyCollection(configServer.componentDetails()), valueOrEmptyCollection(configServer.pvs())); } catch (RuntimeException e) { LoggerUtils.logErrorWithStackTrace(LOG, e.getMessage(), e); throw e; } }
Source:
<code>private void onFailure(Throwable caught) { <START> for (Object o : callbacks) { <END> if (o instanceof AsyncCallback) { @SuppressWarnings("unchecked") AsyncCallback<Object> cb = (AsyncCallback<Object>) o; cb.onFailure(caught); } else { @SuppressWarnings("unchecked") com.google.gwtjsonrpc.common.AsyncCallback<Object> cb = (com.google.gwtjsonrpc.common.AsyncCallback<Object>) o; cb.onFailure(caught); } } }</code><technical_language>I want give callback failure. I want give a callback failure stop processing. callbacks show error message user, that</technical_language>

Target:
private void onFailure(Throwable caught) { if (failed) { return; } failed = true; Throwable caughtDuringOnFailure = null; for (Object o : callbacks) { try { if (o instanceof AsyncCallback) { @SuppressWarnings("unchecked") AsyncCallback<Object> cb = (AsyncCallback<Object>) o; cb.onFailure(caught); } else { @SuppressWarnings("unchecked") com.google.gwtjsonrpc.common.AsyncCallback<Object> cb = (com.google.gwtjsonrpc.common.AsyncCallback<Object>) o; cb.onFailure(caught); } } catch (Throwable t) { if (caughtDuringOnFailure == null) { caughtDuringOnFailure = t; } } } propagate(caught); }
Source:
<code>public void tearDown() throws Exception { for (OrganizationDto organization : organizations) <START> testOrganizationServiceClient.deleteById(organization.getId()); <END> }</code><technical_language>code affect organizations created in parallel threads of test execution</technical_language>

Target:
public void tearDown() throws Exception { testOrganizationServiceClient.deleteById(childOrganization.getId()); testOrganizationServiceClient.deleteById(parentOrganization.getId()); }
Source:
<code>public void testStateRestoredAfterOrientationChange() { enterTestText(); selectFormatting(FormattingOptions.SANS_SERIF); selectFormatting(FormattingOptions.UNDERLINE); selectFormatting(FormattingOptions.ITALIC); selectFormatting(FormattingOptions.BOLD); selectFormatting(FormattingOptions.SIZE_40); final PointF toolMemberBoxPosition = getToolMemberBoxPosition(); PointF expectedPosition = new PointF(toolMemberBoxPosition.x, toolMemberBoxPosition.y); launchActivityRule.getActivity() .setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); textTool = (TextTool) PaintroidApplication.currentTool; assertEquals(TEST_TEXT, textEditText.getText().toString()); assertEquals(FONT_SANS_SERIF, fontSpinner.getSelectedItem()); assertTrue(underlinedToggleButton.isChecked()); assertTrue(italicToggleButton.isChecked()); assertTrue(boldToggleButton.isChecked()); assertEquals("Wrong text size selected after reopen dialog", <START> String.valueOf(TEXT_SIZE_40_STRING), textSizeSpinner.getSelectedItem()); <END> assertEquals(expectedPosition, getToolMemberBoxPosition()); checkTextBoxDimensions(); }</code><technical_language>String.valueOf is needed</technical_language>

Target:
public void testStateRestoredAfterOrientationChange() { enterTestText(); selectFormatting(FormattingOptions.SANS_SERIF); selectFormatting(FormattingOptions.UNDERLINE); selectFormatting(FormattingOptions.ITALIC); selectFormatting(FormattingOptions.BOLD); selectFormatting(FormattingOptions.SIZE_40); final PointF toolMemberBoxPosition = getToolMemberBoxPosition(); PointF expectedPosition = new PointF(toolMemberBoxPosition.x, toolMemberBoxPosition.y); launchActivityRule.getActivity() .setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); textTool = (TextTool) PaintroidApplication.currentTool; assertEquals(TEST_TEXT, textEditText.getText().toString()); assertEquals(FONT_SANS_SERIF, fontSpinner.getSelectedItem()); assertTrue(underlinedToggleButton.isChecked()); assertTrue(italicToggleButton.isChecked()); assertTrue(boldToggleButton.isChecked()); assertEquals("Wrong text size selected after reopen dialog", TEXT_SIZE_40_STRING, textSizeSpinner.getSelectedItem()); assertEquals(expectedPosition, getToolMemberBoxPosition()); checkTextBoxDimensions(); }
Source:
<code>public void testLogEntryDoesntLogWhenNoAnnotation() throws Exception { Log log = mock(Log.class); <START> LoggedUtils.logEntry(log, "", new Object()); <END> }</code><technical_language>Need verify interactions log</technical_language>

Target:
public void testLogEntryDoesntLogWhenNoAnnotation() throws Exception { Log log = mock(Log.class); LoggedUtils.logEntry(log, "", new Object()); verifyZeroInteractions(log); }
Source:
<code>public void testReadOnlyIndex() throws Throwable { String tableName = createTable("CREATE TABLE %s (pk int, ck int, value int, PRIMARY KEY (pk, ck))"); String indexName = createIndex("CREATE CUSTOM INDEX ON %s (value) USING '" + ReadOnlyIndex.class.getName() + "'"); assertTrue(waitForIndex(keyspace(), tableName, indexName)); execute("SELECT value FROM %s WHERE value = 1"); execute("INSERT INTO %s (pk, ck, value) VALUES (?, ?, ?)", 1, 1, 1); ReadOnlyIndex index = (ReadOnlyIndex) getCurrentColumnFamilyStore().indexManager.getIndexByName(indexName); assertEquals(0, index.rowsInserted.size()); <START> execute("DROP index " + KEYSPACE + "." + indexName); <END> }</code><technical_language>try a recovery here, verify index starts accepts writes recovery. Also, in ReadOnlyIndex, throw exception in getInitializationTask, provide a mock implementation getRecoveryTaskSupport enables writes. Note forcing exception initialization miss call markIndexBuilt, index added SIM#queryableIndexes accepts reads independently of ReadOnlyIndex#supportsLoad implementation. I need some new logic in SIM#markIndexFailed too</technical_language>

Target:
public void testReadOnlyIndex() throws Throwable { String tableName = createTable("CREATE TABLE %s (pk int, ck int, value int, PRIMARY KEY (pk, ck))"); String indexName = createIndex("CREATE CUSTOM INDEX ON %s (value) USING '" + ReadOnlyOnFailureIndex.class.getName() + "'"); assertTrue(waitForIndex(keyspace(), tableName, indexName)); execute("SELECT value FROM %s WHERE value = 1"); execute("INSERT INTO %s (pk, ck, value) VALUES (?, ?, ?)", 1, 1, 1); ReadOnlyOnFailureIndex index = (ReadOnlyOnFailureIndex) getCurrentColumnFamilyStore().indexManager.getIndexByName(indexName); assertEquals(1, index.rowsInserted.size()); getCurrentColumnFamilyStore().indexManager.rebuildIndexesBlocking(ImmutableSet.of(indexName)); assertEquals(1, index.rowsInserted.size()); execute("SELECT value FROM %s WHERE value = 1"); execute("INSERT INTO %s (pk, ck, value) VALUES (?, ?, ?)", 2, 1, 1); assertEquals(2, index.rowsInserted.size()); dropIndex(format("DROP INDEX %s.%s", KEYSPACE, indexName)); ReadOnlyOnFailureIndex.failInit = true; indexName = createIndex("CREATE CUSTOM INDEX ON %s (value) USING '" + ReadOnlyOnFailureIndex.class.getName() + "'"); index = (ReadOnlyOnFailureIndex) getCurrentColumnFamilyStore().indexManager.getIndexByName(indexName); assertTrue(waitForIndexBuilds(keyspace(), indexName)); assertInvalidThrow(IndexNotAvailableException.class, "SELECT value FROM %s WHERE value = 1"); execute("INSERT INTO %s (pk, ck, value) VALUES (?, ?, ?)", 1, 1, 1); assertEquals(0, index.rowsInserted.size()); index.reset(); getCurrentColumnFamilyStore().indexManager.rebuildIndexesBlocking(ImmutableSet.of(indexName)); assertEquals(2, index.rowsInserted.size()); execute("SELECT value FROM %s WHERE value = 1"); execute("INSERT INTO %s (pk, ck, value) VALUES (?, ?, ?)", 2, 1, 1); assertEquals(3, index.rowsInserted.size()); dropIndex(format("DROP INDEX %s.%s", KEYSPACE, indexName)); }
Source:
<code>public void test_setCurrency() throws Exception { NumberFormat nf = NumberFormat.getCurrencyInstance(Locale.US); Currency amd = Currency.getInstance("AMD"); assertEquals(0, amd.getDefaultFractionDigits()); <START> nf.setCurrency(Currency.getInstance("AMD")); <END> assertEquals(2, nf.getMinimumFractionDigits()); assertEquals(2, nf.getMaximumFractionDigits()); assertEquals("AMD50.00", nf.format(50.00)); nf.setMaximumFractionDigits(amd.getDefaultFractionDigits()); assertEquals("AMD50", nf.format(50.00)); nf = NumberFormat.getCurrencyInstance(Locale.US); nf.setCurrency(Currency.getInstance("EUR")); assertEquals("€50.00", nf.format(50.00)); nf.setCurrency(Currency.getInstance("JPY")); assertEquals("¥50.00", nf.format(50.00)); nf.setCurrency(Currency.getInstance("CHF")); assertEquals("CHF50.00", nf.format(50.00)); }</code><technical_language>"amd" instead of creating another one</technical_language>

Target:
public void test_setCurrency() throws Exception { NumberFormat nf = NumberFormat.getCurrencyInstance(Locale.US); nf.setCurrency(Currency.getInstance("AMD")); assertEquals("AMD50", nf.format(50.00)); nf.setCurrency(Currency.getInstance("EUR")); assertEquals("€50.00", nf.format(50.00)); nf.setCurrency(Currency.getInstance("JPY")); assertEquals("¥50", nf.format(50.00)); nf.setCurrency(Currency.getInstance("CHF")); assertEquals("CHF50.00", nf.format(50.00)); }
Source:
<code>protected Void visitReferenceDimension(Dimension dimension) { Class<?> tableClass = dictionary.getEntityClass(dimension.getTable().getId()); JoinPath joinToPath = new JoinPath( tableClass, dictionary, dictionary.getAttributeOrRelationAnnotation(tableClass, JoinTo.class, dimension.getName()).path()); <START> visited.add(dimension); <END> visitColumn(getColumn(joinToPath)); visited.remove(dimension); return null; }</code><technical_language>Do need check if visited contains dimension</technical_language>

Target:
protected Void visitReferenceDimension(Dimension dimension) { if (visited.contains(dimension)) { throw new IllegalArgumentException(referenceLoopMessage(visited, dimension)); } Class<?> tableClass = dictionary.getEntityClass(dimension.getTable().getId()); JoinPath joinToPath = new JoinPath( tableClass, dictionary, dictionary.getAttributeOrRelationAnnotation(tableClass, JoinTo.class, dimension.getName()).path()); visited.add(dimension); visitColumn(getColumn(joinToPath)); visited.remove(dimension); return null; }
Source:
<code>protected void loadVmInit() { <START> if (!getVm().isInitialized() && getVm().getVmInit() == null) { <END> VmHandler.updateVmInitFromDB(getVm().getStaticData(), false); } }</code><technical_language>need check for getVm().isInitialized()</technical_language>

Target:
protected void loadVmInit() { if (getVm() != null && getVm().getVmInit() == null) { VmHandler.updateVmInitFromDB(getVm().getStaticData(), false); } }
Source:
<code>public boolean validate() { validateListItems(getHost()); validateListItems(getAvailableStorageDomainTypeItems()); validateListItems(getAvailableStorageTypeItems()); getDescription().validateEntity(new IValidation[] { new LengthValidation(BusinessEntitiesDefinitions.GENERAL_MAX_SIZE), new SpecialAsciiI18NOrNoneValidation() }); getComment().validateEntity(new IValidation[] { new SpecialAsciiI18NOrNoneValidation() }); getWarningLowSpaceIndicator().validateEntity(new IValidation[]{ new NotEmptyValidation(), new IntegerValidation(0, StorageConstants.LOW_SPACE_THRESHOLD) }); if (!isNewStorage() <START> && getStorage() != null) { <END> getCriticalSpaceActionBlocker().validateEntity(new IValidation[] { new NotEmptyValidation(), new IntegerValidation(0, getStorage().getTotalDiskSize()) }); } else { getCriticalSpaceActionBlocker().validateEntity(new IValidation[] { new NotEmptyValidation(), new IntegerValidation(0, Integer.MAX_VALUE) }); } getWarningLowConfirmedSpaceIndicator().validateEntity(new IValidation[]{ new NotEmptyValidation(), new IntegerValidation(0, StorageConstants.LOW_SPACE_THRESHOLD) }); validateDiscardAfterDelete(); return getName().getIsValid() && getHost().getIsValid() && getIsValid() && getCurrentStorageItem().validate() && getDescription().getIsValid() && getComment().getIsValid() && getWarningLowSpaceIndicator().getIsValid() && getCriticalSpaceActionBlocker().getIsValid() && getWarningLowConfirmedSpaceIndicator().getIsValid() && getDiscardAfterDelete().getIsValid() && getBackup().getIsValid(); }</code><technical_language>needed, isNewStorage() is checks</technical_language>

Target:
public boolean validate() { validateListItems(getHost()); validateListItems(getAvailableStorageDomainTypeItems()); validateListItems(getAvailableStorageTypeItems()); getDescription().validateEntity(new IValidation[] { new LengthValidation(BusinessEntitiesDefinitions.GENERAL_MAX_SIZE), new SpecialAsciiI18NOrNoneValidation() }); getComment().validateEntity(new IValidation[] { new SpecialAsciiI18NOrNoneValidation() }); getWarningLowSpaceIndicator().validateEntity(new IValidation[]{ new NotEmptyValidation(), new IntegerValidation(0, StorageConstants.LOW_SPACE_THRESHOLD) }); int maxAllowedSpace = Integer.MAX_VALUE ; if (!isNewStorage()) { maxAllowedSpace = getStorage().getTotalDiskSize() == 0 ? Integer.MAX_VALUE : getStorage().getTotalDiskSize(); } getCriticalSpaceActionBlocker().validateEntity(new IValidation[] { new NotEmptyValidation(), new IntegerValidation(0, maxAllowedSpace) }); getWarningLowConfirmedSpaceIndicator().validateEntity(new IValidation[]{ new NotEmptyValidation(), new IntegerValidation(0, StorageConstants.LOW_SPACE_THRESHOLD) }); validateDiscardAfterDelete(); return getName().getIsValid() && getHost().getIsValid() && getIsValid() && getCurrentStorageItem().validate() && getDescription().getIsValid() && getComment().getIsValid() && getWarningLowSpaceIndicator().getIsValid() && getCriticalSpaceActionBlocker().getIsValid() && getWarningLowConfirmedSpaceIndicator().getIsValid() && getDiscardAfterDelete().getIsValid() && getBackup().getIsValid(); }
Source:
<code>protected void onInit() { this.evaluationContext = ExpressionUtils.createStandardEvaluationContext(getBeanFactory()); TypeLocator typeLocator = this.evaluationContext.getTypeLocator(); if (typeLocator instanceof StandardTypeLocator) { ((StandardTypeLocator) typeLocator).registerImport("org.springframework.data.mongodb.core.query"); } if (this.reactiveMongoTemplate == null) { <START> this.reactiveMongoTemplate = new ReactiveMongoTemplate(this.reactiveMongoDatabaseFactory, this.mongoConverter); <END> } this.initialized = true; }</code><technical_language>This configured ApplicationContext. similar onInit() in ReactiveMongoDbStoringMessageHandler</technical_language>

Target:
protected void onInit() { this.evaluationContext = ExpressionUtils.createStandardEvaluationContext(getBeanFactory()); TypeLocator typeLocator = this.evaluationContext.getTypeLocator(); if (typeLocator instanceof StandardTypeLocator) { ((StandardTypeLocator) typeLocator).registerImport("org.springframework.data.mongodb.core.query"); } if (this.reactiveMongoTemplate == null) { ReactiveMongoTemplate template = new ReactiveMongoTemplate(this.reactiveMongoDatabaseFactory, this.mongoConverter); if (this.applicationContext != null) { template.setApplicationContext(this.applicationContext); } this.reactiveMongoTemplate = template; } this.initialized = true; }
Source:
<code>public CheckAndMutateBuilderImpl(BigtableDataClient client, HBaseRequestAdapter hbaseAdapter, byte[] row, byte[] family) { this.client = client; this.builder = new CheckAndMutateUtil.RequestBuilder(hbaseAdapter, row, family); <START> BigtableTableName bigtableTableName = hbaseAdapter.getBigtableTableName(); <END> this.requestContext = RequestContext.create( InstanceName.of(bigtableTableName.getProjectId(), bigtableTableName.getInstanceId()), ""); }</code><technical_language>Please add a new method in BigtableTableName create InstanceName .toGcbInstanceName</technical_language>

Target:
public CheckAndMutateBuilderImpl(BigtableDataClient client, HBaseRequestAdapter hbaseAdapter, byte[] row, byte[] family) { this.client = client; this.builder = new CheckAndMutateUtil.RequestBuilder(hbaseAdapter, row, family); BigtableTableName bigtableTableName = hbaseAdapter.getBigtableTableName(); this.requestContext = RequestContext.create(bigtableTableName.toGcbInstanceName(), ""); }
Source:
<code>private String parseFQ(String fq) { fq = StringUtils.trimToEmpty(fq); <START> if ((fq.startsWith("-(") || fq.startsWith("(")) && !fq.endsWith(")")) return null; <END> boolean globalInclusive = true; if (fq.startsWith("-(") && fq.endsWith(")")) { fq = fq.substring(2, fq.length() - 1); globalInclusive = false; } else if (fq.startsWith("(") && fq.endsWith(")")) fq = fq.substring(1, fq.length() - 1); if (StringUtils.isNotEmpty(fq)) { String[] fv = fq.split(":"); if (fv.length >= 2 && StringUtils.isNotBlank(fv[0]) && StringUtils.isNotBlank(fv[1])) { boolean localInclusive = fv[0].charAt(0) != '-'; String key = localInclusive ? fv[0] : fv[0].substring(1); return globalInclusive ^ localInclusive ? "-" + key : key; } } return null; }</code><technical_language>[ALA coding](<LINK_0> standards please user single line control statement braces control statements</technical_language>

Target:
private String parseFQ(String fq) { fq = StringUtils.trimToEmpty(fq); if ((fq.startsWith("-(") || fq.startsWith("(")) && !fq.endsWith(")")) { return null; } boolean globalInclusive = true; if (fq.startsWith("-(") && fq.endsWith(")")) { fq = fq.substring(2, fq.length() - 1); globalInclusive = false; } else if (fq.startsWith("(") && fq.endsWith(")")) { fq = fq.substring(1, fq.length() - 1); } if (StringUtils.isNotEmpty(fq)) { String[] fv = fq.split(":"); if (fv.length >= 2 && StringUtils.isNotBlank(fv[0]) && StringUtils.isNotBlank(fv[1])) { boolean localInclusive = fv[0].charAt(0) != '-'; String key = localInclusive ? fv[0] : fv[0].substring(1); return globalInclusive ^ localInclusive ? "-" + key : key; } } return null; }
Source:
<code>public void shouldNotCreateNewAutoGenerationOptionWithNullParameters() throws Exception { long originalCount = getAllCount(); SimpleObject autoGenerationOption = new SimpleObject(); autoGenerationOption.add("identifierType", null); autoGenerationOption.add("location", null); autoGenerationOption.add("source", null); autoGenerationOption.add("automaticGenerationEnabled", null); autoGenerationOption.add("manualEntryEnabled", null); String json = new ObjectMapper().writeValueAsString(autoGenerationOption); MockHttpServletRequest req = request(RequestMethod.POST, getURI()); req.setContent(json.getBytes()); SimpleObject newAutoGenerationOption = deserialize(handle(req)); <START> assertNull(PropertyUtils.getProperty(newAutoGenerationOption, "uuid")); <END> assertEquals(originalCount, getAllCount()); }</code><technical_language>lines get executed</technical_language>

Target:
public void shouldNotCreateNewAutoGenerationOptionWithNullParameters() throws Exception { SimpleObject autoGenerationOption = new SimpleObject(); autoGenerationOption.add("identifierType", null); autoGenerationOption.add("location", null); autoGenerationOption.add("source", null); autoGenerationOption.add("automaticGenerationEnabled", null); autoGenerationOption.add("manualEntryEnabled", null); String json = new ObjectMapper().writeValueAsString(autoGenerationOption); MockHttpServletRequest req = request(RequestMethod.POST, getURI()); req.setContent(json.getBytes()); handle(req); }
Source:
<code>public boolean equals(final Object o) { if (this == o) { return true; } <START> if (o == null) { <END> return false; } if (!(o instanceof Organisation)) { return false; } final Organisation other = (Organisation) o; return Objects.equals(this.organisationIdentification, other.organisationIdentification); }</code><technical_language>Checking for null is redundant next !(o instanceof Organisation) check</technical_language>

Target:
public boolean equals(final Object o) { if (this == o) { return true; } if (!(o instanceof Organisation)) { return false; } final Organisation other = (Organisation) o; return Objects.equals(this.organisationIdentification, other.organisationIdentification); }
Source:
<code>public String moveObjects(AgentPrincipals agent, PID destinationPid, List<PID> pids) { if (destinationPid == null || pids == null || pids.isEmpty()) { throw new IllegalArgumentException("Must provide a destination and at least one object to move."); } if (agent == null || agent.getUsername() == null || agent.getPrincipals() == null) { throw new IllegalArgumentException("Must provide agent identification information"); } MoveObjectsJob job = new MoveObjectsJob(agent, destinationPid, pids, proxyService); job.setAclService(aclService); job.setFcrepoClient(fcrepoClient); job.setRepositoryObjectLoader(repositoryObjectLoader); job.setSparqlQueryService(sparqlQueryService); job.setTransactionManager(transactionManager); <START> job.setOperationsMessageSender(operationsMessageSender); <END> job.setObjectPathFactory(objectPathFactory); job.setOperationMetrics(operationMetrics); if (asynchronous) { log.info("User is queueing move operation of objects to destination {}", new Object[] { agent.getUsername(), job.getMoveId(), pids.size(), destinationPid }); moveExecutor.submit(job); } else { job.run(); } return job.getMoveId(); }</code><technical_language>claiming a spectacular speller, saying: <LINK_0> :)</technical_language>

Target:
public String moveObjects(AgentPrincipals agent, PID destinationPid, List<PID> pids) { if (destinationPid == null || pids == null || pids.isEmpty()) { throw new IllegalArgumentException("Must provide a destination and at least one object to move."); } if (agent == null || agent.getUsername() == null || agent.getPrincipals() == null) { throw new IllegalArgumentException("Must provide agent identification information"); } MoveObjectsJob job = new MoveObjectsJob(agent, destinationPid, pids); job.setAclService(aclService); job.setRepositoryObjectLoader(repositoryObjectLoader); job.setTransactionManager(transactionManager); job.setOperationsMessageSender(operationsMessageSender); job.setObjectPathFactory(objectPathFactory); job.setOperationMetrics(operationMetrics); job.setProxyService(proxyService); if (asynchronous) { log.info("User is queueing move operation of objects to destination {}", new Object[] { agent.getUsername(), job.getMoveId(), pids.size(), destinationPid }); moveExecutor.submit(job); } else { job.run(); } return job.getMoveId(); }