Commit 2c237e54 authored by Rakshit Mittal's avatar Rakshit Mittal
Browse files

added method to compute extensionIndex from reusedIndex and libraryIndex

parent 5f154b6e
......@@ -35,6 +35,20 @@ public class LibraryUtils {
return returnList;
}
public static Integer getExtensionIndex(Integer libraryIndex, Integer reusedIndex, Boolean modifyReused) {
if (modifyReused) {
return libraryIndex;
} else {
if (libraryIndex == -1) {
return reusedIndex;
} else if (reusedIndex == -1) {
return libraryIndex;
} else {
return Math.min(reusedIndex, libraryIndex);
}
}
}
public static EList<ComponentType> getAllInheritingParentTypes(Feature feat, ComponentInstance compinst) {
final EList<ComponentType> returnList = new BasicEList<ComponentType>();
ComponentType comptype;
......@@ -189,7 +203,7 @@ public class LibraryUtils {
if (extensionType == sourceType) {
return true;
}
while (extensionType.getExtended() != null) {
while (extensionType != null) {
if (extensionType == sourceType) {
return true;
} else {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment