diff options
author | Andrew John Hughes <gnu_andrew@member.fsf.org> | 2012-09-28 05:42:24 +0100 |
---|---|---|
committer | Andrew John Hughes <gnu_andrew@member.fsf.org> | 2012-09-28 05:42:24 +0100 |
commit | 98615fef3b11060138cb6c911420adcfab20e63c (patch) | |
tree | c0a7ec8d9b1ac184f3c3b67a86b4acdf52756071 | |
parent | cd3ebd72a7d59734fcf99e8ed85331b74445df1f (diff) | |
download | classpath-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-- | ChangeLog | 9 | ||||
-rw-r--r-- | NEWS | 3 | ||||
-rw-r--r-- | java/text/Bidi.java | 16 |
3 files changed, 20 insertions, 8 deletions
@@ -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: @@ -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(); } |