Skip to content

Commit

Permalink
Better names for ContributedLibrary dependencies fields
Browse files Browse the repository at this point in the history
  • Loading branch information
cmaglie authored and facchinm committed Jul 18, 2019
1 parent 492553c commit 745cb01
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public abstract class ContributedLibrary extends DownloadableContribution {

public abstract List<String> getTypes();

public abstract List<ContributedLibraryDependency> getRequires();
public abstract List<ContributedLibraryDependency> getDependencies();

public abstract List<String> getProvidesIncludes();

Expand Down Expand Up @@ -146,8 +146,8 @@ public String info() {
}
res += "\n";
res += " requires :\n";
if (getRequires() != null)
for (ContributedLibraryDependency r : getRequires()) {
if (getDependencies() != null)
for (ContributedLibraryDependency r : getDependencies()) {
res += " " + r;
}
res += "\n";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ public abstract class ContributedLibraryDependency {

public abstract String getName();

public abstract String getVersionRequired();
public abstract String getVersion();

@Override
public String toString() {
return getName() + " " + getVersionRequired();
return getName() + " " + getVersion();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public List<ContributedLibrary> resolveDependeciesOf(ContributedLibrary library)

public boolean resolveDependeciesOf(List<ContributedLibrary> solution,
ContributedLibrary library) {
List<ContributedLibraryDependency> requirements = library.getRequires();
List<ContributedLibraryDependency> requirements = library.getDependencies();
if (requirements == null) {
// No deps for this library, great!
return true;
Expand Down Expand Up @@ -160,7 +160,7 @@ public boolean resolveDependeciesOf(List<ContributedLibrary> solution,

private List<ContributedLibrary> findMatchingDependencies(ContributedLibraryDependency dep) {
List<ContributedLibrary> available = find(dep.getName());
if (dep.getVersionRequired() == null || dep.getVersionRequired().isEmpty())
if (dep.getVersion() == null || dep.getVersion().isEmpty())
return available;

// XXX: The following part is actually never reached. The use of version
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class UnavailableContributedLibrary extends ContributedLibrary {
private String version;

public UnavailableContributedLibrary(ContributedLibraryDependency dependency) {
this(dependency.getName(), dependency.getVersionRequired());
this(dependency.getName(), dependency.getVersion());
}

public UnavailableContributedLibrary(String _name, String _version) {
Expand Down Expand Up @@ -101,7 +101,7 @@ public List<String> getTypes() {
}

@Override
public List<ContributedLibraryDependency> getRequires() {
public List<ContributedLibraryDependency> getDependencies() {
return new ArrayList<>();
}

Expand Down

0 comments on commit 745cb01

Please sign in to comment.