-
Notifications
You must be signed in to change notification settings - Fork 664
DYN-9348 Integrator PackagePath following Integration version #16528
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
QilongTang
merged 10 commits into
DynamoDS:master
from
RobertGlobant20:DYN-9348-Revit-PackagePath-Update-Singleton
Oct 17, 2025
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
34d03e0
DYN-9348-Revit-PackagePath Suggested Option
RobertGlobant20 e19b479
Merge branch 'master' into DYN-9348-Revit-PackagePath-Update-Singleton
RobertGlobant20 a27fea5
DYN-9348-Revit-PackagePath Suggested Option CodeReview
RobertGlobant20 71d33e0
Merge branch 'master' into DYN-9348-Revit-PackagePath-Update-Singleton
RobertGlobant20 64f1788
DYN-9348-Revit-PackagePath Suggested Option Fix
RobertGlobant20 d8ef875
Merge branch 'master' into DYN-9348-Revit-PackagePath-Update-Singleton
QilongTang 73355e0
Merge branch 'master' into DYN-9348-Revit-PackagePath-Update-Singleton
RobertGlobant20 4cd29a8
DYN-9348-Revit-PackagePath Suggested Option CodeReview
RobertGlobant20 aca9bbf
DYN-9348-Revit-PackagePath Adding Test
RobertGlobant20 ed237cc
Merge branch 'master' into DYN-9348-Revit-PackagePath-Update-Singleton
RobertGlobant20 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,12 +50,49 @@ struct PathManagerParams | |
|
||
internal class PathManager : IPathManager | ||
{ | ||
internal static Lazy<PathManager> | ||
lazy = | ||
new Lazy<PathManager> | ||
(() => new PathManager(new PathManagerParams())); | ||
private static Lazy<PathManager> lazy; | ||
private static readonly object lockObject = new object(); | ||
|
||
public static PathManager Instance { get { return lazy.Value; } } | ||
/// <summary> | ||
/// Initialize the PathManager singleton passing as a parameter a PathManagerParams object (which contains the Major and Minor version values). | ||
/// </summary> | ||
/// <param name="parameters"></param> | ||
public static void Initialize(PathManagerParams parameters) | ||
{ | ||
lock (lockObject) | ||
{ | ||
if (lazy != null) | ||
{ | ||
// Or do we want to reset the existing instance? See below for discussions. | ||
throw new InvalidOperationException("PathManager has already been initialized."); | ||
} | ||
|
||
lazy = new Lazy<PathManager>(() => new PathManager(parameters)); | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// Instance is the property used as an access point to the PathManager singleton (if is not created will be created with default parameters). | ||
/// </summary> | ||
public static PathManager Instance | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Some comments for public property please |
||
{ | ||
get | ||
{ | ||
if (lazy == null) | ||
{ | ||
lock (lockObject) | ||
{ | ||
if (lazy == null) | ||
{ | ||
// Fallback to default if not initialized | ||
lazy = new Lazy<PathManager>(() => new PathManager(new PathManagerParams())); | ||
} | ||
} | ||
} | ||
|
||
return lazy.Value; | ||
} | ||
} | ||
|
||
#region Class Private Data Members | ||
|
||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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 is this implementation
Lazy
the docs say:Use lazy initialization to defer the creation of a large or resource-intensive object, or the execution of a resource-intensive task, particularly when such creation or execution might not occur during the lifetime of the program.
I think it's unlikely any of our clients will not need a path manager.
If it was to make initialization thread safe, well then, this PR breaks that invariant, so whats the point?