Permalink
Browse files

Handle numbering headers that are blank.

  • Loading branch information...
1 parent c1fc51a commit 41b275035e1fbd614bad1beb6544325a81bfc51c @jhinkey jhinkey committed Apr 17, 2012
View
13 code/liferay-doc-utils/src/com/liferay/documentation/util/NumberHeadersTask.java
@@ -136,7 +136,9 @@ private String extractChapterNumber(String fileName) {
return chapter;
}
- private String handleHeaderLine(String line, String filename, int lineNum, Properties props) {
+ private String handleHeaderLine(String line, String filename, int lineNum,
+ Properties props) throws BuildException {
+
String newHeadingLine = null;
// Check if the header contains an ID
@@ -180,7 +182,14 @@ private String handleHeaderLine(String line, String filename, int lineNum, Prop
}
}
- String heading = extractHeading(line, indexOfFirstHeaderChar);
+ String heading = null;
+ if (indexOfFirstHeaderChar > 0) {
+ heading = extractHeading(line, indexOfFirstHeaderChar);
+ }
+ else {
+ throw new BuildException("WARNING - " + filename + ":" +
+ lineNum + " is missing header text.");
+ }
String chapter = extractChapterNumber(filename);
View
BIN lib/liferay-doc-utils.jar
Binary file not shown.

0 comments on commit 41b2750

Please sign in to comment.