Author: omalley
Date: Thu Sep 24 16:47:59 2009
New Revision: 818543
URL: http://svn.apache.org/viewvc?rev=818543&view=rev
Log:
HADOOP-6281. Avoid null pointer exceptions when the jsps don't have
paramaters (omalley)
Modified:
hadoop/common/trunk/CHANGES.txt
hadoop/common/trunk/src/java/org/apache/hadoop/http/HtmlQuoting.java
hadoop/common/trunk/src/test/core/org/apache/hadoop/http/TestHtmlQuoting.java
Modified: hadoop/common/trunk/CHANGES.txt
URL:
http://svn.apache.org/viewvc/hadoop/common/trunk/CHANGES.txt?rev=818543&r1=818542&r2=818543&view=diff
==============================================================================
--- hadoop/common/trunk/CHANGES.txt (original)
+++ hadoop/common/trunk/CHANGES.txt Thu Sep 24 16:47:59 2009
@@ -702,8 +702,9 @@
HADOOP-5292. Fix NPE in KFS::getBlockLocations. (Sriram Rao via lohit)
- HADOOP-5219. Adds a new property io.seqfile.local.dir for use by
SequenceFile,
- which earlier used mapred.local.dir. (Sharad Agarwal via ddas)
+ HADOOP-5219. Adds a new property io.seqfile.local.dir for use by
+ SequenceFile, which earlier used mapred.local.dir. (Sharad Agarwal
+ via ddas)
HADOOP-5300. Fix ant javadoc-dev target and the typo in the class name
NameNodeActivtyMBean. (szetszwo)
@@ -720,7 +721,7 @@
HADOOP-5383. Avoid building an unused string in NameNode's
verifyReplication(). (Raghu Angadi)
- HADOOP-5347. Create a job output directory for the bbp examples.
(szetszwo)
+ HADOOP-5347. Create a job output directory for the bbp examples. (szetszwo)
HADOOP-5341. Make hadoop-daemon scripts backwards compatible with the
changes in HADOOP-4868. (Sharad Agarwal via yhemanth)
@@ -826,8 +827,8 @@
in the JobTracker to get the FileSystem objects as per the JobTracker's
configuration. (Amar Kamat via ddas)
- HADOOP-5648. Not able to generate gridmix.jar on the already compiled
version of hadoop.
- (gkesavan)
+ HADOOP-5648. Not able to generate gridmix.jar on the already compiled
+ version of hadoop. (gkesavan)
HADOOP-5808. Fix import never used javac warnings in hdfs. (szetszwo)
@@ -911,7 +912,8 @@
in DataBlockScanner. (Kan Zhang via szetszwo)
HADOOP-4864. Fixes a problem to do with -libjars with multiple jars when
- client and cluster reside on different OSs. (Amareshwari Sriramadasu via
ddas)
+ client and cluster reside on different OSs. (Amareshwari Sriramadasu via
+ ddas)
HADOOP-5623. Fixes a problem to do with status messages getting overwritten
in streaming jobs. (Rick Cox and Jothi Padmanabhan via ddas)
@@ -919,8 +921,8 @@
HADOOP-5895. Fixes computation of count of merged bytes for logging.
(Ravi Gummadi via ddas)
- HADOOP-5805. problem using top level s3 buckets as input/output
directories.
- (Ian Nowland via tomwhite)
+ HADOOP-5805. problem using top level s3 buckets as input/output
+ directories. (Ian Nowland via tomwhite)
HADOOP-5940. trunk eclipse-plugin build fails while trying to copy
commons-cli jar from the lib dir (Giridharan Kesavan via gkesavan)
@@ -1019,8 +1021,9 @@
HADOOP-6123. Add missing classpaths in hadoop-config.sh. (Sharad Agarwal
via szetszwo)
- HADOOP-6172. Fix jar file names in hadoop-config.sh and include
${build.src}
- as a part of the source list in build.xml. (Hong Tang via szetszwo)
+ HADOOP-6172. Fix jar file names in hadoop-config.sh and include
+ ${build.src} as a part of the source list in build.xml. (Hong Tang via
+ szetszwo)
HADOOP-6124. Fix javac warning detection in test-patch.sh. (Giridharan
Kesavan via szetszwo)
@@ -1079,6 +1082,9 @@
HADOOP-6274. Fix TestLocalFSFileContextMainOperations test failure.
(Gary Murry via suresh).
+ HADOOP-6281. Avoid null pointer exceptions when the jsps don't have
+ paramaters (omalley)
+
Release 0.20.1 - 2009-09-01
INCOMPATIBLE CHANGES
Modified: hadoop/common/trunk/src/java/org/apache/hadoop/http/HtmlQuoting.java
URL:
http://svn.apache.org/viewvc/hadoop/common/trunk/src/java/org/apache/hadoop/http/HtmlQuoting.java?rev=818543&r1=818542&r2=818543&view=diff
==============================================================================
--- hadoop/common/trunk/src/java/org/apache/hadoop/http/HtmlQuoting.java
(original)
+++ hadoop/common/trunk/src/java/org/apache/hadoop/http/HtmlQuoting.java Thu
Sep 24 16:47:59 2009
@@ -60,6 +60,9 @@
* @return does the string contain any of the active html characters?
*/
public static boolean needsQuoting(String str) {
+ if (str == null) {
+ return false;
+ }
byte[] bytes = str.getBytes();
return needsQuoting(bytes, 0 , bytes.length);
}
@@ -92,6 +95,9 @@
* @return the quoted string
*/
public static String quoteHtmlChars(String item) {
+ if (item == null) {
+ return null;
+ }
byte[] bytes = item.getBytes();
if (needsQuoting(bytes, 0, bytes.length)) {
ByteArrayOutputStream buffer = new ByteArrayOutputStream();
@@ -145,6 +151,9 @@
* @return the unquoted string
*/
public static String unquoteHtmlChars(String item) {
+ if (item == null) {
+ return null;
+ }
int next = item.indexOf('&');
// nothing was quoted
if (next == -1) {
Modified:
hadoop/common/trunk/src/test/core/org/apache/hadoop/http/TestHtmlQuoting.java
URL:
http://svn.apache.org/viewvc/hadoop/common/trunk/src/test/core/org/apache/hadoop/http/TestHtmlQuoting.java?rev=818543&r1=818542&r2=818543&view=diff
==============================================================================
---
hadoop/common/trunk/src/test/core/org/apache/hadoop/http/TestHtmlQuoting.java
(original)
+++
hadoop/common/trunk/src/test/core/org/apache/hadoop/http/TestHtmlQuoting.java
Thu Sep 24 16:47:59 2009
@@ -33,6 +33,7 @@
assertTrue(HtmlQuoting.needsQuoting("&"));
assertFalse(HtmlQuoting.needsQuoting(""));
assertFalse(HtmlQuoting.needsQuoting("ab\ncdef"));
+ assertFalse(HtmlQuoting.needsQuoting(null));
}
@Test public void testQuoting() throws Exception {
@@ -41,6 +42,7 @@
assertEquals("&&&", HtmlQuoting.quoteHtmlChars("&&&"));
assertEquals(" '\n", HtmlQuoting.quoteHtmlChars(" '\n"));
assertEquals(""", HtmlQuoting.quoteHtmlChars("\""));
+ assertEquals(null, HtmlQuoting.quoteHtmlChars(null));
}
private void runRoundTrip(String str) throws Exception {
@@ -53,6 +55,7 @@
runRoundTrip("<>&'\"");
runRoundTrip("ab>cd<ef&ghi'\"");
runRoundTrip("A string\n with no quotable chars in it!");
+ runRoundTrip(null);
StringBuilder buffer = new StringBuilder();
for(char ch=0; ch < 127; ++ch) {
buffer.append(ch);