You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2012/08/30 06:39:11 UTC

[Bug 53799] New: Can't Remove Comments when the number of comments more than 54

https://issues.apache.org/bugzilla/show_bug.cgi?id=53799

          Priority: P2
            Bug ID: 53799
          Assignee: dev@poi.apache.org
           Summary: Can't Remove Comments when the number of comments more
                    than 54
          Severity: normal
    Classification: Unclassified
                OS: Windows XP
          Reporter: tony810428@hotmail.com
          Hardware: PC
            Status: NEW
           Version: 3.8
         Component: HSSF
           Product: POI

I wanted to remove all comments in my workbook, but exception was thrown.

my code as follow,

-------------
for (int i = sheet.getLastRowNum() ; i >=0 ; i --) {
    Row row = sheet.getRow(i) ;

    if (row == null) {
        continue ;
    }

    for (int j = row.getLastCellNum() ; j >= 0 ; j --) {
        org.apache.poi.ss.usermodel.Cell c = row.getCell(j) ;

        if (c == null) {
            continue ;
        }

        c.removeCellComment() ;
        row.removeCell(c) ;
    }

    sheet.removeRow(row) ;
}
--------------------


when the number of comments in .xls more than 60 or more, will throw exception
as follow

-----------------------
//HSSFCell, line is 1065
throw new IllegalStateException("Found the wrong records before the
TextObjectRecord, can't remove comment");
----------------------

is any firend can help? thanks~~~~

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 53799] Can't Remove Comments when the number of comments more than 54

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53799

--- Comment #6 from Virgil.Chen <to...@hotmail.com> ---
Created attachment 29312
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=29312&action=edit
Code & Run Result

oh no..My Code Can't Pass~~~ why?
I use poi-3.8-20120326.jar
thx

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 53799] Can't Remove Comments when the number of comments more than 54

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53799

--- Comment #2 from Virgil.Chen <to...@hotmail.com> ---
Created attachment 29305
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=29305&action=edit
this xls can remove all comments

this xls can remove all comments

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 53799] Can't Remove Comments when the number of comments more than 54

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53799

--- Comment #7 from Evgeniy Berlog <su...@gmail.com> ---
Hi Virgil.Chen

You can download the latest build from this link
https://builds.apache.org/job/POI/lastSuccessfulBuild/artifact/build/dist/

Regards, Evgeniy

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 53799] Can't Remove Comments when the number of comments more than 54

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53799

--- Comment #3 from Virgil.Chen <to...@hotmail.com> ---
Created attachment 29306
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=29306&action=edit
this xls can't remove all comments

I added 2 rows to this xls base on before xls, and this xls can't remove all
comments,

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 53799] Can't Remove Comments when the number of comments more than 54

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53799

--- Comment #11 from Evgeniy Berlog <su...@gmail.com> ---
Virgil,

I'm glad that I helped you. Good luck in your project.

Regards, Evgeniy

(In reply to comment #10)
> Dear Evgeniy,
> 
> I created a new project and ran the test case under 3.9-jar, it's passed,
> you are right, thank you  very much.
> 
> I will take the other way to my project so as to avoid it, and waiting next
> version release.
> 
> anyway, thanks~~~
> 
> 
> 
> 
> 
> (In reply to comment #9)
> > Hi Virgil,
> > 
> > I think that OS or jdk version don't affect the result in this case.
> > I've checked your code with POI 3.8 and this bug really appeared.
> > 
> > Probably you have two POI libraries in classpath. Please check your
> > configuration one more time and if you find old POI library in your
> > classpath just remove it.
> > 
> > Regards, Evgeniy
> > 
> > (In reply to comment #8)
> > > Dear Evgeniy,
> > > 
> > > It's very strange~~ ah ha~~
> > > 
> > > I download poi-bin-3.9-beta1-20120829.tar.gz to run my test case, but get
> > > the same Error~~
> > > 
> > > any suggestion? JDK Version? OS ?
> > > 
> > > thank you very much~~
> > > 
> > > 
> > > 
> > > Regards, Virgil
> > > 
> > > (In reply to comment #7)
> > > > Hi Virgil.Chen
> > > > 
> > > > You can download the latest build from this link
> > > > https://builds.apache.org/job/POI/lastSuccessfulBuild/artifact/build/dist/
> > > > 
> > > > Regards, Evgeniy

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 53799] Can't Remove Comments when the number of comments more than 54

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53799

--- Comment #9 from Evgeniy Berlog <su...@gmail.com> ---
Hi Virgil,

I think that OS or jdk version don't affect the result in this case.
I've checked your code with POI 3.8 and this bug really appeared.

Probably you have two POI libraries in classpath. Please check your
configuration one more time and if you find old POI library in your classpath
just remove it.

Regards, Evgeniy

(In reply to comment #8)
> Dear Evgeniy,
> 
> It's very strange~~ ah ha~~
> 
> I download poi-bin-3.9-beta1-20120829.tar.gz to run my test case, but get
> the same Error~~
> 
> any suggestion? JDK Version? OS ?
> 
> thank you very much~~
> 
> 
> 
> Regards, Virgil
> 
> (In reply to comment #7)
> > Hi Virgil.Chen
> > 
> > You can download the latest build from this link
> > https://builds.apache.org/job/POI/lastSuccessfulBuild/artifact/build/dist/
> > 
> > Regards, Evgeniy

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 53799] Can't Remove Comments when the number of comments more than 54

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53799

--- Comment #5 from Evgeniy Berlog <su...@gmail.com> ---
I've executed your code with both of your input files successully.
Please, say what version of POI do you use.

I used POI trunk latest build. You can see download links on
http://poi.apache.org/
or build yourself from SVN trunk, see http://poi.apache.org/subversion.html. 

Regards, Evgeniy

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 53799] Can't Remove Comments when the number of comments more than 54

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53799

--- Comment #1 from Evgeniy Berlog <su...@gmail.com> ---
Hi,

Attach please the source .xls file you work with

Regards, Evgeniy

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 53799] Can't Remove Comments when the number of comments more than 54

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53799

--- Comment #4 from Virgil.Chen <to...@hotmail.com> ---
(In reply to comment #1)
I added 2 xls files, thanks

> Hi,
> 
> Attach please the source .xls file you work with
> 
> Regards, Evgeniy

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 53799] Can't Remove Comments when the number of comments more than 54

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53799

--- Comment #8 from Virgil.Chen <to...@hotmail.com> ---
Dear Evgeniy,

It's very strange~~ ah ha~~

I download poi-bin-3.9-beta1-20120829.tar.gz to run my test case, but get the
same Error~~

any suggestion? JDK Version? OS ?

thank you very much~~



Regards, Virgil

(In reply to comment #7)
> Hi Virgil.Chen
> 
> You can download the latest build from this link
> https://builds.apache.org/job/POI/lastSuccessfulBuild/artifact/build/dist/
> 
> Regards, Evgeniy

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 53799] Can't Remove Comments when the number of comments more than 54

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53799

Virgil.Chen <to...@hotmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |LATER

--- Comment #10 from Virgil.Chen <to...@hotmail.com> ---
Dear Evgeniy,

I created a new project and ran the test case under 3.9-jar, it's passed,
you are right, thank you  very much.

I will take the other way to my project so as to avoid it, and waiting next
version release.

anyway, thanks~~~





(In reply to comment #9)
> Hi Virgil,
> 
> I think that OS or jdk version don't affect the result in this case.
> I've checked your code with POI 3.8 and this bug really appeared.
> 
> Probably you have two POI libraries in classpath. Please check your
> configuration one more time and if you find old POI library in your
> classpath just remove it.
> 
> Regards, Evgeniy
> 
> (In reply to comment #8)
> > Dear Evgeniy,
> > 
> > It's very strange~~ ah ha~~
> > 
> > I download poi-bin-3.9-beta1-20120829.tar.gz to run my test case, but get
> > the same Error~~
> > 
> > any suggestion? JDK Version? OS ?
> > 
> > thank you very much~~
> > 
> > 
> > 
> > Regards, Virgil
> > 
> > (In reply to comment #7)
> > > Hi Virgil.Chen
> > > 
> > > You can download the latest build from this link
> > > https://builds.apache.org/job/POI/lastSuccessfulBuild/artifact/build/dist/
> > > 
> > > Regards, Evgeniy

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org