<Swing Dev> javax.swing.text.html.parser.NPrintWriter
Alexandr Scherbatiy
alexandr.scherbatiy at oracle.com
Wed Sep 14 16:29:16 UTC 2016
Hello Manuel,
Thank you for the feedback. I have filled an issue on it [1]:
JDK-8166050 partialArray is not created in
javax.swing.text.html.parser.NPrintWriter.println(...) method
Do you have any particular test which runs into this issue?
[1] https://bugs.openjdk.java.net/browse/JDK-8166050
Thanks,
Alexandr.
On 9/14/2016 11:41 AM, Manuel Kassens wrote:
>
> Hi,
>
> i found an error in javax
> <eclipse-javadoc:%E2%98%82=tools/src%3Cjavax>.swing
> <eclipse-javadoc:%E2%98%82=tools/src%3Cjavax.swing>.text
> <eclipse-javadoc:%E2%98%82=tools/src%3Cjavax.swing.text>.html
> <eclipse-javadoc:%E2%98%82=tools/src%3Cjavax.swing.text.html>.parser
> <eclipse-javadoc:%E2%98%82=tools/src%3Cjavax.swing.text.html.parser>.NPrintWriter
>
> void javax <eclipse-javadoc:%E2%98%82=tools/src%3Cjavax>.swing
> <eclipse-javadoc:%E2%98%82=tools/src%3Cjavax.swing>.text
> <eclipse-javadoc:%E2%98%82=tools/src%3Cjavax.swing.text>.html
> <eclipse-javadoc:%E2%98%82=tools/src%3Cjavax.swing.text.html>.parser
> <eclipse-javadoc:%E2%98%82=tools/src%3Cjavax.swing.text.html.parser>.NPrintWriter
> <eclipse-javadoc:%E2%98%82=tools/src%3Cjavax.swing.text.html.parser%7BTagStack.java%E2%98%83NPrintWriter>.println(char[]
> array)
>
> *public**void*println(*char*[] array) {
>
> *if*(*this*.numPrinted>= *this*.numLines) {
>
> *return*;
>
> }
>
> *char*[] partialArray= *null*;
>
> *for*(*int*i= 0; i< array.length; i++) {
>
> *if*(array[i] == '\n') {
>
> *this*.numPrinted++;
>
> }
>
> *if*(*this*.numPrinted== *this*.numLines) {
>
> /* è*/ partialArray= *new**char*[i]; */* missing code, without there
> will be a NPE */*
>
> System./arraycopy/(array, 0, partialArray, 0, i);
>
> }
>
> }
>
> *if*(partialArray!= *null*) {
>
> *super*.print(partialArray);
>
> }
>
> *if*(*this*.numPrinted== *this*.numLines) {
>
> *return*;
>
> }
>
> *super*.println(array);
>
> *this*.numPrinted++;
>
> }
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/swing-dev/attachments/20160914/d7498b73/attachment.html>
More information about the swing-dev
mailing list