jira.codehaus.org

  • Log In Access more options
    • Online Help
    • 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)
  • Milyn
  • MILYN-640

Source javabean not in beanmap if additional beans are added before filtering

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: Smooks v1.4.2
  • Fix Version/s: None
  • Component/s: Smooks Core
  • Labels:
    None
  • Environment:
    Windows

Description

if you call Smooks.filterSource with a source that is a JavaBean, the beanmap that is passed in the execution context will contain the beans in the source. StandaloneBeanContextFactory.createBeanMap does the copy.

But if you add beans the execution context before calling filterSource, this does not occur because when you call
executionContext.getBeanContext(), there is no source set so nothing is copied into it.

Then when you execute the filter, the source bean is not available.

Example - This will have the bean

InputStream config = new FileInputStream(mappingConfigFile);
Smooks smooks = new Smooks(config);
ExecutionContext execContext = smooks.createExecutionContext();
Map<String,Object> mySource = new HashMap<String,Object>();
mySource.put("A", "123");
PayloadProcessor payloadProcessor = new PayloadProcessor( smooks, ResultType.STRING );
Object result = payloadProcessor.process(mySource, execContext);

This way it will not
InputStream config = new FileInputStream(mappingConfigFile);
Smooks smooks = new Smooks(config);
ExecutionContext execContext = smooks.createExecutionContext();
Map<String,Object> mySource = new HashMap<String,Object>();
mySource.put("A", "123");
// Executing this line caused the bean context to be created without the source
execContext.getBeanContext().addBean("AnotherBean", "234");
PayloadProcessor payloadProcessor = new PayloadProcessor( smooks, ResultType.STRING );
Object result = payloadProcessor.process(mySource, execContext);

Activity

  • All
  • Comments
  • Work Log
  • History
  • Activity
There are no comments yet on this issue.

People

  • Assignee:
    Unassigned
    Reporter:
    Brian Blasko
Vote (0)
Watch (1)

Dates

  • Created:
    17/Jan/12 4:12 PM
    Updated:
    17/Jan/12 4:12 PM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.