You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pluto-scm@portals.apache.org by ms...@apache.org on 2016/01/18 13:41:34 UTC

[32/35] portals-pluto git commit: Bug fix in annotated method store

Bug fix in annotated method store


Project: http://git-wip-us.apache.org/repos/asf/portals-pluto/repo
Commit: http://git-wip-us.apache.org/repos/asf/portals-pluto/commit/abee3790
Tree: http://git-wip-us.apache.org/repos/asf/portals-pluto/tree/abee3790
Diff: http://git-wip-us.apache.org/repos/asf/portals-pluto/diff/abee3790

Branch: refs/heads/V3Prototype
Commit: abee3790538a428718330419572c21e4b9502f6a
Parents: 92f8e87
Author: Scott Nicklous <ms...@apache.org>
Authored: Fri Jan 15 13:08:18 2016 +0100
Committer: Scott Nicklous <ms...@apache.org>
Committed: Fri Jan 15 13:08:18 2016 +0100

----------------------------------------------------------------------
 .../bean/processor/AnnotatedMethodStore.java         | 15 +++++++++------
 .../om/portlet/impl/ConfigurationProcessor.java      |  2 +-
 2 files changed, 10 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/abee3790/pluto-container/src/main/java/org/apache/pluto/container/bean/processor/AnnotatedMethodStore.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/bean/processor/AnnotatedMethodStore.java b/pluto-container/src/main/java/org/apache/pluto/container/bean/processor/AnnotatedMethodStore.java
index 652ef86..50287d2 100644
--- a/pluto-container/src/main/java/org/apache/pluto/container/bean/processor/AnnotatedMethodStore.java
+++ b/pluto-container/src/main/java/org/apache/pluto/container/bean/processor/AnnotatedMethodStore.java
@@ -538,14 +538,17 @@ public class AnnotatedMethodStore {
    }
    
    /**
-    * Sets the bean instance for all annotated methods that are members of a configured portlet
-    * class to ensure that all annotated methods of the portlet class use the same bean instance.
+    * Sets the bean instance for all annotated methods for a given portlet that are members of 
+    * a configured portlet class to ensure that all annotated methods of the portlet class use 
+    * the same bean instance.
     * 
-    * @param cls
-    * @param beanInstance
+    * @param portletName      The portlet name
+    * @param cls              The class
+    * @param beanInstance     The instance to use
     */
-   public void setPortletClassInstance(Class<?> cls, Object beanInstance) {
-      for (List<AnnotatedMethod> list : methods.values()) {
+   public void setPortletClassInstance(String portletName, Class<?> cls, Object beanInstance) {
+      for (MethodIdentifier mi : getMethodIDsForPortlet(portletName)) {
+         List<AnnotatedMethod> list =  methods.get(mi);
          for (AnnotatedMethod am : list) {
             if (am.getJavaMethod().getDeclaringClass().equals(cls)) {
                am.setPortletClassInstance(beanInstance);

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/abee3790/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/ConfigurationProcessor.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/ConfigurationProcessor.java b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/ConfigurationProcessor.java
index 7f368e4..5c42c06 100644
--- a/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/ConfigurationProcessor.java
+++ b/pluto-container/src/main/java/org/apache/pluto/container/om/portlet/impl/ConfigurationProcessor.java
@@ -508,7 +508,7 @@ public abstract class ConfigurationProcessor {
             // publishing event references. Such annotated methods must use the same bean
             // instance, so fix up the method store.
             
-            ams.setPortletClassInstance(cls, instance);
+            ams.setPortletClassInstance(pd.getPortletName(), cls, instance);
 
             // extract the methods from the portlet class and add them to the method store
             // as long there is no corresponding annotated method already present.