Skip to content
This repository has been archived by the owner on Apr 21, 2023. It is now read-only.

Build xbase and xtend lib built with Java 6 #45

Closed
svenefftinge opened this issue Mar 16, 2017 · 5 comments
Closed

Build xbase and xtend lib built with Java 6 #45

svenefftinge opened this issue Mar 16, 2017 · 5 comments
Labels

Comments

@svenefftinge
Copy link
Member

To allow usage of xtend on Java 6 runtimes, we need to make sure the libs are compiled for that.

@spoenemann
Copy link
Member

The xtext-lib project is already built with sourceCompatibility = '1.6', and the default value of targetCompatibilityis to follow sourceCompatibility. Is there anything else to do for this issue?

@cdietrich
Copy link
Member

@spoenemann
Copy link
Member

We switched to Java 6 on xtext-lib at some time after the restructuring, so I think we can close this now.

@cdietrich cdietrich reopened this Jun 12, 2017
@cdietrich
Copy link
Member

java 6 code with java 8 api is generated

+import java.util.function.Consumer;
 import org.eclipse.xtend.lib.annotations.AccessorsProcessor;
 import org.eclipse.xtend.lib.annotations.EqualsHashCodeProcessor;
 import org.eclipse.xtend.lib.annotations.FinalFieldsConstructorProcessor;
@@ -101,13 +102,13 @@ public class DataProcessor extends AbstractClassProcessor {
     final ToStringProcessor.Util toStringUtil = new ToStringProcessor.Util(context);
     @Extension
     final FinalFieldsConstructorProcessor.Util requiredArgsUtil = new FinalFieldsConstructorProcessor.Util(context);
-    final Procedure1<MutableFieldDeclaration> _function = new Procedure1<MutableFieldDeclaration>() {
+    final Consumer<MutableFieldDeclaration> _function = new Consumer<MutableFieldDeclaration>() {
       @Override
-      public void apply(final MutableFieldDeclaration it) {
+      public void accept(final MutableFieldDeclaration it) {
         it.setFinal(true);
       }
     };
-    IterableExtensions.forEach(util.getDataFields(it), _function);
+    util.getDataFields(it).forEach(_function);
     boolean _needsFinalFieldConstructor = requiredArgsUtil.needsFinalFieldConstructor(it);
     if (_needsFinalFieldConstructor) {
       requiredArgsUtil.addFinalFieldsConstructor(it);
@@ -127,9 +128,9 @@ public class DataProcessor extends AbstractClassProcessor {
     if (_not_2) {
       util.addDataToString(it);
     }
-    final Procedure1<MutableFieldDeclaration> _function_1 = new Procedure1<MutableFieldDeclaration>() {
+    final Consumer<MutableFieldDeclaration> _function_1 = new Consumer<MutableFieldDeclaration>() {
       @Override
-      public void apply(final MutableFieldDeclaration it) {
+      public void accept(final MutableFieldDeclaration it) {
         boolean _shouldAddGetter = getterUtil.shouldAddGetter(it);
         if (_shouldAddGetter) {
           getterUtil.addGetter(it, Visibility.PUBLIC);
@@ -139,6 +140,6 @@ public class DataProcessor extends AbstractClassProcessor {
         it.setSimpleName(_plus);
       }
     };
-    IterableExtensions.forEach(util.getDataFields(it), _function_1);
+    util.getDataFields(it).forEach(_function_1);
   }
 }

@cdietrich
Copy link
Member

We moved to Java 8 no so this is obsolete

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants