Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 9B14B200D6A for ; Sat, 30 Dec 2017 17:42:09 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 996DB160C21; Sat, 30 Dec 2017 16:42:09 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id DE8C0160C11 for ; Sat, 30 Dec 2017 17:42:08 +0100 (CET) Received: (qmail 56734 invoked by uid 500); 30 Dec 2017 16:42:08 -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 56725 invoked by uid 99); 30 Dec 2017 16:42:08 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 30 Dec 2017 16:42:08 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 8692BC3111 for ; Sat, 30 Dec 2017 16:42:07 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.211 X-Spam-Level: X-Spam-Status: No, score=-99.211 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id Mie2E2z1glS3 for ; Sat, 30 Dec 2017 16:42:06 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id DD0945F24C for ; Sat, 30 Dec 2017 16:42:05 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 03F91E0C25 for ; Sat, 30 Dec 2017 16:42:03 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 83DC0212F7 for ; Sat, 30 Dec 2017 16:42:01 +0000 (UTC) Date: Sat, 30 Dec 2017 16:42:00 +0000 (UTC) From: "mgroovy (JIRA)" To: notifications@groovy.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (GROOVY-8385) CompileStatic: Improved method call/property access Java compatibility for Minecraft Forge obfuscation support MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Sat, 30 Dec 2017 16:42:09 -0000 [ https://issues.apache.org/jira/browse/GROOVY-8385?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16306872#comment-16306872 ] mgroovy commented on GROOVY-8385: --------------------------------- * When using groovy-all-2.4.14-SNAPSHOT.jar from Groovy JDK 8 Build with snapshot deploy (2_4_X) (29 Dec 17 02:22) (apache-groovy-sdk-2.4.14-SNAPSHOT.zip from http://ci.groovy-lang.org) {code} minecraftEntity.@hurtResistantTime = 0 // with minecraftEntity being e.g. of type cow, horse, slime {code} works ||-) * (As expected property access, e.g. {code} minecraftEntity.hurtResistantTime = 0 {code} still does not work) > CompileStatic: Improved method call/property access Java compatibility for Minecraft Forge obfuscation support > -------------------------------------------------------------------------------------------------------------- > > Key: GROOVY-8385 > URL: https://issues.apache.org/jira/browse/GROOVY-8385 > Project: Groovy > Issue Type: Improvement > Components: bytecode > Reporter: mgroovy > Assignee: Jochen Theodorou > Priority: Minor > Labels: Forge, Java, JavaCompatibility, Minecraft, Modding > > * Even with @CompileStatic the Groovy compiler creates bytecode for method calls / property access which is dynamic in nature. > * This means that e.g. Minecraft Forge's obfuscator does not pick up the calls in the generated bytecode, which means they do not get obfuscated, which in turn makes the code fail when executed in Minecraft. > * This effectively makes it nearly impossible to write Minecraft mods with Groovy, which in turn is a wasted opportunity to get people involved with Groovy early on. > * Possible approaches to improve the situation: > ## Improve on a fundamental level: According to [~paulk] only a few calls are required to be done dynamically for Groovy functionality to work as expected under @CompileStatic. > *** The problem seems to be that it could be hard to be a 100% sure no edge case is overlooked, as to not break @CompileStatic in situations where e.g. no 100% Java-call-compatibility is needed. > ## Improve through newly introduced @CompileStatic parameters > *** => Static method call / property access bytecode is generated for method code / all class methods repectively (with possible exceptions for the know cases mentioned above). > ## Improve through newly introduced @ObfuscationJavaCompatibility annotation that can be put on a method or class > *** behavior same as for @CompileStatic parameters above -- This message was sent by Atlassian JIRA (v6.4.14#64029)