Hi!

This patch avoids an EmptyStackException in jgecko when running
FindBugs.

With this patch Findbugs survives (at least, does not go mad with
exceptions) when trying to parse html reports, but still fails to render
them, this means that the result is a white page instead of a blocked
application.

Moreover, Roman told me that this class is mostly about black magic, so
before adding even such a small fix, I prefer to wait for his veto
before committing.

On a final note, Findbugs has still lots of other problems, and I get
also some segfaults when the code goes in
Java_gnu_java_awt_peer_gtk_FreetypeGlyphVector_getMetricsNative and uses
FT_Load_Glyph (both cacao and javm).

I think this is more a bug in freetype than in classpath, because no
matter how bad the input is, the library should handle it. I've searched
on the net and found a similar issue
(http://www.nabble.com/SIGSEGVin-FT_Load_Glyph-t3764177.html), so maybe
I can do something about it in the next couple of days (will not start
working on that before tomorrow, though), but I don't consider this a
blocking issue for release anymore (Findbugs is too much broken with
Classpath anyway), so for me it's ok to push the release unless there
are other problems you want fixed.

Thanks,
Mario

2007-10-15  Mario Torre  <[EMAIL PROTECTED]>

* javax/swing/text/DefaultStyledDocument.java  
          (ElementBuffer.insertElement): Added check for empty
          stack to avoid EmptyStackException. 

-- 
Lima Software - http://www.limasoftware.net/
GNU Classpath Developer - http://www.classpath.org/
Fedora Ambassador - http://fedoraproject.org/wiki/MarioTorre
Jabber: [EMAIL PROTECTED]
pgp key: http://subkeys.pgp.net/ PGP Key ID: 80F240CF
Fingerprint: BA39 9666 94EC 8B73 27FA  FC7C 4086 63E3 80F2 40CF

Please, support open standards:
http://opendocumentfellowship.org/petition/
http://www.nosoftwarepatents.com/
### Eclipse Workspace Patch 1.0
#P classpath
Index: javax/swing/text/DefaultStyledDocument.java
===================================================================
RCS file: /sources/classpath/classpath/javax/swing/text/DefaultStyledDocument.java,v
retrieving revision 1.73
diff -u -r1.73 DefaultStyledDocument.java
--- javax/swing/text/DefaultStyledDocument.java	21 Dec 2006 13:02:51 -0000	1.73
+++ javax/swing/text/DefaultStyledDocument.java	15 Oct 2007 17:42:03 -0000
@@ -1158,6 +1158,9 @@
 
     private void insertElement(ElementSpec spec)
     {
+      if (elementStack.isEmpty())
+        return;
+      
       Edit edit = (Edit) elementStack.peek();
       switch (spec.getType())
         {

Reply via email to