private Collection<ActionParameterTypes> doGetConstructorParameterTypes(Class<?> type, Notifier context) { final Collection<ActionParameterTypes> parameters = new ArrayList<>(); final JvmTypeReference typeReference = this.typeReferences.getTypeForName(type, context); final JvmType jvmType = typeReference.getType(); if (jvmType instanceof JvmDeclaredType) { final JvmDeclaredType declaredType = (JvmDeclaredType) jvmType; for (final JvmConstructor constructor : declaredType.getDeclaredConstructors()) { final ActionParameterTypes types = this.sarlActionSignatures.createParameterTypesFromJvmModel( constructor.isVarArgs(), constructor.getParameters()); if (types != null) { parameters.add(types); } } } if (parameters.isEmpty()) { parameters.add(this.sarlActionSignatures.createParameterTypesForVoid()); } return parameters; }
bitset.set(4); if (constructor.isVarArgs()) { bitset.set(5);
for (final JvmConstructor superConstructor : jvmSuperElement.getDeclaredConstructors()) { final ActionParameterTypes sig = this.sarlActionSignatures.createParameterTypesFromJvmModel( superConstructor.isVarArgs(), superConstructor.getParameters()); superConstructors.put(sig, superConstructor);
constructor.setVisibility(JvmVisibility.PRIVATE); constructor.setSimpleName(inferredLocalClass.getSimpleName()); constructor.setVarArgs(superConstructor.isVarArgs()); final List<JvmFormalParameter> parameters = superConstructor.getParameters(); for(JvmFormalParameter parameter: parameters) {
for (final JvmConstructor cons : parentType.getDeclaredConstructors()) { final ActionParameterTypes sig = sarlSignatureProvider.createParameterTypesFromJvmModel( cons.isVarArgs(), cons.getParameters()); superConstructors.put(sig, cons);
parameters = getParamTypeReferences(constructor, false, true); hasSideEffects = false; isVariadic = constructor.isVarArgs(); } else { final XAbstractFeatureCall call = (XAbstractFeatureCall) container.get();
/** Create the JvmConstructor for the given JDT constructor. * * @param constructor the JDT constructor. * @param context the context of the constructor. * @return the JvmConstructor * @throws JavaModelException if the Java model is invalid. */ public JvmConstructor getJvmConstructor(IMethod constructor, XtendTypeDeclaration context) throws JavaModelException { if (constructor.isConstructor()) { final JvmType type = this.typeReferences.findDeclaredType( constructor.getDeclaringType().getFullyQualifiedName(), context); if (type instanceof JvmDeclaredType) { final JvmDeclaredType declaredType = (JvmDeclaredType) type; final ActionParameterTypes jdtSignature = this.actionPrototypeProvider.createParameterTypes( Flags.isVarargs(constructor.getFlags()), getFormalParameterProvider(constructor)); for (final JvmConstructor jvmConstructor : declaredType.getDeclaredConstructors()) { final ActionParameterTypes jvmSignature = this.actionPrototypeProvider.createParameterTypesFromJvmModel( jvmConstructor.isVarArgs(), jvmConstructor.getParameters()); if (jvmSignature.equals(jdtSignature)) { return jvmConstructor; } } } } return null; }
for (final JvmConstructor constructor : constructors) { final ActionParameterTypes types = this.sarlSignatureProvider.createParameterTypesFromJvmModel( constructor.isVarArgs(), constructor.getParameters()); sortedConstructors.add(new Pair<>(constructor, types)); newCons.setVarArgs(constructor.isVarArgs());