auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private static void setTheEnvironmentVariablesAddthePlatformTxt(IContributedEnvironment contribEnv, ICConfigurationDescription confDesc, IPath platformFile) throws IOException { DataInputStream dataInputStream = new DataInputStream(new FileInputStream(platformFile.toOSString())); BufferedReader br = new BufferedReader(new InputStreamReader(dataInputStream)); String strLine; IEnvironmentVariable var = null; while ((strLine = br.readLine()) != null) { String RealData[] = strLine.split("#"); if (RealData.length > 0) { String Var[] = RealData[0].split("=", 2); if (Var.length == 2) { String Value = MakeEnvironmentString(Var[1].replace("\"{build.path}/syscalls_sam3.c.o\"", "\"{build.path}/arduino/syscalls_sam3.c.o\"")); Value = MakeEnvironmentString(Var[1].replace("\"{build.path}/syscalls_mtk.c.o\"", "\"{build.path}/arduino/syscalls_mtk.c.o\"")); var = new EnvironmentVariable(MakeKeyString(Var[0]), Value); contribEnv.addVariable(var, confDesc); } } } dataInputStream.close(); }

Target:
private static void setTheEnvironmentVariablesAddthePlatformTxt(IContributedEnvironment contribEnv, ICConfigurationDescription confDesc, IPath platformFile) throws IOException { DataInputStream dataInputStream = new DataInputStream(new FileInputStream(platformFile.toOSString())); BufferedReader br = new BufferedReader(new InputStreamReader(dataInputStream)); String strLine; IEnvironmentVariable var = null; while ((strLine = br.readLine()) != null) { String RealData[] = strLine.split("#"); if (RealData.length > 0) { String Var[] = RealData[0].split("=", 2); if (Var.length == 2) { String value = Var[1]; if (value.contains(BUILD_PATH_SYSCALLS_SAM3)) { value = MakeEnvironmentString(value.replace(BUILD_PATH_SYSCALLS_SAM3, BUILD_PATH_ARDUINO_SYSCALLS_SAM3)); } else if (value.contains(BUILD_PATH_SYSCALLS_MTK)) { value = MakeEnvironmentString(value.replace(BUILD_PATH_SYSCALLS_MTK, BUILD_PATH_ARDUINO_SYSCALLS_MTK)); } var = new EnvironmentVariable(MakeKeyString(Var[0]), value); contribEnv.addVariable(var, confDesc); } } } dataInputStream.close(); }
Source:
public void testBlockFlooder() throws Exception { final EventType eventType = NakadiTestUtils.createEventType(); blacklist(eventType.getName(), BlacklistService.Type.CONSUMER_ET); try { Assert.assertNotNull(CURATOR.checkExists() .forPath("/nakadi/blacklist/consumers/event_types/" + eventType.getName())); } finally { whitelist(eventType.getName(), BlacklistService.Type.CONSUMER_ET); } }

Target:
public void testBlockFlooder() throws Exception { final EventType eventType = NakadiTestUtils.createEventType(); blacklist(eventType.getName(), BlacklistService.Type.CONSUMER_ET); Assert.assertNotNull(CURATOR.checkExists() .forPath("/nakadi/blacklist/consumers/event_types/" + eventType.getName())); }
Source:
public void testValidateStatusUpForActivation() { validator = setValidatorForActivation(VDSStatus.Up); ValidationResult result = validator.validateStatusForActivation(); assertEquals(result.getMessage(), VdcBllMessages.VDS_ALREADY_UP); }

Target:
public void testValidateStatusUpForActivation() { validator = mockHostForActivation(VDSStatus.Up); assertThat(validator.validateStatusForActivation(), failsWith( VdcBllMessages.VDS_ALREADY_UP)); }
Source:
private void physicalClose() throws Exception { if (logger.isDebugEnabled()) { logger.debug("Closing cached Channel: " + this.target); } if (this.target == null) { return; } try { this.target.close(); } catch (AlreadyClosedException e) { if (logger.isTraceEnabled()) { logger.trace(this.target + " is already closed"); } } }

Target:
private void physicalClose() throws Exception { if (logger.isDebugEnabled()) { logger.debug("Closing cached Channel: " + this.target); } if (this.target == null) { return; } try { this.target.close(); } catch (AlreadyClosedException e) { if (logger.isTraceEnabled()) { logger.trace(this.target + " is already closed"); } } finally { this.target = null; } }
Source:
private void loadOutputChannel(ChannelTypeUID channelTypeUID, String acceptedItemType) { if (channelTypeUID != null && acceptedItemType != null) { currentChannel = channelTypeUID.getId(); List<Channel> channelList = new LinkedList<Channel>(this.getThing().getChannels()); boolean channelIsAlreadyLoaded = false; boolean channelListChanged = false; if (!channelList.isEmpty()) { Iterator<Channel> channelInter = channelList.iterator(); while (channelInter.hasNext()) { Channel eshChannel = channelInter.next(); if (DsChannelTypeProvider.isOutputChannel(eshChannel.getUID().getId())) { if (!eshChannel.getUID().getId().equals(currentChannel) && !(device.isShade() && eshChannel.getUID().getId().equals(DsChannelTypeProvider.SHADE))) { channelInter.remove(); channelListChanged = true; } else { if (!eshChannel.getUID().getId().equals(DsChannelTypeProvider.SHADE)) { channelIsAlreadyLoaded = true; } } } } } if (!channelIsAlreadyLoaded && currentChannel != null) { Channel channel = ChannelBuilder .create(new ChannelUID(this.getThing().getUID(), channelTypeUID.getId()), acceptedItemType) .withType(channelTypeUID).build(); channelList.add(channel); channelListChanged = true; } if (channelListChanged) { ThingBuilder thingBuilder = editThing(); thingBuilder.withChannels(channelList); updateThing(thingBuilder.build()); logger.debug("load channel: with item: {}", channelTypeUID.getAsString(), acceptedItemType); } } }

Target:
private void loadOutputChannel(ChannelTypeUID channelTypeUID, String acceptedItemType) { if (channelTypeUID == null || acceptedItemType == null) { return; } currentChannel = channelTypeUID.getId(); List<Channel> channelList = new LinkedList<Channel>(this.getThing().getChannels()); boolean channelIsAlreadyLoaded = false; boolean channelListChanged = false; if (!channelList.isEmpty()) { Iterator<Channel> channelInter = channelList.iterator(); while (channelInter.hasNext()) { Channel eshChannel = channelInter.next(); if (DsChannelTypeProvider.isOutputChannel(eshChannel.getUID().getId())) { if (!eshChannel.getUID().getId().equals(currentChannel) && !(device.isShade() && eshChannel.getUID().getId().equals(DsChannelTypeProvider.SHADE))) { channelInter.remove(); channelListChanged = true; } else { if (!eshChannel.getUID().getId().equals(DsChannelTypeProvider.SHADE)) { channelIsAlreadyLoaded = true; } } } } } if (!channelIsAlreadyLoaded && currentChannel != null) { Channel channel = ChannelBuilder .create(new ChannelUID(this.getThing().getUID(), channelTypeUID.getId()), acceptedItemType) .withType(channelTypeUID).build(); channelList.add(channel); channelListChanged = true; } if (channelListChanged) { ThingBuilder thingBuilder = editThing(); thingBuilder.withChannels(channelList); updateThing(thingBuilder.build()); logger.debug("load channel: with item: {}", channelTypeUID.getAsString(), acceptedItemType); } }
Source:
public void shouldDeleteNetworkToPublicRouterNoDeleted() throws OpenStackException, InfrastructureException { String response = "{\"ports\": [ {\"status\": \"ACTIVE\",\"name\": \"\", \"admin_state_up\": true, " + "\"network_id\": \"ID\", \"tenant_id\": \"08bed031f6c54c9d9b35b42aa06b51c0\"," + "\"device_owner\": \"compute:None\", \"binding:capabilities\": {\"port_filter\": true}, " + "\"fixed_ips\": [ {\"subnet_id\": \"ID\", \"ip_address\": \"172.31.0.3\"}]," + "\"id\": \"07fd27d2-9ce1-48f3-be83-c7d2b7041a1a\", \"security_groups\": [], \"device_id\":" + " \"dhcpfa3e6aae-2140-5176-877a-2f67684a3165-6a609412-3f04-485c-b269-b1a9b9ecb6bf\"" + "}]}"; when(openStackUtil.listPorts(any(PaasManagerUser.class), anyString())).thenReturn(response); NetworkInstance net = new NetworkInstance("router", "vdc", "region"); SubNetworkInstance subNet = new SubNetworkInstance("dd", "vdc", "region", "ID"); subNet.setIdSubNet("ID"); net.addSubNet(subNet); when(openStackUtil.deleteInterfaceToPublicRouter(any(PaasManagerUser.class), any(NetworkInstance.class), anyString())).thenReturn(response); openStackNetworkImpl.deleteNetworkToPublicRouter(claudiaData, net, REGION); }

Target:
public void shouldDeleteNetworkToPublicRouterNoDeleted() throws OpenStackException, InfrastructureException { String response = "{\"ports\": [ {\"status\": \"ACTIVE\",\"name\": \"\", \"admin_state_up\": true, " + "\"network_id\": \"ID\", \"tenant_id\": \"08bed031f6c54c9d9b35b42aa06b51c0\"," + "\"device_owner\": \"compute:None\", \"binding:capabilities\": {\"port_filter\": true}, " + "\"fixed_ips\": [ {\"subnet_id\": \"ID\", \"ip_address\": \"172.31.0.3\"}]," + "\"id\": \"07fd27d2-9ce1-48f3-be83-c7d2b7041a1a\", \"security_groups\": [], \"device_id\":" + " \"dhcpfa3e6aae-2140-5176-877a-2f67684a3165-6a609412-3f04-485c-b269-b1a9b9ecb6bf\"" + "}]}"; when(openStackUtil.listPorts(any(PaasManagerUser.class), anyString())).thenReturn(response); NetworkInstance net = new NetworkInstance("router", "vdc", "region"); SubNetworkInstance subNet = new SubNetworkInstance("dd", "vdc", "region", "ID"); subNet.setIdSubNet("ID"); net.addSubNet(subNet); when(openStackUtil.deleteInterfaceToPublicRouter(any(PaasManagerUser.class), any(NetworkInstance.class), anyString())).thenReturn(response); openStackNetworkImpl.deleteNetworkToPublicRouter(claudiaData, net, REGION); verify(openStackUtil, never()).deleteInterfaceToPublicRouter(any(PaasManagerUser.class), any(NetworkInstance.class), anyString()); }
Source:
public void testJvmPauseMonitorExceedInfoThreshold() throws InterruptedException { final Long sleepTime = 100L; final Long infoTH = -1L; ServerConfig serverConfig = new ServerConfig(); QuorumPeerConfig quorumPeerConfig = new QuorumPeerConfig(); Properties zkProp = new Properties(); zkProp.setProperty("dataDir", new File("myDataDir").getAbsolutePath()); zkProp.setProperty("jvm.pause.monitor", "true"); zkProp.setProperty("jvm.pause.sleep.time.ms", sleepTime.toString()); zkProp.setProperty("jvm.pause.info-threshold.ms", infoTH.toString()); try { quorumPeerConfig.parseProperties(zkProp); } catch (IOException | QuorumPeerConfig.ConfigException e) { Assert.fail("Exception while reading config for JvmPauseMonitor"); } serverConfig.readFrom(quorumPeerConfig); JvmPauseMonitor pauseMonitor = new JvmPauseMonitor(serverConfig); pauseMonitor.serviceStart(); Assert.assertEquals(sleepTime, Long.valueOf(pauseMonitor.sleepTimeMs)); Assert.assertEquals(infoTH, Long.valueOf(pauseMonitor.infoThresholdMs)); Thread.sleep(1000); Assert.assertNotEquals(0L, pauseMonitor.getNumGcInfoThresholdExceeded()); Assert.assertEquals(0L, pauseMonitor.getNumGcWarnThresholdExceeded()); }

Target:
public void testJvmPauseMonitorExceedInfoThreshold() throws InterruptedException { QuorumPeerConfig qpConfig = mock(QuorumPeerConfig.class); when(qpConfig.getJvmPauseSleepTimeMs()).thenReturn(sleepTime); when(qpConfig.getJvmPauseInfoThresholdMs()).thenReturn(infoTH); pauseMonitor = new JvmPauseMonitor(qpConfig); pauseMonitor.serviceStart(); Assert.assertEquals(sleepTime, Long.valueOf(pauseMonitor.sleepTimeMs)); Assert.assertEquals(infoTH, Long.valueOf(pauseMonitor.infoThresholdMs)); while(pauseMonitor.getNumGcInfoThresholdExceeded() == 0) { Thread.sleep(200); } }
Source:
public static long fromIEEE754Binary32(@SqlType(StandardTypes.VARBINARY) Slice slice) { ByteBuffer buffer = ByteBuffer.wrap(slice.getBytes()); return (long) buffer.getInt(); }

Target:
public static long fromIEEE754Binary32(@SqlType(StandardTypes.VARBINARY) Slice slice) { checkCondition(slice.length() == Integer.BYTES, INVALID_FUNCTION_ARGUMENT, "Input floating-point value must be exactly 4 bytes long"); return Integer.reverseBytes(slice.getInt(0)); }
Source:
private void waitUntilProcessEnds(Long timeoutInSeconds) { boolean finished; try { boolean processWroteDuringWait; do { long beforeWaiting = System.currentTimeMillis(); finished = process.waitFor(timeoutInSeconds, TimeUnit.SECONDS); processWroteDuringWait = beforeWaiting < outputIdleSince.get(); if (processWroteDuringWait && !finished) { logger.debug("Extending the timeout, as the process wrote more lines (it's still active)"); } } while (processWroteDuringWait && !finished); } catch (InterruptedException e) { throw new ItemStreamException(e); } if (!finished) { String timeoutReachedMessage = "VEP has been idle for more than the timeout (" + timeoutInSeconds + " seconds). Killed the process."; logger.error(timeoutReachedMessage); process.destroy(); throw new ItemStreamException(timeoutReachedMessage); } }

Target:
private void waitUntilProcessEnds(Long timeoutInSeconds) { boolean finished; try { boolean processWroteDuringWait; do { long beforeWaiting = System.currentTimeMillis(); finished = process.waitFor(timeoutInSeconds, TimeUnit.SECONDS); processWroteDuringWait = beforeWaiting < outputIdleSince.get(); if (processWroteDuringWait && !finished) { logger.debug("Extending the timeout, as the process wrote more lines (it's still active)"); } } while (processWroteDuringWait && !finished); } catch (InterruptedException e) { throw new ItemStreamException(e); } if (!finished) { process.destroy(); String timeoutReachedMessage = "VEP has been idle for more than the timeout (" + timeoutInSeconds + " seconds). The process has been killed."; logger.error(timeoutReachedMessage); throw new ItemStreamException(timeoutReachedMessage); } }
Source:
public Response createPolicy(@Context UriInfo info, @PathParam("tenant") String tenant, @PathParam("subject") String subject, String policy) { String id; try { LOGGER.debug("Creating policy for tenant [" + tenant + "] and subject [" + subject + "]"); id = factory.create(Xml.toXml(policy)).getId().toString(); } catch (Exception e) { LOGGER.error("Cannot parse policy: " + e.getMessage()); return Response.status(400).build(); } dao.createPolicy(new Policy(id, tenant, subject, policy)); return Response.created(info.getAbsolutePathBuilder().path("/policy/" + id).build()).build(); }

Target:
public Response createPolicy(@Context UriInfo info, @PathParam("tenant") String tenant, @PathParam("subject") String subject, String policy) { String id; try { LOGGER.debug("Creating policy for tenant and subject [{}]", tenant, subject); id = factory.create(Xml.toXml(policy)).getId().toString(); } catch (Exception e) { LOGGER.error("Cannot parse policy: " + e.getMessage()); return Response.status(400).build(); } dao.createPolicy(new Policy(id, tenant, subject, policy)); return Response.created(info.getAbsolutePathBuilder().path("/policy/" + id).build()).build(); }
Source:
public void createEphemeral(String path, Object data, List<ACL> acl) { throw new UnsupportedOperationException( "Create ephemeral nodes using " + SharedZkClient.class.getSimpleName() + " is not supported."); }

Target:
public void createEphemeral(String path, Object data, List<ACL> acl) { throw new UnsupportedOperationException( "Creating ephemeral nodes using " + SharedZkClient.class.getSimpleName() + " is not supported."); }
Source:
public boolean requestRouteToHostAddress(int networkType, InetAddress hostAddress) { String address = hostAddress.getHostAddress(); try { return mService.requestRouteToHostAddress(networkType, address); } catch (RemoteException e) { return false; } }

Target:
public boolean requestRouteToHostAddress(int networkType, InetAddress hostAddress) { byte[] address = hostAddress.getAddress(); try { return mService.requestRouteToHostAddress(networkType, address); } catch (RemoteException e) { return false; } }
Source:
public JedisPool(final GenericObjectPoolConfig poolConfig, final URI uri, final int timeout, final SSLSocketFactory sslSocketFactory, final SSLParameters sslParameters, final HostnameVerifier hostnameVerifier) { this(poolConfig, uri, timeout, timeout); }

Target:
public JedisPool(final GenericObjectPoolConfig poolConfig, final URI uri, final int timeout, final SSLSocketFactory sslSocketFactory, final SSLParameters sslParameters, final HostnameVerifier hostnameVerifier) { this(poolConfig, uri, timeout, timeout, sslSocketFactory, sslParameters, hostnameVerifier); }
Source:
private static String loadDefaultLicenseInfoHeaderText(){ try { String defaultLicenseInfoHeader = IOUtils.toString(LicenseInfoHandler.class.getResourceAsStream(DEFAULT_LICENSE_INFO_HEADER_FILE), "UTF-8"); defaultLicenseInfoHeader = defaultLicenseInfoHeader.replaceAll("(?m)^#.*\\n", ""); return defaultLicenseInfoHeader; } catch (IOException e) { LOGGER.error("Could not read default license info header text from file."); return ""; } }

Target:
private static String loadDefaultLicenseInfoHeaderText(){ String defaultLicenseInfoHeader = new String( CommonUtils.loadResource(LicenseInfoHandler.class, DEFAULT_LICENSE_INFO_HEADER_FILE).orElse(new byte[0]) ); defaultLicenseInfoHeader = defaultLicenseInfoHeader.replaceAll("(?m)^#.*\\n", ""); return defaultLicenseInfoHeader; }
Source:
final int createServerSocketChannel(InetAddress bindAddress, int initialPort, boolean bindAny) { int portCount = networkConfig.getPortCount(); boolean portAutoIncrement = networkConfig.isPortAutoIncrement(); logger.finest("inet reuseAddress:" + networkConfig.isReuseAddress()); if (initialPort == 0) { initialPort = networkConfig.getPort() ; } if (initialPort == 0) { logger.info("No explicit port is given, system will pick up an ephemeral port."); } int portTrialCount = initialPort > 0 && portAutoIncrement ? portCount : 1; try { return tryOpenServerSocketChannel(bindAddress, initialPort, portTrialCount, bindAny); } catch (IOException e) { String message = "Cannot bind to a given address: " + bindAddress + ". Hazelcast cannot start. "; if (networkConfig.isPortAutoIncrement()) { message += "Config-port: " + networkConfig.getPort() + ", latest-port: " + (initialPort + portTrialCount); } else { message += "Port [" + initialPort + "] is already in use and auto-increment is disabled."; } throw new HazelcastException(message, e); } }

Target:
final int createServerSocketChannel(InetAddress bindAddress, int initialPort, boolean bindAny) { int portCount = networkConfig.getPortCount(); boolean portAutoIncrement = networkConfig.isPortAutoIncrement(); logger.finest("inet reuseAddress:" + networkConfig.isReuseAddress()); if (initialPort == 0) { initialPort = networkConfig.getPort() ; } if (initialPort == 0) { logger.info("No explicit port is given, system will pick up an ephemeral port."); } int portTrialCount = initialPort > 0 && portAutoIncrement ? portCount : 1; try { return tryOpenServerSocketChannel(bindAddress, initialPort, portTrialCount, bindAny); } catch (IOException e) { String message = "Cannot bind to a given address: " + bindAddress + ". Hazelcast cannot start. "; if (networkConfig.isPortAutoIncrement()) { message += "Config-port: " + networkConfig.getPort() + ", latest-port: " + (initialPort + portTrialCount - 1); } else { message += "Port [" + initialPort + "] is already in use and auto-increment is disabled."; } throw new HazelcastException(message, e); } }
Source:
public long save(Run run) throws IOException { updateWatchers(run); long id; if (run.getId() == AbstractRun.UNSAVED_ID) { currentSession().save(run); try { String name = namingScheme.generateNameFor(run); run.setName(name); DbUtils.validateNameOrThrow(run, namingScheme); Number newId = (long) currentSession().save(run); if (newId.longValue() != run.getId()) { log.error("Expected Run ID doesn't match returned value from database insert: rolling back..."); currentSession().delete(run); throw new IOException("Something bad happened. Expected Run ID doesn't match returned value from DB insert"); } else { id = run.getId(); } } catch (MisoNamingException e) { throw new IOException("Cannot save Run - issue with generating name"); } } else { currentSession().update(run); id = run.getId(); } return id; }

Target:
public long save(Run run) throws IOException { updateWatchers(run); long id; if (run.getId() == AbstractRun.UNSAVED_ID) { currentSession().save(run); } else { currentSession().update(run); } id = run.getId(); return id; }
Source:
private static <E> View<E> load(Configuration conf) { Class<E> type; try { type = (Class<E>)conf.getClass(KITE_TYPE, GenericData.Record.class); } catch (RuntimeException e) { if (e.getCause() instanceof ClassNotFoundException) { throw new TypeNotFoundException(String.format( "The Java class %s for the entity type could not be found", conf.get(KITE_TYPE)), e.getCause()); } else { throw e; } } String inputUri = conf.get(KITE_INPUT_URI); DefaultConfiguration.set(conf); return Datasets.<E, View<E>>load(inputUri, type); }

Target:
private static <E> View<E> load(Configuration conf) { Class<E> type; try { type = (Class<E>)conf.getClass(KITE_TYPE, GenericData.Record.class); } catch (RuntimeException e) { if (e.getCause() instanceof ClassNotFoundException) { throw new TypeNotFoundException(String.format( "The Java class %s for the entity type could not be found", conf.get(KITE_TYPE)), e.getCause()); } else { throw e; } } String inputUri = conf.get(KITE_INPUT_URI); return Datasets.<E, View<E>>load(inputUri, type); }
Source:
private boolean checkCertificate(X509Certificate cert, AuditLogType alertExpirationEventType, AuditLogType alertAboutToExpireEventType, AuditLogType warnAboutToExpireEventType, VDS host) { Date expirationDate = cert.getNotAfter(); Date certWarnTime = getExpirationDate(expirationDate, ConfigValues.CertExpirationWarnPeriodInDays); Date certAlertTime = getExpirationDate(expirationDate, ConfigValues.CertExpirationAlertPeriodInDays); Date now = new Date(); AuditLogType eventType = null; if (now.compareTo(expirationDate) > 0) { eventType = alertExpirationEventType; } else if (now.compareTo(certAlertTime) > 0) { eventType = alertAboutToExpireEventType; } else if (now.compareTo(certWarnTime) > 0) { eventType = warnAboutToExpireEventType; } if (eventType != null) { AuditLogableBase event = Injector.injectMembers(new AuditLogableBase()); event.addCustomValue("ExpirationDate", new SimpleDateFormat("yyyy-MM-dd").format(expirationDate)); if (host != null) { event.setVds(host); } auditLogDirector.log(event, eventType); return false; } return true; }

Target:
private boolean checkCertificate(X509Certificate cert, AuditLogType alertExpirationEventType, AuditLogType alertAboutToExpireEventType, AuditLogType warnAboutToExpireEventType, VDS host) { Date expirationDate = cert.getNotAfter(); Date certWarnTime = getExpirationDate(expirationDate, ConfigValues.CertExpirationWarnPeriodInDays); Date certAlertTime = getExpirationDate(expirationDate, ConfigValues.CertExpirationAlertPeriodInDays); Date now = new Date(); AuditLogType eventType = null; if (now.compareTo(expirationDate) > 0) { eventType = alertExpirationEventType; } else if (now.compareTo(certAlertTime) > 0) { eventType = alertAboutToExpireEventType; } else if (now.compareTo(certWarnTime) > 0) { eventType = warnAboutToExpireEventType; } if (eventType != null) { AuditLogableBase event = new AuditLogableBase(); event.addCustomValue("ExpirationDate", new SimpleDateFormat("yyyy-MM-dd").format(expirationDate)); if (host != null) { event.setVds(host); } auditLogDirector.log(event, eventType); return false; } return true; }
Source:
public StatementContext(PhoenixStatement statement, ColumnResolver resolver, Scan scan, SequenceManager seqManager) { this.statement = statement; this.resolver = resolver; this.scan = scan; this.sequences = seqManager; this.binds = new BindManager(statement.getParameters()); this.aggregates = new AggregationManager(); this.expressions = new ExpressionManager(); PhoenixConnection connection = statement.getConnection(); if (connection!=null) { this.dateFormat = connection.getQueryServices().getProps().get(QueryServices.DATE_FORMAT_ATTRIB, DateUtil.DEFAULT_DATE_FORMAT); this.dateFormatTimeZone = TimeZone.getTimeZone( connection.getQueryServices().getProps().get(QueryServices.DATE_FORMAT_TIMEZONE_ATTRIB, DateUtil.DEFAULT_TIME_ZONE_ID)); this.numberFormat = connection.getQueryServices().getProps().get(QueryServices.NUMBER_FORMAT_ATTRIB, NumberUtil.DEFAULT_NUMBER_FORMAT); } else { this.dateFormat = DateUtil.DEFAULT_DATE_FORMAT; this.dateFormatTimeZone = TimeZone.getTimeZone(DateUtil.DEFAULT_TIME_ZONE_ID); this.numberFormat = NumberUtil.DEFAULT_NUMBER_FORMAT; } this.dateFormatter = DateUtil.getDateFormatter(dateFormat); this.tempPtr = new ImmutableBytesWritable(); this.currentTable = resolver != null && !resolver.getTables().isEmpty() ? resolver.getTables().get(0) : null; this.whereConditionColumns = new ArrayList<Pair<byte[],byte[]>>(); this.dataColumns = this.currentTable == null ? Collections.<PColumn, Integer>emptyMap() : Maps.<PColumn, Integer>newLinkedHashMap(); this.subqueryResults = Maps.<SelectStatement, Object>newHashMap(); }

Target:
public StatementContext(PhoenixStatement statement, ColumnResolver resolver, Scan scan, SequenceManager seqManager) { this.statement = statement; this.resolver = resolver; this.scan = scan; this.sequences = seqManager; this.binds = new BindManager(statement.getParameters()); this.aggregates = new AggregationManager(); this.expressions = new ExpressionManager(); PhoenixConnection connection = statement.getConnection(); this.dateFormat = connection.getQueryServices().getProps().get(QueryServices.DATE_FORMAT_ATTRIB, DateUtil.DEFAULT_DATE_FORMAT); this.dateFormatTimeZone = TimeZone.getTimeZone( connection.getQueryServices().getProps().get(QueryServices.DATE_FORMAT_TIMEZONE_ATTRIB, DateUtil.DEFAULT_TIME_ZONE_ID)); this.dateFormatter = DateUtil.getDateFormatter(dateFormat); this.numberFormat = connection.getQueryServices().getProps().get(QueryServices.NUMBER_FORMAT_ATTRIB, NumberUtil.DEFAULT_NUMBER_FORMAT); this.tempPtr = new ImmutableBytesWritable(); this.currentTable = resolver != null && !resolver.getTables().isEmpty() ? resolver.getTables().get(0) : null; this.whereConditionColumns = new ArrayList<Pair<byte[],byte[]>>(); this.dataColumns = this.currentTable == null ? Collections.<PColumn, Integer>emptyMap() : Maps.<PColumn, Integer>newLinkedHashMap(); this.subqueryResults = Maps.<SelectStatement, Object>newHashMap(); }
Source:
private Object getMapValue(Class<?> keyType, Class<?> valueType, String propertyName, EDBObject object) { Map<Object, Object> temp = new HashMap<Object, Object>(); for (int i = 0;; i++) { String keyProperty = propertyName + "." + i + ".key"; String valueProperty = propertyName + "." + i + ".value"; if (!object.containsKey(keyProperty)) { break; } Object key = object.getObject(keyProperty); Object value = object.getObject(valueProperty); if (OpenEngSBModel.class.isAssignableFrom(keyType)) { key = convertEDBObjectToUncheckedModel(keyType, edbService.getObject(key.toString())); } if (OpenEngSBModel.class.isAssignableFrom(valueType)) { value = convertEDBObjectToUncheckedModel(valueType, edbService.getObject(value.toString())); } temp.put(key, value); object.remove(keyProperty); object.remove(valueProperty); } return temp; }

Target:
private Object getMapValue(Class<?> keyType, Class<?> valueType, String propertyName, EDBObject object) { Map<Object, Object> temp = new HashMap<Object, Object>(); for (int i = 0;; i++) { String keyProperty = EDBConverterUtils.getEntryNameForMapKey(propertyName, i); String valueProperty = EDBConverterUtils.getEntryNameForMapValue(propertyName, i); if (!object.containsKey(keyProperty)) { break; } Object key = object.getObject(keyProperty); Object value = object.getObject(valueProperty); if (OpenEngSBModel.class.isAssignableFrom(keyType)) { key = convertEDBObjectToUncheckedModel(keyType, edbService.getObject(key.toString())); } if (OpenEngSBModel.class.isAssignableFrom(valueType)) { value = convertEDBObjectToUncheckedModel(valueType, edbService.getObject(value.toString())); } temp.put(key, value); object.remove(keyProperty); object.remove(valueProperty); } return temp; }
Source:
protected BeanDefinitionBuilder parseHandler(Element gatewayElement, ParserContext parserContext) { final BeanDefinitionBuilder jpaOutboundGatewayBuilder = super.parseHandler(gatewayElement, parserContext); final BeanDefinitionBuilder jpaExecutorBuilder = JpaParserUtils.getOutboundGatewayJpaExecutorBuilder(gatewayElement, parserContext); IntegrationNamespaceUtils.setValueIfAttributeDefined(jpaExecutorBuilder, gatewayElement, "persist-mode"); IntegrationNamespaceUtils.setValueIfAttributeDefined(jpaExecutorBuilder, gatewayElement, "flush"); IntegrationNamespaceUtils.setValueIfAttributeDefined(jpaExecutorBuilder, gatewayElement, "flush-size"); IntegrationNamespaceUtils.setValueIfAttributeDefined(jpaExecutorBuilder, gatewayElement, "clean-on-flush"); final BeanDefinition jpaExecutorBuilderBeanDefinition = jpaExecutorBuilder.getBeanDefinition(); final String gatewayId = this.resolveId(gatewayElement, jpaOutboundGatewayBuilder.getRawBeanDefinition(), parserContext); final String jpaExecutorBeanName = gatewayId + ".jpaExecutor"; parserContext.registerBeanComponent(new BeanComponentDefinition(jpaExecutorBuilderBeanDefinition, jpaExecutorBeanName)); jpaOutboundGatewayBuilder.addConstructorArgValue(jpaExecutorBuilderBeanDefinition); jpaOutboundGatewayBuilder.addPropertyValue("gatewayType", OutboundGatewayType.UPDATING); return jpaOutboundGatewayBuilder; }

Target:
protected BeanDefinitionBuilder parseHandler(Element gatewayElement, ParserContext parserContext) { final BeanDefinitionBuilder jpaOutboundGatewayBuilder = super.parseHandler(gatewayElement, parserContext); final BeanDefinitionBuilder jpaExecutorBuilder = JpaParserUtils.getOutboundGatewayJpaExecutorBuilder(gatewayElement, parserContext); IntegrationNamespaceUtils.setValueIfAttributeDefined(jpaExecutorBuilder, gatewayElement, "persist-mode"); IntegrationNamespaceUtils.setValueIfAttributeDefined(jpaExecutorBuilder, gatewayElement, "flush"); IntegrationNamespaceUtils.setValueIfAttributeDefined(jpaExecutorBuilder, gatewayElement, "flush-size"); IntegrationNamespaceUtils.setValueIfAttributeDefined(jpaExecutorBuilder, gatewayElement, "clear-on-flush"); final BeanDefinition jpaExecutorBuilderBeanDefinition = jpaExecutorBuilder.getBeanDefinition(); final String gatewayId = this.resolveId(gatewayElement, jpaOutboundGatewayBuilder.getRawBeanDefinition(), parserContext); final String jpaExecutorBeanName = gatewayId + ".jpaExecutor"; parserContext.registerBeanComponent(new BeanComponentDefinition(jpaExecutorBuilderBeanDefinition, jpaExecutorBeanName)); jpaOutboundGatewayBuilder.addConstructorArgReference(jpaExecutorBeanName); jpaOutboundGatewayBuilder.addPropertyValue("gatewayType", OutboundGatewayType.UPDATING); return jpaOutboundGatewayBuilder; }
Source:
public NotesToJson(Json json) { this.json = checkNotNull(json, "json"); }

Target:
NotesToJson(Json json) { this.json = json; }
Source:
private int addMappingUnderLock(ObjectStreamClass desc, SerializableDataKey probe) { lock.lock(); try { if (potentiallyInconsistent) { refreshMappingsFromServer(readLookup.entrySet()); potentiallyInconsistent = false; } ObjectStreamClass disconnected = disconnect(desc); SerializableDataKey key = new SerializableDataKey(disconnected, true); while (true) { Integer rep = writeLookup.get(probe); if (rep != null) { return rep; } rep = nextStreamIndex++; try { ObjectStreamClass existingOsc = readLookup.putIfAbsent(rep, disconnected); if (existingOsc == null) { writeLookup.put(key, rep); readLookupLocalCache.put(rep, disconnected); return rep; } else { ObjectStreamClass discOsc = disconnect(existingOsc); writeLookup.put(new SerializableDataKey(discOsc, true), rep); readLookupLocalCache.put(rep, discOsc); } } catch (Throwable t) { potentiallyInconsistent = true; throw t; } } } finally { lock.unlock(); } }

Target:
private int addMappingUnderLock(ObjectStreamClass desc, SerializableDataKey probe) { lock.lock(); try { if (potentiallyInconsistent) { refreshMappingsFromStateRepository(); potentiallyInconsistent = false; } while (true) { Integer rep = writeLookupCache.get(probe); if (rep != null) { return rep; } rep = nextStreamIndex++; try { ObjectStreamClass disconnected = disconnect(desc); ObjectStreamClass existingOsc = persistentState.putIfAbsent(rep, disconnected); if (existingOsc == null) { cacheMapping(rep, disconnected); return rep; } else { cacheMapping(rep, disconnect(existingOsc)); } } catch (Throwable t) { potentiallyInconsistent = true; throw t; } } } finally { lock.unlock(); } }
Source:
private JSONObject getSlaveAttributeForLabel(String labelName) { LOGGER.info(String.format("Getting slave attributes for label: %s", labelName)); List<MesosSlaveInfo> matchedSlaves = getMesosCloud().getSlaveInfos().stream() .filter(slaveInfo -> slaveInfo.getLabelString() != null && slaveInfo.getLabelString().equals(labelName)) .collect(Collectors.toList()); if (matchedSlaves.size() > 1) { LOGGER.info(String.format("Multiple matches for label %s found, matches: %o", labelName, matchedSlaves.size())); LOGGER.info("For multiple matches, checking for Slave Info marked as default"); return matchedSlaves.stream() .filter(MesosSlaveInfo::isDefaultSlave).collect(Collectors.toList()) .stream() .findFirst() .map(MesosSlaveInfo::getSlaveAttributes) .orElse(null); } return matchedSlaves.stream().findFirst().map(MesosSlaveInfo::getSlaveAttributes).orElse(null); }

Target:
private JSONObject getSlaveAttributeForLabel(String labelName) { LOGGER.info(String.format("Getting slave attributes for label: %s", labelName)); List<MesosSlaveInfo> matchedSlaves = getMesosCloud().getSlaveInfos().stream() .filter(slaveInfo -> Objects.equals(labelName, slaveInfo.getLabelString())) .collect(Collectors.toList()); if (matchedSlaves.size() > 1) { LOGGER.info(String.format("Multiple matches for label %s found, matches: %o", labelName, matchedSlaves.size())); LOGGER.info("For multiple matches, checking for Slave Info marked as default"); return matchedSlaves.stream() .filter(MesosSlaveInfo::isDefaultSlave).collect(Collectors.toList()) .stream() .findFirst() .map(MesosSlaveInfo::getSlaveAttributes) .orElse(new JSONObject()); } return matchedSlaves.stream().findFirst().map(MesosSlaveInfo::getSlaveAttributes).orElse(new JSONObject()); }
Source:
public void undelete(){ WebElement undeleteLink = wait.forElementVisible(undeleteLinkBy); undeleteLink.click(); }

Target:
public SpecialRestorePageObject undelete() { WebElement undeleteLink = wait.forElementVisible(undeleteLinkBy); undeleteLink.click(); return new SpecialRestorePageObject(driver); }
Source:
public static void beforeClass() throws IOException, CommandFailedException { operations.writeAttribute(WEBSERVICES_ADDRESS, "statistics-enabled", true); if (client.options().isDomain) { address = Address.host(client.options().defaultHost) .and("server", "server-one"); } address = address.and("deployment", DEPLOYMENT_FILE_NAME) .and("subsystem", "webservices") .and("endpoint", "test%3ATestService"); verifier = new ResourceVerifier(address, client); }

Target:
public static void beforeClass() throws IOException, CommandFailedException { originalStatisticsEnabledValue = operations.readAttribute(WEBSERVICES_ADDRESS, STATISTICS_ENABLED, ReadAttributeOption.NOT_INCLUDE_DEFAULTS).value(); operations.writeAttribute(WEBSERVICES_ADDRESS, STATISTICS_ENABLED, true); if (client.options().isDomain) { address = Address.host(client.options().defaultHost) .and("server", "server-one"); } address = address.and("deployment", DEPLOYMENT_FILE_NAME) .and("subsystem", "webservices") .and("endpoint", "test%3ATestService"); verifier = new ResourceVerifier(address, client); }
Source:
public final JsonObject json() throws IOException { return null; }

Target:
public final JsonObject json() throws IOException { throw new UnsupportedOperationException("MkFork#json()"); }
Source:
public Builder adapt(Scan scan, ReadHooks readHooks) { throwIfUnsupportedScan(scan); RowFilter filter = buildFilter(scan, readHooks); RowSet.Builder rowSetBuilder = RowSet.newBuilder(); if (scan.isGetScan()) { rowSetBuilder.addRowKeys(ByteString.copyFrom(scan.getStartRow())); } else { rowSetBuilder.addRowRanges( RowRange.newBuilder().setStartKeyClosed(ByteString.copyFrom(scan.getStartRow())) .setEndKeyOpen(ByteString.copyFrom(scan.getStopRow()))); } return ReadRowsRequest.newBuilder().setFilter(filter).setRows(rowSetBuilder); }

Target:
public Builder adapt(Scan scan, ReadHooks readHooks) { throwIfUnsupportedScan(scan); RowFilter filter = buildFilter(scan, readHooks); RowSet.Builder rowSetBuilder = RowSet.newBuilder(); ByteString startRow = ByteString.copyFrom(scan.getStartRow()); if (scan.isGetScan()) { rowSetBuilder.addRowKeys(startRow); } else { ByteString stopRow = ByteString.copyFrom(scan.getStopRow()); rowSetBuilder.addRowRangesBuilder().setStartKeyClosed(startRow).setEndKeyOpen(stopRow); } return ReadRowsRequest.newBuilder().setRows(rowSetBuilder).setFilter(filter); }
Source:
void setEnableEditMode(boolean enable) { if (mIsMultiSelectEnabled == enable) { return; } if (enable) { mShowHiddenSites = true; mShowSelfHostedSites = false; } else { mShowHiddenSites = false; mShowSelfHostedSites = true; } mIsMultiSelectEnabled = enable; mSelectedPositions.clear(); notifyDataSetChanged(); loadSites(); }

Target:
void setEnableEditMode(boolean enable) { if (mIsMultiSelectEnabled == enable) { return; } if (enable) { mShowHiddenSites = true; mShowSelfHostedSites = false; } else { mShowHiddenSites = false; mShowSelfHostedSites = true; } mIsMultiSelectEnabled = enable; mSelectedPositions.clear(); loadSites(); }
Source:
public void visitCompilationUnit(CompilationUnitTree tree) { super.visitCompilationUnit(tree); checkDuplications(functions, FUNCTION_TO_NAME); }

Target:
public void visitCompilationUnit(CompilationUnitTree tree) { functions.clear(); methods.clear(); super.visitCompilationUnit(tree); checkDuplications(functions, FUNCTION_TO_NAME); }
Source:
public ArrayList<LectureSlide> getLectureSlide(final List<String> slideId, final String userId) throws AuthenticationException, DatabaseAccessException { final long currentTime = System.currentTimeMillis(); final ArrayList<LectureSlide> allSlides = new ArrayList<LectureSlide>(); for (int slides = slideId.size() - 1; slides >= 0; slides--) { try { allSlides.add(SlideManager.mongoGetLectureSlide(getInstance().auth, getInstance().database, slideId.get(slides), userId, currentTime)); } catch (DatabaseAccessException e) { LOG.info(LoggingConstants.EXCEPTION_MESSAGE, e); if (!e.isRecoverable()) { throw e; } } catch (AuthenticationException e) { LOG.error("Error: {}", e); if (e.getType() != AuthenticationException.INVALID_DATE) { throw e; } } } return allSlides; }

Target:
public ArrayList<LectureSlide> getLectureSlide(final List<String> slideId, final String userId) throws AuthenticationException, DatabaseAccessException { final long currentTime = System.currentTimeMillis(); final ArrayList<LectureSlide> allSlides = new ArrayList<LectureSlide>(); for (int slides = slideId.size() - 1; slides >= 0; slides--) { try { allSlides.add(SlideManager.mongoGetLectureSlide(getInstance().auth, getInstance().database, slideId.get(slides), userId, currentTime)); } catch (DatabaseAccessException e) { LOG.error(LoggingConstants.EXCEPTION_MESSAGE, e); if (!e.isRecoverable()) { throw e; } } catch (AuthenticationException e) { LOG.error(LoggingConstants.EXCEPTION_MESSAGE, e); if (e.getType() != AuthenticationException.INVALID_DATE) { throw e; } } } return allSlides; }
Source:
void setInitialBounds () { if ((state & ZERO_WIDTH) != 0 && (state & ZERO_HEIGHT) != 0) { long topHandle = topHandle (); if(GTK.GTK_VERSION > OS.VERSION(3, 18, 0)) { if(mustBeVisibleOnInitBounds()) { GTK.gtk_widget_set_visible(topHandle, true); } return; } GtkAllocation allocation = new GtkAllocation(); if ((parent.style & SWT.MIRRORED) != 0) { allocation.x = parent.getClientWidth (); } else { allocation.x = 0; } allocation.y = 0; GTK.gtk_widget_set_visible(topHandle, true); GTK.gtk_widget_set_allocation(topHandle, allocation); } else { resizeHandle (1, 1); forceResize (); } }

Target:
void setInitialBounds () { if ((state & ZERO_WIDTH) != 0 && (state & ZERO_HEIGHT) != 0) { long topHandle = topHandle (); if(GTK.GTK_VERSION >= OS.VERSION(3, 20, 0)) { if(mustBeVisibleOnInitBounds()) { GTK.gtk_widget_set_visible(topHandle, true); } return; } GtkAllocation allocation = new GtkAllocation(); if ((parent.style & SWT.MIRRORED) != 0) { allocation.x = parent.getClientWidth (); } else { allocation.x = 0; } allocation.y = 0; GTK.gtk_widget_set_visible(topHandle, true); GTK.gtk_widget_set_allocation(topHandle, allocation); } else { resizeHandle (1, 1); forceResize (); } }
Source:
public void onEndProduct(ProductId id) throws Exception { super.onEndProduct(id); Product product = getProduct(); byte[] json = new JsonProduct().getJsonObject(product).toString().getBytes("UTF8"); out.write(json); }

Target:
public void onEndProduct(ProductId id) throws Exception { super.onEndProduct(id); Product product = getProduct(); byte[] json = new JsonProduct().getJsonObject(product) .toString().getBytes(StandardCharsets.UTF_8); out.write(json); }
Source:
public static WebElement findByFooter(WebDriver webDriver, String tableLocator, String content) { List<String> locators = parseTableLocator(tableLocator, "footer"); System.out.println(Arrays.toString(locators.toArray())); return searchInLocators(webDriver, locators, content); }

Target:
public static WebElement findByFooter(WebDriver webDriver, String tableLocator, String content) { List<String> locators = parseTableLocator(tableLocator, "footer"); return searchInLocators(webDriver, locators, content); }
Source:
public void executeCommand() { addAuditLogForPartialVMs(); super.executeCommand(); if (getParameters().isImagesExistOnTargetStorageDomain()) { if (!getImages().isEmpty()) { findAndSaveDiskCopies(); for (DiskImage diskImage : getImages()) { initQcowVersionForDisks(diskImage.getId()); } } unregisteredOVFDataDao.removeEntity(ovfEntityData.getEntityId(), null); unregisteredDisksDao.removeUnregisteredDiskRelatedToVM(ovfEntityData.getEntityId(), null); } setActionReturnValue(getVmTemplate().getId()); setSucceeded(true); }

Target:
public void executeCommand() { addAuditLogForPartialVMs(); super.executeCommand(); if (getParameters().isImagesExistOnTargetStorageDomain()) { if (!getImages().isEmpty()) { findAndSaveDiskCopies(); getImages().stream().forEach(diskImage -> { initQcowVersionForDisks(diskImage.getId()); }); } unregisteredOVFDataDao.removeEntity(ovfEntityData.getEntityId(), null); unregisteredDisksDao.removeUnregisteredDiskRelatedToVM(ovfEntityData.getEntityId(), null); } setActionReturnValue(getVmTemplate().getId()); setSucceeded(true); }
Source:
public VariantLoaderStepParametersValidator() { super(new String[]{ JobParametersNames.DB_NAME, JobParametersNames.DB_COLLECTIONS_VARIANTS_NAME, JobParametersNames.DB_COLLECTIONS_FILES_NAME, JobParametersNames.INPUT_STUDY_ID, JobParametersNames.INPUT_VCF_ID, JobParametersNames.INPUT_VCF, }, new String[]{}); }

Target:
public VariantLoaderStepParametersValidator() { super(new String[]{JobParametersNames.DB_NAME, JobParametersNames.DB_COLLECTIONS_VARIANTS_NAME, JobParametersNames.INPUT_STUDY_ID, JobParametersNames.INPUT_VCF_ID, JobParametersNames.INPUT_VCF, JobParametersNames.INPUT_VCF_AGGREGATION}, new String[]{}); }
Source:
private static Optional<ExchangeRepositoryMetadata> getExchangeRepositoryMetadata(DeploymentRepository repository, Settings settings, List<String> customDomains) { ExchangeRepositoryMetadata metadata = null; if (repository != null && new ExchangeUriChecker(customDomains).isExchangeRepo(repository.getUrl())) { Server server = settings.getServer(repository.getId()); if (server != null) { Credentials credentials = new Credentials(server.getUsername(), server.getPassword()); metadata = new ExchangeRepositoryMetadata(credentials, repository.getUrl(), customDomains); } } return Optional.ofNullable(metadata); }

Target:
private static Optional<ExchangeRepositoryMetadata> getExchangeRepositoryMetadata(DeploymentRepository repository, Settings settings, List<String> customDomains) { ExchangeRepositoryMetadata metadata = null; ExchangeUriChecker exchangeUriChecker = new ExchangeUriChecker(customDomains); if (repository != null && exchangeUriChecker.isExchangeRepo(repository.getUrl())) { Server server = settings.getServer(repository.getId()); if (server != null) { Credentials credentials = new Credentials(server.getUsername(), server.getPassword()); metadata = new ExchangeRepositoryMetadata(credentials, repository.getUrl(), customDomains); } } return Optional.ofNullable(metadata); }
Source:
protected String getTextTransform(String textToInsert, String oldText, CSSValue value) { if (value.getCssValueType() == CSSValue.CSS_PRIMITIVE_VALUE) { CSSPrimitiveValue primitiveValue = (CSSPrimitiveValue) value; String textTransform = primitiveValue.getStringValue(); if ("capitalize".equals(textTransform)) { String newText = StringUtils.capitalize(oldText + textToInsert); if (newText.length() > 0) { return newText.substring(newText.length() - 1); } } if ("uppercase".equals(textTransform)) { if (textToInsert != null) { return textToInsert.toUpperCase(); } } if ("lowercase".equals(textTransform)) { if (textToInsert != null) { return textToInsert.toLowerCase(); } } if ("inherit".equals(textTransform)) { return textToInsert; } } return textToInsert; }

Target:
protected String getTextTransform(String textToInsert, String oldText, CSSValue value) { if (value.getCssValueType() != CSSValue.CSS_PRIMITIVE_VALUE) { return textToInsert; } String textTransform = ((CSSPrimitiveValue) value).getStringValue(); if ("capitalize".equals(textTransform)) { String newText = StringUtils.capitalize(oldText + textToInsert); if (newText.length() > 0) { return newText.substring(newText.length() - 1); } } if ("uppercase".equals(textTransform) && textToInsert != null) { return textToInsert.toUpperCase(); } if ("lowercase".equals(textTransform) && textToInsert != null) { return textToInsert.toLowerCase(); } if ("inherit".equals(textTransform)) { return textToInsert; } return textToInsert; }
Source:
public static MoveEntityEvent.Teleport handleDisplaceEntityTeleportEvent(Entity entityIn, Transform<World> fromTransform, Transform<World> toTransform, boolean apiCall) { final PhaseTracker phaseTracker = PhaseTracker.getInstance(); final PhaseData peek = phaseTracker.getCurrentPhaseData(); final IPhaseState state = peek.state; final PhaseContext<?> context = peek.context; Sponge.getCauseStackManager().pushCause(entityIn); MoveEntityEvent.Teleport event = SpongeEventFactory.createMoveEntityEventTeleport(Sponge.getCauseStackManager().getCurrentCause(), fromTransform, toTransform, (org.spongepowered.api.entity.Entity) entityIn); SpongeImpl.postEvent(event); return event; }

Target:
public static MoveEntityEvent.Teleport handleDisplaceEntityTeleportEvent(Entity entityIn, Transform<World> fromTransform, Transform<World> toTransform, boolean apiCall) { final PhaseTracker phaseTracker = PhaseTracker.getInstance(); final PhaseData peek = phaseTracker.getCurrentPhaseData(); final IPhaseState state = peek.state; final PhaseContext<?> context = peek.context; try (CauseStackManager.StackFrame frame = Sponge.getCauseStackManager().pushCauseFrame()) { frame.pushCause(entityIn); MoveEntityEvent.Teleport event = SpongeEventFactory.createMoveEntityEventTeleport(Sponge.getCauseStackManager().getCurrentCause(), fromTransform, toTransform, (org.spongepowered.api.entity.Entity) entityIn); SpongeImpl.postEvent(event); return event; } }
Source:
@Override public void init(StreamGraph graph, Config config) { Supplier<Integer> initialValue = () -> 0; MessageStream<PageViewEvent> pageViewEvents = graph.getInputStream("pageViewEventStream", (k, m) -> (PageViewEvent) m); pageViewEvents .partitionBy(m -> m.memberId) .window(Windows.keyedTumblingWindow(m -> m.memberId, Duration.ofMinutes(5), initialValue, (m, c) -> c + 1)) .map(MyStreamOutput::new) .sendTo(graph.getOutputStream("steramId", m -> m.memberId, m -> m.memberId)); }

Target:
@Override public void init(StreamGraph graph, Config config) { Supplier<Integer> initialValue = () -> 0; MessageStream<PageViewEvent> pageViewEvents = graph.getInputStream("pageViewEventStream", (k, m) -> (PageViewEvent) m); OutputStream<String, MyStreamOutput, MyStreamOutput> pageViewEventPerMemberStream = graph .getOutputStream("pageViewEventPerMemberStream", m -> m.memberId, m -> m); pageViewEvents .partitionBy(m -> m.memberId) .window(Windows.keyedTumblingWindow(m -> m.memberId, Duration.ofMinutes(5), initialValue, (m, c) -> c + 1)) .map(MyStreamOutput::new) .sendTo(pageViewEventPerMemberStream); }