Skip to content

Commit

Permalink
resolve conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric Kerwin committed Mar 6, 2020
2 parents 41978e2 + 321e6d8 commit 74bd70e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@
*/
package com.synopsys.integration.bdio.graph.builder;

import com.synopsys.integration.bdio.model.dependencyid.DependencyId;
import com.synopsys.integration.bdio.model.externalid.ExternalId;

@FunctionalInterface
public interface LazyBuilderMissingExternalIdHandler {
ExternalId handleMissingExternalId(LazyExternalIdDependencyGraphBuilder.LazyDependencyInfo lazyDependencyInfo) throws MissingExternalIdException;
ExternalId handleMissingExternalId(final DependencyId dependencyId, final LazyExternalIdDependencyGraphBuilder.LazyDependencyInfo lazyDependencyInfo) throws MissingExternalIdException;
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
import com.synopsys.integration.bdio.model.externalid.ExternalId;

public class LazyExternalIdDependencyGraphBuilder {
static class LazyDependencyInfo {
public static class LazyDependencyInfo {
private Set<DependencyId> children = new HashSet<>();
private DependencyId aliasId;
private ExternalId externalId;
Expand Down Expand Up @@ -96,11 +96,11 @@ private LazyDependencyInfo infoForId(final DependencyId id) {
}

public DependencyGraph build() throws MissingExternalIdException {
return build(lazyDependencyInfo -> {
return build((dependencyId, lazyDependencyInfo) -> {
if (lazyDependencyInfo != null && lazyDependencyInfo.aliasId != null) {
throw new MissingExternalIdException(lazyDependencyInfo.aliasId);
} else {
throw new MissingExternalIdException(null);
throw new MissingExternalIdException(dependencyId);
}
});
}
Expand All @@ -111,7 +111,7 @@ public DependencyGraph build(LazyBuilderMissingExternalIdHandler lazyBuilderHand
for (final DependencyId dependencyId : dependencyInfo.keySet()) {
final LazyDependencyInfo lazyDependencyInfo = infoForId(dependencyId);
if (lazyDependencyInfo.getExternalId() == null) {
final ExternalId handledExternalId = lazyBuilderHandler.handleMissingExternalId(lazyDependencyInfo);
final ExternalId handledExternalId = lazyBuilderHandler.handleMissingExternalId(dependencyId, lazyDependencyInfo);
if (handledExternalId == null || dependencyId == null) {
throw new MissingExternalIdException(dependencyId);
} else {
Expand Down

0 comments on commit 74bd70e

Please sign in to comment.