From notifications-return-14334-archive-asf-public=cust-asf.ponee.io@groovy.apache.org Mon Oct 15 23:49:24 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id A96A6180647 for ; Mon, 15 Oct 2018 23:49:23 +0200 (CEST) Received: (qmail 11223 invoked by uid 500); 15 Oct 2018 21:49:22 -0000 Mailing-List: contact notifications-help@groovy.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@groovy.apache.org Delivered-To: mailing list notifications@groovy.apache.org Received: (qmail 11214 invoked by uid 99); 15 Oct 2018 21:49:22 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Oct 2018 21:49:22 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id AC7BEDFF41; Mon, 15 Oct 2018 21:49:22 +0000 (UTC) From: paulk-asert To: notifications@groovy.apache.org Reply-To: notifications@groovy.apache.org References: In-Reply-To: Subject: [GitHub] groovy pull request #811: GROOVY-8843: Fix illegal reflective access within ... Content-Type: text/plain Message-Id: <20181015214922.AC7BEDFF41@git1-us-west.apache.org> Date: Mon, 15 Oct 2018 21:49:22 +0000 (UTC) Github user paulk-asert commented on a diff in the pull request: https://github.com/apache/groovy/pull/811#discussion_r225328503 --- Diff: src/main/java/org/codehaus/groovy/vmplugin/v9/Java9.java --- @@ -18,14 +18,78 @@ */ package org.codehaus.groovy.vmplugin.v9; +import org.codehaus.groovy.GroovyBugError; import org.codehaus.groovy.vmplugin.v8.Java8; +import java.lang.invoke.MethodHandles; +import java.lang.reflect.Constructor; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; + /** - * Java 9 based functions will be added here if needed. + * Additional Java 9 based functions will be added here as needed. */ public class Java9 extends Java8 { + + private static class LookupHolder { + private static final Method PRIVATE_LOOKUP; + private static final Constructor LOOKUP_Constructor; + static { + Constructor lookup = null; + Method privateLookup = null; + try { // java 9 + privateLookup = MethodHandles.class.getMethod("privateLookupIn", Class.class, MethodHandles.Lookup.class); --- End diff -- We don't eventually, I was just letting the build be built from Java 8 (with current warnings) until we get more things in place. ---