Sven,

-  public final char[] value;
+  private final char[] value;

  /**
   * Holds the number of characters in value.  This number is generally
   * the same as value.length, but can be smaller because substrings and
   * StringBuffers can share arrays. Package visible for use by trusted code.
   */
-  public final int count;
+  private final int count;

  /**
   * Caches the result of hashCode().  If this value is zero, the hashcode
@@ -132,7 +132,7 @@
   * substring()'s are common, the use of offset allows the operation
   * to perform in O(1). Package access is granted for use by StringBuffer.
   */
-  public final int offset;
+  private final int offset;

  /**
   * An implementation for [EMAIL PROTECTED] CASE_INSENSITIVE_ORDER}.

Bad idea, that breaks the build because StringBuffer is accessing this. Package private is better in this case. I fix this with the attached patch.

Generally when changing stuff in core libraries better RFC the list. And always check if it still builds.

2005-04-18  Roman Kennke  <[EMAIL PROTECTED]>

       * java/lang/String.java:
       Make value, offset and count fields package private instead
       of private.

/Roman

Index: java/lang/String.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/lang/String.java,v
retrieving revision 1.63
diff -u -r1.63 String.java
--- java/lang/String.java       18 Apr 2005 10:11:45 -0000      1.63
+++ java/lang/String.java       18 Apr 2005 11:18:07 -0000
@@ -112,14 +112,14 @@
    * Characters which make up the String.
    * Package access is granted for use by StringBuffer.
    */
-  private final char[] value;
+  final char[] value;
 
   /**
    * Holds the number of characters in value.  This number is generally
    * the same as value.length, but can be smaller because substrings and
    * StringBuffers can share arrays. Package visible for use by trusted code.
    */
-  private final int count;
+  final int count;
 
   /**
    * Caches the result of hashCode().  If this value is zero, the hashcode
@@ -132,7 +132,7 @@
    * substring()'s are common, the use of offset allows the operation
    * to perform in O(1). Package access is granted for use by StringBuffer.
    */
-  private final int offset;
+  final int offset;
 
   /**
    * An implementation for [EMAIL PROTECTED] CASE_INSENSITIVE_ORDER}.
_______________________________________________
Classpath-patches mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/classpath-patches

Reply via email to