Git Product home page Git Product logo

Comments (4)

GoogleCodeExporter avatar GoogleCodeExporter commented on August 15, 2024
We found that changing the RatingType enum in the test class to a class fixes 
it. So problem might be related to handling the enums. 

Original comment by nvenky on 1 Oct 2010 at 1:38

from lambdaj.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 15, 2024
I am sorry, but there is no way I can fix this. As you can read here:

http://code.google.com/p/lambdaj/wiki/KnownLimitations

this is a well known limitation of lambdaj. Unfortunately in Java final classes 
are by definition not extensible and then not proxable. And enum are final by 
definition as well. That's why you experienced that you "fixed" the problem by 
converting the enum in a normal class. For the same reason I can say I am sure 
this particular use case never worked in any lambdaj version. If you found it 
sometimes worked it cannot be no more than a lucky coincidence.

Original comment by [email protected] on 1 Oct 2010 at 9:47

  • Changed state: WontFix

from lambdaj.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 15, 2024
Thanks for your response and that explains few things.

But, when I looked on the net for "Unable to convert the placeholder" it takes 
me to Defect #33, which was related to race condition and we have faced the 
same issue in our project as well. Upgrading Lambdaj to 2.3.1 actually fixed 
it. When I encountered this issue again, I immediately thought this is one of 
such cases that was not handled.

It will be great if we could get detailed error message on this case so that 
others don't get misguided as I did.

Thanks,
Venky.

Original comment by nvenky on 1 Oct 2010 at 11:16

from lambdaj.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 15, 2024
Sorry again, but I am afraid that also to give a more detailed error message is 
not feasible. Let me explain why quickly. When you invoke the on() method on a 
given class a proxy extending that class (or implementing that interface) is 
created. Then every time you invoke a method on that proxy, the invocation is 
registered and another proxy, with the same characteristic of the former one, 
but implementing the type returned by the invoked method is created. This chain 
of proxy get broken when you hit a final class (or an enum as in your example) 
because I cannot create a proxy for it (damn Java). In that case a plain 
instance of that class is returned and it acts as a placeholder that I can bind 
to the invocations sequence. But this instance, not being a proxy, is totally 
outside my control, so if you invoke another method on it, the result is 
completely not deterministic under my point of view. In other words this last 
invocation must be avoided but I have no way enforce that, so it is up to the 
lambdaj user to avoid it. In the end, what you experienced is that lambdaj 
cannot convert that placeholder (the object returned by the method invoked on 
the enum) in an invocations sequence and this is the only type of error I can 
report.

I hope this makes sense, but if you have any further doubt about it feel free 
to email me. The same applies if you have any suggestion to improve the 
lambdaj's behavior in this particular case.

P.S.: if you or your colleagues are using lambdaj and you find it useful, it 
should be great if you could leave a couple of sentences about your experience 
here:

http://code.google.com/p/lambdaj/wiki/WhoIsUsingLambdaj

Original comment by [email protected] on 2 Oct 2010 at 1:20

from lambdaj.

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.