auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected ValidationInfo doValidate() { Component selectedComponent = myContentPanel.getSelectedComponent(); if (selectedComponent != myColorPickerPanel) { boolean isProjectPanel = selectedComponent == myProjectPanel.myComponent; ResourcePanel panel = isProjectPanel ? myProjectPanel : mySystemPanel; ResourceItem element = getSelectedElement(panel.myTreeBuilder, ResourceItem.class); if (element == null) { return new ValidationInfo("Select a color", panel.myComponent); } else { return null; } } if (myResourceNameVisibility == ResourceNameVisibility.HIDE) { return null; } final String errorText = getErrorString(); if (errorText == null) { myResourceNameMessage.setText(""); return null; } else { if (myOverwriteResource) { myResourceNameMessage.setText(errorText); return null; } else { myResourceNameMessage.setText(""); return new ValidationInfo(errorText, myResourceNameField); } } }

Target:
protected ValidationInfo doValidate() { Component selectedComponent = myContentPanel.getSelectedComponent(); if (selectedComponent != myColorPickerPanel) { boolean isProjectPanel = selectedComponent == myProjectPanel.myComponent; ResourcePanel panel = isProjectPanel ? myProjectPanel : mySystemPanel; ResourceItem element = getSelectedElement(panel.myTreeBuilder, ResourceItem.class); setOKActionEnabled(element != null); return null; } if (myResourceNameVisibility == ResourceNameVisibility.HIDE) { setOKActionEnabled(true); return null; } final String errorText = getErrorString(); if (errorText == null) { myResourceNameMessage.setText(""); setOKActionEnabled(true); return null; } if (myOverwriteResource) { myResourceNameMessage.setText(errorText); setOKActionEnabled(true); return null; } myResourceNameMessage.setText(""); setOKActionEnabled(false); return new ValidationInfo(errorText, myResourceNameField); }
Source:
public void testBasics() throws Exception { expectPublishedSegments(1); final AppenderatorDriverRealtimeIndexTask task = makeRealtimeTask(null); final ListenableFuture<TaskStatus> statusFuture = runTask(task); while (task.getFirehose() == null) { Thread.sleep(50); } final TestFirehose firehose = (TestFirehose) task.getFirehose(); firehose.addRows( ImmutableList.of( ImmutableMap.of("t", now.getMillis(), "dim1", "foo", "met1", "1"), ImmutableMap.of("t", now.getMillis(), "dim2", "bar", "met1", 2.0) ) ); firehose.close(); Collection<DataSegment> publishedSegments = awaitSegments(); Assert.assertEquals(2, task.getMetrics().processed()); Assert.assertEquals(0, task.getMetrics().thrownAway()); Assert.assertEquals(0, task.getMetrics().unparseable()); Assert.assertEquals(2, sumMetric(task, null, "rows")); Assert.assertEquals(3, sumMetric(task, null, "met1")); awaitHandoffs(); for (DataSegment publishedSegment : publishedSegments) { Optional<Map.Entry<SegmentDescriptor, Pair<Executor, Runnable>>> optional = handOffCallbacks.entrySet().stream() .filter(e -> e.getKey() .equals( new SegmentDescriptor( publishedSegment .getInterval(), publishedSegment .getVersion(), publishedSegment .getShardSpec() .getPartitionNum() ))) .findFirst(); Assert.assertTrue( publishedSegment + " missing from handoff callbacks: " + handOffCallbacks, optional.isPresent() ); Pair<Executor, Runnable> executorRunnablePair = optional.get().getValue(); executorRunnablePair.lhs.execute(executorRunnablePair.rhs); } handOffCallbacks.clear(); final TaskStatus taskStatus = statusFuture.get(); Assert.assertEquals(TaskState.SUCCESS, taskStatus.getStatusCode()); }

Target:
public void testBasics() throws Exception { expectPublishedSegments(1); final AppenderatorDriverRealtimeIndexTask task = makeRealtimeTask(null); final ListenableFuture<TaskStatus> statusFuture = runTask(task); while (task.getFirehose() == null) { Thread.sleep(50); } final TestFirehose firehose = (TestFirehose) task.getFirehose(); firehose.addRows( ImmutableList.of( ImmutableMap.of("t", now.getMillis(), "dim1", "foo", "met1", "1"), ImmutableMap.of("t", now.getMillis(), "dim2", "bar", "met1", 2.0) ) ); firehose.close(); Collection<DataSegment> publishedSegments = awaitSegments(); Assert.assertEquals(2, task.getMetrics().processed()); Assert.assertEquals(0, task.getMetrics().thrownAway()); Assert.assertEquals(0, task.getMetrics().unparseable()); Assert.assertEquals(2, sumMetric(task, null, "rows")); Assert.assertEquals(3, sumMetric(task, null, "met1")); awaitHandoffs(); for (DataSegment publishedSegment : publishedSegments) { Pair<Executor, Runnable> executorRunnablePair = handOffCallbacks.get( new SegmentDescriptor( publishedSegment.getInterval(), publishedSegment.getVersion(), publishedSegment.getShardSpec().getPartitionNum() ) ); Assert.assertNotNull( publishedSegment + " missing from handoff callbacks: " + handOffCallbacks, executorRunnablePair ); executorRunnablePair.lhs.execute(executorRunnablePair.rhs); } handOffCallbacks.clear(); final TaskStatus taskStatus = statusFuture.get(); Assert.assertEquals(TaskState.SUCCESS, taskStatus.getStatusCode()); }
Source:
public void setUp() { final TestCommandFactory commandFactory = TestCommandFactory.newInstance(newUuid(), ZoneOffset.getDefaultInstance()); this.command = commandFactory.create(newStringValue(newUuid()), Timestamps2.getCurrentTime()); }

Target:
public void setUp() { final TestCommandFactory commandFactory = TestCommandFactory.newInstance(FailureThrowable.class); this.command = commandFactory.create(newUuidValue()); }
Source:
private boolean shouldShowGutenbergEditor() { return AppPrefs.isGutenbergEditorEnabled() && (mIsNewPost || TextUtils.isEmpty(mPost.getContent()) || GutenbergEditorFragment.contentContainsGutenbergBlocks(mPost.getContent())); }

Target:
private boolean shouldShowGutenbergEditor() { return AppPrefs.isGutenbergEditorEnabled() && (mIsNewPost || GutenbergEditorFragment.contentContainsGutenbergBlocks(mPost.getContent())); }
Source:
public void init(final ConsolePopupModel model) { this.model = model; initView(model); initListeners(model); String vmName = model.getModel().getVM().getName(); getView().setVmName(vmName); super.init(model); }

Target:
public void init(final ConsolePopupModel model) { if (model.getModel().isPool()) { throw new IllegalArgumentException("The console popup can not be used with pool, only with VM"); } this.model = model; initView(model); initListeners(model); String vmName = model.getModel().getVM().getName(); getView().setVmName(vmName); super.init(model); }
Source:
private CQMResultDetails buildCqmDetails(CQMCriterionDTO cqmDto) { CQMResultDetails cqmDetails = new CQMResultDetails(); cqmDetails.setCmsId(cqmDto.getCmsId()); cqmDetails.setNqfNumber(cqmDto.getNqfNumber()); cqmDetails.setNumber(cqmDto.getNumber()); cqmDetails.setTitle(cqmDto.getTitle()); cqmDetails.setDescription(cqmDto.getDescription()); cqmDetails.setSuccess(Boolean.FALSE); cqmDetails.getAllVersions().add(cqmDto.getCqmVersion()); cqmDetails.setTypeId(cqmDto.getCqmCriterionTypeId()); return cqmDetails; }

Target:
private CQMResultDetails buildCqmDetails(CQMCriterionDTO cqmDto) { CQMResultDetails cqmDetails = CQMResultDetails.builder() .cmsId(cqmDto.getCmsId()) .nqfNumber(cqmDto.getNqfNumber()) .number(cqmDto.getNumber()) .title(cqmDto.getTitle()) .description(cqmDto.getDescription()) .success(Boolean.FALSE) .typeId(cqmDto.getCqmCriterionTypeId()) .build(); cqmDetails.getAllVersions().add(cqmDto.getCqmVersion()); return cqmDetails; }
Source:
protected void executeCommand() { Guid storageDomainId = getStorageDomainId(); StoragePoolParametersBase parameters = new StoragePoolParametersBase(getStoragePoolId()); ActionReturnValue actionReturnValue = runInternalAction(ActionType.ProcessOvfUpdateForStoragePool, parameters, getContext()); Set<Guid> proccessedDomains = actionReturnValue.getActionReturnValue(); if (!actionReturnValue.getSucceeded()) { return; } if (proccessedDomains != null && proccessedDomains.contains(storageDomainId)) { actionReturnValue = runInternalActionWithTasksContext(ActionType.ProcessOvfUpdateForStorageDomain, createProcessOvfUpdateForDomainParams()); if (actionReturnValue == null || !actionReturnValue.getSucceeded()) { return; } } else { log.info("OVFs update was ignored - nothing to update for storage domain '{}'", storageDomainId); } setSucceeded(true); }

Target:
protected void executeCommand() { Guid storageDomainId = getStorageDomainId(); StoragePoolParametersBase parameters = new StoragePoolParametersBase(getStoragePoolId()); ActionReturnValue actionReturnValue = runInternalAction(ActionType.ProcessOvfUpdateForStoragePool, parameters, getContext()); Set<Guid> proccessedDomains = actionReturnValue.getActionReturnValue(); if (!actionReturnValue.getSucceeded()) { return; } if (proccessedDomains != null && proccessedDomains.contains(storageDomainId)) { actionReturnValue = runInternalActionWithTasksContext(ActionType.ProcessOvfUpdateForStorageDomain, createProcessOvfUpdateForDomainParams()); if (!actionReturnValue.getSucceeded()) { return; } } else { log.info("OVFs update was ignored - nothing to update for storage domain '{}'", storageDomainId); } setSucceeded(true); }
Source:
private void loadImplementationsInJar(final ResolverUtil.Test test, final String parent, final URLConnection connection) { JarFile jarFile = null; try { if (connection != null && connection instanceof JarURLConnection) { JarURLConnection jarURLConnection = (JarURLConnection) connection; jarFile = jarURLConnection.getJarFile(); final Enumeration<JarEntry> entries = jarFile.entries(); while (entries.hasMoreElements()) { JarEntry entry = entries.nextElement(); String name = entry.getName(); if (!entry.isDirectory() && name.startsWith(parent) && this.isTestApplicable(test, name)) { this.addIfMatching(test, name); } } } }catch (IOException e){ LOGGER.error("Could not search JAR file '{}' for classes matching criteria {}, file not found", jarFile, test, e); }finally { if (jarFile != null){ try { jarFile.close(); } catch (IOException ignored) { LOGGER.error("Error closing JAR file stream for {}", jarFile, ignored); } } } }

Target:
private void loadImplementationsInJar(final ResolverUtil.Test test, final String parent, final URLConnection connection) { if (connection != null && connection instanceof JarURLConnection) { JarURLConnection jarURLConnection = (JarURLConnection) connection; try (JarFile jarFile = jarURLConnection.getJarFile()) { final Enumeration<JarEntry> entries = jarFile.entries(); while (entries.hasMoreElements()) { JarEntry entry = entries.nextElement(); String name = entry.getName(); if (!entry.isDirectory() && name.startsWith(parent) && this.isTestApplicable(test, name)) { this.addIfMatching(test, name); } } } catch (IOException e) { LOGGER.error("Could not search JAR file '{}' for classes matching criteria {}, file not found", connection.getURL().getPath(), test, e); } } }
Source:
public Optional<ImmutableSneakingData> with(Key<? extends BaseValue<?>> key, Object value, ImmutableSneakingData immutable) { if (!key.equals(Keys.IS_SNEAKING)) { return Optional.absent(); } final ImmutableSneakingData data = new ImmutableSpongeSneakingData(((Boolean) value).booleanValue()); return Optional.of(data); }

Target:
public Optional<ImmutableSneakingData> with(Key<? extends BaseValue<?>> key, Object value, ImmutableSneakingData immutable) { if (!key.equals(Keys.IS_SNEAKING)) { return Optional.absent(); } final ImmutableSneakingData data = ImmutableDataCachingUtil.getManipulator(ImmutableSpongeSneakingData.class, value); return Optional.of(data); }
Source:
private void validateTypeCombination(OMElement sourceElement, OMElement targetElement) { int sourceType = -1; int targetType = -1; OMAttribute sourceTypeAttr = sourceElement.getAttribute(ATT_TYPE); if (sourceTypeAttr != null && sourceTypeAttr.getAttributeValue() != null) { sourceType = convertTypeToInt(sourceTypeAttr.getAttributeValue()); if (sourceType < 0) { throw new SynapseException("Un-expected source type"); } } else { throw new SynapseException("Source type attribute can't be null"); } OMAttribute targetTypeAttr = targetElement.getAttribute(ATT_TYPE); if (targetTypeAttr != null && targetTypeAttr.getAttributeValue() != null) { targetType = convertTypeToInt(targetTypeAttr.getAttributeValue()); if (targetType < 0) { throw new SynapseException("Un-expected target type"); } if (targetType == 4) { throw new SynapseException("Inline not support for target attribute"); } } else { throw new SynapseException("Target type attribute can't be null"); } if ((sourceType == 1 && targetType == 0) || (sourceType == 1 && targetType == 2) || (sourceType == 2 && targetType == 2) || (sourceType == 0 && targetType == 1) || (sourceType == 1 && targetType == 1) || ( sourceType == 2 && targetType == 1)) { throw new SynapseException("Wrong combination of source and target type"); } }

Target:
private void validateTypeCombination(OMElement sourceElement, OMElement targetElement) { int sourceType = -1; int targetType = -1; OMAttribute sourceTypeAttr = sourceElement.getAttribute(ATT_TYPE); if (sourceTypeAttr != null && sourceTypeAttr.getAttributeValue() != null) { sourceType = convertTypeToInt(sourceTypeAttr.getAttributeValue()); if (sourceType < 0) { throw new SynapseException("Un-expected source type"); } } else { throw new SynapseException("Source type attribute can't be null"); } OMAttribute targetTypeAttr = targetElement.getAttribute(ATT_TYPE); if (targetTypeAttr != null && targetTypeAttr.getAttributeValue() != null) { targetType = convertTypeToInt(targetTypeAttr.getAttributeValue()); if (targetType < 0) { throw new SynapseException("Un-expected target type"); } if (targetType == 4) { throw new SynapseException("Inline not support for target attribute"); } } else { throw new SynapseException("Target type attribute can't be null"); } if (sourceType == 1) { if (targetType == 0 || targetType == 1 || targetType == 2) { throw new SynapseException("Wrong combination of source and target type"); } } else if (sourceType == 2) { if (targetType == 1 || targetType == 2) { throw new SynapseException("Wrong combination of source and target type"); } } else if (sourceType == 0 && targetType == 1) { throw new SynapseException("Wrong combination of source and target type"); } }
Source:
private void setCustomServer(String s) { SharedPreferences userPreferences = AnkiDroidApp.getSharedPrefs(AnkiDroidApp.getInstance()); SharedPreferences.Editor e = userPreferences.edit(); e.putBoolean("useCustomSyncServer", true); e.putString("syncBaseUrl", s); e.commit(); }

Target:
private void setCustomServer(String s) { SharedPreferences userPreferences = AnkiDroidApp.getSharedPrefs(AnkiDroidApp.getInstance()); SharedPreferences.Editor e = userPreferences.edit(); e.putBoolean("useCustomSyncServer", true); e.putString("syncBaseUrl", s); e.apply(); }
Source:
private void InitializeHelpers() { try { for (StorageType storageType : StorageType.values()) { Class<?> actionType = null; try { actionType = Class.forName(String.format("%1$s.%2$s%3$s", ACTION_TYPE_PACKAGE, storageType.name(), ACTION_TYPE_CLASS)); } catch (ClassNotFoundException cnfe) { } if (actionType != null) { Constructor<?> info = actionType.getConstructors()[0]; Object tempVar = info.newInstance(null); IStorageHelper currentHelper = (IStorageHelper) tempVar; if (currentHelper != null) { _helpers.put(storageType, currentHelper); } } } } catch (Exception ex) { throw new ApplicationException("JTODO missing exception", ex); } }

Target:
private void InitializeHelpers() { try { for (StorageType storageType : StorageType.values()) { Class<?> actionType = null; try { actionType = Class.forName(String.format("%1$s.%2$s%3$s", ACTION_TYPE_PACKAGE, storageType.name(), ACTION_TYPE_CLASS)); } catch (ClassNotFoundException cnfe) { } if (actionType != null) { Constructor<?> info = actionType.getConstructors()[0]; IStorageHelper currentHelper = (IStorageHelper) info.newInstance(null); _helpers.put(storageType, currentHelper); } } } catch (Exception ex) { throw new ApplicationException("JTODO missing exception", ex); } }
Source:
protected void postSaveAction(Guid networkGuid, boolean succeeded) { super.postSaveAction(networkGuid, succeeded); if (!succeeded) { return; } Guid networkId = getNetwork().getId() == null ? networkGuid : getNetwork().getId(); ArrayList<VdcActionParametersBase> actionParameters1 = new ArrayList<VdcActionParametersBase>(); for (NetworkClusterModel networkClusterModel : getClustersToAttach()) { Network tempVar = new Network(); tempVar.setId(networkId); tempVar.setName(getNetwork().getName()); NetworkCluster networkCluster = new NetworkCluster(); networkCluster.setRequired(networkClusterModel.isRequired()); tempVar.setCluster(networkCluster); actionParameters1.add(new AttachNetworkToVdsGroupParameter(networkClusterModel.getEntity(), tempVar)); } Frontend.getInstance().runMultipleAction(VdcActionType.AttachNetworkToVdsGroup, actionParameters1); if ((Boolean) getExport().getEntity() && !getSubnetName().getEntity().isEmpty()) { ExternalSubnet subnet = new ExternalSubnet(); subnet.setName(getSubnetName().getEntity()); subnet.setCidr(getSubnetCidr().getEntity()); subnet.setIpVersion(getSubnetIpVersion().getSelectedItem()); actionParameters1 = new ArrayList<VdcActionParametersBase>(); actionParameters1.add(new AddExternalSubnetParameters(subnet, networkId)); Frontend.getInstance().runMultipleAction(VdcActionType.AddSubnetToProvider, actionParameters1); } }

Target:
protected void postSaveAction(Guid networkGuid, boolean succeeded) { super.postSaveAction(networkGuid, succeeded); if (!succeeded) { return; } Guid networkId = getNetwork().getId() == null ? networkGuid : getNetwork().getId(); ArrayList<VdcActionParametersBase> actionParameters1 = new ArrayList<VdcActionParametersBase>(); for (NetworkClusterModel networkClusterModel : getClustersToAttach()) { Network tempVar = new Network(); tempVar.setId(networkId); tempVar.setName(getNetwork().getName()); NetworkCluster networkCluster = new NetworkCluster(); networkCluster.setRequired(networkClusterModel.isRequired()); tempVar.setCluster(networkCluster); actionParameters1.add(new AttachNetworkToVdsGroupParameter(networkClusterModel.getEntity(), tempVar)); } Frontend.getInstance().runMultipleAction(VdcActionType.AttachNetworkToVdsGroup, actionParameters1); if ((Boolean) getExport().getEntity() && !getSubnetName().getEntity().isEmpty()) { ExternalSubnet subnet = new ExternalSubnet(); subnet.setName(getSubnetName().getEntity()); subnet.setCidr(getSubnetCidr().getEntity()); subnet.setIpVersion(getSubnetIpVersion().getSelectedItem()); Frontend.getInstance().runAction(VdcActionType.AddSubnetToProvider, new AddExternalSubnetParameters(subnet, networkId)); } }
Source:
protected void updateUserDistance(User user1, User user2) { if (user1 != null && user2 != null) { double miles = user1.calculateDistance(user2); double feet = MapUtil.convertMilesToFeet(miles); DecimalFormat df = new DecimalFormat("0.00"); String distanceStr = df.format(feet); tvDistance.setText(distanceStr + "ft"); } }

Target:
protected void updateUserDistance(User user1, User user2) { if (user1 != null && user2 != null) { double miles = user1.calculateDistance(user2); double feet = MapUtil.convertMilesToFeet(miles); DecimalFormat df = new DecimalFormat("0.00"); String distanceStr = df.format(feet); tvDistance.setText(distanceStr + getResources().getString(R.string.ft)); } }
Source:
public void uncaughtException(Thread t, Throwable e) { LOG.fatal("Critical thread " + t + " crashed!", e); if (HAUtil.isHAEnabled(rmContext.getYarnConfiguration())) { new Thread() { @Override public void run() { rmContext.getResourceManager().handleTransitionToStandBy(); } }.start(); } else { rmContext.getDispatcher().getEventHandler().handle( new RMFatalEvent(RMFatalEventType.CRITICAL_THREAD_CRASH, new Exception(e))); } }

Target:
public void uncaughtException(Thread t, Throwable e) { LOG.fatal("Critical thread " + t.getName() + " crashed!", e); if (HAUtil.isHAEnabled(rmContext.getYarnConfiguration())) { rmContext.getResourceManager().handleTransitionToStandByInNewThread(); } else { rmContext.getDispatcher().getEventHandler().handle( new RMFatalEvent(RMFatalEventType.CRITICAL_THREAD_CRASH, new Exception(e))); } }
Source:
private void scrapeBean(MBeanServerConnection beanConn, ObjectName mbeanName) { MBeanInfo info; try { info = beanConn.getMBeanInfo(mbeanName); } catch (IOException e) { logScrape(mbeanName.toString(), "getMBeanInfo Fail: " + e); return; } catch (JMException e) { logScrape(mbeanName.toString(), "getMBeanInfo Fail: " + e); return; } MBeanAttributeInfo[] attrInfos = info.getAttributes(); Map<String, MBeanAttributeInfo> name2AttrInfo = new LinkedHashMap<String, MBeanAttributeInfo>(); for (int idx = 0; idx < attrInfos.length; ++idx) { MBeanAttributeInfo attr = attrInfos[idx]; if (!attr.isReadable()) { logScrape(mbeanName, attr, "not readable"); continue; } name2AttrInfo.put(attr.getName(), attr); } AttributeList attributes; try { attributes = beanConn.getAttributes(mbeanName, name2AttrInfo.keySet().toArray(new String[0])); } catch (Exception e) { throw new RuntimeException("Failed to read attributes " + name2AttrInfo.keySet() + " from " + mbeanName); } for (Object o : attributes) { if (o instanceof Attribute) { Attribute attribute = (Attribute) o; MBeanAttributeInfo attr = name2AttrInfo.get(attribute.getName()); logScrape(mbeanName, attr, "process"); processBeanValue( mbeanName.getDomain(), jmxMBeanPropertyCache.getKeyPropertyList(mbeanName), new LinkedList<String>(), attr.getName(), attr.getType(), attr.getDescription(), attribute.getValue() ); }else { throw new IllegalStateException("Item from attribute list is not of type Attribute [" + o.getClass().getSimpleName() + "]: " + o + " from mbean: " + mbeanName); } } }

Target:
private void scrapeBean(MBeanServerConnection beanConn, ObjectName mbeanName) { MBeanInfo info; try { info = beanConn.getMBeanInfo(mbeanName); } catch (IOException e) { logScrape(mbeanName.toString(), "getMBeanInfo Fail: " + e); return; } catch (JMException e) { logScrape(mbeanName.toString(), "getMBeanInfo Fail: " + e); return; } MBeanAttributeInfo[] attrInfos = info.getAttributes(); Map<String, MBeanAttributeInfo> name2AttrInfo = new LinkedHashMap<String, MBeanAttributeInfo>(); for (int idx = 0; idx < attrInfos.length; ++idx) { MBeanAttributeInfo attr = attrInfos[idx]; if (!attr.isReadable()) { logScrape(mbeanName, attr, "not readable"); continue; } name2AttrInfo.put(attr.getName(), attr); } final AttributeList attributes; try { attributes = beanConn.getAttributes(mbeanName, name2AttrInfo.keySet().toArray(new String[0])); } catch (Exception e) { logScrape(mbeanName, name2AttrInfo.keySet(), "Fail: " + e); return; } for (Attribute attribute : attributes.asList()) { MBeanAttributeInfo attr = name2AttrInfo.get(attribute.getName()); logScrape(mbeanName, attr, "process"); processBeanValue( mbeanName.getDomain(), jmxMBeanPropertyCache.getKeyPropertyList(mbeanName), new LinkedList<String>(), attr.getName(), attr.getType(), attr.getDescription(), attribute.getValue() ); } }
Source:
private void parseEvent(CommonTree eventNode) throws ParseException { List<CommonTree> children = eventNode.getChildren(); if (children == null) { throw new ParseException("Empty event block"); } EventDeclaration event = new EventDeclaration(); pushScope(); for (CommonTree child : children) { switch (child.getType()) { case CTFParser.TYPEALIAS: parseTypealias(child); break; case CTFParser.TYPEDEF: parseTypedef(child); break; case CTFParser.CTF_EXPRESSION_TYPE: case CTFParser.CTF_EXPRESSION_VAL: parseEventDeclaration(child, event); break; default: childTypeError(child); break; } } if (!event.nameIsSet()) { throw new ParseException("Event name not set"); } if (!event.streamIsSet()) { CTFStream stream = fTrace.getStream(0L); if (stream != null) { event.setStream(stream); } else { throw new ParseException("Event without stream_id, but there is no stream without id"); } if (fTrace.nbStreams() > 1) { throw new ParseException("Event without stream_id with more than one stream"); } } event.getStream().addEvent(event); popScope(); }

Target:
private void parseEvent(CommonTree eventNode) throws ParseException { List<CommonTree> children = eventNode.getChildren(); if (children == null) { throw new ParseException("Empty event block"); } EventDeclaration event = new EventDeclaration(); pushScope(); for (CommonTree child : children) { switch (child.getType()) { case CTFParser.TYPEALIAS: parseTypealias(child); break; case CTFParser.TYPEDEF: parseTypedef(child); break; case CTFParser.CTF_EXPRESSION_TYPE: case CTFParser.CTF_EXPRESSION_VAL: parseEventDeclaration(child, event); break; default: childTypeError(child); break; } } if (!event.nameIsSet()) { throw new ParseException("Event name not set"); } if (!event.streamIsSet()) { fHasEventsWithUnsetStreams = true; CTFStream stream = fTrace.getStream(0L); if (stream != null) { event.setStream(stream); } else { throw new ParseException("Event without stream_id, but there is no stream without id"); } if (fTrace.nbStreams() > 1) { throw new ParseException("Event without stream_id with more than one stream"); } } event.getStream().addEvent(event); popScope(); }
Source:
protected IsWidget createIcon() { Span iconSpan = new Span(); iconSpan.addStyleName(Styles.FONT_AWESOME_BASE); if (SnapshotStatus.IN_PREVIEW.equals(getEntity().getStatus())) { iconSpan.addStyleName(IconType.EYE.getCssName()); } else if (SnapshotStatus.LOCKED.equals(getEntity().getStatus())) { iconSpan.addStyleName(IconType.LOCK.getCssName()); } else { iconSpan.addStyleName(getEntity().containsMemory() ? IconType.MICROCHIP.getCssName() : IconType.CAMERA.getCssName()); } iconSpan.addStyleName(PatternflyConstants.PF_LIST_VIEW_ICON_SM); iconPanel.add(iconSpan); return iconPanel; }

Target:
protected IsWidget createIcon() { Span iconSpan = new Span(); iconSpan.addStyleName(Styles.FONT_AWESOME_BASE); if (SnapshotStatus.IN_PREVIEW.equals(getEntity().getStatus())) { iconSpan.addStyleName(IconType.EYE.getCssName()); } else if (SnapshotStatus.LOCKED.equals(getEntity().getStatus())) { iconSpan.addStyleName(IconType.LOCK.getCssName()); } else if (getEntity().containsMemory()) { iconSpan.addStyleName(IconType.MICROCHIP.getCssName()); } else { iconSpan.addStyleName(IconType.CAMERA.getCssName()); } iconSpan.addStyleName(PatternflyConstants.PF_LIST_VIEW_ICON_SM); iconPanel.add(iconSpan); return iconPanel; }
Source:
public void beginWindow(long windowId) { totalTuples = normalTuples = laggardsTuples = lateLaggardsTuples = errorTuples = 0; percentNormal = percentLaggards = percentLateLaggards = percentErrors = 0.0f; logger.debug("bufferTime tumblingWindowTime laggardsWindowTime {}, timestampKeyName {}", bufferTime, tumblingWindowTime, laggardsWindowTime, timestampKeyName); }

Target:
public void beginWindow(long windowId) { totalTuples = normalTuples = laggardsTuples = lateLaggardsTuples = errorTuples = 0; }
Source:
public Response postRequest(URI url, String payload, Map<String, String> headers, MediaType mediaType, String metricsPrefix) throws GatewayClientException, GatewayClientRuntimeException { Stopwatch responseTimeStopwatch = Stopwatch.createStarted(); try { Invocation.Builder clientBuilder = client.target(url.toString()) .request(); headers.keySet().forEach(headerKey -> clientBuilder.header(headerKey, headers.get(headerKey))); Response response = clientBuilder .post(Entity.entity(payload, mediaType)); throwIfErrorResponse(response, metricsPrefix); return response; } catch (RuntimeException e) { metricRegistry.counter(metricsPrefix + ".failures").inc(); logger.error(format("Exception for gateway url=%s", url.toString()), e); throw new GatewayClientRuntimeException(url.toString(), e); } finally { responseTimeStopwatch.stop(); metricRegistry.histogram(metricsPrefix + ".response_time").update(responseTimeStopwatch.elapsed(TimeUnit.MILLISECONDS)); } }

Target:
public Response postRequest(URI url, String payload, Map<String, String> headers, MediaType mediaType, String metricsPrefix) throws GatewayClientException, GatewayClientRuntimeException { Stopwatch responseTimeStopwatch = Stopwatch.createStarted(); Response response; try { Invocation.Builder clientBuilder = client.target(url.toString()) .request(); headers.keySet().forEach(headerKey -> clientBuilder.header(headerKey, headers.get(headerKey))); response = clientBuilder .post(Entity.entity(payload, mediaType)); } catch (Exception e) { metricRegistry.counter(metricsPrefix + ".failures").inc(); logger.error(format("Exception for gateway url=%s", url.toString()), e); throw new GatewayClientRuntimeException(url.toString(), e); } finally { responseTimeStopwatch.stop(); metricRegistry.histogram(metricsPrefix + ".response_time").update(responseTimeStopwatch.elapsed(TimeUnit.MILLISECONDS)); } throwIfErrorResponse(response, metricsPrefix); return response; }
Source:
public void visitNode(Tree tree) { AnnotationTree annotation = (AnnotationTree) tree; if (annotation.symbolType().is("org.springframework.security.config.annotation.web.configuration.EnableWebSecurity")) { annotation.arguments().stream() .filter(SpringSecurityDebugModeCheck::isDebugArgument) .map(AssignmentExpressionTree.class::cast) .filter(assignment -> Boolean.TRUE.equals(ConstantUtils.resolveAsBooleanConstant(assignment.expression()))) .findFirst() .ifPresent(assignment -> reportIssue(assignment, "Deactivate Spring Security's debug mode.")); } }

Target:
public void visitNode(Tree tree) { AnnotationTree annotation = (AnnotationTree) tree; if (annotation.symbolType().is("org.springframework.security.config.annotation.web.configuration.EnableWebSecurity")) { annotation.arguments().stream() .map(SpringSecurityDebugModeCheck::getDebugArgument) .filter(Objects::nonNull) .findFirst() .filter(assignment -> Boolean.TRUE.equals(ConstantUtils.resolveAsBooleanConstant(assignment.expression()))) .ifPresent(assignment -> reportIssue(assignment, "Deactivate Spring Security's debug mode.")); } }
Source:
private int computeTimeDelta(List<Metric> list) { int size = list.size(); IntSummaryStatistics stats = IntStream.range(1, size) .map( x -> (int) (list.get(size - x).getTime().getTime() - list.get(size - x - 1).getTime().getTime())) .filter(d -> (d >= 0 && d < minFrequencyMillisAllowed)) .summaryStatistics(); int result = -1; if (stats.getCount() > 5) { result = stats.getMin(); log.info("stats: " + stats); } return result; }

Target:
private int computeTimeDelta(List<Metric> list) { int size = list.size(); IntSummaryStatistics stats = IntStream.range(1, size) .map( x -> (int) (list.get(size - x).getTime().getTime() - list.get(size - x - 1).getTime().getTime())) .filter(d -> (d >= 0 && d < minFrequencyMillisAllowed)) .summaryStatistics(); int result = -1; if (stats.getCount() > BURST_THRESHOLD) { result = stats.getMin(); log.info("stats: " + stats); } return result; }
Source:
void fireEvent(Event event, IAccount account) { listeners.stream().forEach(listener -> { switch (event) { case ACCOUNT_ADDED: listener.accountAdded(this, account); break; case ACCOUNT_REMOVED: listener.accountRemoved(this, account); break; } }); }

Target:
void fireEvent(Event event, IAccount account) { listeners.forEach(listener -> { switch (event) { case ACCOUNT_ADDED: listener.accountAdded(this, account); break; case ACCOUNT_REMOVED: listener.accountRemoved(this, account); break; } }); }
Source:
private void checkLowReplication(long now) { try { for (Entry<WAL, RollController> entry : wals.entrySet()) { WAL wal = entry.getKey(); boolean needRollAlready = entry.getValue().isRollRequested(); if (needRollAlready || !(wal instanceof AbstractFSWAL)) { continue; } ((AbstractFSWAL<?>) wal).checkLogLowReplication(checkLowReplicationInterval); } } catch (Throwable e) { LOG.warn("Failed checking low replication", e); } }

Target:
private void checkLowReplication(long now) { try { for (Entry<WAL, RollController> entry : wals.entrySet()) { WAL wal = entry.getKey(); boolean needRollAlready = entry.getValue().needsRoll(now); if (needRollAlready || !(wal instanceof AbstractFSWAL)) { continue; } ((AbstractFSWAL<?>) wal).checkLogLowReplication(checkLowReplicationInterval); } } catch (Throwable e) { LOG.warn("Failed checking low replication", e); } }
Source:
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) { if (key.equalsIgnoreCase("icons-pack")) { KissApplication.getIconsHandler(this).loadIconsPack(sharedPreferences.getString(key, "default")); } if (key.equalsIgnoreCase("sort-apps")) { final AppProvider provider = KissApplication.getDataHandler(this).getAppProvider(); if (provider != null) { provider.reload(); } } if(key.equalsIgnoreCase("theme")) { requireFullRestart = true; finish(); return; } if (requireRestartSettings.contains(key)) { requireFullRestart = true; } if ("enable-sms-history".equals(key) || "enable-phone-history".equals(key)) { if ("enable-sms-history".equals(key)) { PackageManagerUtils.enableComponent(this, IncomingSmsHandler.class, sharedPreferences.getBoolean(key, false)); } else { PackageManagerUtils.enableComponent(this, IncomingCallHandler.class, sharedPreferences.getBoolean(key, false)); } } }

Target:
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) { if (key.equalsIgnoreCase("icons-pack")) { KissApplication.getIconsHandler(this).loadIconsPack(sharedPreferences.getString(key, "default")); } if (key.equalsIgnoreCase("sort-apps")) { final AppProvider provider = KissApplication.getDataHandler(this).getAppProvider(); if (provider != null) { provider.reload(); } } if (requireRestartSettings.contains(key)) { requireFullRestart = true; if(key.equalsIgnoreCase("theme")) { finish(); return; } } if ("enable-sms-history".equals(key) || "enable-phone-history".equals(key)) { if ("enable-sms-history".equals(key)) { PackageManagerUtils.enableComponent(this, IncomingSmsHandler.class, sharedPreferences.getBoolean(key, false)); } else { PackageManagerUtils.enableComponent(this, IncomingCallHandler.class, sharedPreferences.getBoolean(key, false)); } } }
Source:
public void testSwitchTheme() { final int theme = UserPreferences.getTheme(); int otherTheme; if (theme == de.danoeh.antennapod.core.R.style.Theme_AntennaPod_Light) { otherTheme = R.string.pref_theme_title_dark; } else { otherTheme = R.string.pref_theme_title_light; } clickPreference(R.string.user_interface_label); clickPreference(R.string.pref_set_theme_title); clickPreference(otherTheme); Awaitility.await().atMost(1000, MILLISECONDS) .until(() -> UserPreferences.getTheme() != theme); }

Target:
public void testSwitchTheme() { final int theme = UserPreferences.getTheme(); int otherTheme; if (theme == de.danoeh.antennapod.core.R.style.Theme_AntennaPod_Light) { otherTheme = R.string.pref_theme_title_dark; } else { otherTheme = R.string.pref_theme_title_light; } clickPreference(R.string.user_interface_label); clickPreference(R.string.pref_set_theme_title); onView(withText(otherTheme)).perform(click()); Awaitility.await().atMost(1000, MILLISECONDS) .until(() -> UserPreferences.getTheme() != theme); }
Source:
public WebSocketClientHandshaker13(URI webSocketURL, WebSocketVersion version, String subprotocol, boolean allowExtensions, HttpHeaders customHeaders, int maxFramePayloadLength, boolean performMasking, boolean allowMaskMismatch, long forceCloseTimeoutMillis, boolean absoluteUpgradeUrl) { super(webSocketURL, version, subprotocol, customHeaders, maxFramePayloadLength, forceCloseTimeoutMillis, absoluteUpgradeUrl); this.allowExtensions = allowExtensions; this.performMasking = performMasking; this.allowMaskMismatch = allowMaskMismatch; }

Target:
WebSocketClientHandshaker13(URI webSocketURL, WebSocketVersion version, String subprotocol, boolean allowExtensions, HttpHeaders customHeaders, int maxFramePayloadLength, boolean performMasking, boolean allowMaskMismatch, long forceCloseTimeoutMillis, boolean absoluteUpgradeUrl) { super(webSocketURL, version, subprotocol, customHeaders, maxFramePayloadLength, forceCloseTimeoutMillis, absoluteUpgradeUrl); this.allowExtensions = allowExtensions; this.performMasking = performMasking; this.allowMaskMismatch = allowMaskMismatch; }
Source:
public void testHealthCheck() throws IOException { ProbeManager pm = Framework.getLocalService(ProbeManager.class); Collection<ProbeInfo> healthCheckProbes = pm.getAllContributeToHealthCheckProbeInfos(); assertEquals(1, healthCheckProbes.size()); ProbeInfo probeInfo = (ProbeInfo) healthCheckProbes.toArray()[0]; HealthCheckResult result = pm.getOrRunHealthCheck(); assertTrue(result.isHealthy()); assertTrue(probeInfo.getStatus().isSuccess()); assertEquals("{\"healthCheck\":[{\"runtimeStatus\":[\"ok\"]}]}", result.toJson()); result = pm.getOrRunHealthCheckSingleProbe("runtimeStatus"); assertTrue(result.isHealthy()); assertTrue(probeInfo.getStatus().isSuccess()); assertEquals("{\"healthCheck\":[{\"runtimeStatus\":[\"ok\"]}]}", result.toJson()); }

Target:
public void testHealthCheck() throws IOException { Collection<ProbeInfo> healthCheckProbes = pm.getHealthCheckProbes(); assertEquals(2, healthCheckProbes.size()); HealthCheckResult result = pm.getOrRunHealthChecks(); assertTrue(result.isHealthy()); assertEquals("{\"runtimeStatus\":\"ok\",\"repositoryStatus\":\"ok\"}", result.toJson()); }
Source:
private String checkStage(EDBStage stage) { if (stage != null) { return stage.getStageId(); } return null; }

Target:
private String checkStage(EDBStage stage) { return stage != null ? stage.getStageId() : null; }
Source:
public float[] getEmbeddingVector(String term) throws IOException { IndexSearcher searcher = new IndexSearcher(reader); Query query = AnalyzerUtils.buildBagOfWordsQuery(FIELD_ID, new WhitespaceAnalyzer(), term); TopDocs rs = searcher.search(query, 1); ScoredDocuments docs = ScoredDocuments.fromTopDocs(rs, searcher); byte[] val = docs.documents[0].getField(FIELD_BODY).binaryValue().bytes; FloatBuffer floatBuffer = ByteBuffer.wrap(val).asFloatBuffer(); float[] floatArray = new float[floatBuffer.limit()]; floatBuffer.get(floatArray); return floatArray; }

Target:
public float[] getEmbeddingVector(String term) throws IOException { Query query = AnalyzerUtils.buildBagOfWordsQuery(FIELD_ID, analyzer, term); TopDocs rs = searcher.search(query, 1); ScoredDocuments docs = ScoredDocuments.fromTopDocs(rs, searcher); byte[] val = docs.documents[0].getField(FIELD_BODY).binaryValue().bytes; FloatBuffer floatBuffer = ByteBuffer.wrap(val).asFloatBuffer(); float[] floatArray = new float[floatBuffer.limit()]; floatBuffer.get(floatArray); return floatArray; }
Source:
public PatchRequestScope( String baseUrlEndPoint, String path, String apiVersion, DataStoreTransaction transaction, User user, UUID requestId, ElideSettings elideSettings) { super( baseUrlEndPoint, path, apiVersion, (JsonApiDocument) null, transaction, user, (MultivaluedMap<String, String>) null, (MultivaluedMap<String, String>) null, requestId, elideSettings ); }

Target:
public PatchRequestScope( String baseUrlEndPoint, String path, String apiVersion, DataStoreTransaction transaction, User user, UUID requestId, ElideSettings elideSettings) { super( baseUrlEndPoint, path, apiVersion, (JsonApiDocument) null, transaction, user, (MultivaluedMap<String, String>) null, Collections.emptyMap(), requestId, elideSettings ); }
Source:
protected EmbeddedCacheManager createCacheManager() throws Exception { ConfigurationBuilder c = getDefaultStandaloneCacheConfig(isTransactional()); c.indexing() .enable() .addIndexedEntity(TestEntity.class) .addIndexedEntity(AnotherTestEntity.class) .addProperty(SearchConfig.DIRECTORY_TYPE, SearchConfig.HEAP); return TestCacheManagerFactory.createCacheManager(QueryTestSCI.INSTANCE, c); }

Target:
protected EmbeddedCacheManager createCacheManager() throws Exception { ConfigurationBuilder c = getDefaultStandaloneCacheConfig(isTransactional()); c.indexing() .enable() .addIndexedEntity(TestEntity.class) .addIndexedEntity(AnotherTestEntity.class) .addProperty(SearchConfig.DIRECTORY_TYPE, SearchConfig.HEAP) .addProperty(SearchConfig.ERROR_HANDLER, StaticTestingErrorHandler.class.getName()); return TestCacheManagerFactory.createCacheManager(QueryTestSCI.INSTANCE, c); }
Source:
private long getEstimatedTotalNumberOfLines(String filePath) { long fileSize = new File(filePath).length(); long singleLineSize = bodyFile.length() / MAX_NUMBER_OF_LINES; long headFileSize = headFile.length(); boolean headDeleted = headFile.delete(); boolean bodyDeleted = bodyFile.delete(); if (!headDeleted || !bodyDeleted) { logger.debug("Couldn't delete the temporary files used for the estimation: and {}", headFile, bodyFile); } long estimatedTotalNumberOfLines = ((fileSize - headFileSize) / singleLineSize); return estimatedTotalNumberOfLines; }

Target:
private long getEstimatedTotalNumberOfLines(String filePath) { long fileSize = new File(filePath).length(); long singleLineSize = bodyFile.length() / MAX_NUMBER_OF_LINES; long headFileSize = headFile.length(); headFile.deleteOnExit(); bodyFile.deleteOnExit(); long estimatedTotalNumberOfLines = ((fileSize - headFileSize) / singleLineSize); return estimatedTotalNumberOfLines; }
Source:
public void refreshModel() { modifiedSeveritySinceLastRun.clear(); Set<IResource> localDirty = new HashSet<>(dirty); synchronized (this.dirty) { this.dirty.removeAll(localDirty); } removeFromCache(localDirty); modifiedSeveritySinceLastRun.addAll(localDirty); try { for (IMarker marker : WorkbenchNavigatorPlugin.getWorkspace().getRoot().findMarkers(IMarker.PROBLEM, true, IResource.DEPTH_INFINITE)) { IResource resource = marker.getResource(); if (resource != null && (neverRan || localDirty.contains(resource))) { int severity = marker.getAttribute(IMarker.SEVERITY, 0); if (severity >= 0) { propagateSeverityToCache(resource, severity); } } } neverRan = false; } catch (CoreException e) { WorkbenchNavigatorPlugin.log(e.getMessage(), new Status(IStatus.ERROR, WorkbenchNavigatorPlugin.PLUGIN_ID, e.getMessage(), e)); throw new RuntimeException(e); } catch (CancellationException e) { } }

Target:
public void refreshModel() { modifiedSeveritySinceLastRun.clear(); Set<IResource> localDirty = null; synchronized (this.dirty) { localDirty = new HashSet<>(dirty); this.dirty.removeAll(localDirty); } removeFromCache(localDirty); modifiedSeveritySinceLastRun.addAll(localDirty); try { for (IMarker marker : WorkbenchNavigatorPlugin.getWorkspace().getRoot().findMarkers(IMarker.PROBLEM, true, IResource.DEPTH_INFINITE)) { IResource resource = marker.getResource(); if (resource != null && (neverRan || localDirty.contains(resource))) { int severity = marker.getAttribute(IMarker.SEVERITY, -1); if (severity >= 0) { propagateSeverityToCache(resource, severity); } } } neverRan = false; } catch (CoreException e) { WorkbenchNavigatorPlugin.log(e.getMessage(), new Status(IStatus.ERROR, WorkbenchNavigatorPlugin.PLUGIN_ID, e.getMessage(), e)); throw new RuntimeException(e); } catch (CancellationException e) { } }
Source:
private static <E> View<E> load(JobContext jobContext) { Configuration conf = Hadoop.JobContext.getConfiguration.invoke(jobContext); Class<E> type = getType(jobContext); String outputUri = conf.get(KITE_OUTPUT_URI); DefaultConfiguration.set(conf); return Datasets.<E, View<E>>load(outputUri, type); }

Target:
private static <E> View<E> load(JobContext jobContext) { Configuration conf = Hadoop.JobContext.getConfiguration.invoke(jobContext); Class<E> type = getType(jobContext); String outputUri = conf.get(KITE_OUTPUT_URI); return Datasets.<E, View<E>>load(outputUri, type); }
Source:
public static void sendIMCOutdatedMessage() { NBTTagCompound tag = new NBTTagCompound(); tag.setString("newVersion", newVersion); tag.setString("updateUrl", "<LINK_2>"); tag.setBoolean("isDirectLink", false); String changeLogString = ""; for (String changeLogLine : changeLog) { changeLogString = changeLogString + changeLogLine + "\n"; } tag.setString("changeLog", changeLogString); sentIMCMessage = FMLInterModComms.sendMessage("VersionChecker", "addUpdate", tag); }

Target:
public static void sendIMCOutdatedMessage() { if (Loader.isModLoaded("VersionChecker")) { NBTTagCompound tag = new NBTTagCompound(); tag.setString("oldVersion", LogisticsPipes.VERSION); tag.setString("newVersion", newVersion); tag.setString("updateUrl", "<LINK_1>"); tag.setBoolean("isDirectLink", false); StringBuilder stringBuilder = new StringBuilder(); for (String changeLogLine : changeLog) { stringBuilder.append(changeLogLine).append("\n"); } tag.setString("changeLog", stringBuilder.toString()); FMLInterModComms.sendRuntimeMessage("LogisticsPipes", "VersionChecker", "addUpdate", tag); sentIMCMessage = true; } }
Source:
public Type getValidatedType() { return TypeHelper.extractType( validatorClass ); }

Target:
public Type getValidatedType() { return validatedType; }
Source:
public long fastForwardDataBase() throws IOException { PlayBackListener listener = new PlayBackListener(){ public void onTxnLoaded(TxnHeader hdr,Record txn){ Request r = new Request(0, hdr.getCxid(), hdr.getType(), hdr, txn, hdr.getZxid()); addCommittedProposal(r); } }; long zxid = snapLog.fastForwardFromEdits(dataTree, sessionsWithTimeouts, listener); initialized = true; return zxid; }

Target:
public long fastForwardDataBase() throws IOException { long zxid = snapLog.fastForwardFromEdits(dataTree, sessionsWithTimeouts, commitProposalPlaybackListener); initialized = true; return zxid; }
Source:
private void registerContainerDeletionSyncTask(StateMachineEngine engine) { Map<String, TaskFactory> taskFactoryMap = new HashMap<>(); taskFactoryMap.put(String.format("%s", CloudContainerDeletionSyncTask.class.getSimpleName()), new TaskFactory() { @Override public Task createNewTask(TaskCallbackContext context) { return new CloudContainerDeletionSyncTask(accountService, storeConfig.storeContainerDeletionRetentionDays, cloudDestination); } }); if (!taskFactoryMap.isEmpty()) { engine.registerStateModelFactory(TaskConstants.STATE_MODEL_NAME, new TaskStateModelFactory(manager, taskFactoryMap)); } }

Target:
private void registerContainerDeletionSyncTask(StateMachineEngine engine) { Map<String, TaskFactory> taskFactoryMap = new HashMap<>(); taskFactoryMap.put(DeprecatedContainerCloudSyncTask.class.getSimpleName(), new TaskFactory() { @Override public Task createNewTask(TaskCallbackContext context) { return new DeprecatedContainerCloudSyncTask(accountService, storeConfig.storeContainerDeletionRetentionDays, cloudDestination); } }); if (!taskFactoryMap.isEmpty()) { engine.registerStateModelFactory(TaskConstants.STATE_MODEL_NAME, new TaskStateModelFactory(manager, taskFactoryMap)); } }