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 138F8200D41 for ; Tue, 7 Nov 2017 14:16:05 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 1205B1609C8; Tue, 7 Nov 2017 13:16:05 +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 55942160BED for ; Tue, 7 Nov 2017 14:16:04 +0100 (CET) Received: (qmail 30994 invoked by uid 500); 7 Nov 2017 13:16:03 -0000 Mailing-List: contact dev-help@aries.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@aries.apache.org Delivered-To: mailing list dev@aries.apache.org Received: (qmail 30969 invoked by uid 99); 7 Nov 2017 13:16:03 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Nov 2017 13:16:03 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 9913218E15C for ; Tue, 7 Nov 2017 13:16:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -100.002 X-Spam-Level: X-Spam-Status: No, score=-100.002 tagged_above=-999 required=6.31 tests=[RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id kSHl0eFzz3VH for ; Tue, 7 Nov 2017 13:16:01 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 60B8960DCF for ; Tue, 7 Nov 2017 13:16:01 +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 EBB19E0EFC for ; Tue, 7 Nov 2017 13:16:00 +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 64DBC241AB for ; Tue, 7 Nov 2017 13:16:00 +0000 (UTC) Date: Tue, 7 Nov 2017 13:16:00 +0000 (UTC) From: "James Phillpotts (JIRA)" To: dev@aries.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (ARIES-1755) IllegalArgumentException on weaving MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Tue, 07 Nov 2017 13:16:05 -0000 [ https://issues.apache.org/jira/browse/ARIES-1755?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] James Phillpotts updated ARIES-1755: ------------------------------------ Attachment: aries-test.zip Attached sample project. > IllegalArgumentException on weaving > ----------------------------------- > > Key: ARIES-1755 > URL: https://issues.apache.org/jira/browse/ARIES-1755 > Project: Aries > Issue Type: Bug > Components: SPI Fly > Affects Versions: spifly-1.0.8 > Reporter: James Phillpotts > > On weaving a jar that contains a utility loading class like this (this example is an enum, but the same happens if it's a class, anonymous inner class, etc.): > {code:java} > public enum Loader { > LOADER; > public S load(Class type) { > Iterator services = ServiceLoader.load(type).iterator(); > return services.hasNext() ? services.next() : null; > } > } > {code} > The weaving throws this exception: > {noformat} > java.lang.IllegalArgumentException: value null > at org.objectweb.asm.ClassWriter.newConstItem(ClassWriter.java:1057) > at org.objectweb.asm.MethodWriter.visitLdcInsn(MethodWriter.java:1126) > at org.apache.aries.spifly.weaver.TCCLSetterVisitor$TCCLSetterMethodVisitor.visitMethodInsn(TCCLSetterVisitor.java:194) > at org.objectweb.asm.ClassReader.readCode(ClassReader.java:1416) > at org.objectweb.asm.ClassReader.readMethod(ClassReader.java:1017) > at org.objectweb.asm.ClassReader.accept(ClassReader.java:693) > at org.objectweb.asm.ClassReader.accept(ClassReader.java:506) > at org.apache.aries.spifly.statictool.Main.weaveDir(Main.java:196) > at org.apache.aries.spifly.statictool.Main.weaveJar(Main.java:96) > at org.apache.aries.spifly.statictool.Main.main(Main.java:73) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:498) > at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:282) > at java.lang.Thread.run(Thread.java:745) > {noformat} > This happens regardless of whether static or dynamic weaving is used. > I'll attach a sample project. -- This message was sent by Atlassian JIRA (v6.4.14#64029)