diff --git a/main/coreplugins/io.sarl.lang.core/src/io/sarl/lang/bugfixes/pending/pr106/PR106ArrayExtensions.java b/main/coreplugins/io.sarl.lang.core/src/io/sarl/lang/bugfixes/pending/pr106/PR106ArrayExtensions.java deleted file mode 100644 index bc424f200b..0000000000 --- a/main/coreplugins/io.sarl.lang.core/src/io/sarl/lang/bugfixes/pending/pr106/PR106ArrayExtensions.java +++ /dev/null @@ -1,353 +0,0 @@ -/* - * $Id$ - * - * SARL is an general-purpose agent programming language. - * More details on http://www.sarl.io - * - * Copyright (C) 2014-2019 the original authors or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.sarl.lang.bugfixes.pending.pr106; - -import com.google.common.annotations.GwtCompatible; -import org.eclipse.xtext.xbase.lib.Inline; -import org.eclipse.xtext.xbase.lib.Pure; - -/** - * Extend the ArrayExtensions class for accessing multi-dimensional arrays. - * - *

FIXME: Remove when PR is merged: https://github.com/eclipse/xtext-lib/pull/106 - * - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - * @see "https://github.com/eclipse/xtext-lib/pull/106" - */ -@SuppressWarnings("checkstyle:all") -@GwtCompatible -public class PR106ArrayExtensions { - - /** - * @param array - * the array - * @param index0 - * the first index the value should be set at - * @param index1 - * the second index the value should be set at - * @param value - * the value to set at the given indexes - * @return the new value - * @since 2.15 - */ - @Inline("$1[$2][$3] = $4") - public static T set(T[][] array, int index0, int index1, E value) { - array[index0][index1] = value; - return value; - } - - /** - * @param array - * the array - * @param index0 - * the first index - * @param index1 - * the second index - * @return the value at the given index - * @since 2.15 - */ - @Pure - @Inline("$1[$2][$3]") - public static T get(T[][] array, int index0, int index1) { - return array[index0][index1]; - } - - - - // BEGIN generated code - - /** - * @param array - * the array - * @param index0 - * the first index - * @param index1 - * the second index - * @return the value at the given indexes - * @since 2.15 - */ - @Pure - @Inline("$1[$2][$3]") - public static boolean get(boolean[][] array, int index0, int index1) { - return array[index0][index1]; - } - - /** - * @param array - * the array - * @param index0 - * the first index the value should be set at - * @param index1 - * the second index the value should be set at - * @param value - * the value to set at the given indexes - * @return the new value - * @since 2.15 - */ - @Inline("$1[$2][$3] = $4") - public static boolean set(boolean[][] array, int index0, int index1, boolean value) { - array[index0][index1] = value; - return value; - } - - /** - * @param array - * the array - * @param index0 - * the first index - * @param index1 - * the second index - * @return the value at the given indexes - * @since 2.15 - */ - @Pure - @Inline("$1[$2][$3]") - public static double get(double[][] array, int index0, int index1) { - return array[index0][index1]; - } - - /** - * @param array - * the array - * @param index0 - * the first index the value should be set at - * @param index1 - * the second index the value should be set at - * @param value - * the value to set at the given indexex - * @return the new value - * @since 2.15 - */ - @Inline("$1[$2][$3] = $4") - public static double set(double[][] array, int index0, int index1, double value) { - array[index0][index1] = value; - return value; - } - - /** - * @param array - * the array - * @param index0 - * the first index - * @param index1 - * the first index - * @return the value at the given indexes - * @since 2.15 - */ - @Pure - @Inline("$1[$2][$3]") - public static float get(float[][] array, int index0, int index1) { - return array[index0][index1]; - } - - /** - * @param array - * the array - * @param index0 - * the first index the value should be set at - * @param index1 - * the second index the value should be set at - * @param value - * the value to set at the given indexes - * @return the new value - * @since 2.15 - */ - @Inline("$1[$2][$3] = $4") - public static float set(float[][] array, int index0, int index1, float value) { - array[index0][index1] = value; - return value; - } - - /** - * @param array - * the array - * @param index0 - * the first index - * @param index1 - * the second index - * @return the value at the given indexes - * @since 2.15 - */ - @Pure - @Inline("$1[$2][$3]") - public static long get(long[][] array, int index0, int index1) { - return array[index0][index1]; - } - - /** - * @param array - * the array - * @param index0 - * the first index the value should be set at - * @param index1 - * the second index the value should be set at - * @param value - * the value to set at the given indexes - * @return the new value - * @since 2.15 - */ - @Inline("$1[$2][$3] = $4") - public static long set(long[][] array, int index0, int index1, long value) { - array[index0][index1] = value; - return value; - } - - /** - * @param array - * the array - * @param index0 - * the first index - * @param index1 - * the second index - * @return the value at the given indexes - * @since 2.15 - */ - @Pure - @Inline("$1[$2]") - public static int get(int[][] array, int index0, int index1) { - return array[index0][index1]; - } - - /** - * @param array - * the array - * @param index0 - * the first index the value should be set at - * @param index1 - * the second index the value should be set at - * @param value - * the value to set at the given index - * @return the new value - * @since 2.15 - */ - @Inline("$1[$2][$3] = $4") - public static int set(int[][] array, int index0, int index1, int value) { - array[index0][index1] = value; - return value; - } - - /** - * @param array - * the array - * @param index0 - * the first index - * @param index1 - * the second index - * @return the value at the given indexes - * @since 2.15 - */ - @Pure - @Inline("$1[$2][$3]") - public static char get(char[][] array, int index0, int index1) { - return array[index0][index1]; - } - - /** - * @param array - * the array - * @param index0 - * the first index the value should be set at - * @param index1 - * the second index the value should be set at - * @param value - * the value to set at the given indexes - * @return the new value - * @since 2.15 - */ - @Inline("$1[$2][$3] = $4") - public static char set(char[][] array, int index0, int index1, char value) { - array[index0][index1] = value; - return value; - } - - /** - * @param array - * the array - * @param index0 - * the first index - * @param index1 - * the second index - * @return the value at the given indexes - * @since 2.15 - */ - @Pure - @Inline("$1[$2][$3]") - public static short get(short[][] array, int index0, int index1) { - return array[index0][index1]; - } - - /** - * @param array - * the array - * @param index0 - * the first index the value should be set at - * @param index1 - * the second index the value should be set at - * @param value - * the value to set at the given indexes - * @return the new value - * @since 2.15 - */ - @Inline("$1[$2][$3] = $4") - public static short set(short[][] array, int index0, int index1, short value) { - array[index0][index1] = value; - return value; - } - - /** - * @param array - * the array - * @param index0 - * the first index - * @param index1 - * the second index - * @return the value at the given indexes - * @since 2.15 - */ - @Pure - @Inline("$1[$2][$3]") - public static byte get(byte[][] array, int index0, int index1) { - return array[index0][index1]; - } - - /** - * @param array - * the array - * @param index0 - * the first index the value should be set at - * @param index1 - * the second index the value should be set at - * @param value - * the value to set at the given indexes - * @return the new value - * @since 2.15 - */ - @Inline("$1[$2][$3] = $4") - public static byte set(byte[][] array, int index0, int index1, byte value) { - array[index0][index1] = value; - return value; - } - -} diff --git a/main/coreplugins/io.sarl.lang.core/src/io/sarl/lang/bugfixes/pending/pr106/PR106ArrayLiterals.java b/main/coreplugins/io.sarl.lang.core/src/io/sarl/lang/bugfixes/pending/pr106/PR106ArrayLiterals.java deleted file mode 100644 index d75785234b..0000000000 --- a/main/coreplugins/io.sarl.lang.core/src/io/sarl/lang/bugfixes/pending/pr106/PR106ArrayLiterals.java +++ /dev/null @@ -1,170 +0,0 @@ -/* - * $Id$ - * - * SARL is an general-purpose agent programming language. - * More details on http://www.sarl.io - * - * Copyright (C) 2014-2019 the original authors or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.sarl.lang.bugfixes.pending.pr106; - -import com.google.common.annotations.GwtCompatible; -import org.eclipse.xtext.xbase.lib.Inline; -import org.eclipse.xtext.xbase.lib.Pure; - -/** - * Extend the ArrayLiterals class for creating multi-dimensional arrays. - * - *

FIXME: Remove when PR is merged: https://github.com/eclipse/xtext-lib/pull/106 - * - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - * @see "https://github.com/eclipse/xtext-lib/pull/106" - */ -@SuppressWarnings("checkstyle:all") -@GwtCompatible -public class PR106ArrayLiterals { - - /** - * @param size0 - * the first size for the array to be created - * @param size1 - * the second size for the array to be created - * @return an array of the given sizes - * @since 15.0 - */ - @Pure - @Inline("new $4[$1][$2]") - public static T[][] newArrayOfSize(int size0, int size1) { - throw new UnsupportedOperationException( - "This method relies on the inlined compilation (see @Inline annotation), and cannot be used from Java or with an uncustomized interpreter."); //$NON-NLS-1$ - } - - /** - * @param size0 - * the first size for the array to be created - * @param size1 - * the second size for the array to be created - * @return an array of the given sizes - * @since 15.0 - */ - @Pure - @Inline("new char[$1][$2]") - public static char[][] newCharArrayOfSize(int size0, int size1) { - return new char[size0][size1]; - } - - /** - * @param size0 - * the first size for the array to be created - * @param size1 - * the second size for the array to be created - * @return an array of the given sizes - * @since 15.0 - */ - @Pure - @Inline("new int[$1][$2]") - public static int[][] newIntArrayOfSize(int size0, int size1) { - return new int[size0][size1]; - } - - /** - * @param size0 - * the first size for the array to be created - * @param size1 - * the second size for the array to be created - * @return an array of the given sizes - * @since 15.0 - */ - @Pure - @Inline("new boolean[$1][$2]") - public static boolean[][] newBooleanArrayOfSize(int size0, int size1) { - return new boolean[size0][size1]; - } - - /** - * @param size0 - * the first size for the array to be created - * @param size1 - * the second size for the array to be created - * @return an array of the given sizes - * @since 15.0 - */ - @Pure - @Inline("new short[$1][$2]") - public static short[][] newShortArrayOfSize(int size0, int size1) { - return new short[size0][size1]; - } - - /** - * @param size0 - * the first size for the array to be created - * @param size1 - * the second size for the array to be created - * @return an array of the given sizes - * @since 15.0 - */ - @Pure - @Inline("new long[$1][$2]") - public static long[][] newLongArrayOfSize(int size0, int size1) { - return new long[size0][size1]; - } - - /** - * @param size0 - * the first size for the array to be created - * @param size1 - * the second size for the array to be created - * @return an array of the given sizes - * @since 15.0 - */ - @Pure - @Inline("new float[$1][$2]") - public static float[][] newFloatArrayOfSize(int size0, int size1) { - return new float[size0][size1]; - } - - /** - * @param size0 - * the first size for the array to be created - * @param size1 - * the second size for the array to be created - * @return an array of the given sizes - * @since 15.0 - */ - @Pure - @Inline("new double[$1][$2]") - public static double[][] newDoubleArrayOfSize(int size0, int size1) { - return new double[size0][size1]; - } - - /** - * @param size0 - * the first size for the array to be created - * @param size1 - * the second size for the array to be created - * @return an array of the given sizes - * @since 15.0 - */ - @Pure - @Inline("new byte[$1][$2]") - public static byte[][] newByteArrayOfSize(int size0, int size1) { - return new byte[size0][size1]; - } - -} diff --git a/main/coreplugins/io.sarl.lang/META-INF/MANIFEST.MF b/main/coreplugins/io.sarl.lang/META-INF/MANIFEST.MF index f22f79b7e9..829634aa73 100644 --- a/main/coreplugins/io.sarl.lang/META-INF/MANIFEST.MF +++ b/main/coreplugins/io.sarl.lang/META-INF/MANIFEST.MF @@ -28,7 +28,6 @@ Require-Bundle: io.sarl.lang.core;bundle-version="0.9.0";visibility:=reexport, Bundle-Activator: io.sarl.lang.SARLLangActivator Export-Package: io.sarl.lang, io.sarl.lang.bugfixes.pending.bug621, - io.sarl.lang.bugfixes.pending.bug868, io.sarl.lang.bugfixes.unpublished, io.sarl.lang.codebuilder, io.sarl.lang.codebuilder.appenders, diff --git a/main/coreplugins/io.sarl.lang/src/io/sarl/lang/bugfixes/pending/bug868/Bug868ActiveAnnotationContextProvider.java b/main/coreplugins/io.sarl.lang/src/io/sarl/lang/bugfixes/pending/bug868/Bug868ActiveAnnotationContextProvider.java deleted file mode 100644 index 2a06cdf294..0000000000 --- a/main/coreplugins/io.sarl.lang/src/io/sarl/lang/bugfixes/pending/bug868/Bug868ActiveAnnotationContextProvider.java +++ /dev/null @@ -1,290 +0,0 @@ -/* - * $Id$ - * - * SARL is an general-purpose agent programming language. - * More details on http://www.sarl.io - * - * Copyright (C) 2014-2019 the original authors or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.sarl.lang.bugfixes.pending.bug868; - -import java.util.List; -import java.util.function.Consumer; - -import com.google.inject.Inject; -import com.google.inject.Provider; -import org.apache.log4j.Logger; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.xtend.core.macro.ActiveAnnotationContext; -import org.eclipse.xtend.core.macro.ActiveAnnotationContextProvider; -import org.eclipse.xtend.core.macro.ActiveAnnotationContexts; -import org.eclipse.xtend.core.macro.ProcessorInstanceForJvmTypeProvider; -import org.eclipse.xtend.core.macro.XAnnotationExtensions; -import org.eclipse.xtend.core.macro.declaration.CompilationUnitImpl; -import org.eclipse.xtend.core.validation.IssueCodes; -import org.eclipse.xtend.core.xtend.XtendAnnotationTarget; -import org.eclipse.xtend.core.xtend.XtendAnnotationType; -import org.eclipse.xtend.core.xtend.XtendClass; -import org.eclipse.xtend.core.xtend.XtendConstructor; -import org.eclipse.xtend.core.xtend.XtendEnum; -import org.eclipse.xtend.core.xtend.XtendFile; -import org.eclipse.xtend.core.xtend.XtendFunction; -import org.eclipse.xtend.core.xtend.XtendInterface; -import org.eclipse.xtend.core.xtend.XtendMember; -import org.eclipse.xtend.core.xtend.XtendParameter; -import org.eclipse.xtend.core.xtend.XtendTypeDeclaration; -import org.eclipse.xtend2.lib.StringConcatenation; -import org.eclipse.xtext.common.types.JvmAnnotationType; -import org.eclipse.xtext.common.types.JvmType; -import org.eclipse.xtext.diagnostics.Severity; -import org.eclipse.xtext.service.OperationCanceledManager; -import org.eclipse.xtext.util.IAcceptor; -import org.eclipse.xtext.util.internal.Stopwatches; -import org.eclipse.xtext.validation.EObjectDiagnosticImpl; -import org.eclipse.xtext.xbase.annotations.xAnnotations.XAnnotation; -import org.eclipse.xtext.xbase.annotations.xAnnotations.XAnnotationsPackage; -import org.eclipse.xtext.xbase.lib.Exceptions; -import org.eclipse.xtext.xbase.lib.Extension; -import org.eclipse.xtext.xbase.lib.Functions.Function1; -import org.eclipse.xtext.xbase.lib.IterableExtensions; -import org.eclipse.xtext.xbase.lib.Pair; -import org.eclipse.xtext.xbase.lib.util.ReflectExtensions; - -/** Provide the contexts of the active annotations. - * - *

FIXME: Remove this class when PR 649 is merged. - * - * @author $Author: sgalland$ - * @version $FullVersion$ - * @mavengroupid $GroupId$ - * @mavenartifactid $ArtifactId$ - * @since 0.9 - * @see "https://github.com/eclipse/xtext-xtend/pull/649" - */ -@SuppressWarnings("all") -public class Bug868ActiveAnnotationContextProvider extends ActiveAnnotationContextProvider { - private final static Logger logger = Logger.getLogger(ActiveAnnotationContextProvider.class); - - @Inject - @Extension - private XAnnotationExtensions _xAnnotationExtensions; - - @Inject - @Extension - private ProcessorInstanceForJvmTypeProvider _processorInstanceForJvmTypeProvider; - - @Inject - private Provider compilationUnitProvider; - - @Inject - private OperationCanceledManager operationCanceledManager; - - @Inject - private ReflectExtensions reflect; - - public ActiveAnnotationContexts computeContext(final XtendFile file) { - final Stopwatches.StoppedTask task = Stopwatches.forTask("[macros] findActiveAnnotations (ActiveAnnotationContextProvider.computeContext)"); - task.start(); - try { - final ActiveAnnotationContexts result = ActiveAnnotationContexts.installNew(file.eResource()); - final CompilationUnitImpl compilationUnit = this.compilationUnitProvider.get(); - compilationUnit.setXtendFile(file); - this.reflect.set(result, "compilationUnit", compilationUnit); - final IAcceptor> _function = (Pair it) -> { - boolean _containsKey = result.getContexts().containsKey(it.getKey()); - boolean _not = (!_containsKey); - if (_not) { - final ActiveAnnotationContext fa = new ActiveAnnotationContext(); - fa.setCompilationUnit(compilationUnit); - final JvmType processorType = this._xAnnotationExtensions.getProcessorType(it.getKey()); - try { - final Object processorInstance = this._processorInstanceForJvmTypeProvider.getProcessorInstance(processorType); - if ((processorInstance == null)) { - String _identifier = processorType.getIdentifier(); - String _plus = ("Couldn\'t instantiate the annotation processor of type \'" + _identifier); - String _plus_1 = (_plus + "\'. This is usually the case when the processor resides in the same project as the annotated element."); - throw new IllegalStateException(_plus_1); - } - fa.setProcessorInstance(processorInstance); - } catch (final Throwable _t) { - if (_t instanceof VirtualMachineError) { - final VirtualMachineError e = (VirtualMachineError)_t; - throw e; - } else if (_t instanceof Throwable) { - final Throwable e_1 = (Throwable)_t; - this.operationCanceledManager.propagateAsErrorIfCancelException(e_1); - String _switchResult = null; - boolean _matched = false; - if (e_1 instanceof ExceptionInInitializerError) { - _matched=true; - _switchResult = ((ExceptionInInitializerError)e_1).getException().getMessage(); - } - if (!_matched) { - _switchResult = e_1.getMessage(); - } - final String msg = _switchResult; - EList _errors = file.eResource().getErrors(); - StringConcatenation _builder = new StringConcatenation(); - _builder.append("Problem while loading annotation processor: "); - _builder.append(msg); - XAnnotation _value = it.getValue(); - EObjectDiagnosticImpl _eObjectDiagnosticImpl = new EObjectDiagnosticImpl(Severity.ERROR, - IssueCodes.PROCESSING_ERROR, _builder.toString(), _value, - XAnnotationsPackage.Literals.XANNOTATION__ANNOTATION_TYPE, (-1), null); - _errors.add(_eObjectDiagnosticImpl); - } else { - throw Exceptions.sneakyThrow(_t); - } - } - result.getContexts().put(it.getKey(), fa); - } - List _annotatedSourceElements = result.getContexts().get(it.getKey()).getAnnotatedSourceElements(); - XtendAnnotationTarget _annotatedTarget = this._xAnnotationExtensions.getAnnotatedTarget(it.getValue()); - _annotatedSourceElements.add(_annotatedTarget); - }; - this.searchAnnotatedElements(file, _function); - return result; - } catch (final Throwable _t) { - if (_t instanceof Throwable) { - final Throwable e = (Throwable)_t; - this.operationCanceledManager.propagateAsErrorIfCancelException(e); - boolean _matched = false; - if (e instanceof VirtualMachineError) { - _matched=true; - throw ((VirtualMachineError)e); - } - if (!_matched) { - if (e instanceof LinkageError) { - _matched=true; - throw ((LinkageError)e); - } - } - //ActiveAnnotationContextProvider.logger.warn("Error finding the elements to be processed by active annotations", e); - return ActiveAnnotationContexts.installNew(file.eResource()); - } else { - throw Exceptions.sneakyThrow(_t); - } - } finally { - task.stop(); - } - } - - /** - * recursively looks for macro annotations on XtendAnnotationTargets - */ - protected void searchAnnotatedElements(final EObject element, final IAcceptor> acceptor) { - boolean _matched = false; - if (element instanceof XtendFile) { - _matched=true; - final Consumer _function = (XtendTypeDeclaration it) -> { - this.searchAnnotatedElements(it, acceptor); - }; - ((XtendFile)element).getXtendTypes().forEach(_function); - } - if (!_matched) { - if (element instanceof XtendClass) { - _matched=true; - this.registerMacroAnnotations(((XtendAnnotationTarget)element), acceptor); - final Consumer _function = (XtendMember it) -> { - this.searchAnnotatedElements(it, acceptor); - }; - ((XtendClass)element).getMembers().forEach(_function); - } - } - if (!_matched) { - if (element instanceof XtendInterface) { - _matched=true; - this.registerMacroAnnotations(((XtendAnnotationTarget)element), acceptor); - final Consumer _function = (XtendMember it) -> { - this.searchAnnotatedElements(it, acceptor); - }; - ((XtendInterface)element).getMembers().forEach(_function); - } - } - if (!_matched) { - if (element instanceof XtendEnum) { - _matched=true; - this.registerMacroAnnotations(((XtendAnnotationTarget)element), acceptor); - final Consumer _function = (XtendMember it) -> { - this.searchAnnotatedElements(it, acceptor); - }; - ((XtendEnum)element).getMembers().forEach(_function); - } - } - if (!_matched) { - if (element instanceof XtendAnnotationType) { - _matched=true; - this.registerMacroAnnotations(((XtendAnnotationTarget)element), acceptor); - final Consumer _function = (XtendMember it) -> { - this.searchAnnotatedElements(it, acceptor); - }; - ((XtendAnnotationType)element).getMembers().forEach(_function); - } - } - if (!_matched) { - if (element instanceof XtendFunction) { - _matched=true; - this.registerMacroAnnotations(((XtendAnnotationTarget)element), acceptor); - final Consumer _function = (XtendParameter it) -> { - this.searchAnnotatedElements(it, acceptor); - }; - ((XtendFunction)element).getParameters().forEach(_function); - } - } - if (!_matched) { - if (element instanceof XtendConstructor) { - _matched=true; - this.registerMacroAnnotations(((XtendAnnotationTarget)element), acceptor); - final Consumer _function = (XtendParameter it) -> { - this.searchAnnotatedElements(it, acceptor); - }; - ((XtendConstructor)element).getParameters().forEach(_function); - } - } - if (!_matched) { - if (element instanceof XtendAnnotationTarget) { - _matched=true; - this.registerMacroAnnotations(((XtendAnnotationTarget)element), acceptor); - } - } - } - - protected void registerMacroAnnotations(final XtendAnnotationTarget candidate, final IAcceptor> acceptor) { - final Function1 _function = (XAnnotation it) -> { - return Boolean.valueOf(this._xAnnotationExtensions.isProcessed(it)); - }; - Iterable _filter = IterableExtensions.filter(candidate.getAnnotations(), _function); - for (final XAnnotation annotation : _filter) { - { - final JvmAnnotationType activeAnnotationDeclaration = this._xAnnotationExtensions.tryFindAnnotationType(annotation); - if ((activeAnnotationDeclaration != null)) { - boolean _isValid = this.isValid(annotation, activeAnnotationDeclaration); - if (_isValid) { - Pair _mappedTo = Pair.of(activeAnnotationDeclaration, annotation); - acceptor.accept(_mappedTo); - } - } - } - } - } - - private boolean isValid(final XAnnotation annotation, final JvmAnnotationType activeAnnotationDeclaration) { - return (annotation != null); - } - -} diff --git a/main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/SarlCompiler.java b/main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/SarlCompiler.java index 806e0dd07a..f8bc20da4f 100644 --- a/main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/SarlCompiler.java +++ b/main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/SarlCompiler.java @@ -82,7 +82,6 @@ import org.eclipse.xtext.xbase.XVariableDeclaration; import org.eclipse.xtext.xbase.compiler.IGeneratorConfigProvider; import org.eclipse.xtext.xbase.compiler.output.ITreeAppendable; -import org.eclipse.xtext.xbase.lib.util.ReflectExtensions; import org.eclipse.xtext.xbase.scoping.batch.IFeatureNames; import org.eclipse.xtext.xbase.typesystem.IBatchTypeResolver; import org.eclipse.xtext.xbase.typesystem.IResolvedTypes; @@ -166,10 +165,6 @@ public class SarlCompiler extends XtendCompiler { @Inject private ISarlEarlyExitComputer earlyExit; - //FIXME: Remove according to https://github.com/eclipse/xtext-extras/pull/331 - @Inject - private ReflectExtensions reflect; - private volatile boolean isOnJavaEarlyExit; @SuppressWarnings({"checkstyle:returncount", "checkstyle:npathcomplexity", "checkstyle:cyclomaticcomplexity"}) @@ -819,8 +814,7 @@ private ITreeAppendable toSerializableAnonymousClassProxyDefinition(XClosure clo final LightweightTypeReference returnType = getClosureOperationReturnType(type, operation); appendOperationVisibility(appendable, operation); if (!operation.getTypeParameters().isEmpty()) { - //FIXME: Remove reflect according to https://github.com/eclipse/xtext-extras/pull/331 - this.reflect.invoke(this, "appendTypeParameters", appendable, operation, type); //$NON-NLS-1$ + appendTypeParameters(appendable, operation, type); } appendable.append(returnType); appendable.append(" ").append(operation.getSimpleName()); //$NON-NLS-1$ @@ -856,8 +850,7 @@ private ITreeAppendable toSerializableAnonymousClassProxyDefinition(XClosure clo compile(closure.getExpression(), contextAppendable, returnType, newHashSet(operation.getExceptions())); - //FIXME: Remove reflect according to https://github.com/eclipse/xtext-extras/pull/331 - this.reflect.invoke(this, "closeBlock", appendable); //$NON-NLS-1$ + closeBlock(appendable); } catch (Exception exception) { throw new RuntimeException(exception); } finally { @@ -909,8 +902,7 @@ private ITreeAppendable toSerializableAnonymousClass(XClosure closure, ITreeAppe } appendOperationVisibility(appendable, operation); if (!operation.getTypeParameters().isEmpty()) { - //FIXME: Remove reflect according to https://github.com/eclipse/xtext-extras/pull/331 - this.reflect.invoke(this, "appendTypeParameters", appendable, operation, type); //$NON-NLS-1$ + appendTypeParameters(appendable, operation, type); } appendable.append(returnType); appendable.append(" ").append(operation.getSimpleName()); //$NON-NLS-1$ @@ -947,8 +939,7 @@ private ITreeAppendable toSerializableAnonymousClass(XClosure closure, ITreeAppe reassignThisInClosure(appendable, null); } compile(closure.getExpression(), appendable, returnType, newHashSet(operation.getExceptions())); - //FIXME: Remove reflect according to https://github.com/eclipse/xtext-extras/pull/331 - this.reflect.invoke(this, "closeBlock", appendable); //$NON-NLS-1$ + closeBlock(appendable); } catch (Exception exception) { throw new RuntimeException(exception); } finally { diff --git a/main/coreplugins/io.sarl.lang/src/io/sarl/lang/macro/SarlActiveAnnotationContextProvider.java b/main/coreplugins/io.sarl.lang/src/io/sarl/lang/macro/SarlActiveAnnotationContextProvider.java index 901d270113..6bf2a2e7e4 100644 --- a/main/coreplugins/io.sarl.lang/src/io/sarl/lang/macro/SarlActiveAnnotationContextProvider.java +++ b/main/coreplugins/io.sarl.lang/src/io/sarl/lang/macro/SarlActiveAnnotationContextProvider.java @@ -22,12 +22,12 @@ package io.sarl.lang.macro; import org.eclipse.emf.ecore.EObject; +import org.eclipse.xtend.core.macro.ActiveAnnotationContextProvider; import org.eclipse.xtext.common.types.JvmAnnotationType; import org.eclipse.xtext.util.IAcceptor; import org.eclipse.xtext.xbase.annotations.xAnnotations.XAnnotation; import org.eclipse.xtext.xbase.lib.Pair; -import io.sarl.lang.bugfixes.pending.bug868.Bug868ActiveAnnotationContextProvider; import io.sarl.lang.sarl.SarlAgent; import io.sarl.lang.sarl.SarlBehavior; import io.sarl.lang.sarl.SarlSkill; @@ -42,7 +42,7 @@ * @mavenartifactid $ArtifactId$ * @since 0.9 */ -public class SarlActiveAnnotationContextProvider extends Bug868ActiveAnnotationContextProvider { +public class SarlActiveAnnotationContextProvider extends ActiveAnnotationContextProvider { @Override protected void searchAnnotatedElements(final EObject element, final IAcceptor> acceptor) { diff --git a/main/coreplugins/io.sarl.lang/src/io/sarl/lang/scoping/SARLImplicitlyImportedFeatures.java b/main/coreplugins/io.sarl.lang/src/io/sarl/lang/scoping/SARLImplicitlyImportedFeatures.java index 7a522a378d..e12016999b 100644 --- a/main/coreplugins/io.sarl.lang/src/io/sarl/lang/scoping/SARLImplicitlyImportedFeatures.java +++ b/main/coreplugins/io.sarl.lang/src/io/sarl/lang/scoping/SARLImplicitlyImportedFeatures.java @@ -28,8 +28,6 @@ import com.google.inject.Singleton; import org.eclipse.xtext.xbase.scoping.batch.ImplicitlyImportedFeatures; -import io.sarl.lang.bugfixes.pending.pr106.PR106ArrayExtensions; -import io.sarl.lang.bugfixes.pending.pr106.PR106ArrayLiterals; import io.sarl.lang.scoping.extensions.numbers.cast.NumberCastImplicitlyImportedFeatures; import io.sarl.lang.scoping.extensions.numbers.comparison.NumberComparisonImplicitlyImportedFeatures; import io.sarl.lang.scoping.extensions.time.TimeExtensions; @@ -60,19 +58,10 @@ public SARLImplicitlyImportedFeatures() { super(); } - @Override - protected List> getStaticImportClasses() { - final List> xtextList = super.getStaticImportClasses(); - // Insert at the beginning for ensuring the SARL extension is selected before any Xtext extension. - xtextList.add(0, PR106ArrayLiterals.class); - return xtextList; - } - @Override protected List> getExtensionClasses() { final List> xtextList = super.getExtensionClasses(); // Insert at the beginning for ensuring the SARL extension is selected before any Xtext extension. - xtextList.add(0, PR106ArrayExtensions.class); xtextList.add(0, TimeExtensions.class); // Add features related to numbers.