mirror of
https://github.com/apache/lucene.git
synced 2025-02-08 19:15:06 +00:00
SOLR-5083: Move JDK-1.0-style hidden classes into inner classes of SolrRequestParsers (to prevent uptodate javac bugs)
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1507742 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
70344afbfc
commit
2902c40cfd
@ -361,7 +361,6 @@ public class SolrRequestParsers
|
||||
public void setAddRequestHeadersToContext(boolean addRequestHeadersToContext) {
|
||||
this.addHttpRequestToContext = addRequestHeadersToContext;
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------
|
||||
//-----------------------------------------------------------------
|
||||
@ -380,20 +379,20 @@ interface SolrRequestParser
|
||||
/**
|
||||
* The simple parser just uses the params directly, does not support POST URL-encoded forms
|
||||
*/
|
||||
class SimpleRequestParser implements SolrRequestParser
|
||||
static class SimpleRequestParser implements SolrRequestParser
|
||||
{
|
||||
@Override
|
||||
public SolrParams parseParamsAndFillStreams(
|
||||
final HttpServletRequest req, ArrayList<ContentStream> streams ) throws Exception
|
||||
{
|
||||
return SolrRequestParsers.parseQueryString(req.getQueryString());
|
||||
return parseQueryString(req.getQueryString());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Wrap an HttpServletRequest as a ContentStream
|
||||
*/
|
||||
class HttpRequestContentStream extends ContentStreamBase
|
||||
static class HttpRequestContentStream extends ContentStreamBase
|
||||
{
|
||||
private final HttpServletRequest req;
|
||||
|
||||
@ -420,7 +419,7 @@ class HttpRequestContentStream extends ContentStreamBase
|
||||
/**
|
||||
* Wrap a FileItem as a ContentStream
|
||||
*/
|
||||
class FileItemContentStream extends ContentStreamBase
|
||||
static class FileItemContentStream extends ContentStreamBase
|
||||
{
|
||||
private final FileItem item;
|
||||
|
||||
@ -442,14 +441,14 @@ class FileItemContentStream extends ContentStreamBase
|
||||
/**
|
||||
* The raw parser just uses the params directly
|
||||
*/
|
||||
class RawRequestParser implements SolrRequestParser
|
||||
static class RawRequestParser implements SolrRequestParser
|
||||
{
|
||||
@Override
|
||||
public SolrParams parseParamsAndFillStreams(
|
||||
final HttpServletRequest req, ArrayList<ContentStream> streams ) throws Exception
|
||||
{
|
||||
streams.add( new HttpRequestContentStream( req ) );
|
||||
return SolrRequestParsers.parseQueryString( req.getQueryString() );
|
||||
return parseQueryString( req.getQueryString() );
|
||||
}
|
||||
}
|
||||
|
||||
@ -458,7 +457,7 @@ class RawRequestParser implements SolrRequestParser
|
||||
/**
|
||||
* Extract Multipart streams
|
||||
*/
|
||||
class MultipartRequestParser implements SolrRequestParser
|
||||
static class MultipartRequestParser implements SolrRequestParser
|
||||
{
|
||||
private final int uploadLimitKB;
|
||||
|
||||
@ -475,7 +474,7 @@ class MultipartRequestParser implements SolrRequestParser
|
||||
throw new SolrException( ErrorCode.BAD_REQUEST, "Not multipart content! "+req.getContentType() );
|
||||
}
|
||||
|
||||
MultiMapSolrParams params = SolrRequestParsers.parseQueryString( req.getQueryString() );
|
||||
MultiMapSolrParams params = parseQueryString( req.getQueryString() );
|
||||
|
||||
// Create a factory for disk-based file items
|
||||
DiskFileItemFactory factory = new DiskFileItemFactory();
|
||||
@ -513,7 +512,7 @@ class MultipartRequestParser implements SolrRequestParser
|
||||
/**
|
||||
* Extract application/x-www-form-urlencoded form data for POST requests
|
||||
*/
|
||||
class FormDataRequestParser implements SolrRequestParser
|
||||
static class FormDataRequestParser implements SolrRequestParser
|
||||
{
|
||||
private final int uploadLimitKB;
|
||||
|
||||
@ -535,7 +534,7 @@ class FormDataRequestParser implements SolrRequestParser
|
||||
// also add possible URL parameters and include into the map (parsed using UTF-8):
|
||||
final String qs = req.getQueryString();
|
||||
if (qs != null) {
|
||||
SolrRequestParsers.parseQueryString(qs, map);
|
||||
parseQueryString(qs, map);
|
||||
}
|
||||
|
||||
// may be -1, so we check again later. But if its already greater we can stop processing!
|
||||
@ -552,7 +551,7 @@ class FormDataRequestParser implements SolrRequestParser
|
||||
InputStream in = null;
|
||||
try {
|
||||
in = req.getInputStream();
|
||||
final long bytesRead = SolrRequestParsers.parseFormDataContent(FastInputStream.wrap(in), maxLength, charset, map);
|
||||
final long bytesRead = parseFormDataContent(FastInputStream.wrap(in), maxLength, charset, map);
|
||||
if (bytesRead == 0L && totalLength > 0L) {
|
||||
throw getParameterIncompatibilityException();
|
||||
}
|
||||
@ -596,7 +595,7 @@ class FormDataRequestParser implements SolrRequestParser
|
||||
/**
|
||||
* The default Logic
|
||||
*/
|
||||
class StandardRequestParser implements SolrRequestParser
|
||||
static class StandardRequestParser implements SolrRequestParser
|
||||
{
|
||||
MultipartRequestParser multipart;
|
||||
RawRequestParser raw;
|
||||
@ -616,7 +615,7 @@ class StandardRequestParser implements SolrRequestParser
|
||||
String method = req.getMethod().toUpperCase(Locale.ROOT);
|
||||
if ("GET".equals(method) || "HEAD".equals(method)
|
||||
|| ("PUT".equals(method) && req.getRequestURI().contains("/schema"))) {
|
||||
return SolrRequestParsers.parseQueryString(req.getQueryString());
|
||||
return parseQueryString(req.getQueryString());
|
||||
}
|
||||
if ("POST".equals( method ) ) {
|
||||
if (formdata.isFormData(req)) {
|
||||
@ -630,12 +629,4 @@ class StandardRequestParser implements SolrRequestParser
|
||||
throw new SolrException(ErrorCode.BAD_REQUEST, "Unsupported method: " + method + " for request " + req);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
@ -44,6 +44,10 @@ import org.apache.solr.common.params.SolrParams;
|
||||
import org.apache.solr.common.util.ContentStream;
|
||||
import org.apache.solr.core.SolrCore;
|
||||
import org.apache.solr.request.SolrQueryRequest;
|
||||
import org.apache.solr.servlet.SolrRequestParsers.MultipartRequestParser;
|
||||
import org.apache.solr.servlet.SolrRequestParsers.FormDataRequestParser;
|
||||
import org.apache.solr.servlet.SolrRequestParsers.RawRequestParser;
|
||||
import org.apache.solr.servlet.SolrRequestParsers.StandardRequestParser;
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
|
Loading…
x
Reference in New Issue
Block a user