Alexey Andreev 2015-03-01 12:55:28 +03:00
parent c8090c0bde
commit 852589a4dd
2 changed files with 18 additions and 2 deletions

View File

@ -338,9 +338,20 @@ class DependencyGraphBuilder {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
for (int i = 0; i < dimensions.size(); ++i) { for (int i = 0; i < dimensions.size(); ++i) {
sb.append('['); sb.append('[');
itemType = ((ValueType.Array)itemType).getItemType();
}
String itemTypeStr;
if (itemType instanceof ValueType.Object) {
itemTypeStr = ((ValueType.Object)itemType).getClassName();
} else {
itemTypeStr = itemType.toString();
}
sb.append(itemTypeStr);
DependencyNode node = nodes[receiver.getIndex()];
for (int i = 0; i < dimensions.size(); ++i) {
node.propagate(dependencyChecker.getType(sb.substring(i, sb.length())));
node = node.getArrayItem();
} }
sb.append(itemType);
nodes[receiver.getIndex()].propagate(dependencyChecker.getType(sb.toString()));
String className = extractClassName(itemType); String className = extractClassName(itemType);
if (className != null) { if (className != null) {
dependencyChecker.linkClass(className, new CallLocation(caller.getMethod(), currentLocation)); dependencyChecker.linkClass(className, new CallLocation(caller.getMethod(), currentLocation));

View File

@ -120,6 +120,11 @@ public class DependencyNode implements ValueDependencyInfo {
if (DependencyChecker.shouldLog) { if (DependencyChecker.shouldLog) {
arrayItemNode.tag = tag + "["; arrayItemNode.tag = tag + "[";
} }
arrayItemNode.addConsumer(new DependencyConsumer() {
@Override public void consume(DependencyAgentType type) {
DependencyNode.this.propagate(type);
}
});
} }
return arrayItemNode; return arrayItemNode;
} }