Milestone 21.6.0-m01

New and Noteworthy in Version 21.6

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:

Klasse Änderung
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.

 

Methode Änderung
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.

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.

Bugs

  • Null-Values in EnumContents are read as an empty String at runtime (FIPS-7096)

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.

Bugs

  • Typo in Javadoc for TableUsage getter (FIPS-6304)
  • Editor scrolls horizontally (FIPS-6528)
  • Null-Values in EnumContents are read as an empty String at runtime (FIPS-7096)
  • 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)

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)
  • 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)
  • Convenience-methods Message#asMessageList & MessageList#of (FIPS-7203)
  • Migration for 21.6 (FIPS-7329)
  • Builder-Refactoring (FIPS-7333)
  • Include MessageListUtil from f10-commons-ips (FIPS-7345)
  • Move m2e to faktorips.base (FIPS-7353)
  • Very easy Warnings fix (FIPS-7407)