Coder Social home page Coder Social logo

Comments (7)

dmarkov avatar dmarkov commented on August 21, 2024

@carlosmiranda This task is yours, please go ahead keeping in mind this. If any questions, don't hesitate to ask right here

from jcabi-matchers.

dmarkov avatar dmarkov commented on August 21, 2024

@carlosmiranda Task's budget is 30 mins (see this for explanation)

from jcabi-matchers.

carlosmiranda avatar carlosmiranda commented on August 21, 2024

This is a limitation of the Java Generics facility. The problem is, the type of new JAXBElement<Object> and the return type of object.getClass is Class<? extends Object> are determined at compile time, while the actual class of object is known at runtime. I can't think of any way to make this compile without having to suppress warnings.

The best that can be done to my knowledge is to create a variable inside the method and move the suppression to the variable to reduce the scope of the suppression:

@SuppressWarnings("unchecked")
Class<Object> type = (Class<Object>) object.getClass();
subject = new JAXBElement<Object>(
    JaxbConverter.qname(object),
    (Class<Object>) object.getClass(),
    object
);

@yegor256 , what do you think?

from jcabi-matchers.

yegor256 avatar yegor256 commented on August 21, 2024

yes, I agree, let's do it

from jcabi-matchers.

carlosmiranda avatar carlosmiranda commented on August 21, 2024

I made a pull request in #4, please review.

from jcabi-matchers.

dmarkov avatar dmarkov commented on August 21, 2024

@carlosmiranda Thank you, I've added 30 mins to your account in payment/transaction "39063127"

from jcabi-matchers.

dmarkov avatar dmarkov commented on August 21, 2024

Closed, thanks all

from jcabi-matchers.

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.