auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private String getDeviceIpAddress(final DlmsDevice dlmsDevice, final String messageMetaDataIpAddress) throws SessionProviderException { String deviceIpAddress = null; final String iccId = dlmsDevice.getIccId(); try { deviceIpAddress = this.getDeviceIpAddressFromSessionProvider(iccId, dlmsDevice); } catch (final SessionProviderUnsupportedException e) { LOGGER.warn( "iccId is not supported by the sessionProvider for {}. Using device messageMetaData IpAddress {}", iccId, dlmsDevice.getCommunicationProvider(), messageMetaDataIpAddress); return messageMetaDataIpAddress; } if (deviceIpAddress == null) { throw new SessionProviderException("The meter did not wake up in 5 minutes"); } return deviceIpAddress; }

Target:
private String getDeviceIpAddress(final DlmsDevice dlmsDevice, final String messageMetaDataIpAddress) throws SessionProviderException { String deviceIpAddress = null; final String iccId = dlmsDevice.getIccId(); try { deviceIpAddress = this.getDeviceIpAddressFromSessionProvider(iccId, dlmsDevice); } catch (final SessionProviderUnsupportedException e) { LOGGER.warn( "iccId " + iccId + " is not supported by the sessionProvider for " + dlmsDevice.getCommunicationProvider() + ". Using device messageMetaData IpAddress " + messageMetaDataIpAddress, e); return messageMetaDataIpAddress; } if (deviceIpAddress == null) { throw new SessionProviderException("The meter did not wake up. Retried " + this.jasperGetSessionRetries + " times in a total amount of " + this.jasperGetSessionRetries * this.jasperGetSessionSleepBetweenRetries + " seconds"); } return deviceIpAddress; }
Source:
protected Warning createWarning(final Matcher matcher) { String tool, type, category, message, fileName; int lineNumber = 0; int column = 0; List<String> arr = new ArrayList<String>(); int n = matcher.groupCount(); for (int i = 0; i<= n; i++) arr.add(i,matcher.group(i)); Priority priority = Priority.LOW; if (matcher.group(1) != null) { tool = matcher.group(2); type = matcher.group(3); category = matcher.group(4); fileName = matcher.group(6); lineNumber = getLineNumber(matcher.group(7)); message = matcher.group(5); priority = Priority.NORMAL; } else if (matcher.group(16) != null) { return handleDirectory(matcher, 20); } else if (matcher.group(8) != null) { tool = matcher.group(9); type = matcher.group(10); category = matcher.group(11); fileName = matcher.group(12); lineNumber = getLineNumber(matcher.group(13)); priority = Priority.NORMAL; message = matcher.group(15); } else if (matcher.group(21) != null) { tool = matcher.group(22); type = matcher.group(23); category = matcher.group(24); message = matcher.group(25); fileName = "/NotFileRelated"; } else { return FALSE_POSITIVE; } if (category.equalsIgnoreCase("E")) { priority = Priority.HIGH; category = "Error (" + tool + "): " + category; } else { category = "Warning (" + tool + "): " + category; } if (fileName.startsWith(SLASH)) { return createWarning(fileName, lineNumber, category, message, priority); } else { return createWarning(directory + fileName, lineNumber, category, message, priority); } }

Target:
protected Warning createWarning(final Matcher matcher) { String tool; String type; String category; String message; String fileName; int lineNumber = 0; int column = 0; List<String> arr = new ArrayList<String>(); int n = matcher.groupCount(); for (int i = 0; i <= n; i++) { arr.add(i, matcher.group(i)); } Priority priority = Priority.LOW; if (matcher.group(1) != null) { tool = matcher.group(2); type = matcher.group(3); category = matcher.group(4); fileName = matcher.group(6); lineNumber = getLineNumber(matcher.group(7)); message = matcher.group(5); priority = Priority.NORMAL; } else if (matcher.group(16) != null) { return handleDirectory(matcher, 20); } else if (matcher.group(8) != null) { tool = matcher.group(9); type = matcher.group(10); category = matcher.group(11); fileName = matcher.group(12); lineNumber = getLineNumber(matcher.group(13)); priority = Priority.NORMAL; message = matcher.group(15); } else if (matcher.group(21) != null) { tool = matcher.group(22); type = matcher.group(23); category = matcher.group(24); message = matcher.group(25); fileName = "/NotFileRelated"; } else { return FALSE_POSITIVE; } if (category.equalsIgnoreCase("E")) { priority = Priority.HIGH; category = "Error (" + tool + "): " + category; } else { category = "Warning (" + tool + "): " + category; } if (fileName == null) { return FALSE_POSITIVE; } if (fileName.startsWith(SLASH)) { return createWarning(fileName, lineNumber, category, message, priority); } else { return createWarning(directory + fileName, lineNumber, category, message, priority); } }
Source:
public static @NonNull Collection<ITmfTrace> getTraceSet(ITmfTrace trace) { if (trace == null) { return NonNullUtils.checkNotNull(ImmutableSet.<ITmfTrace> of()); } List<ITmfTrace> traces = trace.getChildren(ITmfTrace.class); if (traces.size() > 0) { return NonNullUtils.checkNotNull(ImmutableSet.<ITmfTrace> copyOf(traces)); } return NonNullUtils.checkNotNull(ImmutableSet.<ITmfTrace> of(trace)); }

Target:
public static @NonNull Collection<ITmfTrace> getTraceSet(ITmfTrace trace) { if (trace == null) { return NonNullUtils.checkNotNull(ImmutableSet.<ITmfTrace> of()); } List<ITmfTrace> traces = trace.getChildren(ITmfTrace.class); if (traces.size() > 0) { return NonNullUtils.checkNotNull(ImmutableSet.copyOf(traces)); } return NonNullUtils.checkNotNull(ImmutableSet.of(trace)); }
Source:
protected static String getPopulatedEmptyStringErrorMessage(String messageTemplate, String fieldName, int maxLength) throws ReflectiveOperationException { return (String) invokeMethod(FieldValidator.class, "getPopulatedEmptyStringErrorMessage", new Class<?>[] { String.class, String.class, int.class }, null, new Object[] { messageTemplate, fieldName, maxLength }); }

Target:
protected static String getPopulatedEmptyStringErrorMessage(String messageTemplate, String fieldName, int maxLength) { return FieldValidator.getPopulatedEmptyStringErrorMessage(messageTemplate, fieldName, maxLength); }
Source:
public void onNewOptionSelected() { final AppCompatActivity activity = UiUtils.getActivityFromView(view); if (activity == null) { return; } TextInputDialog.Builder builder = new TextInputDialog.Builder(activity); builder.setHint(activity.getString(R.string.dialog_new_broadcast_message_name)) .setTextWatcher(new NonEmptyStringTextWatcher()) .setPositiveButton(activity.getString(R.string.ok), new TextInputDialog.OnClickListener() { @Override public void onPositiveButtonClick(DialogInterface dialog, String textInput) { addItem(textInput); notifyDataSetChanged(activity); } }); builder.setTitle(R.string.dialog_new_broadcast_message_title) .setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { spinner.setSelection(getBroadcastMessage()); } }) .setOnCancelListener(new DialogInterface.OnCancelListener() { @Override public void onCancel(DialogInterface dialog) { spinner.setSelection(getBroadcastMessage()); } }) .show(); }

Target:
public void onNewOptionSelected() { final SpriteActivity activity = (SpriteActivity) UiUtils.getActivityFromView(view); if (activity == null) { return; } TextInputDialog.Builder builder = new TextInputDialog.Builder(activity); builder.setHint(activity.getString(R.string.dialog_new_broadcast_message_name)) .setTextWatcher(new NonEmptyStringTextWatcher()) .setPositiveButton(activity.getString(R.string.ok), getOkButtonListener(activity)) .setTitle(R.string.dialog_new_broadcast_message_title) .setNegativeButton(R.string.cancel, getNegativeButtonListener()) .setOnCancelListener(getCanceledListener()) .show(); }
Source:
private void loadRemoteStartPage(boolean loadThroughFrontDoor) { assert !bootconfig.isLocal(); String startPage = bootconfig.getStartPage(); String url = startPage; if (loadThroughFrontDoor) { url = getFrontDoorUrl(url, false); } SalesforceHybridLogger.i(TAG, "loadRemoteStartPage called - loading: " + startPage); loadUrl(url); webAppLoaded = true; }

Target:
private void loadRemoteStartPage(boolean loadThroughFrontDoor) { assert !bootconfig.isLocal(); String startPage = bootconfig.getStartPage(); String url = startPage; if (loadThroughFrontDoor) { url = getFrontDoorUrl(url, false); } SalesforceHybridLogger.i(TAG, "loadRemoteStartPage called - loading: " + url); loadUrl(url); webAppLoaded = true; }
Source:
public void updated(Dictionary<String, ?> config) throws ConfigurationException { 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); }

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:
public static Deployment getDeployment(IService service) { List<IRoute> routes = ConnectionsRegistryUtil.getConnectionFor(service).getResources(ResourceKind.ROUTE, service.getNamespace()); List<IPod> pods = service.getPods(); List<IRoute> appRoutes = routes.stream() .filter(r->r.getServiceName().equals(service.getName())).collect(Collectors.toList()); return new Deployment(service, appRoutes, pods); }

Target:
public static Deployment getDeployment(IService service) { List<IRoute> routes = ConnectionsRegistryUtil.getConnectionFor(service).getResources(ResourceKind.ROUTE, service.getNamespace()); return getDeployment(service, routes); }
Source:
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; } } rerunTests(expectedTests, listener); } }

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:
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()) { onToggleSidePaneButtonClicked(); } }

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:
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) { 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); }

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:
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.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); }

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:
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++) { 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; }

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:
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); 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)); } }

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:
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); placeholderWithoutArgs.put("achievements", this::getAchievements); placeholderWithoutArgs.put("achievements_percentage", this::getAchievementsPercentage); }

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:
public static File archiveTARFiles(File base, Iterable<File> files, String archiveNameWithOutExtension) throws IOException { File tarFile = new File(FileUtils.getTempDirectoryPath(), archiveNameWithOutExtension + ".tar"); tarFile.deleteOnExit(); TarArchiveOutputStream tos = new TarArchiveOutputStream(new GZIPOutputStream( 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; }

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:
private void attachKafkaAppender(KafkaLog4jAppender appender) { if (kafkaAppender.isPresent()) { 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); }

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:
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(); while (extension != -1) { 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; } }

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:
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)) invalidBitmap = true; else bitmapIdx = idx; } return bitmapIdx; }

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:
private void handleGitObjectComparison(GitModelBlob obj, boolean reseEditor) { ITypedElement left; ITypedElement right; if (obj instanceof GitModelWorkingFile) { IFile file = (IFile) obj.getResource(); if (isNonWorksapce(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); }

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:
protected EditableConfiguration transform(Configuration value) { try { return new EditableConfiguration( value, valueOrEmptyCollection(configServer.iocs()), valueOrEmptyCollection(configServer.componentDetails()), valueOrEmptyCollection(configServer.pvs())); } catch (RuntimeException e) { LoggerUtils.logErrorWithStackTrace(IsisLog.getLogger(getClass()), e.getMessage(), e); throw e; } }

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:
private void onFailure(Throwable caught) { for (Object o : callbacks) { 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); } } }

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:
public void tearDown() throws Exception { for (OrganizationDto organization : organizations) testOrganizationServiceClient.deleteById(organization.getId()); }

Target:
public void tearDown() throws Exception { testOrganizationServiceClient.deleteById(childOrganization.getId()); testOrganizationServiceClient.deleteById(parentOrganization.getId()); }
Source:
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", String.valueOf(TEXT_SIZE_40_STRING), textSizeSpinner.getSelectedItem()); assertEquals(expectedPosition, getToolMemberBoxPosition()); checkTextBoxDimensions(); }

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:
public void testLogEntryDoesntLogWhenNoAnnotation() throws Exception { Log log = mock(Log.class); LoggedUtils.logEntry(log, "", new Object()); }

Target:
public void testLogEntryDoesntLogWhenNoAnnotation() throws Exception { Log log = mock(Log.class); LoggedUtils.logEntry(log, "", new Object()); verifyZeroInteractions(log); }
Source:
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()); execute("DROP index " + KEYSPACE + "." + indexName); }

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:
public void test_setCurrency() throws Exception { NumberFormat nf = NumberFormat.getCurrencyInstance(Locale.US); Currency amd = Currency.getInstance("AMD"); assertEquals(0, amd.getDefaultFractionDigits()); nf.setCurrency(Currency.getInstance("AMD")); 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)); }

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:
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()); visited.add(dimension); visitColumn(getColumn(joinToPath)); visited.remove(dimension); return null; }

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:
protected void loadVmInit() { if (!getVm().isInitialized() && getVm().getVmInit() == null) { VmHandler.updateVmInitFromDB(getVm().getStaticData(), false); } }

Target:
protected void loadVmInit() { if (getVm() != null && getVm().getVmInit() == null) { VmHandler.updateVmInitFromDB(getVm().getStaticData(), false); } }
Source:
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() && getStorage() != null) { 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(); }

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:
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) { this.reactiveMongoTemplate = new ReactiveMongoTemplate(this.reactiveMongoDatabaseFactory, this.mongoConverter); } this.initialized = true; }

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:
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( InstanceName.of(bigtableTableName.getProjectId(), bigtableTableName.getInstanceId()), ""); }

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:
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; }

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; }