Giter Site home page Giter Site logo

Comments (9)

fluxtah avatar fluxtah commented on July 4, 2024

Sorry my bad :( my fault the generator did not generate the super type call first time round

from icepick.

pushbit avatar pushbit commented on July 4, 2024

It appears that this issue has returned in 2.3.2. My SubType$$Icicle methods are called, but the SuperType$$Icicle methods are not.

from icepick.

frankiesardo avatar frankiesardo commented on July 4, 2024

That sounds weird. For me both the sample project with superclass and the tests are fine. Can you copy/paste the generated classes? SubType$$Icicle should have a call to SuperType$$Icicle in both save and restore instance state.
Gradle > Clean your project may also help. Maybe you were using another version and the generated classes have not been updated.

from icepick.

pushbit avatar pushbit commented on July 4, 2024

I have cleaned the project and the SubType$$Icicle class is generated without calls to the SuperType$$Icicle methods. Could it be because SuperType is in an Android library project and not in the same project/package as SubType? I will try to verify this theory later today or tomorrow when I have time.

from icepick.

pushbit avatar pushbit commented on July 4, 2024

This does appear to be the issue. When SuperType and SubType are in the same project, SubType$$Icicle is generated with calls to SuperType$$Icicle. But if SuperType is moved to a library project (which SubType's project uses), then SubType$$Icicle no longer contains the calls to SuperType$$Icicle.

I have tried adding both the library jar and src/ to the annotation processor factory path, but it did not help. Any idea why the processor is not seeing SuperType in the library project?

from icepick.

frankiesardo avatar frankiesardo commented on July 4, 2024

I see. The problem is that only the annotations of one project are processed at time, so the Processor can't tell if the class inherits from an annotated parents.

A solution could be to scan all parent's fields and see if there is an @Icicle annotation and thus call the generated file, but it seems that getAnnotationMirrors is not working properly across projects. Plus, this will considerably slow down the build time.

I'll have a look at it. I'm reopening the issue in the meanwhile.

from icepick.

frankiesardo avatar frankiesardo commented on July 4, 2024

@pushbit I just pushed a 2.3.2-SNAPSHOT on Maven. This is a feature that it makes sense to support, regardless of the drop in performance. Early benchmarks shows that is at least 2x slower to walk the hierarchy asking for every field if it has an @Icicle annotation, but seems to be no other way to retrieve this information from another project. Persisting something on the filesystem can easily get out of hand.

Still, I can probably cut some slow nested loop by keeping track of unsuccessful paths.

Let me know if this fixes your issue.

from icepick.

pushbit avatar pushbit commented on July 4, 2024

2.3.3-SNAPSHOT fixes the issue and I don't notice any build slowdown, thanks!

from icepick.

frankiesardo avatar frankiesardo commented on July 4, 2024

Glad it helped. We're still talking about an order of hundreds of milliseconds, so the build should still be pretty fast. I added a log at the end of the processing that prints how long it took, if anybody notice a slow down they can share their timing.

from icepick.

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.