You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@activemq.apache.org by "Francesco Nigro (Jira)" <ji...@apache.org> on 2020/04/06 07:31:00 UTC

[jira] [Created] (ARTEMIS-2697) Avoid using raw types for Persister

Francesco Nigro created ARTEMIS-2697:
----------------------------------------

             Summary: Avoid using raw types for Persister<T>
                 Key: ARTEMIS-2697
                 URL: https://issues.apache.org/jira/browse/ARTEMIS-2697
             Project: ActiveMQ Artemis
          Issue Type: Bug
    Affects Versions: 2.11.0
            Reporter: Francesco Nigro


Persister<T> has been introduced by [ARTEMIS-1009 Pure Message Encoding|https://issues.apache.org/jira/browse/ARTEMIS-1009], but during the refactoring process some bits are being left around to properly use Java Generics to help spotting wrong assignments eg 

{code:java}
public interface Journal extends ActiveMQComponent {

   // ...

   void appendAddRecord(long id,
                        byte recordType,
                        Persister persister,
                        Object record,
                        boolean sync,
                        IOCompletion completionCallback) throws Exception;
{code}

And by consequence, a caller on {{AbstractJournalStorageManager}}:

{code:java}
if (message.isLargeMessage() && message instanceof LargeServerMessageImpl) {
            messageJournal.appendAddRecord(message.getMessageID(), JournalRecordIds.ADD_LARGE_MESSAGE, LargeMessagePersister.getInstance(), message, false, getContext(false));
{code}

Where {{LargeMessagePersister.getInstance()}} is a {{Persister<LargeServerMessage>}} and {{message}} is a {{Message}} and such method call should not compile at all.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)