Skip to content

Commit

Permalink
Merge pull request #476 from stuartwoodman/AUS-4249-KnownLayers-Build…
Browse files Browse the repository at this point in the history
…-Failing

AUS4249 KnownLayers Build Failing
  • Loading branch information
vjf authored Sep 23, 2024
2 parents 5afa6ec + 2063f9d commit f454623
Showing 1 changed file with 41 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,10 @@ public String getServiceName() {
* @return the online resources
*/
public List<AbstractCSWOnlineResource> getOnlineResources() {
return onlineResources;
if (onlineResources == null) {
onlineResources = new ArrayList<AbstractCSWOnlineResource>();
}
return onlineResources;
}

/**
Expand Down Expand Up @@ -706,23 +709,24 @@ public String toString() {
*/
public List<AbstractCSWOnlineResource> getOnlineResourcesByType(AbstractCSWOnlineResource.OnlineResourceType... types) {
List<AbstractCSWOnlineResource> result = new ArrayList<>();

for (AbstractCSWOnlineResource r : onlineResources) {
if (r == null) {
continue;
}
boolean matching = false;
AbstractCSWOnlineResource.OnlineResourceType typeToMatch = r.getType();
for (AbstractCSWOnlineResource.OnlineResourceType type : types) {
if (typeToMatch == type) {
matching = true;
break;
}
}

if (matching) {
result.add(r);
}
if (onlineResources != null) {
for (AbstractCSWOnlineResource r : onlineResources) {
if (r == null) {
continue;
}
boolean matching = false;
AbstractCSWOnlineResource.OnlineResourceType typeToMatch = r.getType();
for (AbstractCSWOnlineResource.OnlineResourceType type : types) {
if (typeToMatch == type) {
matching = true;
break;
}
}

if (matching) {
result.add(r);
}
}
}

return result;
Expand All @@ -743,24 +747,25 @@ public List<AbstractCSWOnlineResource> getOnlineResourcesByType(
CSWRecordsFilterVisitor visitor,
AbstractCSWOnlineResource.OnlineResourceType... types) {
List<AbstractCSWOnlineResource> result = new ArrayList<>();

for (AbstractCSWOnlineResource r : onlineResources) {
if (r == null) {
continue;
}
boolean matching = false;
AbstractCSWOnlineResource.OnlineResourceType typeToMatch = r
.getType();
for (AbstractCSWOnlineResource.OnlineResourceType type : types) {
if (typeToMatch == type) {
matching = true;
break;
}
}

if (matching && r.accept(visitor)) {
result.add(r);
}
if (onlineResources != null) {
for (AbstractCSWOnlineResource r : onlineResources) {
if (r == null) {
continue;
}
boolean matching = false;
AbstractCSWOnlineResource.OnlineResourceType typeToMatch = r
.getType();
for (AbstractCSWOnlineResource.OnlineResourceType type : types) {
if (typeToMatch == type) {
matching = true;
break;
}
}

if (matching && r.accept(visitor)) {
result.add(r);
}
}
}

return result;
Expand Down

0 comments on commit f454623

Please sign in to comment.