Giter Club home page Giter Club logo

Comments (4)

jamierocks avatar jamierocks commented on August 19, 2024

It will be AbstractClassMappingImpl.complete that is copying the mapping across - though I had thought it wouldn't override existing mappings.

I think that's all that's required here is just tweaking the aforementioned method to check if there is a previously existing mapping (on the plus side performance benefits too?).

cc @Minecrell as he designed the new inheritance system

from lorenz.

prplz avatar prplz commented on August 19, 2024

This is what happens:

  • On requesting the field mapping for the parent, an extra mapping gets added. Now it has f->parentField untyped and f->parentField int
  • On completing the child class, the f->parentField int field mapping gets copied over, even though the child already has f->childField untyped
  • Requesting the field mapping f int on the child returns parentField

from lorenz.

jamierocks avatar jamierocks commented on August 19, 2024

Oh I see, its an issue of lacking descriptors.

The issue is effecively with this.fields.putIfAbsent(mapping.getSignature(), mapping);, as FieldSignatures are both names and descriptors.

from lorenz.

jamierocks avatar jamierocks commented on August 19, 2024

Alright, I've given this some thought about how to proceed:

  • Check for ambiguous cases (where a parent has a typed field of the correct name, but the class has a none-typed field).
  • Mark our "synthetic" mappings (where one has been copied by a remapper), and don't copy them

I'm hesitant to act too swiftly here, as I'm concerned that any solution could have a knock-on effect and cause false-positive cases that should have been copied over - there are pros and cons of both above solutions (checking for ambiguous cases is probably the best bet though).


Though, in the mean time there is a solution - field type providers which can ensure that data is filled into the mappings during reading.

from lorenz.

Related Issues (19)

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.