Commit c2ac4826 authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gaston

Fixed #parseDocument to throw any exception raised parsing the stream instead...

Fixed #parseDocument to throw any exception raised parsing the stream instead of returning a null value. This solves the CPU consumption problem.


git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/trunk@660 b35dd754-fafc-0310-a699-88a17e54d16e
parent bbceefd5
...@@ -9,14 +9,7 @@ ...@@ -9,14 +9,7 @@
package org.dom4j.io; package org.dom4j.io;
import java.io.BufferedReader; import java.io.*;
import java.io.CharArrayReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;
import java.net.URL; import java.net.URL;
import org.dom4j.Document; import org.dom4j.Document;
import org.dom4j.DocumentException; import org.dom4j.DocumentException;
...@@ -24,7 +17,6 @@ import org.dom4j.DocumentFactory; ...@@ -24,7 +17,6 @@ import org.dom4j.DocumentFactory;
import org.dom4j.Element; import org.dom4j.Element;
import org.dom4j.ElementHandler; import org.dom4j.ElementHandler;
import org.dom4j.QName; import org.dom4j.QName;
import org.dom4j.DocumentHelper;
import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException; import org.xmlpull.v1.XmlPullParserException;
import org.xmlpull.v1.XmlPullParserFactory; import org.xmlpull.v1.XmlPullParserFactory;
...@@ -273,12 +265,7 @@ public class XPPPacketReader { ...@@ -273,12 +265,7 @@ public class XPPPacketReader {
int count = 0; int count = 0;
while (true) { while (true) {
int type = -1; int type = -1;
try {
type = pp.nextToken(); type = pp.nextToken();
}
catch(Exception ex){
return null;
}
switch (type) { switch (type) {
case XmlPullParser.PROCESSING_INSTRUCTION: case XmlPullParser.PROCESSING_INSTRUCTION:
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment