From 863691e727cd36ea24f978b17728ee47656228ca Mon Sep 17 00:00:00 2001
From: Alexander Schnitzler <git@alexanderschnitzler.de>
Date: Mon, 17 Feb 2020 09:42:48 +0100
Subject: [PATCH] [TASK] Mark TypeConverterException final

Class \TYPO3\CMS\Form\Mvc\Property\Exception\TypeConverterException
provides a factory method fromError to instantiate new instance of
itself. It's done via new static(...) which is unsafe if the class
is not final as the implementation cannot know if constructors of
sub classes have the same method signature like itself.

One solution to this issue is to make a class final, another is to
use new self() instead of new static(). In this case, the class is
made final as this is a very specific Exception already and unlikely
to be extended.

Releases: master
Resolves: #90401
Change-Id: I4f1127cc423cb1c865b8f422a3047ad5888d00f4
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/63275
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Susanne Moog <look@susi.dev>
Tested-by: Daniel Goerz <daniel.goerz@posteo.de>
Reviewed-by: Stefan Froemken <froemken@gmail.com>
Reviewed-by: Susanne Moog <look@susi.dev>
Reviewed-by: Daniel Goerz <daniel.goerz@posteo.de>
---
 .../Classes/Mvc/Property/Exception/TypeConverterException.php   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/typo3/sysext/form/Classes/Mvc/Property/Exception/TypeConverterException.php b/typo3/sysext/form/Classes/Mvc/Property/Exception/TypeConverterException.php
index 9df06b4c873c..c60a10234e8d 100644
--- a/typo3/sysext/form/Classes/Mvc/Property/Exception/TypeConverterException.php
+++ b/typo3/sysext/form/Classes/Mvc/Property/Exception/TypeConverterException.php
@@ -19,7 +19,7 @@ use TYPO3\CMS\Extbase\Error\Error;
 /**
  * A "Type Converter" Exception
  */
-class TypeConverterException extends \TYPO3\CMS\Extbase\Property\Exception\TypeConverterException
+final class TypeConverterException extends \TYPO3\CMS\Extbase\Property\Exception\TypeConverterException
 {
     /**
      * @var Error
-- 
GitLab