Skip to content

C#/Java: Respect manual neutrals, sources and sinks in model generation. #16722

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

Merged
merged 6 commits into from
Jun 25, 2024

Conversation

michaelnebel
Copy link
Contributor

@michaelnebel michaelnebel commented Jun 11, 2024

In this PR we create separate classes of callables to be used by the dataflow configurations for the source, sink and summary callable target classes for model generation. Furthermore, we

  • Ensure that source and sink models are not generated in case there exist a corresponding manual neutral or manual source/sink.
  • Enable all source kinds for the C# source model generator.

IMO we should also avoid lifting sources or sinks the same way we do for summaries due to the following reason (this will also become easier to implement with the different classes for summary, source and sink callables): Contrary to summaries - sources and sinks have more granular kinds. As an example, we could imagine an interface or abstract class for writing to a stream. Depending on the implementation the stream writer could write to maybe the console, a file, a database, a log, etc. which could all be of different kinds (of sinks). That is, if we are lifting sinks we would then get a union of these kinds and the prototype implementation would become a "universal" sink.

Copy link
Contributor

github-actions bot commented Jun 13, 2024

⚠️ The head of this PR and the base branch were compared for differences in the framework coverage reports. A recent commit removed the previously reported differences.

@michaelnebel michaelnebel force-pushed the csharp/modelgensourcesink branch from 9623eff to 6da9b73 Compare June 14, 2024 08:56
Comment on lines 194 to 197
catch (Exception e)
{
ExtractionContext.Logger.LogDebug($"Failed to compute absolute path for relative path in line mapping: '{mappedToPath}': {e}");
}

Check notice

Code scanning / CodeQL

Generic catch clause

Generic catch clause.
Comment on lines 152 to 155
catch (Exception ex) // lgtm[cs/catch-of-all-exceptions]
{
fileLogger.Log(Severity.Error, " Unhandled exception: {0}", ex);
}

Check notice

Code scanning / CodeQL

Generic catch clause

Generic catch clause.
@michaelnebel michaelnebel force-pushed the csharp/modelgensourcesink branch from 6da9b73 to 6e3a5a9 Compare June 17, 2024 13:20
@michaelnebel michaelnebel force-pushed the csharp/modelgensourcesink branch 2 times, most recently from cf6ab3a to ea065b6 Compare June 18, 2024 11:25
@github-actions github-actions bot added the Java label Jun 18, 2024
@michaelnebel michaelnebel force-pushed the csharp/modelgensourcesink branch from ea065b6 to 7fb9780 Compare June 18, 2024 12:05
@@ -1,72 +1,11 @@
private import CaptureModelsSpecific
private import csharp as CS

Check warning

Code scanning / CodeQL

Names only differing by case

CS is only different by casing from Cs that is used elsewhere for modules.
@michaelnebel michaelnebel force-pushed the csharp/modelgensourcesink branch from a2d4063 to 24685a0 Compare June 24, 2024 11:09
@michaelnebel michaelnebel changed the title C#: Improve source model generation. C#/Java: Respect manual neutrals, sources and sinks in model generation. Jun 24, 2024
@michaelnebel michaelnebel marked this pull request as ready for review June 24, 2024 13:45
@michaelnebel michaelnebel requested review from a team as code owners June 24, 2024 13:45
@michaelnebel michaelnebel added the no-change-note-required This PR does not need a change note label Jun 24, 2024
@michaelnebel michaelnebel requested a review from hvitved June 24, 2024 13:47
@michaelnebel
Copy link
Contributor Author

DCA looks good; Java integration test failure is unrelated to this PR.

@michaelnebel michaelnebel merged commit 8dc95ce into github:main Jun 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C# Java no-change-note-required This PR does not need a change note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants