Skip to content

Class diagram generation cannot handle windows template paths #117

Description

@schmalzing

Issue description

Class diagram generation fails on Windows when an absolute Windows path is passed as the FreeMarker template name. The path contains backslashes (), whereas FreeMarker template names must use forward slashes (/) and are interpreted relative to the configured TemplateLoader.

Steps to reproduce:

Run CD2PojoTool with an absolute template path such as:

C:\Users\AUser\Documents\montiarc\generators\ma2jsim\main\cd2pojo\CD2Java.ftl

This causes the following error:

0xA0560 Unable to load template: Template not found ...
Warning: The name contains backslash ("\") instead of slash ("/")

Expected behavior:

The generator should support fully qualified template paths on Windows and load the specified template normally. Windows path separators (\) should be handled correctly, for example by normalizing the path before resolving the template.

Actual behavior:

The absolute Windows path is treated as a FreeMarker template name. Consequently, the already configured MontiCoreFileTemplateLoader for ...\cd2pojo cannot resolve the template.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions