Merge pull request elastic/elasticsearch#615 from rjernst/warnings_cleanup2

Add warning suppressions

Original commit: elastic/x-pack-elasticsearch@a787f9c2a4
This commit is contained in:
Ryan Ernst 2015-09-09 12:51:51 -07:00
commit 7aa612b62e
8 changed files with 21 additions and 14 deletions

View File

@ -23,6 +23,7 @@
<tests.rest.suite>marvel</tests.rest.suite>
<tests.rest.load_packaged>false</tests.rest.load_packaged>
<deploy.skip>true</deploy.skip>
<xlint.options>-Xlint:-rawtypes,-unchecked</xlint.options>
</properties>
<dependencies>

View File

@ -70,28 +70,28 @@ public class ClusterInfoIT extends AbstractRendererTestCase {
Map license = (Map) licenses.iterator().next();
assertThat(license, instanceOf(Map.class));
String uid = (String) ((Map) license).get(ClusterInfoRenderer.Fields.UID.underscore().toString());
String uid = (String) license.get(ClusterInfoRenderer.Fields.UID.underscore().toString());
assertThat(uid, not(isEmptyOrNullString()));
String type = (String) ((Map) license).get(ClusterInfoRenderer.Fields.TYPE.underscore().toString());
String type = (String) license.get(ClusterInfoRenderer.Fields.TYPE.underscore().toString());
assertThat(type, not(isEmptyOrNullString()));
String status = (String) ((Map) license).get(ClusterInfoRenderer.Fields.STATUS.underscore().toString());
String status = (String) license.get(ClusterInfoRenderer.Fields.STATUS.underscore().toString());
assertThat(status, not(isEmptyOrNullString()));
Long expiryDate = (Long) ((Map) license).get(ClusterInfoRenderer.Fields.EXPIRY_DATE_IN_MILLIS.underscore().toString());
Long expiryDate = (Long) license.get(ClusterInfoRenderer.Fields.EXPIRY_DATE_IN_MILLIS.underscore().toString());
assertThat(expiryDate, greaterThan(0L));
// We basically recompute the hash here
String hkey = (String) ((Map) license).get(ClusterInfoRenderer.Fields.HKEY.underscore().toString());
String hkey = (String) license.get(ClusterInfoRenderer.Fields.HKEY.underscore().toString());
String recalculated = ClusterInfoRenderer.hash(status, uid, type, String.valueOf(expiryDate), clusterUUID);
assertThat(hkey, equalTo(recalculated));
assertThat((String) ((Map) license).get(ClusterInfoRenderer.Fields.FEATURE.underscore().toString()), not(isEmptyOrNullString()));
assertThat((String) ((Map) license).get(ClusterInfoRenderer.Fields.ISSUER.underscore().toString()), not(isEmptyOrNullString()));
assertThat((String) ((Map) license).get(ClusterInfoRenderer.Fields.ISSUED_TO.underscore().toString()), not(isEmptyOrNullString()));
assertThat((Long) ((Map) license).get(ClusterInfoRenderer.Fields.ISSUE_DATE_IN_MILLIS.underscore().toString()), greaterThan(0L));
assertThat((Integer) ((Map) license).get(ClusterInfoRenderer.Fields.MAX_NODES.underscore().toString()), greaterThan(0));
assertThat((String) license.get(ClusterInfoRenderer.Fields.FEATURE.underscore().toString()), not(isEmptyOrNullString()));
assertThat((String) license.get(ClusterInfoRenderer.Fields.ISSUER.underscore().toString()), not(isEmptyOrNullString()));
assertThat((String) license.get(ClusterInfoRenderer.Fields.ISSUED_TO.underscore().toString()), not(isEmptyOrNullString()));
assertThat((Long) license.get(ClusterInfoRenderer.Fields.ISSUE_DATE_IN_MILLIS.underscore().toString()), greaterThan(0L));
assertThat((Integer) license.get(ClusterInfoRenderer.Fields.MAX_NODES.underscore().toString()), greaterThan(0));
Object clusterStats = source.get(ClusterStatsRenderer.Fields.CLUSTER_STATS.underscore().toString());
assertNotNull(clusterStats);

View File

@ -18,6 +18,7 @@
<elasticsearch.plugin.isolated>false</elasticsearch.plugin.isolated>
<elasticsearch.integ.antfile>${project.basedir}/integration-tests.xml</elasticsearch.integ.antfile>
<xplugins.list>license,shield,shield-example-realm</xplugins.list>
<xlint.options>-Xlint:-rawtypes</xlint.options>
</properties>
<dependencies>
@ -120,4 +121,4 @@
</plugin>
</plugins>
</build>
</project>
</project>

View File

@ -25,6 +25,7 @@
<elasticsearch.plugin.isolated>false</elasticsearch.plugin.isolated>
<!-- TODO: refactor -->
<elasticsearch.integ.antfile>${basedir}/dev-tools/integration-tests.xml</elasticsearch.integ.antfile>
<xlint.options>-Xlint:-deprecation,-rawtypes,-serial,-try,-unchecked</xlint.options>
</properties>
<dependencies>

View File

@ -532,8 +532,8 @@ public class BCrypt {
* Initialise the Blowfish key schedule
*/
private void init_key() {
P = (int[])P_orig.clone();
S = (int[])S_orig.clone();
P = P_orig.clone();
S = S_orig.clone();
}
/**
@ -700,7 +700,7 @@ public class BCrypt {
B = new BCrypt();
hashed = B.crypt_raw(passwordb, saltb, rounds,
(int[])bf_crypt_ciphertext.clone());
bf_crypt_ciphertext.clone());
rs.append("$2");
if (minor >= 'a')

View File

@ -76,6 +76,7 @@ public final class Automatons {
/**
* Builds and returns an automaton that represents the given pattern.
*/
@SuppressWarnings("fallthrough") // explicit fallthrough at end of switch
static Automaton wildcard(String text) {
List<Automaton> automata = new ArrayList<>();
for (int i = 0; i < text.length();) {

View File

@ -25,6 +25,7 @@
<tests.rest.load_packaged>false</tests.rest.load_packaged>
<tests.timewarp>true</tests.timewarp>
<tests.rest.blacklist>hijack/10_basic/*</tests.rest.blacklist>
<xlint.options>-Xlint:-deprecation,-rawtypes,-serial,-unchecked</xlint.options>
</properties>
<dependencies>

View File

@ -257,6 +257,8 @@ public class DynamicIndexName implements ToXContent {
throw new ElasticsearchParseException("invalid dynamic name expression [{}]. invalid character at position [{}]. " +
"`{` and `}` are reserved characters and should be escaped when used as part of the index name using `\\` (e.g. `\\{text\\}`)", new String(text, from, length), i);
}
sb.append(c);
break;
default:
sb.append(c);
}