Removal of final modifier from a method since that prevents CDI from

proxying the bean.
deploy_packages_to_gitea
Jens Pelzetter 2023-01-24 19:03:25 +01:00
parent be6abc17cb
commit 0d00794ffb
1 changed files with 20 additions and 11 deletions

View File

@ -204,8 +204,8 @@ public abstract class AbstractEntityImExporter<T extends Exportable> {
* values of the imported entity. Related entities must not be updated by an * values of the imported entity. Related entities must not be updated by an
* implementation, expect for embedded entities. * implementation, expect for embedded entities.
* *
* @param existingEntity The existing entity. * @param existingEntity The existing entity.
* @param withImportedEntity The imported entity. * @param withImportedEntity The imported entity.
* *
* @see #importEntity(java.lang.String) * @see #importEntity(java.lang.String)
* @see #findExistingEntity(java.lang.String) * @see #findExistingEntity(java.lang.String)
@ -246,7 +246,7 @@ public abstract class AbstractEntityImExporter<T extends Exportable> {
/** /**
* Reloads the entity to export. Entities become detacted for several * Reloads the entity to export. Entities become detacted for several
* reasons before they are passed to the null null null null null null null * reasons before they are passed to the null null null null null null null
* null null null null null null {@link #exportEntity(org.libreccm.imexport.Exportable) method. The * null null null null null null null {@link #exportEntity(org.libreccm.imexport.Exportable) method. The
* implementation of this should reload the passed entity. * implementation of this should reload the passed entity.
* *
* @param entity The entity to reload. * @param entity The entity to reload.
@ -255,8 +255,17 @@ public abstract class AbstractEntityImExporter<T extends Exportable> {
*/ */
protected abstract T reloadEntity(final T entity); protected abstract T reloadEntity(final T entity);
/**
protected final void syncLocalizedStrings( * A helper method to sync a localized string property.
*
* !!!Warning: CDI does not allow final methods to forbid overriding a
* method. Nevertheless this method should <strong>never</strong> be
* overriden by a child class!!!
*
* @param source The source property.
* @param target The target property.
*/
protected void syncLocalizedStrings(
final LocalizedString source, final LocalizedString source,
final LocalizedString target final LocalizedString target
) { ) {
@ -274,11 +283,11 @@ public abstract class AbstractEntityImExporter<T extends Exportable> {
.filter(locale -> !source.getAvailableLocales().contains(locale)) .filter(locale -> !source.getAvailableLocales().contains(locale))
.collect(Collectors.toSet()); .collect(Collectors.toSet());
for(final Locale toRemove : localesToRemove) { for (final Locale toRemove : localesToRemove) {
target.removeValue(toRemove); target.removeValue(toRemove);
} }
for(final Locale toAdd : localesToAdd) { for (final Locale toAdd : localesToAdd) {
target.putValue(toAdd, source.getValue(toAdd)); target.putValue(toAdd, source.getValue(toAdd));
} }
} }