Uploaded image for project: 'ActiveMQ Artemis'
  1. ActiveMQ Artemis
  2. ARTEMIS-2697

Avoid using raw types for Persister<T>

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 2.11.0
    • None
    • None
    • None

    Description

      Persister<T> has been introduced by ARTEMIS-1009 Pure Message Encoding, but during the refactoring process some bits are being left around to properly use Java Generics to help spotting wrong assignments at compile time eg

      public interface Journal extends ActiveMQComponent {
      
         // ...
      
         void appendAddRecord(long id,
                              byte recordType,
                              Persister persister,
                              Object record,
                              boolean sync,
                              IOCompletion completionCallback) throws Exception;
      

      And by consequence, a caller on AbstractJournalStorageManager:

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

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

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              nigro.fra@gmail.com Francesco Nigro
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 0.5h
                  0.5h