cziegeler 01/11/05 03:32:55
Modified: src/org/apache/cocoon/generation HTMLGenerator.java
ScriptGenerator.java
Log:
More NPE fixes
Revision Changes Path
1.17 +8 -6
xml-cocoon2/src/org/apache/cocoon/generation/HTMLGenerator.java
Index: HTMLGenerator.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/org/apache/cocoon/generation/HTMLGenerator.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- HTMLGenerator.java 2001/10/25 19:32:59 1.16
+++ HTMLGenerator.java 2001/11/05 11:32:55 1.17
@@ -42,7 +42,7 @@
/**
* @author <a href="mailto:[EMAIL PROTECTED]">Davanum Srinivas</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Carsten Ziegeler</a>
- * @version CVS $Revision: 1.16 $ $Date: 2001/10/25 19:32:59 $
+ * @version CVS $Revision: 1.17 $ $Date: 2001/11/05 11:32:55 $
*/
public class HTMLGenerator extends ComposerGenerator implements Cacheable,
Recyclable, Composable, Disposable {
@@ -70,8 +70,10 @@
*/
public void recycle() {
super.recycle();
- this.inputSource.recycle();
- this.inputSource = null;
+ if (this.inputSource != null) {
+ this.inputSource.recycle();
+ this.inputSource = null;
+ }
this.xpath = null;
}
@@ -82,7 +84,7 @@
public void setup(SourceResolver resolver, Map objectModel, String src,
Parameters par)
throws ProcessingException, SAXException, IOException {
super.setup(resolver, objectModel, src, par);
-
+
Request request = (Request)
objectModel.get(Constants.REQUEST_OBJECT);
xpath = request.getParameter("xpath");
if(xpath == null)
@@ -98,10 +100,10 @@
String[] values = request.getParameterValues( name );
for (int i = 0; i < values.length; i++) {
- query.append( name ).append( "=" ).append( values[i]
).append( "&" );
+ query.append( name ).append( "=" ).append( values[i]
).append( "&" );
}
}
-
+
if (query.length() > 0) {
super.source = new
StringBuffer(super.source).append("?").append(query.substring( 0,
query.length() - 1 )).toString();
}
1.14 +5 -3
xml-cocoon2/src/org/apache/cocoon/generation/ScriptGenerator.java
Index: ScriptGenerator.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/org/apache/cocoon/generation/ScriptGenerator.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- ScriptGenerator.java 2001/10/11 07:28:21 1.13
+++ ScriptGenerator.java 2001/11/05 11:32:55 1.14
@@ -45,7 +45,7 @@
* </pre>
*
* @author <a href="mailto:[EMAIL PROTECTED]">Jason Foster</a>
- * @version CVS $Revision: 1.13 $ $Date: 2001/10/11 07:28:21 $
+ * @version CVS $Revision: 1.14 $ $Date: 2001/11/05 11:32:55 $
*/
public class ScriptGenerator extends ComposerGenerator implements
Configurable,
Recyclable {
@@ -101,8 +101,10 @@
public void recycle() {
super.recycle();
- this.inputSource.recycle();
- this.inputSource = null;
+ if (this.inputSource != null) {
+ this.inputSource.recycle();
+ this.inputSource = null;
+ }
}
public void generate() throws ProcessingException {
----------------------------------------------------------------------
In case of troubles, e-mail: [EMAIL PROTECTED]
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]