From 5cef06fa3eff6de5ff7c62e99b7e5a0cfecac302 Mon Sep 17 00:00:00 2001 From: Jack Conradson Date: Tue, 14 Jun 2016 14:28:47 -0700 Subject: [PATCH] Add a test. --- .../org/elasticsearch/painless/WhenThingsGoWrongTests.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/lang-painless/src/test/java/org/elasticsearch/painless/WhenThingsGoWrongTests.java b/modules/lang-painless/src/test/java/org/elasticsearch/painless/WhenThingsGoWrongTests.java index 7a597132227..a9e03095297 100644 --- a/modules/lang-painless/src/test/java/org/elasticsearch/painless/WhenThingsGoWrongTests.java +++ b/modules/lang-painless/src/test/java/org/elasticsearch/painless/WhenThingsGoWrongTests.java @@ -229,4 +229,9 @@ public class WhenThingsGoWrongTests extends ScriptTestCase { assertThat(e.getMessage(), containsString("\\ujjjj")); } + public void testBadBoxingCast() { + expectScriptThrows(ClassCastException.class, () -> { + exec("BitSet bs = new BitSet(); bs.and(2);"); + }); + } }