Uploaded image for project: 'Causeway'
  1. Causeway
  2. CAUSEWAY-1620

[WON'T FIX] Metamodel exception if choices specified incorrectly

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Trivial
    • Resolution: Won't Fix
    • 1.14.0
    • 2.0.0-M5
    • None

    Description

      currently the framework just fails "too fast" and throws an exception as soon as the issue is detected. instead it should collate the problem and report along with others (as for other metamodel invalid exceptions).

      To reproduce in kitchensink app:

          @Action(semantics=SemanticsOf.IDEMPOTENT, publishing = Publishing.ENABLED)
          public TextObject updateSomeStringOptionalWithMultiChoices(
                  // @Nullable
                  @ParameterLayout(named = "Choose some string(s)")
                  final List<String> strings) {
              final String asStr = SeparatorUtil.asStr(strings);
              setSomeStringOptionalWithMultiChoices(asStr);
              return this;
          }
      
          public List<String> choices0UpdateSomeStringOptionalWithMultiChoices() {
              return choicesUpdateSomeStringOptionalWithMultiChoices();
          }
      
          public List<String> choicesUpdateSomeStringOptionalWithMultiChoices() {
              return Lists.newArrayList("a", "ab", "abcd", "abcdefgh", "abcdefghijklmnop", "abcdefghijklmnopqrstuvwxyz");
          }
      

      will throw an exception when encountered

      	at org.apache.wicket.Application.initApplication(Application.java:953)
      	at org.apache.wicket.protocol.http.WicketFilter.init(WicketFilter.java:429)
      	... 20 more
      Caused by: org.apache.isis.core.metamodel.exceptions.MetaModelException: class org.isisaddons.app.kitchensink.dom.text.TextObject uses both old and new choices syntax - must use one or other
      	at org.apache.isis.core.metamodel.facets.param.choices.methodnum.ActionParameterChoicesFacetViaMethodFactory.attachChoicesFacetForParametersIfChoicesNumMethodIsFound(ActionParameterChoicesFacetViaMethodFactory.java:92)
      	at org.apache.isis.core.metamodel.facets.param.choices.methodnum.ActionParameterChoicesFacetViaMethodFactory.process(ActionParameterChoicesFacetViaMethodFactory.java:65)
      	at org.apache.isis.core.metamodel.specloader.facetprocessor.FacetProcessor.process(FacetProcessor.java:315)
      	at org.apache.isis.core.metamodel.specloader.specimpl.FacetedMethodsBuilder.createActionFacetedMethod(FacetedMethodsBuilder.java:489)
      	at org.apache.isis.core.metamodel.specloader.specimpl.FacetedMethodsBuilder.findActionFacetedMethod(FacetedMethodsBuilder.java:475)
      	at org.apache.isis.core.metamodel.specloader.specimpl.FacetedMethodsBuilder.findActionFacetedMethods(FacetedMethodsBuilder.java:454)
      	at org.apache.isis.core.metamodel.specloader.specimpl.FacetedMethodsBuilder.findActionFacetedMethods(FacetedMethodsBuilder.java:433)
      	at org.apache.isis.core.metamodel.specloader.specimpl.FacetedMethodsBuilder.getActionFacetedMethods(FacetedMethodsBuilder.java:409)
      

      Attachments

        Activity

          People

            danhaywood Daniel Keir Haywood
            danhaywood Daniel Keir Haywood
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: