You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2021/09/20 09:48:35 UTC

[GitHub] [shardingsphere] tristaZero commented on a change in pull request #12588: Fix the failure tests when building with JDK 11

tristaZero commented on a change in pull request #12588:
URL: https://github.com/apache/shardingsphere/pull/12588#discussion_r712020211



##########
File path: shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/adapter/invocation/JdbcMethodInvocationTest.java
##########
@@ -29,7 +29,22 @@ public void assertInvokeSuccess() throws NoSuchMethodException {
     
     @Test(expected = IllegalAccessException.class)
     public void assertInvokeFailure() throws NoSuchMethodException {
-        JdbcMethodInvocation actual = new JdbcMethodInvocation(String.class.getDeclaredMethod("indexOfSupplementary", int.class, int.class), new Object[] {1, 1});
+        JdbcMethodInvocation actual;
+
+        if (isJDK8OrEarlier()) {
+            actual = new JdbcMethodInvocation(String.class.getDeclaredMethod("indexOfSupplementary", int.class, int.class), new Object[] {1, 1});
+        } else {
+            actual = new JdbcMethodInvocation(String.class.getDeclaredMethod("value"), new Object[] {});
+        }
         actual.invoke("");
     }
+
+    private boolean isJDK8OrEarlier() {
+        String version = System.getProperty("java.specification.version");
+        if (version.startsWith("1.")) {
+            version = version.substring(2);
+        }
+

Review comment:
       Same with the last comment. Thanks.

##########
File path: shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/adapter/invocation/JdbcMethodInvocationTest.java
##########
@@ -29,7 +29,22 @@ public void assertInvokeSuccess() throws NoSuchMethodException {
     
     @Test(expected = IllegalAccessException.class)
     public void assertInvokeFailure() throws NoSuchMethodException {
-        JdbcMethodInvocation actual = new JdbcMethodInvocation(String.class.getDeclaredMethod("indexOfSupplementary", int.class, int.class), new Object[] {1, 1});
+        JdbcMethodInvocation actual;
+

Review comment:
       Could you remove this redundant blank line?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org