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 2017/06/29 10:22:32 UTC

[Bug 61236] New: Dynamically addAbstractNum in XWPFNumbering

https://bz.apache.org/bugzilla/show_bug.cgi?id=61236

            Bug ID: 61236
           Summary: Dynamically addAbstractNum in XWPFNumbering
           Product: POI
           Version: 3.16-FINAL
          Hardware: PC
                OS: Mac OS X 10.1
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XWPF
          Assignee: dev@poi.apache.org
          Reporter: adasai90@gmail.com
  Target Milestone: ---

I want addAbstractNum in XWPFNumbering Dynamically, but in method
org.apache.poi.xwpf.usermodel.XWPFNumbering.addAbstractNum(), if
abstractNum.getAbstractNum() is null, will throw NullPointerException


TRACE:

java.lang.NullPointerException
        at
org.apache.poi.xwpf.usermodel.XWPFNumbering.addAbstractNum(XWPFNumbering.java:242)

-- 
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 61236] Dynamically addAbstractNum in XWPFNumbering

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

--- Comment #2 from adasai90@gmail.com ---
(In reply to PJ Fanning from comment #1)
> Isn't abstractNum the param you pass in?
> 
> public BigInteger addAbstractNum(XWPFAbstractNum abstractNum)
> 
> Can't you ensure that your abstractNum has a non-null value for
> abstractNum.getAbstractNum()?
> 
> Eg by using
> public XWPFAbstractNum(CTAbstractNum abstractNum)
> 
> Could you provide a full sample of what you are trying to do?

abstractNum.getAbstractNum() is really null,i just want to addAbstractNum。 
Java Code allow abstractNum.getAbstractNum() has a null value,but in else
block, throw exception,So the else block is dead.

Thank you.
finally, i found this method to addAbstractNum, it's OK,
https://stackoverflow.com/questions/44433347/apache-poi-numbered-list

-- 
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 61236] Dynamically addAbstractNum in XWPFNumbering

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

Dominik Stadler <do...@gmx.at> changed:

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

--- Comment #3 from Dominik Stadler <do...@gmx.at> ---
Seems to be ok for now based on last comment.

-- 
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 61236] Dynamically addAbstractNum in XWPFNumbering

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

--- Comment #1 from PJ Fanning <fa...@yahoo.com> ---
Isn't abstractNum the param you pass in?

public BigInteger addAbstractNum(XWPFAbstractNum abstractNum)

Can't you ensure that your abstractNum has a non-null value for
abstractNum.getAbstractNum()?

Eg by using
public XWPFAbstractNum(CTAbstractNum abstractNum)

Could you provide a full sample of what you are trying to do?

-- 
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 61236] Dynamically addAbstractNum in XWPFNumbering

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

adasai90@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|WORKSFORME                  |FIXED

-- 
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