auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public MassIndexerImpl(SessionFactoryImplementor sessionFactory, String tenantIdentifier, Class<?>... entities) { this.sessionFactory = sessionFactory; this.tenantIdentifier = tenantIdentifier; HibernateSearchContextService searchContextService = sessionFactory.getServiceRegistry().getService( HibernateSearchContextService.class ); this.mapping = searchContextService.getMapping(); this.rootEntities = toRootEntities( mapping, entities ); <START> ConfigurationService configurationService = sessionFactory.getServiceRegistry().getService( ConfigurationService.class ); <END> HibernateOrmConfigurationPropertySource propertySource = new HibernateOrmConfigurationPropertySource( configurationService ); Boolean jmxEnabled = JMX_ENABLED.get( propertySource ); this.monitor = ( jmxEnabled ) ? new JMXRegistrar.IndexingProgressMonitor() : new SimpleIndexingProgressMonitor(); }</code><technical_language>mentioned, JMX support part of scope. Please remove this commit. configuration properties, read startup, stored somewhere. This kind of runtime configuration parsing necessary all</technical_language>

Target:
public MassIndexerImpl(SessionFactoryImplementor sessionFactory, String tenantIdentifier, Class<?>... entities) { this.sessionFactory = sessionFactory; this.mapping = sessionFactory.getServiceRegistry().getService( HibernateSearchContextService.class ).getMapping(); this.tenantIdentifier = tenantIdentifier; this.rootEntities = toRootEntities( mapping, entities ); this.monitor = new SimpleIndexingProgressMonitor(); }
Source:
<code><START> protected synchronized @Nonnull String getUniqueId() { <END> int result = 0; if (rules != null) { Set<String> col = rules.keySet(); if (col != null) { for (Iterator<String> it = col.iterator(); it.hasNext();) { String rUID = it.next(); if (rUID != null && rUID.startsWith(ID_PREFIX)) { String sNum = rUID.substring(ID_PREFIX.length()); int i; try { i = Integer.parseInt(sNum); result = i > result ? i : result; } catch (NumberFormatException e) { } } } } } if (result > ruleMaxID) { ruleMaxID = result + 1; } else { ++ruleMaxID; } return ID_PREFIX + ruleMaxID; }</code><technical_language>Is this annotation is needed here? This method is part of public api returns null value. If returns a null this is bug in implementation</technical_language>

Target:
protected synchronized @NonNull String getUniqueId() { int result = 0; if (rules != null) { Set<String> col = rules.keySet(); if (col != null) { for (Iterator<String> it = col.iterator(); it.hasNext();) { String rUID = it.next(); if (rUID != null && rUID.startsWith(ID_PREFIX)) { String sNum = rUID.substring(ID_PREFIX.length()); int i; try { i = Integer.parseInt(sNum); result = i > result ? i : result; } catch (NumberFormatException e) { } } } } } if (result > ruleMaxID) { ruleMaxID = result + 1; } else { ++ruleMaxID; } return ID_PREFIX + ruleMaxID; }
Source:
<code>public void run() { PrivilegedExceptionAction<Object> doAsAction = new PrivilegedExceptionAction<Object>() { @Override public Object run() throws HiveSQLException { Hive.set(parentHive); SessionState.setCurrentSessionState(parentSessionState); PerfLogger.setPerfLogger(SessionState.getPerfLogger()); LogUtils.registerLoggingContext(queryState.getConf()); ShimLoader.getHadoopShims().setHadoopQueryContext(queryState.getQueryId()); try { if (asyncPrepare) { prepare(queryState); } runQuery(); } catch (HiveSQLException e) { setOperationException(e); LOG.error("Error running hive query: ", e); } finally { LogUtils.unregisterLoggingContext(); <START> Hive.closeCurrent(); <END> } return null; } }; try { currentUGI.doAs(doAsAction); } catch (Exception e) { setOperationException(new HiveSQLException(e)); LOG.error("Error running hive query as user : " + currentUGI.getShortUserName(), e); } finally { if (ThreadWithGarbageCleanup.currentThread() instanceof ThreadWithGarbageCleanup) { ThreadWithGarbageCleanup currentThread = (ThreadWithGarbageCleanup) ThreadWithGarbageCleanup.currentThread(); currentThread.cacheThreadLocalRawStore(); } } }</code><technical_language>i this check is required gurantee parent hive object is session hive object</technical_language>

Target:
public void run() { PrivilegedExceptionAction<Object> doAsAction = new PrivilegedExceptionAction<Object>() { @Override public Object run() throws HiveSQLException { Hive.set(parentHive, false); SessionState.setCurrentSessionState(parentSessionState); PerfLogger.setPerfLogger(SessionState.getPerfLogger()); LogUtils.registerLoggingContext(queryState.getConf()); ShimLoader.getHadoopShims().setHadoopQueryContext(queryState.getQueryId()); try { if (asyncPrepare) { prepare(queryState); } runQuery(); } catch (HiveSQLException e) { setOperationException(e); LOG.error("Error running hive query: ", e); } finally { LogUtils.unregisterLoggingContext(); Hive hiveDb = Hive.getThreadLocal(); if (hiveDb != null && hiveDb != parentHive) { Hive.closeCurrent(); } } return null; } }; try { currentUGI.doAs(doAsAction); } catch (Exception e) { setOperationException(new HiveSQLException(e)); LOG.error("Error running hive query as user : " + currentUGI.getShortUserName(), e); } finally { if (ThreadWithGarbageCleanup.currentThread() instanceof ThreadWithGarbageCleanup) { ThreadWithGarbageCleanup currentThread = (ThreadWithGarbageCleanup) ThreadWithGarbageCleanup.currentThread(); currentThread.cacheThreadLocalRawStore(); } } }
Source:
<code>private void pollDownloadStatus(StateContext context) { ActionReturnValue returnValue = runInternalAction(ActionType.TransferImageStatus, new TransferImageStatusParameters(getCommandId())); <START> if (returnValue != null && returnValue.getSucceeded()) { <END> ImageTransfer imageTransfer = returnValue.getActionReturnValue(); if (imageTransfer.getBytesTotal() != null && imageTransfer.getBytesTotal().equals(imageTransfer.getBytesSent()) && !imageTransfer.getActive()) { if (!context.entity.getActive()) { ImageTransfer updates = new ImageTransfer(); updates.setPhase(ImageTransferPhase.FINALIZING_SUCCESS); TransferImageStatusParameters parameters = new TransferImageStatusParameters(getCommandId()); parameters.setUpdates(updates); runInternalAction(ActionType.TransferImageStatus, parameters); } } } }</code><technical_language>worth adding a debug log if fails</technical_language>

Target:
private void pollDownloadStatus(StateContext context) { ActionReturnValue returnValue = runInternalAction(ActionType.TransferImageStatus, new TransferImageStatusParameters(getCommandId())); if (returnValue == null || !returnValue.getSucceeded()) { log.debug("Failed to poll download status."); return; } ImageTransfer imageTransfer = returnValue.getActionReturnValue(); if (imageTransfer.getBytesTotal() != null && imageTransfer.getBytesTotal().equals(imageTransfer.getBytesSent()) && !imageTransfer.getActive()) { if (!context.entity.getActive()) { ImageTransfer updates = new ImageTransfer(); updates.setPhase(ImageTransferPhase.FINALIZING_SUCCESS); TransferImageStatusParameters parameters = new TransferImageStatusParameters(getCommandId()); parameters.setUpdates(updates); runInternalAction(ActionType.TransferImageStatus, parameters); } } }
Source:
<code>FactoryBean<MessageHandler> aggregatorFactoryBean(MessageChannel toSink, MessageGroupStore messageGroupStore) { AggregatorFactoryBean aggregatorFactoryBean = new AggregatorFactoryBean(); aggregatorFactoryBean.setCorrelationStrategy( new ExpressionEvaluatingCorrelationStrategy("payload.getClass().name")); <START> String releaseStrategyExpression = "size() == " + properties.getBatchSize(); <END> aggregatorFactoryBean.setReleaseStrategy( new ExpressionEvaluatingReleaseStrategy(releaseStrategyExpression)); aggregatorFactoryBean.setMessageStore(messageGroupStore); aggregatorFactoryBean.setProcessorBean(new DefaultAggregatingMessageGroupProcessor()); aggregatorFactoryBean.setExpireGroupsUponCompletion(true); aggregatorFactoryBean.setSendPartialResultOnExpiry(true); aggregatorFactoryBean.setOutputChannel(toSink); return aggregatorFactoryBean; }</code><technical_language>MessageCountReleaseStrategy for this kind of aggregator</technical_language>

Target:
FactoryBean<MessageHandler> aggregatorFactoryBean(MessageChannel toSink, MessageGroupStore messageGroupStore) { AggregatorFactoryBean aggregatorFactoryBean = new AggregatorFactoryBean(); aggregatorFactoryBean.setCorrelationStrategy( new ExpressionEvaluatingCorrelationStrategy("payload.getClass().name")); aggregatorFactoryBean.setReleaseStrategy(new MessageCountReleaseStrategy(properties.getBatchSize())); aggregatorFactoryBean.setMessageStore(messageGroupStore); aggregatorFactoryBean.setProcessorBean(new DefaultAggregatingMessageGroupProcessor()); aggregatorFactoryBean.setExpireGroupsUponCompletion(true); aggregatorFactoryBean.setSendPartialResultOnExpiry(true); aggregatorFactoryBean.setOutputChannel(toSink); return aggregatorFactoryBean; }
Source:
<code>public Disks list() { GetStorageDomainsByVmTemplateIdQueryParameters queryParams = new GetStorageDomainsByVmTemplateIdQueryParameters(parentId); List<storage_domains> storageDomains = getBackendCollection(storage_domains.class, VdcQueryType.GetStorageDomainsByVmTemplateId, queryParams); List<org.ovirt.engine.core.common.businessentities.Disk> backendCollection = getBackendCollection(queryType, queryParams); <START> for (org.ovirt.engine.core.common.businessentities.Disk disk : backendCollection) { <END> disk.setvm_guid(null); } Disks disks = mapCollection(backendCollection); for (Disk disk : disks.getDisks()) { if (disk.isSetStorageDomains()) { disk.getStorageDomains().getStorageDomains().clear(); } else { disk.setStorageDomains(new StorageDomains()); } for (storage_domains sd : storageDomains) { StorageDomain storageDomain = new StorageDomain(); storageDomain.setId(sd.getId().toString()); disk.getStorageDomains().getStorageDomains().add(storageDomain); } } return disks; }</code><technical_language>for loop twice? reuse for line 33</technical_language>

Target:
public Disks list() { GetStorageDomainsByVmTemplateIdQueryParameters queryParams = new GetStorageDomainsByVmTemplateIdQueryParameters(parentId); List<storage_domains> storageDomains = getBackendCollection(storage_domains.class, VdcQueryType.GetStorageDomainsByVmTemplateId, queryParams); List<org.ovirt.engine.core.common.businessentities.Disk> backendCollection = getBackendCollection(queryType, queryParams); Disks disks = mapCollection(backendCollection, false); for (Disk disk : disks.getDisks()) { disk.setVm(null); if (disk.isSetStorageDomains()) { disk.getStorageDomains().getStorageDomains().clear(); } else { disk.setStorageDomains(new StorageDomains()); } for (storage_domains sd : storageDomains) { StorageDomain storageDomain = new StorageDomain(); storageDomain.setId(sd.getId().toString()); disk.getStorageDomains().getStorageDomains().add(storageDomain); } addLinks(disk); } return disks; }
Source:
<code>private void validateParams() { if(StringUtils.isEmpty(getPassword())) { throw new ServerApiException(ApiErrorCode.PARAM_ERROR, "Empty passwords are not allowed"); } <START> if (getAccountType() == null && getRoleId() == null) { <END> throw new ServerApiException(ApiErrorCode.PARAM_ERROR, "Both account type and role ID are not provided"); } }</code><technical_language>Consider splitting checks give a more precise error message end user. Also, check roleId is greater 0L</technical_language>

Target:
private void validateParams() { if(StringUtils.isEmpty(getPassword())) { throw new ServerApiException(ApiErrorCode.PARAM_ERROR, "Empty passwords are not allowed"); } if (getAccountType() == null && (getRoleId() == null || getRoleId() < 1L)) { throw new ServerApiException(ApiErrorCode.PARAM_ERROR, "Neither account type and role ID are not provided"); } }
Source:
<code>private SemanticFn parseSemanticFn(LispTree tree) { if (tree.isLeaf()) { LispTree newTree = LispTree.proto.newList(); newTree.addChild("ConstantFn"); newTree.addChild(tree.value); tree = newTree; } String name = tree.child(0).value; <START> if (name.equals("lambda") && Grammar.opts.useApplyFn == null) { <END> LispTree newTree = LispTree.proto.newList(); newTree.addChild("JoinFn"); newTree.addChild("betaReduce"); newTree.addChild("forward"); newTree.addChild(LispTree.proto.newList("arg0", tree)); tree = newTree; name = tree.child(0).value; } if (name.equals("lambda") && Grammar.opts.useApplyFn != null) { LispTree newTree = LispTree.proto.newList(); newTree.addChild(Grammar.opts.useApplyFn); newTree.addChild(tree); tree = newTree; name = tree.child(0).value; } if (name.equals("LexiconFn") || name.equals("BridgeFn")) name = "freebase." + name; SemanticFn fn; fn = (SemanticFn) Utils.newInstanceHard(SempreUtils.resolveClassName(name)); if (fn == null) throw new RuntimeException("Invalid SemanticFn name: " + name); fn.init(tree); return fn; }</code><technical_language>more readable combine this block next one...first text for name.equals("lambda"), block, branch useApplyFn is specified</technical_language>

Target:
private SemanticFn parseSemanticFn(LispTree tree) { if (tree.isLeaf()) { LispTree newTree = LispTree.proto.newList(); newTree.addChild("ConstantFn"); newTree.addChild(tree.value); tree = newTree; } String name = tree.child(0).value; if (name.equals("lambda")) { LispTree newTree = LispTree.proto.newList(); if (Grammar.opts.useApplyFn == null) { newTree.addChild("JoinFn"); newTree.addChild("betaReduce"); newTree.addChild("forward"); newTree.addChild(LispTree.proto.newList("arg0", tree)); } else { newTree.addChild(Grammar.opts.useApplyFn); newTree.addChild(tree); } tree = newTree; name = tree.child(0).value; } if (name.equals("LexiconFn") || name.equals("BridgeFn")) name = "freebase." + name; SemanticFn fn; fn = (SemanticFn) Utils.newInstanceHard(SempreUtils.resolveClassName(name)); if (fn == null) throw new RuntimeException("Invalid SemanticFn name: " + name); fn.init(tree); return fn; }
Source:
<code>private OracleChangeEvent generateOracleChangeEvent() throws SQLException, DatastreamException { long scn = _resultSet.getLong(SCN_INDEX); Timestamp ts = _resultSet.getTimestamp(TIMESTAMP_INDEX); long sourceTimestamp = ts.getTime(); OracleChangeEvent oracleChangeEvent = null; try { <START> oracleChangeEvent = generateEvent(_resultSet, _schema, scn, sourceTimestamp, 3); <END> } catch (Exception e) { String msg = String.format("Failed to process ResultSet with SCN: %s, Timestamp: %s, Schema: %s", scn, ts, _schema.getFullName()); LOG.error(msg, e); throw new DatastreamException(msg, e); } return oracleChangeEvent; }</code><technical_language>nit: add a constant for "3"</technical_language>

Target:
private OracleChangeEvent generateOracleChangeEvent() throws SQLException, DatastreamException { long scn = _resultSet.getLong(SCN_COLUMN_INDEX); Timestamp ts = _resultSet.getTimestamp(TIMESTAMP_COLUMN_INDEX); long sourceTimestamp = ts.getTime(); OracleChangeEvent oracleChangeEvent = null; try { oracleChangeEvent = generateEvent(_resultSet, _schema, scn, sourceTimestamp); } catch (Exception e) { String msg = String.format("Failed to process ResultSet with SCN: %s, Timestamp: %s, Schema: %s", scn, ts, _schema.getFullName()); LOG.error(msg, e); throw new DatastreamException(msg, e); } return oracleChangeEvent; }
Source:
<code>public static Float calcNum(Question question, float idSurvey) { if (question == null) { return null; } Value value = question.getValueBySurvey(idSurvey); <START> if(question.getCompulsory() && question.hasParent()){ <END> if (question.isHiddenBySurvey(idSurvey)) { if (value == null) return null; } } if(!question.getCompulsory()) { if (value == null) return null; } Option option=question.getOptionBySurvey(idSurvey); if(option==null){ return 0f; } return question.getNumerator_w()*option.getFactor(); }</code><technical_language>@idelcano is this? 'if' other finally a 'return null'. this code improved? for 'if'</technical_language>

Target:
public static Float calcNum(Question question, float idSurvey) { if (question == null) { return null; } Value value = question.getValueBySurvey(idSurvey); if(value == null){ return null; } Option option=question.getOptionBySurvey(idSurvey); if(option==null){ return 0f; } return question.getNumerator_w()*option.getFactor(); }
Source:
<code><START> private List<Feed> getFeeds(List<FormDataBodyPart> feedForms) { <END> List<Feed> feeds = new ArrayList<>(); if (feedForms != null && !feedForms.isEmpty()) { for (FormDataBodyPart formDataBodyPart : feedForms) { feeds.add(formDataBodyPart.getValueAs(Feed.class)); } } return feeds; }</code><technical_language>single method takes in Class argument</technical_language>

Target:
private List<Entity> getFeeds(List<FormDataBodyPart> feedForms) { List<Entity> feeds = new ArrayList<>(); if (feedForms != null && !feedForms.isEmpty()) { for (FormDataBodyPart formDataBodyPart : feedForms) { feeds.add(formDataBodyPart.getValueAs(Feed.class)); } } return feeds; }
Source:
<code>public void setMaxBreadcrumbs(int maxBreadcrumbs) { <START> impl.setMaxBreadcrumbs(maxBreadcrumbs); <END> }</code><technical_language>Is logic downstream limit this a range of 0 100</technical_language>

Target:
public void setMaxBreadcrumbs(int maxBreadcrumbs) { if (maxBreadcrumbs >= MIN_BREADCRUMBS && maxBreadcrumbs <= MAX_BREADCRUMBS) { impl.setMaxBreadcrumbs(maxBreadcrumbs); } else { getLogger().e(String.format(Locale.US, "Invalid configuration value detected. " + "Option maxBreadcrumbs should be an integer between 0-100. " + "Supplied value is %d", maxBreadcrumbs)); } }
Source:
<code>public boolean askSessionReopeningWithResourceVersionMismatch(AirdResourceVersionMismatchException e) { <START> AskSessionOpeningRunnable askSessionOpeningRunnable = new AskSessionOpeningRunnable(e); Display.getDefault().syncExec(askSessionOpeningRunnable); return askSessionOpeningRunnable.mustReopenSessionIgnoringVersionMismach(); <END> }</code><technical_language>introduce a separate class for a simple case? "return MessageDiaglog.openQuestion()" parameters</technical_language>

Target:
public boolean askSessionReopeningWithResourceVersionMismatch(AirdResourceVersionMismatchException e) { return false; }
Source:
<code>public void testGetGraphQLComplexityDetails() throws APIManagementException { APIIdentifier apiIdentifier = new APIIdentifier("RASIKA", "API1", "1.0.0"); apiMgtDAO.addOrUpdateComplexityDetails(apiIdentifier, getGraphqlComplexityInfoDetails()); <START> apiMgtDAO.getComplexityDetails(apiIdentifier); <END> }</code><technical_language>assert verify executing this method</technical_language>

Target:
public void testGetGraphQLComplexityDetails() throws APIManagementException { APIIdentifier apiIdentifier = new APIIdentifier("RASIKA", "API1", "1.0.0"); apiMgtDAO.addOrUpdateComplexityDetails(apiIdentifier, getGraphqlComplexityInfoDetails()); GraphqlComplexityInfo graphqlComplexityInfo = apiMgtDAO.getComplexityDetails(apiIdentifier); assertEquals(2,graphqlComplexityInfo.getList().size()); }
Source:
<code><START> protected static ReadMapping dateReadMapping() <END> { return longReadMapping(DATE, (resultSet, columnIndex) -> { long localMillis = resultSet.getDate(columnIndex).getTime(); long utcMillis = ISOChronology.getInstance().getZone().getMillisKeepLocal(UTC, localMillis); return MILLISECONDS.toDays(utcMillis); }); }</code><technical_language>public, connectors extend base in package</technical_language>

Target:
public static ReadMapping dateReadMapping() { return longReadMapping(DATE, (resultSet, columnIndex) -> { long localMillis = resultSet.getDate(columnIndex).getTime(); long utcMillis = ISOChronology.getInstance().getZone().getMillisKeepLocal(UTC, localMillis); return MILLISECONDS.toDays(utcMillis); }); }
Source:
<code>private void sleepQuietly( long milliseconds ) { try { sleep( milliseconds ); } catch ( InterruptedException e ) { <START> ; <END> } }</code><technical_language>log this TRACE least? in case need this happening? long formatting in varargs / parameters, avoid cost of formatting a string in case TRACE is turned off</technical_language>

Target:
private void sleepQuietly( long milliseconds ) { try { sleep( milliseconds ); } catch ( InterruptedException e ) { logger.trace( "Sleep interrupted: {}", e ); } }
Source:
<code>public int hashCode() { return new HashCodeBuilder(47, 19) .appendSuper(super.hashCode()) .append(getName()) .append(getClassName()) <START> .append(getXtype()) <END> .toHashCode(); }</code><technical_language>leave out sourceCode styleSheet purpose? fileUploads</technical_language>

Target:
public int hashCode() { return new HashCodeBuilder(47, 19) .appendSuper(super.hashCode()) .append(getName()) .append(getClassName()) .append(getXtype()) .append(getSourceCode()) .append(getStyleSheet()) .toHashCode(); }
Source:
<code>public void addCluster() { ClusterModel model = new ClusterModel(); model.init(false); <START> model.setAddMacPoolCommand(ClusterListModel.createAddMacPoolCommand(this)); <END> setWindow(model); model.setTitle(ConstantsManager.getInstance().getConstants().newClusterTitle()); model.setHelpTag(HelpTag.new_cluster); model.setHashName("new_cluster"); model.setIsNew(true); ArrayList<StoragePool> dataCenters = new ArrayList<>(); dataCenters.add(getEntity()); model.getDataCenter().setItems(dataCenters, getEntity()); model.getDataCenter().setIsChangeable(false); UICommand tempVar = UICommand.createDefaultOkUiCommand("OnAddCluster", this); model.getCommands().add(tempVar); UICommand tempVar2 = UICommand.createCancelUiCommand("Cancel", this); model.getCommands().add(tempVar2); }</code><technical_language>add macPoolCommand 'executeCommand' of this class. I miss something, suppose work..</technical_language>

Target:
public void addCluster() { ClusterModel model = new ClusterModel(); model.init(false); setWindow(model); model.setTitle(ConstantsManager.getInstance().getConstants().newClusterTitle()); model.setHelpTag(HelpTag.new_cluster); model.setHashName("new_cluster"); model.setIsNew(true); ArrayList<StoragePool> dataCenters = new ArrayList<>(); dataCenters.add(getEntity()); model.getDataCenter().setItems(dataCenters, getEntity()); model.getDataCenter().setIsChangeable(false); UICommand tempVar = UICommand.createDefaultOkUiCommand("OnAddCluster", this); model.getCommands().add(tempVar); UICommand tempVar2 = UICommand.createCancelUiCommand("Cancel", this); model.getCommands().add(tempVar2); }
Source:
<code>public byte[] getAPIData() { ByteArrayOutputStream os = new ByteArrayOutputStream(); try { os.write(frameID); <START> os.write(command.getBytes()); <END> os.write(status.getId()); if (commandData != null) os.write(commandData); } catch (IOException e) { e.printStackTrace(); } return os.toByteArray(); }</code><technical_language>Check command status null</technical_language>

Target:
public byte[] getAPIData() { ByteArrayOutputStream os = new ByteArrayOutputStream(); try { os.write(frameID); os.write(command.getBytes()); os.write(status.getId()); if (commandData != null) os.write(commandData); } catch (IOException e) { } return os.toByteArray(); }
Source:
<code><START> public static Map<String, Boolean> validateTrials(List<String> nctIds) throws ParserConfigurationException, SAXException, IOException { <END> Map<String, Boolean> result = new HashMap<>(); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder db = dbf.newDocumentBuilder(); for (String nctId : nctIds) { String strUrl = "<LINK_0>" + nctId + "?displayxml=true"; try { Document doc = db.parse(strUrl); result.put(nctId, true); } catch (IOException e) { result.put(nctId, false); } } return result; }</code><technical_language>need validate nctIds is null</technical_language>

Target:
public static Map<String, Boolean> validateTrials(List<String> nctIds) throws ParserConfigurationException, SAXException, IOException { Map<String, Boolean> result = new HashMap<>(); if (nctIds == null || nctIds.size() == 0) { return result; } DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder db = dbf.newDocumentBuilder(); for (String nctId : nctIds) { String strUrl = "<LINK_0>" + nctId + "?displayxml=true"; try { Document doc = db.parse(strUrl); result.put(nctId, true); } catch (IOException e) { result.put(nctId, false); } } return result; }
Source:
<code>public Map<String, String> getAllMappingUnderPath(String path) { TrieNode curNode; try { curNode = findTrieNode(path, false); } catch (IllegalArgumentException e) { return Collections.emptyMap(); } Map<String, String> resultMap = new HashMap<>(); if (path.substring(path.length() - 1).equals("/")) { path = path.substring(0, path.length() - 1); } addAllAddressesToMapping(resultMap, curNode, path); <START> return resultMap; <END> }</code><technical_language>fast processing, sacrifice some memory usage storing children in current node</technical_language>

Target:
public Map<String, String> getAllMappingUnderPath(String path) { TrieNode curNode; try { curNode = findTrieNode(path, false); } catch (NoSuchElementException e) { return Collections.emptyMap(); } Map<String, String> resultMap = new HashMap<>(); Deque<TrieNode> nodeStack = new ArrayDeque<>(); nodeStack.push(curNode); while (!nodeStack.isEmpty()) { curNode = nodeStack.pop(); if (curNode._isLeaf) { resultMap.put(curNode._name, curNode._realmAddress); } else { for (TrieNode child : curNode._children.values()) { nodeStack.push(child); } } } return resultMap; }
Source:
<code>private void setBackgroundColour() { <START> if (buttonData.type == ValueType.CUSTOM) { <END> butt.setBackgroundColor(ContextCompat.getColor(getContext(), R.color.button_default)); butt.setTextColor(ContextCompat.getColor(getContext(), R.color.steel)); butt.setTypeface(null, Typeface.BOLD); } else { butt.setBackgroundResource(R.drawable.button_background_kitkat); butt.setTextColor(Color.WHITE); butt.setTypeface(null, Typeface.NORMAL); } }</code><technical_language>Superfluous empty line</technical_language>

Target:
private void setBackgroundColour() { switch (buttonData.type) { case CUSTOM: butt.setBackgroundColor(ContextCompat.getColor(getContext(), R.color.button_default)); butt.setTextColor(ContextCompat.getColor(getContext(), R.color.steel)); butt.setTypeface(null, Typeface.BOLD); break; default: butt.setBackgroundResource(R.drawable.button_background_kitkat); butt.setTextColor(Color.WHITE); butt.setTypeface(null, Typeface.NORMAL); break; } }
Source:
<code>private Estimate calculateDistinctValuesCount(Map<String, PartitionStatistics> statisticsByPartitionName, String column) { return summarizePartitionStatistics( statisticsByPartitionName.values(), column, columnStatistics -> { if (columnStatistics.getDistinctValuesCount().isPresent()) { return OptionalDouble.of(columnStatistics.getDistinctValuesCount().getAsLong()); } <START> else if (columnStatistics.getBooleanStatistics().isPresent() && <END> columnStatistics.getBooleanStatistics().get().getFalseCount().isPresent() && columnStatistics.getBooleanStatistics().get().getTrueCount().isPresent() && columnStatistics.getNullsCount().isPresent()) { long falseCount = columnStatistics.getBooleanStatistics().get().getFalseCount().getAsLong(); long trueCount = columnStatistics.getBooleanStatistics().get().getTrueCount().getAsLong(); return OptionalDouble.of((falseCount > 0 ? 1 : 0) + (trueCount > 0 ? 1 : 0)); } else { return OptionalDouble.empty(); } }, DoubleStream::max); }</code><technical_language>"else" is redundant</technical_language>

Target:
private Estimate calculateDistinctValuesCount(Map<String, PartitionStatistics> statisticsByPartitionName, String column) { return summarizePartitionStatistics( statisticsByPartitionName.values(), column, columnStatistics -> { if (columnStatistics.getDistinctValuesCount().isPresent()) { return OptionalDouble.of(columnStatistics.getDistinctValuesCount().getAsLong()); } if (columnStatistics.getBooleanStatistics().isPresent() && columnStatistics.getBooleanStatistics().get().getFalseCount().isPresent() && columnStatistics.getBooleanStatistics().get().getTrueCount().isPresent()) { long falseCount = columnStatistics.getBooleanStatistics().get().getFalseCount().getAsLong(); long trueCount = columnStatistics.getBooleanStatistics().get().getTrueCount().getAsLong(); return OptionalDouble.of((falseCount > 0 ? 1 : 0) + (trueCount > 0 ? 1 : 0)); } return OptionalDouble.empty(); }, DoubleStream::max); }
Source:
<code>private void send(String message, String vmID, boolean removeClient) throws ClientConnectionException{ String hostName = null; try { ReactorClient client = JsonRpcServer.getReactorsMap().get(vmID); <START> hostName = client.getHostname(); <END> client.sendMessage(message.getBytes()); log.debug("sending events message {}", message); }catch (ClientConnectionException e) { log.error("Host {}, failed to send event message {}", hostName, e); } if (removeClient){ JsonRpcServer.removeReactorsMap(vmID); } }</code><technical_language>need hostName log error. Please call there</technical_language>

Target:
private void send(String message, String vmID, boolean removeClient) throws ClientConnectionException{ ReactorClient client = null; try { client = JsonRpcServer.getReactorsMap().get(vmID); client.sendMessage(message.getBytes()); log.debug("sending events message {}", message); }catch (ClientConnectionException e) { log.error("Host {}, failed to send event message {}", client.getHostname(), e); } if (removeClient){ JsonRpcServer.removeReactorsMap(vmID); } }
Source:
<code>private static String initMultiGetEntitiesQuery(EntityKeyMetadata entityKeyMetadata, boolean includeEmbedded) { StringBuilder queryBuilder = new StringBuilder( "MATCH " ); <START> queryBuilder.append( "(owner:" ); <END> queryBuilder.append( ENTITY ); queryBuilder.append( ":" ); appendLabel( entityKeyMetadata, queryBuilder ); queryBuilder.append( ") " ); queryBuilder.append( " WHERE " ); if ( entityKeyMetadata.getColumnNames().length == 1 ) { queryBuilder.append( "owner." ); escapeIdentifier( queryBuilder, entityKeyMetadata.getColumnNames()[0] ); queryBuilder.append( " IN {0}" ); appendGetEmbeddedNodesIfNeeded( includeEmbedded, queryBuilder ); } return queryBuilder.toString(); }</code><technical_language>sense constant declared above</technical_language>

Target:
private static String initMultiGetEntitiesQuery(EntityKeyMetadata entityKeyMetadata, boolean includeEmbedded) { StringBuilder queryBuilder = new StringBuilder( "MATCH " ); queryBuilder.append( "(" ); queryBuilder.append( ENTITY_ALIAS ); queryBuilder.append( ":" ); queryBuilder.append( ENTITY ); queryBuilder.append( ":" ); appendLabel( entityKeyMetadata, queryBuilder ); queryBuilder.append( ") " ); queryBuilder.append( " WHERE " ); if ( entityKeyMetadata.getColumnNames().length == 1 ) { queryBuilder.append( ENTITY_ALIAS ); queryBuilder.append( "." ); escapeIdentifier( queryBuilder, entityKeyMetadata.getColumnNames()[0] ); queryBuilder.append( " IN {0}" ); appendGetEmbeddedNodesIfNeeded( includeEmbedded, queryBuilder ); } return queryBuilder.toString(); }
Source:
<code>private ConnectorInfo createConnector(Server server, String name, IntSupplier port, ServerConnectorConfig config) { final List<ConnectionFactory> factories = new ArrayList<>(); final SslContextFactory ssl; switch (config.getProtocol()) { case "proxy+http": factories.add(new ProxyConnectionFactory()); case "http": ssl = null; break; case "proxy+https": factories.add(new ProxyConnectionFactory()); case "https": ssl = new SuperSadSslContextFactory(name, config); break; default: throw new UnsupportedOperationException(String.format("For connector '%s', unsupported protocol '%s'", name, config.getProtocol())); } final HttpConfiguration httpConfig = new HttpConfiguration(); if (ssl != null || tlsProvider.isPresent()) { <START> httpConfig.addCustomizer(new SecureRequestCustomizer()); <END> } else if (config.isForceSecure()) { httpConfig.addCustomizer(new SuperSecureCustomizer()); } httpConfigCustomizers.ifPresent(c -> c.forEach(h -> h.accept(httpConfig))); final HttpConnectionFactory http = new HttpConnectionFactory(httpConfig); if (ssl != null) { factories.add(new SslConnectionFactory(ssl, http.getProtocol())); } factories.add(http); final ServerConnector connector = new ServerConnector(server, factories.toArray(new ConnectionFactory[factories.size()])); connector.setName(name); connector.setPort(selectPort(port, config)); server.addConnector(connector); return new ServerConnectorInfo(name, connector, config); }</code><technical_language>difference Secure SuperSecure</technical_language>

Target:
private ConnectorInfo createConnector(Server server, String name, IntSupplier port, ServerConnectorConfig config) { final List<ConnectionFactory> factories = new ArrayList<>(); final SslContextFactory ssl; switch (config.getProtocol()) { case "proxy+http": factories.add(new ProxyConnectionFactory()); case "http": ssl = null; break; case "proxy+https": factories.add(new ProxyConnectionFactory()); case "https": ssl = new SuperSadSslContextFactory(name, config); break; default: throw new UnsupportedOperationException(String.format("For connector '%s', unsupported protocol '%s'", name, config.getProtocol())); } final HttpConfiguration httpConfig = new HttpConfiguration(); if (ssl != null || tlsProvider.isPresent()) { httpConfig.addCustomizer(new SecureRequestCustomizer()); } else if (config.isForceSecure()) { httpConfig.addCustomizer(new SuperSecureCustomizer()); } httpConfigCustomizers.ifPresent(c -> c.forEach(h -> h.accept(httpConfig))); final HttpConnectionFactory http = new HttpConnectionFactory(httpConfig); if (ssl != null) { factories.add(new SslConnectionFactory(ssl, http.getProtocol())); } factories.add(http); final ServerConnector connector = new ServerConnector(server, factories.toArray(new ConnectionFactory[factories.size()])); connector.setName(name); connector.setHost(config.getBindAddress()); connector.setPort(selectPort(port, config)); server.addConnector(connector); return new ServerConnectorInfo(name, connector, config); }
Source:
<code>public void testBuildXMLGenerateRemoteRegistryClients() throws CarbonToolsIntegrationTestException { boolean isJarCreated = false; Process process = null; try { File folder = new File(carbonHome + File.separator + "repository" + File.separator + "lib"); File[] listOfFilesBeforeRunAntCommand = folder.listFiles(); String[] cmdArray; if (CarbonCommandToolsUtil.isCurrentOSWindows()) { cmdArray = new String[]{"cmd.exe", "/c", "start", "ant" }; } else { cmdArray = new String[]{"ant"}; } process = CarbonCommandToolsUtil.runScript(carbonHome + File.separator + "bin", cmdArray); long startTime = System.currentTimeMillis(); long timeout = 20000; while ((System.currentTimeMillis() - startTime) < timeout) { File[] listOfFilesAfterRunAntCommand = folder.listFiles(); if (listOfFilesBeforeRunAntCommand != null && listOfFilesAfterRunAntCommand != null) { if (listOfFilesAfterRunAntCommand.length > listOfFilesBeforeRunAntCommand.length) { <START> log.info("Jars created successfully"); <END> isJarCreated = true; break; } } else { if (listOfFilesAfterRunAntCommand != null && listOfFilesAfterRunAntCommand.length > 0) { log.info("Jars created successfully"); isJarCreated = true; break; } } } } finally { if (process != null) { process.destroy(); } } assertTrue(isJarCreated, "Jar not created successfully"); }</code><technical_language>incorrect log message. Ant script copy jars for plugins lib. creating.</technical_language>

Target:
public void testBuildXMLGenerateRemoteRegistryClients() throws CarbonToolsIntegrationTestException { boolean isJarCreated = false; Process process = null; try { File folder = new File(carbonHome + File.separator + "repository" + File.separator + "lib"); File[] listOfFilesBeforeRunAntCommand = folder.listFiles(); String[] cmdArray; if ((CarbonCommandToolsUtil.getCurrentOperatingSystem(). contains(OperatingSystems.WINDOWS.name().toLowerCase()))) { cmdArray = new String[]{"cmd.exe", "/c", "start", "ant" }; } else { cmdArray = new String[]{"ant"}; } process = CarbonCommandToolsUtil.runScript(carbonHome + File.separator + "bin", cmdArray); long startTime = System.currentTimeMillis(); long timeout = 20000; while ((System.currentTimeMillis() - startTime) < timeout) { File[] listOfFilesAfterRunAntCommand = folder.listFiles(); if (listOfFilesBeforeRunAntCommand != null && listOfFilesAfterRunAntCommand != null) { if (listOfFilesAfterRunAntCommand.length > listOfFilesBeforeRunAntCommand.length) { log.info("Jars created successfully"); isJarCreated = true; break; } } else { if (listOfFilesAfterRunAntCommand != null && listOfFilesAfterRunAntCommand.length > 0) { log.info("Jars created successfully"); isJarCreated = true; break; } } } } finally { if (process != null) { process.destroy(); } } assertTrue(isJarCreated, "Jar not created successfully"); }
Source:
<code>public void getVariable() { TestSuiteModel testSuite = new TestSuiteModel(); String variable_indentifier = "variable_indentifier"; String variable_content = "variable_content"; String variable_description = "variable_description"; testSuite.setVariable(variable_indentifier, variable_content, variable_description); assertEquals(1, testSuite.getVariables().size()); assertEquals(variable_indentifier, testSuite.getVariables().get(0).getName()); assertEquals(variable_content, testSuite.getVariables().get(0).getContent()); assertEquals(variable_description, testSuite.getVariables().get(0).getDescription()); assertNotNull(testSuite.getVariable(variable_indentifier)); assertEquals(variable_indentifier, testSuite.getVariable(variable_indentifier).getName()); assertEquals(variable_content, testSuite.getVariable(variable_indentifier).getContent()); assertEquals(variable_description, testSuite.getVariable(variable_indentifier).getDescription()); String variable_indentifier_1 = variable_indentifier + "_1"; String variable_content_1 = variable_content + "_1"; String variable_description_1 = variable_description + "_1"; testSuite.setVariable(variable_indentifier_1, variable_content_1, variable_description_1); assertEquals(2, testSuite.getVariables().size()); assertEquals(variable_indentifier, testSuite.getVariables().get(0).getName()); assertEquals(variable_content, testSuite.getVariables().get(0).getContent()); assertEquals(variable_description, testSuite.getVariables().get(0).getDescription()); assertNotNull(testSuite.getVariable(variable_indentifier_1)); assertEquals(variable_indentifier_1, testSuite.getVariable(variable_indentifier_1).getName()); assertEquals(variable_content_1, testSuite.getVariable(variable_indentifier_1).getContent()); assertEquals(variable_description_1, testSuite.getVariable(variable_indentifier_1).getDescription()); <START> <END> }</code><technical_language>remove empty lines end of methods</technical_language>

Target:
public void getVariable() { TestSuiteModel testSuite = new TestSuiteModel(); for (int index = 0; index < elements; index++) { testSuite.setVariable(variableIndentifier[index], variableContent[index], variableDescription[index]); } for (int index = elements-1; index >= 0; index--) { assertEquals(variableIndentifier[index], testSuite.getVariable(variableIndentifier[index]).getName()); assertEquals(variableContent[index], testSuite.getVariable(variableIndentifier[index]).getContent()); assertEquals(variableDescription[index], testSuite.getVariable(variableIndentifier[index]).getDescription()); } }
Source:
<code>public void testNamespace(){ String testTermEntry = "\n[Term]\n" + "id: SO:0000691\n" + "name: cleaved_initiator_methionine \n" + "namespace: sequence\n" + "alt_id: BS:00067\n" + "def: \"The initiator methionine that has been cleaved from a mature polypeptide sequence.\" [EBIBS:GAR]\n" + "subset: biosapiens\n" + "synonym: \"cleaved initiator methionine\" EXACT []\n" + "synonym: \"init_met\" RELATED [uniprot:feature_type]\n" + "synonym: \"initiator methionine\" RELATED []\n" + "is_a: SO:0100011 ! cleaved_peptide_region\n\n"; OboParser parser = new OboParser(); try { InputStream inStream = new ByteArrayInputStream(testTermEntry.getBytes()); assertNotNull(inStream); BufferedReader oboFile = new BufferedReader ( new InputStreamReader ( inStream ) ); Ontology ontology; ontology = parser.parseOBO(oboFile, "so-xp/subsets/biosapiens", "snippet from biosapiens protein feature ontology"); Set<Term> keys = ontology.getTerms(); assertTrue(keys.size() > 1); assertTrue(ontology.getTerm("SO:0000691").getAnnotation().containsProperty(NAMESPACE)); assertEquals("sequence",ontology.getTerm("SO:0000691").getAnnotation().getProperty(NAMESPACE)); <START> } catch (Exception e) { <END> logger.error("Exception: ", e); fail(e.getMessage()); } }</code><technical_language>throw exception instead of catching. get error instead of a failure, is want exception happens</technical_language>

Target:
public void testNamespace() throws IOException, ParseException { String testTermEntry = "\n[Term]\n" + "id: SO:0000691\n" + "name: cleaved_initiator_methionine \n" + "namespace: sequence\n" + "alt_id: BS:00067\n" + "def: \"The initiator methionine that has been cleaved from a mature polypeptide sequence.\" [EBIBS:GAR]\n" + "subset: biosapiens\n" + "synonym: \"cleaved initiator methionine\" EXACT []\n" + "synonym: \"init_met\" RELATED [uniprot:feature_type]\n" + "synonym: \"initiator methionine\" RELATED []\n" + "is_a: SO:0100011 ! cleaved_peptide_region\n\n"; OboParser parser = new OboParser(); InputStream inStream = new ByteArrayInputStream(testTermEntry.getBytes()); assertNotNull(inStream); BufferedReader oboFile = new BufferedReader ( new InputStreamReader ( inStream ) ); Ontology ontology = parser.parseOBO(oboFile, "so-xp/subsets/biosapiens", "snippet from biosapiens protein feature ontology"); Set<Term> keys = ontology.getTerms(); assertTrue(keys.size() > 1); assertTrue(ontology.getTerm("SO:0000691").getAnnotation().containsProperty(NAMESPACE)); assertEquals("sequence",ontology.getTerm("SO:0000691").getAnnotation().getProperty(NAMESPACE)); }
Source:
<code>public CommandResult<RuleViolation> execute(final GraphCommandExecutionContext context) { final CommandResult<RuleViolation> results = allow(context); if (!results.getType().equals(CommandResult.Type.ERROR)) { <START> final org.kie.workbench.common.stunner.core.graph.Graph graph = getGraph(context); <END> graph.addNode(candidate); getMutableIndex(context).addNode(candidate); } return results; }</code><technical_language>Do need FQCN</technical_language>

Target:
public CommandResult<RuleViolation> execute(final GraphCommandExecutionContext context) { final CommandResult<RuleViolation> results = allow(context); if (!results.getType().equals(CommandResult.Type.ERROR)) { final Graph graph = getGraph(context); graph.addNode(candidate); getMutableIndex(context).addNode(candidate); } return results; }
Source:
<code>public void storeWorkerMetrics(final String workerId, final WorkerMetrics metrics) { if (metricCollectionEnabled) { try { final int numDataBlocksOnWorker = metrics.getNumDataBlocks(); final int numDataBlocksOnDriver = numBlockOwnershipByEvalIdForWorker.get(workerId); if (numDataBlocksOnWorker == numDataBlocksOnDriver) { final DataInfo dataInfo = new DataInfoImpl(numDataBlocksOnWorker); final EvaluatorParameters evaluatorParameters = new WorkerEvaluatorParameters(workerId, dataInfo, metrics); workerEvalParams.computeIfAbsent(workerId, metricList -> new ArrayList<>()).add(evaluatorParameters); } else { LOG.log(Level.FINE, "{0} contains {1} blocks, driver says {2} blocks. Dropping metric.", new Object[]{workerId, numDataBlocksOnWorker, numDataBlocksOnDriver}); } <START> } catch (NullPointerException e) { <END> LOG.log(Level.FINE, "No information about {0}. Dropping metric.", workerId); } } else { LOG.log(Level.FINE, "Metric collection disabled. Dropping metric from {0}", workerId); } }</code><technical_language>explicitly check numBlockOwnershipByEvalIdForWorker contains workerId. for storeServerMetrics()</technical_language>

Target:
public void storeWorkerMetrics(final String workerId, final WorkerMetrics metrics) { if (metricCollectionEnabled) { final int numDataBlocksOnWorker = metrics.getNumDataBlocks(); if (numBlockByEvalIdForWorker != null && numBlockByEvalIdForWorker.containsKey(workerId)) { final int numDataBlocksOnDriver = numBlockByEvalIdForWorker.get(workerId); if (numDataBlocksOnWorker == numDataBlocksOnDriver) { final DataInfo dataInfo = new DataInfoImpl(numDataBlocksOnWorker); final EvaluatorParameters evaluatorParameters = new WorkerEvaluatorParameters(workerId, dataInfo, metrics); synchronized (workerEvalParams) { if (!workerEvalParams.containsKey(workerId)) { workerEvalParams.put(workerId, new ArrayList<>()); } workerEvalParams.get(workerId).add(evaluatorParameters); } } else { LOG.log(Level.FINE, "{0} contains {1} blocks, driver says {2} blocks. Dropping metric.", new Object[]{workerId, numDataBlocksOnWorker, numDataBlocksOnDriver}); } } else { LOG.log(Level.FINE, "No information about {0}. Dropping metric.", workerId); } } else { LOG.log(Level.FINE, "Metric collection disabled. Dropping metric from {0}", workerId); } if (this.dashboardEnabled) { sendMetricsToDashboard(workerId, metrics.toString()); } }
Source:
<code>public void unselect(final int row) { <START> waitForEnabled(); <END> setFocus(); asyncExec(new VoidResult() { public void run() { log.debug(MessageFormat.format("Unselecting row {0} in {1}", row, widget)); widget.deselect(row); lastSelectionItem = widget.getItem(row); } }); notifySelect(); }</code><technical_language>add assertMultiSelect() here? added unselect() also, call this method anyways. if add above, OK call unselect() a SWT.SINGLE table selection yet..</technical_language>

Target:
public void unselect(final int row) { waitForEnabled(); setFocus(); asyncExec(new VoidResult() { public void run() { if (widget.isSelected(row)) { log.debug(MessageFormat.format("Unselecting row {0} in {1}", row, widget)); widget.deselect(row); lastSelectionItem = widget.getItem(row); notifySelect(true); } else { log.debug(MessageFormat.format("Nothing to unselect in {0}", widget)); } } }); }
Source:
<code>public List getResultList() { <START> log.info( "I am called!" ); <END> if ( isResultSet() ) { return resultList; } return null; }</code><technical_language>Remember remove this</technical_language>

Target:
public List getResultList() { if ( isResultSet() ) { return resultList; } return null; }
Source:
<code>public void testUnmarshallTopLevelEventWithEdgesEmptyProperties() throws Exception { Diagram<Graph, Metadata> diagram = unmarshall(marshaller, BPMN_CATCHING_INTERMEDIATE_EVENT_FILE_PATH); assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM); IntermediateTimerEvent emptyEvent = getCatchingIntermediateNodeById(diagram, EMPTY_WITH_OUTGOING_EDGE_TOP_LEVEL_EVENT_ID, HAS_NO_INCOME_EDGE, HAS_OUTGOING_EDGE); assertGeneralSet(emptyEvent.getGeneral(), EMPTY_VALUE, EMPTY_VALUE); <START> assertTimerEventEmpty(emptyEvent.getExecutionSet(), NON_CANCELLING, ""); <END> }</code><technical_language>suggestion assertTimerEventEmpty(emptyEvent.getExecutionSet(), NON_CANCELLING, EMPTY_VALUE);</technical_language>

Target:
public void testUnmarshallTopLevelEventWithEdgesEmptyProperties() throws Exception { Diagram<Graph, Metadata> diagram = unmarshall(marshaller, BPMN_CATCHING_INTERMEDIATE_EVENT_FILE_PATH); assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM); IntermediateTimerEvent emptyEvent = getCatchingIntermediateNodeById(diagram, EMPTY_WITH_OUTGOING_EDGE_TOP_LEVEL_EVENT_ID, HAS_NO_INCOME_EDGE, HAS_OUTGOING_EDGE); assertGeneralSet(emptyEvent.getGeneral(), EMPTY_VALUE, EMPTY_VALUE); assertTimerEventEmpty(emptyEvent.getExecutionSet(), NON_CANCELLING, EMPTY_VALUE); }