Re: [cp-patches] [PATCH] Fix raw type references in AnnotationInvocationHandler

2011-10-12 Thread Dr Andrew John Hughes
On 16:26 Wed 12 Oct , Brian Jones wrote:
> On Wed, Oct 12, 2011 at 3:16 PM, Dr Andrew John Hughes
>  wrote:
> > On 12:07 Wed 12 Oct     , Ian Rogers wrote:
> >> On 12 October 2011 03:52, Mark Wielaard  wrote:
> >> > On Wed, 2011-10-12 at 10:29 +0300, Pekka Enberg wrote:
> >> >> On Wed, Oct 12, 2011 at 1:28 AM, Dr Andrew John Hughes
> >> >>  wrote:
> >> >> > If we're going to change that, it should happen after the next release
> >> >> > and with plenty of discussion / heads up for VMs.
> >> >>
> >> >> Right. I guess I could send patches for JamVM, CACAO, and Jato as
> >> >> well. Are there other VMs we care about?
> >> >
> >> > JikesRVM and GCJ of course!
> >> > Although they only use part of the VM interface at this time.
> >> > There is a somewhat full list at:
> >> > https://www.gnu.org/software/classpath/stories.html#jvm
> >> > Some of those are somewhat in "hibernation" though.
> >> > Heay, and JATO is missing...
> >
> > If we're going to do this, it needs to wait until after the next release.
> 
> When is that?
> 

I need to finish the fix for:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42390

and fix:

https://bugzilla.redhat.com/show_bug.cgi?id=712013

Then we'll have a release, if there are no objections.

Is anyone against moving the VM interfaces to 1.5 constructs post 0.99?
Or adding 1.7 classes for that matter (which was discussed earlier)?

> Brian

-- 
Andrew :)

Free Java Software Engineer
Red Hat, Inc. (http://www.redhat.com)

Support Free Java!
Contribute to GNU Classpath and IcedTea
http://www.gnu.org/software/classpath
http://icedtea.classpath.org
PGP Key: 248BDC07 (https://keys.indymedia.org/)
Fingerprint = EC5A 1F5E C0AD 1D15 8F1F  8F91 3B96 A578 248B DC07



Re: [cp-patches] [PATCH] Fix raw type references in AnnotationInvocationHandler

2011-10-12 Thread Brian Jones
On Wed, Oct 12, 2011 at 3:16 PM, Dr Andrew John Hughes
 wrote:
> On 12:07 Wed 12 Oct     , Ian Rogers wrote:
>> On 12 October 2011 03:52, Mark Wielaard  wrote:
>> > On Wed, 2011-10-12 at 10:29 +0300, Pekka Enberg wrote:
>> >> On Wed, Oct 12, 2011 at 1:28 AM, Dr Andrew John Hughes
>> >>  wrote:
>> >> > If we're going to change that, it should happen after the next release
>> >> > and with plenty of discussion / heads up for VMs.
>> >>
>> >> Right. I guess I could send patches for JamVM, CACAO, and Jato as
>> >> well. Are there other VMs we care about?
>> >
>> > JikesRVM and GCJ of course!
>> > Although they only use part of the VM interface at this time.
>> > There is a somewhat full list at:
>> > https://www.gnu.org/software/classpath/stories.html#jvm
>> > Some of those are somewhat in "hibernation" though.
>> > Heay, and JATO is missing...
>
> If we're going to do this, it needs to wait until after the next release.

When is that?

Brian



Re: [cp-patches] [PATCH] Fix raw type references in AnnotationInvocationHandler

2011-10-12 Thread Dr Andrew John Hughes
On 12:07 Wed 12 Oct , Ian Rogers wrote:
> On 12 October 2011 03:52, Mark Wielaard  wrote:
> > On Wed, 2011-10-12 at 10:29 +0300, Pekka Enberg wrote:
> >> On Wed, Oct 12, 2011 at 1:28 AM, Dr Andrew John Hughes
> >>  wrote:
> >> > If we're going to change that, it should happen after the next release
> >> > and with plenty of discussion / heads up for VMs.
> >>
> >> Right. I guess I could send patches for JamVM, CACAO, and Jato as
> >> well. Are there other VMs we care about?
> >
> > JikesRVM and GCJ of course!
> > Although they only use part of the VM interface at this time.
> > There is a somewhat full list at:
> > https://www.gnu.org/software/classpath/stories.html#jvm
> > Some of those are somewhat in "hibernation" though.
> > Heay, and JATO is missing...

If we're going to do this, it needs to wait until after the next release.
-- 
Andrew :)

Free Java Software Engineer
Red Hat, Inc. (http://www.redhat.com)

Support Free Java!
Contribute to GNU Classpath and IcedTea
http://www.gnu.org/software/classpath
http://icedtea.classpath.org
PGP Key: 248BDC07 (https://keys.indymedia.org/)
Fingerprint = EC5A 1F5E C0AD 1D15 8F1F  8F91 3B96 A578 248B DC07



Re: [cp-patches] [PATCH] Fix raw type references in AnnotationInvocationHandler

2011-10-12 Thread Ian Rogers
On 12 October 2011 03:52, Mark Wielaard  wrote:
> On Wed, 2011-10-12 at 10:29 +0300, Pekka Enberg wrote:
>> On Wed, Oct 12, 2011 at 1:28 AM, Dr Andrew John Hughes
>>  wrote:
>> > If we're going to change that, it should happen after the next release
>> > and with plenty of discussion / heads up for VMs.
>>
>> Right. I guess I could send patches for JamVM, CACAO, and Jato as
>> well. Are there other VMs we care about?
>
> JikesRVM and GCJ of course!
> Although they only use part of the VM interface at this time.
> There is a somewhat full list at:
> https://www.gnu.org/software/classpath/stories.html#jvm
> Some of those are somewhat in "hibernation" though.
> Heay, and JATO is missing...
>
> And if we are going to extend/adapt the VM interface anyway, it would
> not harm to work on the Common Virtual Machine Interface (CVMI) project
> http://icedtea.classpath.org/wiki/CVMIDiscussion
> (Heay, I can dream :)
>
> Cheers,
>
> Mark

Jikes RVM is woefully out-of-date wrt Classpath, MRP
(http://mrp.codehaus.org/) isn't :-)

Regards,
Ian



Re: [cp-patches] [PATCH] Fix raw type references in AnnotationInvocationHandler

2011-10-12 Thread Mark Wielaard
On Wed, 2011-10-12 at 10:29 +0300, Pekka Enberg wrote:
> On Wed, Oct 12, 2011 at 1:28 AM, Dr Andrew John Hughes
>  wrote:
> > If we're going to change that, it should happen after the next release
> > and with plenty of discussion / heads up for VMs.
> 
> Right. I guess I could send patches for JamVM, CACAO, and Jato as
> well. Are there other VMs we care about?

JikesRVM and GCJ of course!
Although they only use part of the VM interface at this time.
There is a somewhat full list at:
https://www.gnu.org/software/classpath/stories.html#jvm
Some of those are somewhat in "hibernation" though.
Heay, and JATO is missing...

And if we are going to extend/adapt the VM interface anyway, it would
not harm to work on the Common Virtual Machine Interface (CVMI) project
http://icedtea.classpath.org/wiki/CVMIDiscussion
(Heay, I can dream :)

Cheers,

Mark



Re: [cp-patches] [PATCH] Fix raw type references in AnnotationInvocationHandler

2011-10-12 Thread Pekka Enberg
On Wed, Oct 12, 2011 at 1:28 AM, Dr Andrew John Hughes
 wrote:
> We can't do this.  This class is part of the VM interface and the VM
> interface is meant to work with < 1.5.

Would it be OK to use @SuppressWarnings here? I'd like to make builds
less verbose.

On Wed, Oct 12, 2011 at 1:28 AM, Dr Andrew John Hughes
 wrote:
> If we're going to change that, it should happen after the next release
> and with plenty of discussion / heads up for VMs.

Right. I guess I could send patches for JamVM, CACAO, and Jato as
well. Are there other VMs we care about?

Pekka



Re: [cp-patches] [PATCH] Fix raw type references in AnnotationInvocationHandler

2011-10-11 Thread Dr Andrew John Hughes
On 00:00 Wed 12 Oct , Pekka Enberg wrote:
> This patch converts AnnotationInvoncationHandler to use parametrized types for
> Class, Map, and Iterator which kills few compilation warnings during build.
> 
> Signed-off-by: Pekka Enberg 
> ---
>  ChangeLog  |   10 ++
>  .../annotation/AnnotationInvocationHandler.java|   31 +++
>  2 files changed, 28 insertions(+), 13 deletions(-)
> 
> diff --git a/ChangeLog b/ChangeLog
> index 7f57a9e..cf728f4 100644
> --- a/ChangeLog
> +++ b/ChangeLog
> @@ -1,3 +1,13 @@
> +2011-10-11  Pekka Enberg  
> +
> + * sun/reflect/annotation/AnnotationInvocationHandler.java:
> + (AnnotationInvocationHandler): Parametrize raw types.
> + (create): Parametrize raw types.
> + (equals): Parametrize raw types.
> + (hashCode): Parametrize raw types.
> + (toString): Parametrize raw types.
> + (getBoxedReturnType): Parametrize raw types.
> +
>  2011-09-09  Andrew John Hughes  
>  
>   PR classpath/45526: Produce header files for
> diff --git a/sun/reflect/annotation/AnnotationInvocationHandler.java 
> b/sun/reflect/annotation/AnnotationInvocationHandler.java
> index 909e7ae..7d585a9 100644
> --- a/sun/reflect/annotation/AnnotationInvocationHandler.java
> +++ b/sun/reflect/annotation/AnnotationInvocationHandler.java
> @@ -62,21 +62,23 @@ public final class AnnotationInvocationHandler
>implements InvocationHandler, Serializable
>  {
>  private static final long serialVersionUID = 6182022883658399397L;
> -private final Class type;
> -private final Map memberValues;
> +private final Class type;
> +private final Map memberValues;
>  
>  /**
>   * Construct a new invocation handler for an annotation proxy.
>   * Note that the VM is responsible for filling the memberValues map
>   * with the default values of all the annotation members.
>   */
> -public AnnotationInvocationHandler(Class type, Map memberValues)
> +public AnnotationInvocationHandler(Class type,
> +   Map memberValues)
>  {
>  this.type = type;
>  this.memberValues = memberValues;
>  }
>  
> -public static Annotation create(Class type, Map memberValues)
> +public static Annotation create(Class type,
> +Map memberValues)
>  {
>for (Method m : type.getDeclaredMethods())
>  {
> @@ -106,7 +108,8 @@ public final class AnnotationInvocationHandler
>   * (can) use different representations of annotations that reuse this
>   * method.
>   */
> -public static boolean equals(Class type, Map memberValues, Object other)
> +public static boolean equals(Class type,
> + Map memberValues, Object 
> other)
>  {
>  if (type.isInstance(other))
>  {
> @@ -217,13 +220,14 @@ public final class AnnotationInvocationHandler
>   * (can) use different representations of annotations that reuse this
>   * method.
>   */
> -public static int hashCode(Class type, Map memberValues)
> +public static int hashCode(Class type,
> +   Map memberValues)
>  {
>  int h = 0;
> -Iterator iter = memberValues.keySet().iterator();
> +Iterator iter = memberValues.keySet().iterator();
>  while (iter.hasNext())
>  {
> -Object key = iter.next();
> +String key = iter.next();
>  Object val = memberValues.get(key);
>  h += deepHashCode(val) ^ 127 * key.hashCode();
>  }
> @@ -267,15 +271,16 @@ public final class AnnotationInvocationHandler
>   * (can) use different representations of annotations that reuse this
>   * method.
>   */
> -public static String toString(Class type, Map memberValues)
> +public static String toString(Class type,
> +  Map memberValues)
>  {
>  StringBuffer sb = new StringBuffer();
>  sb.append('@').append(type.getName()).append('(');
>  String sep = "";
> -Iterator iter = memberValues.keySet().iterator();
> +Iterator iter = memberValues.keySet().iterator();
>  while (iter.hasNext())
>  {
> -Object key = iter.next();
> +String key = iter.next();
>  Object val = memberValues.get(key);
>  sb.append(sep).append(key).append('=').append(deepToString(val));
>  sep = ", ";
> @@ -284,9 +289,9 @@ public final class AnnotationInvocationHandler
>  return sb.toString();
>  }
>  
> -private static Class getBoxedReturnType(Method method)
> +private static Class getBoxedReturnType(Method method)
>  {
> -Class returnType = method.getReturnType();
> +Class returnType = method.getReturnType();
>  
>  if (returnType == boolean.class)
>  return Boolean.class;
> -- 
> 1.7.6

[cp-patches] [PATCH] Fix raw type references in AnnotationInvocationHandler

2011-10-11 Thread Pekka Enberg
This patch converts AnnotationInvoncationHandler to use parametrized types for
Class, Map, and Iterator which kills few compilation warnings during build.

Signed-off-by: Pekka Enberg 
---
 ChangeLog  |   10 ++
 .../annotation/AnnotationInvocationHandler.java|   31 +++
 2 files changed, 28 insertions(+), 13 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 7f57a9e..cf728f4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2011-10-11  Pekka Enberg  
+
+   * sun/reflect/annotation/AnnotationInvocationHandler.java:
+   (AnnotationInvocationHandler): Parametrize raw types.
+   (create): Parametrize raw types.
+   (equals): Parametrize raw types.
+   (hashCode): Parametrize raw types.
+   (toString): Parametrize raw types.
+   (getBoxedReturnType): Parametrize raw types.
+
 2011-09-09  Andrew John Hughes  
 
PR classpath/45526: Produce header files for
diff --git a/sun/reflect/annotation/AnnotationInvocationHandler.java 
b/sun/reflect/annotation/AnnotationInvocationHandler.java
index 909e7ae..7d585a9 100644
--- a/sun/reflect/annotation/AnnotationInvocationHandler.java
+++ b/sun/reflect/annotation/AnnotationInvocationHandler.java
@@ -62,21 +62,23 @@ public final class AnnotationInvocationHandler
   implements InvocationHandler, Serializable
 {
 private static final long serialVersionUID = 6182022883658399397L;
-private final Class type;
-private final Map memberValues;
+private final Class type;
+private final Map memberValues;
 
 /**
  * Construct a new invocation handler for an annotation proxy.
  * Note that the VM is responsible for filling the memberValues map
  * with the default values of all the annotation members.
  */
-public AnnotationInvocationHandler(Class type, Map memberValues)
+public AnnotationInvocationHandler(Class type,
+   Map memberValues)
 {
 this.type = type;
 this.memberValues = memberValues;
 }
 
-public static Annotation create(Class type, Map memberValues)
+public static Annotation create(Class type,
+Map memberValues)
 {
   for (Method m : type.getDeclaredMethods())
 {
@@ -106,7 +108,8 @@ public final class AnnotationInvocationHandler
  * (can) use different representations of annotations that reuse this
  * method.
  */
-public static boolean equals(Class type, Map memberValues, Object other)
+public static boolean equals(Class type,
+ Map memberValues, Object 
other)
 {
 if (type.isInstance(other))
 {
@@ -217,13 +220,14 @@ public final class AnnotationInvocationHandler
  * (can) use different representations of annotations that reuse this
  * method.
  */
-public static int hashCode(Class type, Map memberValues)
+public static int hashCode(Class type,
+   Map memberValues)
 {
 int h = 0;
-Iterator iter = memberValues.keySet().iterator();
+Iterator iter = memberValues.keySet().iterator();
 while (iter.hasNext())
 {
-Object key = iter.next();
+String key = iter.next();
 Object val = memberValues.get(key);
 h += deepHashCode(val) ^ 127 * key.hashCode();
 }
@@ -267,15 +271,16 @@ public final class AnnotationInvocationHandler
  * (can) use different representations of annotations that reuse this
  * method.
  */
-public static String toString(Class type, Map memberValues)
+public static String toString(Class type,
+  Map memberValues)
 {
 StringBuffer sb = new StringBuffer();
 sb.append('@').append(type.getName()).append('(');
 String sep = "";
-Iterator iter = memberValues.keySet().iterator();
+Iterator iter = memberValues.keySet().iterator();
 while (iter.hasNext())
 {
-Object key = iter.next();
+String key = iter.next();
 Object val = memberValues.get(key);
 sb.append(sep).append(key).append('=').append(deepToString(val));
 sep = ", ";
@@ -284,9 +289,9 @@ public final class AnnotationInvocationHandler
 return sb.toString();
 }
 
-private static Class getBoxedReturnType(Method method)
+private static Class getBoxedReturnType(Method method)
 {
-Class returnType = method.getReturnType();
+Class returnType = method.getReturnType();
 
 if (returnType == boolean.class)
 return Boolean.class;
-- 
1.7.6.4