You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by "Lou Amodeo (JIRA)" <tu...@ws.apache.org> on 2007/09/07 20:42:31 UTC
[jira] Created: (TUSCANY-1677) XML Parser not being closed with
void return types causing memory leaks
XML Parser not being closed with void return types causing memory leaks
-------------------------------------------------------------------------
Key: TUSCANY-1677
URL: https://issues.apache.org/jira/browse/TUSCANY-1677
Project: Tuscany
Issue Type: Bug
Reporter: Lou Amodeo
I am seeing a memory leak due to the XML Stream reader not being closed when void return types are used. I modified the Output2OutputTransformer
to close() the stream when a void return is encountered. Here is snippit. I attached the source code..
if ((!sourceWrapped) && targetWrapped) {
// Unwrapped --> Wrapped
WrapperInfo wrapper = targetOp.getWrapper();
Object targetWrapper = targetWrapperHandler.create(wrapper.getOutputWrapperElement(), context);
List<ElementInfo> childElements = wrapper.getOutputChildElements();
if (childElements.isEmpty()) {
// void output
if (targetWrapper instanceof OMElement)
((OMElement)targetWrapper).getXMLStreamReader().close();
return targetWrapper;
}
ElementInfo argElement = childElements.get(0);
DataType<XMLType> argType = wrapper.getUnwrappedOutputType();
Object child = response;
child = mediator.mediate(response, sourceType.getLogical(), argType, context.getMetadata());
targetWrapperHandler.setChild(targetWrapper, 0, argElement, child);
return targetWrapper;
} else if (sourceWrapped && (!targetWrapped)) {
// Wrapped to Unwrapped
Object sourceWrapper = response;
List<ElementInfo> childElements = sourceOp.getWrapper().getOutputChildElements();
if (childElements.isEmpty()) {
// The void output
if (sourceWrapper instanceof OMElement)
((OMElement)sourceWrapper).getXMLStreamReader().close();
return null;
}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org
[jira] Updated: (TUSCANY-1677) XML Parser not being closed with
void return types causing memory leaks
Posted by "Lou Amodeo (JIRA)" <tu...@ws.apache.org>.
[ https://issues.apache.org/jira/browse/TUSCANY-1677?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Lou Amodeo updated TUSCANY-1677:
--------------------------------
Attachment: Output2OutputTransformer.java
> XML Parser not being closed with void return types causing memory leaks
> -------------------------------------------------------------------------
>
> Key: TUSCANY-1677
> URL: https://issues.apache.org/jira/browse/TUSCANY-1677
> Project: Tuscany
> Issue Type: Bug
> Reporter: Lou Amodeo
> Attachments: Output2OutputTransformer.java
>
>
> I am seeing a memory leak due to the XML Stream reader not being closed when void return types are used. I modified the Output2OutputTransformer
> to close() the stream when a void return is encountered. Here is snippit. I attached the source code..
> if ((!sourceWrapped) && targetWrapped) {
> // Unwrapped --> Wrapped
> WrapperInfo wrapper = targetOp.getWrapper();
> Object targetWrapper = targetWrapperHandler.create(wrapper.getOutputWrapperElement(), context);
> List<ElementInfo> childElements = wrapper.getOutputChildElements();
> if (childElements.isEmpty()) {
> // void output
> if (targetWrapper instanceof OMElement)
> ((OMElement)targetWrapper).getXMLStreamReader().close();
> return targetWrapper;
> }
> ElementInfo argElement = childElements.get(0);
> DataType<XMLType> argType = wrapper.getUnwrappedOutputType();
> Object child = response;
> child = mediator.mediate(response, sourceType.getLogical(), argType, context.getMetadata());
> targetWrapperHandler.setChild(targetWrapper, 0, argElement, child);
> return targetWrapper;
> } else if (sourceWrapped && (!targetWrapped)) {
> // Wrapped to Unwrapped
> Object sourceWrapper = response;
> List<ElementInfo> childElements = sourceOp.getWrapper().getOutputChildElements();
> if (childElements.isEmpty()) {
> // The void output
> if (sourceWrapper instanceof OMElement)
> ((OMElement)sourceWrapper).getXMLStreamReader().close();
> return null;
> }
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org
[jira] Assigned: (TUSCANY-1677) XML Parser not being closed with
void return types causing memory leaks
Posted by "Raymond Feng (JIRA)" <tu...@ws.apache.org>.
[ https://issues.apache.org/jira/browse/TUSCANY-1677?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Raymond Feng reassigned TUSCANY-1677:
-------------------------------------
Assignee: Raymond Feng
> XML Parser not being closed with void return types causing memory leaks
> -------------------------------------------------------------------------
>
> Key: TUSCANY-1677
> URL: https://issues.apache.org/jira/browse/TUSCANY-1677
> Project: Tuscany
> Issue Type: Bug
> Reporter: Lou Amodeo
> Assignee: Raymond Feng
> Attachments: Output2OutputTransformer.java
>
>
> I am seeing a memory leak due to the XML Stream reader not being closed when void return types are used. I modified the Output2OutputTransformer
> to close() the stream when a void return is encountered. Here is snippit. I attached the source code..
> if ((!sourceWrapped) && targetWrapped) {
> // Unwrapped --> Wrapped
> WrapperInfo wrapper = targetOp.getWrapper();
> Object targetWrapper = targetWrapperHandler.create(wrapper.getOutputWrapperElement(), context);
> List<ElementInfo> childElements = wrapper.getOutputChildElements();
> if (childElements.isEmpty()) {
> // void output
> if (targetWrapper instanceof OMElement)
> ((OMElement)targetWrapper).getXMLStreamReader().close();
> return targetWrapper;
> }
> ElementInfo argElement = childElements.get(0);
> DataType<XMLType> argType = wrapper.getUnwrappedOutputType();
> Object child = response;
> child = mediator.mediate(response, sourceType.getLogical(), argType, context.getMetadata());
> targetWrapperHandler.setChild(targetWrapper, 0, argElement, child);
> return targetWrapper;
> } else if (sourceWrapped && (!targetWrapped)) {
> // Wrapped to Unwrapped
> Object sourceWrapper = response;
> List<ElementInfo> childElements = sourceOp.getWrapper().getOutputChildElements();
> if (childElements.isEmpty()) {
> // The void output
> if (sourceWrapper instanceof OMElement)
> ((OMElement)sourceWrapper).getXMLStreamReader().close();
> return null;
> }
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org
[jira] Resolved: (TUSCANY-1677) XML Parser not being closed with
void return types causing memory leaks
Posted by "Raymond Feng (JIRA)" <tu...@ws.apache.org>.
[ https://issues.apache.org/jira/browse/TUSCANY-1677?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Raymond Feng resolved TUSCANY-1677.
-----------------------------------
Resolution: Fixed
Fixed in a slightly different way.
> XML Parser not being closed with void return types causing memory leaks
> -------------------------------------------------------------------------
>
> Key: TUSCANY-1677
> URL: https://issues.apache.org/jira/browse/TUSCANY-1677
> Project: Tuscany
> Issue Type: Bug
> Reporter: Lou Amodeo
> Assignee: Raymond Feng
> Fix For: Java-SCA-1.0
>
> Attachments: Output2OutputTransformer.java
>
>
> I am seeing a memory leak due to the XML Stream reader not being closed when void return types are used. I modified the Output2OutputTransformer
> to close() the stream when a void return is encountered. Here is snippit. I attached the source code..
> if ((!sourceWrapped) && targetWrapped) {
> // Unwrapped --> Wrapped
> WrapperInfo wrapper = targetOp.getWrapper();
> Object targetWrapper = targetWrapperHandler.create(wrapper.getOutputWrapperElement(), context);
> List<ElementInfo> childElements = wrapper.getOutputChildElements();
> if (childElements.isEmpty()) {
> // void output
> if (targetWrapper instanceof OMElement)
> ((OMElement)targetWrapper).getXMLStreamReader().close();
> return targetWrapper;
> }
> ElementInfo argElement = childElements.get(0);
> DataType<XMLType> argType = wrapper.getUnwrappedOutputType();
> Object child = response;
> child = mediator.mediate(response, sourceType.getLogical(), argType, context.getMetadata());
> targetWrapperHandler.setChild(targetWrapper, 0, argElement, child);
> return targetWrapper;
> } else if (sourceWrapped && (!targetWrapped)) {
> // Wrapped to Unwrapped
> Object sourceWrapper = response;
> List<ElementInfo> childElements = sourceOp.getWrapper().getOutputChildElements();
> if (childElements.isEmpty()) {
> // The void output
> if (sourceWrapper instanceof OMElement)
> ((OMElement)sourceWrapper).getXMLStreamReader().close();
> return null;
> }
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org
[jira] Updated: (TUSCANY-1677) XML Parser not being closed with
void return types causing memory leaks
Posted by "ant elder (JIRA)" <tu...@ws.apache.org>.
[ https://issues.apache.org/jira/browse/TUSCANY-1677?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
ant elder updated TUSCANY-1677:
-------------------------------
Fix Version/s: Java-SCA-1.0
> XML Parser not being closed with void return types causing memory leaks
> -------------------------------------------------------------------------
>
> Key: TUSCANY-1677
> URL: https://issues.apache.org/jira/browse/TUSCANY-1677
> Project: Tuscany
> Issue Type: Bug
> Reporter: Lou Amodeo
> Assignee: Raymond Feng
> Fix For: Java-SCA-1.0
>
> Attachments: Output2OutputTransformer.java
>
>
> I am seeing a memory leak due to the XML Stream reader not being closed when void return types are used. I modified the Output2OutputTransformer
> to close() the stream when a void return is encountered. Here is snippit. I attached the source code..
> if ((!sourceWrapped) && targetWrapped) {
> // Unwrapped --> Wrapped
> WrapperInfo wrapper = targetOp.getWrapper();
> Object targetWrapper = targetWrapperHandler.create(wrapper.getOutputWrapperElement(), context);
> List<ElementInfo> childElements = wrapper.getOutputChildElements();
> if (childElements.isEmpty()) {
> // void output
> if (targetWrapper instanceof OMElement)
> ((OMElement)targetWrapper).getXMLStreamReader().close();
> return targetWrapper;
> }
> ElementInfo argElement = childElements.get(0);
> DataType<XMLType> argType = wrapper.getUnwrappedOutputType();
> Object child = response;
> child = mediator.mediate(response, sourceType.getLogical(), argType, context.getMetadata());
> targetWrapperHandler.setChild(targetWrapper, 0, argElement, child);
> return targetWrapper;
> } else if (sourceWrapped && (!targetWrapped)) {
> // Wrapped to Unwrapped
> Object sourceWrapper = response;
> List<ElementInfo> childElements = sourceOp.getWrapper().getOutputChildElements();
> if (childElements.isEmpty()) {
> // The void output
> if (sourceWrapper instanceof OMElement)
> ((OMElement)sourceWrapper).getXMLStreamReader().close();
> return null;
> }
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org