JIRA

  • Log In Access more options
    • Online Help
    • GreenHopper Help
    • Agile Answers
    • Use Agile By Default
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What’s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • Agile Access more options (Alt+g)
  • Create Issue
  • Mule
  • MULE-5034

Instructions for msg.getAttachmentNames() deprecation are wrong

  • Agile Board
  • More Actions
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Critical Critical
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 3.0.0-RC3
  • Component/s: Core: API
  • Labels:
    • 30ce_blck
  • User impact:
    Medium
  • Similar Issues:
    None

Description

org.mule.transport.email.MailMuleMessageFactoryTestCase#testAttachments()

uses the deprecated getAttachments(). However, replacing it with getInboundAttachmentNames() as per instructions is not working (attachments end up on the outbound). See if these are doc errors or things go wrong in the Mule message factory.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
  • Transitions
  • Commits
  • Source
  • Builds
Hide
Permalink
Andrew Perepelytsya added a comment - 23/Aug/10 05:12 PM

Same for e.g. LoanBrokerEsbTestCase. It outputs numerous warning about the deprecated api usage, however, replacing it with this (as per deprecation docs):

Set<?> attachmentNames = message.getOutboundAttachmentNames();
        if (attachmentNames != null && !attachmentNames.isEmpty())
        {
            List<DataHandler> attachments = new ArrayList<DataHandler>();
            for (Object attachmentName : attachmentNames)
            {
                attachments.add(message.getInboundAttachment((String) attachmentName));
            }
            List<Object> temp = new ArrayList<Object>(Arrays.asList(args));
            temp.add(attachments.toArray(new DataHandler[attachments.size()]));
            args = temp.toArray();
        }

doesn't feel right (iterating over outbound attachmen names, but getting the from the inbound?)

Show
Andrew Perepelytsya added a comment - 23/Aug/10 05:12 PM Same for e.g. LoanBrokerEsbTestCase. It outputs numerous warning about the deprecated api usage, however, replacing it with this (as per deprecation docs):
Set<?> attachmentNames = message.getOutboundAttachmentNames();
        if (attachmentNames != null && !attachmentNames.isEmpty())
        {
            List<DataHandler> attachments = new ArrayList<DataHandler>();
            for (Object attachmentName : attachmentNames)
            {
                attachments.add(message.getInboundAttachment((String) attachmentName));
            }
            List<Object> temp = new ArrayList<Object>(Arrays.asList(args));
            temp.add(attachments.toArray(new DataHandler[attachments.size()]));
            args = temp.toArray();
        }
doesn't feel right (iterating over outbound attachmen names, but getting the from the inbound?)
Hide
Permalink
Andrew Perepelytsya added a comment - 24/Aug/10 09:56 AM

The above code can be found e.g. in CxfOutboundMessageProcessor

Show
Andrew Perepelytsya added a comment - 24/Aug/10 09:56 AM The above code can be found e.g. in CxfOutboundMessageProcessor
Hide
Permalink
Andrew Perepelytsya added a comment - 09/Sep/10 09:57 AM

Ross, were there any changes committed? Changeset?

Show
Andrew Perepelytsya added a comment - 09/Sep/10 09:57 AM Ross, were there any changes committed? Changeset?
Hide
Permalink
Ross Mason added a comment - 10/Sep/10 03:19 PM

AP: this is the changeset for MULE-5034,  Jira is referenced: http://fisheye.codehaus.org/changelog/mule/?cs=19337.

I didn't tackle CXF, I guess the issue now is to remove any deprecated calls to attachment APIs

Show
Ross Mason added a comment - 10/Sep/10 03:19 PM AP: this is the changeset for MULE-5034,  Jira is referenced: http://fisheye.codehaus.org/changelog/mule/?cs=19337. I didn't tackle CXF, I guess the issue now is to remove any deprecated calls to attachment APIs

People

  • Assignee:
    Ross Mason
    Reporter:
    Andrew Perepelytsya
Vote (0)
Watch (0)

Dates

  • Created:
    23/Aug/10 05:09 PM
    Updated:
    10/Sep/10 03:57 PM
    Resolved:
    10/Sep/10 03:57 PM

Agile

  • View on Board
  • Atlassian JIRA (v5.0.7#734-sha1:8ad78a6)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for MuleForge. Try JIRA - bug tracking software for your team.