private synchronized void createTypeFlows(BigBang bb) { if (assignableTypes != null) { return; } /* * Do not publish the new flows here, before they have been completely initialized. Other * threads must not pick up partially initialized type flows. */ AllInstantiatedTypeFlow newAssignableTypes = new AllInstantiatedTypeFlow(this); AllInstantiatedTypeFlow newAssignableTypesNonNull = new AllInstantiatedTypeFlow(this); updateTypeFlows(bb, newAssignableTypes, newAssignableTypesNonNull); /* We perform the null-check on assignableTypes, so publish that one last. */ assignableTypesNonNull = newAssignableTypesNonNull; assignableTypes = newAssignableTypes; }
@Override public void update(BigBang bb) { assert checkUsages(); super.update(bb); }
private boolean checkUsages() { for (TypeFlow<?> use : getUses()) { assert !use.isClone() || use instanceof ProxyTypeFlow || use instanceof SourceTypeFlowBase || use instanceof DynamicNewInstanceTypeFlow || use instanceof FilterTypeFlow || use instanceof ActualReturnTypeFlow : use.getClass(); } return true; }
@Override public TypeState filter(BigBang bb, TypeState update) { if (partitionType.equals(bb.getObjectType())) { /* No need to filter. */ return update; } else { /* Filter the incoming state with the partition type. */ return TypeState.forIntersection(bb, update, partitionType.getTypeFlow(bb, true).getState()); } }
fieldComponentType.getTypeFlow(this, false).addUse(this, elementsFlow);
@Override public TypeState filter(BigBang bb, TypeState update) { if (declaredType.equals(bb.getObjectType())) { /* No need to filter. */ return update; } else { /* Filter the incoming state with the field type. */ return TypeState.forIntersection(bb, update, declaredType.getTypeFlow(bb, true).getState()); } }
@Override public TypeState filter(BigBang bb, TypeState update) { if (partitionType.equals(bb.getObjectType())) { /* No need to filter. */ return update; } else { /* Filter the incoming state with the partition type. */ return TypeState.forIntersection(bb, update, partitionType.getTypeFlow(bb, true).getState()); } }
@Override public TypeState filter(BigBang bb, TypeState update) { if (declaredType.equals(bb.getObjectType())) { /* No need to filter. */ return update; } else { /* * Filter out the objects not compatible with the declared type, i.e., those objects * whose type cannot be converted to the component type of the this array by assignment * conversion. At runtime that will throw an ArrayStoreException but during the analysis * we can detect such cases and filter out the incompatible types. */ return TypeState.forIntersection(bb, update, declaredType.getTypeFlow(bb, true).getState()); } }
TypeState superAssignableTypeState = superType.assignableTypes.getState(); BitSet assignableTypesSet = new BitSet(); for (AnalysisType type : superAssignableTypeState.types()) {
if (newAssignableTypes.get(type.getId()) != null) { BitSet assignableTypes = newAssignableTypes.get(type.getId()); if (type.assignableTypes.getState().hasExactTypes(assignableTypes)) {
AnalysisType declaredType = method.getTypeFlow().getOriginalMethodFlows().getParameter(i).getDeclaredType(); if (declaredType.isInterface()) { state = TypeState.forSubtraction(bigbang, state, declaredType.getTypeFlow(bigbang, true).getState()); if (!state.isEmpty()) { String methodKey = method.format("%H.%n(%p)"); AnalysisType declaredType = field.getType(); if (declaredType.isInterface()) { state = TypeState.forSubtraction(bigbang, state, declaredType.getTypeFlow(bigbang, true).getState()); if (!state.isEmpty()) { String fieldKey = field.format("%H.%n");