summaryrefslogtreecommitdiffstats
path: root/branches/sca-java-1.x/modules/contribution
diff options
context:
space:
mode:
authorlresende <lresende@13f79535-47bb-0310-9956-ffa450edef68>2009-01-29 00:52:21 +0000
committerlresende <lresende@13f79535-47bb-0310-9956-ffa450edef68>2009-01-29 00:52:21 +0000
commitb7c96d82cebf937c25f8c5268973effa7b83570a (patch)
tree8142f12004d77787ec82013af040be2136001cb8 /branches/sca-java-1.x/modules/contribution
parentbec8aa745f084c90f92b3198cb54930bc4d4217f (diff)
TUSCANY-2663 - Workaround for 'java.lang.IllegalStateException: The current state is not START_DOCUMENT' when in WebSphere env
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@738683 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'branches/sca-java-1.x/modules/contribution')
-rw-r--r--branches/sca-java-1.x/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/TuscanyXMLStreamReader.java15
1 files changed, 14 insertions, 1 deletions
diff --git a/branches/sca-java-1.x/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/TuscanyXMLStreamReader.java b/branches/sca-java-1.x/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/TuscanyXMLStreamReader.java
index 3fd7bded68..f2afe419a3 100644
--- a/branches/sca-java-1.x/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/TuscanyXMLStreamReader.java
+++ b/branches/sca-java-1.x/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/TuscanyXMLStreamReader.java
@@ -35,12 +35,14 @@ public class TuscanyXMLStreamReader extends StreamReaderDelegate implements XMLS
Stack<List<String>[]> context = new Stack<List<String>[]>();
+ String characterEncodingScheme;
List<String>[] contextList;
List<String> prefixList;
List<String> uriList;
public TuscanyXMLStreamReader(XMLStreamReader reader) {
super(reader);
+ this.saveCharacterEncodingScheme();
}
public void pushContext() throws XMLStreamException {
@@ -68,6 +70,10 @@ public class TuscanyXMLStreamReader extends StreamReaderDelegate implements XMLS
public void popContext() throws XMLStreamException {
context.pop();
}
+
+ public void saveCharacterEncodingScheme() {
+ this.characterEncodingScheme = super.getCharacterEncodingScheme();
+ }
/*
* Overriding the next() method to perform PUSH and POP operations
@@ -93,6 +99,7 @@ public class TuscanyXMLStreamReader extends StreamReaderDelegate implements XMLS
@Override
public int nextTag() throws XMLStreamException {
int event = super.nextTag();
+
if (event == START_ELEMENT) {
pushContext();
}
@@ -106,4 +113,10 @@ public class TuscanyXMLStreamReader extends StreamReaderDelegate implements XMLS
public NamespaceContext getNamespaceContext() {
return new TuscanyNamespaceContext((Stack<List<String>[]>)context.clone());
}
-}
+
+
+ @Override
+ public String getCharacterEncodingScheme() {
+ return characterEncodingScheme;
+ }
+} \ No newline at end of file