auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testNodeDiscoveryRest() { ElasticsearchSchedulerContainer scheduler = getScheduler(); TasksResponse tasksResponse = new TasksResponse(scheduler.getIpAddress(), NODE_COUNT); List<JSONObject> tasks = tasksResponse.getTasks(); ElasticsearchNodesResponse nodesResponse = new ElasticsearchNodesResponse(tasks, NODE_COUNT); assertTrue("Elasticsearch nodes did not discover each other within 5 minutes", nodesResponse.isDiscoverySuccessful()); try (InputStream inputstream = CONFIG.dockerClient.copyFileFromContainerCmd(CLUSTER.getMesosContainer().getContainerId(), "/var/lib/elasticsearch/mesos-elasticsearch").withHostPath("/tmp").exec()) { String contents = IOUtils.toString(inputstream); inputstream.close(); assertTrue(contents.contains("mesos-elasticsearch/nodes")); assertTrue(contents.contains("mesos-elasticsearch/nodes/0")); assertTrue(contents.contains("mesos-elasticsearch/nodes/0/_state")); assertTrue(contents.contains("mesos-elasticsearch/nodes/0/node.lock")); assertTrue(contents.contains("mesos-elasticsearch/nodes/1")); assertTrue(contents.contains("mesos-elasticsearch/nodes/1/_state")); assertTrue(contents.contains("mesos-elasticsearch/nodes/1/node.lock")); assertTrue(contents.contains("mesos-elasticsearch/nodes/2")); assertTrue(contents.contains("mesos-elasticsearch/nodes/2/_state")); assertTrue(contents.contains("mesos-elasticsearch/nodes/2/node.lock")); } catch (IOException e) { LOGGER.error("Could not copy /var/lib/elasticsearch/mesos-elasticsearch from Mesos-Local container"); } }

Target:
public void testNodeDiscoveryRest() { ElasticsearchSchedulerContainer scheduler = getScheduler(); TasksResponse tasksResponse = new TasksResponse(scheduler.getIpAddress(), NODE_COUNT); List<JSONObject> tasks = tasksResponse.getTasks(); ElasticsearchNodesResponse nodesResponse = new ElasticsearchNodesResponse(tasks, NODE_COUNT); assertTrue("Elasticsearch nodes did not discover each other within 5 minutes", nodesResponse.isDiscoverySuccessful()); }
Source:
public void setIgnoreErrors(final boolean ignoreErrors) { this.ignoreErrors = ignoreErrors; }

Target:
void setIgnoreErrors(final boolean ignoreErrors) { this.ignoreErrors = ignoreErrors; }
Source:
public Eh107CacheManager getCacheManager(ConfigSupplier configSupplier, Properties properties) { Eh107CacheManager cacheManager; ConcurrentMap<URI, Eh107CacheManager> byURI; final ClassLoader classLoader = configSupplier.getClassLoader(); final URI uri = configSupplier.getUri(); synchronized (cacheManagers) { byURI = cacheManagers.get(classLoader); if (byURI == null) { byURI = new ConcurrentHashMap<URI, Eh107CacheManager>(); cacheManagers.put(classLoader, byURI); } cacheManager = byURI.get(uri); if (cacheManager == null || cacheManager.isClosed()) { if(cacheManager != null) { byURI.remove(uri, cacheManager); } cacheManager = createCacheManager(uri, configSupplier.getConfiguration(), properties); byURI.put(uri, cacheManager); } } return cacheManager; }

Target:
Eh107CacheManager getCacheManager(ConfigSupplier configSupplier, Properties properties) { Eh107CacheManager cacheManager; ConcurrentMap<URI, Eh107CacheManager> byURI; final ClassLoader classLoader = configSupplier.getClassLoader(); final URI uri = configSupplier.getUri(); synchronized (cacheManagers) { byURI = cacheManagers.get(classLoader); if (byURI == null) { byURI = new ConcurrentHashMap<URI, Eh107CacheManager>(); cacheManagers.put(classLoader, byURI); } cacheManager = byURI.get(uri); if (cacheManager == null || cacheManager.isClosed()) { if(cacheManager != null) { byURI.remove(uri, cacheManager); } cacheManager = createCacheManager(uri, configSupplier.getConfiguration(), properties); byURI.put(uri, cacheManager); } } return cacheManager; }
Source:
private String getDatabaseTypeWithVersion(String databaseType) { try { if (databaseType != null && databaseType.equals("mysql")) { if (conn != null && (!conn.isClosed())) { DatabaseMetaData metaData = conn.getMetaData(); String databaseProductVersion = metaData.getDatabaseProductVersion(); double versionWithMinorNumber = Double.parseDouble(databaseProductVersion.substring(0, 3)); if (versionWithMinorNumber >= 5.7) { databaseType = databaseType + "-5.7+"; } } } } catch (SQLException | NumberFormatException e) { log.warn("Unable to retrieve version of the database."); } return databaseType; }

Target:
private String getDatabaseTypeWithVersion(String databaseType) throws SQLException { if (databaseType != null && databaseType.equals("mysql")) { if (conn != null && (!conn.isClosed())) { DatabaseMetaData metaData = conn.getMetaData(); int databaseMajorVersion = metaData.getDatabaseMajorVersion(); int databaseMinorVersion = metaData.getDatabaseMinorVersion(); if (databaseMajorVersion == 5 && databaseMinorVersion >= 7) { databaseType = databaseType + "-5.7+"; } } } return databaseType; }
Source:
public void mercury_recentWikiActivity_anonNavigateToRWAfromMenu() { new MainPage().open(); new TopBar(driver).openNavigation().openRecentWikiActivity(); }

Target:
public void mercury_recentWikiActivity_anonNavigateToRWAfromMenu() { new MainPage() .open() .getTopBar() .openNavigation() .openRecentWikiActivity(); }
Source:
private void addRecordsToTasks(final ConsumerRecords<byte[], byte[]> records) { for (final TopicPartition partition : records.partitions()) { final StreamTask task = taskManager.activeTask(partition); if (task == null) { if (!isRunning()) { ENDING_SHUTDOWN and don't find the task it implies that it was a newly assigned continue; } log.error( "Unable to locate active task for received-record partition {}. Current tasks: {}", partition, taskManager.toString(">") ); throw new NullPointerException("Task was unexpectedly missing for partition " + partition); } else if (task.isClosed()) { log.info("Stream task is already closed, probably because it got unexpectedly migrated to another thread already. " + "Notifying the thread to trigger a new rebalance immediately.", task.id()); throw new TaskMigratedException(task); } task.addRecords(partition, records.records(partition)); } }

Target:
private void addRecordsToTasks(final ConsumerRecords<byte[], byte[]> records) { for (final TopicPartition partition : records.partitions()) { final StreamTask task = taskManager.activeTask(partition); if (task == null) { if (!isRunning()) { ENDING_SHUTDOWN and don't find the task it implies that it was a newly assigned log.info("State already transits to {}, skipping the add records to non-existing task for partition {}", state, partition); continue; } log.error( "Unable to locate active task for received-record partition {}. Current tasks: {}", partition, taskManager.toString(">") ); throw new NullPointerException("Task was unexpectedly missing for partition " + partition); } else if (task.isClosed()) { log.info("Stream task is already closed, probably because it got unexpectedly migrated to another thread already. " + "Notifying the thread to trigger a new rebalance immediately.", task.id()); throw new TaskMigratedException(task); } task.addRecords(partition, records.records(partition)); } }
Source:
private void checkFilesAccessibility(File bundledPlugins, File externalPlugins) { try { if (!bundledPlugins.canRead() || !externalPlugins.canRead()) { LOG.error("Could not read plugins." + "Please check access rights on files in external and bundled folder."); throw new FileAccessRightsCheckException("Could not read plugins. " + "Please check access rights in external and bundled plugin folder."); } } catch (SecurityException se) { throw new RuntimeException(String.format("SecurityException occurred" + " while checking file access rights.", se.getStackTrace())); } }

Target:
private void checkFilesAccessibility(File bundledPlugins, File externalPlugins) { boolean bundled = bundledPlugins.canRead(); boolean external = externalPlugins.canRead(); if (!bundled || !external) { String folder = bundled ? externalPlugins.getAbsolutePath() : bundledPlugins.getAbsolutePath(); LOG.error(String.format("Could not read plugins." + "Please check access rights on files in folder: %s.", folder)); throw new FileAccessRightsCheckException(String.format("Could not read plugins. Please check access rights in folder: %s", folder)); } }
Source:
public static List<TieredBlock> getConsumableInArrearTieredBlocks(final Usage usage, final String unitType) { Preconditions.checkArgument(usage.getBillingMode() == BillingMode.IN_ARREAR && usage.getUsageType() == UsageType.CONSUMABLE); Preconditions.checkArgument(usage.getTiers().length > 0); final List<TieredBlock> result = Lists.newLinkedList(); for (Tier tier : usage.getTiers()) { boolean found = false; for (TieredBlock tierBlock : tier.getTieredBlocks()) { if (tierBlock.getUnit().getName().equals(unitType)) { result.add(tierBlock); found = true; break; } } Preconditions.checkState(found, String.format("Catalog issue in usage section '%s': Missing tierBlock definition for unit '%s'", usage.getName(), unitType)); } return result; }

Target:
public static List<TieredBlock> getConsumableInArrearTieredBlocks(final Usage usage, final String unitType) { Preconditions.checkArgument(usage.getBillingMode() == BillingMode.IN_ARREAR && usage.getUsageType() == UsageType.CONSUMABLE); Preconditions.checkArgument(usage.getTiers().length > 0); final List<TieredBlock> result = Lists.newLinkedList(); for (Tier tier : usage.getTiers()) { boolean found = false; for (TieredBlock tierBlock : tier.getTieredBlocks()) { if (tierBlock.getUnit().getName().equals(unitType)) { result.add(tierBlock); found = true; break; } } Preconditions.checkState(found, "Catalog issue in usage section '%s': Missing tierBlock definition for unit '%s'", usage.getName(), unitType); } return result; }
Source:
public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; ParameterSummary<?> that = (ParameterSummary<?>) o; if (description != null ? !description.equals(that.description) : that.description != null) return false; if (name != null ? !name.equals(that.name) : that.name != null) return false; if (type != null ? !type.equals(that.type) : that.type != null) return false; if (defaultValue != null ? !type.equals(that.defaultValue) : that.defaultValue != null) return false; return true; }

Target:
public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; ParameterSummary<?> that = (ParameterSummary<?>) o; return Objects.equal(this.name, that.name) && Objects.equal(this.type, that.type) && Objects.equal(this.description, that.description) && Objects.equal(this.defaultValue, that.defaultValue); }
Source:
public SqlNode validate(SqlNode sqlNode) throws ValidationException { ensure(State.STATE_3_PARSED); final SqlConformance conformance = conformance(); final CalciteCatalogReader catalogReader = createCatalogReader(); final SqlOperatorTable opTab = ChainedSqlOperatorTable.of(operatorTable, catalogReader); this.validator = new CalciteSqlValidator(opTab, catalogReader, typeFactory, conformance); this.validator.setIdentifierExpansion(true); try { validatedSqlNode = validator.validate(sqlNode); } catch (RuntimeException e) { throw new ValidationException(e); } state = State.STATE_4_VALIDATED; return validatedSqlNode; }

Target:
public SqlNode validate(SqlNode sqlNode) throws ValidationException { ensure(State.STATE_3_PARSED); this.validator = createSqlValidator(createCatalogReader()); try { validatedSqlNode = validator.validate(sqlNode); } catch (RuntimeException e) { throw new ValidationException(e); } state = State.STATE_4_VALIDATED; return validatedSqlNode; }
Source:
private void createFileIfNecessary() throws IOException { this.file = FileUtils.toFile( url ); if ( file == null ) { this.file = File.createTempFile( "classPathResourceAsFile", getOriginalExtension(), parentDirectory ); this.fileIsTemporary = true; try ( InputStream input = url.openStream() ; OutputStream output = new FileOutputStream( file ) ) { IOUtils.copy( input, output ); } } }

Target:
private void createFileIfNecessary() throws IOException { this.file = FileUtils.toFile( url ); if ( file == null ) { this.file = File.createTempFile( "classPathResourceAsFile", getOriginalExtension(), parentDirectory ); this.hasCreatedTempFile = true; try ( InputStream input = url.openStream(); OutputStream output = new FileOutputStream( file ) ) { IOUtils.copy( input, output ); } } }
Source:
private Container createGuestAgentContainerPanel(VmNetworkInterface networkInterface, List<VmGuestAgentInterface> allGuestAgentData) { Row content = new Row(); Column column = new Column(ColumnSize.MD_12); content.add(column); for (VmGuestAgentInterface guestAgentInterface: allGuestAgentData) { if (guestAgentInterface.getMacAddress() != null && guestAgentInterface.getMacAddress().equals(networkInterface.getMacAddress())) { DListElement dl = Document.get().createDLElement(); dl.addClassName(DL_HORIZONTAL); addDetailItem(SafeHtmlUtils.fromSafeConstant(constants.nameVmGuestAgent()), guestAgentInterface.getInterfaceName(), dl); addDetailItem(SafeHtmlUtils.fromSafeConstant(constants.ipv4VmGuestAgent()), guestAgentInterface.getIpv4Addresses() != null ? String.join(COMMA_DELIMITOR, guestAgentInterface.getIpv4Addresses()) : constants.notAvailableLabel(), dl); addDetailItem(SafeHtmlUtils.fromSafeConstant(constants.ipv6VmGuestAgent()), guestAgentInterface.getIpv6Addresses() != null ? String.join(COMMA_DELIMITOR, guestAgentInterface.getIpv6Addresses()) : constants.notAvailableLabel(), dl); addDetailItem(SafeHtmlUtils.fromSafeConstant(constants.macVmGuestAgent()), guestAgentInterface.getMacAddress(), dl); column.getElement().appendChild(dl); } } if (allGuestAgentData.isEmpty()) { Span noDataSpan = new Span(); noDataSpan.setText(constants.notAvailableLabel()); column.add(noDataSpan); } return createItemContainerPanel(content); }

Target:
private Container createGuestAgentContainerPanel(VmNetworkInterface networkInterface, List<VmGuestAgentInterface> allGuestAgentData) { Row content = new Row(); Column column = new Column(ColumnSize.MD_12); content.add(column); for (VmGuestAgentInterface guestAgentInterface: allGuestAgentData) { if (guestAgentInterface.getMacAddress() != null && guestAgentInterface.getMacAddress().equals(networkInterface.getMacAddress())) { DListElement dl = Document.get().createDLElement(); dl.addClassName(DL_HORIZONTAL); addDetailItem(SafeHtmlUtils.fromSafeConstant(constants.nameVmGuestAgent()), guestAgentInterface.getInterfaceName(), dl); addDetailItem(SafeHtmlUtils.fromSafeConstant(constants.ipv4VmGuestAgent()), guestAgentInterface.getIpv4Addresses() != null ? String.join(COMMA_DELIMITER, guestAgentInterface.getIpv4Addresses()) : constants.notAvailableLabel(), dl); addDetailItem(SafeHtmlUtils.fromSafeConstant(constants.ipv6VmGuestAgent()), guestAgentInterface.getIpv6Addresses() != null ? String.join(COMMA_DELIMITER, guestAgentInterface.getIpv6Addresses()) : constants.notAvailableLabel(), dl); addDetailItem(SafeHtmlUtils.fromSafeConstant(constants.macVmGuestAgent()), guestAgentInterface.getMacAddress(), dl); column.getElement().appendChild(dl); } } if (allGuestAgentData.isEmpty()) { Span noDataSpan = new Span(); noDataSpan.setText(constants.notAvailableLabel()); column.add(noDataSpan); } return createItemContainerPanel(content); }
Source:
public void shouldUpdateStateOrProvinceForChargeWhenCountryIsUs() { ChargeEntity chargeSpy = spy(ChargeEntityFixture.aValidChargeEntity().build()); ChargeEventEntity chargeEvent = mock(ChargeEventEntity.class); AuthCardDetails authCardDetails = new AuthCardDetails(); Address address = new Address(); address.setCountry("US"); address.setPostcode("20500"); authCardDetails.setAddress(address); authCardDetails.setCardNo("1234567890"); when(chargeEvent.getStatus()).thenReturn(ENTERING_CARD_DETAILS); when(chargeEvent.getUpdated()).thenReturn(now()); when(mockedChargeEventDao.persistChargeEventOf(chargeSpy, null)).thenReturn(chargeEvent); when(mockedChargeDao.findByExternalId(chargeSpy.getExternalId())).thenReturn(Optional.of(chargeSpy)); when(mockNorthAmericanRegionMapper.getNorthAmericanRegionForCountry(any(AddressEntity.class))).thenReturn(Optional.of(UsState.WASHINGTON_DC)); when(chargeSpy.getEvents()).thenReturn(List.of(chargeEvent)); service.updateChargeAndEmitEventPostAuthorisation(chargeSpy.getExternalId(), ENTERING_CARD_DETAILS, authCardDetails, null, null, null, null, null); assertThat(chargeSpy.getCardDetails().getBillingAddress().get().getStateOrProvince(), is("DC")); }

Target:
public void shouldUpdateStateOrProvinceForChargeWhenCountryIsUs() { ChargeEntity chargeSpy = spy(ChargeEntityFixture.aValidChargeEntity().build()); ChargeEventEntity chargeEvent = mock(ChargeEventEntity.class); AuthCardDetails authCardDetails = new AuthCardDetails(); Address address = new Address(); address.setCountry("US"); address.setPostcode("20500"); authCardDetails.setAddress(address); authCardDetails.setCardNo("1234567890"); when(chargeEvent.getStatus()).thenReturn(ENTERING_CARD_DETAILS); when(chargeEvent.getUpdated()).thenReturn(now()); when(mockedChargeEventDao.persistChargeEventOf(chargeSpy, null)).thenReturn(chargeEvent); when(mockedChargeDao.findByExternalId(chargeSpy.getExternalId())).thenReturn(Optional.of(chargeSpy)); when(mockNorthAmericanRegionMapper.getNorthAmericanRegionForCountry(any(Address.class))).thenAnswer((Answer<Optional<? extends NorthAmericaRegion>>) invocationOnMock -> Optional.of(UsState.WASHINGTON_DC)); when(chargeSpy.getEvents()).thenReturn(List.of(chargeEvent)); service.updateChargeAndEmitEventPostAuthorisation(chargeSpy.getExternalId(), ENTERING_CARD_DETAILS, authCardDetails, null, null, null, null, null); assertThat(chargeSpy.getCardDetails().getBillingAddress().get().getStateOrProvince(), is("DC")); }
Source:
public void testDefaultProvisioningConfiguration() throws Exception { final String iface = "test_wlan0"; final IpManager ipm = new IpManager(mContext, iface, mCb, mNMService); ProvisioningConfiguration config = new ProvisioningConfiguration.Builder() .withoutIPv4() .withoutIpReachabilityMonitor() .build(); ipm.startProvisioning(config); verify(mCb, times(1)).setNeighborDiscoveryOffload(true); verify(mNMService, timeout(100).times(1)).disableIpv6(iface); verify(mNMService, timeout(100).times(1)).clearInterfaceAddresses(iface); verify(mCb, timeout(100).times(1)).setFallbackMulticastFilter(false); verify(mCb, never()).onProvisioningFailure(any()); ipm.stop(); verify(mNMService, timeout(100).times(1)).disableIpv6(iface); verify(mNMService, timeout(100).times(1)).clearInterfaceAddresses(iface); }

Target:
public void testDefaultProvisioningConfiguration() throws Exception { final String iface = "test_wlan0"; final IpManager ipm = makeIpManager(iface); ProvisioningConfiguration config = new ProvisioningConfiguration.Builder() .withoutIPv4() .withoutIpReachabilityMonitor() .build(); ipm.startProvisioning(config); verify(mCb, times(1)).setNeighborDiscoveryOffload(true); verify(mCb, timeout(100).times(1)).setFallbackMulticastFilter(false); verify(mCb, never()).onProvisioningFailure(any()); ipm.stop(); verify(mNMService, timeout(100).times(1)).disableIpv6(iface); verify(mNMService, timeout(100).times(1)).clearInterfaceAddresses(iface); }
Source:
public void dispose() { if (getTarget() != null) { getTarget().removeResourceSetListener(this); } }

Target:
public void dispose() { if (getTarget() != null) { getTarget().removeResourceSetListener(this); } diagramEditor = null; }
Source:
public void addToOrderBook(Order order) throws StockMarketExpection { if(order instanceof BuyOrder) { ArrayList<Order> temp = buyOrders.get(order.getStockSymbol()); if(temp != null) { temp.add(order); } else { temp = new ArrayList<Order>(); temp.add(order); } buyOrders.put(order.getStockSymbol(), temp); } else if(order instanceof SellOrder) { ArrayList<Order> temp = sellOrders.get(order.getStockSymbol()); if(temp != null) { temp.add(order); } else { temp = new ArrayList<Order>(); temp.add(order); } sellOrders.put(order.getStockSymbol(), temp); } else { throw new StockMarketExpection("In OrderBook, addToOrderBook: Parameter is not an Order"); } }

Target:
public void addToOrderBook(Order order) throws StockMarketExpection { if(order instanceof BuyOrder) { ArrayList<Order> buyOrdersCopy = buyOrders.get(order.getStockSymbol()); if(buyOrdersCopy != null) { buyOrdersCopy.add(order); } else { buyOrdersCopy = new ArrayList<Order>(); buyOrdersCopy.add(order); } buyOrders.put(order.getStockSymbol(), buyOrdersCopy); } else if(order instanceof SellOrder) { ArrayList<Order> temp = sellOrders.get(order.getStockSymbol()); if(temp != null) { temp.add(order); } else { temp = new ArrayList<Order>(); temp.add(order); } sellOrders.put(order.getStockSymbol(), temp); } else { throw new StockMarketExpection("In OrderBook, addToOrderBook: Parameter is not an Order"); } }
Source:
public void overrideComputationScheduler() { try { RxJavaHooks.setOnComputationScheduler(replaceWithImmediate); Assert.assertSame(Schedulers.immediate(), Schedulers.computation()); } finally { RxJavaHooks.reset(); } Assert.assertNotSame(Schedulers.immediate(), Schedulers.computation()); }

Target:
public void overrideComputationScheduler() { try { RxJavaHooks.setOnComputationScheduler(replaceWithImmediate); assertSame(Schedulers.immediate(), Schedulers.computation()); } finally { RxJavaHooks.reset(); } assertNotSame(Schedulers.immediate(), Schedulers.computation()); }
Source:
public void testToCalendarWithDateAndTimeZoneNull() { try { DateUtils.toCalendar(null, null); fail("Expected NullPointerException to be thrown when both Date and TimeZone are null"); } catch(final NullPointerException npe) { } }

Target:
public void testToCalendarWithDateAndTimeZoneNull() { DateUtils.toCalendar(null, null); }
Source:
public void LengthBatchWindowTest2() throws InterruptedException { log.info("Testing length batch window with no of events greater than window size"); final int length = 4; SiddhiManager siddhiManager = new SiddhiManager(); String cseEventStream = "define stream cseEventStream (symbol string, price float, volume int);"; String query = "" + "@info(name = 'query1') " + "from cseEventStream#window.lengthBatch(" + length + ") " + "select symbol,price,volume " + "insert expired events into outputStream ;"; ExecutionPlanRuntime executionPlanRuntime = siddhiManager.createExecutionPlanRuntime(cseEventStream + query); executionPlanRuntime.addCallback("outputStream", new StreamCallback() { @Override public void receive(Event[] events) { EventPrinter.print(events); for (Event event : events) { count++; Assert.assertEquals("In event order", count, event.getData(2)); } eventArrived = true; } }); InputHandler inputHandler = executionPlanRuntime.getInputHandler("cseEventStream"); executionPlanRuntime.start(); inputHandler.send(new Object[]{"IBM", 700f, 1}); inputHandler.send(new Object[]{"WSO2", 60.5f, 2}); inputHandler.send(new Object[]{"IBM", 700f, 3}); inputHandler.send(new Object[]{"WSO2", 60.5f, 4}); inputHandler.send(new Object[]{"IBM", 700f, 5}); inputHandler.send(new Object[]{"WSO2", 60.5f, 6}); Thread.sleep(500); Assert.assertEquals("Total event count", 4, count); Assert.assertTrue(eventArrived); executionPlanRuntime.shutdown(); }

Target:
public void LengthBatchWindowTest2() throws InterruptedException { log.info("Testing length batch window with no of events greater than window size"); final int length = 4; SiddhiManager siddhiManager = new SiddhiManager(); String cseEventStream = "define stream cseEventStream (symbol string, price float, volume int);"; String query = "" + "@info(name = 'query1') " + "from cseEventStream#window.lengthBatch(" + length + ") " + "select symbol,price,volume " + "insert into outputStream ;"; ExecutionPlanRuntime executionPlanRuntime = siddhiManager.createExecutionPlanRuntime(cseEventStream + query); executionPlanRuntime.addCallback("outputStream", new StreamCallback() { @Override public void receive(Event[] events) { EventPrinter.print(events); for (Event event : events) { count++; Assert.assertEquals("In event order", count, event.getData(2)); } eventArrived = true; } }); InputHandler inputHandler = executionPlanRuntime.getInputHandler("cseEventStream"); executionPlanRuntime.start(); inputHandler.send(new Object[]{"IBM", 700f, 1}); inputHandler.send(new Object[]{"WSO2", 60.5f, 2}); inputHandler.send(new Object[]{"IBM", 700f, 3}); inputHandler.send(new Object[]{"WSO2", 60.5f, 4}); inputHandler.send(new Object[]{"IBM", 700f, 5}); inputHandler.send(new Object[]{"WSO2", 60.5f, 6}); Thread.sleep(500); Assert.assertEquals("Total event count", 4, count); Assert.assertTrue(eventArrived); executionPlanRuntime.shutdown(); }
Source:
private ArtifactoryXrayResponse parseXrayScanResponse(HttpResponse response) throws IOException { if (response.getStatusLine().getStatusCode() != HttpStatus.SC_OK) { throw new IOException("Artifactory response: " + response.getStatusLine().getReasonPhrase()); } ObjectMapper mapper = new ObjectMapper(); String content = IOUtils.toString(response.getEntity().getContent(), "UTF-8"); JsonNode result; try { result = mapper.readTree(content); if (result == null) { throw new NullArgumentException("received empty content from Artifactory"); } } catch (Exception ex) { throw new XrayErrorException(String.format("Failed processing scan response: %s\n%s", ex.toString(), content)); } if (result.get("errors") != null) { String resultStr = result.get("errors").toString(); for (JsonNode error : result.get("errors")) { if (error.get("status").toString().equals(XRAY_FATAL_FAIL_STATUS)) { throw new RuntimeException("Artifactory response: " + resultStr); } } throw new XrayErrorException("Artifactory response: " + resultStr); } mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); return mapper.treeToValue(result, ArtifactoryXrayResponse.class); }

Target:
private ArtifactoryXrayResponse parseXrayScanResponse(HttpResponse response) throws IOException { if (response.getStatusLine().getStatusCode() != HttpStatus.SC_OK) { throw new IOException("Artifactory response: " + response.getStatusLine().getReasonPhrase()); } ObjectMapper mapper = new ObjectMapper(); String content = IOUtils.toString(response.getEntity().getContent(), "UTF-8"); JsonNode result; try { result = mapper.readTree(content); if (result == null) { throw new NullArgumentException("Received empty content from Artifactory"); } } catch (Exception ex) { throw new XrayErrorException(String.format("Failed processing scan response: %s\n%s", ex.toString(), content)); } if (result.get("errors") != null) { String resultStr = result.get("errors").toString(); for (JsonNode error : result.get("errors")) { if (error.get("status").toString().equals(XRAY_FATAL_FAIL_STATUS)) { throw new RuntimeException("Artifactory response: " + resultStr); } } throw new XrayErrorException("Artifactory response: " + resultStr); } mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); return mapper.treeToValue(result, ArtifactoryXrayResponse.class); }
Source:
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { HttpServletRequest req = (HttpServletRequest) request; HttpServletResponse resp = (HttpServletResponse) response; String encoding = Optional.fromNullable(request.getCharacterEncoding()).or(defaultEncoding); String serviceRequestId = UUID.randomUUID().toString(); MDC.put(HEADER_SERVICE_REQUEST, serviceRequestId); resp.addHeader(HEADER_SERVICE_REQUEST, URLEncoder.encode(serviceRequestId, encoding)); String clientRequestId = req.getHeader(HEADER_CLIENT_REQUEST); if (clientRequestId != null && clientIdPattern.matcher(clientRequestId).matches()) { MDC.put(HEADER_CLIENT_REQUEST, clientRequestId); resp.addHeader(HEADER_CLIENT_REQUEST, URLEncoder.encode(clientRequestId, encoding)); } try { chain.doFilter(request, response); } finally { MDC.remove(HEADER_SERVICE_REQUEST); MDC.remove(HEADER_CLIENT_REQUEST); } }

Target:
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { HttpServletRequest req = (HttpServletRequest) request; HttpServletResponse resp = (HttpServletResponse) response; String encoding = Optional.fromNullable(request.getCharacterEncoding()).or(defaultEncoding); String serviceRequestId = String.valueOf(ThreadLocalRandom.current().nextLong()); MDC.put(RequestId.SERVICE_REQUEST_ID, serviceRequestId); resp.addHeader(HEADER_SERVICE_REQUEST, URLEncoder.encode(serviceRequestId, encoding)); String clientRequestId = req.getHeader(HEADER_CLIENT_REQUEST); if (clientRequestId != null && clientIdPattern.matcher(clientRequestId).matches()) { MDC.put(RequestId.CLIENT_REQUEST_ID, clientRequestId); resp.addHeader(HEADER_CLIENT_REQUEST, URLEncoder.encode(clientRequestId, encoding)); } try { chain.doFilter(request, response); } finally { MDC.remove(RequestId.SERVICE_REQUEST_ID); MDC.remove(RequestId.CLIENT_REQUEST_ID); } }
Source:
public static <T extends Activity> ActivityController<T> of(T activity, Intent intent) { if (intent != null) { Parcel obtain = Parcel.obtain(); obtain.writeParcelable(intent, 0); obtain.setDataPosition(0); intent = obtain.readParcelable(Intent.class.getClassLoader()); obtain.recycle(); } return new ActivityController<>(activity, intent) .attach( null); }

Target:
public static <T extends Activity> ActivityController<T> of(T activity, Intent intent) { return new ActivityController<>(activity, intent) .attach( null); }
Source:
private boolean repositoryAlreadyExistsForUrl(File repositoryPath, URIish gitUrl) { if (repositoryPath.exists()) { try { FileRepository existingRepository = new FileRepository( repositoryPath); String remoteUrl = existingRepository.getConfig().getString( ConfigConstants.CONFIG_REMOTE_SECTION, Constants.DEFAULT_REMOTE_NAME, ConfigConstants.CONFIG_KEY_URL); existingRepository.close(); URIish existingUrl = new URIish(remoteUrl); if (existingUrl.equals(gitUrl)) { return true; } } catch (IOException e) { return false; } catch (URISyntaxException e) { return false; } } return false; }

Target:
private static boolean repositoryAlreadyExistsForUrl(File repositoryPath, URIish gitUrl) { if (repositoryPath.exists()) { try { FileRepository existingRepository = new FileRepository( repositoryPath); boolean exists = containsRemoteForUrl( existingRepository.getConfig(), gitUrl); existingRepository.close(); return exists; } catch (IOException e) { return false; } catch (URISyntaxException e) { return false; } } return false; }
Source:
public StatusPrinter(StatementClient client, PrintStream out) { this.client = client; this.out = out; this.console = new ConsolePrinter(out); this.debug = client.isDebug(); this.mappingPreviousStageStatuses = new HashMap<>(); }

Target:
public StatusPrinter(StatementClient client, PrintStream out) { this.client = client; this.out = out; this.console = new ConsolePrinter(out); this.debug = client.isDebug(); }
Source:
@Override public void close() { EndpointGroup endpointGroup = EndpointGroupRegistry.get("elasticsearch"); if (endpointGroup != null) { endpointGroup.close(); EndpointGroupRegistry.unregister("elasticsearch"); } factory.close(); }

Target:
@Override public void close() { EndpointGroup endpointGroup = EndpointGroupRegistry.get("elasticsearch"); if (endpointGroup != null) { endpointGroup.close(); EndpointGroupRegistry.unregister("elasticsearch"); } }
Source:
private static void readBlocks(NBTTagCompound nbt, ICubicWorldServer world, Cube cube) { boolean isEmpty = !nbt.hasKey("Blocks"); if (!isEmpty) { ExtendedBlockStorage ebs = new ExtendedBlockStorage(Coords.cubeToMinBlock(cube.getY()), !cube.getCubicWorld().getProvider().getHasNoSky()); byte[] abyte = nbt.getByteArray("Blocks"); NibbleArray data = new NibbleArray(nbt.getByteArray("Data")); NibbleArray add = nbt.hasKey("Add", 7) ? new NibbleArray(nbt.getByteArray("Add")) : null; ebs.getData().setDataFromNBT(abyte, data, add); ebs.setBlocklightArray(new NibbleArray(nbt.getByteArray("BlockLight"))); if (!world.getProvider().getHasNoSky()) { ebs.setSkylightArray(new NibbleArray(nbt.getByteArray("SkyLight"))); } ebs.removeInvalidBlocks(); cube.setStorage(ebs); } }

Target:
private static void readBlocks(NBTTagCompound nbt, ICubicWorldServer world, Cube cube) { boolean isEmpty = !nbt.hasKey("Blocks"); if (!isEmpty) { ExtendedBlockStorage ebs = new ExtendedBlockStorage(Coords.cubeToMinBlock(cube.getY()), !cube.getWorld().getProvider().getHasNoSky()); byte[] abyte = nbt.getByteArray("Blocks"); NibbleArray data = new NibbleArray(nbt.getByteArray("Data")); NibbleArray add = nbt.hasKey("Add", 7) ? new NibbleArray(nbt.getByteArray("Add")) : null; ebs.getData().setDataFromNBT(abyte, data, add); ebs.setBlocklightArray(new NibbleArray(nbt.getByteArray("BlockLight"))); if (!world.getProvider().getHasNoSky()) { ebs.setSkylightArray(new NibbleArray(nbt.getByteArray("SkyLight"))); } ebs.removeInvalidBlocks(); cube.setStorage(ebs); } }
Source:
public void should_call_single_listener_on_verify() throws NoSuchMethodException { RememberingListener listener = new RememberingListener(); MockitoFramework mockitoFramework = Mockito.framework(); mockitoFramework.addListener(listener); Method invocationWanted = Foo.class.getDeclaredMethod("doSomething", String.class); Foo foo = mock(Foo.class); VerificationMode never = never(); verify(foo, never).doSomething(""); assertThat(listener).is(notifiedFor(foo, never, invocationWanted)); }

Target:
public void should_call_single_listener_on_verify() { Foo foo = mock(Foo.class); VerificationMode never = never(); verify(foo, never).doSomething(""); assertThat(listener).is(notifiedFor(foo, never, invocationWanted)); }
Source:
private boolean isHostHealthy(CassandraClientPoolingContainer container) { try { container.runWithPooledResource(CassandraUtils.getDescribeRing(config)); container.runWithPooledResource(CassandraUtils.getValidatePartitioner(config)); return true; } catch (Exception e) { log.warn("We tried to blacklist back into the pool, but got an exception" + " that caused us to distrust this host further. Exception message was: : {}", SafeArg.of("host", CassandraLogHelper.host(container.getHost())), SafeArg.of("exceptionClass", e.getClass().getCanonicalName()), UnsafeArg.of("exceptionMessage", e.getMessage())); return false; } }

Target:
private boolean isHostHealthy(CassandraClientPoolingContainer container) { try { container.runWithPooledResource(CassandraUtils.getDescribeRing(config)); container.runWithPooledResource(CassandraUtils.getValidatePartitioner(config)); return true; } catch (Exception e) { log.warn("We tried to add blacklisted host '{}' back into the pool, but got an exception" + " that caused us to distrust this host further. Exception message was: : {}", SafeArg.of("host", CassandraLogHelper.host(container.getHost())), SafeArg.of("exceptionClass", e.getClass().getCanonicalName()), UnsafeArg.of("exceptionMessage", e.getMessage())); return false; } }
Source:
private void throwUnknownLanguageVersionException(String minOrMax, String unknownVersion) { throw new IllegalArgumentException("Unknown " + minOrMax + " Language Version '" + unknownVersion + "' for Language '" + language.getTerseName() + "' for Rule " + name + "; supported Language Versions are: " + language.getVersions().stream().map(LanguageVersion::getTerseName).collect(Collectors.joining(", "))); }

Target:
private void throwUnknownLanguageVersionException(String minOrMax, String unknownVersion) { throw new IllegalArgumentException("Unknown " + minOrMax + " language version '" + unknownVersion + "' for language '" + language.getTerseName() + "' for rule " + name + "; supported language versions are: " + language.getVersions().stream().map(LanguageVersion::getVersion).collect(Collectors.joining(", "))); }
Source:
private Object readResolve() throws IOException { if (this.agentUser == null && this.slavesUser != null) { this.agentUser = this.slavesUser; } else if (this.agentUser == null) { this.agentUser = "nobody"; } if (this.frameworkId == null) { this.frameworkId = UUID.randomUUID().toString(); } if (this.mesosAgentSpecTemplates == null && this.slaveInfos != null) { this.mesosAgentSpecTemplates = this.slaveInfos; } else if (this.mesosAgentSpecTemplates == null) { this.mesosAgentSpecTemplates = new ArrayList<>(); } if (selfIsMesosTask()) { String mesosSandbox = System.getenv("MESOS_SANDBOX"); this.sslCert = Optional.ofNullable(loadDcosCert(mesosSandbox)); this.dcosAuthorization = Optional.ofNullable(loadDcosAuthorization()); } else { this.sslCert = Optional.empty(); this.dcosAuthorization = Optional.empty(); } try { MesosApi.getInstance(this); logger.info( "Initialized Mesos API object for framework after deserialization.", this.frameworkId); } catch (InterruptedException | ExecutionException e) { logger.error("Failed initialize Mesos API object for framework {}", this.frameworkId, e); throw new RuntimeException("Failed to initialize Mesos API object after deserialization.", e); } return this; }

Target:
private Object readResolve() throws IOException { if (this.agentUser == null && this.slavesUser != null) { this.agentUser = this.slavesUser; } else if (this.agentUser == null) { this.agentUser = "nobody"; } if (this.frameworkId == null) { this.frameworkId = UUID.randomUUID().toString(); } if (this.mesosAgentSpecTemplates == null && this.slaveInfos != null) { this.mesosAgentSpecTemplates = this.slaveInfos; } else if (this.mesosAgentSpecTemplates == null) { this.mesosAgentSpecTemplates = new ArrayList<>(); } if (selfIsMesosTask()) { String mesosSandbox = System.getenv("MESOS_SANDBOX"); this.sslCert = Optional.ofNullable(loadDcosCert(mesosSandbox)); this.dcosAuthorization = Optional.ofNullable(loadDcosAuthorization()); } else { this.sslCert = Optional.empty(); this.dcosAuthorization = Optional.empty(); } return this; }
Source:
public void setUp(){ Dataset ds = new Dataset(); String f = Dataset.ACETYLATION; File localFile = getLocalFileName(f); try { if (!localFile.exists()) { ds.downloadFile(new URL(f), localFile); } } catch (IOException e) { e.printStackTrace(); } }

Target:
public void setUp() throws IOException{ Dataset ds = new Dataset(); String f = Dataset.ACETYLATION; File localFile = getLocalFileName(f); if (!localFile.exists()) { ds.downloadFile(new URL(f), localFile); } }
Source:
protected BeanMapper(Class<T> type, PojoProperties<T> properties, String prefix) { this.type = type; this.beanInfo = properties; this.prefix = prefix.toLowerCase(); }

Target:
private BeanMapper(Class<T> type, PojoProperties<T> properties, String prefix) { super(type, properties, prefix); strictColumnTypeMapping = false; }
Source:
public void highlightIssue(LiveIssue issue) { RangeMarker issueRange = issue.getRange(); if (issueRange == null) { return; } List<HighlightInfo> highlights = issue.flows().stream().findFirst() .map(f -> f.locations().stream() .filter(Objects::nonNull) .map(l -> createHighlight(l.location(), l.message())) .collect(Collectors.toList()) ).orElse(new ArrayList<>()); highlights.add(createHighlight(issueRange, issue.getMessage())); updateHighlights(highlights, issueRange.getDocument()); }

Target:
public void highlightIssue(LiveIssue issue) { List<HighlightInfo> highlights = issue.context() .map(context -> createHighlights(context.hasFlows() ? context.flows().get(0).locations() : context.secondaryLocations())) .orElse(new ArrayList<>()); RangeMarker issueRange = issue.getRange(); if (issueRange != null) { highlights.add(createHighlight(issueRange, issue.getMessage())); } updateHighlights(highlights, FileDocumentManager.getInstance().getDocument(issue.psiFile().getVirtualFile())); }
Source:
public static ForceAlignment getForceAlignment(int ordinal) { for (ForceAlignment he : values()) { if (he.ordinal() == ordinal) { return he; } } return null; }

Target:
public static ForceAlignment getForceAlignment(int ordinal) { for (ForceAlignment fe : values()) { if (fe.ordinal() == ordinal) { return fe; } } return null; }
Source:
private void addCertificate(){ fileChooser.setAcceptAllFileFilterUsed(false); fileChooser.addChoosableFileFilter(certFilter); fileChooser.setFileFilter(certFilter); int retVal = fileChooser.showOpenDialog(this); if (retVal == JFileChooser.APPROVE_OPTION) { File file = fileChooser.getSelectedFile(); try { fileField.setText(file.getAbsolutePath()); String certAlias = (String) JOptionPane.showInputDialog(null, Res.getString("dialog.provide.alias")); if (certAlias == null) { throw new IllegalArgumentException(); } certControll.addCertificateToKeystore(file, certAlias); } catch (KeyStoreException | CertificateException | NoSuchAlgorithmException | IOException ex) { Log.error("Cannot upload certificate file", ex); } catch (IllegalArgumentException ex) { Log.warning("Certificate alias cannot be null"); } } }

Target:
private void addCertificate() { fileChooser.setAcceptAllFileFilterUsed(false); fileChooser.addChoosableFileFilter(certFilter); fileChooser.setFileFilter(certFilter); int retVal = fileChooser.showOpenDialog(this); if (retVal == JFileChooser.APPROVE_OPTION) { File file = fileChooser.getSelectedFile(); try { certControll.addCertificateToKeystore(file); } catch (KeyStoreException | CertificateException | NoSuchAlgorithmException | IOException ex) { Log.error("Cannot upload certificate file", ex); } catch (IllegalArgumentException ex) { Log.warning("Certificate or it's alias cannot be null", ex); } catch (HeadlessException | InvalidNameException ex) { Log.error("Error at setting certificate alias", ex); } } }
Source:
public ExtractionType getExtractionType() { return ExtractionType.MANY_TO_ONE; }

Target:
public ExtractionType getExtractionType() { return injective ? ExtractionType.ONE_TO_ONE : ExtractionType.MANY_TO_ONE; }
Source:
protected boolean hasMoreItems() { return currentNextPage != null && ((currentNextPage.getUrl() != null && !currentNextPage.getUrl().isEmpty()) || (currentNextPage.getIds() != null && !currentNextPage.getIds().isEmpty())); }

Target:
protected boolean hasMoreItems() { return Page.isValid(currentNextPage); }
Source:
private Collection<LockComponent> getGlobalLocks(Configuration conf) { String lockNames = conf.get(ConfVars.HIVE_QUERY_EXCLUSIVE_LOCK.varname); if (StringUtils.isEmpty(lockNames)) { return Collections.emptyList(); } List<LockComponent> globalLocks = new ArrayList<LockComponent>(); for (String lockName : lockNames.split(",")) { lockName = lockName.trim(); if (StringUtils.isEmpty(lockName)) { continue; } LockComponentBuilder compBuilder = new LockComponentBuilder(); compBuilder.setExclusive(); compBuilder.setOperationType(DataOperationType.UPDATE); compBuilder.setDbName("__GLOBAL_LOCKS"); compBuilder.setTableName(lockName); globalLocks.add(compBuilder.build()); LOG.debug("Adding global lock: " + lockName); } return globalLocks; }

Target:
private Collection<LockComponent> getGlobalLocks(Configuration conf) { String lockNames = conf.get(Constants.HIVE_QUERY_EXCLUSIVE_LOCK); if (StringUtils.isEmpty(lockNames)) { return Collections.emptyList(); } List<LockComponent> globalLocks = new ArrayList<LockComponent>(); for (String lockName : lockNames.split(",")) { lockName = lockName.trim(); if (StringUtils.isEmpty(lockName)) { continue; } LockComponentBuilder compBuilder = new LockComponentBuilder(); compBuilder.setExclusive(); compBuilder.setOperationType(DataOperationType.UPDATE); compBuilder.setDbName("__GLOBAL_LOCKS"); compBuilder.setTableName(lockName); globalLocks.add(compBuilder.build()); LOG.debug("Adding global lock: " + lockName); } return globalLocks; }
Source:
public void setBarState(int state) { if (state != mState && mVisible && (state == StatusBarState.SHADE_LOCKED || (state == StatusBarState.SHADE && isGoingToNotificationShade()))) { clearNotificationEffects(); } if (state == StatusBarState.KEYGUARD) { removeRemoteInputEntriesKeptUntilCollapsed(); } mState = state; mGroupManager.setStatusBarState(state); mFalsingManager.setStatusBarState(state); mStatusBarWindowManager.setStatusBarState(state); updateDozing(); }

Target:
public void setBarState(int state) { if (state != mState && mVisible && (state == StatusBarState.SHADE_LOCKED || (state == StatusBarState.SHADE && isGoingToNotificationShade()))) { clearNotificationEffects(); } if (state == StatusBarState.KEYGUARD) { removeRemoteInputEntriesKeptUntilCollapsed(); maybeEscalateHeadsUp(); } mState = state; mGroupManager.setStatusBarState(state); mFalsingManager.setStatusBarState(state); mStatusBarWindowManager.setStatusBarState(state); updateDozing(); }
Source:
X509Certificate getCertificate(String certSerialId) throws CertificateException; X509Certificate getCertificate(); boolean verifyCertificate(X509Certificate certificate); byte[] signDataStream(InputStream stream) throws CertificateException; byte[] signData(byte[] data) throws CertificateException; boolean verifySignature(InputStream stream, byte[] signature, X509Certificate cert) throws CertificateException; boolean verifySignature(byte[] data, byte[] signature, X509Certificate cert) throws CertificateException; CertificateSignRequest.Builder getCSRBuilder() throws CertificateException; X509Certificate queryCertificate(String query); void storeCertificate(String pemEncodedCert, boolean force, boolean caCert) throws CertificateException; void storeTrustChain(CertStore certStore) throws CertificateException; void storeTrustChain(List<X509Certificate> certificates) throws CertificateException; InitResponse init() throws CertificateException; enum InitResponse { SUCCESS, FAILURE, GETCERT, RECOVER }

Target:
X509Certificate getCertificate(String certSerialId) throws CertificateException; X509Certificate getCertificate(); boolean verifyCertificate(X509Certificate certificate); byte[] signDataStream(InputStream stream) throws CertificateException; byte[] signData(byte[] data) throws CertificateException; boolean verifySignature(InputStream stream, byte[] signature, X509Certificate cert) throws CertificateException; boolean verifySignature(byte[] data, byte[] signature, X509Certificate cert) throws CertificateException; CertificateSignRequest.Builder getCSRBuilder() throws CertificateException; X509Certificate queryCertificate(String query); void storeCertificate(String pemEncodedCert, boolean force) throws CertificateException; void storeCertificate(String pemEncodedCert, boolean force, boolean caCert) throws CertificateException; void storeTrustChain(CertStore certStore) throws CertificateException; void storeTrustChain(List<X509Certificate> certificates) throws CertificateException; InitResponse init() throws CertificateException; enum InitResponse { SUCCESS, FAILURE, GETCERT, RECOVER }
Source:
public static TripPlanListFragment newInstance(String city, String group, String season) { TripPlanListFragment tripPlanListFragment = new TripPlanListFragment(); Bundle args = new Bundle(); args.putString("city", city); args.putString("group", group); args.putString("season", season); tripPlanListFragment.setArguments(args); TripPlanListFragment.city = city; TripPlanListFragment.group = group; TripPlanListFragment.season = season; return tripPlanListFragment; }

Target:
public static TripPlanListFragment newInstance(String city, String group, String season) { TripPlanListFragment tripPlanListFragment = new TripPlanListFragment(); Bundle args = new Bundle(); args.putString("city", city); args.putString("group", group); args.putString("season", season); tripPlanListFragment.setArguments(args); return tripPlanListFragment; }
Source:
private void avroAssertColumnTypes(QueryResult queryResult) { Connection connection = defaultQueryExecutor().getConnection(); if (usingPrestoJdbcDriver(connection)) { assertThat(queryResult).hasColumns( BIGINT, DOUBLE, BIGINT ); } else if (usingTeradataJdbcDriver(connection)) { assertThat(queryResult).hasColumns( BIGINT, DOUBLE, BIGINT ); } else { throw new IllegalStateException(); } }

Target:
private void avroAssertColumnTypes(QueryResult queryResult) { Connection connection = defaultQueryExecutor().getConnection(); if (usingPrestoJdbcDriver(connection) || usingTeradataJdbcDriver(connection)) { assertThat(queryResult).hasColumns( BIGINT, DOUBLE, BIGINT ); } else { throw new IllegalStateException(); } }
Source:
public List<String> getSuggestedNames(String queryString, int maxResults) throws GeoEntryQueryException { LOGGER.debug("getSuggestedNames is not implemented for GeoNamesQueryLuceneDirectoryIndex"); return Collections.emptyList(); }

Target:
public List<String> getSuggestedNames(String queryString, int maxResults) throws GeoEntryQueryException { LOGGER.debug("Suggestion query not implemented."); return Collections.emptyList(); }