Hi,

This cleans up some of the simpler warnings jikes was giving.

2005-05-24  Mark Wielaard  <[EMAIL PROTECTED]>

        * java/util/regex/Pattern.java (split): Assign value of variable
        matched outside while statement.
        * gnu/regexp/RE.java (getCharUnit): Assign value of unit.bk variable
        outside if statement.
        * gnu/CORBA/bufferedResponseHandler.java (createReply): Assign values
        from static class type constants.
        * gnu/CORBA/IOR.java (_write_no_endian): Likewise.
        * gnu/CORBA/Functional_ORB.java (respond_to_client): Likewise.
        (serve): Likewise.

This brings the number of warnings given by jikes down to 7.
Some of these might also be trivially fixable.

Committed,

Mark

Index: gnu/CORBA/Functional_ORB.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/CORBA/Functional_ORB.java,v
retrieving revision 1.2
diff -u -r1.2 Functional_ORB.java
--- gnu/CORBA/Functional_ORB.java	23 May 2005 20:00:45 -0000	1.2
+++ gnu/CORBA/Functional_ORB.java	24 May 2005 08:18:47 -0000
@@ -699,11 +699,11 @@
     ReplyHeader reply = handler.reply_header;
 
     if (sysEx != null)
-      reply.reply_status = reply.SYSTEM_EXCEPTION;
+      reply.reply_status = ReplyHeader.SYSTEM_EXCEPTION;
     else if (handler.isExceptionReply())
-      reply.reply_status = reply.USER_EXCEPTION;
+      reply.reply_status = ReplyHeader.USER_EXCEPTION;
     else
-      reply.reply_status = reply.NO_EXCEPTION;
+      reply.reply_status = ReplyHeader.NO_EXCEPTION;
 
     reply.request_id = rh_request.request_id;
 
@@ -719,7 +719,7 @@
 
     MessageHeader msh_reply = new MessageHeader();
     msh_reply.version = msh_request.version;
-    msh_reply.message_type = msh_reply.REPLY;
+    msh_reply.message_type = MessageHeader.REPLY;
     msh_reply.message_size = out.buffer.size();
 
     // Write the reply.
@@ -772,7 +772,7 @@
             n = in.read(r, n, r.length - n);
           }
 
-        if (msh_request.message_type == msh_request.REQUEST)
+        if (msh_request.message_type == MessageHeader.REQUEST)
           {
             RequestHeader rh_request;
 
@@ -957,4 +957,4 @@
   {
     asynchron.send_multiple_requests_oneway(requests);
   }
-}
\ No newline at end of file
+}
Index: gnu/CORBA/IOR.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/CORBA/IOR.java,v
retrieving revision 1.1
diff -u -r1.1 IOR.java
--- gnu/CORBA/IOR.java	15 May 2005 01:09:29 -0000	1.1
+++ gnu/CORBA/IOR.java	24 May 2005 08:18:47 -0000
@@ -467,7 +467,7 @@
         // One tagged component.
         b.write_long(1);
 
-        b.write_long(CodeSets.TAG_CODE_SETS);
+        b.write_long(CodeSets_profile.TAG_CODE_SETS);
         CodeSets.write(b);
 
         b.close();
Index: gnu/CORBA/bufferedResponseHandler.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/CORBA/bufferedResponseHandler.java,v
retrieving revision 1.1
diff -u -r1.1 bufferedResponseHandler.java
--- gnu/CORBA/bufferedResponseHandler.java	15 May 2005 01:09:29 -0000	1.1
+++ gnu/CORBA/bufferedResponseHandler.java	24 May 2005 08:18:47 -0000
@@ -130,7 +130,7 @@
   {
     exceptionReply = false;
     prepareStream();
-    reply_header.reply_status = reply_header.NO_EXCEPTION;
+    reply_header.reply_status = ReplyHeader.NO_EXCEPTION;
     return buffer;
   }
 
Index: gnu/regexp/RE.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/regexp/RE.java,v
retrieving revision 1.4
diff -u -r1.4 RE.java
--- gnu/regexp/RE.java	16 May 2005 19:02:31 -0000	1.4
+++ gnu/regexp/RE.java	24 May 2005 08:18:47 -0000
@@ -1,5 +1,5 @@
 /* gnu/regexp/RE.java
-   Copyright (C) 1998-2001, 2004 Free Software Foundation, Inc.
+   Copyright (C) 1998-2001, 2004, 2005 Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -819,7 +819,9 @@
 
   private static int getCharUnit(char[] input, int index, CharUnit unit, boolean quot) throws REException {
     unit.ch = input[index++];
-    if (unit.bk = (unit.ch == '\\' && (!quot || index >= input.length || input[index] == 'E')))
+    unit.bk = (unit.ch == '\\'
+	       && (!quot || index >= input.length || input[index] == 'E'));
+    if (unit.bk)
       if (index < input.length)
 	unit.ch = input[index++];
       else throw new REException(getLocalizedMessage("ends.with.backslash"),REException.REG_ESCAPE,index);
Index: java/util/regex/Pattern.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/util/regex/Pattern.java,v
retrieving revision 1.10
diff -u -r1.10 Pattern.java
--- java/util/regex/Pattern.java	6 Feb 2005 15:50:18 -0000	1.10
+++ java/util/regex/Pattern.java	24 May 2005 08:18:48 -0000
@@ -1,5 +1,5 @@
 /* Pattern.java -- Compiled regular expression ready to be applied.
-   Copyright (C) 2002, 2004 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -188,9 +188,9 @@
     int count = 0;
     int start = 0;
     int end;
-    boolean matched;
+    boolean matched = matcher.find();
 
-    while (matched = matcher.find() && (limit <= 0 || count < limit - 1))
+    while (matched && (limit <= 0 || count < limit - 1))
       {
 	++count;
 	end = matcher.start();
@@ -208,6 +208,7 @@
 	    list.add(text);
 	  }
 	start = matcher.end();
+	matched = matcher.find();
       }
 
     // We matched nothing.

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
Classpath-patches mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/classpath-patches

Reply via email to