You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by mc...@apache.org on 2015/03/30 18:11:15 UTC
[2/2] incubator-nifi git commit: NIFI-250: - Fixing controller
service ancestor calculation.
NIFI-250:
- Fixing controller service ancestor calculation.
Project: http://git-wip-us.apache.org/repos/asf/incubator-nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-nifi/commit/37d2bd1e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-nifi/tree/37d2bd1e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-nifi/diff/37d2bd1e
Branch: refs/heads/NIFI-250
Commit: 37d2bd1e1e564c516cb2d96c7f1b361c9034110a
Parents: 2673c39
Author: Matt Gilman <ma...@gmail.com>
Authored: Mon Mar 30 12:10:44 2015 -0400
Committer: Matt Gilman <ma...@gmail.com>
Committed: Mon Mar 30 12:10:44 2015 -0400
----------------------------------------------------------------------
.../java/org/apache/nifi/web/api/dto/DtoFactory.java | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/37d2bd1e/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/dto/DtoFactory.java
----------------------------------------------------------------------
diff --git a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/dto/DtoFactory.java b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/dto/DtoFactory.java
index 2ebc860..4dcf650 100644
--- a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/dto/DtoFactory.java
+++ b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/dto/DtoFactory.java
@@ -1437,7 +1437,10 @@ public final class DtoFactory {
}
// move the interfaces into the appropriate hierarchy
+ final Collection<Class> rootTypes = new ArrayList<>();
for (final Class<?> i : interfaces) {
+ rootTypes.add(i);
+
// identify the base types
final Set<Class> baseTypes = new LinkedHashSet<>();
identifyBaseTypes(baseClass, i, baseTypes, false);
@@ -1458,19 +1461,19 @@ public final class DtoFactory {
// remove this interface from the lookup (this will only
// leave the interfaces that are ancestor roots)
- lookup.remove(i);
+ rootTypes.remove(i);
}
}
// include the interfaces
- sortedClasses.addAll(lookup.keySet());
+ sortedClasses.addAll(rootTypes);
// get the DTO form for all interfaces and classes
for (final Class<?> cls : sortedClasses) {
boolean add = false;
final DocumentedTypeDTO type;
- if (lookup.containsKey(cls)) {
+ if (rootTypes.contains(cls)) {
type = lookup.get(cls);
add = true;
} else {
@@ -1490,13 +1493,13 @@ public final class DtoFactory {
} else {
// get the DTO for each base type
for (final Class baseType : baseTypes) {
- final DocumentedTypeDTO parentInteface = lookup.get(baseType);
+ final DocumentedTypeDTO parentInterface = lookup.get(baseType);
// include all parent tags in the respective children
- type.getTags().addAll(parentInteface.getTags());
+ type.getTags().addAll(parentInterface.getTags());
// update the hierarchy
- parentInteface.getChildTypes().add(type);
+ parentInterface.getChildTypes().add(type);
}
}