Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jdt-dev] ECJ bug for inner class method reference deserialization ?

Hi Gayan,
yes, that's the plan.

Regards,
Manoj

-----jdt-dev-bounces@xxxxxxxxxxx wrote: -----
To: "Eclipse JDT general developers list." <jdt-dev@xxxxxxxxxxx>
From: Gayan Perera
Sent by: jdt-dev-bounces@xxxxxxxxxxx
Date: 09/04/2020 02:18PM
Subject: [EXTERNAL] Re: [jdt-dev] ECJ bug for inner class method reference deserialization ?

Hi Manoj,

I came across with the same issue in one my projects as well. Is there any plan to fix this in next 4.18 release ?

Best regards,
Gayan

On Tue, 18 Aug 2020 at 13:13, Manoj Palat <manoj.palat@xxxxxxxxxx> wrote:
@Laurent: I was able to reproduce the issue with the code you pointed to. Thanks!

ecj emits newInvokeSpecial()[const - 8] in bootstrap as is evident from your report as well as from the generated class files while javac sticks to InvokeSpecial. Though this itself is not an issue, need to probe further to figure out the missed param for invoke.



Regards,

Manoj







-----jdt-dev-bounces@xxxxxxxxxxx wrote: -----

To: "Eclipse JDT general developers list." <jdt-dev@xxxxxxxxxxx>

From: "Manoj Palat"

Sent by: jdt-dev-bounces@xxxxxxxxxxx

Date: 08/18/2020 10:11AM

Subject: [EXTERNAL] Re: [jdt-dev] ECJ bug for inner class method reference deserialization ?



Hi,

Can you please file a bug under JDT, ie https://bugs.eclipse.org/bugs/enter_bug.cgi?product=JDT - the component is Core. One of us will take a look.



Regards,

Manoj



-----jdt-dev-bounces@xxxxxxxxxxx wrote: -----

To: jdt-dev@xxxxxxxxxxx

From: Laurent Almeras

Sent by: jdt-dev-bounces@xxxxxxxxxxx

Date: 08/17/2020 10:08PM

Subject: [EXTERNAL] [jdt-dev] ECJ bug for inner class method reference deserialization ?



Hi,

I search some insight to confirm an issue with ECJ.

I create a minimal use-case (two classes, ~20 lines) here : https://github.com/igloo-project/issue-lambda-serialization

The issue I encounter is that if I use method reference notation (ClassName::new) as a Supplier<ClassName>, this lambda triggers a deserialization issue. If I use an inlined expression - () -> new ClassName() - it works as expected. This error is triggered only if code is compiled by Eclipse. The same code, launched with mvn clean test or mvn clean exec:java does not trigger an error.

The not-expected stacktrace is :

Exception in thread "main" java.io.IOException: unexpected exception type

    at java.base/java.io.ObjectStreamClass.throwMiscException(ObjectStreamClass.java:1641)

    at java.base/java.io.ObjectStreamClass.invokeReadResolve(ObjectStreamClass.java:1271)

    at java.base/java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2153)

    at java.base/java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1646)

    at java.base/java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2412)

    at java.base/java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2306)

    at java.base/java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2144)

    at java.base/java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1646)

    at java.base/java.io.ObjectInputStream.readObject(ObjectInputStream.java:464)

    at java.base/java.io.ObjectInputStream.readObject(ObjectInputStream.java:422)

    at lambda.MySerializer.serializeAndDeserialize(MySerializer.java:33)

    at lambda.MySerializer.main(MySerializer.java:17)

Caused by: java.lang.reflect.InvocationTargetException

    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

    at java.base/java.lang.reflect.Method.invoke(Method.java:566)

    at java.base/java.lang.invoke.SerializedLambda.readResolve(SerializedLambda.java:237)

    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

    at java.base/java.lang.reflect.Method.invoke(Method.java:566)

    at java.base/java.io.ObjectStreamClass.invokeReadResolve(ObjectStreamClass.java:1265)

    ... 10 more

Caused by: java.lang.BootstrapMethodError: bootstrap method initialization exception

    at java.base/java.lang.invoke.BootstrapMethodInvoker.invoke(BootstrapMethodInvoker.java:194)

    at java.base/java.lang.invoke.CallSite.makeSite(CallSite.java:307)

    at java.base/java.lang.invoke.MethodHandleNatives.linkCallSiteImpl(MethodHandleNatives.java:258)

    at java.base/java.lang.invoke.MethodHandleNatives.linkCallSite(MethodHandleNatives.java:248)

    at lambda.MyOuterClass.$deserializeLambda$(MyOuterClass.java:1)

    ... 20 more

Caused by: java.lang.invoke.LambdaConversionException: Incorrect number of parameters for static method newInvokeSpecial lambda.MyOuterClass$MyInnerClass.<init>:(MyOuterClass)void; 0 captured parameters, 0 functional interface method parameters, 1 implementation parameters

    at java.base/java.lang.invoke.AbstractValidatingLambdaMetafactory.validateMetafactoryArgs(AbstractValidatingLambdaMetafactory.java:214)

    at java.base/java.lang.invoke.LambdaMetafactory.altMetafactory(LambdaMetafactory.java:503)

    at java.base/java.lang.invoke.BootstrapMethodInvoker.invoke(BootstrapMethodInvoker.java:138)

    ... 24 more



This commit contains all the remaining information about the issue (commands, class names, ...) : https://github.com/igloo-project/issue-lambda-serialization/commit/7b18c2d48833e7e1507115dd778ca1c3f40fd035

I do not find any bug that matches this issue in Eclipse Bugzilla (https://bugs.eclipse.org/bugs/buglist.cgi?bug_status=__open__&content=LambdaConversionException&no_redirect=1&order=Importance&query_format=specific returns 4 other bugs ; the only one that could be linked from my opinion is https://bugs.eclipse.org/bugs/show_bug.cgi?id=565787, but it is not serialization-related).

Anyone can confirm my issue with my minimal test-case ? Where this issue should be created ? Product JDT, Component Core ?





Thanks for you insight,





--

Laurent Almeras









_______________________________________________

jdt-dev mailing list

jdt-dev@xxxxxxxxxxx

To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/jdt-dev



_______________________________________________

jdt-dev mailing list

jdt-dev@xxxxxxxxxxx

To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/jdt-dev





_______________________________________________

jdt-dev mailing list

jdt-dev@xxxxxxxxxxx

To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/jdt-dev


_______________________________________________
jdt-dev mailing list
jdt-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/jdt-dev



Back to the top