auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public ExecutionResult executeInVR(final String routerIP, final String script, final String args, final Duration timeout) { Pair<Boolean, String> result; String cmdline = "/opt/cloud/bin/router_proxy.sh " + script + " " + routerIP + " " + args; cmdline = cmdline.replaceAll(";", "\\\\;"); try { s_logger.debug("Executing command in VR: " + cmdline); result = SshHelper.sshExecute(_host.getIp(), 22, _username, null, _password.peek(), cmdline, 60000, 60000, (int)timeout.getMillis()); } catch (final Exception e) { return new ExecutionResult(false, e.getMessage()); } return new ExecutionResult(result.first(), result.second()); }

Target:
public ExecutionResult executeInVR(final String routerIP, final String script, final String args, final Duration timeout) { Pair<Boolean, String> result; String cmdline = "/opt/cloud/bin/router_proxy.sh " + script + " " + routerIP + " " + args; cmdline = cmdline.replaceAll(";", "\\\\;"); try { s_logger.debug("Executing command in VR: " + cmdline); result = SshHelper.sshExecute(_host.getIp(), 22, _username, null, _password.peek(), cmdline, VRScripts.CONNECTION_TIMEOUT, VRScripts.CONNECTION_TIMEOUT, timeout); } catch (final Exception e) { return new ExecutionResult(false, e.getMessage()); } return new ExecutionResult(result.first(), result.second()); }
Source:
private Set<String> escapePaths(Set<String> paths) { return paths.stream().map(s -> escapePath(s)).collect(Collectors.toSet()); }

Target:
protected Set<String> escapePaths(Set<String> paths) { return paths.stream().map(s -> escapePath(s)).collect(Collectors.toSet()); }
Source:
private String getDefaultUrl(ProviderType type) { if (type == null) { return ""; } switch (type) { case OPENSTACK_NETWORK: return "http://localhost:9696"; case OPENSTACK_IMAGE: return "http://localhost:9292"; case FOREMAN: default: return "https://localhost"; } }

Target:
private String getDefaultUrl(ProviderType type) { if (type == null) { return ""; } switch (type) { case OPENSTACK_NETWORK: return "http://localhost:9696"; case OPENSTACK_IMAGE: return "http://localhost:9292"; case FOREMAN: default: return "http://localhost"; } }
Source:
public static void init() { SWTBotUtil.failIfUIThread(); URL location = FileLocator.find(TmfCoreTestPlugin.getDefault().getBundle(), new Path(COLLAPSE_TRACE_PATH), null); URI uri; try { uri = FileLocator.toFileURL(location).toURI(); fTestFile = new File(uri); } catch (URISyntaxException | IOException e) { e.printStackTrace(); fail(); } assumeTrue(fTestFile.exists()); IEclipsePreferences defaultPreferences = InstanceScope.INSTANCE.getNode(Activator.PLUGIN_ID); defaultPreferences.put(ITmfTimePreferencesConstants.DATIME, "MMM d HH:mm:ss"); defaultPreferences.put(ITmfTimePreferencesConstants.SUBSEC, ITmfTimePreferencesConstants.SUBSEC_NO_FMT); TmfTimestampFormat.updateDefaultFormats(); SWTBotPreferences.TIMEOUT = 20000; fLogger.addAppender(new ConsoleAppender(new SimpleLayout(), ConsoleAppender.SYSTEM_OUT)); fBot = new SWTWorkbenchBot(); final List<SWTBotView> openViews = fBot.views(); for (SWTBotView view : openViews) { if (view.getTitle().equals("Welcome")) { view.close(); fBot.waitUntil(ConditionHelpers.ViewIsClosed(view)); } } SWTBotUtil.switchToTracingPerspective(); SWTBotUtil.waitForJobs(); }

Target:
public static void init() { SWTBotUtil.failIfUIThread(); URL location = FileLocator.find(TmfCoreTestPlugin.getDefault().getBundle(), new Path(COLLAPSE_TRACE_PATH), null); URI uri; try { uri = FileLocator.toFileURL(location).toURI(); fTestFile = new File(uri); } catch (URISyntaxException | IOException e) { e.printStackTrace(); fail(); } assumeTrue(fTestFile.exists()); IEclipsePreferences defaultPreferences = InstanceScope.INSTANCE.getNode(Activator.PLUGIN_ID); defaultPreferences.put(ITmfTimePreferencesConstants.DATIME, "MMM d HH:mm:ss"); defaultPreferences.put(ITmfTimePreferencesConstants.SUBSEC, ITmfTimePreferencesConstants.SUBSEC_NO_FMT); TmfTimestampFormat.updateDefaultFormats(); SWTBotPreferences.TIMEOUT = 20000; fLogger.addAppender(new ConsoleAppender(new SimpleLayout(), ConsoleAppender.SYSTEM_OUT)); fBot = new SWTWorkbenchBot(); SWTBotUtil.closeView("Welcome", fBot); SWTBotUtil.switchToTracingPerspective(); SWTBotUtil.waitForJobs(); }
Source:
private static EventDataConverter createConverter() { if (eventDataLoaded == null) { try { LoaderUtil.loadClass("org.slf4j.ext.EventData"); eventDataLoaded = true; } catch (final ClassNotFoundException cnfe) { eventDataLoaded = false; } } return eventDataLoaded ? new EventDataConverter() : null; }

Target:
private static EventDataConverter createConverter() { try { LoaderUtil.loadClass("org.slf4j.ext.EventData"); return new EventDataConverter(); } catch (final ClassNotFoundException cnfe) { return null; } }
Source:
private String consumeCapabilities(PacketLineIn pckIn, Consumer<String> serverOptionConsumer, Consumer<String> agentConsumer) throws IOException { String serverOptionPrefix = OPTION_SERVER_OPTION + '='; String agentPrefix = OPTION_AGENT + '='; String line = pckIn.readString(); while (line != PacketLineIn.DELIM && line != PacketLineIn.END) { if (line.startsWith(serverOptionPrefix)) { serverOptionConsumer .accept(line.substring(serverOptionPrefix.length())); } else if (line.startsWith(agentPrefix)) { agentConsumer.accept(line.substring(agentPrefix.length())); } line = pckIn.readString(); } return line; }

Target:
private static String consumeCapabilities(PacketLineIn pckIn, Consumer<String> serverOptionConsumer, Consumer<String> agentConsumer) throws IOException { String serverOptionPrefix = OPTION_SERVER_OPTION + '='; String agentPrefix = OPTION_AGENT + '='; String line = pckIn.readString(); while (line != PacketLineIn.DELIM && line != PacketLineIn.END) { if (line.startsWith(serverOptionPrefix)) { serverOptionConsumer .accept(line.substring(serverOptionPrefix.length())); } else if (line.startsWith(agentPrefix)) { agentConsumer.accept(line.substring(agentPrefix.length())); } else { } line = pckIn.readString(); } return line; }
Source:
public void launchConfigurationChanged(ILaunchConfiguration configuration) { if (this.configChangeCalled) { return; } else { this.configChangeCalled = true; updateClasspathProvider(configuration); this.configChangeCalled = false; } }

Target:
public synchronized void launchConfigurationChanged(ILaunchConfiguration configuration) { if (this.configChangeCalled) { return; } try { this.configChangeCalled = true; updateClasspathProvider(configuration); } finally { this.configChangeCalled = false; } }
Source:
private static Vec3 positionFromSource(CommandSource origin) { if (origin instanceof ICommandSender) { return ((ICommandSender) origin).getPositionVector(); } return null; }

Target:
private static Vector3d positionFromSource(CommandSource origin) { if (origin instanceof LocatedSource) { return ((LocatedSource) origin).getLocation().getPosition(); } return null; }
Source:
private void verifyRename(Path srcPath, Path dstPath, boolean overwrite) throws Exception { AbstractFileSystem fs = fc.getDefaultFileSystem(); assertTrue(fs instanceof LocalFs); ChecksumFs checksumFs = (ChecksumFs) fs; fs.delete(srcPath, true); fs.delete(dstPath, true); Options.Rename renameOpt = Options.Rename.NONE; if (overwrite) { renameOpt = Options.Rename.OVERWRITE; createTestFile(checksumFs, dstPath, 2); } createTestFile(checksumFs, srcPath, 1); assertTrue(fc.util().exists(checksumFs.getChecksumFile(srcPath))); checksumFs.rename(srcPath, dstPath, renameOpt); assertTrue(fc.util().exists(checksumFs.getChecksumFile(dstPath))); try (FSDataInputStream is = fs.open(dstPath)) { assertEquals(1, is.readInt()); } }

Target:
private void verifyRename(Path srcPath, Path dstPath, boolean overwrite) throws Exception { ChecksumFs fs = (ChecksumFs) fc.getDefaultFileSystem(); fs.delete(srcPath, true); fs.delete(dstPath, true); Options.Rename renameOpt = Options.Rename.NONE; if (overwrite) { renameOpt = Options.Rename.OVERWRITE; createTestFile(fs, dstPath, 2); } createTestFile(fs, srcPath, 1); assertTrue("Checksum file doesn't exist for source file - " + srcPath, fc.util().exists(fs.getChecksumFile(srcPath))); fs.rename(srcPath, dstPath, renameOpt); assertTrue("Checksum file doesn't exist for dest file - " + srcPath, fc.util().exists(fs.getChecksumFile(dstPath))); try (FSDataInputStream is = fs.open(dstPath)) { assertEquals(1, is.readInt()); } }
Source:
public Optional<Timeline> getActiveTimeline(final String name) throws InternalNakadiException, NoSuchEventTypeException { final List<Timeline> timelines = getTimelines(name); if (timelines == null) { return Optional.empty(); } return timelines.stream() .filter(t -> t.getSwitchedAt() != null) .max(Comparator.comparing(Timeline::getOrder)); }

Target:
public Optional<Timeline> getActiveTimeline(final String name) throws InternalNakadiException, NoSuchEventTypeException { final List<Timeline> timelines = getTimelinesOrdered(name); if (timelines == null) { return Optional.empty(); } final ListIterator<Timeline> rIterator = timelines.listIterator(timelines.size()); while (rIterator.hasPrevious()) { final Timeline toCheck = rIterator.previous(); if (toCheck.getSwitchedAt() != null) { return Optional.of(toCheck); } } return Optional.empty(); }
Source:
private void showInitialSelection() { IWorkbenchWindow window = PlatformUI.getWorkbench() .getActiveWorkbenchWindow(); if (window == null) { return; } IEditorPart editor = window.getActivePage().getActiveEditor(); if (editor != null) { IEditorInput input = editor.getEditorInput(); if (input instanceof IFileEditorInput) reactOnSelection(new StructuredSelection( ((IFileEditorInput) input).getFile())); } else { IStructuredSelection selection = (IStructuredSelection) window .getSelectionService().getSelection(); reactOnSelection(selection); } }

Target:
private void showInitialSelection() { IWorkbenchWindow window = PlatformUI.getWorkbench() .getActiveWorkbenchWindow(); if (window == null) { return; } IEditorPart editor = window.getActivePage().getActiveEditor(); if (editor != null) { IEditorInput input = editor.getEditorInput(); Repository repository = AdapterUtils.adapt(input, Repository.class); if (repository != null) { reactOnSelection(new StructuredSelection(repository)); } } else { IStructuredSelection selection = (IStructuredSelection) window .getSelectionService().getSelection(); reactOnSelection(selection); } }
Source:
public void showInterstitial() { if (mVungleManager != null) mVungleManager.playAd(mAdapterId, mPlacementForPlay, mAdConfig, new VungleListener() { @Override void onAdEnd(String placement, boolean wasSuccessfulView, boolean wasCallToActionClicked) { if (mMediationInterstitialListener != null) { if (wasCallToActionClicked) { mMediationInterstitialListener.onAdClicked(VungleInterstitialAdapter.this); mMediationInterstitialListener.onAdLeftApplication(VungleInterstitialAdapter.this); } mMediationInterstitialListener.onAdClosed(VungleInterstitialAdapter.this); } } @Override void onAdStart(String placement) { if (mMediationInterstitialListener != null) { mMediationInterstitialListener.onAdOpened(VungleInterstitialAdapter.this); } } @Override void onAdFail(String placement) { if (mMediationInterstitialListener != null) { mMediationInterstitialListener.onAdClosed(VungleInterstitialAdapter.this); } } }); }

Target:
public void showInterstitial() { if (mVungleManager != null) mVungleManager.playAd(mPlacementForPlay, mAdConfig, new VungleListener() { @Override void onAdEnd(String placement, boolean wasSuccessfulView, boolean wasCallToActionClicked) { if (mMediationInterstitialListener != null) { if (wasCallToActionClicked) { mMediationInterstitialListener.onAdClicked(VungleInterstitialAdapter.this); } mMediationInterstitialListener.onAdClosed(VungleInterstitialAdapter.this); } } @Override void onAdStart(String placement) { if (mMediationInterstitialListener != null) { mMediationInterstitialListener.onAdOpened(VungleInterstitialAdapter.this); } } @Override void onAdFail(String placement) { if (mMediationInterstitialListener != null) { mMediationInterstitialListener.onAdClosed(VungleInterstitialAdapter.this); } } }); }
Source:
public void onGitReferenceUpdated(GitReferenceUpdatedListener.Event event) { ReplicationState state = new ReplicationState(injector.getInstance(GitUpdateProcessing.class)); if (!running) { wrappedLog.warn("Replication plugin did not finish startup before event", state); return; } Project.NameKey project = new Project.NameKey(event.getProjectName()); for (Destination cfg : configs) { if (cfg.wouldPushProject(project) && cfg.wouldPushRef(event.getRefName())) { for (URIish uri : cfg.getURIs(project, null)) { cfg.schedule(project, event.getRefName(), uri, state); } } } state.markAllPushTasksScheduled(); }

Target:
public void onGitReferenceUpdated(GitReferenceUpdatedListener.Event event) { ReplicationState state = new ReplicationState(new GitUpdateProcessing(changeHooks, database)); if (!running) { wrappedLog.warn("Replication plugin did not finish startup before event", state); return; } Project.NameKey project = new Project.NameKey(event.getProjectName()); for (Destination cfg : configs) { if (cfg.wouldPushProject(project) && cfg.wouldPushRef(event.getRefName())) { for (URIish uri : cfg.getURIs(project, null)) { cfg.schedule(project, event.getRefName(), uri, state); } } } state.markAllPushTasksScheduled(); }
Source:
public void dismissLoadingDialog() { Fragment frag = getSupportFragmentManager().findFragmentByTag(DIALOG_WAIT_TAG); if (frag != null) { Log_OC.d(TAG, "dismiss loading dialog"); LoadingDialog loading = (LoadingDialog) frag; loading.dismiss(); } }

Target:
public void dismissLoadingDialog() { Fragment frag = getSupportFragmentManager().findFragmentByTag(DIALOG_WAIT_TAG); if (frag == null) { return; } Log_OC.d(TAG, "dismiss loading dialog"); LoadingDialog loading = (LoadingDialog) frag; loading.dismiss(); }
Source:
protected Collection<IAction> getActions() { if (historyPage.getCurrentRepo() == null) return new ArrayList<>(); RefFilterHelper helper = historyPage.helper; List<IAction> actions = new ArrayList<>(); actions.add(configureFiltersAction); Set<RefFilter> filters = helper.getRefFilters(); List<RefFilter> sortedFilters = new ArrayList<>( filters); sortedFilters.sort(new Comparator<RefFilter>() { private int category(RefFilter filter) { if (filter.isPreconfigured()) return 100; return 1000; } @Override public int compare(RefFilter o1, RefFilter o2) { int cat1 = category(o1); int cat2 = category(o2); if (cat1 != cat2) { return cat1 - cat2; } String name1 = o1.getFilterString(); String name2 = o2.getFilterString(); return name1.compareTo(name2); } }); for (RefFilter filter : sortedFilters) { Action action = new ShownRefAction(filter, () -> { helper.setRefFilters(filters); historyPage.refresh(); }); actions.add(action); } return actions; }

Target:
protected Collection<IAction> getActions() { if (historyPage.getCurrentRepo() == null) { return new ArrayList<>(); } RefFilterHelper helper = historyPage.helper; List<IAction> actions = new ArrayList<>(); actions.add(configureFiltersAction); Set<RefFilter> filters = helper.getRefFilters(); List<RefFilter> sortedFilters = new ArrayList<>( filters); sortedFilters.sort(new Comparator<RefFilter>() { private int category(RefFilter filter) { if (filter.isPreconfigured()) { return 100; } return 1000; } @Override public int compare(RefFilter o1, RefFilter o2) { int cat1 = category(o1); int cat2 = category(o2); if (cat1 != cat2) { return cat1 - cat2; } String name1 = o1.getFilterString(); String name2 = o2.getFilterString(); return name1.compareTo(name2); } }); for (RefFilter filter : sortedFilters) { Action action = new ShownRefAction(filter, () -> { helper.setRefFilters(filters); historyPage.refresh(); }); actions.add(action); } return actions; }
Source:
public boolean validate() { getNetwork().validateSelectedItem(new IValidation[] { new NotEmptyValidation() }); getBond().validateSelectedItem(new IValidation[] { new NotEmptyValidation(), new LengthValidation(BusinessEntitiesDefinitions.HOST_NIC_NAME_LENGTH), new BondNameValidation() }); getAddress().setIsValid(true); getSubnet().setIsValid(true); getGateway().setIsValid(true); if (getIsStaticAddress()) { getAddress().validateEntity(new IValidation[] { new NotEmptyValidation(), new IpAddressValidation() }); getSubnet().validateEntity(new IValidation[] { new NotEmptyValidation(), new SubnetMaskValidation() }); getGateway().validateEntity(new IValidation[] { new NotEmptyValidation(), new IpAddressValidation() }); } final String customEditorParameter = " Custom mode "; if (getBondingOptions().getSelectedItem().getKey().equals("custom")) { getCustomEditor().validateEntity(new IValidation[] { new NotEmptyValidation(), new KeyValueFormatValidation((customEditorParameter)) }); } return getBond().getIsValid() && getNetwork().getIsValid() && getAddress().getIsValid() && getSubnet().getIsValid() && getGateway().getIsValid() && getCustomEditor().getIsValid(); }

Target:
public boolean validate() { getNetwork().validateSelectedItem(new IValidation[] { new NotEmptyValidation() }); getBond().validateSelectedItem(new IValidation[] { new NotEmptyValidation(), new LengthValidation(BusinessEntitiesDefinitions.HOST_NIC_NAME_LENGTH), new BondNameValidation() }); getAddress().setIsValid(true); getSubnet().setIsValid(true); getGateway().setIsValid(true); if (getIsStaticAddress()) { getAddress().validateEntity(new IValidation[] { new NotEmptyValidation(), new IpAddressValidation() }); getSubnet().validateEntity(new IValidation[] { new NotEmptyValidation(), new SubnetMaskValidation() }); getGateway().validateEntity(new IValidation[] { new NotEmptyValidation(), new IpAddressValidation() }); } if (getBondingOptions().getSelectedItem().getKey().equals(CUSTOM_BONDING_MODE)) { getCustomBondMode().validateEntity(new IValidation[] { new NotEmptyValidation(), new KeyValueFormatValidation(constantsManager) }); } return getBond().getIsValid() && getNetwork().getIsValid() && getAddress().getIsValid() && getSubnet().getIsValid() && getGateway().getIsValid() && getCustomBondMode().getIsValid(); }
Source:
public static void main(String[] args) throws InterruptedException { Microservices gateway = Microservices.builder() .discovery(serviceEndpoint -> new ScalecubeServiceDiscovery(serviceEndpoint)) .transport(ServiceTransports::rsocketServiceTransport) .gateway(opt -> new WebsocketGateway(opt.id("ws").port(8080))) .gateway(opt -> new HttpGateway(opt.id("http").port(8181)).corsEnabled(true)) .startAwait(); Address seedAddress = Address.create(gateway.discovery().address().host(), gateway.discovery().address().port()); Microservices.builder() .discovery( serviceEndpoint -> new ScalecubeServiceDiscovery(serviceEndpoint) .options(opts -> opts.seedMembers(seedAddress))) .transport(ServiceTransports::rsocketServiceTransport) .services(new GreetingServiceImpl()) .startAwait(); GreetingsService service = gateway.call().api(GreetingsService.class); service .sayHello("joe") .subscribe( consumer -> { System.out.println(consumer.message()); }); Thread.currentThread().join(); }

Target:
public static void main(String[] args) { Microservices gateway = Microservices.builder() .discovery(serviceEndpoint -> new ScalecubeServiceDiscovery(serviceEndpoint)) .transport(ServiceTransports::rsocketServiceTransport) .gateway(opt -> new WebsocketGateway(opt.id("ws").port(8080))) .gateway(opt -> new HttpGateway(opt.id("http").port(8181)).corsEnabled(true)) .startAwait(); Address seedAddress = Address.create(gateway.discovery().address().host(), gateway.discovery().address().port()); Microservices ms = Microservices.builder() .discovery( serviceEndpoint -> new ScalecubeServiceDiscovery(serviceEndpoint) .options(opts -> opts.seedMembers(seedAddress))) .transport(ServiceTransports::rsocketServiceTransport) .services(new GreetingServiceImpl()) .startAwait(); GreetingsService service = gateway.call().api(GreetingsService.class); service .sayHello("joe") .subscribe( consumer -> { System.out.println(consumer.message()); }); gateway.onShutdown().block(); ms.onShutdown().block(); }
Source:
private void operationExecuted(MatchingFrame frame) { if (!adapters.isEmpty()) for (ILocalSearchAdapter adapter : adapters) { adapter.operationExecuted(this, frame); } }

Target:
private void operationExecuted(MatchingFrame frame) { if (!adapters.isEmpty()){ for (ILocalSearchAdapter adapter : adapters) { adapter.operationExecuted(this, frame); } } }
Source:
public void getTaskData(Set<String> taskIds, TaskRepository taskRepository, TaskDataCollector collector, IOperationMonitor monitor) throws BugzillaRestException { BugzillaRestConfiguration config; try { config = connector.getRepositoryConfiguration(taskRepository); } catch (CoreException e1) { throw new BugzillaRestException(e1); } Iterable<String> taskIdsTemp = Iterables.transform(taskIds, function); Iterable<List<String>> partitions = Iterables.partition(taskIdsTemp, MAX_RETRIEVED_PER_QUERY); for (List<String> list : partitions) { Joiner joiner = Joiner.on(",id=").skipNulls(); String urlIDList = "id=" + joiner.join(list); try { List<TaskData> taskDataArray = new BugzillaRestGetTaskData(client, connector, urlIDList, taskRepository) .run(monitor); for (TaskData taskData : taskDataArray) { new BugzillaRestGetTaskComments(getClient(), taskData).run(monitor); new BugzillaRestGetTaskAttachments(getClient(), taskData).run(monitor); config.updateProductOptions(taskData); config.addValidOperations(taskData); collector.accept(taskData); } } catch (BugzillaRestException e) { throw e; } catch (RuntimeException e) { Throwable cause = e.getCause(); if (cause instanceof CoreException) { throw new BugzillaRestException(cause); } throw e; } } }

Target:
public void getTaskData(Set<String> taskIds, TaskRepository taskRepository, TaskDataCollector collector, IOperationMonitor monitor) throws BugzillaRestException { BugzillaRestConfiguration config; try { config = connector.getRepositoryConfiguration(taskRepository); } catch (CoreException e1) { throw new BugzillaRestException(e1); } Iterable<String> taskIdsTemp = Iterables.transform(taskIds, removeLeadingZero); Iterable<List<String>> partitions = Iterables.partition(taskIdsTemp, MAX_RETRIEVED_PER_QUERY); for (List<String> list : partitions) { Joiner joiner = Joiner.on(",id=").skipNulls(); String urlIDList = "id=" + joiner.join(list); try { List<TaskData> taskDataArray = new BugzillaRestGetTaskData(client, connector, urlIDList, taskRepository) .run(monitor); for (TaskData taskData : taskDataArray) { new BugzillaRestGetTaskComments(getClient(), taskData).run(monitor); new BugzillaRestGetTaskAttachments(getClient(), taskData).run(monitor); config.updateProductOptions(taskData); config.addValidOperations(taskData); collector.accept(taskData); } } catch (RuntimeException e) { Throwable cause = e.getCause(); if (cause instanceof CoreException) { throw new BugzillaRestException(cause); } throw e; } } }
Source:
private boolean isValidIpOrRange(String entry) { if (TextUtils.isEmpty(entry)) { return false; } entry = entry.trim(); entry = entry.replaceAll(" ", ""); String[] ipStrings = entry.split("-"); if (ipStrings.length > 2 || ipStrings.length < 1) { return false; } for (String ip : ipStrings) { if (!InetAddressUtils.isIPv4Address(ip)) { return false; } } return true; }

Target:
private boolean isValidIpOrRange(String entry) { if (TextUtils.isEmpty(entry)) { return false; } entry = entry.replaceAll("\\s", ""); String[] ipStrings = entry.split("-"); if (ipStrings.length > 2 || ipStrings.length < 1) { return false; } for (String ip : ipStrings) { if (!InetAddressUtils.isIPv4Address(ip)) { return false; } } return true; }
Source:
public void broadcastObject(final Object object) { executorsBySession.forEach((session, executor) -> executor.submit(() -> { while (true) { LOGGER.debug("Sending notification to session with id: {}, open: {}", session.getId(), session.isOpen()); try { if (session.isOpen()) { session.getBasicRemote().sendObject(object); LOGGER.debug("Notification sent to session with id: {}", session.getId()); } break; } catch (IOException | EncodeException ex) { LOGGER.warn("Failed to send notification, error: {}", ex.getMessage(), ex); Thread.sleep(500); } } return null; })); }

Target:
public void broadcastObject(final Object object) { executorsBySession.forEach((session, executor) -> executor.submit(() -> { for (int i = 0; i < RETRIES; i++) { LOGGER.debug("Sending notification to session with id: {}, open: {}", session.getId(), session.isOpen()); try { if (session.isOpen()) { session.getBasicRemote().sendObject(object); LOGGER.debug("Notification sent to session with id: {}", session.getId()); } else { LOGGER.debug("Notification not sent, session is closed."); } break; } catch (EncodeException ex) { LOGGER.warn("Failed to send notification, due to encoding error: {}, skipping message", ex.getMessage(), ex); break; } catch (IOException ex) { LOGGER.warn("Failed to send notification, error: {}", ex.getMessage(), ex); Thread.sleep(i * 500); } } return null; })); }
Source:
public boolean isFinished() { return blocked.isDone() && state == State.FINISHED; }

Target:
public boolean isFinished() { return state == State.FINISHED && blocked.isDone(); }
Source:
public void systemIterateReader() { String ionText = "1 2 3 4"; IonReader ionReader = system().newSystemReader(ionText); Iterator<IonValue> iterate = system().systemIterate(ionReader); assertTrue(iterate.hasNext()); assertEquals(1, ((IonInt) iterate.next()).intValue()); assertTrue(iterate.hasNext()); assertEquals(2, ((IonInt) iterate.next()).intValue()); assertTrue(iterate.hasNext()); assertEquals(3, ((IonInt) iterate.next()).intValue()); assertTrue(iterate.hasNext()); assertEquals(4, ((IonInt) iterate.next()).intValue()); assertFalse(iterate.hasNext()); }

Target:
public void systemIterateReader() throws IOException { String ionText = "1 2 3 4"; IonReader ionReader = system().newSystemReader(ionText); Iterator<IonValue> iterate = system().systemIterate(ionReader); assertTrue(iterate.hasNext()); assertEquals(1, ((IonInt) iterate.next()).intValue()); assertTrue(iterate.hasNext()); assertEquals(2, ((IonInt) iterate.next()).intValue()); assertTrue(iterate.hasNext()); assertEquals(3, ((IonInt) iterate.next()).intValue()); assertTrue(iterate.hasNext()); assertEquals(4, ((IonInt) iterate.next()).intValue()); assertFalse(iterate.hasNext()); ionReader.close(); }
Source:
public void processTuple(String inputTuple) { try { if (out.isConnected()) { reader.open(inputTuple); JAXBElement<?> output = unmarshaller.unmarshal(new StreamSource(reader), getClazz()); LOG.debug(output.getValue().toString()); emittedObjectCount++; out.emit(output.getValue()); } else if (validator != null) { validator.validate(new StreamSource(inputTuple)); } if (parsedOutput.isConnected()) { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder; try { builder = factory.newDocumentBuilder(); Document doc = builder.parse(new InputSource(new ByteArrayInputStream(inputTuple.getBytes("utf-8")))); parsedOutput.emit(doc); } catch (Exception e) { LOG.info("Failed to parse xml tuple {}, Exception = , StackTrace = {}", inputTuple, e, e.getStackTrace()); errorTupleCount++; if (err.isConnected()) { err.emit(inputTuple); } } } } catch (Exception e) { LOG.info("Failed to parse xml tuple {}, Exception = {}, StackTrace = ", inputTuple, e, e.getStackTrace()); errorTupleCount++; if (err.isConnected()) { err.emit(inputTuple); } } finally { try { if (reader.isOpen()) { reader.close(); } } catch (IOException e) { DTThrowable.wrapIfChecked(e); } } }

Target:
public void processTuple(String inputTuple) { try { if (out.isConnected()) { reader.open(inputTuple); JAXBElement<?> output = unmarshaller.unmarshal(new StreamSource(reader), getClazz()); LOG.debug(output.getValue().toString()); emittedObjectCount++; out.emit(output.getValue()); } else if (validator != null) { validator.validate(new StreamSource(inputTuple)); } if (parsedOutput.isConnected()) { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder; try { builder = factory.newDocumentBuilder(); Document doc = builder.parse(new InputSource(new ByteArrayInputStream(inputTuple.getBytes("UTF-8")))); parsedOutput.emit(doc); } catch (Exception e) { LOG.info("Failed to parse xml tuple {}, Exception = , StackTrace = {}", inputTuple, e, e.getStackTrace()); errorTupleCount++; if (err.isConnected()) { err.emit(inputTuple); } } } } catch (Exception e) { LOG.info("Failed to parse xml tuple {}, Exception = {}, StackTrace = ", inputTuple, e, e.getStackTrace()); errorTupleCount++; if (err.isConnected()) { err.emit(inputTuple); } } finally { try { if (reader.isOpen()) { reader.close(); } } catch (IOException e) { DTThrowable.wrapIfChecked(e); } } }
Source:
public CatalogClasspathDo(CatalogDo catalog) { this.catalog = catalog; this.classpath = catalog.dto.classpath; }

Target:
public CatalogClasspathDo(CatalogDo catalog) { this.catalog = Preconditions.checkNotNull(catalog, "catalog"); this.classpath = catalog.dto.classpath; this.scanMode = (classpath != null) ? classpath.scan : null; }
Source:
private void doParallelBulkLoad(HttpServletRequest req, HttpServletResponse resp) throws IOException { if (!BigdataRDFServletEx.isWritable(getServletContext(), req, resp)) { return; } final Properties props = parseProperties(req, resp); if (props == null) { return; } final String namespace = props.getProperty("namespace", BigdataSail.Options.DEFAULT_NAMESPACE); final String fileOrDirs = props.getProperty("fileOrDirs"); if (fileOrDirs == null) { throw new RuntimeException( "fileOrDirs is required for the DataLoader"); } final String propertyFile = props.getProperty("propertyFile"); if (propertyFile == null) { throw new RuntimeException( "propertyFile is required for the DataLoader"); } createKbIfNeeded(req, resp, namespace, propertyFile); final int maxTmpStatementsSize = getIntProperty(props, "maxTmpStatementsSize", Integer.parseInt(DataLoader.Options.DEFAULT_BUFFER_CAPACITY)); final int cpuCores = Runtime.getRuntime().availableProcessors(); final int fileReadersCount = getIntProperty(props, "fileReadersCount", cpuCores < 3 ? 1 : cpuCores - 2); final int mergersCount = getIntProperty(props, "mergersCount", cpuCores - fileReadersCount < 1 ? 1 : cpuCores - fileReadersCount); final int tmpQueueLimit = getIntProperty(props, "tmpQueueLimit", fileReadersCount); runParallelDataLoad(req, resp, props, namespace, maxTmpStatementsSize, fileReadersCount, mergersCount, tmpQueueLimit); buildAndCommitResponse(resp, HTTP_OK, MIME_TEXT_PLAIN, "DATALOADER-SERVLET: Loaded " + namespace + " with properties: " + propertyFile); }

Target:
private void doParallelBulkLoad(HttpServletRequest req, HttpServletResponse resp) throws IOException { if (!BigdataRDFServletUtil.isWritable(getServletContext(), req, resp)) { resp.setStatus(HttpServletResponse.SC_FORBIDDEN); resp.setContentType(MIME_TEXT_PLAIN); return; } final Properties props = parseProperties(req, resp); if (props == null) { return; } final String namespace = props.getProperty("namespace", BigdataSail.Options.DEFAULT_NAMESPACE); final String fileOrDirs = props.getProperty("fileOrDirs"); if (fileOrDirs == null) { throw new RuntimeException( "fileOrDirs is required for the DataLoader"); } final String propertyFile = props.getProperty("propertyFile"); if (propertyFile == null) { throw new RuntimeException( "propertyFile is required for the DataLoader"); } createKbIfNeeded(req, resp, namespace, propertyFile); final int maxTmpStatementsSize = getIntProperty(props, "maxTmpStatementsSize", Integer.parseInt(DataLoader.Options.DEFAULT_BUFFER_CAPACITY)); final int cpuCores = Runtime.getRuntime().availableProcessors(); final int fileReadersCount = getIntProperty(props, "fileReadersCount", cpuCores < 3 ? 1 : cpuCores - 2); final int mergersCount = getIntProperty(props, "mergersCount", cpuCores - fileReadersCount < 1 ? 1 : cpuCores - fileReadersCount); final int tmpQueueLimit = getIntProperty(props, "tmpQueueLimit", fileReadersCount); runParallelDataLoad(req, resp, props, namespace, maxTmpStatementsSize, fileReadersCount, mergersCount, tmpQueueLimit); buildAndCommitResponse(resp, HTTP_OK, MIME_TEXT_PLAIN, "DATALOADER-SERVLET: Loaded " + namespace + " with properties: " + propertyFile); }
Source:
private boolean canRestoreVmConfigFromSnapshot() { Snapshot snapshot = getSnapshot(); return snapshot.getType() == SnapshotType.PREVIEW || snapshot.getType() == SnapshotType.STATELESS ? getSnapshotsManager().canRestoreVmConfigurationFromSnapshot(getVm(), snapshot, new VmInterfaceManager(getMacPool())) : true; }

Target:
private boolean canRestoreVmConfigFromSnapshot() { Snapshot snapshot = getSnapshot(); return snapshot.getType() == SnapshotType.PREVIEW ? getSnapshotsManager().canRestoreVmConfigurationFromSnapshot(getVm(), snapshot, new VmInterfaceManager(getMacPool())) : true; }
Source:
public static void setup() { grobidService = new GrobidService(JabRefPreferences.getInstance()); }

Target:
public static void setup() { grobidService = new GrobidService("<LINK_0>"); }
Source:
public static void initializeDefaults(IPreferenceStore store) { boolean[] highContrast = new boolean[] { false }; try { Display.getDefault().syncExec(() -> { try { highContrast[0] = Display.getDefault().getHighContrast(); } catch (SWTException e) { } }); } catch (SWTException e) { } PreferenceConverter.setDefault(store, P_DEFAULT, highContrast[0] ? DEFAULT_HIGH_CONTRAST : DEFAULT); PreferenceConverter.setDefault(store, P_PROC_INSTR, PROC_INSTR); PreferenceConverter.setDefault(store, P_STRING, STRING); PreferenceConverter.setDefault(store, P_EXTERNALIZED_STRING, EXTERNALIZED_STRING); PreferenceConverter.setDefault(store, P_TAG, TAG); PreferenceConverter.setDefault(store, P_XML_COMMENT, XML_COMMENT); PreferenceConverter.setDefault(store, P_HEADER_KEY, HEADER_KEY); PreferenceConverter.setDefault(store, P_HEADER_OSGI, HEADER_OSGI); store.setDefault(P_HEADER_OSGI + IPDEColorConstants.P_BOLD_SUFFIX, true); PreferenceConverter.setDefault(store, P_HEADER_VALUE, highContrast[0] ? HEADER_VALUE_HIGH_CONTRAST : HEADER_VALUE); PreferenceConverter.setDefault(store, P_HEADER_ATTRIBUTES, highContrast[0] ? HEADER_ASSIGNMENT_HIGH_CONTRAST : HEADER_ATTRIBUTES); store.setDefault(P_HEADER_ATTRIBUTES + IPDEColorConstants.P_ITALIC_SUFFIX, true); PreferenceConverter.setDefault(store, P_HEADER_ASSIGNMENT, HEADER_ASSIGNMENT); }

Target:
public static void initializeDefaults(IPreferenceStore store) { PreferenceConverter.setDefault(store, P_DEFAULT, DEFAULT); PreferenceConverter.setDefault(store, P_PROC_INSTR, PROC_INSTR); PreferenceConverter.setDefault(store, P_STRING, STRING); PreferenceConverter.setDefault(store, P_EXTERNALIZED_STRING, EXTERNALIZED_STRING); PreferenceConverter.setDefault(store, P_TAG, TAG); PreferenceConverter.setDefault(store, P_XML_COMMENT, XML_COMMENT); PreferenceConverter.setDefault(store, P_HEADER_KEY, HEADER_KEY); PreferenceConverter.setDefault(store, P_HEADER_OSGI, HEADER_OSGI); store.setDefault(P_HEADER_OSGI + IPDEColorConstants.P_BOLD_SUFFIX, true); PreferenceConverter.setDefault(store, P_HEADER_VALUE, HEADER_VALUE); PreferenceConverter.setDefault(store, P_HEADER_ATTRIBUTES, HEADER_ATTRIBUTES); store.setDefault(P_HEADER_ATTRIBUTES + IPDEColorConstants.P_ITALIC_SUFFIX, true); PreferenceConverter.setDefault(store, P_HEADER_ASSIGNMENT, HEADER_ASSIGNMENT); try { Display display = Display.getDefault(); Runnable runnable = () -> { if (!display.isDisposed() && display.getHighContrast()) { PreferenceConverter.setDefault(store, P_DEFAULT, DEFAULT_HIGH_CONTRAST); PreferenceConverter.setDefault(store, P_HEADER_VALUE, HEADER_VALUE_HIGH_CONTRAST); PreferenceConverter.setDefault(store, P_HEADER_ATTRIBUTES, HEADER_ASSIGNMENT_HIGH_CONTRAST); } }; if (display == Display.getCurrent()) { runnable.run(); } else { display.asyncExec(runnable); } } catch (SWTException e) { } }
Source:
public void testBadIntegerReconnectAttempts() { udpOperation.get(ElytronDescriptionConstants.ICMP_ERROR_RECONNECT_ATTEMPTS).set(BAD_RECONNECT_NUMBER); ModelNode response = services.executeOperation(udpOperation); assertCorrectError(response, BAD_RECONNECT_NUMBER + " is an invalid value for parameter icmp-error-reconnect-attempts. A minimum value of -1 is required"); assertFailed(response); }

Target:
public void testBadIntegerReconnectAttempts() { udpOperation.get(ElytronDescriptionConstants.RECONNECT_ATTEMPTS).set(BAD_RECONNECT_NUMBER); ModelNode response = services.executeOperation(udpOperation); assertCorrectError(response, new String[] {"WFLYCTL0117", Integer.toString(BAD_RECONNECT_NUMBER)}); assertFailed(response); }
Source:
public Response upgrade(Action action) { UpgradeHostParameters params = new UpgradeHostParameters(guid); if (action.isSetImage()) { params.setoVirtIsoFile(action.getImage()); } if (action.isReboot() != null) { params.setReboot(action.isReboot()); } return doAction(ActionType.UpgradeHost, params, action); }

Target:
public Response upgrade(Action action) { UpgradeHostParameters params = new UpgradeHostParameters(guid); if (action.isSetImage()) { params.setoVirtIsoFile(action.getImage()); } if (action.isSetReboot()) { params.setReboot(action.isReboot()); } return doAction(ActionType.UpgradeHost, params, action); }
Source:
public void openPreNullWithRequired() throws IOException { configFactory.copyRealmFromAssets(context, "default-before-migration.realm", Realm.DEFAULT_REALM_NAME); RealmMigration migration = new RealmMigration() { @Override public void migrate(DynamicRealm realm, long oldVersion, long newVersion) { RealmSchema schema = realm.getSchema(); if (oldVersion == 0) { schema.get(AllTypes.CLASS_NAME) .addField(AllTypes.FIELD_BYTE, byte.class) .addField(AllTypes.FIELD_SHORT, short.class) .addField(AllTypes.FIELD_INT, int.class); oldVersion++; } } }; RealmConfiguration realmConfig = configFactory.createConfigurationBuilder() .schemaVersion(1) .schema(AllTypes.class) .migration(migration) .build(); Realm realm = Realm.getInstance(realmConfig); realm.beginTransaction(); try { AllTypes allTypes = realm.createObject(AllTypes.class); allTypes.setColumnString(null); fail(); } catch (IllegalArgumentException ignored) { } realm.cancelTransaction(); realm.close(); }

Target:
public void openPreNullWithRequired() throws IOException { configFactory.copyRealmFromAssets(context, "default-before-migration.realm", Realm.DEFAULT_REALM_NAME); RealmConfiguration realmConfig = configFactory.createConfigurationBuilder() .schemaVersion(0) .schema(AllTypes.class) .build(); Realm realm = Realm.getInstance(realmConfig); realm.beginTransaction(); try { AllTypes allTypes = realm.createObject(AllTypes.class); allTypes.setColumnString(null); fail(); } catch (IllegalArgumentException ignored) { } realm.cancelTransaction(); realm.close(); }
Source:
public void testXmlValidateValid() { Activator plugin = Activator.getDefault(); if (plugin == null) { throw new IllegalStateException(); } URL location = FileLocator.find(plugin.getBundle(), PATH_VALID, null); File file = null; try { IPath path = new Path(FileLocator.toFileURL(location).getPath()); file = path.toFile(); } catch (IOException e) { throw new IllegalStateException(); } File[] validFiles = file.listFiles(); for (File f : validFiles) { assertTrue("File " + f.getName(), XmlUtils.xmlValidate(f).isOK()); } }

Target:
public void testXmlValidateValid() { IPath path = getAbsolutePath(PATH_VALID); File file = path.toFile(); File[] validFiles = file.listFiles(); assertTrue(validFiles.length > 0); for (File f : validFiles) { assertTrue("File " + f.getName(), XmlUtils.xmlValidate(f).isOK()); } }
Source:
public RegionBootstrap(final Context context, final MonitorNotifier monitorNotifier, List<Region> regions) { if (context.getApplicationContext() == null) { throw new NullPointerException("Application Context should not be null"); } beaconManager = BeaconManager.getInstanceForApplication(context.getApplicationContext()); this.context = context; this.monitorNotifier = monitorNotifier; this.monitorNotifier = new BootstrapNotifier() { public Context getApplicationContext() { return context.getApplicationContext(); } public void didEnterRegion(Region region) { monitorNotifier.didEnterRegion(region); } public void didExitRegion(Region region) { monitorNotifier.didExitRegion(region); } public void didDetermineStateForRegion(int state, Region region) { monitorNotifier.didDetermineStateForRegion(state, region); } }; this.regions = regions; beaconConsumer = new InternalBeaconConsumer(); beaconManager.bind(beaconConsumer); LogManager.d(TAG, "Waiting for BeaconService connection"); }

Target:
public RegionBootstrap(final Context context, final MonitorNotifier monitorNotifier, List<Region> regions) { if (context == null) { throw new NullPointerException("Application Context should not be null"); } this.context = context.getApplicationContext(); this.monitorNotifier = monitorNotifier; this.monitorNotifier = new BootstrapNotifier() { public Context getApplicationContext() { return context.getApplicationContext(); } public void didEnterRegion(Region region) { monitorNotifier.didEnterRegion(region); } public void didExitRegion(Region region) { monitorNotifier.didExitRegion(region); } public void didDetermineStateForRegion(int state, Region region) { monitorNotifier.didDetermineStateForRegion(state, region); } }; this.regions = regions; beaconManager = BeaconManager.getInstanceForApplication(context); beaconConsumer = new InternalBeaconConsumer(); beaconManager.bind(beaconConsumer); LogManager.d(TAG, "Waiting for BeaconService connection"); }
Source:
public void emptyGzip() { ObjectMapper om = Unirest.config().getObjectMapper(); ObjectMapper omWithNull = new ObjectMapper() { @Override public <T> T readValue(String value, Class<T> valueType) { return value == null || value.trim().isEmpty() ? null : om.readValue(value, valueType); } @Override public String writeValue(Object value) { return om.writeValue(value); } }; Unirest.config().setObjectMapper(omWithNull); HttpResponse<Map<?,?>> resp = Unirest.post(MockServer.EMPTY_GZIP) .header("Content-Type", "application/json") .accept( "application/json") .asObject(Map.class); Unirest.config().setObjectMapper(om); assertFalse(resp.getParsingError().isPresent()); }

Target:
public void emptyGzip() { HttpResponse<String> result = Unirest.post(MockServer.EMPTY_GZIP) .asString(); assertFalse(result.getParsingError().isPresent()); assertEquals("", result.getBody()); }
Source:
private void cleanupForMissingExecutor(Executor executor, List<ExecutableFlow> executions) { String finalizeReason = "Executor was unreachable, executor id: " + executor.getId(); finalizeFlows(executions, finalizeReason); try { this.executorLoader.removeExecutor(executor.getHost(), executor.getPort()); } catch (ExecutorManagerException ex) { logger.error(String.format("Attempt to remove executor %s failed with reason %s", executor.getId(), ex)); } }

Target:
private void cleanupForMissingExecutor(Executor executor, List<ExecutableFlow> executions) { String finalizeReason = String.format("Executor was unreachable, executor-id: %s, executor-host: %s, " + "executor-port: %d", executor.getId(), executor.getHost(), executor.getPort()); finalizeFlows(executions, finalizeReason); }
Source:
public void setAttributeOverrides(List<String> attributeOverrides) { Map<String, Serializable> attributeOverrideMap = new HashMap<>(); for (String s : attributeOverrides) { String[] keyValue = s.split("=", 2); if (keyValue.length < 2) { LOGGER.error("Invalid attribute override configured for monitored directory"); throw new IllegalStateException( "Invalid attribute override configured for monitored directory"); } attributeOverrideMap.computeIfAbsent(keyValue[0], k -> new ArrayList<String>()); ArrayList valueList = (ArrayList) attributeOverrideMap.get(keyValue[0]); valueList.add(keyValue[1]); } this.attributeOverrides = attributeOverrideMap; }

Target:
public void setAttributeOverrides(List<String> attributeOverrides) { Map<String, Serializable> attributeOverrideMap = new HashMap<>(); for (String s : attributeOverrides) { String[] keyValue = s.split("=", 2); if (keyValue.length < 2) { LOGGER.error("Invalid attribute override configured for monitored directory"); throw new IllegalStateException( "Invalid attribute override configured for monitored directory"); } attributeOverrideMap.computeIfAbsent(keyValue[0], k -> new ArrayList<String>()); List valueList = (List) attributeOverrideMap.get(keyValue[0]); valueList.add(keyValue[1]); } this.attributeOverrides = attributeOverrideMap; }
Source:
private static SerializableError createSerializableError(Exception exception) { return SerializableError.of( exception.getMessage(), exception.getClass()); }

Target:
private static SerializableError createSerializableError(Exception exception) { return SerializableError.of( exception.getMessage(), exception.getClass(), getStackTraceElementsAsList(exception)); }
Source:
private String getJarBackupFilename(String filename) { Pattern jarFilenamePattern = Pattern.compile("^(.*)\\.(jar|JAR)$"); Matcher jarFilenameMatcher = jarFilenamePattern.matcher(filename); if (!jarFilenameMatcher.find()) { return filename + BACKUP_FILENAME_SUFFIX; } return jarFilenameMatcher.group(1) + backupSuffix + ".jar"; }

Target:
private String getJarBackupFilename(String filename) { Pattern jarFilenamePattern = Pattern.compile("^(.*)\\.jar$", Pattern.CASE_INSENSITIVE); Matcher jarFilenameMatcher = jarFilenamePattern.matcher(filename); if (!jarFilenameMatcher.find()) { return filename + BACKUP_FILENAME_SUFFIX; } return jarFilenameMatcher.group(1) + backupSuffix + ".jar"; }
Source:
public boolean isEnabled() { return baragonConfiguration.getWorkerConfiguration().isEnabled(); }

Target:
public boolean isEnabled() { return config.isEnabled(); }
Source:
private TableScanNode tableScan(String id, List<VariableReferenceExpression> variables) { ImmutableMap.Builder<VariableReferenceExpression, ColumnHandle> assignments = ImmutableMap.builder(); for (VariableReferenceExpression variable : variables) { assignments.put(variable, new TpchColumnHandle("orderkey", BIGINT)); } TpchTableHandle tableHandle = new TpchTableHandle("orders", 1.0); return new TableScanNode( new PlanNodeId(id), new TableHandle( new ConnectorId("tpch"), tableHandle, TpchTransactionHandle.INSTANCE, Optional.of(new TpchTableLayoutHandle(tableHandle, TupleDomain.all()))), variables, assignments.build(), false, TupleDomain.all(), TupleDomain.all()); }

Target:
private TableScanNode tableScan(String id, List<VariableReferenceExpression> variables) { ImmutableMap.Builder<VariableReferenceExpression, ColumnHandle> assignments = ImmutableMap.builder(); for (VariableReferenceExpression variable : variables) { assignments.put(variable, new TpchColumnHandle("orderkey", BIGINT)); } TpchTableHandle tableHandle = new TpchTableHandle("orders", 1.0); return new TableScanNode( new PlanNodeId(id), new TableHandle( new ConnectorId("tpch"), tableHandle, TpchTransactionHandle.INSTANCE, Optional.of(new TpchTableLayoutHandle(tableHandle, TupleDomain.all()))), variables, assignments.build(), TupleDomain.all(), TupleDomain.all()); }
Source:
public TimestampService createTimestampService(KeyValueService rawKvs, Optional<TableReference> timestampTable) { AtlasDbVersion.ensureVersionReported(); Preconditions.checkArgument(rawKvs instanceof CassandraKeyValueService, "TimestampService must be created from an instance of" + " CassandraKeyValueService, found %s", rawKvs.getClass()); return PersistentTimestampService.create( CassandraTimestampBoundStore.create((CassandraKeyValueService) rawKvs, timestampTable.orElse(AtlasDbConstants.TIMESTAMP_TABLE))); }

Target:
public TimestampService createTimestampService(KeyValueService rawKvs, Optional<TableReference> timestampTable) { Preconditions.checkArgument(!timestampTable.isPresent() || timestampTable.get().equals(AtlasDbConstants.TIMESTAMP_TABLE), "***ERROR:This can cause severe data corruption.***\nUnexpected timestamp table found: " + timestampTable.map(TableReference::getQualifiedName).orElse("unknown table") + "\nThis can happen if you configure the timelock server to use Cassandra KVS for timestamp" + " persistence, which is unsupported.\nWe recommend using the default paxos timestamp" + " persistence. However, if you are need to persist the timestamp service state in the" + " database, please specify a valid DbKvs config in the timestampBoundPersister block." + "\nNote that if the service has already been running, you will have to migrate the timestamp" + " table to Postgres/Oracle and rename it to %s.", AtlasDbConstants.TIMELOCK_TIMESTAMP_TABLE); AtlasDbVersion.ensureVersionReported(); Preconditions.checkArgument(rawKvs instanceof CassandraKeyValueService, "TimestampService must be created from an instance of" + " CassandraKeyValueService, found %s", rawKvs.getClass()); return PersistentTimestampService.create( CassandraTimestampBoundStore.create((CassandraKeyValueService) rawKvs)); }