Coder Social home page Coder Social logo

Comments (4)

dstepanov avatar dstepanov commented on June 15, 2024

Right now, method annotations are merged with the class annotations; that's why the interceptor is created. If you don't need it, don't include annotations that require an interceptor.

from micronaut-core.

nbrugger-tgm avatar nbrugger-tgm commented on June 15, 2024

But shouldn't at least the @NotNull on BeanThatShouldHaveInterceptor create an interceptor @dstepanov

https://github.com/nbrugger-tgm/micronaut-reproductions/blob/a94c18cb23be177f89f02c63f2fcb0076482ddd4/micronaut-4-factory-regression-3/src/main/java/com/example/BeanThatShouldHaveInterceptor.java#L6

from micronaut-core.

graemerocher avatar graemerocher commented on June 15, 2024

there is a debate to be had an maybe an annotation hint could be provided whether the annotation applies to the factory method or the class. Currently they apply to the class and changing this would be a breaking change that we cannot implement. If you want a new feature then sure create a feature request to allow disambiguation.

from micronaut-core.

nbrugger-tgm avatar nbrugger-tgm commented on June 15, 2024

I mean I do not have too much of a problem with the Annotation from the factory being applied to the class (altho yes it should be documented)

But as far as I see it in the case of BeanThatShouldHaveInterceptor the missing interceptor is more a bug - because the validations set in BeanThatShouldHaveInterceptor do not apply and it's unnoticeable unless there are tests on it -> its a silent ignoring of annotations. If it is a technical limitation (annotations that are on classes constructed in Factories do not work) an error or more likely warning should appear.

Calling a @NotNull annotated method with null being possible is a bug from my point of view

from micronaut-core.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.