r1038 - xwiki/trunk/src/main/java/com/xpn/xwiki/render
Ludovic Dubost
ludovic at users.forge.objectweb.org
Sun Apr 9 23:19:34 CEST 2006
Author: ludovic
Date: 2006-04-09 23:19:23 +0200 (Sun, 09 Apr 2006)
New Revision: 1038
Modified:
xwiki/trunk/src/main/java/com/xpn/xwiki/render/XWikiRenderingEngine.java
Log:
Fix null pointer exception in tests
Modified: xwiki/trunk/src/main/java/com/xpn/xwiki/render/XWikiRenderingEngine.java
===================================================================
--- xwiki/trunk/src/main/java/com/xpn/xwiki/render/XWikiRenderingEngine.java 2006-04-09 19:41:52 UTC (rev 1037)
+++ xwiki/trunk/src/main/java/com/xpn/xwiki/render/XWikiRenderingEngine.java 2006-04-09 21:19:23 UTC (rev 1038)
@@ -1,25 +1,25 @@
-/*
- * Copyright 2006, XpertNet SARL, and individual contributors as indicated
- * by the contributors.txt.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- *
- * @author ludovic
- * @author sdumitriu
- */
+/*
+ * Copyright 2006, XpertNet SARL, and individual contributors as indicated
+ * by the contributors.txt.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *
+ * @author ludovic
+ * @author sdumitriu
+ */
package com.xpn.xwiki.render;
@@ -213,8 +213,10 @@
}
private String getKey(String text, XWikiDocument contentdoc, XWikiDocument includingdoc, XWikiContext context) {
- return context.getDatabase() + "-" + contentdoc.getDatabase() + ":" + contentdoc.getFullName() + "-"
- + includingdoc.getDatabase() + ":" + includingdoc.getFullName() + "-" + context.getRequest().getQueryString()
+ return ((context==null) ? "xwiki" : context.getDatabase()) + "-"
+ + ((contentdoc==null) ? "" : contentdoc.getDatabase() + ":" + contentdoc.getFullName()) + "-"
+ + ((includingdoc==null) ? "" : includingdoc.getDatabase() + ":" + includingdoc.getFullName()) + "-"
+ + ((context.getRequest()==null) ? "" : context.getRequest().getQueryString())
+ "-" + text.hashCode();
}
More information about the Xwiki-notifications
mailing list