Comments (4)
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.
This is what happens:
- On requesting the field mapping for the parent, an extra mapping gets added. Now it has
f->parentField untyped
andf->parentField int
- On completing the child class, the
f->parentField int
field mapping gets copied over, even though the child already hasf->childField untyped
- Requesting the field mapping
f int
on the child returnsparentField
from lorenz.
Oh I see, its an issue of lacking descriptors.
The issue is effecively with this.fields.putIfAbsent(mapping.getSignature(), mapping);
, as FieldSignature
s are both names and descriptors.
from lorenz.
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)
- Gradle task `uploadArchives` is run implicitly HOT 5
- 1.0.0 Specification HOT 5
- In-memory extension data HOT 1
- Faulty canInherit calls on anonymous classes
- Kotlin DSL
- Why does parameter indexing work the way it does? HOT 3
- Merge Strategies HOT 2
- Classes with a `$` in sources have names and references unintentionally changed HOT 1
- Support blank comments in IO readers HOT 2
- XSRG Support HOT 1
- Create MappingSets from MappingSetModelFactory
- Flush isn't called on standard MappingFormats HOT 2
- Binary Formats HOT 1
- Duplicate field mappings do not repair signatures HOT 1
- Composition of incomplete mappings leads to weird behavior in `complete`
- MappingSet#deobfuscate is called twice for return types HOT 1
- AbstractClassMappingImpl.complete(...) infers wrong method name
- Project status HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lorenz.