Skip to content

Commit

Permalink
devonfw#754: quickfix via lazy init
Browse files Browse the repository at this point in the history
  • Loading branch information
hohwille committed Nov 12, 2024
1 parent 2b473ff commit 7613a7a
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -247,10 +247,8 @@ public void setCwd(Path userDir, String workspace, Path ideHome) {
this.userHomeIde = this.userHome.resolve(".ide");
this.downloadPath = this.userHome.resolve("Downloads/ide");

this.variables = createVariables();
this.path = computeSystemPath();
this.customToolRepository = CustomToolRepositoryImpl.of(this);
this.workspaceMerger = new DirectoryMerger(this);
}

private String getMessageIdeHomeFound() {
Expand Down Expand Up @@ -498,6 +496,9 @@ public SystemPath getPath() {
@Override
public EnvironmentVariables getVariables() {

if (this.variables == null) {
this.variables = createVariables();
}
return this.variables;
}

Expand Down Expand Up @@ -571,6 +572,9 @@ public Locale getLocale() {
@Override
public DirectoryMerger getWorkspaceMerger() {

if (this.workspaceMerger == null) {
this.workspaceMerger = new DirectoryMerger(this);
}
return this.workspaceMerger;
}

Expand Down Expand Up @@ -1054,6 +1058,6 @@ public IdeStartContextImpl getStartContext() {
* Reloads this context and re-initializes the {@link #getVariables() variables}.
*/
public void reload() {
this.variables = createVariables();
this.variables = null;
}
}

0 comments on commit 7613a7a

Please sign in to comment.