Skip to content

Commit

Permalink
Renamed project to bndrun because that is what it is
Browse files Browse the repository at this point in the history
---
 Signed-off-by: Peter Kriens <[email protected]>

Signed-off-by: Peter Kriens <[email protected]>
  • Loading branch information
pkriens committed Apr 4, 2024
1 parent 83e192d commit 1ac2cd7
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions biz.aQute.bndlib/src/aQute/bnd/build/model/BndEditModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public class BndEditModel {
private Properties properties = new UTF8Properties();
private final Map<String, Object> objectProperties = new HashMap<>();
private final Map<String, String> changesToSave = new TreeMap<>();
private Project project;
private Project bndrun;

private volatile boolean dirty;

Expand Down Expand Up @@ -384,7 +384,7 @@ public BndEditModel(IDocument document) throws IOException {

public BndEditModel(Project bndrun) throws IOException {
this(bndrun.getWorkspace());
this.project = bndrun;
this.bndrun = bndrun;
File propertiesFile = bndrun.getPropertiesFile();
if (propertiesFile.isFile())
this.document = new Document(IO.collect(propertiesFile));
Expand All @@ -400,13 +400,13 @@ public BndEditModel(Project bndrun) throws IOException {
* Workspace/Project/sub bnd files files
*/
Processor getOwner() {
File propertiesFile = project.getPropertiesFile();
File propertiesFile = bndrun.getPropertiesFile();
if (!propertiesFile.getName()
.endsWith(".bnd"))
return project;
return bndrun;

return workspace.findProcessor(propertiesFile)
.orElse(project);
.orElse(bndrun);
}

public void loadFrom(IDocument document) throws IOException {
Expand Down Expand Up @@ -1253,11 +1253,11 @@ private boolean hasIncludeResourceHeaderLikeInstruction() {
}

public void setProject(Project project) {
this.project = project;
this.bndrun = project;
}

public Project getProject() {
return project;
return bndrun;
}

public Workspace getWorkspace() {
Expand Down Expand Up @@ -1290,10 +1290,10 @@ public Processor getProperties() throws Exception {
File source = getBndResource();
Processor parent;

if (project != null) {
parent = project;
if (bndrun != null) {
parent = bndrun;
if (source == null) {
source = project.getPropertiesFile();
source = bndrun.getPropertiesFile();
}
} else if (workspace != null && isCnf()) {
parent = workspace;
Expand Down Expand Up @@ -1366,7 +1366,7 @@ public Map<String, String> getDocumentChanges() {
*/
public void saveChanges() throws IOException {
assert document != null
&& project != null : "you can only call saveChanges when you created this edit model with a project";
&& bndrun != null : "you can only call saveChanges when you created this edit model with a project";

saveChangesTo(document);
store(document, getProject().getPropertiesFile());
Expand All @@ -1383,7 +1383,7 @@ public ResolutionInstructions.ResolveMode getResolveMode() {
try {
return aQute.lib.converter.Converter.cnv(ResolutionInstructions.ResolveMode.class, resolve);
} catch (Exception e) {
project.error("Invalid value for %s: %s. Allowed values are %s", Constants.RESOLVE, resolve,
bndrun.error("Invalid value for %s: %s. Allowed values are %s", Constants.RESOLVE, resolve,
ResolutionInstructions.ResolveMode.class.getEnumConstants());
}
}
Expand All @@ -1407,7 +1407,7 @@ public void setDirty(boolean isDirty) {
}

public void load() throws IOException {
loadFrom(project.getPropertiesFile());
loadFrom(bndrun.getPropertiesFile());
}

/**
Expand Down

0 comments on commit 1ac2cd7

Please sign in to comment.