I tried to find used styles of style, which have 'next style', but has no 'link style', using XWPFStyles.getUsedStyleList(XWPFStyle) method and got NPE at 174 line. https://github.com/apache/poi/blob/REL_3_11_BRANCH/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFStyles.java#L191 This part of code looks really suspicious: String nextStyleID = style.getNextStyleID(); XWPFStyle nextStyle = getStyle(nextStyleID); if((nextStyle!=null)&&(!usedStyleList.contains(nextStyle))){ usedStyleList.add(linkStyle); getUsedStyleList(linkStyle, usedStyleList); } Probably this is a bug, and author mentioned that: usedStyleList.add(nextStyle); getUsedStyleList(nextStyle, usedStyleList); So, trunk version of this class contains same part of code too.
https://github.com/apache/poi/blob/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFStyles.java#L245 Current version has same piece of code.