<Swing Dev> javax.swing.text.html.parser.NPrintWriter

Alexandr Scherbatiy alexandr.scherbatiy at oracle.com
Wed Sep 14 17:52:07 UTC 2016


On 9/14/2016 7:35 PM, Sergey Bylokhov wrote:
> I think that NPrintWriter is not public and is not used in jdk.
   May be it it has sense just to remove it?

   Thanks,
   Alexandr.
>
> On 14.09.16 19:29, Alexandr Scherbatiy wrote:
>>
>> 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++;
>>>
>>>      }
>>>
>>>
>>>
>>
>
>




More information about the swing-dev mailing list