Skip to content

Problems with component deletion in performance test #446

@tamasborbas

Description

@tamasborbas

If a component has been removed then its xtuml pair will be dirty. Then in CodeGenerationPhase we try to get dirty xtuml components' pairs but for removed xtuml component it will add null to the list of cpp components. When we iterate on this list and call executeCppCodeGeneration with null cpp component (the pair of the removed xtuml component) the method will throw IllegalArgumentException.

The problematic code snippet from CodeGenerationPhase

val dirtyComponents = changeMonitor.dirtyXTComponents

val cppComponents = dirtyComponents.map[ xtComponent |
    mcToken.toolchainManager.engine.cppComponents.getAllValuesOfcppComponent(xtComponent).head
]
if(mcToken.cppSourceFileContents == null) {
    mcToken.cppSourceFileContents = <CPPSourceFile, CharSequence>newHashMap
}
cppComponents.forEach[ cppComponent |
    val cppSourceFileContentsForComponent = mcToken.toolchainManager.executeCppCodeGeneration(cppComponent)
    mcToken.cppSourceFileContents.putAll(cppSourceFileContentsForComponent)
]

Note: Will high level package deletion also cause problems?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions