Bug 582828 - Code duplication for transformation caching
Summary: Code duplication for transformation caching
Status: NEW
Alias: None
Product: QVTo
Classification: Modeling
Component: Engine (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-01-04 05:29 EST by Christopher Gerking CLA
Modified: 2024-01-10 05:12 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christopher Gerking CLA 2024-01-04 05:29:53 EST
Code is duplicated between the InternalTransformationExecutor and CstTransformation classes, as both have the ability to cache a QVTo transformation once it has been loaded (including the load diagnostics). This code duplication is unnecessary as the InternalTransformationExecutor refers directly to a CstTransformation and can therefore delegate all caching to it.

In fact, the duplication stems from a flawed refactoring in bug 478006, where InternalTransformationExecutor and CstTransformation were separated into distinct classes.
Comment 1 Christopher Gerking CLA 2024-01-04 06:00:57 EST
Patch pushed to cgerking/582828. In particular, it gets rid of the private doLoad(...) method of InternalTransformationExecutor as it is no longer needed.

Jenkins build #210 succeeded.
Comment 2 Ed Willink CLA 2024-01-04 10:11:30 EST
Releng: /org.eclipse.m2m.qvt.oml/META-INF/MANIFEST.MF needs to advance to 3.10.9

Weird: org.eclipse.m2m.qvt.oml is set to Unix new-line, but CstTransformation.java was mixed Unix/Windows but after your edit is uniformly Windows. When I try with 2023-03 and 2023-12 I get more variations. My OCL Java source files seem to stay consistently Unix.

The changes seem to involve probably trivial changes such as monitor/SubMonitor and field/return. If the tests pass I guess they're ok.
Comment 3 Christopher Gerking CLA 2024-01-10 05:12:34 EST
(In reply to Ed Willink from comment #2)
> Weird: org.eclipse.m2m.qvt.oml is set to Unix new-line, but
> CstTransformation.java was mixed Unix/Windows but after your edit is
> uniformly Windows.
Converted line delimiters of CstTransformation to Unix in commit 6e90b0168ee2846e90cb414c4dbd10710534c9e5.


> Releng: /org.eclipse.m2m.qvt.oml/META-INF/MANIFEST.MF needs to advance to
> 3.10.9 
Advanced in commit bbb9bda03b6ef06c92ce6053887a920d8b0a4e33.


> The changes seem to involve probably trivial changes such as
> monitor/SubMonitor and field/return. If the tests pass I guess they're ok.
Right, the SubMonitor encapsulates some null checks on the IProgressMonitor passed in. Do you mean that fields like fLoadDiagnostic are replaced by local variables? This is a direct consequence of removing the caching – there is still a corresponding fLoadDiagnostic in CstTransformation. And since the executor refers to the CstTransformation using its fTransformation field, there is no need to duplicate the fLoadDiagnostic.