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 242B5200D08 for ; Thu, 7 Sep 2017 00:32:07 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 22A9D16128F; Wed, 6 Sep 2017 22:32:07 +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 702E51609E3 for ; Thu, 7 Sep 2017 00:32:06 +0200 (CEST) Received: (qmail 64445 invoked by uid 500); 6 Sep 2017 22:32:04 -0000 Mailing-List: contact issues-help@struts.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@struts.apache.org Delivered-To: mailing list issues@struts.apache.org Received: (qmail 64434 invoked by uid 99); 6 Sep 2017 22:32:04 -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; Wed, 06 Sep 2017 22:32:04 +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 B428318B5A7 for ; Wed, 6 Sep 2017 22:32:03 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.202 X-Spam-Level: X-Spam-Status: No, score=-99.202 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id SKKAf9YoKHQR for ; Wed, 6 Sep 2017 22:32:02 +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 AA18E5F254 for ; Wed, 6 Sep 2017 22:32: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 CE0BEE0C21 for ; Wed, 6 Sep 2017 22:32: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 862A72414F for ; Wed, 6 Sep 2017 22:32:00 +0000 (UTC) Date: Wed, 6 Sep 2017 22:32:00 +0000 (UTC) From: "Mitth'raw'nuruodo (JIRA)" To: issues@struts.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Comment Edited] (WW-4849) ObjectFactory constructor signature change breaks extensions MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Wed, 06 Sep 2017 22:32:07 -0000 [ https://issues.apache.org/jira/browse/WW-4849?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16156121#comment-16156121 ] Mitth'raw'nuruodo edited comment on WW-4849 at 9/6/17 10:31 PM: ---------------------------------------------------------------- [~aleksandr-m] I'm not sure how much of your previous comment was directed at me vs Lukasz...however: "Required objects should be injected in the constructor" - this is difficult for any custom ObjectFactory to do, given that it [has to have a no-arg constructor|https://struts.apache.org/docs/objectfactory.html] and then has to immediately pass a Container to its superclass constructor. "Have you tested it with some non default object factory e.g. spring?" - my pull request includes unit testing. As far as I can see, it will accept the first Container that gets injected, either via constructor or setter, and will then ignore further injection attempts. *Note that the {{SpringObjectFactory}} - and the other factories provided by the project, like {{CdiObjectFactory}} and {{PlexusObjectFactory}} - are not compliant with the documentation about custom object factories at https://struts.apache.org/docs/objectfactory.html, since they lack no-arg constructors.* was (Author: thrawnca): [~aleksandr-m] I'm not sure how much of your previous comment was directed at me vs Lukasz...however: "Required objects should be injected in the constructor" - this is difficult for any custom ObjectFactory to do, given that it [has to have a no-arg constructor|https://struts.apache.org/docs/objectfactory.html] and then has to immediately pass a Container to its superclass constructor. "Have you tested it with some non default object factory e.g. spring?" - my pull request includes unit testing. As far as I can see, it will accept the first Container that gets injected, either via constructor or setter, and will then ignore further injection attempts. *Note that the {{SpringObjectFactory}} - and the other factories provided by the project, like {{CdiObjectFactory}} and {{PlexusObjectFactory}} are not compliant with the documentation about custom object factories at https://struts.apache.org/docs/objectfactory.html, since they lack no-arg constructors.* > ObjectFactory constructor signature change breaks extensions > ------------------------------------------------------------ > > Key: WW-4849 > URL: https://issues.apache.org/jira/browse/WW-4849 > Project: Struts 2 > Issue Type: Bug > Components: Core > Affects Versions: 2.5.13 > Reporter: Mitth'raw'nuruodo > Fix For: 2.5.14 > > > Commit {{6f91d0776a545c911ca4f2875ed9976614711ef9}} changed the signature of the {{ObjectFactory}} constructor, breaking all classes that extend {{ObjectFactory}} (as per https://struts.apache.org/docs/objectfactory.html). This affects eg the [{{guice-servlet}} Struts plugin| https://github.com/google/guice/blob/master/extensions/struts2/src/com/google/inject/struts2/Struts2Factory.java]. > This was not listed on the [2.5.13 version notes|https://struts.apache.org/docs/version-notes-2513.html] as a breaking change, and breaking changes should preferably be avoided in critical security updates. -- This message was sent by Atlassian JIRA (v6.4.14#64029)