Use Advanced Search to search the entire archive.
Re: Email proposal to the core-libs-dev@openjdk.java.net
- From: Werner Keil <
>
- To: "
" <
>
- Subject: Re: Email proposal to the
- Date: Thu, 30 Oct 2014 12:06:03 +0100
Well, reprase it please, as mentioned, there are also strategic JSRs like
CDI doing it as our "prior work" does and especially Unit also does right
now.
Check out these examples:
http://www.programcreek.com/java-api-examples/index.php?api=javax.enterprise.inject.spi.InjectionPoint
Is full of cases like
Bean<?> bean=point.getBean();
if (bean != null) {
startup=bean.getBeanClass().getAnnotation(ContextName.class);
}
The code doesn't care, whether Bean is Bean<Camel> or Bean<Horse> at that
time, but calls to e.g. getBeanClass(), also completely Wildcard with
Class<?> btw, it has no relation to the <T> of the generic Bean Interface,
Information like used annotations, etc. can be retrieved.
On the API Level JSR 363 has to be equally flexible in the sense, that you
may "inject" any custom quantities, in appropriate Environments like OSGi
even dynamically at runtime, so the flexibility of Quantity<?> is in some
cases inevitable, and those who need flexible code won't care about the
type.
I'll probably ask the CDI Spec Leads why they don't consider replacing
Bean
<
http://docs.jboss.org/cdi/api/1.0/javax/enterprise/inject/spi/Bean.html><?>*getBean
<
http://docs.jboss.org/cdi/api/1.0/javax/enterprise/inject/spi/InjectionPoint.html#getBean()>*
()
with something else. The thing is, here the type can be practically
everything. And we already ensure, <?> must be at least a child of
Quantity.
If they wanted or even cared about a concrete generic type like Bean<Apple>
there could be no other way than to cast here either[?]
We have at least 2 separate issues, one is "forging" types instead of
accepting the Wildcard type like so many other APIs (like CDI)
the other one is clearly more scientific and beyond OpenJDK guys, which
would be some sort of rule set or guideline to ensure only certain result
types are allowed in a calculation.
As of now, there seems only Type Annotations for that, I'll probably run at
least the question whether some Scenarios could require such restriction by
the Science Group.
Werner
On Thu, Oct 30, 2014 at 11:32 AM, Martin Desruisseaux <
>
wrote:
>
Le 30/10/14 19:19, Werner Keil a écrit :
>
> If any, I think we should send a new one. However, asking the majority
>
> of JDK core folks about a scientific/mathematical problem (which in
>
> the end it always is) would be like asking them about EJBs or Servlets
>
>
I don't think that it is a scientific or mathematical problem. I think
>
that asking to the JDK mailing list would make clear that the proposed
>
method signature is illegal (given the intended semantic) - no matter
>
what the domain of expertise is.
>
>
Martin
>
>
Attachment:
347.gif
Description: GIF image