diff --git a/pom.xml b/pom.xml index 13daa03cc..831a78d55 100644 --- a/pom.xml +++ b/pom.xml @@ -51,8 +51,8 @@ UTF-8 - 1.8 - 1.8 + 11 + 11 2.22.2 2.13.5 5.7.0 @@ -135,6 +135,7 @@ 8 + false diff --git a/src/main/java/com/xceptance/neodymium/module/StatementBuilder.java b/src/main/java/com/xceptance/neodymium/module/StatementBuilder.java index 035168ced..4f61f04ee 100644 --- a/src/main/java/com/xceptance/neodymium/module/StatementBuilder.java +++ b/src/main/java/com/xceptance/neodymium/module/StatementBuilder.java @@ -25,13 +25,9 @@ public static T instantiate(Class clazz) { try { - return clazz.newInstance(); + return clazz.getDeclaredConstructor().newInstance(); } - catch (InstantiationException e) - { - throw new RuntimeException(e); - } - catch (IllegalAccessException e) + catch (ReflectiveOperationException e) { throw new RuntimeException(e); } @@ -56,7 +52,7 @@ public static List getAnnotations(AnnotatedElement obj { annotations.addAll(Arrays.asList((T[]) annotation.getClass().getMethod("value").invoke(annotation))); } - catch (Exception e) + catch (ReflectiveOperationException e) { throw new RuntimeException(e); } @@ -92,7 +88,7 @@ public static List getDeclaredAnnotations(AnnotatedEle { annotations.addAll(Arrays.asList((T[]) annotation.getClass().getMethod("value").invoke(annotation))); } - catch (Exception e) + catch (ReflectiveOperationException e) { throw new RuntimeException(e); } diff --git a/src/test/java/com/xceptance/neodymium/testclasses/datautils/DataUtilsTests.java b/src/test/java/com/xceptance/neodymium/testclasses/datautils/DataUtilsTests.java index 9de8d1baf..89f1899a3 100644 --- a/src/test/java/com/xceptance/neodymium/testclasses/datautils/DataUtilsTests.java +++ b/src/test/java/com/xceptance/neodymium/testclasses/datautils/DataUtilsTests.java @@ -210,7 +210,7 @@ public void testGetClass() throws Exception Assert.assertEquals("1234567890", testCompound.getClubCardNumber()); Assert.assertEquals(null, testCompound.getNotSet()); Assert.assertEquals(null, testCompound.getNullValue()); - Assert.assertEquals(new Double(12.34), testCompound.getNumberValue()); + Assert.assertEquals(Double.valueOf(12.34), testCompound.getNumberValue()); Assert.assertEquals("containing strange things like spaces and äüø", testCompound.getDescription()); Assert.assertEquals("4111111111111111", testCompound.getCreditCard().getCardNumber()); Assert.assertEquals("123", testCompound.getCreditCard().getCcv()); @@ -235,7 +235,7 @@ public void testGetClass() throws Exception public void testGetByPath() throws Exception { Double numberValue = DataUtils.get("$.numberValue", Double.class); - Assert.assertEquals(new Double(12.34), numberValue); + Assert.assertEquals(Double.valueOf(12.34), numberValue); String description = DataUtils.get("$.description", String.class); Assert.assertEquals("containing strange things like spaces and äüø", description); @@ -276,7 +276,7 @@ public void testGetClassByPath() throws Exception Assert.assertEquals("1234567890", testCompound.getClubCardNumber()); Assert.assertEquals(null, testCompound.getNotSet()); Assert.assertEquals(null, testCompound.getNullValue()); - Assert.assertEquals(new Double(12.34), testCompound.getNumberValue()); + Assert.assertEquals(Double.valueOf(12.34), testCompound.getNumberValue()); Assert.assertEquals("containing strange things like spaces and äüø", testCompound.getDescription()); Assert.assertEquals("4111111111111111", testCompound.getCreditCard().getCardNumber()); Assert.assertEquals("123", testCompound.getCreditCard().getCcv()); diff --git a/src/test/java/com/xceptance/neodymium/testclasses/datautils/DataUtilsTestsXml.java b/src/test/java/com/xceptance/neodymium/testclasses/datautils/DataUtilsTestsXml.java index acdd98051..704ce1aa0 100644 --- a/src/test/java/com/xceptance/neodymium/testclasses/datautils/DataUtilsTestsXml.java +++ b/src/test/java/com/xceptance/neodymium/testclasses/datautils/DataUtilsTestsXml.java @@ -210,7 +210,7 @@ public void testGetClass() throws Exception Assert.assertEquals(null, testCompound.getNotSet()); // our XML parer does not support explicit null value // Assert.assertEquals(null, testCompound.getNullValue()); - Assert.assertEquals(new Double(12.34), testCompound.getNumberValue()); + Assert.assertEquals(Double.valueOf(12.34), testCompound.getNumberValue()); Assert.assertEquals("containing strange things like spaces and äüø", testCompound.getDescription()); Assert.assertEquals("4111111111111111", testCompound.getCreditCard().getCardNumber()); Assert.assertEquals("123", testCompound.getCreditCard().getCcv()); @@ -235,7 +235,7 @@ public void testGetClass() throws Exception public void testGetByPath() throws Exception { Double numberValue = DataUtils.get("$.numberValue", Double.class); - Assert.assertEquals(new Double(12.34), numberValue); + Assert.assertEquals(Double.valueOf(12.34), numberValue); String description = DataUtils.get("$.description", String.class); Assert.assertEquals("containing strange things like spaces and äüø", description); @@ -277,7 +277,7 @@ public void testGetClassByPath() throws Exception Assert.assertEquals(null, testCompound.getNotSet()); // our XML parer does not support explicit null value // Assert.assertEquals(null, testCompound.getNullValue()); - Assert.assertEquals(new Double(12.34), testCompound.getNumberValue()); + Assert.assertEquals(Double.valueOf(12.34), testCompound.getNumberValue()); Assert.assertEquals("containing strange things like spaces and äüø", testCompound.getDescription()); Assert.assertEquals("4111111111111111", testCompound.getCreditCard().getCardNumber()); Assert.assertEquals("123", testCompound.getCreditCard().getCcv());