Author: ltheussl
Date: Wed Jun 3 10:17:37 2009
New Revision: 781327
URL: http://svn.apache.org/viewvc?rev=781327&view=rev
Log:
Remove redundant flags
Modified:
maven/doxia/doxia/trunk/doxia-modules/doxia-module-fml/src/main/java/org/apache/maven/doxia/module/fml/FmlParser.java
Modified:
maven/doxia/doxia/trunk/doxia-modules/doxia-module-fml/src/main/java/org/apache/maven/doxia/module/fml/FmlParser.java
URL:
http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-fml/src/main/java/org/apache/maven/doxia/module/fml/FmlParser.java?rev=781327&r1=781326&r2=781327&view=diff
==============================================================================
---
maven/doxia/doxia/trunk/doxia-modules/doxia-module-fml/src/main/java/org/apache/maven/doxia/module/fml/FmlParser.java
(original)
+++
maven/doxia/doxia/trunk/doxia-modules/doxia-module-fml/src/main/java/org/apache/maven/doxia/module/fml/FmlParser.java
Wed Jun 3 10:17:37 2009
@@ -66,12 +66,6 @@
/** Collect a single faq. */
private Faq currentFaq;
- /** An indication on if we're inside a question. */
- private boolean inQuestion;
-
- /** An indication on if we're inside an answer. */
- private boolean inAnswer;
-
/** Used to collect text events. */
private StringBuffer buffer;
@@ -200,8 +194,6 @@
buffer.append( String.valueOf( LESS_THAN ) ).append(
parser.getName() )
.append( String.valueOf( GREATER_THAN ) );
-
- inQuestion = true;
}
else if ( parser.getName().equals( ANSWER_TAG.toString() ) )
{
@@ -210,9 +202,8 @@
buffer.append( String.valueOf( LESS_THAN ) ).append(
parser.getName() )
.append( String.valueOf( GREATER_THAN ) );
- inAnswer = true;
}
- else if ( inQuestion || inAnswer )
+ else if ( buffer != null )
{
buffer.append( String.valueOf( LESS_THAN ) ).append(
parser.getName() );
@@ -274,7 +265,7 @@
currentFaq.setQuestion( buffer.toString() );
- inQuestion = false;
+ buffer = null;
}
else if ( parser.getName().equals( ANSWER_TAG.toString() ) )
{
@@ -283,14 +274,15 @@
throw new XmlPullParserException( "Missing <faq> at: ("
+ parser.getLineNumber() + ":" + parser.getColumnNumber()
+ ")" );
}
+
buffer.append( String.valueOf( LESS_THAN ) ).append(
String.valueOf( SLASH ) )
.append( parser.getName() ).append( String.valueOf(
GREATER_THAN ) );
currentFaq.setAnswer( buffer.toString() );
- inAnswer = false;
+ buffer = null;
}
- else if ( inQuestion || inAnswer )
+ else if ( buffer != null )
{
if ( buffer.charAt( buffer.length() - 1 ) == SPACE )
{
@@ -306,7 +298,7 @@
protected void handleText( XmlPullParser parser, Sink sink )
throws XmlPullParserException
{
- if ( inQuestion || inAnswer )
+ if ( buffer != null )
{
buffer.append( parser.getText() );
}
@@ -320,7 +312,7 @@
{
String cdSection = parser.getText();
- if ( inQuestion || inAnswer )
+ if ( buffer != null )
{
buffer.append( LESS_THAN ).append( BANG ).append(
LEFT_SQUARE_BRACKET ).append( CDATA )
.append( LEFT_SQUARE_BRACKET ).append( cdSection ).append(
RIGHT_SQUARE_BRACKET )
@@ -338,7 +330,7 @@
{
String comment = parser.getText();
- if ( inQuestion || inAnswer )
+ if ( buffer != null )
{
buffer.append( LESS_THAN ).append( BANG ).append( MINUS ).append(
MINUS )
.append( comment ).append( MINUS ).append( MINUS ).append(
GREATER_THAN );
@@ -353,9 +345,9 @@
protected void handleEntity( XmlPullParser parser, Sink sink )
throws XmlPullParserException
{
- if ( inQuestion || inAnswer )
+ if ( buffer != null )
{
- if ( buffer != null && parser.getText() != null )
+ if ( parser.getText() != null )
{
String text = parser.getText();