classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cp-patches] FYI: Implemented some methods javax.swing.text.Abstract


From: Roman Kennke
Subject: Re: [cp-patches] FYI: Implemented some methods javax.swing.text.AbstractDocument
Date: Mon, 25 Apr 2005 11:02:36 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021204

Mark Wielaard wrote:

Hi Roman,

On Sat, 2005-04-23 at 10:41 +0200, Roman Kennke wrote:
2005-04-23  Roman Kennke  <address@hidden>

       * javax/swing/text/AbstractDocument.java
       (getDocumentProperties): Implemented.
       (setDocumentProperties): Implemented.
       (getProperty): Implemented.
       (putProperty): Implemented.

As implemented these methods aren't thread safe. Now we don't seem to
have any implementation for the read and write lock methods (and they
are not even marked final currently) so it might not matter at this
time. Just wanted to know if you (or someone else) had thought about
these issues. It would be good to add a big fat FIXME to the
documentation of this class to warn about any threading issues.

Done. See attached patch, which I committed.

2005-04-25  Roman Kennke  <address@hidden>

       * javax/swing/text/AbstractDocument.java:
       Added FIXME comments. This class still has to be
       implemented thread-safe.

/Roman

Index: javax/swing/text/AbstractDocument.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/text/AbstractDocument.java,v
retrieving revision 1.16
diff -u -r1.16 AbstractDocument.java
--- javax/swing/text/AbstractDocument.java      23 Apr 2005 08:39:35 -0000      
1.16
+++ javax/swing/text/AbstractDocument.java      25 Apr 2005 08:59:44 -0000
@@ -179,6 +179,7 @@
 
   public Dictionary getDocumentProperties()
   {
+    // FIXME: make me thread-safe
     if (properties == null)
       properties = new Hashtable();
 
@@ -208,6 +209,7 @@
 
   public Object getProperty(Object key)
   {
+    // FIXME: make me thread-safe
     Object value = null;
     if (properties != null)
       value = properties.get(key);
@@ -269,6 +271,7 @@
 
   public void putProperty(Object key, Object value)
   {
+    // FIXME: make me thread-safe
     if (properties == null)
       properties = new Hashtable();
 
@@ -381,6 +384,7 @@
 
   public void setDocumentProperties(Dictionary x)
   {
+    // FIXME: make me thread-safe
     properties = x;
   }
 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]