This patch fixes a few cases where variables are protected
by synchronization in one method but not in another, as spotted
by FindBugs.

ChangeLog:

2008-09-09  Andrew John Hughes  <[EMAIL PROTECTED]>

        * tools/gnu/classpath/tools/getopt/Parser.java:
        (setHeader(String)): Make synchronized.
        (setFooter(String)): Likewise.
        * tools/gnu/classpath/tools/rmic/SourceGiopRmicCompiler.java,
        (reset()): Make synchronized.
        (name(Class)): Likewise.

-- 
Andrew :)

Support Free Java!
Contribute to GNU Classpath and the OpenJDK
http://www.gnu.org/software/classpath
http://openjdk.java.net
PGP Key: 94EFD9D8 (http://subkeys.pgp.net)
Fingerprint = F8EF F1EA 401E 2E60 15FA  7927 142C 2591 94EF D9D8
Index: tools/gnu/classpath/tools/getopt/Parser.java
===================================================================
RCS file: 
/sources/classpath/classpath/tools/gnu/classpath/tools/getopt/Parser.java,v
retrieving revision 1.10
diff -u -u -r1.10 Parser.java
--- tools/gnu/classpath/tools/getopt/Parser.java        20 Mar 2008 18:04:44 
-0000      1.10
+++ tools/gnu/classpath/tools/getopt/Parser.java        9 Sep 2008 22:18:44 
-0000
@@ -197,7 +197,7 @@
    * 
    * @param headerText the header text
    */
-  public void setHeader(String headerText)
+  public synchronized void setHeader(String headerText)
   {
     this.headerText = headerText;
   }
@@ -207,7 +207,7 @@
    * 
    * @param footerText the footer text
    */
-  public void setFooter(String footerText)
+  public synchronized void setFooter(String footerText)
   {
     this.footerText = footerText;
   }
Index: tools/gnu/classpath/tools/rmic/SourceGiopRmicCompiler.java
===================================================================
RCS file: 
/sources/classpath/classpath/tools/gnu/classpath/tools/rmic/SourceGiopRmicCompiler.java,v
retrieving revision 1.3
diff -u -u -r1.3 SourceGiopRmicCompiler.java
--- tools/gnu/classpath/tools/rmic/SourceGiopRmicCompiler.java  24 Jun 2008 
17:36:07 -0000      1.3
+++ tools/gnu/classpath/tools/rmic/SourceGiopRmicCompiler.java  9 Sep 2008 
22:18:44 -0000
@@ -140,7 +140,7 @@
   /**
    * Clear data, preparing for the next compilation.
    */
-  public void reset()
+  public synchronized void reset()
   {
     packag = name = implName = stubName = null;
     implementedRemotes.clear();
@@ -329,7 +329,7 @@
    *          the class to name
    * @return the name of class as it should appear in java language
    */
-  public String name(Class nameIt)
+  public synchronized String name(Class nameIt)
   {
     if (nameIt.isArray())
       {

Reply via email to