From 9b2e2dff2148eb1549066cfaee432264abcd528a Mon Sep 17 00:00:00 2001 From: Kai Brassel <mail@khbrassel.de> Date: Wed, 6 Apr 2022 13:11:40 +0200 Subject: [PATCH] Code for conversion TimeOfDay from String was lost; Use Java 17 --- de.hftstuttgart.cityunits.model.edit/.classpath | 8 ++++++-- de.hftstuttgart.cityunits.model/.classpath | 4 ++-- .../model/Quantities.genmodel | 4 ++-- .../model/quantities/impl/QuantitiesFactoryImpl.java | 11 ++++++++++- pom.xml | 4 ++-- 5 files changed, 22 insertions(+), 9 deletions(-) diff --git a/de.hftstuttgart.cityunits.model.edit/.classpath b/de.hftstuttgart.cityunits.model.edit/.classpath index b405857..fe1a205 100644 --- a/de.hftstuttgart.cityunits.model.edit/.classpath +++ b/de.hftstuttgart.cityunits.model.edit/.classpath @@ -1,7 +1,11 @@ <?xml version="1.0" encoding="UTF-8"?> <classpath> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-16"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17"> + <attributes> + <attribute name="module" value="true"/> + </attributes> + </classpathentry> <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> - <classpathentry kind="src" path="src/"/> + <classpathentry kind="src" path="src"/> <classpathentry kind="output" path="target/classes"/> </classpath> diff --git a/de.hftstuttgart.cityunits.model/.classpath b/de.hftstuttgart.cityunits.model/.classpath index 24b87a3..fe1a205 100644 --- a/de.hftstuttgart.cityunits.model/.classpath +++ b/de.hftstuttgart.cityunits.model/.classpath @@ -1,11 +1,11 @@ <?xml version="1.0" encoding="UTF-8"?> <classpath> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-16"> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17"> <attributes> <attribute name="module" value="true"/> </attributes> </classpathentry> <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> - <classpathentry kind="src" path="src/"/> + <classpathentry kind="src" path="src"/> <classpathentry kind="output" path="target/classes"/> </classpath> diff --git a/de.hftstuttgart.cityunits.model/model/Quantities.genmodel b/de.hftstuttgart.cityunits.model/model/Quantities.genmodel index eeba660..7c147bf 100644 --- a/de.hftstuttgart.cityunits.model/model/Quantities.genmodel +++ b/de.hftstuttgart.cityunits.model/model/Quantities.genmodel @@ -2,12 +2,12 @@ <genmodel:GenModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" modelDirectory="/de.hftstuttgart.cityunits.model/src" creationIcons="false" modelPluginID="de.hftstuttgart.cityunits.model" modelName="Quantities" rootExtendsClass="org.eclipse.emf.ecore.impl.MinimalEObjectImpl$Container" - importerID="org.eclipse.emf.importer.ecore" complianceLevel="11.0" copyrightFields="false" + importerID="org.eclipse.emf.importer.ecore" complianceLevel="17.0" copyrightFields="false" importOrganizing="true"> <foreignModel>Quantities.ecore</foreignModel> <genPackages prefix="Quantities" basePackage="de.hftstuttgart.cityunits.model" disposableProviderFactory="true" ecorePackage="Quantities.ecore#/"> <genDataTypes ecoreDataType="Quantities.ecore#//Quantity" create="return de.hftstuttgart.cityunits.model.NullableQuantity.create(it);"/> - <genDataTypes ecoreDataType="Quantities.ecore#//TimeOfDay"/> + <genDataTypes ecoreDataType="Quantities.ecore#//TimeOfDay" create="return java.time.LocalTime.parse(it);"/> </genPackages> </genmodel:GenModel> diff --git a/de.hftstuttgart.cityunits.model/src/de/hftstuttgart/cityunits/model/quantities/impl/QuantitiesFactoryImpl.java b/de.hftstuttgart.cityunits.model/src/de/hftstuttgart/cityunits/model/quantities/impl/QuantitiesFactoryImpl.java index 82031e8..f2b2567 100644 --- a/de.hftstuttgart.cityunits.model/src/de/hftstuttgart/cityunits/model/quantities/impl/QuantitiesFactoryImpl.java +++ b/de.hftstuttgart.cityunits.model/src/de/hftstuttgart/cityunits/model/quantities/impl/QuantitiesFactoryImpl.java @@ -125,13 +125,22 @@ public class QuantitiesFactoryImpl extends EFactoryImpl implements QuantitiesFac return super.convertToString(eDataType, instanceValue); } + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public LocalTime createTimeOfDay(final String it) { + return java.time.LocalTime.parse(it); + } + /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public LocalTime createTimeOfDayFromString(EDataType eDataType, String initialValue) { - return (LocalTime)super.createFromString(eDataType, initialValue); + return createTimeOfDay(initialValue); } /** diff --git a/pom.xml b/pom.xml index f56b22f..6723fb6 100644 --- a/pom.xml +++ b/pom.xml @@ -19,8 +19,8 @@ <artifactId>tycho-maven-plugin</artifactId> <version>${tycho-version}</version> <configuration> - <source>16</source> - <target>16</target> + <source>17</source> + <target>17</target> <encoding>UTF-8</encoding> </configuration> <extensions>true</extensions> -- GitLab