VerifyError (original) (raw)
Richard Warburton richard.warburton at gmail.com
Sun Apr 21 01:12:46 PDT 2013
- Previous message: VerifyError
- Next message: hg: lambda/lambda/jdk: Spec update for Arrays methods in prep for JDK-8012650 push
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
It's a compiler issue, in the following expression, the lambda used as parameter of flatMap is not able to create CoBuy::new correctly
// product id -> product id -> frequency purchased together Map<Integer, Map<Integer, Long>> productSimilarity = buysByUser.values() .stream() .flatMap(buys -> zip(buys.stream(), buys.stream(), CoBuy::new)) .collect(groupingBy(coBuy -> coBuy.x, groupingBy(coBuy -> coBuy.y, TreeMap::new, counting()))); so the bug is here: buys -> zip(buys.stream(), buys.stream(), CoBuy::new) CoBuy is declared as a non static inner class (BTW, Richard, I think you forget to declare it static) so it capture 'this' which is an instance of Java8Recommender.
Makes perfect sense, and making CoBuy static fixes the problem.
regards,
Richard Warburton
http://insightfullogic.com @RichardWarburto <http://twitter.com/richardwarburto>
- Previous message: VerifyError
- Next message: hg: lambda/lambda/jdk: Spec update for Arrays methods in prep for JDK-8012650 push
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]