-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft: Implementation for LibraryElementHasher #597
base: develop
Are you sure you want to change the base?
Conversation
Test Results 100 files - 10 100 suites - 10 43s ⏱️ -5s Results for commit 71e3705. ± Comparison against base commit 987566a. This pull request removes 57 tests.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The IHasherInterface, the extension point, and the helper for getting a hasher should be moved to the model plugin, best to the typelibrary. Because we will needed it for different use cases. I would even expect that the TypeEntry will cash the hash values as they are rather expensive to create.
Please also add the copyright headers to the new files. This is the reason the build didn't run through.
if (il.getVisibleOutputVars().size() > 0) { | ||
parts.add("DATAOUTPUTS{"); //$NON-NLS-1$ | ||
for (final VarDeclaration vdec : il.getVisibleOutputVars()) { // TODO getVisibleOutputVars == DataOutputs? | ||
parts.add(String.format("%s:%s", vdec.getName(), vdec.getTypeName())); //$NON-NLS-1$ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are you not using your vardecl method here?
if (il.getVisibleInputVars().size() > 0) { | ||
parts.add("DATAINPUTS{"); //$NON-NLS-1$ | ||
for (final VarDeclaration vdec : il.getVisibleInputVars()) { // TODO VisibleInputVars == DataInputs? | ||
parts.add(String.format("%s:%s", vdec.getName(), vdec.getTypeName())); //$NON-NLS-1$ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are you not using your vardecl method here?
if (il.getEventOutputs().size() > 0) { | ||
parts.add("OUTPUTEVENTS{"); //$NON-NLS-1$ | ||
for (final Event event : il.getEventOutputs()) { | ||
parts.add(String.format("%s:%s", event.getName(), event.getTypeName())); //$NON-NLS-1$ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are you not using your event method here?
if (il.getEventInputs().size() > 0) { | ||
parts.add("INPUTEVENTS{"); //$NON-NLS-1$ | ||
for (final Event event : il.getEventInputs()) { | ||
parts.add(String.format("%s:%s", event.getName(), event.getTypeName())); //$NON-NLS-1$ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are you not using your event method here?
|
||
private void process(final VarDeclaration vdec, final List<String> parts, final String version) { | ||
// TODO handle LocalVariable or MemberVarDeclaration | ||
parts.add(String.format("VDEC:%s:%s", vdec.getName(), //$NON-NLS-1$ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
data type name is missing
parts.add(String.format("ECC{")); //$NON-NLS-1$ | ||
parts.add(String.format("ECStates{")); //$NON-NLS-1$ | ||
for (final ECState ecs : ecc.getECState()) { | ||
parts.add(ecs.getName()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actions are missing
Aside from what @azoitl has already mentioned, I have a few general remarks regarding your current approach:
I would thus like to propose a different approach:
I believe this has the following advantages over the current approach:
|
@mx990 how is your xmi based approach not breaking any existing XMI export? |
I believe the hashing implementation should be entirely independent of the XMI export, although it would certainly be quite similar in how it works. I would propose the following:
[1] see |
I do really like the approach, I'll look into implementing it that way, and see if I hit any snags on the way. The only potential issue I see, is that I don't yet have an idea of how I would introduce detecting "old versions" of the hash with this approach, as that was one of the requested features, but I'll see what I can find. |
Please add unit tests. So please add test cases for every type that can hashed: Are you hashing Structured Data Type ? i cannot find that in the code |
This change will add hashing functionality to the IDE, and automatically adds computed hash values to the output of the Forte NG exporter.