summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlresende <lresende@13f79535-47bb-0310-9956-ffa450edef68>2009-01-29 01:09:20 +0000
committerlresende <lresende@13f79535-47bb-0310-9956-ffa450edef68>2009-01-29 01:09:20 +0000
commit45f5a0476d199f2a8c6b7393d4508e16f936acf9 (patch)
tree7602dd499a8321d6cf0d28728fe12bb633e5082c
parentb76ea9bf0a7983a05c25efa4b24c3911f132aca4 (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@738693 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--branches/sca-java-1.3.3/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.3.3/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/TuscanyXMLStreamReader.java b/branches/sca-java-1.3.3/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/TuscanyXMLStreamReader.java
index 3fd7bded68..f2afe419a3 100644
--- a/branches/sca-java-1.3.3/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/TuscanyXMLStreamReader.java
+++ b/branches/sca-java-1.3.3/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