[Kafenio-cvs-commit] kafenio_main/src/de/xeinfach/kafenio KafenioPanel.java,1.8,1.9
Status: Beta
Brought to you by:
netsrak
|
From: <ne...@pr...> - 2004-01-26 18:28:19
|
Update of /cvsroot/kafenio/kafenio_main/src/de/xeinfach/kafenio In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14130/src/de/xeinfach/kafenio Modified Files: KafenioPanel.java Log Message: added java 1.3 compliant patch for java bug from Maxym Mykhalchuk: also see: http://developer.java.sun.com/developer/bugParade/bugs/4799813.html Index: KafenioPanel.java =================================================================== RCS file: /cvsroot/kafenio/kafenio_main/src/de/xeinfach/kafenio/KafenioPanel.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** KafenioPanel.java 26 Jan 2004 16:47:50 -0000 1.8 --- KafenioPanel.java 26 Jan 2004 18:27:25 -0000 1.9 *************** *** 131,134 **** --- 131,135 ---- private Vector toolbars = new Vector(); private URLFetch urlFetcher = new URLFetch(); + private gnu.regexp.RE pattern = null; /* Actions */ *************** *** 2222,2225 **** --- 2223,2239 ---- */ public void setDocumentText(String sText) { + // dirty hack around JDK bug 4799813 + // see http://developer.java.sun.com/developer/bugParade/bugs/4799813.html + // regression in 1.4.x, to be fixed in 1.5 + // When setting the text to be "& footext", it becomes "&footext" (space disappears) + try { + if( System.getProperty("java.version").substring(0,3).equals("1.4") ) { + if (pattern == null) + pattern = new gnu.regexp.RE("(&\\w+;|&#\\d+;)(\\s|<)"); + sText=pattern.substituteAll(sText,"$1 $2"); + } + } catch (gnu.regexp.REException ree) { + System.err.println("gnu.regexp.REException in setDocumentText: "+ree); + } htmlPane.setText(sText); srcPane.setText(htmlPane.getText()); |