Tapestry
  1. Tapestry
  2. TAPESTRY-441

Poor reporting of duplicate method implementations

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.0
    • Fix Version/s: 4.0
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      jboss-4.0.2 with tomcat 5.5.9 on linux

      Description

      On a (abstract) Page that implements an interface it is impossible to inject a property that
      is defined by an interface.

      This behaviour is a bug because 'Attempt to redefine method de.atron.b2xsale.web.util.IPageBean getPageBean() '
      is not really true as IPageBean is an interface and the redefined method is (still) abstract
      in my Caculate Page.

      The expected behaviour is to allow the 'redefinition' of the method without any warning.

      Details:

      This page definition (still 3.0 style but this is a bug against 4.0-beta2; it has work with 3.0.3):

      <?xml version="1.0" encoding="UTF-8"?>

      <page-specification class="de.atron.b2xsale.web.Calculate">
      <description>Calculate</description>
      <property-specification name="PageBean" type="de.atron.b2xsale.web.util.IPageBean"
      persistent="yes" initial-value="new de.atron.b2xsale.web.beans.CalculateBean()"/>
      ...
      </page-specification>

      leeds to the following Error:

      Error at classpath:/WEB-INF/Calculate.page, line 7, column 60: Error adding property pageBean to class de.atron.b2xsale.web.Calculate: Attempt to redefine method de.atron.b2xsale.web.util.IPageBean getPageBean() of class $Calculate_25.
      location:
      classpath:/WEB-INF/Calculate.page, line 7, column 60
      2
      5 <!-- generated by Spindle, http://spindle.sourceforge.net -->
      6
      7 <page-specification class="de.atron.b2xsale.web.Calculate">
      8
      9 <description>Calculate</description>
      10
      11 <property-specification name="PageBean" type="de.atron.b2xsale.web.util.IPageBean"
      12 persistent="yes" initial-value="new de.atron.b2xsale.web.beans.CalculateBean()"/>
      org.apache.hivemind.ApplicationRuntimeException
      Attempt to redefine method de.atron.b2xsale.web.util.IPageBean getPageBean() of class $Calculate_25.
      Stack Trace:
      org.apache.hivemind.service.impl.ClassFabImpl.addMethod(ClassFabImpl.java:276)
      org.apache.tapestry.enhance.EnhancementOperationImpl.addMethod(EnhancementOperationImpl.java:337)
      org.apache.tapestry.enhance.EnhanceUtils.createSimpleAccessor(EnhanceUtils.java:71)
      org.apache.tapestry.enhance.AbstractPropertyWorker.createProperty(AbstractPropertyWorker.java:69)
      org.apache.tapestry.enhance.AbstractPropertyWorker.performEnhancement(AbstractPropertyWorker.java:45)
      $EnhancementWorker_10551fa4f1f.performEnhancement($EnhancementWorker_10551fa4f1f.java)
      $EnhancementWorker_10551fa4f21.performEnhancement($EnhancementWorker_10551fa4f21.java)
      $EnhancementWorker_10551fa4f03.performEnhancement($EnhancementWorker_10551fa4f03.java)
      org.apache.tapestry.services.impl.ComponentConstructorFactoryImpl.getComponentConstructor(ComponentConstructorFactoryImpl.java:76)
      $ComponentConstructorFactory_10551fa4eec.getComponentConstructor($ComponentConstructorFactory_10551fa4eec.java)
      org.apache.tapestry.pageload.PageLoader.instantiatePage(PageLoader.java:611)
      org.apache.tapestry.pageload.PageLoader.loadPage(PageLoader.java:639)
      $IPageLoader_10551fa4ee8.loadPage($IPageLoader_10551fa4ee8.java)
      $IPageLoader_10551fa4ee9.loadPage($IPageLoader_10551fa4ee9.java)
      org.apache.tapestry.pageload.PageSource.getPage(PageSource.java:118)
      $IPageSource_10551fa4e58.getPage($IPageSource_10551fa4e58.java)
      org.apache.tapestry.engine.RequestCycle.loadPage(RequestCycle.java:252)
      org.apache.tapestry.engine.RequestCycle.getPage(RequestCycle.java:235)
      de.atron.b2xsale.web.Border.formGotoCalculate(Border.java:98)

      on the Page Caculate

      public abstract class Calculate extends AHiddenStatePage

      { ... }

      with AHiddenStatePage with

      public abstract class AHiddenStatePage
      extends BasePage
      implements IHiddenStatePage, PageRenderListener { ... }

      with the interface IHiddenStagePage

      public interface IHiddenStatePage extends IPage {
      void setPageBean(IPageBean bean);
      IPageBean getPageBean();
      }

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            Howard M. Lewis Ship
            Reporter:
            Thomas Pasch
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development