Return-Path: X-Original-To: apmail-commons-issues-archive@minotaur.apache.org Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 54112CE3A for ; Thu, 10 May 2012 13:36:13 +0000 (UTC) Received: (qmail 26914 invoked by uid 500); 10 May 2012 13:36:13 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 26820 invoked by uid 500); 10 May 2012 13:36:13 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 26812 invoked by uid 99); 10 May 2012 13:36:13 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 10 May 2012 13:36:12 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 10 May 2012 13:36:10 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id A728D14856 for ; Thu, 10 May 2012 13:35:49 +0000 (UTC) Date: Thu, 10 May 2012 13:35:49 +0000 (UTC) From: "Christian Lewold (JIRA)" To: issues@commons.apache.org Message-ID: <1502679376.49226.1336656949686.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <417571154.49212.1336656829078.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (BEANUTILS-413) Compiler Compliance level creates bad bytecode MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/BEANUTILS-413?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13272321#comment-13272321 ] Christian Lewold commented on BEANUTILS-413: -------------------------------------------- Ok, this was the first defect I created using jira, so I didnt know that I can attach files only after I created the defect ... the zipped test project is attached now - you may use it from within eclipse or simply invoke "ant" on the command line. > Compiler Compliance level creates bad bytecode > ---------------------------------------------- > > Key: BEANUTILS-413 > URL: https://issues.apache.org/jira/browse/BEANUTILS-413 > Project: Commons BeanUtils > Issue Type: Bug > Components: Bean / Property Utils > Affects Versions: 1.8.3 > Environment: All > Reporter: Christian Lewold > Fix For: 1.8.4 > > Original Estimate: 3h > Remaining Estimate: 3h > > There is a problem with bytecode generated with jdk 1.3 compliance settings. The problem is, that public methods of package private classes cannot be accessed using reflection. > This happens for example with ResultSetDynaClass which extends JDBCDynaClass. Why is this important? Well, because problems occur in case e.g. ResultSetDynaClass.getDynaProperties is accessed through EL. > The problem is easily solved by re-building beanutils using "1.6" compliance settings. > This unit test shows the problem. I mocked the creation of ResultSet. > -) testUsingMethodCall always succeeds > -) testUsingReflection fails with commons-beanutils-core-1.8.3.jar in classpath. This is the version you get from official downloads or maven repositories!!!!! > -) testUsingReflection succeeds with commons-beanutils-core-1.8.3_jdk6.jar. I built this jar using mvn package, but changed compliance settings to 1.6 in pom.xml. > I also provide 2 decompiled (using jad) ResultSetDynaClass.jad_version files. The difference makes the real problem obvious. The public volatile methods exposing the public methods of the package private base class are missing in the byte code created with older compiler compliance settings. > Bottomline - this problem happens often in case e.g. Tomcat 6 is used to show ResultSetDynaBeans using expression language. Likely these classes are not the only ones affected. > Actually I'd have a complete unit test, and a eclipse based test project (or if you prefer ant build.xml) easily showing the defect. I simply don't know how to attach the file right now. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira