Closed lhstrh closed 4 months ago
The recent changes improve the handling of resources within the GeneratorBase
and GeneratorUtils
classes by switching from List
to Set
data structures. This change helps in preventing duplicate entries, thus ensuring more efficient resource management. Additionally, a new method for managing inherited resources in reactors is introduced. A new test file is also added to verify these updates within a specific target.
File | Change Summary |
---|---|
core/.../GeneratorBase.java |
Changed allResources from List to Set , updated method signatures to use Set instead of List . |
core/.../GeneratorUtils.java |
Replaced ArrayList with LinkedHashSet , switched methods to use Set instead of List , added addInheritedResources method. |
test/C/.../ImportedCMakeInclude.lf |
Introduced a new target file defining a reactor for testing the generation functionalities. |
sequenceDiagram
participant User
participant GeneratorBase
participant GeneratorUtils
participant Reactor
User->>GeneratorBase: Initiate resource processing
GeneratorBase->>GeneratorUtils: Call getResources()
GeneratorUtils->>GeneratorUtils: Fetch resources as Set
GeneratorUtils-->>GeneratorBase: Return Set<Resource>
GeneratorBase->>GeneratorUtils: Call transformConflictingConnectionsInModalReactors(Set<Resource>)
GeneratorUtils->>GeneratorBase: Process resources
GeneratorBase->>GeneratorUtils: Call addInheritedResources(Reactor, Set<Resource>)
GeneratorUtils->>Reactor: Fetch inherited resources
Reactor-->>GeneratorUtils: Return inherited resources
GeneratorUtils-->>GeneratorBase: Updated resource Set
GeneratorBase-->>User: Resource processing completed
[!TIP]
Early access features: enabled
We are currently testing the following features in early access: - **OpenAI `gpt-4o` model for code reviews and chat**: OpenAI claims that this model is better at understanding and generating code than the previous models. We seek your feedback over the next few weeks before making it generally available. Note: - You can enable or disable early access features from the CodeRabbit UI or by updating the CodeRabbit configuration file. - Please join our [Discord Community](https://discord.com/invite/GsXnASn26c) to provide feedback and report issues. - OSS projects are always opted into early access features.
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Fixes #2286.
Summary by CodeRabbit
New Features
ImportedCMakeInclude.lf
to support importing and extending reactor definitions with a timeout mechanism.Improvements
List
toSet
, ensuring unique resources and improving efficiency inGeneratorBase
andGeneratorUtils
.