Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AnalyzerException: Unknown method org/jinq/orm/stream/scala/JinqIterator:sumBigDecimal(Lscala/Function1;)Ljava/math/BigDecimal; #4

Closed
mkotsbak opened this issue May 7, 2015 · 1 comment

Comments

@mkotsbak
Copy link

mkotsbak commented May 7, 2015

Running this code, based on the sample:

  lineorders.where(_.getSale.getCustomer.getDebt > 0)
    .group(_.getSale.getCustomer, (c: Customer, s)=> s.sumBigDecimal(_.getTotal) )
    .sortedBy(_._2)

similar to the Java code (which works):

  lineorders().where(l->l.getSale().getCustomer().getDebt() > 0)
          .group(l2 -> l2.getSale().getCustomer(), (customer, stream) -> stream.sumBigDecimal(l -> l.getTotal()))
          .sortedBy(p -> p.getTwo())

gives the following exception:

Exception in thread "main" java.lang.IllegalArgumentException: Could not analyze lambda code
at org.jinq.jpa.transform.LambdaAnalysis.fullyAnalyzeClassAsLambda(LambdaAnalysis.java:123)
at org.jinq.jpa.transform.ScalaLambdaInfo.fullyAnalyze(ScalaLambdaInfo.java:25)
at org.jinq.jpa.JPAQueryComposer.applyTransformWithLambdas(JPAQueryComposer.java:320)
at org.jinq.jpa.JinqJPAScalaIterator.groupToTuple(JinqJPAScalaIterator.scala:221)
at org.jinq.jpa.JinqJPAScalaIterator.group(JinqJPAScalaIterator.scala:226)
at SampleMain.runSampleQueries(SampleMain.scala:74)
at SampleMain$.main(SampleMain.scala:26)
at SampleMain.main(SampleMain.scala)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)
Caused by: org.objectweb.asm.tree.analysis.AnalyzerException: Unknown method org/jinq/orm/stream/scala/JinqIterator:sumBigDecimal(Lscala/Function1;)Ljava/math/BigDecimal; encountered
at ch.epfl.labos.iu.orm.queryll2.symbolic.BasicSymbolicInterpreter.naryOperation(BasicSymbolicInterpreter.java:367)
at org.objectweb.asm.tree.analysis.Frame.execute(Unknown Source)
at ch.epfl.labos.iu.orm.queryll2.path.CodePath.calculateReturnValueAndConditions(CodePath.java:148)
at ch.epfl.labos.iu.orm.queryll2.path.TransformationClassAnalyzer.analyzeMethod(TransformationClassAnalyzer.java:365)
at ch.epfl.labos.iu.orm.queryll2.path.TransformationClassAnalyzer.analyzeLambdaMethod(TransformationClassAnalyzer.java:331)
at org.jinq.jpa.transform.LambdaAnalysis.analyzeLambdaClass(LambdaAnalysis.java:238)
at org.jinq.jpa.transform.LambdaAnalysis.fullyAnalyzeClassAsLambda(LambdaAnalysis.java:113)
... 12 more

@my2iu
Copy link
Owner

my2iu commented May 7, 2015

Oops! I accidentally listed the method as returning a java.lang.BigDecimal instead of java.math.BigDecimal in the Scala version of Jinq. I've fixed it. I'll make a new release soon once I figure out if I want to make some other Scala changes too while I'm at it.

@my2iu my2iu closed this as completed May 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants