From emijiang6 at googlemail.com Wed Oct 21 05:02:22 2015 From: emijiang6 at googlemail.com (Emily Jiang) Date: Wed, 21 Oct 2015 10:02:22 +0100 Subject: [weld-dev] javax.el.ExpressionFactory has final methods! CDI doesn't allow that Message-ID: CDI specification does not allow proxying a class with non-private final methods. The java.util.Hashtable class has a non-private final method added to the class in later versions of Java, so a CDI application that previously worked may break when updating the Java level. This issue was logged in CDI-527. OpenWebBeans fixed this via the jira (https://issues.apache.org/jira/browse/OWB-616). Can Weld fix this in the 2.3 or 2.2 trunk? -- Thanks Emily ================= Emily Jiang ejiang at apache.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/weld-dev/attachments/20151021/3bfe7575/attachment.html From mkouba at redhat.com Wed Oct 21 06:50:18 2015 From: mkouba at redhat.com (Martin Kouba) Date: Wed, 21 Oct 2015 12:50:18 +0200 Subject: [weld-dev] javax.el.ExpressionFactory has final methods! CDI doesn't allow that In-Reply-To: References: Message-ID: <56276DEA.3060206@redhat.com> Hi Emily, commments inline. Dne 21.10.2015 v 11:02 Emily Jiang napsal(a): > CDI specification does not allow proxying a class with non-private final > methods. The java.util.Hashtable class has a > non-private final method added to the class in later versions > of Java, so a CDI application that previously worked may break > when updating the Java level. Just for the record: what's the name of the method? > > This issue was logged in CDI-527. > > OpenWebBeans fixed this via the jira (https://issues.apache.org/jira/browse/OWB-616). OWB-616 does not fix CDI-527 but CDI-159, i.e. a private final method does not cause a deployment problem. This works in Weld too. On the other hand, CDI-527 is still an open issue so we can't simply fix it. In theory, we could add a new feature of a non-portable mode. But non-portable mode is not intended to be commonly used. It's kind of a workaround. > > Can Weld fix this in the 2.3 or 2.2 trunk? > > > -- > Thanks > Emily > ================= > Emily Jiang > ejiang at apache.org > > > _______________________________________________ > weld-dev mailing list > weld-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/weld-dev > -- Martin Kouba Software Engineer Red Hat, Czech Republic From emijiang6 at googlemail.com Wed Oct 21 07:20:03 2015 From: emijiang6 at googlemail.com (Emily Jiang) Date: Wed, 21 Oct 2015 12:20:03 +0100 Subject: [weld-dev] javax.el.ExpressionFactory has final methods! CDI doesn't allow that In-Reply-To: <56276DEA.3060206@redhat.com> References: <56276DEA.3060206@redhat.com> Message-ID: Thanks Martin! The new final method on the Hashtable is final boolean initHashSeedAsNeeded(int capacity) The change went as part of the following bug fix: [1] http://bugs.java.com/bugdatabase/view_bug.do?bug_id=8006593 As for the OWB-616 jira, I did not look at the actual fix, but I assume the fix by the following comments. I might be wrong here. Mark Struberg added a comment - 01/Oct/11 19:12 I now changed the checks to allow private final and public/protected static final methods. Thanks Emily On Wed, Oct 21, 2015 at 11:50 AM, Martin Kouba wrote: > Hi Emily, > > commments inline. > > Dne 21.10.2015 v 11:02 Emily Jiang napsal(a): > >> CDI specification does not allow proxying a class with non-private final >> methods. The java.util.Hashtable class has a >> non-private final method added to the class in later versions >> of Java, so a CDI application that previously worked may break >> when updating the Java level. >> > > Just for the record: what's the name of the method? > > >> This issue was logged in CDI-527. >> >> OpenWebBeans fixed this via the jira ( >> https://issues.apache.org/jira/browse/OWB-616). >> > > OWB-616 does not fix CDI-527 but CDI-159, i.e. a private final method does > not cause a deployment problem. This works in Weld too. On the other hand, > CDI-527 is still an open issue so we can't simply fix it. In theory, we > could add a new feature of a non-portable mode. But non-portable mode is > not intended to be commonly used. It's kind of a workaround. > > >> Can Weld fix this in the 2.3 or 2.2 trunk? >> >> >> -- >> Thanks >> Emily >> ================= >> Emily Jiang >> ejiang at apache.org >> >> >> _______________________________________________ >> weld-dev mailing list >> weld-dev at lists.jboss.org >> https://lists.jboss.org/mailman/listinfo/weld-dev >> >> > -- > Martin Kouba > Software Engineer > Red Hat, Czech Republic > -- Thanks Emily ================= Emily Jiang ejiang at apache.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/weld-dev/attachments/20151021/5049a61a/attachment.html From mkouba at redhat.com Wed Oct 21 07:38:21 2015 From: mkouba at redhat.com (Martin Kouba) Date: Wed, 21 Oct 2015 13:38:21 +0200 Subject: [weld-dev] javax.el.ExpressionFactory has final methods! CDI doesn't allow that In-Reply-To: References: <56276DEA.3060206@redhat.com> Message-ID: <5627792D.8000102@redhat.com> Dne 21.10.2015 v 13:20 Emily Jiang napsal(a): > Thanks Martin! > The new final method on the Hashtable is > > final boolean initHashSeedAsNeeded(int capacity) I see. This package-private method was added in JDK7. > > The change went as part of the following bug fix: > > [1] http://bugs.java.com/bugdatabase/view_bug.do?bug_id=8006593 > > As for the OWB-616 jira, I did not look at the actual fix, but I assume > the fix by the following comments. I might be wrong here. > > > Mark Struberg > > added a comment - 01/Oct/11 19:12 > > I now changed the checks to allow private final and public/protected > static final methods. Mark does not talk about non-static package-private methods, right? He talks about private final and public/protected static final => should work in Weld too. If non-static package-private methods are allowed than the spec is violated. Unfortunately, it seems there's no tck test for this. > > > Thanks > > Emily > > > On Wed, Oct 21, 2015 at 11:50 AM, Martin Kouba > wrote: > > Hi Emily, > > commments inline. > > Dne 21.10.2015 v 11:02 Emily Jiang napsal(a): > > CDI specification does not allow proxying a class with > non-private final > methods. The java.util.Hashtable class has a > non-private final method added to the class in later versions > of Java, so a CDI application that previously worked may break > when updating the Java level. > > > Just for the record: what's the name of the method? > > > This issue was logged in CDI-527. > > OpenWebBeans fixed this via the jira > (https://issues.apache.org/jira/browse/OWB-616). > > > OWB-616 does not fix CDI-527 but CDI-159, i.e. a private final > method does not cause a deployment problem. This works in Weld too. > On the other hand, CDI-527 is still an open issue so we can't simply > fix it. In theory, we could add a new feature of a non-portable > mode. But non-portable mode is not intended to be commonly used. > It's kind of a workaround. > > > Can Weld fix this in the 2.3 or 2.2 trunk? > > > -- > Thanks > Emily > ================= > Emily Jiang > ejiang at apache.org > > > > > _______________________________________________ > weld-dev mailing list > weld-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/weld-dev > > > -- > Martin Kouba > Software Engineer > Red Hat, Czech Republic > > > > > -- > Thanks > Emily > ================= > Emily Jiang > ejiang at apache.org -- Martin Kouba Software Engineer Red Hat, Czech Republic From emijiang6 at googlemail.com Wed Oct 21 07:54:20 2015 From: emijiang6 at googlemail.com (Emily Jiang) Date: Wed, 21 Oct 2015 12:54:20 +0100 Subject: [weld-dev] javax.el.ExpressionFactory has final methods! CDI doesn't allow that In-Reply-To: <5627792D.8000102@redhat.com> References: <56276DEA.3060206@redhat.com> <5627792D.8000102@redhat.com> Message-ID: doh. You were right that the OWB-616 was for a different issue rather than the one I am interested. Do you have any suggestions about working around the unproxiable Hashtable issue? On Wed, Oct 21, 2015 at 12:38 PM, Martin Kouba wrote: > Dne 21.10.2015 v 13:20 Emily Jiang napsal(a): > >> Thanks Martin! >> The new final method on the Hashtable is >> >> final boolean initHashSeedAsNeeded(int capacity) >> > > I see. This package-private method was added in JDK7. > > >> The change went as part of the following bug fix: >> >> [1] http://bugs.java.com/bugdatabase/view_bug.do?bug_id=8006593 >> >> As for the OWB-616 jira, I did not look at the actual fix, but I assume >> the fix by the following comments. I might be wrong here. >> >> >> Mark Struberg >> >> added a comment - 01/Oct/11 19:12 >> >> I now changed the checks to allow private final and public/protected >> static final methods. >> > > Mark does not talk about non-static package-private methods, right? He > talks about private final and public/protected static final => should work > in Weld too. > > If non-static package-private methods are allowed than the spec is > violated. Unfortunately, it seems there's no tck test for this. > > >> >> Thanks >> >> Emily >> >> >> On Wed, Oct 21, 2015 at 11:50 AM, Martin Kouba > > wrote: >> >> Hi Emily, >> >> commments inline. >> >> Dne 21.10.2015 v 11:02 Emily Jiang napsal(a): >> >> CDI specification does not allow proxying a class with >> non-private final >> methods. The java.util.Hashtable class has a >> non-private final method added to the class in later versions >> of Java, so a CDI application that previously worked may break >> when updating the Java level. >> >> >> Just for the record: what's the name of the method? >> >> >> This issue was logged in CDI-527. >> >> OpenWebBeans fixed this via the jira >> (https://issues.apache.org/jira/browse/OWB-616). >> >> >> OWB-616 does not fix CDI-527 but CDI-159, i.e. a private final >> method does not cause a deployment problem. This works in Weld too. >> On the other hand, CDI-527 is still an open issue so we can't simply >> fix it. In theory, we could add a new feature of a non-portable >> mode. But non-portable mode is not intended to be commonly used. >> It's kind of a workaround. >> >> >> Can Weld fix this in the 2.3 or 2.2 trunk? >> >> >> -- >> Thanks >> Emily >> ================= >> Emily Jiang >> ejiang at apache.org >> > >> >> >> _______________________________________________ >> weld-dev mailing list >> weld-dev at lists.jboss.org >> https://lists.jboss.org/mailman/listinfo/weld-dev >> >> >> -- >> Martin Kouba >> Software Engineer >> Red Hat, Czech Republic >> >> >> >> >> -- >> Thanks >> Emily >> ================= >> Emily Jiang >> ejiang at apache.org >> > > -- > Martin Kouba > Software Engineer > Red Hat, Czech Republic > -- Thanks Emily ================= Emily Jiang ejiang at apache.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/weld-dev/attachments/20151021/b86e4039/attachment-0001.html From mkouba at redhat.com Wed Oct 21 09:57:42 2015 From: mkouba at redhat.com (Martin Kouba) Date: Wed, 21 Oct 2015 15:57:42 +0200 Subject: [weld-dev] javax.el.ExpressionFactory has final methods! CDI doesn't allow that In-Reply-To: References: <56276DEA.3060206@redhat.com> <5627792D.8000102@redhat.com> Message-ID: <562799D6.8060908@redhat.com> Dne 21.10.2015 v 13:54 Emily Jiang napsal(a): > doh. You were right that the OWB-616 was for a different issue rather > than the one I am interested. > > Do you have any suggestions about working around the unproxiable > Hashtable issue? Well, the spec only requires the injection points to be validated, or rather the required bean types to be proxyable. So if you inject/use Map interface instead of Hashtable, the validation should pass. > > On Wed, Oct 21, 2015 at 12:38 PM, Martin Kouba > wrote: > > Dne 21.10.2015 v 13:20 Emily Jiang napsal(a): > > Thanks Martin! > The new final method on the Hashtable is > > final boolean initHashSeedAsNeeded(int capacity) > > > I see. This package-private method was added in JDK7. > > > The change went as part of the following bug fix: > > [1] http://bugs.java.com/bugdatabase/view_bug.do?bug_id=8006593 > > As for the OWB-616 jira, I did not look at the actual fix, but I > assume > the fix by the following comments. I might be wrong here. > > > Mark Struberg > > added a comment - 01/Oct/11 19:12 > > I now changed the checks to allow private final and public/protected > static final methods. > > > Mark does not talk about non-static package-private methods, right? > He talks about private final and public/protected static final => > should work in Weld too. > > If non-static package-private methods are allowed than the spec is > violated. Unfortunately, it seems there's no tck test for this. > > > > Thanks > > Emily > > > On Wed, Oct 21, 2015 at 11:50 AM, Martin Kouba > > >> wrote: > > Hi Emily, > > commments inline. > > Dne 21.10.2015 v 11:02 Emily Jiang napsal(a): > > CDI specification does not allow proxying a class with > non-private final > methods. The java.util.Hashtable class has a > non-private final method added to the class in later > versions > of Java, so a CDI application that previously worked > may break > when updating the Java level. > > > Just for the record: what's the name of the method? > > > This issue was logged in CDI-527. > > OpenWebBeans fixed this via the jira > (https://issues.apache.org/jira/browse/OWB-616). > > > OWB-616 does not fix CDI-527 but CDI-159, i.e. a private final > method does not cause a deployment problem. This works in > Weld too. > On the other hand, CDI-527 is still an open issue so we > can't simply > fix it. In theory, we could add a new feature of a non-portable > mode. But non-portable mode is not intended to be commonly > used. > It's kind of a workaround. > > > Can Weld fix this in the 2.3 or 2.2 trunk? > > > -- > Thanks > Emily > ================= > Emily Jiang > ejiang at apache.org > > > > >> > > > _______________________________________________ > weld-dev mailing list > weld-dev at lists.jboss.org > > > https://lists.jboss.org/mailman/listinfo/weld-dev > > > -- > Martin Kouba > Software Engineer > Red Hat, Czech Republic > > > > > -- > Thanks > Emily > ================= > Emily Jiang > ejiang at apache.org > > > > > -- > Martin Kouba > Software Engineer > Red Hat, Czech Republic > > > > > -- > Thanks > Emily > ================= > Emily Jiang > ejiang at apache.org -- Martin Kouba Software Engineer Red Hat, Czech Republic From emijiang6 at googlemail.com Wed Oct 21 18:28:45 2015 From: emijiang6 at googlemail.com (Emily Jiang) Date: Wed, 21 Oct 2015 23:28:45 +0100 Subject: [weld-dev] javax.el.ExpressionFactory has final methods! CDI doesn't allow that In-Reply-To: <562799D6.8060908@redhat.com> References: <56276DEA.3060206@redhat.com> <5627792D.8000102@redhat.com> <562799D6.8060908@redhat.com> Message-ID: What about legacy applications running on new JDK7? The only workaround is that the customers have to update the app. Otherwise, their app won't start. This is not nice. On Wed, Oct 21, 2015 at 2:57 PM, Martin Kouba wrote: > Dne 21.10.2015 v 13:54 Emily Jiang napsal(a): > >> doh. You were right that the OWB-616 was for a different issue rather >> than the one I am interested. >> >> Do you have any suggestions about working around the unproxiable >> Hashtable issue? >> > > Well, the spec only requires the injection points to be validated, or > rather the required bean types to be proxyable. So if you inject/use Map > interface instead of Hashtable, the validation should pass. > > >> On Wed, Oct 21, 2015 at 12:38 PM, Martin Kouba > > wrote: >> >> Dne 21.10.2015 v 13:20 Emily Jiang napsal(a): >> >> Thanks Martin! >> The new final method on the Hashtable is >> >> final boolean initHashSeedAsNeeded(int capacity) >> >> >> I see. This package-private method was added in JDK7. >> >> >> The change went as part of the following bug fix: >> >> [1] http://bugs.java.com/bugdatabase/view_bug.do?bug_id=8006593 >> >> As for the OWB-616 jira, I did not look at the actual fix, but I >> assume >> the fix by the following comments. I might be wrong here. >> >> >> Mark Struberg >> < >> https://issues.apache.org/jira/secure/ViewProfile.jspa?name=struberg> >> added a comment - 01/Oct/11 19:12 >> >> I now changed the checks to allow private final and >> public/protected >> static final methods. >> >> >> Mark does not talk about non-static package-private methods, right? >> He talks about private final and public/protected static final => >> should work in Weld too. >> >> If non-static package-private methods are allowed than the spec is >> violated. Unfortunately, it seems there's no tck test for this. >> >> >> >> Thanks >> >> Emily >> >> >> On Wed, Oct 21, 2015 at 11:50 AM, Martin Kouba >> >> >> wrote: >> >> Hi Emily, >> >> commments inline. >> >> Dne 21.10.2015 v 11:02 Emily Jiang napsal(a): >> >> CDI specification does not allow proxying a class with >> non-private final >> methods. The java.util.Hashtable class has a >> non-private final method added to the class in later >> versions >> of Java, so a CDI application that previously worked >> may break >> when updating the Java level. >> >> >> Just for the record: what's the name of the method? >> >> >> This issue was logged in CDI-527. >> >> OpenWebBeans fixed this via the jira >> (https://issues.apache.org/jira/browse/OWB-616). >> >> >> OWB-616 does not fix CDI-527 but CDI-159, i.e. a private >> final >> method does not cause a deployment problem. This works in >> Weld too. >> On the other hand, CDI-527 is still an open issue so we >> can't simply >> fix it. In theory, we could add a new feature of a >> non-portable >> mode. But non-portable mode is not intended to be commonly >> used. >> It's kind of a workaround. >> >> >> Can Weld fix this in the 2.3 or 2.2 trunk? >> >> >> -- >> Thanks >> Emily >> ================= >> Emily Jiang >> ejiang at apache.org >> > >> >> >> >> >> >> _______________________________________________ >> weld-dev mailing list >> weld-dev at lists.jboss.org >> > >> >> https://lists.jboss.org/mailman/listinfo/weld-dev >> >> >> -- >> Martin Kouba >> Software Engineer >> Red Hat, Czech Republic >> >> >> >> >> -- >> Thanks >> Emily >> ================= >> Emily Jiang >> ejiang at apache.org >> > >> >> >> -- >> Martin Kouba >> Software Engineer >> Red Hat, Czech Republic >> >> >> >> >> -- >> Thanks >> Emily >> ================= >> Emily Jiang >> ejiang at apache.org >> > > -- > Martin Kouba > Software Engineer > Red Hat, Czech Republic > -- Thanks Emily ================= Emily Jiang ejiang at apache.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/weld-dev/attachments/20151021/67ee380a/attachment.html From mkouba at redhat.com Thu Oct 22 02:22:43 2015 From: mkouba at redhat.com (Martin Kouba) Date: Thu, 22 Oct 2015 08:22:43 +0200 Subject: [weld-dev] javax.el.ExpressionFactory has final methods! CDI doesn't allow that In-Reply-To: References: <56276DEA.3060206@redhat.com> <5627792D.8000102@redhat.com> <562799D6.8060908@redhat.com> Message-ID: <562880B3.7030207@redhat.com> Well, might not be nice but we cannot guarantee backward compatibility for such cases. CDI defines a contract. If you break the contract then the deployment fails. If we allow to break the contract then the contract is useless and we could allow anything... Anyway what's the use case here? Is there a normal-scoped producer? I believe that having such a producer for a third-party type other than interface is not a good practice. Is there a normal-scoped bean class extending Hashtable? Not a good practice either. If so, the bean author should reduce the bean types by means of @Typed and allow the bean clients to only work with interfaces. Martin Dne 22.10.2015 v 00:28 Emily Jiang napsal(a): > What about legacy applications running on new JDK7? The only workaround > is that the customers have to update the app. Otherwise, their app won't > start. This is not nice. > > On Wed, Oct 21, 2015 at 2:57 PM, Martin Kouba > wrote: > > Dne 21.10.2015 v 13:54 Emily Jiang napsal(a): > > doh. You were right that the OWB-616 was for a different issue > rather > than the one I am interested. > > Do you have any suggestions about working around the unproxiable > Hashtable issue? > > > Well, the spec only requires the injection points to be validated, > or rather the required bean types to be proxyable. So if you > inject/use Map interface instead of Hashtable, the validation should > pass. > > > On Wed, Oct 21, 2015 at 12:38 PM, Martin Kouba > > >> wrote: > > Dne 21.10.2015 v 13:20 Emily Jiang napsal(a): > > Thanks Martin! > The new final method on the Hashtable is > > final boolean initHashSeedAsNeeded(int capacity) > > > I see. This package-private method was added in JDK7. > > > The change went as part of the following bug fix: > > [1] > http://bugs.java.com/bugdatabase/view_bug.do?bug_id=8006593 > > As for the OWB-616 jira, I did not look at the actual > fix, but I > assume > the fix by the following comments. I might be wrong here. > > > Mark Struberg > > > added a comment - 01/Oct/11 19:12 > > I now changed the checks to allow private final and > public/protected > static final methods. > > > Mark does not talk about non-static package-private > methods, right? > He talks about private final and public/protected static > final => > should work in Weld too. > > If non-static package-private methods are allowed than the > spec is > violated. Unfortunately, it seems there's no tck test for this. > > > > Thanks > > Emily > > > On Wed, Oct 21, 2015 at 11:50 AM, Martin Kouba > > > > > >>> wrote: > > Hi Emily, > > commments inline. > > Dne 21.10.2015 v 11:02 Emily Jiang napsal(a): > > CDI specification does not allow proxying a > class with > non-private final > methods. The java.util.Hashtable class has a > non-private final method added to the class in > later > versions > of Java, so a CDI application that previously > worked > may break > when updating the Java level. > > > Just for the record: what's the name of the method? > > > This issue was logged in CDI-527. > > OpenWebBeans fixed this via the jira > (https://issues.apache.org/jira/browse/OWB-616). > > > OWB-616 does not fix CDI-527 but CDI-159, i.e. a > private final > method does not cause a deployment problem. This > works in > Weld too. > On the other hand, CDI-527 is still an open issue > so we > can't simply > fix it. In theory, we could add a new feature of a > non-portable > mode. But non-portable mode is not intended to be > commonly > used. > It's kind of a workaround. > > > Can Weld fix this in the 2.3 or 2.2 trunk? > > > -- > Thanks > Emily > ================= > Emily Jiang > ejiang at apache.org > > > > >> > > > > >>> > > > _______________________________________________ > weld-dev mailing list > weld-dev at lists.jboss.org > > > > >> > https://lists.jboss.org/mailman/listinfo/weld-dev > > > -- > Martin Kouba > Software Engineer > Red Hat, Czech Republic > > > > > -- > Thanks > Emily > ================= > Emily Jiang > ejiang at apache.org > > > > >> > > > -- > Martin Kouba > Software Engineer > Red Hat, Czech Republic > > > > > -- > Thanks > Emily > ================= > Emily Jiang > ejiang at apache.org > > > > > -- > Martin Kouba > Software Engineer > Red Hat, Czech Republic > > > > > -- > Thanks > Emily > ================= > Emily Jiang > ejiang at apache.org -- Martin Kouba Software Engineer Red Hat, Czech Republic