Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-603

Injecting a reference to a bean which is of a final class fails

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.2.6
    • 1.3.0-beta2
    • wicket-spring
    • None

    Description

      When using the @SpringBean annotation, injecting a bean that is of a final class such as String, fails. This is because LazyInitProxyFactory tries to create a subclass of the bean which will obviously fail when that class is marked final.

      A possible fix would be to test the modifiers of the injected field for Modifier.isFinal(..), when this is true don't create a proxy but return the object directly.

      Attachments

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            almaw Alastair Maw
            wensveen Matthijs Wensveen
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment