lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rm...@apache.org
Subject svn commit: r1068718 [21/21] - in /lucene/dev/branches/bulkpostings: ./ dev-tools/eclipse/ dev-tools/idea/.idea/ dev-tools/idea/lucene/ dev-tools/maven/ dev-tools/maven/lucene/ dev-tools/maven/lucene/contrib/ant/ dev-tools/maven/lucene/contrib/db/bdb-j...
Date Wed, 09 Feb 2011 01:04:13 GMT
Modified: lucene/dev/branches/bulkpostings/solr/src/test/org/apache/solr/search/function/NvlValueSourceParser.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/solr/src/test/org/apache/solr/search/function/NvlValueSourceParser.java?rev=1068718&r1=1068717&r2=1068718&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/solr/src/test/org/apache/solr/search/function/NvlValueSourceParser.java
(original)
+++ lucene/dev/branches/bulkpostings/solr/src/test/org/apache/solr/search/function/NvlValueSourceParser.java
Wed Feb  9 01:03:49 2011
@@ -42,16 +42,19 @@ public class NvlValueSourceParser extend
      */
     private float nvlFloatValue = 0.0f;
 
+    @Override
     public ValueSource parse(FunctionQParser fp) throws ParseException {
 	ValueSource source = fp.parseValueSource();
 	final float nvl = fp.parseFloat();
 
 	return new SimpleFloatFunction(source) {
-	    protected String name() {
+	    @Override
+      protected String name() {
 		return "nvl";
 	    }
 
-	    protected float func(int doc, DocValues vals) {
+	    @Override
+      protected float func(int doc, DocValues vals) {
 		float v = vals.floatVal(doc);
 		if (v == nvlFloatValue) {
 		    return nvl;
@@ -62,6 +65,7 @@ public class NvlValueSourceParser extend
 	};
     }
 
+    @Override
     public void init(NamedList args) {
 	/* initialize the value to consider as null */
 	Float nvlFloatValueArg = (Float) args.get("nvlFloatValue");

Modified: lucene/dev/branches/bulkpostings/solr/src/test/org/apache/solr/search/function/SortByFunctionTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/solr/src/test/org/apache/solr/search/function/SortByFunctionTest.java?rev=1068718&r1=1068717&r2=1068718&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/solr/src/test/org/apache/solr/search/function/SortByFunctionTest.java
(original)
+++ lucene/dev/branches/bulkpostings/solr/src/test/org/apache/solr/search/function/SortByFunctionTest.java
Wed Feb  9 01:03:49 2011
@@ -24,19 +24,21 @@ import org.apache.solr.util.AbstractSolr
  *
  **/
 public class SortByFunctionTest extends AbstractSolrTestCase {
+  @Override
   public String getSchemaFile() {
     return "schema.xml";
   }
 
+  @Override
   public String getSolrConfigFile() {
     return "solrconfig.xml";
   }
 
   public void test() throws Exception {
-    assertU(adoc("id", "1", "x_td", "0", "y_td", "2", "w_td", "25", "z_td", "5", "f_t", "ipod"));
-    assertU(adoc("id", "2", "x_td", "2", "y_td", "2", "w_td", "15", "z_td", "5", "f_t", "ipod
ipod ipod ipod ipod"));
-    assertU(adoc("id", "3", "x_td", "3", "y_td", "2", "w_td", "55", "z_td", "5", "f_t", "ipod
ipod ipod ipod ipod ipod ipod ipod ipod"));
-    assertU(adoc("id", "4", "x_td", "4", "y_td", "2", "w_td", "45", "z_td", "5", "f_t", "ipod
ipod ipod ipod ipod ipod ipod"));
+    assertU(adoc("id", "1", "x_td", "0", "y_td", "2", "w_td1", "25", "z_td", "5", "f_t",
"ipod"));
+    assertU(adoc("id", "2", "x_td", "2", "y_td", "2", "w_td1", "15", "z_td", "5", "f_t",
"ipod ipod ipod ipod ipod"));
+    assertU(adoc("id", "3", "x_td", "3", "y_td", "2", "w_td1", "55", "z_td", "5", "f_t",
"ipod ipod ipod ipod ipod ipod ipod ipod ipod"));
+    assertU(adoc("id", "4", "x_td", "4", "y_td", "2", "w_td1", "45", "z_td", "5", "f_t",
"ipod ipod ipod ipod ipod ipod ipod"));
     assertU(commit());
 
     assertQ(req("fl", "*,score", "q", "*:*"),
@@ -80,8 +82,8 @@ public class SortByFunctionTest extends 
             "//result/doc[3]/int[@name='id'][.='3']",
             "//result/doc[4]/int[@name='id'][.='4']"
     );
-    //the function is equal, w_td separates
-    assertQ(req("q", "*:*", "fl", "id", "sort", "sum(z_td, y_td) asc, w_td asc"),
+    //the function is equal, w_td1 separates
+    assertQ(req("q", "*:*", "fl", "id", "sort", "sum(z_td, y_td) asc, w_td1 asc"),
             "//*[@numFound='4']",
             "//result/doc[1]/int[@name='id'][.='2']",
             "//result/doc[2]/int[@name='id'][.='1']",
@@ -125,4 +127,4 @@ public class SortByFunctionTest extends 
 
 /*
 <lst name="responseHeader"><int name="status">0</int><int name="QTime">93</int></lst><result
name="response" numFound="4" start="0" maxScore="1.0"><doc><float name="score">1.0</float><int
name="id">4</int><int name="intDefault">42</int><arr name="multiDefault"><str>muLti-Default</str></arr><date
name="timestamp">2009-12-12T12:59:46.412Z</date><arr name="x_td"><double>4.0</double></arr><arr
name="y_td"><double>2.0</double></arr></doc><doc><float
name="score">1.0</float><int name="id">3</int><int name="intDefault">42</int><arr
name="multiDefault"><str>muLti-Default</str></arr><date name="timestamp">2009-12-12T12:59:46.409Z</date><arr
name="x_td"><double>3.0</double></arr><arr name="y_td"><double>2.0</double></arr></doc><doc><float
name="score">1.0</float><int name="id">2</int><int name="intDefault">42</int><arr
name="multiDefault"><str>muLti-Default</str></arr><date name="timestamp">2009-12-12T12:59:46.406Z</date><arr
name="x_td"><double>2.0</double></arr><arr name="y_td"><dou
 ble>2.0</double></arr></doc><doc><float name="score">1.0</float><int
name="id">1</int><int name="intDefault">42</int><arr name="multiDefault"><str>muLti-Default</str></arr><date
name="timestamp">2009-12-12T12:59:46.361Z</date><arr name="x_td"><double>0.0</double></arr><arr
name="y_td"><double>2.0</double></arr></doc></result>
-*/
\ No newline at end of file
+*/

Modified: lucene/dev/branches/bulkpostings/solr/src/test/org/apache/solr/servlet/CacheHeaderTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/solr/src/test/org/apache/solr/servlet/CacheHeaderTest.java?rev=1068718&r1=1068717&r2=1068718&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/solr/src/test/org/apache/solr/servlet/CacheHeaderTest.java
(original)
+++ lucene/dev/branches/bulkpostings/solr/src/test/org/apache/solr/servlet/CacheHeaderTest.java
Wed Feb  9 01:03:49 2011
@@ -85,6 +85,7 @@ public class CacheHeaderTest extends Cac
     }
   }
 
+  @Override
   protected void doLastModified(String method) throws Exception {
     // We do a first request to get the last modified
     // This must result in a 200 OK response
@@ -140,6 +141,7 @@ public class CacheHeaderTest extends Cac
   }
 
   // test ETag
+  @Override
   protected void doETag(String method) throws Exception {
     HttpMethodBase get = getSelectMethod(method);
     getClient().executeMethod(get);
@@ -211,6 +213,7 @@ public class CacheHeaderTest extends Cac
         .getStatusCode());
   }
 
+  @Override
   protected void doCacheControl(String method) throws Exception {
     if ("POST".equals(method)) {
       HttpMethodBase m = getSelectMethod(method);

Modified: lucene/dev/branches/bulkpostings/solr/src/test/org/apache/solr/servlet/DirectSolrConnectionTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/solr/src/test/org/apache/solr/servlet/DirectSolrConnectionTest.java?rev=1068718&r1=1068717&r2=1068718&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/solr/src/test/org/apache/solr/servlet/DirectSolrConnectionTest.java
(original)
+++ lucene/dev/branches/bulkpostings/solr/src/test/org/apache/solr/servlet/DirectSolrConnectionTest.java
Wed Feb  9 01:03:49 2011
@@ -24,7 +24,9 @@ import org.apache.solr.util.AbstractSolr
 
 public class DirectSolrConnectionTest extends AbstractSolrTestCase 
 {
+  @Override
   public String getSchemaFile() { return "solr/crazy-path-to-schema.xml"; }
+  @Override
   public String getSolrConfigFile() { return "solr/crazy-path-to-config.xml"; }
   
   DirectSolrConnection direct;

Modified: lucene/dev/branches/bulkpostings/solr/src/test/org/apache/solr/servlet/NoCacheHeaderTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/solr/src/test/org/apache/solr/servlet/NoCacheHeaderTest.java?rev=1068718&r1=1068717&r2=1068718&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/solr/src/test/org/apache/solr/servlet/NoCacheHeaderTest.java
(original)
+++ lucene/dev/branches/bulkpostings/solr/src/test/org/apache/solr/servlet/NoCacheHeaderTest.java
Wed Feb  9 01:03:49 2011
@@ -35,18 +35,21 @@ public class NoCacheHeaderTest extends C
   }
 
   // The tests
+  @Override
   @Test
   public void testLastModified() throws Exception {
     doLastModified("GET");
     doLastModified("HEAD");
   }
 
+  @Override
   @Test
   public void testEtag() throws Exception {
     doETag("GET");
     doETag("HEAD");
   }
 
+  @Override
   @Test
   public void testCacheControl() throws Exception {
     doCacheControl("GET");
@@ -54,6 +57,7 @@ public class NoCacheHeaderTest extends C
     doCacheControl("POST");
   }
   
+  @Override
   protected void doLastModified(String method) throws Exception {
     // We do a first request to get the last modified
     // This must result in a 200 OK response
@@ -105,6 +109,7 @@ public class NoCacheHeaderTest extends C
   }
 
   // test ETag
+  @Override
   protected void doETag(String method) throws Exception {
     HttpMethodBase get = getSelectMethod(method);
     getClient().executeMethod(get);
@@ -153,6 +158,7 @@ public class NoCacheHeaderTest extends C
         .getStatusCode());
   }
 
+  @Override
   protected void doCacheControl(String method) throws Exception {
       HttpMethodBase m = getSelectMethod(method);
       getClient().executeMethod(m);

Modified: lucene/dev/branches/bulkpostings/solr/src/test/org/apache/solr/servlet/SolrRequestParserTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/solr/src/test/org/apache/solr/servlet/SolrRequestParserTest.java?rev=1068718&r1=1068717&r2=1068718&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/solr/src/test/org/apache/solr/servlet/SolrRequestParserTest.java
(original)
+++ lucene/dev/branches/bulkpostings/solr/src/test/org/apache/solr/servlet/SolrRequestParserTest.java
Wed Feb  9 01:03:49 2011
@@ -74,7 +74,7 @@ public class SolrRequestParserTest exten
     List<ContentStream> streams = new ArrayList<ContentStream>();
     SolrQueryRequest req = parser.buildRequestFrom( core, new MultiMapSolrParams( args ),
streams );
     assertEquals( 1, streams.size() );
-    assertEquals( body1, IOUtils.toString( streams.get(0).getStream() ) );
+    assertEquals( body1, IOUtils.toString( streams.get(0).getReader() ) );
     req.close();
 
     // Now add three and make sure they come out ok
@@ -87,9 +87,9 @@ public class SolrRequestParserTest exten
     input.add( body1 );
     input.add( body2 );
     input.add( body3 );
-    output.add( IOUtils.toString( streams.get(0).getStream() ) );
-    output.add( IOUtils.toString( streams.get(1).getStream() ) );
-    output.add( IOUtils.toString( streams.get(2).getStream() ) );
+    output.add( IOUtils.toString( streams.get(0).getReader() ) );
+    output.add( IOUtils.toString( streams.get(1).getReader() ) );
+    output.add( IOUtils.toString( streams.get(2).getReader() ) );
     // sort them so the output is consistent
     Collections.sort( input );
     Collections.sort( output );
@@ -112,13 +112,13 @@ public class SolrRequestParserTest exten
   {
     boolean ok = false;
     String url = "http://www.apache.org/dist/lucene/solr/";
-    String txt = null;
+    byte[] bytes = null;
     try {
       URLConnection connection = new URL(url).openConnection();
       connection.setConnectTimeout(5000);
       connection.setReadTimeout(5000);
       connection.connect();
-      txt = IOUtils.toString( connection.getInputStream());
+      bytes = IOUtils.toByteArray( connection.getInputStream());
     }
     catch( Exception ex ) {
       assumeNoException("Unable to connect to " + url + " to run the test.", ex);
@@ -134,7 +134,7 @@ public class SolrRequestParserTest exten
     List<ContentStream> streams = new ArrayList<ContentStream>();
     SolrQueryRequest req = parser.buildRequestFrom( core, new MultiMapSolrParams( args ),
streams );
     assertEquals( 1, streams.size() );
-    assertEquals( txt, IOUtils.toString( streams.get(0).getStream() ) );
+    assertArrayEquals( bytes, IOUtils.toByteArray( streams.get(0).getStream() ) );
     req.close();
   }
   

Modified: lucene/dev/branches/bulkpostings/solr/src/test/org/apache/solr/spelling/IndexBasedSpellCheckerTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/solr/src/test/org/apache/solr/spelling/IndexBasedSpellCheckerTest.java?rev=1068718&r1=1068717&r2=1068718&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/solr/src/test/org/apache/solr/spelling/IndexBasedSpellCheckerTest.java
(original)
+++ lucene/dev/branches/bulkpostings/solr/src/test/org/apache/solr/spelling/IndexBasedSpellCheckerTest.java
Wed Feb  9 01:03:49 2011
@@ -227,6 +227,7 @@ public class IndexBasedSpellCheckerTest 
   }
 
   private class TestSpellChecker extends IndexBasedSpellChecker{
+    @Override
     public SpellChecker getSpellChecker(){
       return spellChecker;
     }

Modified: lucene/dev/branches/bulkpostings/solr/src/test/org/apache/solr/spelling/SpellPossibilityIteratorTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/solr/src/test/org/apache/solr/spelling/SpellPossibilityIteratorTest.java?rev=1068718&r1=1068717&r2=1068718&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/solr/src/test/org/apache/solr/spelling/SpellPossibilityIteratorTest.java
(original)
+++ lucene/dev/branches/bulkpostings/solr/src/test/org/apache/solr/spelling/SpellPossibilityIteratorTest.java
Wed Feb  9 01:03:49 2011
@@ -29,7 +29,8 @@ public class SpellPossibilityIteratorTes
 
 	private static Map<Token, LinkedHashMap<String, Integer>> suggestions = new
LinkedHashMap<Token, LinkedHashMap<String, Integer>>();
 
-	@Before
+	@Override
+  @Before
 	public void setUp() throws Exception {
 	  super.setUp();
 		suggestions.clear();

Modified: lucene/dev/branches/bulkpostings/solr/src/test/org/apache/solr/update/AutoCommitTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/solr/src/test/org/apache/solr/update/AutoCommitTest.java?rev=1068718&r1=1068717&r2=1068718&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/solr/src/test/org/apache/solr/update/AutoCommitTest.java
(original)
+++ lucene/dev/branches/bulkpostings/solr/src/test/org/apache/solr/update/AutoCommitTest.java
Wed Feb  9 01:03:49 2011
@@ -78,7 +78,9 @@ class CommitListener implements SolrEven
 
 public class AutoCommitTest extends AbstractSolrTestCase {
 
+  @Override
   public String getSchemaFile() { return "schema.xml"; }
+  @Override
   public String getSolrConfigFile() { return "solrconfig.xml"; }
 
   /**

Modified: lucene/dev/branches/bulkpostings/solr/src/test/org/apache/solr/update/DirectUpdateHandlerOptimizeTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/solr/src/test/org/apache/solr/update/DirectUpdateHandlerOptimizeTest.java?rev=1068718&r1=1068717&r2=1068718&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/solr/src/test/org/apache/solr/update/DirectUpdateHandlerOptimizeTest.java
(original)
+++ lucene/dev/branches/bulkpostings/solr/src/test/org/apache/solr/update/DirectUpdateHandlerOptimizeTest.java
Wed Feb  9 01:03:49 2011
@@ -32,10 +32,12 @@ import java.io.FileFilter;
  **/
 public class DirectUpdateHandlerOptimizeTest extends AbstractSolrTestCase {
 
+  @Override
   public String getSchemaFile() {
     return "schema12.xml";
   }
 
+  @Override
   public String getSolrConfigFile() {
     // return "solrconfig-duh-optimize.xml";
     return "solrconfig.xml";

Modified: lucene/dev/branches/bulkpostings/solr/src/test/org/apache/solr/update/DirectUpdateHandlerTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/solr/src/test/org/apache/solr/update/DirectUpdateHandlerTest.java?rev=1068718&r1=1068717&r2=1068718&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/solr/src/test/org/apache/solr/update/DirectUpdateHandlerTest.java
(original)
+++ lucene/dev/branches/bulkpostings/solr/src/test/org/apache/solr/update/DirectUpdateHandlerTest.java
Wed Feb  9 01:03:49 2011
@@ -42,6 +42,7 @@ public class DirectUpdateHandlerTest ext
     initCore("solrconfig.xml", "schema12.xml");
   }
 
+  @Override
   @Before
   public void setUp() throws Exception {
     super.setUp();

Modified: lucene/dev/branches/bulkpostings/solr/src/test/org/apache/solr/update/TestIndexingPerformance.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/solr/src/test/org/apache/solr/update/TestIndexingPerformance.java?rev=1068718&r1=1068717&r2=1068718&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/solr/src/test/org/apache/solr/update/TestIndexingPerformance.java
(original)
+++ lucene/dev/branches/bulkpostings/solr/src/test/org/apache/solr/update/TestIndexingPerformance.java
Wed Feb  9 01:03:49 2011
@@ -41,7 +41,9 @@ public class TestIndexingPerformance ext
   public static final Logger log 
     = LoggerFactory.getLogger(TestIndexingPerformance.class);
 
+  @Override
   public String getSchemaFile() { return "schema12.xml"; }
+  @Override
   public String getSolrConfigFile() { return "solrconfig_perf.xml"; }
 
   public void testIndexingPerf() throws IOException {

Modified: lucene/dev/branches/bulkpostings/solr/src/test/org/apache/solr/update/processor/SignatureUpdateProcessorFactoryTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/solr/src/test/org/apache/solr/update/processor/SignatureUpdateProcessorFactoryTest.java?rev=1068718&r1=1068717&r2=1068718&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/solr/src/test/org/apache/solr/update/processor/SignatureUpdateProcessorFactoryTest.java
(original)
+++ lucene/dev/branches/bulkpostings/solr/src/test/org/apache/solr/update/processor/SignatureUpdateProcessorFactoryTest.java
Wed Feb  9 01:03:49 2011
@@ -129,6 +129,7 @@ public class SignatureUpdateProcessorFac
     for (int i = 0; i < threads.length; i++) {
       threads[i] = new Thread() {
 
+        @Override
         public void run() {
           for (int i = 0; i < 30; i++) {
             // h.update(adoc("id", Integer.toString(1+ i), "v_t",
@@ -150,6 +151,7 @@ public class SignatureUpdateProcessorFac
     for (int i = 0; i < threads2.length; i++) {
       threads2[i] = new Thread() {
 
+        @Override
         public void run() {
           for (int i = 0; i < 10; i++) {
             // h.update(adoc("id" , Integer.toString(1+ i + 10000), "v_t",

Modified: lucene/dev/branches/bulkpostings/solr/src/test/org/apache/solr/util/AbstractSolrTestCase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/solr/src/test/org/apache/solr/util/AbstractSolrTestCase.java?rev=1068718&r1=1068717&r2=1068718&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/solr/src/test/org/apache/solr/util/AbstractSolrTestCase.java
(original)
+++ lucene/dev/branches/bulkpostings/solr/src/test/org/apache/solr/util/AbstractSolrTestCase.java
Wed Feb  9 01:03:49 2011
@@ -111,6 +111,7 @@ public abstract class AbstractSolrTestCa
   public static Logger log = LoggerFactory.getLogger(AbstractSolrTestCase.class);
 
   private String factoryProp;
+  @Override
   public void setUp() throws Exception {
     super.setUp();
     log.info("####SETUP_START " + getName());
@@ -170,6 +171,7 @@ public abstract class AbstractSolrTestCa
    * to delete dataDir, unless the system property "solr.test.leavedatadir"
    * is set.
    */
+  @Override
   public void tearDown() throws Exception {
     log.info("####TEARDOWN_START " + getName());
     if (factoryProp == null) {
@@ -403,6 +405,7 @@ public abstract class AbstractSolrTestCa
   /** Neccessary to make method signatures un-ambiguous */
   public static class Doc {
     public String xml;
+    @Override
     public String toString() { return xml; }
   }
 

Modified: lucene/dev/branches/bulkpostings/solr/src/test/org/apache/solr/util/TestNumberUtils.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/solr/src/test/org/apache/solr/util/TestNumberUtils.java?rev=1068718&r1=1068717&r2=1068718&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/solr/src/test/org/apache/solr/util/TestNumberUtils.java
(original)
+++ lucene/dev/branches/bulkpostings/solr/src/test/org/apache/solr/util/TestNumberUtils.java
Wed Feb  9 01:03:49 2011
@@ -182,72 +182,88 @@ abstract class Converter {
 }
 
 class Int2Int extends Converter {
+  @Override
   public String toInternal(String val) {
     return Integer.toString(Integer.parseInt(val));
   }
+  @Override
   public String toExternal(String val) {
     return Integer.toString(Integer.parseInt(val));
   }
 }
 
 class SortInt extends Converter {
+  @Override
   public String toInternal(String val) {
     return NumberUtils.int2sortableStr(val);
   }
+  @Override
   public String toExternal(String val) {
     return NumberUtils.SortableStr2int(val);
   }
 }
 
 class SortLong extends Converter {
+  @Override
   public String toInternal(String val) {
     return NumberUtils.long2sortableStr(val);
   }
+  @Override
   public String toExternal(String val) {
     return NumberUtils.SortableStr2long(val);
   }
 }
 
 class Float2Float extends Converter {
+  @Override
   public String toInternal(String val) {
     return Float.toString(Float.parseFloat(val));
   }
+  @Override
   public String toExternal(String val) {
     return Float.toString(Float.parseFloat(val));
   }
 }
 
 class SortFloat extends Converter {
+  @Override
   public String toInternal(String val) {
     return NumberUtils.float2sortableStr(val);
   }
+  @Override
   public String toExternal(String val) {
     return NumberUtils.SortableStr2floatStr(val);
   }
 }
 
 class SortDouble extends Converter {
+  @Override
   public String toInternal(String val) {
     return NumberUtils.double2sortableStr(val);
   }
+  @Override
   public String toExternal(String val) {
     return NumberUtils.SortableStr2doubleStr(val);
   }
 }
 
 class Base100S extends Converter {
+  @Override
   public String toInternal(String val) {
     return BCDUtils.base10toBase100SortableInt(val);
   }
+  @Override
   public String toExternal(String val) {
     return BCDUtils.base100SortableIntToBase10(val);
   }
 }
 
 class Base10kS extends Converter {
+  @Override
   public String toInternal(String val) {
     return BCDUtils.base10toBase10kSortableInt(val);
   }
+  @Override
   public String toExternal(String val) {
     return BCDUtils.base10kSortableIntToBase10(val);
   }

Modified: lucene/dev/branches/bulkpostings/solr/src/test/org/apache/solr/velocity/VelocityResponseWriterTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/solr/src/test/org/apache/solr/velocity/VelocityResponseWriterTest.java?rev=1068718&r1=1068717&r2=1068718&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/solr/src/test/org/apache/solr/velocity/VelocityResponseWriterTest.java
(original)
+++ lucene/dev/branches/bulkpostings/solr/src/test/org/apache/solr/velocity/VelocityResponseWriterTest.java
Wed Feb  9 01:03:49 2011
@@ -1,3 +1,20 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 package org.apache.solr.velocity;
 
 import org.apache.solr.response.SolrQueryResponse;
@@ -9,7 +26,9 @@ import java.io.StringWriter;
 import java.io.IOException;
 
 public class VelocityResponseWriterTest extends AbstractSolrTestCase {
+  @Override
   public String getSchemaFile() { return "schema.xml"; }
+  @Override
   public String getSolrConfigFile() { return "solrconfig.xml"; }
 
 

Modified: lucene/dev/branches/bulkpostings/solr/src/webapp/src/org/apache/solr/servlet/LogLevelSelection.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/solr/src/webapp/src/org/apache/solr/servlet/LogLevelSelection.java?rev=1068718&r1=1068717&r2=1068718&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/solr/src/webapp/src/org/apache/solr/servlet/LogLevelSelection.java
(original)
+++ lucene/dev/branches/bulkpostings/solr/src/webapp/src/org/apache/solr/servlet/LogLevelSelection.java
Wed Feb  9 01:03:49 2011
@@ -36,6 +36,7 @@ import java.util.logging.Logger;
  * @since solr 1.3
  */
 public final class LogLevelSelection extends HttpServlet {
+  @Override
   public void init() throws ServletException {
   }
 
@@ -43,6 +44,7 @@ public final class LogLevelSelection ext
    * Processes an HTTP GET request and changes the logging level as
    * specified.
    */
+  @Override
   public void doGet(HttpServletRequest request,
                     HttpServletResponse response)
           throws IOException, ServletException {
@@ -147,6 +149,7 @@ public final class LogLevelSelection ext
   }
 
 
+  @Override
   public void doPost(HttpServletRequest request,
                      HttpServletResponse response)
           throws IOException, ServletException {
@@ -259,6 +262,7 @@ public final class LogLevelSelection ext
       return name.compareTo(((LogWrapper) other).name);
     }
 
+    @Override
     public boolean equals(Object obj) {
       if (this == obj)
         return true;
@@ -275,6 +279,7 @@ public final class LogLevelSelection ext
       return true;
     }
     
+    @Override
     public int hashCode() {
       final int prime = 31;
       int result = 1;

Modified: lucene/dev/branches/bulkpostings/solr/src/webapp/src/org/apache/solr/servlet/SolrDispatchFilter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/solr/src/webapp/src/org/apache/solr/servlet/SolrDispatchFilter.java?rev=1068718&r1=1068717&r2=1068718&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/solr/src/webapp/src/org/apache/solr/servlet/SolrDispatchFilter.java
(original)
+++ lucene/dev/branches/bulkpostings/solr/src/webapp/src/org/apache/solr/servlet/SolrDispatchFilter.java
Wed Feb  9 01:03:49 2011
@@ -65,7 +65,7 @@ public class SolrDispatchFilter implemen
 
   public SolrDispatchFilter() {
     try {
-      adminRequestParser = new SolrRequestParsers(new Config(null,"solr",new ByteArrayInputStream("<root/>".getBytes()),"")
);
+      adminRequestParser = new SolrRequestParsers(new Config(null,"solr",new ByteArrayInputStream("<root/>".getBytes("UTF-8")),"")
);
     } catch (Exception e) {
       //unlikely
       throw new SolrException(SolrException.ErrorCode.SERVER_ERROR,e);
@@ -315,7 +315,9 @@ public class SolrDispatchFilter implemen
       sendError((HttpServletResponse) response, solrRsp.getException());
     } else {
       // Now write it out
-      response.setContentType(responseWriter.getContentType(solrReq, solrRsp));
+      final String ct = responseWriter.getContentType(solrReq, solrRsp);
+      // don't call setContentType on null
+      if (null != ct) response.setContentType(ct); 
       if (Method.HEAD != reqMethod) {
         if (responseWriter instanceof BinaryQueryResponseWriter) {
           BinaryQueryResponseWriter binWriter = (BinaryQueryResponseWriter) responseWriter;

Modified: lucene/dev/branches/bulkpostings/solr/src/webapp/src/org/apache/solr/servlet/cache/HttpCacheHeaderUtil.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/solr/src/webapp/src/org/apache/solr/servlet/cache/HttpCacheHeaderUtil.java?rev=1068718&r1=1068717&r2=1068718&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/solr/src/webapp/src/org/apache/solr/servlet/cache/HttpCacheHeaderUtil.java
(original)
+++ lucene/dev/branches/bulkpostings/solr/src/webapp/src/org/apache/solr/servlet/cache/HttpCacheHeaderUtil.java
Wed Feb  9 01:03:49 2011
@@ -18,6 +18,7 @@
 package org.apache.solr.servlet.cache;
 
 import java.io.IOException;
+import java.io.UnsupportedEncodingException;
 import java.util.Collections;
 import java.util.Map;
 import java.util.WeakHashMap;
@@ -75,11 +76,15 @@ public final class HttpCacheHeaderUtil {
       if (currentIndexVersion != indexVersionCache) {
         indexVersionCache=currentIndexVersion;
         
-        etagCache = "\""
-          + new String(Base64.encodeBase64((Long.toHexString
-                                            (Long.reverse(indexVersionCache))
-                                            + etagSeed).getBytes()))
-          + "\"";
+        try {
+          etagCache = "\""
+           + new String(Base64.encodeBase64((Long.toHexString
+                                             (Long.reverse(indexVersionCache))
+                                             + etagSeed).getBytes()), "US-ASCII")
+           + "\"";
+        } catch (UnsupportedEncodingException e) {
+          throw new RuntimeException(e); // may not happen
+        }
       }
       
       return etagCache;

Modified: lucene/dev/branches/bulkpostings/solr/src/webapp/web/admin/index.jsp
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/solr/src/webapp/web/admin/index.jsp?rev=1068718&r1=1068717&r2=1068718&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/solr/src/webapp/web/admin/index.jsp (original)
+++ lucene/dev/branches/bulkpostings/solr/src/webapp/web/admin/index.jsp Wed Feb  9 01:03:49
2011
@@ -39,10 +39,10 @@
   </td>
   <td>
     <% if (null != core.getSchemaResource()) { %>
-    [<a href="file/?file=<%=core.getSchemaResource()%>">Schema</a>]
+    [<a href="file/?contentType=text/xml;charset=utf-8&file=<%=core.getSchemaResource()%>">Schema</a>]
     <% }
        if (null != core.getConfigResource()) { %>
-    [<a href="file/?file=<%=core.getConfigResource()%>">Config</a>]
+    [<a href="file/?contentType=text/xml;charset=utf-8&file=<%=core.getConfigResource()%>">Config</a>]
     <% } %>
     [<a href="analysis.jsp?highlight=on">Analysis</a>]
     [<a href="schema.jsp">Schema Browser</a>] <%if(replicationhandler){%>[<a
href="replication/index.jsp">Replication</a>]<%}%>



Mime
View raw message