Coder Social home page Coder Social logo

Comments (3)

pompiuses avatar pompiuses commented on July 28, 2024

This feature is very welcomed! We're currently using the tracing agent together with our test suite to automatically pick up all use of reflection (which is somewhat error prone if low test coverage). This new feature in combination with the tracing agent would eliminate all reflection related runtime errors we get. So it'd be nice if it's made to work seamlessly together.

from native-build-tools.

kristofdho avatar kristofdho commented on July 28, 2024

Looks promising. A couple questions/suggestions.

  1. Is it possible to combine filters? E.g. Only package org.example.foo from dependency org.example:bar:*?
  2. If you know you only need constructors, is it possible to only add them for an entire package?
  3. Is it possible to provide a custom filter to the plugin? A Predicate<Class> and Predicate<Executable> for example?
  4. Is it possible to still specify a "typeReachable" condition on the generated entries?

A specific use-case I have now, for which I have a Feature with a subtype reachability handler:
For all subclasses of Foo Register all methods prefixed with create* with a matching return type and parameter list.
Which is extremely specific I guess. I'd imagine specifying a custom filter class in the lines of this, which is still missing the "typeReachable" part:

class CustomFilter implements PluginFilter {
    @Override
    boolean includeClass(Class<?> clazz) {
        return Foo.class.isAssignableFrom(clazz);
    }

    @Override
    boolean includeMethod(Method method) {
        return method.getName().startsWith("create"); // + check returntype & parameter types
    }

    @Override
    boolean includeConstructor(Constructor<?> cconstructor) {
        return false;
    }

    @Override
    boolean includeField(Field field) {
        return false;
    }
}

from native-build-tools.

vjovanov avatar vjovanov commented on July 28, 2024

@kristofdho this is possible, we need to be careful not to duplicate too much of functionality. Such fine-grained adjustments can currently be done with Native Image features.

from native-build-tools.

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.