protected void _doPrepare(ResolvedTypes resolvedTypes, IFeatureScopeSession featureScopeSession, JvmDeclaredType type, Map<JvmIdentifiableElement, ResolvedTypes> resolvedTypesByType) { IFeatureScopeSession childSession = addThisAndSuper(featureScopeSession, resolvedTypes.getReferenceOwner(), type); prepareMembers(resolvedTypes, childSession, type, resolvedTypesByType); }
@SuppressWarnings("unused") protected void _computeTypes(Map<JvmIdentifiableElement, ResolvedTypes> preparedResolvedTypes, ResolvedTypes resolvedTypes, IFeatureScopeSession featureScopeSession, JvmDeclaredType type) { ResolvedTypes childResolvedTypes = preparedResolvedTypes.get(type); if (childResolvedTypes == null) throw new IllegalStateException("No resolved type found. Type was: " + type.getIdentifier()); IFeatureScopeSession capturedState = LocalVariableCapturerImpl.findCapturedState(type); if (capturedState != null) { featureScopeSession = capturedState; } IFeatureScopeSession childSession = addThisAndSuper(featureScopeSession, childResolvedTypes.getReferenceOwner(), type); computeMemberTypes(preparedResolvedTypes, childResolvedTypes, childSession, type); computeAnnotationTypes(childResolvedTypes, featureScopeSession, type); mergeChildTypes(childResolvedTypes); }
@Override protected void capture(ITypeComputationState state) { this.capturedState = ((AbstractTypeComputationState) state).getFeatureScopeSession(); IFeatureScopeSession nestedSession = typeResolver.addThisAndSuper(capturedState, state.getReferenceOwner(), localClass, getEquivalent(), true); ResolvedTypes capturedResolvedTypes = captureResolvedTypes(state); typeResolver.doPrepare(capturedResolvedTypes, nestedSession, localClass, resolvedTypesByContext); }
protected IFeatureScopeSession addThisAndSuper( IFeatureScopeSession session, ITypeReferenceOwner owner, JvmDeclaredType thisType, /* @Nullable */ JvmTypeReference superType, boolean addNestedTypes) { IFeatureScopeSession childSession = session; if (thisType.eContainer() != null) { if (thisType.isStatic()) { childSession = childSession.dropLocalElements(); } else { childSession = childSession.captureLocalElements(); } } if (superType != null && superType.getType() != null) { ImmutableMap.Builder<QualifiedName, JvmIdentifiableElement> builder = ImmutableMap.builder(); builder.put(IFeatureNames.THIS, thisType); builder.put(IFeatureNames.SUPER, superType.getType()); childSession = childSession.addLocalElements(builder.build(), owner); } else { childSession = childSession.addLocalElement(IFeatureNames.THIS, thisType, owner); } childSession = addThisTypeToStaticScope(childSession, thisType); if (addNestedTypes) childSession = childSession.addNestedTypesToScope(thisType); return childSession; }