public void serializeSafely(final JvmTypeReference typeRef, final ITreeAppendable appendable) { this.serializeSafely(typeRef, null, appendable); }
if (typeRef instanceof JvmSpecializedTypeReference) { _matched=true; this.serializeSafely(((JvmSpecializedTypeReference)typeRef).getEquivalent(), surrogateType, appendable); final ITreeAppendable errorChild = this.openErrorAppendable(appendable, appendable); errorChild.append("type is \'null\'"); this.closeErrorAppendable(appendable, errorChild); Boolean _accept = typeRef.<Boolean>accept(_brokenTypeRefDetector); if ((_accept).booleanValue()) { final ITreeAppendable errorChild = this.openErrorAppendable(appendable, appendable); try { this._typeReferenceSerializer.serialize(typeRef, typeRef.eContainer(), errorChild); this.closeErrorAppendable(appendable, errorChild); if ((surrogateType != null)) { appendable.append(surrogateType);
public void generateTypeParameterConstraints(final JvmTypeParameter it, final ITreeAppendable appendable, final GeneratorConfig config) { final Iterable<JvmUpperBound> upperBounds = Iterables.<JvmUpperBound>filter(it.getConstraints(), JvmUpperBound.class); final Procedure1<LoopParams> _function = (LoopParams it_1) -> { it_1.setPrefix(" extends "); it_1.setSeparator(" & "); }; final Procedure2<JvmUpperBound, ITreeAppendable> _function_1 = (JvmUpperBound it_1, ITreeAppendable app) -> { this._errorSafeExtensions.serializeSafely(it_1.getTypeReference(), app); }; this._errorSafeExtensions.<JvmUpperBound>forEachSafely(appendable, upperBounds, _function, _function_1); }
public void serializeSafely(final JvmAnnotationReference annotationRef, final ITreeAppendable appendable, final Procedure1<? super ITreeAppendable> onSuccess) { if (((annotationRef == null) || (annotationRef.getAnnotation() == null))) { final ITreeAppendable errorChild = this.openErrorAppendable(appendable, appendable); errorChild.append("annotation is \'null\'"); this.closeErrorAppendable(appendable, errorChild); } else { boolean _eIsProxy = annotationRef.getAnnotation().eIsProxy(); if (_eIsProxy) { final ITreeAppendable errorChild_1 = this.openErrorAppendable(appendable, appendable); appendable.append("@"); appendable.append(annotationRef.getAnnotation()); this.closeErrorAppendable(appendable, errorChild_1); } else { appendable.append("@"); appendable.append(annotationRef.getAnnotation()); onSuccess.apply(appendable); } } } }
final LoopParams loopParams = ObjectExtensions.<LoopParams>operator_doubleArrow(_loopParams, loopInitializer); final Function1<T, Boolean> _function = (T it) -> { return Boolean.valueOf(this.hasErrors(it)); }; int _size = IterableExtensions.size(IterableExtensions.<T>filter(elements, _function)); ITreeAppendable _xifexpression = null; if (allElementsBroken) { _xifexpression = this.openErrorAppendable(appendable, null); } else { _xifexpression = appendable; boolean isFirstBroken = true; for (final T element : elements) { boolean _hasErrors = this.hasErrors(element); boolean _not = (!_hasErrors); if (_not) { currentAppendable = this.closeErrorAppendable(appendable, currentAppendable); if ((!isFirst)) { loopParams.appendSeparator(appendable); } else { if ((!allElementsBroken)) { currentAppendable = this.openErrorAppendable(appendable, currentAppendable); _xifexpression_1 = currentAppendable; } else { _xifexpression_1 = this.closeErrorAppendable(appendable, currentAppendable);
}; final Procedure2<JvmTypeReference, ITreeAppendable> _function_2 = (JvmTypeReference it_1, ITreeAppendable app) -> { this._errorSafeExtensions.serializeSafely(it_1, app); }; this._errorSafeExtensions.<JvmTypeReference>forEachSafely(appendable, withoutObject, _function_1, _function_2); } else { final Function1<JvmTypeReference, Boolean> _function_3 = (JvmTypeReference typeRef) -> { final Iterable<JvmTypeReference> superInterfaces = IterableExtensions.<JvmTypeReference>filter(withoutObject_1, _function_5); if ((superClazz != null)) { final boolean hasErrors = this._errorSafeExtensions.hasErrors(superClazz); if (hasErrors) { appendable.append("/* "); this._errorSafeExtensions.serializeSafely(superClazz, appendable); appendable.append(" "); } catch (final Throwable _t) { }; final Procedure2<JvmTypeReference, ITreeAppendable> _function_7 = (JvmTypeReference it_1, ITreeAppendable app) -> { this._errorSafeExtensions.serializeSafely(it_1, app); }; this._errorSafeExtensions.<JvmTypeReference>forEachSafely(appendable, superInterfaces, _function_6, _function_7);
/** * Returns the errors that are produced for elements that are directly contained * in this feature (e.g. unresolved type proxies) or that are associated with * the expression that may be logically contained in the given feature. */ private Iterable<Issue> getDirectErrorsOrLogicallyContainedErrors(final JvmFeature feature) { Iterable<Issue> errors = this._errorSafeExtensions.getErrors(feature); boolean _isEmpty = IterableExtensions.isEmpty(errors); if (_isEmpty) { final XExpression expression = this._iLogicalContainerProvider.getAssociatedExpression(feature); if ((expression != null)) { errors = this._errorSafeExtensions.getErrors(expression); } } return errors; }
public void generateThrowsClause(final JvmExecutable it, final ITreeAppendable appendable, final GeneratorConfig config) { final LinkedHashMap<JvmType, JvmTypeReference> toBeGenerated = CollectionLiterals.<JvmType, JvmTypeReference>newLinkedHashMap(); final Consumer<JvmTypeReference> _function = (JvmTypeReference it_1) -> { boolean _containsKey = toBeGenerated.containsKey(it_1.getType()); boolean _not = (!_containsKey); if (_not) { toBeGenerated.put(it_1.getType(), it_1); } }; it.getExceptions().forEach(_function); final Procedure1<LoopParams> _function_1 = (LoopParams it_1) -> { it_1.setPrefix(" throws "); it_1.setSeparator(", "); }; final Procedure2<JvmTypeReference, ITreeAppendable> _function_2 = (JvmTypeReference it_1, ITreeAppendable app) -> { app.trace(it_1).append(it_1.getType()); }; this._errorSafeExtensions.<JvmTypeReference>forEachSafely(appendable, toBeGenerated.values(), _function_1, _function_2); }
final XExpression body = this._iLogicalContainerProvider.getAssociatedExpression(it); if ((body != null)) { boolean _hasErrors = this._errorSafeExtensions.hasErrors(body); if (_hasErrors) { appendable.append("/* skipped default expression with errors */"); boolean _tripleNotEquals_2 = (_defaultValue != null); if (_tripleNotEquals_2) { boolean _hasErrors_1 = this._errorSafeExtensions.hasErrors(it.getDefaultValue()); if (_hasErrors_1) { appendable.append("/* skipped default expression with errors */");
final XExpression expression = this._iLogicalContainerProvider.getAssociatedExpression(op); if (((expression != null) && config.isGenerateExpressions())) { final Iterable<Issue> errors_2 = this._errorSafeExtensions.getErrors(expression); boolean _isEmpty_2 = IterableExtensions.isEmpty(errors_2); if (_isEmpty_2) {
public void generateAnnotations(final Iterable<JvmAnnotationReference> annotations, final ITreeAppendable appendable, final boolean withLineBreak, final GeneratorConfig config) { final Function1<ITreeAppendable, ITreeAppendable> _function = (ITreeAppendable it) -> { ITreeAppendable _xifexpression = null; if (withLineBreak) { _xifexpression = it.newLine(); } else { _xifexpression = it.append(" "); } return _xifexpression; }; final Function1<ITreeAppendable, ITreeAppendable> sep = _function; final Procedure1<LoopParams> _function_1 = (LoopParams it) -> { it.setSeparator(sep); it.setSuffix(sep); }; final Procedure2<JvmAnnotationReference, ITreeAppendable> _function_2 = (JvmAnnotationReference it, ITreeAppendable app) -> { this.generateAnnotation(it, app, config); }; this._errorSafeExtensions.<JvmAnnotationReference>forEachSafely(appendable, annotations, _function_1, _function_2); }
final XExpression expression = this._iLogicalContainerProvider.getAssociatedExpression(it); if (((expression != null) && config.isGenerateExpressions())) { boolean _hasErrors = this._errorSafeExtensions.hasErrors(expression); if (_hasErrors) { appendable.append(" /* Skipped initializer because of errors */");
public void generateParameter(final JvmFormalParameter it, final ITreeAppendable appendable, final boolean vararg, final GeneratorConfig config) { final ITreeAppendable tracedAppendable = appendable.trace(it); this.generateAnnotations(it.getAnnotations(), tracedAppendable, false, config); tracedAppendable.append("final "); if (vararg) { JvmTypeReference _parameterType = it.getParameterType(); boolean _not = (!(_parameterType instanceof JvmGenericArrayTypeReference)); if (_not) { tracedAppendable.append("/* Internal Error: Parameter was vararg but not an array type. */"); } else { JvmTypeReference _parameterType_1 = it.getParameterType(); this._errorSafeExtensions.serializeSafely(((JvmGenericArrayTypeReference) _parameterType_1).getComponentType(), "Object", tracedAppendable); } tracedAppendable.append("..."); } else { this._errorSafeExtensions.serializeSafely(it.getParameterType(), "Object", tracedAppendable); } tracedAppendable.append(" "); final String name = tracedAppendable.declareVariable(it, this.makeJavaIdentifier(it.getSimpleName())); this._treeAppendableUtil.traceSignificant(tracedAppendable, it).append(name); }
protected ITreeAppendable _generateMember(final JvmField it, final ITreeAppendable appendable, final GeneratorConfig config) { ITreeAppendable _xblockexpression = null; { appendable.newLine(); this.generateJavaDoc(it, appendable, config); final ITreeAppendable tracedAppendable = appendable.trace(it); this.generateAnnotations(it.getAnnotations(), tracedAppendable, true, config); this.generateModifier(it, tracedAppendable, config); this._errorSafeExtensions.serializeSafely(it.getType(), "Object", tracedAppendable); tracedAppendable.append(" "); final String name = tracedAppendable.declareVariable(it, this.makeJavaIdentifier(it.getSimpleName())); this._treeAppendableUtil.traceSignificant(tracedAppendable, it).append(name); this.generateInitialization(it, tracedAppendable, config); _xblockexpression = tracedAppendable.append(";"); } return _xblockexpression; }
public void generateAnnotationMethod(final JvmOperation it, final ITreeAppendable appendable, final GeneratorConfig config) { appendable.increaseIndentation().newLine(); appendable.openScope(); this.generateJavaDoc(it, appendable, config); final ITreeAppendable tracedAppendable = appendable.trace(it); this.generateAnnotations(it.getAnnotations(), tracedAppendable, true, config); this.generateModifier(it, tracedAppendable, config); this._errorSafeExtensions.serializeSafely(it.getReturnType(), "Object", tracedAppendable); tracedAppendable.append(" "); this._treeAppendableUtil.traceSignificant(tracedAppendable, it).append(this.makeJavaIdentifier(it.getSimpleName())); tracedAppendable.append("()"); this.generateDefaultExpression(it, tracedAppendable, config); tracedAppendable.append(";"); appendable.decreaseIndentation(); appendable.closeScope(); }
tracedAppendable.append("void"); //$NON-NLS-1$ } else { this._errorSafeExtensions.serializeSafely(it.getReturnType(), Object.class.getSimpleName(), tracedAppendable);
tracedAppendable.append("void"); } else { this._errorSafeExtensions.serializeSafely(it.getReturnType(), "Object", tracedAppendable);
tracedAppendable.append("void"); } else { this._errorSafeExtensions.serializeSafely(((JvmOperation)it_1).getReturnType(), "Object", tracedAppendable); tracedAppendable_1.append("volatile "); this._errorSafeExtensions.serializeSafely(((JvmField)it_1).getType(), "Object", tracedAppendable_1); tracedAppendable_1.append(" "); this._treeAppendableUtil.traceSignificant(tracedAppendable_1, it_1).append(((JvmField)it_1).getSimpleName());