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 AD273200C43 for ; Sun, 26 Mar 2017 19:39:51 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id ABFAC160B92; Sun, 26 Mar 2017 17:39:51 +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 F230B160B82 for ; Sun, 26 Mar 2017 19:39:50 +0200 (CEST) Received: (qmail 83905 invoked by uid 500); 26 Mar 2017 17:39:46 -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 83895 invoked by uid 99); 26 Mar 2017 17:39:46 -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; Sun, 26 Mar 2017 17:39:46 +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 91C45185CAB for ; Sun, 26 Mar 2017 17:39:45 +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 qufusUxTfKQ1 for ; Sun, 26 Mar 2017 17:39:43 +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 F14345F245 for ; Sun, 26 Mar 2017 17:39:42 +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 1AF32E06BA for ; Sun, 26 Mar 2017 17:39:42 +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 A6B6724066 for ; Sun, 26 Mar 2017 17:39:41 +0000 (UTC) Date: Sun, 26 Mar 2017 17:39:41 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@struts.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (WW-4744) AnnotationWorkflowInterceptor should supports non-public annotated methods MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Sun, 26 Mar 2017 17:39:51 -0000 [ https://issues.apache.org/jira/browse/WW-4744?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15942358#comment-15942358 ] ASF GitHub Bot commented on WW-4744: ------------------------------------ Github user lukaszlenart commented on the issue: https://github.com/apache/struts/pull/124 So as I understand this is ready to be merged with a future notice to use Commons Lang 3.6 when available? > AnnotationWorkflowInterceptor should supports non-public annotated methods > -------------------------------------------------------------------------- > > Key: WW-4744 > URL: https://issues.apache.org/jira/browse/WW-4744 > Project: Struts 2 > Issue Type: Improvement > Components: Core Interceptors > Reporter: zhouyanming > Fix For: 2.5.next > > > {code:java} > @Before > protected String prepare(){ > //TODO > return null; > } > {code} > [https://github.com/apache/struts/blob/master/core/src/main/java/com/opensymphony/xwork2/interceptor/annotations/AnnotationWorkflowInterceptor.java#L115] > {code:java} > List methods = new ArrayList<>(AnnotationUtils.getAnnotatedMethods(action.getClass(), Before.class)); > {code} > [https://github.com/apache/struts/blob/master/core/src/main/java/com/opensymphony/xwork2/util/AnnotationUtils.java#L123] > {code:java} > for (Method m : clazz.getMethods()) > {code} > clazz.getMethods() only return public methods, so method "prepare" will be excluded, and protected modifier is a good practice for intercept method.We should improve AnnotationUtils.getAnnotatedMethods() to return all methods. Perhaps use an ConcurrentHashMap as cache is much better. -- This message was sent by Atlassian JIRA (v6.3.15#6346)