False positiv: Replace this type parametrization by the 'final' type `String`

i have this class in my code and Sonarqube reports here an issue for the clear. The issue is “Replace this type parametrization by the ‘final’ type String.”. When i follow the suggestion the code does no longer compile.

package foo.bar;

import java.util.List;

import javax.cache.event.CacheEntryEvent;
import javax.cache.event.CacheEntryExpiredListener;
import javax.cache.event.CacheEntryListenerException;
import javax.cache.event.CacheEntryRemovedListener;

class MyCacheEntryListener implements CacheEntryExpiredListener<String, List<String>>, CacheEntryRemovedListener<String, List<String>> {
    private final String myCacheKey;

    MyCacheEntryListener(final String myCacheKey) {
        this.myCacheKey = myCacheKey;
    }

    @Override
    public void onExpired(final Iterable<CacheEntryEvent<? extends String, ? extends List<String>>> cacheEntryEvents) throws CacheEntryListenerException {
        cacheEntryEvents.forEach(this::clear);
    }

    @Override
    public void onRemoved(final Iterable<CacheEntryEvent<? extends String, ? extends List<String>>> cacheEntryEvents) throws CacheEntryListenerException {
        cacheEntryEvents.forEach(this::clear);
    }

    private void clear(final CacheEntryEvent<? extends String, ? extends List<String>> event) {
        if (event.getKey()
                .equals(myCacheKey)) {
            System.out.println("event=" + event);
        }
    }
}

Hey there.

What version of SonarQube are you using?

we are using version 9.8.0.63668

Hi @BigMichi1,

Thank you for reporting.
This is a known FP, and we already have a ticket for fixing it.
Here, SONARJAVA-4398, you can track progress.

All the best,

Irina