LUCENE-6740: Reduce warnings emitted by javac #6

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1696080 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Uwe Schindler 2015-08-15 18:04:24 +00:00
parent e0d6e53756
commit 94b12beb4a
6 changed files with 13 additions and 13 deletions

View File

@ -266,11 +266,11 @@ final class Stemmer {
// some state for traversing FSTs
final FST.BytesReader prefixReaders[] = new FST.BytesReader[3];
@SuppressWarnings("unchecked")
@SuppressWarnings({"unchecked","rawtypes"})
final FST.Arc<IntsRef> prefixArcs[] = new FST.Arc[3];
final FST.BytesReader suffixReaders[] = new FST.BytesReader[3];
@SuppressWarnings("unchecked")
@SuppressWarnings({"unchecked","rawtypes"})
final FST.Arc<IntsRef> suffixArcs[] = new FST.Arc[3];

View File

@ -31,7 +31,7 @@ import org.junit.Test;
/**
* Tests for {@link ConfusionMatrixGenerator}
*/
public class ConfusionMatrixGeneratorTest extends ClassificationTestBase {
public class ConfusionMatrixGeneratorTest extends ClassificationTestBase<Object> {
@Test
public void testGetConfusionMatrixWithSNB() throws Exception {

View File

@ -40,9 +40,9 @@ public class OrQuery extends ComposedQuery implements DistanceSubQuery {
@Override
public String distanceSubQueryNotAllowed() {
Iterator sqi = getSubQueriesIterator();
Iterator<SrndQuery> sqi = getSubQueriesIterator();
while (sqi.hasNext()) {
SrndQuery leq = (SrndQuery) sqi.next();
SrndQuery leq = sqi.next();
if (leq instanceof DistanceSubQuery) {
String m = ((DistanceSubQuery)leq).distanceSubQueryNotAllowed();
if (m != null) {
@ -57,9 +57,10 @@ public class OrQuery extends ComposedQuery implements DistanceSubQuery {
@Override
public void addSpanQueries(SpanNearClauseFactory sncf) throws IOException {
Iterator sqi = getSubQueriesIterator();
Iterator<SrndQuery> sqi = getSubQueriesIterator();
while (sqi.hasNext()) {
((DistanceSubQuery)sqi.next()).addSpanQueries(sncf);
SrndQuery s = sqi.next();
((DistanceSubQuery) s).addSpanQueries(sncf);
}
}
}

View File

@ -61,7 +61,7 @@ abstract class RewriteQuery<SQ extends SrndQuery> extends Query {
return false;
if (! getClass().equals(obj.getClass()))
return false;
RewriteQuery other = (RewriteQuery)obj;
@SuppressWarnings("unchecked") RewriteQuery<SQ> other = (RewriteQuery<SQ>)obj;
return super.equals(obj)
&& fieldName.equals(other.fieldName)
&& qf.equals(other.qf)

View File

@ -176,9 +176,9 @@ public class QueryTemplateManager {
Element root = doc.createElement("Document");
doc.appendChild(root);
Enumeration keysEnum = formProperties.keys();
Enumeration<?> keysEnum = formProperties.propertyNames();
while (keysEnum.hasMoreElements()) {
String propName = (String) keysEnum.nextElement();
String propName = keysEnum.nextElement().toString();
String value = formProperties.getProperty(propName);
if ((value != null) && (value.length() > 0)) {
DOMUtils.insertChild(root, propName, value);

View File

@ -156,14 +156,13 @@ public class TestQueryParser extends QueryParserTestBase {
@SuppressWarnings("rawtype")
public void testProtectedCtors() throws Exception {
try {
QueryParser.class.getConstructor(new Class[] {CharStream.class});
QueryParser.class.getConstructor(CharStream.class);
fail("please switch public QueryParser(CharStream) to be protected");
} catch (NoSuchMethodException nsme) {
// expected
}
try {
QueryParser.class
.getConstructor(new Class[] {QueryParserTokenManager.class});
QueryParser.class.getConstructor(QueryParserTokenManager.class);
fail("please switch public QueryParser(QueryParserTokenManager) to be protected");
} catch (NoSuchMethodException nsme) {
// expected