auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private boolean isInstanceTimedOutDuringMaintenance(HelixDataAccessor accessor, String instance, long timeOutWindow) { PropertyKey.Builder keyBuilder = accessor.keyBuilder(); PropertyKey propertyKey = keyBuilder.participantHistory(instance); ParticipantHistory history = accessor.getProperty(propertyKey); long lastOfflineTime = history.getLastTimeInOfflineHistory(); if (lastOfflineTime < 0) { return false; } long currentTime = System.currentTimeMillis(); if (currentTime - lastOfflineTime > timeOutWindow) { LogUtil.logWarn(logger, getClusterEventId(), String.format( "During maintenance mode, instance %s is timed-out due to its offline time. Current time: " + "%s, Last offline time: %s, Timeout window: %s", instance, currentTime, lastOfflineTime, timeOutWindow)); return true; } return false; }

Target:
private boolean isInstanceTimedOutDuringMaintenance(HelixDataAccessor accessor, String instance, long timeOutWindow) { ParticipantHistory history = accessor.getProperty(accessor.keyBuilder().participantHistory(instance)); List<Long> onlineTimestamps = history.getOnlineTimestampsAsMilliseconds(); List<Long> offlineTimestamps = history.getOfflineTimestampsAsMilliseconds(); onlineTimestamps.add(System.currentTimeMillis()); for (int onlineTimestampIndex = onlineTimestamps.size() - 1, offlineTimestampIndex = offlineTimestamps.size() - 1; onlineTimestampIndex >= 0 && offlineTimestampIndex >= 0; onlineTimestampIndex--) { long onlineWindowRight = onlineTimestamps.get(onlineTimestampIndex); if (onlineWindowRight <= _maintenanceSignal.getTimestamp()) { break; } long onlineWindowLeft = 0L; if (onlineTimestampIndex > 0) { onlineWindowLeft = onlineTimestamps.get(onlineTimestampIndex - 1); } if (offlineTimestamps.get(offlineTimestampIndex) <= onlineWindowLeft) { continue; } while (offlineTimestampIndex >= 0 && offlineTimestamps.get(offlineTimestampIndex) > onlineWindowLeft) { offlineTimestampIndex--; } long offlineTimeStamp = offlineTimestamps.get(offlineTimestampIndex + 1); if (onlineWindowRight - offlineTimeStamp > timeOutWindow) { LogUtil.logWarn(logger, getClusterEventId(), String.format( "During maintenance mode, instance %s is timed-out due to its offline time. Online time: " + "%s, Offline time: %s, Timeout window: %s", instance, onlineWindowRight, offlineTimeStamp, timeOutWindow)); return true; } } return false; }
Source:
public static boolean addResourceToSet(ResourceSet resourceSet, URI resourceURI) { try { final Map<Object, Object> loadOptions = new HashMap<Object, Object>(); loadOptions.put(XMLResource.OPTION_RECORD_UNKNOWN_FEATURE, Boolean.TRUE); resourceSet.createResource(resourceURI).load(loadOptions); int rsSize = resourceSet.getResources().size(); EcoreUtil.resolveAll(resourceSet); while (rsSize != resourceSet.getResources().size()) { EcoreUtil.resolveAll(resourceSet); rsSize = resourceSet.getResources().size(); } return true; } catch (final IOException e) { } return false; }

Target:
public static boolean addResourceToSet(ResourceSet resourceSet, URI resourceURI) { try { final Map<Object, Object> loadOptions = new HashMap<Object, Object>(); loadOptions.put(XMLResource.OPTION_RECORD_UNKNOWN_FEATURE, Boolean.TRUE); resourceSet.createResource(resourceURI).load(loadOptions); int rsSize = resourceSet.getResources().size(); EcoreUtil.resolveAll(resourceSet); while (rsSize != resourceSet.getResources().size()) { EcoreUtil.resolveAll(resourceSet); rsSize = resourceSet.getResources().size(); } return true; } catch (final IOException ex) { Activator.getDefault().getReportService().report( new StatusReport(new Status(IStatus.ERROR, Activator.PLUGIN_ID, ex.getMessage(), ex))); } return false; }
Source:
public ElasticAgentRequestProcessor(PluginRequestProcessorRegistry registry, AgentService agentService, AgentConfigService agentConfigService) { this(registry, new ElasticAgentRequestProcessorV1(agentService, agentConfigService), new ElasticAgentRequestProcessorV2(agentService, agentConfigService), new ElasticAgentRequestProcessorV3(agentService, agentConfigService) ); }

Target:
public ElasticAgentRequestProcessor(PluginRequestProcessorRegistry registry, AgentService agentService, AgentConfigService agentConfigService) { this(registry, new HashMap<String, VersionableElasticAgentProcessor>() {{ put("1.0", new ElasticAgentRequestProcessorV1(agentService, agentConfigService)); put("2.0", new ElasticAgentRequestProcessorV1(agentService, agentConfigService)); put("3.0", new ElasticAgentRequestProcessorV1(agentService, agentConfigService)); }}); }
Source:
public static ContentFilter get() { return ExtensionList.lookupSingleton(ContentFilters.class).isEnabled() ? ALL : DISABLED; }

Target:
public static ContentFilters get() { return ExtensionList.lookupSingleton(ContentFilters.class); }
Source:
private void initSettingsFields() { mExcerptEditText.setText(mPost.getPostExcerpt()); String[] items = new String[]{ getResources().getString(R.string.publish_post), getResources().getString(R.string.draft), getResources().getString(R.string.pending_review), getResources().getString(R.string.post_private) }; ArrayAdapter<String> adapter = new ArrayAdapter<>(getActivity(), android.R.layout.simple_spinner_item, items); adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); mStatusSpinner.setAdapter(adapter); mStatusSpinner.setOnTouchListener( new View.OnTouchListener() { @Override public boolean onTouch(View view, MotionEvent motionEvent) { return false; } } ); long pubDate = mPost.getDate_created_gmt(); if (pubDate != 0) { try { int flags = 0; flags |= android.text.format.DateUtils.FORMAT_SHOW_DATE; flags |= android.text.format.DateUtils.FORMAT_ABBREV_MONTH; flags |= android.text.format.DateUtils.FORMAT_SHOW_YEAR; flags |= android.text.format.DateUtils.FORMAT_SHOW_TIME; String formattedDate = DateUtils.formatDateTime(getActivity(), pubDate, flags); mPubDateText.setText(formattedDate); } catch (RuntimeException e) { AppLog.e(T.POSTS, e); } } if (!TextUtils.isEmpty(mPost.getPassword())) { mPasswordEditText.setText(mPost.getPassword()); } updateStatusSpinner(); if (!mPost.isPage()) { if (mPost.getJSONCategories() != null) { mCategories = JSONUtils.fromJSONArrayToStringList(mPost.getJSONCategories()); } } String tags = mPost.getKeywords(); if (!tags.equals("")) { mTagsEditText.setText(tags); } if (AppPrefs.isVisualEditorEnabled()) { updateFeaturedImage(mPost.getFeaturedImageId()); } }

Target:
private void initSettingsFields() { mExcerptEditText.setText(mPost.getExcerpt()); String[] items = new String[]{getResources().getString(R.string.publish_post), getResources().getString(R.string.draft), getResources().getString(R.string.pending_review), getResources().getString(R.string.post_private)}; ArrayAdapter<String> adapter = new ArrayAdapter<>(getActivity(), android.R.layout.simple_spinner_item, items); adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); mStatusSpinner.setAdapter(adapter); mStatusSpinner.setOnTouchListener( new View.OnTouchListener() { @Override public boolean onTouch(View view, MotionEvent motionEvent) { return false; } } ); String pubDate = mPost.getDateCreated(); if (StringUtils.isNotEmpty(pubDate)) { try { int flags = 0; flags |= android.text.format.DateUtils.FORMAT_SHOW_DATE; flags |= android.text.format.DateUtils.FORMAT_ABBREV_MONTH; flags |= android.text.format.DateUtils.FORMAT_SHOW_YEAR; flags |= android.text.format.DateUtils.FORMAT_SHOW_TIME; String formattedDate = DateUtils.formatDateTime(getActivity(), DateTimeUtils.timestampFromIso8601Millis(pubDate), flags); mPubDateText.setText(formattedDate); } catch (RuntimeException e) { AppLog.e(T.POSTS, e); } } if (!TextUtils.isEmpty(mPost.getPassword())) { mPasswordEditText.setText(mPost.getPassword()); } updateStatusSpinner(); }
Source:
public MultipartUploadMetadata(@Nullable String archiveDescription, Date creationDate, String multipartUploadId, long partSizeInBytes, String vaultARN, @Nullable Iterable<PartMetadata> parts, @Nullable String marker) { super(); this.archiveDescription = archiveDescription; this.creationDate = checkNotNull(creationDate, "creationDate"); this.multipartUploadId = checkNotNull(multipartUploadId, "multipartUploadId"); this.partSizeInBytes = partSizeInBytes; this.vaultARN = checkNotNull(vaultARN, "vaultARN"); this.parts = parts; this.marker = marker; }

Target:
public MultipartUploadMetadata(@Nullable String archiveDescription, Date creationDate, String multipartUploadId, long partSizeInBytes, String vaultARN, @Nullable Iterable<PartMetadata> parts, @Nullable String marker) { super(); this.archiveDescription = archiveDescription; this.creationDate = (Date) checkNotNull(creationDate, "creationDate").clone(); this.multipartUploadId = checkNotNull(multipartUploadId, "multipartUploadId"); this.partSizeInBytes = partSizeInBytes; this.vaultARN = checkNotNull(vaultARN, "vaultARN"); this.parts = parts; this.marker = marker; }
Source:
public boolean matches(NameKey name) { if (matchAll) { return true; } else { String projectName = name.get(); for (final String projectMatch : projectsToMatch) { if (isRE(projectMatch)) { if (projectName.matches(projectMatch)) { return true; } } else if (isWildcard(projectMatch)) { if (projectName.startsWith(projectMatch.substring(0, projectMatch.length() - 1))) { return true; } } else { if (projectName.equals(projectMatch)) { return true; } } } return false; } }

Target:
public boolean matches(NameKey name) { if (projectPatterns.isEmpty()) { return true; } else { String projectName = name.get(); for (String pattern : projectPatterns) { if (isRE(pattern)) { if (projectName.matches(pattern)) { return true; } } else if (isWildcard(pattern)) { if (projectName.startsWith(pattern.substring(0, pattern.length() - 1))) { return true; } } else { if (projectName.equals(pattern)) { return true; } } } return false; } }
Source:
public View getView(int position, View convertView, ViewGroup parent) { if (actionsCount > 0 && position >= actionsStartPosition) { HorizontalMediaView tiav = (HorizontalMediaView)convertView; if (tiav == null) { tiav = new HorizontalMediaView(context); } Action currentAction = detail.getCustomActions().get(position - actionsStartPosition); tiav.setDisplay(currentAction.getDisplay()); tiav.setBackgroundResource(R.drawable.list_bottom_tab); int padding = (int)context.getResources().getDimension(R.dimen.entity_padding); tiav.setPadding(padding, padding, padding, padding); return tiav; } Entity<TreeReference> entity = current.get(position); if (usesGridView) { GridEntityView emv = (GridEntityView)convertView; int[] titleColor = AndroidUtil.getThemeColorIDs(context, new int[]{R.attr.entity_select_title_text_color}); if (emv == null) { emv = new GridEntityView(context, detail, entity, currentSearchTerms, mImageLoader, mFuzzySearchEnabled); } else { emv.setSearchTerms(currentSearchTerms); emv.setViews(context, detail, entity); } emv.setTitleTextColor(titleColor[0]); return emv; } else { EntityView emv = (EntityView)convertView; if (emv == null) { emv = EntityView.buildEntryEntityView(context, detail, entity, null, currentSearchTerms, position, mFuzzySearchEnabled); } else { emv.setSearchTerms(currentSearchTerms); emv.refreshViewsForNewEntity(entity, entity.getElement().equals(selected), position); } return emv; } }

Target:
public View getView(int position, View convertView, ViewGroup parent) { if (actionsCount > 0 && position >= actionsStartPosition) { return getActionView(position, (HorizontalMediaView)convertView); } Entity<TreeReference> entity = current.get(position); if (usesGridView) { return getGridView(entity, (GridEntityView)convertView); } else { return getEntityView(entity, (EntityView)convertView, position); } }
Source:
public List<PoolQuantityDTO> dryBind( @PathParam("consumer_uuid") @Verify(Consumer.class) String consumerUuid, @QueryParam("service_level") String serviceLevel) { Consumer consumer = consumerCurator.verifyAndLookupConsumer(consumerUuid); if (consumer.getOwner().isAutobindDisabled()) { throw new BadRequestException(i18n.tr("Owner has autobind disabled.")); } List<PoolQuantityDTO> dryRunPools = new ArrayList<PoolQuantityDTO>(); try { consumerBindUtil.validateServiceLevel(consumer.getOwner(), serviceLevel); dryRunPools = entitler.getDryRun(consumer, serviceLevel); if (dryRunPools == null) { return new ArrayList<PoolQuantityDTO>(); } } catch (ForbiddenException fe) { return dryRunPools; } catch (BadRequestException bre) { throw bre; } catch (RuntimeException re) { return dryRunPools; } return dryRunPools; }

Target:
public List<PoolQuantityDTO> dryBind( @PathParam("consumer_uuid") @Verify(Consumer.class) String consumerUuid, @QueryParam("service_level") String serviceLevel) { Consumer consumer = consumerCurator.verifyAndLookupConsumer(consumerUuid); if (consumer.getOwner().isAutobindDisabled()) { throw new BadRequestException(i18n.tr("Owner has autobind disabled.")); } List<PoolQuantity> dryRunPools = new ArrayList<PoolQuantity>(); try { consumerBindUtil.validateServiceLevel(consumer.getOwner(), serviceLevel); dryRunPools = entitler.getDryRun(consumer, serviceLevel); } catch (ForbiddenException fe) { return Collections.<PoolQuantityDTO>emptyList(); } catch (BadRequestException bre) { throw bre; } catch (RuntimeException re) { return Collections.<PoolQuantityDTO>emptyList(); } if (dryRunPools != null) { List<PoolQuantityDTO> dryRunPoolDtos = new ArrayList<PoolQuantityDTO>(); for (PoolQuantity pq : dryRunPools) { dryRunPoolDtos.add(this.translator.translate(pq, PoolQuantityDTO.class)); } return dryRunPoolDtos; } else { return Collections.<PoolQuantityDTO>emptyList(); } }
Source:
DataNodeConfigSourceMetrics(MetricRegistry registry) { setInconsistentCount = registry.counter(MetricRegistry.name(CompositeDataNodeConfigSource.class, "SetInconsistentCount")); getInconsistentCount = registry.counter(MetricRegistry.name(CompositeDataNodeConfigSource.class, "GetInconsistentCount")); listenerInconsistentCount = registry.counter(MetricRegistry.name(CompositeDataNodeConfigSource.class, "ListenerInconsistentCount")); listenerTrendingInconsistentCount = registry.counter(MetricRegistry.name(CompositeDataNodeConfigSource.class, "ListenerTrendingInconsistentCount")); listenerConsistentCount = registry.counter(MetricRegistry.name(CompositeDataNodeConfigSource.class, "ListenerConsistentCount")); }

Target:
DataNodeConfigSourceMetrics(MetricRegistry registry) { setSwallowedErrorCount = registry.counter(MetricRegistry.name(CompositeDataNodeConfigSource.class, "SetSwallowedErrorCount")); getSwallowedErrorCount = registry.counter(MetricRegistry.name(CompositeDataNodeConfigSource.class, "GetSwallowedErrorCount")); addListenerSwallowedErrorCount = registry.counter(MetricRegistry.name(CompositeDataNodeConfigSource.class, "AddListenerSwallowedErrorCount")); listenerInconsistencyCount = registry.counter(MetricRegistry.name(CompositeDataNodeConfigSource.class, "ListenerInconsistencyCount")); listenerTransientInconsistencyCount = registry.counter( MetricRegistry.name(CompositeDataNodeConfigSource.class, "ListenerTransientInconsistencyCount")); }
Source:
private static int getPayloadSize(org.apache.qpid.proton.message.Message msg) { if (msg == null || msg.getBody() == null) { return 0; } if (msg.getBody() instanceof Data) { final Data payloadSection = (Data) msg.getBody(); if (payloadSection == null) { return 0; } final Binary payloadBytes = payloadSection.getValue(); if (payloadBytes == null) { return 0; } return payloadBytes.getLength(); } if (msg.getBody() instanceof AmqpValue) { final AmqpValue amqpValue = (AmqpValue) msg.getBody(); if (amqpValue == null) { return 0; } return amqpValue.getValue().toString().length() * 2; } return 0; }

Target:
private static int getPayloadSize(org.apache.qpid.proton.message.Message msg) { if (msg == null || msg.getBody() == null) { return 0; } final Section bodySection = msg.getBody(); if (bodySection instanceof AmqpValue) { return sizeof(((AmqpValue) bodySection).getValue()); } else if (bodySection instanceof AmqpSequence) { return sizeof(((AmqpSequence) bodySection).getValue()); } else if (bodySection instanceof Data) { final Data payloadSection = (Data) bodySection; final Binary payloadBytes = payloadSection.getValue(); return sizeof(payloadBytes); } else { return 0; } }
Source:
public void topicListeningTestCase() { try { jmsTopicTransportListener.start(topicListeningParameters); logger.info("JMS Transport Listener is starting to listen to the topic " + JMSTestConstants.TOPIC_NAME_1); jmsServer.publishMessagesToTopic(JMSTestConstants.TOPIC_NAME_1); Assert.assertTrue(topicTestMessageProcessor.getCount() > 10, "Expected message count is not received when " + "listening to topic " + JMSTestConstants.TOPIC_NAME_1); jmsTopicTransportListener.stop(); } catch (Exception e) { Assert.fail("Error while listing to topic"); } }

Target:
public void topicListeningTestCase() throws ServerConnectorException, InterruptedException, JMSException { jmsTopicTransportListener.start(topicListeningParameters); logger.info("JMS Transport Listener is starting to listen to the topic " + JMSTestConstants.TOPIC_NAME_1); jmsServer.publishMessagesToTopic(JMSTestConstants.TOPIC_NAME_1); Assert.assertTrue(topicTestMessageProcessor.getCount() > 10, "Expected message count is not received when " + "listening to topic " + JMSTestConstants.TOPIC_NAME_1); jmsTopicTransportListener.stop(); }
Source:
protected void subscribeToInitializeEvent(final DtoUnmarshallerFactory unmarshallerFactory, final MessageBusProvider messageBusProvider, final NotificationManager notificationManager, final EventBus eventBus) { eventBus.addHandler(WsAgentStateEvent.TYPE, new WsAgentStateHandler() { @Override public void onWsAgentStarted(WsAgentStateEvent event) { MessageBus messageBus = messageBusProvider.getMachineMessageBus(); Unmarshallable<LanguageServerInitializeEvent> unmarshaller = unmarshallerFactory .newWSUnmarshaller(LanguageServerInitializeEvent.class); try { messageBus.subscribe("languageserver", new SubscriptionHandler<LanguageServerInitializeEvent>(unmarshaller) { @Override protected void onMessageReceived(LanguageServerInitializeEvent initializeEvent) { register(initializeEvent.getProjectPath(), initializeEvent.getSupportedLanguages(), initializeEvent.getServerCapabilities()); } @Override protected void onErrorReceived(Throwable exception) { notificationManager.notify(exception.getMessage(), StatusNotification.Status.FAIL, StatusNotification.DisplayMode.NOT_EMERGE_MODE); } }); } catch (WebSocketException exception) { Log.error(getClass(), exception); } } @Override public void onWsAgentStopped(WsAgentStateEvent event) { projectToInitResult.clear(); } }); }

Target:
protected void subscribeToInitializeEvent(final DtoUnmarshallerFactory unmarshallerFactory, final MessageBusProvider messageBusProvider, final NotificationManager notificationManager, final EventBus eventBus) { eventBus.addHandler(WsAgentStateEvent.TYPE, new WsAgentStateHandler() { @Override public void onWsAgentStarted(WsAgentStateEvent event) { MessageBus messageBus = messageBusProvider.getMachineMessageBus(); Unmarshallable<LanguageServerInitializeEvent> unmarshaller = unmarshallerFactory.newWSUnmarshaller(LanguageServerInitializeEvent.class); try { messageBus.subscribe("languageserver", new SubscriptionHandler<LanguageServerInitializeEvent>(unmarshaller) { @Override protected void onMessageReceived(LanguageServerInitializeEvent initializeEvent) { register(initializeEvent.getProjectPath(), initializeEvent.getSupportedLanguages(), initializeEvent.getServerCapabilities()); } @Override protected void onErrorReceived(Throwable exception) { notificationManager.notify(exception.getMessage(), FAIL, StatusNotification.DisplayMode.NOT_EMERGE_MODE); } }); } catch (WebSocketException exception) { Log.error(getClass(), exception); } } @Override public void onWsAgentStopped(WsAgentStateEvent event) { projectToInitResult.clear(); } }); }
Source:
protected DBFactory newDbFactory() { DBFactory factory = null; ClassLoader tccl = Thread.currentThread().getContextClassLoader(); for (String className : DB_FACTORY_CLASS_NAMES) { try { factory = (DBFactory) tccl.loadClass(className).newInstance(); break; } catch (Throwable e) { if (log.isDebugEnabled()) log.debugUnableToInstantiateDbFactory(className, e); } } return factory; }

Target:
protected DBFactory newDbFactory() { ImplementationType type = ImplementationType.valueOf(config.getImplementationType()); switch (type) { case JNI: { return Util.<DBFactory>getInstance(JNI_DB_FACTORY_CLASS_NAME, config.getClassLoader()); } case JAVA: { return Util.<DBFactory>getInstance(JAVA_DB_FACTORY_CLASS_NAME, config.getClassLoader()); } default: { for (String className : DB_FACTORY_CLASS_NAMES) { try { return Util.<DBFactory>getInstance(className, config.getClassLoader()); } catch (Throwable e) { if (log.isDebugEnabled()) log.debugUnableToInstantiateDbFactory(className, e); } } } } return null; }
Source:
public Vulnerability getVulnerabilityWithReleaseRelationsByExternalId(String externalId, User sw360User) { try { VulnerabilityService.Iface sw360VulnerabilityClient = getThriftVulnerabilityClient(); sw360VulnerabilityClient.getVulnerabilityWithReleaseRelationsByExternalId(externalId, sw360User); return null; } catch (TException e) { throw new RuntimeException(e); } }

Target:
public Vulnerability getVulnerabilityWithReleaseRelationsByExternalId(String externalId, User sw360User) { try { VulnerabilityService.Iface sw360VulnerabilityClient = getThriftVulnerabilityClient(); final VulnerabilityWithReleaseRelations vulWithRel = sw360VulnerabilityClient.getVulnerabilityWithReleaseRelationsByExternalId(externalId, sw360User); return vulWithRel.getVulnerability(); } catch (TException e) { throw new RuntimeException(e); } }
Source:
public void execute() { for (Motor motor : motors) { try { motor.set(speed); } catch (Exception e) { updateStatus(motor.getName(), SystemStatus.FAIL, e); } } }

Target:
public void execute() { for (Motor motor : motors) { try { motor.set(speed); } catch (Exception e) { updateStatusFail(motor.getName(), e); } VICheck(motor); } }
Source:
public static ArchStrategy getStrategy(String cpuName, Version clusterVersion) { String archName = ArchStrategy.getArchNameFromCpuNameAndVersion(cpuName, clusterVersion); ArchStrategy archStrategy = getStrategy(archName); return archStrategy; }

Target:
public static ArchStrategy getStrategy(String cpuName, Version clusterVersion) { ArchitectureType archType = ArchStrategy.getArchTypeFromCpuNameAndVersion(cpuName, clusterVersion); ArchStrategy archStrategy = getStrategy(archType); return archStrategy; }
Source:
protected void parseTickerFromJsonObject(int requestId, JSONObject jsonObject, Ticker ticker, CheckerInfo checkerInfo) throws Exception { ticker.vol = jsonObject.getDouble("baseVolume"); ticker.high = jsonObject.getDouble("highestBid"); ticker.low = jsonObject.getDouble("lowestAsk"); ticker.last = jsonObject.getDouble("last"); }

Target:
protected void parseTickerFromJsonObject(int requestId, JSONObject jsonObject, Ticker ticker, CheckerInfo checkerInfo) throws Exception { ticker.ask = jsonObject.getDouble("lowestAsk24"); ticker.bid = jsonObject.getDouble("highestBid24"); ticker.vol = jsonObject.getDouble("baseVolume"); ticker.high = jsonObject.getDouble("highestBid"); ticker.low = jsonObject.getDouble("lowestAsk"); ticker.last = jsonObject.getDouble("last"); }
Source:
protected void findGroups(String searchString, AsyncQuery query) { Frontend.getInstance() .runQuery(VdcQueryType.Search, new DirectorySearchParameters("ADGROUP@" + ((ProfileEntry) getProfile().getSelectedItem()).getAuthz() + ": " + searchString, SearchType.DirectoryGroup, (String) getNamespace().getSelectedItem()), query); }

Target:
protected void findGroups(String searchString, AsyncQuery query) { Frontend.getInstance() .runQuery(VdcQueryType.Search, new DirectorySearchParameters("ADGROUP@" + ((ProfileEntry) getProfile().getSelectedItem()).getAuthz() + ": " + searchString, SearchType.DirectoryGroup, getNamespace().getSelectedItem()), query); }
Source:
public void applicationSetVolume(String volume) { final ApplicationSetVolume applicationsetvolume = new ApplicationSetVolume(client, httpUri); if (volume.equals("ON")) { volume = "100"; } if (volume.equals("OFF")) { volume = "0"; } if (volume.equals("DECREASE")) { volume = this.volume.subtract(new BigDecimal(10)).toString(); } if (volume.equals("INCREASE")) { volume = this.volume.add(new BigDecimal(10)).toString(); } this.volume = new BigDecimal(volume); applicationsetvolume.setVolume(this.volume.intValue()); applicationsetvolume.execute(); }

Target:
public void applicationSetVolume(String volume) { final ApplicationSetVolume applicationsetvolume = new ApplicationSetVolume(client, httpUri); if (volume.equals("ON")) { this.volume = new BigDecimal(100); } else if (volume.equals("OFF")) { this.volume = new BigDecimal(0); } else if (volume.equals("DECREASE")) { this.volume = this.volume.subtract(VOLUMESTEP); } else if (volume.equals("INCREASE")) { this.volume = this.volume.add(VOLUMESTEP); } else { try { this.volume = new BigDecimal(volume); } catch (NumberFormatException e) { logger.error("applicationSetVolume cannot parse volume parameter: " + volume); this.volume = BigDecimal.ZERO; } } applicationsetvolume.setVolume(this.volume.intValue()); applicationsetvolume.execute(); }
Source:
protected boolean isEnabledFor(Object[] selectionArray) { Object parent = null; IProfile profile = getProfile(); if (selectionArray.length > 0) { for (Object element2 : selectionArray) { if (element2 instanceof InstalledIUElement) { InstalledIUElement element = (InstalledIUElement) element2; if (parent == null) { parent = element.getParent(element); } else if (parent != element.getParent(element)) { return false; } if (!isSelectable(element.getIU(), profile)) return false; } else { IInstallableUnit iu = ProvUI.getAdapter(element2, IInstallableUnit.class); if (iu == null || !isSelectable(iu)) return false; } } return true; } return false; }

Target:
protected boolean isEnabledFor(Object[] selectionArray) { Object parent = null; IProfile profile = getProfile(); if (selectionArray.length > 0) { for (Object selection : selectionArray) { if (selection instanceof InstalledIUElement) { InstalledIUElement element = (InstalledIUElement) selection; if (parent == null) { parent = element.getParent(element); } else if (parent != element.getParent(element)) { return false; } if (!isSelectable(element.getIU(), profile)) return false; } else { IInstallableUnit iu = ProvUI.getAdapter(selection, IInstallableUnit.class); if (iu == null || !isSelectable(iu)) return false; } } return true; } return false; }
Source:
void setHeight(int height) { cellSize = height; }

Target:
public void setHeight(int height) { cellSize = height; }
Source:
public void onTripRequestComplete(List<Itinerary> itineraries) { Log.i(TAG, "Successfully routed. Itineraries are " + itineraries); if (itineraries.size() > 0) { Fragment fragment = getSupportFragmentManager().findFragmentById(R.id.trip_plan_fragment_container); if (fragment != null && fragment instanceof TripResultsFragment) { Bundle bundle = fragment.getArguments(); bundle.putSerializable(OTPConstants.ITINERARIES, new ArrayList<>(itineraries)); ((TripResultsFragment) fragment).displayNewResults(); return; } TripResultsFragment resultsFragment = new TripResultsFragment(); Bundle bundle = builder.getBundle(); bundle.putSerializable(OTPConstants.ITINERARIES, new ArrayList<>(itineraries)); resultsFragment.setArguments(bundle); FragmentTransaction transaction = getSupportFragmentManager().beginTransaction(); transaction.replace(R.id.trip_plan_fragment_container, resultsFragment); transaction.addToBackStack(null); transaction.commit(); } else { Toast.makeText(this, getString(R.string.tripplanner_error_bogus_parameter), Toast.LENGTH_SHORT).show(); } }

Target:
public void onTripRequestComplete(List<Itinerary> itineraries) { Intent intent = new Intent(this, TripPlanActivity.class) .setAction(Intent.ACTION_MAIN) .addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP) .putExtra(OTPConstants.ITINERARIES, (ArrayList<Itinerary>) itineraries) .putExtra(INTENT_SOURCE, true); startActivity(intent); }
Source:
ScriptExecutingMessageSource(AbstractScriptExecutingMessageProcessor<?> scriptMessageProcessor) { this.scriptMessageProcessor = scriptMessageProcessor; }

Target:
public ScriptExecutingMessageSource(AbstractScriptExecutingMessageProcessor<?> scriptMessageProcessor) { this.scriptMessageProcessor = scriptMessageProcessor; }
Source:
public void run() { AbstractApplicationContext ctx = new ClassPathXmlApplicationContext( "testIp-in-multicast-context.xml", UdpMulticastEndToEndTests.class); while (okToRun) { try { readyToReceive.countDown(); sentFirst.await(); } catch (InterruptedException e) { e.printStackTrace(); } QueueChannel channel = ctx.getBean("udpOutChannel", QueueChannel.class); finalMessage = (Message<byte[]>) channel.receive(); firstReceived.countDown(); try { doneProcessing.await(); } catch (InterruptedException e) { e.printStackTrace(); } } ctx.stop(); ctx.close(); ctx.destroy(); }

Target:
public void run() { AbstractApplicationContext ctx = new ClassPathXmlApplicationContext( "testIp-in-multicast-context.xml", UdpMulticastEndToEndTests.class); while (okToRun) { try { readyToReceive.countDown(); sentFirst.await(); } catch (InterruptedException e) { e.printStackTrace(); } QueueChannel channel = ctx.getBean("udpOutChannel", QueueChannel.class); finalMessage = (Message<byte[]>) channel.receive(); firstReceived.countDown(); try { doneProcessing.await(); } catch (InterruptedException e) { e.printStackTrace(); } } ctx.stop(); ctx.close(); }
Source:
public void invalidate(Object obj, PageMode mode) { IHTMLPage htmlPage = (IHTMLPage) obj; String folderPath = mode.name() + File.separator; String velocityRootPath = VelocityUtil.getVelocityRootPath(); String languageStr = htmlPage.isContent() ? "_" + ((Contentlet) htmlPage).getLanguageId() : ""; String filePath = folderPath + htmlPage.getIdentifier() + languageStr + "." + VelocityType.HTMLPAGE.fileExtension; velocityRootPath += java.io.File.separator; java.io.File f = new java.io.File(velocityRootPath + filePath); f.delete(); DotResourceCache vc = CacheLocator.getVeloctyResourceCache(); vc.remove(ResourceManager.RESOURCE_TEMPLATE + filePath); }

Target:
public void invalidate(Object obj, PageMode mode) { HTMLPageAsset htmlPage =null; if(obj instanceof IHTMLPage) { htmlPage = (HTMLPageAsset) obj; }else if(obj instanceof Contentlet) { htmlPage = APILocator.getHTMLPageAssetAPI().fromContentlet((Contentlet) obj); } if(htmlPage==null) { return; } String folderPath = mode.name() + File.separator; String velocityRootPath = VelocityUtil.getVelocityRootPath(); String languageStr = htmlPage.getLanguageId() +""; String filePath = folderPath + htmlPage.getIdentifier() + languageStr + "." + VelocityType.HTMLPAGE.fileExtension; velocityRootPath += java.io.File.separator; java.io.File f = new java.io.File(velocityRootPath + filePath); f.delete(); DotResourceCache vc = CacheLocator.getVeloctyResourceCache(); vc.remove(ResourceManager.RESOURCE_TEMPLATE + filePath); }
Source:
public void unparseServiceConfigurationWithInstance() { TestCacheLoaderWriter testCacheLoaderWriter = new TestCacheLoaderWriter(); CacheConfiguration<?, ?> cacheConfig = newCacheConfigurationBuilder(Object.class, Object.class, heap(10)).add(new DefaultCacheLoaderWriterConfiguration(testCacheLoaderWriter)).build(); assertThatExceptionOfType(XmlConfigurationException.class).isThrownBy(() -> new DefaultCacheLoaderWriterConfigurationParser().unparseServiceConfiguration(cacheConfig, new CacheType())) .withMessage("%s", "XML translation for instance based intialization for " + "DefaultCacheLoaderWriterConfiguration is not supported"); }

Target:
public void unparseServiceConfigurationWithInstance() { TestCacheLoaderWriter testCacheLoaderWriter = new TestCacheLoaderWriter(); CacheConfiguration<?, ?> cacheConfig = newCacheConfigurationBuilder(Object.class, Object.class, heap(10)).add(new DefaultCacheLoaderWriterConfiguration(testCacheLoaderWriter)).build(); assertThatExceptionOfType(XmlConfigurationException.class).isThrownBy(() -> new DefaultCacheLoaderWriterConfigurationParser().unparseServiceConfiguration(cacheConfig, new CacheType())) .withMessage("%s", "XML translation for instance based initialization for " + "DefaultCacheLoaderWriterConfiguration is not supported"); }
Source:
public EnumWindingOrderTypes getWindingOrder() { return getParameter(PARAM_UNIFY_WINDING_ORDER).as(EnumWindingOrderTypes.class); }

Target:
public EnumWindingOrderTypes getWindingOrder() { EnumWindingOrderTypes value = getParameter(PARAM_UNIFY_WINDING_ORDER) .as(EnumWindingOrderTypes.class); if (value == null) return getDefaultWindingOrder(); else return value; }
Source:
public WebElement getCancelAddInstructorLink() { return browser.driver.findElement(By.id("addInstrCancelLink")); }

Target:
public WebElement getCancelAddInstructorLink() { return browser.driver.findElement(By.id("cancelAddInstructorLink")); }
Source:
public static void changeExternalPrivateCgeoDir(final SettingsActivity fromActivity, final String newExtDir) { final Progress progress = new Progress(true); final Resources res = fromActivity.getResources(); progress.show(fromActivity, res.getString(R.string.init_datadirmove_datadirmove), res.getString(R.string.init_datadirmove_running), ProgressDialog.STYLE_HORIZONTAL, null); AndroidRxUtils.bindActivity(fromActivity, Observable.defer(new Callable<Observable<Boolean>>() { @Override public Observable<Boolean> call() { final File newDataDir = new File(newExtDir, GEOCACHE_DATA_DIR_NAME); final File currentDataDir = new File(getExternalPrivateCgeoDirectory(), GEOCACHE_DATA_DIR_NAME); Log.i("Moving geocache data to " + newDataDir.getAbsolutePath()); final File[] files = currentDataDir.listFiles(); progress.setMaxProgressAndReset(files.length); progress.setProgress(0); for (final File geocacheDataDir : files) { FileUtils.moveTo(geocacheDataDir, newDataDir); progress.incrementProgressBy(1); } Settings.setExternalPrivateCgeoDirectory(newExtDir); Log.i("Ext private c:geo dir was moved to " + newExtDir); externalPrivateCgeoDirectory = new File(newExtDir); return Observable.just(true); } }).subscribeOn(Schedulers.io())).subscribe(new Consumer<Boolean>() { @Override public void accept(final Boolean success) { progress.dismiss(); final String message = success ? fromActivity.getString(R.string.init_datadirmove_success) : fromActivity.getString(R.string.init_datadirmove_failed); Dialogs.message(fromActivity, R.string.init_datadirmove_datadirmove, message); } }); }

Target:
public static void changeExternalPrivateCgeoDir(final SettingsActivity fromActivity, final String newExtDir) { final Progress progress = new Progress(true); progress.show(fromActivity, fromActivity.getString(R.string.init_datadirmove_datadirmove), fromActivity.getString(R.string.init_datadirmove_running), ProgressDialog.STYLE_HORIZONTAL, null); AndroidRxUtils.bindActivity(fromActivity, Observable.defer(new Callable<Observable<Boolean>>() { @Override public Observable<Boolean> call() { final File newDataDir = new File(newExtDir, GEOCACHE_DATA_DIR_NAME); final File currentDataDir = new File(getExternalPrivateCgeoDirectory(), GEOCACHE_DATA_DIR_NAME); Log.i("Moving geocache data to " + newDataDir.getAbsolutePath()); final File[] files = currentDataDir.listFiles(); progress.setMaxProgressAndReset(files.length); progress.setProgress(0); for (final File geocacheDataDir : files) { FileUtils.moveTo(geocacheDataDir, newDataDir); progress.incrementProgressBy(1); } Settings.setExternalPrivateCgeoDirectory(newExtDir); Log.i("Ext private c:geo dir was moved to " + newExtDir); externalPrivateCgeoDirectory = new File(newExtDir); return Observable.just(true); } }).subscribeOn(Schedulers.io())).subscribe(new Consumer<Boolean>() { @Override public void accept(final Boolean success) { progress.dismiss(); final String message = success ? fromActivity.getString(R.string.init_datadirmove_success) : fromActivity.getString(R.string.init_datadirmove_failed); Dialogs.message(fromActivity, R.string.init_datadirmove_datadirmove, message); } }); }
Source:
private void newSnapshot() { if (getWindow() != null) { return; } final UIConstants constants = ConstantsManager.getInstance().getConstants(); GlusterVolumeEntity volumeEntity = getEntity(); boolean scheduleTabVisible = false; if (!(volumeEntity.getSnapshotScheduled())) { scheduleTabVisible = true; } GlusterVolumeSnapshotModel snapshotModel = new GlusterVolumeSnapshotModel(Arrays.asList(GlusterVolumeSnapshotScheduleRecurrence.values()), true, scheduleTabVisible); snapshotModel.setHelpTag(HelpTag.new_volume_snapshot); snapshotModel.setHashName("new_volume_snapshot"); snapshotModel.setTitle(ConstantsManager.getInstance().getConstants().createScheduleVolumeSnapshotTitle()); setWindow(snapshotModel); snapshotModel.getClusterName().setEntity(volumeEntity.getVdsGroupName()); snapshotModel.getVolumeName().setEntity(volumeEntity.getName()); UICommand okCommand = new UICommand("onCreateSnapshot", this); okCommand.setTitle(constants.ok()); okCommand.setIsDefault(true); snapshotModel.getCommands().add(okCommand); UICommand cancelCommand = new UICommand("Cancel", this); cancelCommand.setTitle(constants.cancel()); cancelCommand.setIsCancel(true); snapshotModel.getCommands().add(cancelCommand); }

Target:
private void newSnapshot() { if (getWindow() != null) { return; } final UIConstants constants = ConstantsManager.getInstance().getConstants(); GlusterVolumeEntity volumeEntity = getEntity(); boolean scheduleTabVisible = false; if (!(volumeEntity.getSnapshotScheduled())) { scheduleTabVisible = true; } GlusterVolumeSnapshotModel snapshotModel = new GlusterVolumeSnapshotModel(Arrays.asList(GlusterVolumeSnapshotScheduleRecurrence.values()), true, scheduleTabVisible); snapshotModel.setHelpTag(HelpTag.new_volume_snapshot); snapshotModel.setHashName("new_volume_snapshot"); snapshotModel.setTitle(ConstantsManager.getInstance().getConstants().createScheduleVolumeSnapshotTitle()); setWindow(snapshotModel); snapshotModel.getClusterName().setEntity(volumeEntity.getVdsGroupName()); snapshotModel.getVolumeName().setEntity(volumeEntity.getName()); UICommand okCommand = UICommand.createDefaultOkUiCommand("onCreateSnapshot", this); snapshotModel.getCommands().add(okCommand); UICommand cancelCommand = UICommand.createCancelUiCommand("cancel", this); snapshotModel.getCommands().add(cancelCommand); }
Source:
public static void addMonthsToDate(SSDate date, int months) { if (months != 0) { int month = date.getMonth(); int year = date.getYear(); int resultMonthCount = year * 12 + month + months; int resultYear = resultMonthCount / 12; int resultMonth = resultMonthCount - resultYear * 12; if (resultMonth == 1 && date.getDate() > 28) { if (((resultYear % 4 == 0) && (resultYear % 100 != 0)) || (resultYear % 400 == 0)) { date.setDate(29); } else { date.setDate(28); } } else if ( date.getDate() == 31 && (resultMonth <= 6 && resultMonth % 2 != 0) || (resultMonth > 6 && resultMonth % 2 == 0) ) { date.setDate(30); } date.setMonth(resultMonth); date.setYear(resultYear); } }

Target:
public static void addMonthsToDate(SSDate date, int months) { if (months != 0) { int month = date.getMonth(); int year = date.getYear(); int resultMonthCount = year * 12 + month + months; int resultYear = resultMonthCount / 12; int resultMonth = resultMonthCount - resultYear * 12; if (resultMonth == 1 && date.getDate() > 28) { if (((resultYear % 4 == 0) && (resultYear % 100 != 0)) || (resultYear % 400 == 0)) { date.setDate(29); } else { date.setDate(28); } } else if ( date.getDate() == 31 && (resultMonth == 3 || resultMonth == 5 || resultMonth == 8 || resultMonth == 10) ) { date.setDate(30); } date.setMonth(resultMonth); date.setYear(resultYear); } }
Source:
public void init() { final Image splashImage = new Image(getClass().getResourceAsStream("views/common/splash.png")); final double splashImageAspectRatio = splashImage.getWidth() / splashImage.getHeight(); splashWidth = Screen.getPrimary().getBounds().getWidth() / 3; splashHeight = splashWidth * (1 / splashImageAspectRatio); final ImageView splash = new ImageView(splashImage); splash.setFitWidth(splashWidth); splash.setFitHeight(splashHeight); loadProgress = new ProgressBar(); loadProgress.setPrefWidth(splashWidth); progressText = new Label(tr("Loading ...")); progressText.setFont(new Font(12)); splashLayout = new VBox(); splashLayout.getChildren().addAll(splash, loadProgress, progressText); progressText.setAlignment(Pos.CENTER); splashLayout.setEffect(new DropShadow()); }

Target:
public void init() { final Image splashImage = new Image(getClass().getResourceAsStream("views/common/splash.png")); final double splashImageAspectRatio = splashImage.getWidth() / splashImage.getHeight(); splashWidth = Screen.getPrimary().getBounds().getWidth() / 3; splashHeight = splashWidth * (1 / splashImageAspectRatio); BackgroundSize backgroundSize = new BackgroundSize(splashWidth, splashHeight, false, false, true, true); BackgroundImage backgroundImage = new BackgroundImage(splashImage, BackgroundRepeat.NO_REPEAT, BackgroundRepeat.NO_REPEAT, BackgroundPosition.DEFAULT, backgroundSize); Region spacer = new Region(); VBox.setVgrow(spacer, Priority.ALWAYS); ProgressIndicator loadProgress = new ProgressIndicator(); progressText = new Label(tr("Loading...")); progressText.setFont(new Font(12)); progressText.setPadding(new Insets(20, 5, 10, 5)); progressText.setBackground(Background.EMPTY); progressText.setAlignment(Pos.CENTER); splashLayout = new VBox(spacer, loadProgress, progressText); splashLayout.setPrefSize(splashWidth, splashHeight); splashLayout.setAlignment(Pos.CENTER); splashLayout.setBackground(new Background(backgroundImage)); splashLayout.setEffect(new DropShadow()); }
Source:
public void copyWALFiles(WalPosition startPosition, WalPosition endPosition, long oldWalKey) { try { for (long i = startPosition.fileId; i < endPosition.fileId; i++) { DataInputStream in = bfs.getInputStream(oldWalKey, WAL_FILE_PREFIX + i); DataOutputStream out = bfs.getOutputStream(walKey, WAL_FILE_PREFIX + walFileId); IOUtils.copyLarge(in, out); in.close(); out.close(); walFileId++; } copyWalPart(startPosition, endPosition, oldWalKey); if (maxWalFileSize > 0 && walSize > maxWalFileSize) { writer.close(); writer = null; walFileId++; walSize = 0; } } catch (Exception e) { DTThrowable.wrapIfChecked(e); } }

Target:
public void copyWALFiles(WalPosition startPosition, WalPosition endPosition, long oldWalKey) { try { for (long i = startPosition.fileId; i < endPosition.fileId; i++) { if (bfs.exists(oldWalKey, WAL_FILE_PREFIX + i)) { DataInputStream in = bfs.getInputStream(oldWalKey, WAL_FILE_PREFIX + i); DataOutputStream out = bfs.getOutputStream(walKey, WAL_FILE_PREFIX + walFileId); IOUtils.copyLarge(in, out); in.close(); out.close(); walFileId++; } } copyWalPart(startPosition, endPosition, oldWalKey); if (maxWalFileSize > 0 && walSize > maxWalFileSize) { writer.close(); writer = null; walFileId++; walSize = 0; } } catch (Exception e) { throw Throwables.propagate(e); } }
Source:
public static String longToString(Long transactorId) { return Long.toString(transactorId, 36); }

Target:
public static String longToString(Long transactorId) { return Long.toString(transactorId, Character.MAX_RADIX); }
Source:
public OperatorImplGraph(OperatorSpecGraph specGraph, Context context, Clock clock) { this.clock = clock; StreamConfig streamConfig = new StreamConfig(context.getJobContext().getConfig()); TaskContextImpl taskContext = (TaskContextImpl) context.getTaskContext(); this.jobContextMetadata = new JobContextMetadata(context); Map<SystemStream, Integer> producerTaskCounts = hasIntermediateStreams(specGraph) ? getProducerTaskCountForIntermediateStreams( getStreamToConsumerTasks(jobContextMetadata.getJobModel()), getIntermediateToInputStreamsMap(specGraph, streamConfig)) : Collections.EMPTY_MAP; producerTaskCounts.forEach((stream, count) -> { LOG.info("{} has producer tasks.", stream, count); }); jobContextMetadata.registerObject(EndOfStreamStates.class.getName(), new EndOfStreamStates(taskContext.getTaskModel().getSystemStreamPartitions(), producerTaskCounts)); jobContextMetadata.registerObject(WatermarkStates.class.getName(), new WatermarkStates(taskContext.getTaskModel().getSystemStreamPartitions(), producerTaskCounts, context.getContainerContext().getContainerMetricsRegistry())); specGraph.getInputOperators().forEach((streamId, inputOpSpec) -> { SystemStream systemStream = streamConfig.streamIdToSystemStream(streamId); InputOperatorImpl inputOperatorImpl = (InputOperatorImpl) createAndRegisterOperatorImpl(null, inputOpSpec, systemStream, context); this.inputOperators.put(systemStream, inputOperatorImpl); }); }

Target:
public OperatorImplGraph(OperatorSpecGraph specGraph, Context context, Clock clock) { this.clock = clock; StreamConfig streamConfig = new StreamConfig(context.getJobContext().getConfig()); this.internalTaskContext = new InternalTaskContext(context); Map<SystemStream, Integer> producerTaskCounts = hasIntermediateStreams(specGraph) ? getProducerTaskCountForIntermediateStreams( getStreamToConsumerTasks(internalTaskContext.getJobModel()), getIntermediateToInputStreamsMap(specGraph, streamConfig)) : Collections.EMPTY_MAP; producerTaskCounts.forEach((stream, count) -> { LOG.info("{} has producer tasks.", stream, count); }); internalTaskContext.registerObject(EndOfStreamStates.class.getName(), new EndOfStreamStates( internalTaskContext.getContext().getTaskContext().getTaskModel().getSystemStreamPartitions(), producerTaskCounts)); internalTaskContext.registerObject(WatermarkStates.class.getName(), new WatermarkStates( internalTaskContext.getContext().getTaskContext().getTaskModel().getSystemStreamPartitions(), producerTaskCounts, context.getContainerContext().getContainerMetricsRegistry())); specGraph.getInputOperators().forEach((streamId, inputOpSpec) -> { SystemStream systemStream = streamConfig.streamIdToSystemStream(streamId); InputOperatorImpl inputOperatorImpl = (InputOperatorImpl) createAndRegisterOperatorImpl(null, inputOpSpec, systemStream, context); this.inputOperators.put(systemStream, inputOperatorImpl); }); }
Source:
public SerialMessage getValueMessage() { logger.debug("NODE {}: Creating new message for command SWITCH_ALL_GET", (Object)this.getNode().getNodeId()); SerialMessage result = new SerialMessage(this.getNode().getNodeId(), SerialMessage.SerialMessageClass.SendData, SerialMessage.SerialMessageType.Request, SerialMessage.SerialMessageClass.ApplicationCommandHandler, SerialMessage.SerialMessagePriority.Get); byte[] newPayload = { (byte)this.getNode().getNodeId(), 2, (byte) this.getCommandClass().getKey(), (byte) SWITCH_ALL_GET }; result.setMessagePayload(newPayload); return result; }

Target:
public SerialMessage getValueMessage() { if (!this.isGetSupported) { logger.debug("NODE {}: Node doesn't support get requests", (Object) this.getNode().getNodeId()); return null; } logger.debug( "NODE {}: Creating new message for command SWITCH_ALL_GET", (Object) this.getNode().getNodeId()); SerialMessage result = new SerialMessage(this.getNode().getNodeId(), SerialMessage.SerialMessageClass.SendData, SerialMessage.SerialMessageType.Request, SerialMessage.SerialMessageClass.ApplicationCommandHandler, SerialMessage.SerialMessagePriority.Get); byte[] newPayload = { (byte) this.getNode().getNodeId(), 2, (byte) this.getCommandClass().getKey(), (byte) SWITCH_ALL_GET }; result.setMessagePayload(newPayload); return result; }