summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew John Hughes <gnu_andrew@member.fsf.org>2012-09-28 05:42:24 +0100
committerAndrew John Hughes <gnu_andrew@member.fsf.org>2012-09-28 05:42:24 +0100
commit98615fef3b11060138cb6c911420adcfab20e63c (patch)
treec0a7ec8d9b1ac184f3c3b67a86b4acdf52756071
parentcd3ebd72a7d59734fcf99e8ed85331b74445df1f (diff)
downloadclasspath-98615fef3b11060138cb6c911420adcfab20e63c.tar.gz
PR42134: NullPointerException in java.text.Bidi
2012-09-26 Andrew John Hughes <gnu_andrew@member.fsf.org> PR classpath/42134 * java/text/Bidi.java: (Bidi(AttributedCharacterIterator)): Remove shadow variable text which hides the instance variable of the same name. Remove unnecessary use of this. * NEWS: Updated. Signed-off-by: Andrew John Hughes <gnu_andrew@member.fsf.org>
-rw-r--r--ChangeLog9
-rw-r--r--NEWS3
-rw-r--r--java/text/Bidi.java16
3 files changed, 20 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index 305bbdb34..007528938 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2012-09-26 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
+ PR classpath/42134
+ * java/text/Bidi.java:
+ (Bidi(AttributedCharacterIterator)): Remove shadow
+ variable text which hides the instance variable
+ of the same name. Remove unnecessary use of this.
+ * NEWS: Updated.
+
2012-09-24 Andrew John Hughes <gnu_andrew@member.fsf.org>
* tools/com/sun/javadoc/Doc.java:
diff --git a/NEWS b/NEWS
index 73ba71156..5295681da 100644
--- a/NEWS
+++ b/NEWS
@@ -12,6 +12,9 @@ CVE-XXXX-YYYY: http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=XXXX-YYYY
New in release 1.00 (XXX XX, XXXX)
+* Bug fixes:
+ - PR42134: NPE in java.text.Bidi
+
New in release 0.99 (Feb 15, 2012)
* Addition of java.util.regex.Pattern.quote.
diff --git a/java/text/Bidi.java b/java/text/Bidi.java
index 532ff4e99..236247d5e 100644
--- a/java/text/Bidi.java
+++ b/java/text/Bidi.java
@@ -161,13 +161,13 @@ public final class Bidi
if (val instanceof NumericShaper)
shaper = (NumericShaper) val;
- char[] text = new char[iter.getEndIndex() - iter.getBeginIndex()];
- this.embeddings = new byte[this.text.length];
- this.embeddingOffset = 0;
- this.length = text.length;
- for (int i = 0; i < this.text.length; ++i)
+ text = new char[iter.getEndIndex() - iter.getBeginIndex()];
+ embeddings = new byte[text.length];
+ embeddingOffset = 0;
+ length = text.length;
+ for (int i = 0; i < text.length; ++i)
{
- this.text[i] = iter.current();
+ text[i] = iter.current();
val = iter.getAttribute(TextAttribute.BIDI_EMBEDDING);
if (val instanceof Integer)
@@ -178,13 +178,13 @@ public final class Bidi
bval = 0;
else
bval = (byte) ival;
- this.embeddings[i] = bval;
+ embeddings[i] = bval;
}
}
// Invoke the numeric shaper, if specified.
if (shaper != null)
- shaper.shape(this.text, 0, this.length);
+ shaper.shape(text, 0, length);
runBidi();
}