Version 21.6.0-rc01

New and Noteworthy in Version 21.6 Release Candidate 1

Replacing BigDecimal constants with RoundingMode enums

RoundingMode enums are now used instead of BigDecimal rounding mode constants which are deprecated since Java 9. The old methods using BigDecimal constants are still available but deprecated. Instead the new methods with RoundingMode enums should be used.

Upgrading the Faktor-IPS-Runtime to Java 8

The following projects will be compiled with Java 8 from now on:

  • org.faktorips.runtime.groovy
  • org.faktorips.runtime
  • org.faktorips.valuetypes.joda
  • org.faktorips.valuetypes

The code generator now uses StringBuilder instead of StringBuffer.
DecimalUtils was moved from f10-commons to org.faktorips.valuetypes and renamed to Decimals.

The following changes have been made to the classes and methods:

Class Changes
org.faktorips.util.IntegerUtils
Deleted. The utility class contained the method compare(int x, int y). Since Java 7 this method has been included in java.lang.Integer, which makes this class useless.
org.faktorips.runtime.TableFunctionExecution Deleted. The interface was deprecated and no longer used.
org.faktorips.runtime.modeltype.IModelTypeAttribute Deleted. The interface was deprecated. Instead org.faktorips.runtime.model.type.Attribute can be used directly.
org.faktorips.runtime.modeltype.IModelTypeAssociation Deleted. The interface was deprecated. Instead org.faktorips.runtime.model.type.Association can be used directly.
org.faktorips.runtime.modeltype.IModelType Deleted. The interface was deprecated. Instead org.faktorips.runtime.model.type.Type can be used directly.
org.faktorips.runtime.modeltype.IModelElement Deleted. The interface was deprecated. Instead org.faktorips.runtime.model.type.ModelElement can be used directly.
org.faktorips.devtools.core.ui.filter.AbstractProductCmptPropertyFilter Deleted. The class was deprecated.
org.faktorips.devtools.core.ui.table.ColumnChangeListener Deleted.
org.faktorips.devtools.core.ui.table.IdentifierGenerator Deleted.
org.faktorips.runtime.util.StringBuilderJoiner Added. The utility class contains methods to add elements to existing StringBuilder objects like with String#join.
org.faktorips.runtime.util.AbstractMessageList Added. The abstract class is a superclass of org.faktorips.util.message.MessageList and org.faktorips.runtime.MessageList.
org.faktorips.runtime.util.IMessage Added. The interface is implemented by org.faktorips.util.message.Message and org.faktorips.runtime.Message.
org.faktorips.runtime.util.function.IPredicate Deprecated. Instead java.util.function.Predicate can be used directly.

 

Method Changes
org.faktorips.runtime.model.type.Association
#getAssociationType()
Deleted. The method was deprecated. Use getAssociationKind() instead.
org.faktorips.runtime.model.type.Association
#isProductRelevant()
Deleted. The method was deprecated. Use isMatchingAssociationPresent() instead.
org.faktorips.runtime.model.type.Attribute
#getAttributeType()
Deleted. The method was deprecated. Use getAttributeKind() instead.
org.faktorips.runtime.model.type.Attribute
#getValueSetType()
Deleted. The method was deprecated. Use getValueSetKind() instead.
org.faktorips.values.ObjectUtil
#equals(Object, Object)
Deprecated. Use java.util.Objects#equals instead.
org.faktorips.codegen.CodeFragment
#appendJoined(Iterable)
Added. Appends the Iterable’s content converted to String and separated by commas to the source code.
org.faktorips.codegen.CodeFragment
#appendJoined(Object[])
Added. Appends the arrays content converted to String and separated by commas to the source code.
org.faktorips.codegen.JavaCodeFragment
#appendJoined(JavaCodeFragment[])
Added. Appends the arrays content converted to String and separated by commas to the source code.
org.faktorips.runtime.internal.IpsStringUtils
#join(Iterable, String)
Added. Joins the elements of the provided Iterable into a single String containing the provided elements separated by the given String.
org.faktorips.runtime.internal.IpsStringUtils
#join(Iterable)
Added. Joins the elements of the provided Iterable into a single String containing the provided elements separated by commas.
org.faktorips.runtime.internal.IpsStringUtils
#join(Object[], String)
Added. Joins the elements of the provided array into a single String containing the provided elements separated by the given String.
org.faktorips.runtime.internal.IpsStringUtils
#join(Object[])
Added. Joins the elements of the provided array into a single String containing the provided elements separated by commas.
org.faktorips.runtime.internal.IpsStringUtils
#join(Iterable, Function)
Added. Joins the elements of the provided Iterable into a single String containing the provided elements, converted to String with the given Function, separated by commas.
org.faktorips.runtime.internal.tableindex.RangeType
#findValue(TreeMap<K,V>, K)
Added. Alternative method to getValue(TreeMap<K,V>,K). Returns an Optional.
org.faktorips.runtime.internal.toc.ProductCmptTocEntry
#findNextGenerationEntry(Calendar)
Added. Alternative method to getNextGenerationEntry(Calendar). Returns an Optional.
org.faktorips.runtime.internal.toc.ProductCmptTocEntry
#findPreviousGenerationEntry(Calendar)
Added. Alternative method to getPreviousGenerationEntry(Calendar). Returns an Optional.
org.faktorips.runtime.internal.toc.ProductCmptTocEntry
#findLatestGenerationEntry()
Added. Alternative method to getLatestGenerationEntry(). Returns an Optional.
org.faktorips.runtime.internal.toc.ProductCmptTocEntry
#findGenerationEntry(Calendar)
Added. Alternative method to getGenerationEntry(Calendar). Returns an Optional.
org.faktorips.runtime.internal.toc.ProductCmptTocEntry
#findGenerationEntry(DateTime)
Added. Alternative method to getGenerationEntry(DateTime). Returns an Optional.
org.faktorips.runtime.internal.XmlUtil
#findFirstElement(Node, String)
Added. Alternative method to getFirstElement(Node,String). Returns an Optional.
org.faktorips.runtime.internal.XmlUtil
#findFirstElement(Node)
Added. Alternative method to getFirstElement(Node). Returns an Optional.
org.faktorips.runtime.model.type.Type
#findJavaInterface()
Added. Alternative method to getJavaInterface(). Returns an Optional.
org.faktorips.runtime.model.type.Type
#findDeclaredMethod(Class<T>, AnnotatedElementMatcher<T>)
Added. Alternative method to searchDeclaredMethod(Class<T>, AnnotatedElementMatcher<T>). Returns an Optional.
org.faktorips.runtime.model.type.Type
#findSuperType()
Added. Alternative method to getSuperType(). Returns an Optional.
org.faktorips.runtime.internal.ValueToXmlHelper
#isAttributeTrue(Element, String)
Added. Returns whether the given element has an attribute by the given name that has the value true.

Generic Validation of Attributes

Faktor-IPS allows configuration of value sets (and with those, an attribute’s relevance: an empty value set means an attribute is irrelevant and no value should be set; when null is not part of the value set, the attribute is mandatory). Faktor-IPS allows easy creation of validation rules for value sets – but for every such rule, a custom message and parameters had to be implemented.
Faktor-IPS 21.6 now can use a generic validation (activated with a checkbox on the attribute’s Validation Rule tab). It checks three cases:

  1. Irrelevant attribute: value is set
  2. Mandatory attribute: no value is set
  3. Value set: value is not allowed

The error messages created by this validation can be adapted with a custom implementation of IGenericAttributeValidationConfiguration (or extension of the DefaultGenericAttributeValidationConfiguration) via the IValidationContext. This can also be used to exempt attributes from the validation, for example when they can only be checked after another attribute’s value has been set.
The <Setting enabled="true" name="genericValidationDefault"/> in the .ipsproject configuration file enables this validation for all newly created attributes.

Deprecation of BusinessFunctions

Faktor-IPS contained two different concepts with the name “BusinessFunction”. Both are to our knowledge no longer used in active projects, so we decided to mark them as deprecated and remove them completely in one of the next releases.

Migration

The migration to Faktor-IPS 21.6 must be started from a Faktor-IPS no older than 20.6, because it changes some internal IDs in the files .project, .ipsproject and sometimes .classpath (from org.faktorips.devtools.core to org.faktorips.devtools.model). Custom plugins must also be adapted to these changes, because many classes had to be moved. In most cases, the Eclipse operation “Organize Imports” should do the job.

Generation of Faktor-IPS projects using Maven-Archetypes

Faktor-IPS projects can be created directly as Maven projects by using Maven-Archetypes. A manual for the usage of the archetype for Faktor-IPS can be found here.

Maven Mojo

With the new Mojo “faktorips-build”, the Faktor-IPS build can now be integrated directly into Maven. By default, the Mojo uses Eclipse 2019-03 and the latest Faktor-IPS version from the faktorzehn.org update sites. However, these settings can be changed through parameters. In addition, there are further parameters to configure additional plugins and repositories, the JDK with which the project is to be built, the path to an ant build script, import a FIPS Project as Maven project and various other settings. The Mojo can be used in the following way:

<project>
    ...
    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.faktorips</groupId>
                    <artifactId>faktorips-maven-plugin</artifactId>
                    <version>21.6.0</version>
                </plugin>
                ...
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.faktorips</groupId>
                <artifactId>faktorips-maven-plugin</artifactId>
                <configuration>
                    <jdkId>JavaSE-1.8</jdkId>
                    <!-- <executionEnvironment>JavaSE-11</executionEnvironment> -->
                    <!-- <jdkDir>/usr/lib/jvm/java-8-openjdk-amd64/</jdkDir> -->
                    <!-- <exportHtml>false</exportHtml> -->
                    <!-- <importAsMavenProject>false</importAsMavenProject> -->
                    <!-- <antScriptPath>${project.basedir}/build/importProjects.xml</antScriptPath> -->
                    <!-- <fipsRepositoryVersion>21.6</fipsRepositoryVersion> -->
                    <!-- <fipsRepository>https://update.faktorzehn.org/faktorips/21.6/</fipsRepository> -->
                    <!-- <thirdpartyRepository>https://drone.faktorzehn.de/p2/thirdparty-1.6</thirdpartyRepository> -->
                    <!-- <eclipseRepository>http://update.faktorzehn.org/p2repositories/2019-03/</eclipseRepository> -->
                    <additionalPlugins>
                        <dependency>
                            <artifactId>org.faktorips.productvariant.core</artifactId>
                            <type>eclipse-plugin</type>
                        </dependency>
                        ...
                    </additionalPlugins>
                    <additionalRepositories>
                        <repository>
                            <id>productvariants</id>
                            <layout>p2</layout>
                            <url>https://update.faktorzehn.org/faktorips/productvariants/21.6</url>
                        </repository>
                        ...
                    </additionalRepositories>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>faktorips-build</goal>
                        </goals>
                        <phase>process-resources</phase>
                    </execution>
                </executions>
            </plugin>
            ...
        </plugins>
    </build>
    ...
</project>

Further information on the plugin can be found in the documentation.

New Ant tasks

Two new ant tasks have been added.

  • MavenProjectImportTask
  • MavenProjectRefreshTask

With the MavenProjectImportTask it is now possibel to import a FIPS project as a maven project. This task will also support multi module maven projects by just adding the root pom.


<taskdef name="faktorips.mavenImport" classname="org.faktorips.devtools.ant.MavenProjectImportTask" />
<target name="import">
    <faktorips.mavenImport dir="${dirToMavenProject}" />
</target>

Also a own task for refreshing all maven projects in a workspace has been added. It takes the same parameters and uses the same defaults as the “Update Project…” dialog in Eclipse.


<taskdef name="faktorips.mavenRefresh" classname="org.faktorips.devtools.ant.MavenProjectRefreshTask" />
<target name="refresh">
    <!-- parameters with their default values -->
    <faktorips.mavenRefresh offline="false" updateSnapshots="false" updateConfiguration="true" refreshFromFilesystem="true" cleanProjects="true" />
</target>

Changes in the Faktor-IPS Design-Time

Except for the new minimal requirements the changes in the Faktor-IPS design time only affect developers that wrote their own plugins.

Upgrade to Java 11

All Faktor-IPS plugins including the test and internationalization projects have been upgraded to Bundle-RequiredExecutionEnvironment: JavaSE-11

Increased the minimum required Eclipse version

The minimum requirement for Faktor-IPS has been increased from Luna (4.4) to Eclipse 2019-03.

New plugin projects

In order to be able to separate Eclipse and UI more clearly some of the Faktor-IPS plugin projects had to be divided.

Therefore following new plugin projects have been added:

  • org.faktorips.devtools.core.refactor
  • org.faktorips.devtools.htmlexport.ui
  • org.faktorips.devtools.model.builder
  • org.faktorips.devtools.model
  • org.faktorips.devtools.model.decorators
  • org.faktorips.m2e

Changed Packages

Packages Changed to
org.faktorips.devtools.stdbuilder.refactor org.faktorips.devtools.core.refactor
org.faktorips.devtools.htmlexport org.faktorips.devtools.htmlexport.ui
org.faktorips.devtools.htmlexport.wizards org.faktorips.devtools.htmlexport.ui.wizards
org.faktorips.devtools.core.builder org.faktorips.devtools.model.builder.java
org.faktorips.devtools.core.model org.faktorips.devtools.model
org.faktorips.devtools.core.model.* org.faktorips.devtools.model.*

Changed call to IpsModel

The call to IpsPlugin.getDefault().getIpsModel() has been simplified to IIpsModel.get().

Changed Extension-Point-IDs

Extension-Point-IDs Changed to
org.faktorips.devtools.core.artefactbuilderset org.faktorips.devtools.model.artefactbuilderset
org.faktorips.devtools.core.loggingFrameworkConnector org.faktorips.devtools.model.loggingFrameworkConnector
org.faktorips.devtools.core.artefactbuilderset org.faktorips.devtools.model.artefactbuilderset
org.faktorips.devtools.core.objectExtensionProperty org.faktorips.devtools.model.objectExtensionProperty
org.faktorips.devtools.core.datatypeDefinition org.faktorips.devtools.model.datatypeDefinition
org.faktorips.devtools.core.faktorIpsFeatureVersionManager org.faktorips.devtools.model.faktorIpsFeatureVersionManager
org.faktorips.devtools.core.ipsMigrationOperation org.faktorips.devtools.model.ipsMigrationOperation
org.faktorips.devtools.core.loggingFrameworkConnector org.faktorips.devtools.model.loggingFrameworkConnector
org.faktorips.devtools.core.ipsobjecttype org.faktorips.devtools.model.ipsobjecttype
org.faktorips.devtools.core.flFunctionResolverFactory org.faktorips.devtools.model.flFunctionResolverFactory
org.faktorips.devtools.core.customValidation org.faktorips.devtools.model.customValidation
org.faktorips.devtools.core.productComponentNamingStrategy org.faktorips.devtools.model.productComponentNamingStrategy
org.faktorips.devtools.core.ipsObjectPathContainerType org.faktorips.devtools.model.ipsObjectPathContainerType
org.faktorips.devtools.core.deepCopyOperation org.faktorips.devtools.model.deepCopyOperation
org.faktorips.devtools.core.flIdentifierFilterExtension org.faktorips.devtools.model.flIdentifierFilterExtension
org.faktorips.devtools.core.versionProvider org.faktorips.devtools.model.versionProvider

Unified Message & MessageList

Message, MessageList and MessageLists from the package org.faktorips.util.message were unified with the runtime classes in the package org.faktorips.runtime. Only the runtime messages are now used.

IIpsDecorators

The individual implementations of org.eclipse.ui.model.IWorkbenchAdapter in the org.faktorips.devtools.core.ui project have been replaced by a generic implementation. For this purpose, the icons of the various Faktor-IPS types were moved to the org.faktorips.devtools.model.decorators project. To register your own icons and labels for Faktor-IPS types, the extension point org.faktorips.devtools.model.decorators.decoratorsProvider has been added.

Release Notes – Faktor-IPS – Version 21.6

Bugs

  • Different Faktor-IPS objects could have the same qualified name (FIPS-4767)
  • Typo in generated method names (FIPS-5841)
  • createPolicyComponent() is generated wrong for product component types without policy component types (FIPS-5843)
  • Model types are exported twice from indirect maven dependency (FIPS-6000)
  • Typo in Javadoc for TableUsage getter (FIPS-6304)
  • Editor scrolls horizontally (FIPS-6528)
  • IPS code generator creates blank in comment (FIPS-6690)
  • Declaration of @implements with generics creates invalid html tags (FIPS-6704)
  • Overwriting an attribute with “SINGLE_TABLE” persistence strategy wants different column name (FIPS-6906)
  • Add IPS-Nature with Java-11 module project creates unusable configuration (FIPS-6976)
  • Making a policy attribute no longer configured in subtypes poses risk of NPE (FIPS-6982)
  • doInit[Attribut] missing for overwritten abstract PolicyCmptType attributes (FIPS-7001)
  • Missing null-check in generated code for derived attributes (FIPS-7012)
  • .properties lose sorting with Java 11 (FIPS-7047)
  • Null-Values in EnumContents are read as an empty String at runtime (FIPS-7096)
  • AbstractCachingRuntimeRepository can have multiple instances of the same enum value (FIPS-7197)
  • Money#subtract allows different currencies (FIPS-7222)
  • DefaultRange#getValues(boolean) should better support upperBound == lowerBound (FIPS-7342)
  • java.util.ConcurrentModificationException during headless Eclipse build of product projects (FIPS-7369)
  • Fix Javadoc (FIPS-7379)
  • IRuntimeRepository only sees its own IEnumValueLookupServices (FIPS-7397)
  • Exception is not thrown (FIPS-7437)
  • When only the prefix for enums is defined, the product table names include null in their name (FIPS-7442)
  • Relevance of Boolean attributes sets Unrestricted instead of EnumValueSet (FIPS-7480)
  • Too strict validation: product association may have same name as supertype (FIPS-7517)
  • Empty range “[] (incl. )” is interpreted as enum (FIPS-7518)
  • Typo in generated Javadoc (FIPS-7577)
  • Buggy Code for abstract enums on policy component classes (FIPS-7605)

New Features

Tasks

Improvements

  • Make core independent of eclipse.ui (FIPS-3557)
  • clean up IpsModel: delete deprecated methods (FIPS-6026)
  • Use RoundingMode enum instead of BigDecimal constants (FIPS-6234)
  • Increase minimal requirement from Luna to 2019-03 (FIPS-6649)
  • Improve API of OrderedValueSet (FIPS-6653)
  • Improve IpsObjectPath calculation in Eclipse workspace – no difference to Maven Dependency (FIPS-6660)
  • Switch Faktor-IPS runtime to Java 8 (FIPS-6802)
  • Maven-Build (first steps) (FIPS-6955)
  • Class#newInstance() -> Class#getConstructor()#newInstance() (FIPS-7042)
  • Collector for Decimal & Money (FIPS-7095)
  • Formula language: IF with Boolean null leads to NPE (FIPS-7123)
  • Allow export of enums from dependencies (FIPS-7189)
  • Convenience-methods Message#asMessageList & MessageList#of (FIPS-7203)
  • Covariant overwrites for Association.getMatchingAssociation() (FIPS-7287)
  • Adapt and document PersistenceOptions defaults (FIPS-7308)
  • Migration for 21.6 (FIPS-7329)
  • Builder-Refactoring (FIPS-7333)
  • Include MessageListUtil from f10-commons-ips (FIPS-7345)
  • Make core independent of eclipse.ui (f10) (FIPS-7348)
  • Move m2e to faktorips.base (FIPS-7353)
  • Very easy Warnings fix (FIPS-7407)
  • Decouple HTML-export from UI (FIPS-7409)
  • Constants for names of ModelObjects (FIPS-7547)
  • Deprecate Business Functions (FIPS-7550)
  • Update Tutorial to 21.6 (FIPS-7558)
  • Unify MessageList (FIPS-7560)
  • Use Diamond-Operator in generated code (FIPS-7563)
  • Modify Code-Templates and Clean-Ups: use diamond operator (FIPS-7585)
  • JMerge-Documentation in English (FIPS-7615)
  • Generate abstract derived union methods with wildcard generics (FIPS-7624)