pig-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From da...@apache.org
Subject svn commit: r1143623 - in /pig/trunk: ./ contrib/piggybank/java/src/main/java/org/apache/pig/piggybank/evaluation/util/apachelogparser/ contrib/piggybank/java/src/test/java/org/apache/pig/piggybank/test/evaluation/util/apachelogparser/
Date Thu, 07 Jul 2011 01:23:22 GMT
Author: daijy
Date: Thu Jul  7 01:23:20 2011
New Revision: 1143623

URL: http://svn.apache.org/viewvc?rev=1143623&view=rev
Log:
PIG-2110: NullPointerException in piggybank.evaluation.util.apachelogparser.SearchTermExtractor

Modified:
    pig/trunk/CHANGES.txt
    pig/trunk/contrib/piggybank/java/src/main/java/org/apache/pig/piggybank/evaluation/util/apachelogparser/SearchTermExtractor.java
    pig/trunk/contrib/piggybank/java/src/test/java/org/apache/pig/piggybank/test/evaluation/util/apachelogparser/TestSearchTermExtractor.java

Modified: pig/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/pig/trunk/CHANGES.txt?rev=1143623&r1=1143622&r2=1143623&view=diff
==============================================================================
--- pig/trunk/CHANGES.txt (original)
+++ pig/trunk/CHANGES.txt Thu Jul  7 01:23:20 2011
@@ -62,6 +62,8 @@ PIG-2011: Speed up TestTypedMap.java (dv
 
 BUG FIXES
 
+PIG-2110: NullPointerException in piggybank.evaluation.util.apachelogparser.SearchTermExtractor
(dale_jin via daijy)
+
 PIG-2144: ClassCastException when using IsEmpty(DIFF()) (thejas)
 
 PIG-2139: LogicalExpressionSimplifier optimizer rule should check if udf is

Modified: pig/trunk/contrib/piggybank/java/src/main/java/org/apache/pig/piggybank/evaluation/util/apachelogparser/SearchTermExtractor.java
URL: http://svn.apache.org/viewvc/pig/trunk/contrib/piggybank/java/src/main/java/org/apache/pig/piggybank/evaluation/util/apachelogparser/SearchTermExtractor.java?rev=1143623&r1=1143622&r2=1143623&view=diff
==============================================================================
--- pig/trunk/contrib/piggybank/java/src/main/java/org/apache/pig/piggybank/evaluation/util/apachelogparser/SearchTermExtractor.java
(original)
+++ pig/trunk/contrib/piggybank/java/src/main/java/org/apache/pig/piggybank/evaluation/util/apachelogparser/SearchTermExtractor.java
Thu Jul  7 01:23:20 2011
@@ -167,6 +167,7 @@ public class SearchTermExtractor extends
       if (HOSTS.containsKey(host) || host.contains("google.co")
           || host.contains("search.yahoo")) {
         String queryString = urlObject.getQuery();
+        if (queryString == null) { return null; }
         TERM_MATCHER.reset(queryString);
         if (TERM_MATCHER.find()) {
           String terms = TERM_MATCHER.group(1);

Modified: pig/trunk/contrib/piggybank/java/src/test/java/org/apache/pig/piggybank/test/evaluation/util/apachelogparser/TestSearchTermExtractor.java
URL: http://svn.apache.org/viewvc/pig/trunk/contrib/piggybank/java/src/test/java/org/apache/pig/piggybank/test/evaluation/util/apachelogparser/TestSearchTermExtractor.java?rev=1143623&r1=1143622&r2=1143623&view=diff
==============================================================================
--- pig/trunk/contrib/piggybank/java/src/test/java/org/apache/pig/piggybank/test/evaluation/util/apachelogparser/TestSearchTermExtractor.java
(original)
+++ pig/trunk/contrib/piggybank/java/src/test/java/org/apache/pig/piggybank/test/evaluation/util/apachelogparser/TestSearchTermExtractor.java
Thu Jul  7 01:23:20 2011
@@ -26,6 +26,7 @@ import org.junit.Test;
 public class TestSearchTermExtractor extends TestCase {
     private static HashMap<String, String> tests = new HashMap<String, String>();
     static {
+        tests.put("http://www.google.com/search", null);
         tests.put("http://www.google.com/search?hl=en&q=a+simple+test&btnG=Google+Search",
"a simple test");
         tests.put("http://www.google.co.uk/search?hl=en&q=a+simple+test&btnG=Google+Search&meta=",
"a simple test");
         tests.put("http://www.google.co.jp/search?hl=ja&q=a+simple+test&btnG=Google+%E6%A4%9C%E7%B4%A2&lr=",
"a simple test");



Mime
View raw message