Re: [patch] Small fix for java.beans

2003-10-24 Thread Dalibor Topic
Oops, and of course I forgot the ChangeLog entry:

2003-10-24  Dalibor Topic [EMAIL PROTECTED]

* libraries/javalib/gnu/java/beans/IntrospectionIncubator.java:
(addMethod) Add public static methods.
now, flame away ;)

cheers,
dalibor topic
Dalibor Topic wrote:
Hi all,

while merging in GNU Classpath's java.beans into kaffe, there was a 
small issue that caused a regression test in kaffe to fail: the 
Introspector wouldn't add public static methods to the BeanInfo of a 
bean, as the spec demands. The attached patch solves this problem.

cheers,
dalibor topic


Index: libraries/javalib/gnu/java/beans/IntrospectionIncubator.java
===
RCS file: /cvs/kaffe/kaffe/libraries/javalib/gnu/java/beans/IntrospectionIncubator.java,v
retrieving revision 1.2
diff -u -r1.2 IntrospectionIncubator.java
--- libraries/javalib/gnu/java/beans/IntrospectionIncubator.java	22 Oct 2003 10:34:45 -	1.2
+++ libraries/javalib/gnu/java/beans/IntrospectionIncubator.java	24 Oct 2003 13:39:29 -
@@ -67,7 +67,7 @@
 
 	/* Paving the way for automatic Introspection */
 	public void addMethod(Method method) {
-		if(Modifier.isPublic(method.getModifiers())  !Modifier.isStatic(method.getModifiers())) {
+		if(Modifier.isPublic(method.getModifiers())) {
 			String name = ClassHelper.getTruncatedName(method.getName());
 			Class retType = method.getReturnType();
 			Class[] params = method.getParameterTypes();



___
Classpath mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/classpath




___
Classpath mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/classpath


Re: [patch] Small fix for java.beans

2003-10-24 Thread Mark Wielaard
Hi,

On Fri, 2003-10-24 at 16:04, Dalibor Topic wrote:
 while merging in GNU Classpath's java.beans into kaffe, there was a 
 small issue that caused a regression test in kaffe to fail: the 
 Introspector wouldn't add public static methods to the BeanInfo of a 
 bean, as the spec demands. The attached patch solves this problem.

Thanks. Committed as follows:

2003-10-24  Dalibor Topic  [EMAIL PROTECTED]

   * gnu/java/beans/IntrospectionIncubator.java (addMethod): Add public
   static methods.

That file is really badly formatted (but was already in the Classpath
tree). If someone wants to clean that up, that would be very
appreciated.

Cheers,

Mark


signature.asc
Description: This is a digitally signed message part
___
Classpath mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/classpath


Re: [patch] Small fix for java.beans

2003-10-24 Thread Arnaud Vandyck
On Fri, 24 Oct 2003 16:21:47 +0200
Mark Wielaard [EMAIL PROTECTED] wrote:

[gnu/java/beans/IntrospectionIncubator.java]

 That file is really badly  formatted (but was already in the Classpath
 tree).  If  someone  wants  to  clean  that up,  that  would  be  very
 appreciated.

I have to learn so I can reformat this file. I'll send a patch asap ;)

-- Arnaud Vandyck, STE fi, ULg
   Formateur Cellule Programmation.


___
Classpath mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/classpath


Re: [patch] Small fix for java.beans

2003-10-24 Thread Arnaud Vandyck
On Fri, 24 Oct 2003 16:46:20 +0200 (CEST)
Arnaud Vandyck [EMAIL PROTECTED] wrote:

 On Fri, 24 Oct 2003 16:21:47 +0200
 Mark Wielaard [EMAIL PROTECTED] wrote:
 
 [gnu/java/beans/IntrospectionIncubator.java]
 
  That file is really badly  formatted (but was already in the Classpath
  tree).  If  someone  wants  to  clean  that up,  that  would  be  very
  appreciated.
 
 I have to learn so I can reformat this file. I'll send a patch asap ;)

Attached is the patch and here is the Changelog entry:
2003-10-24 Arnaud Vandyck [EMAIL PROTECTED]

* gnu/java/beans/IntrospectionIncubator.java: reformated to conform to
the GNU standards

Waiting for your comments, thanks,

-- Arnaud Vandyck, STE fi, ULg
   Formateur Cellule Programmation.
Index: IntrospectionIncubator.java
===
RCS file: /cvsroot/classpath/classpath/gnu/java/beans/IntrospectionIncubator.java,v
retrieving revision 1.11
diff -u -r1.11 IntrospectionIncubator.java
--- IntrospectionIncubator.java 24 Oct 2003 14:19:35 -  1.11
+++ IntrospectionIncubator.java 24 Oct 2003 15:16:55 -
@@ -53,303 +53,383 @@
  ** @see java.beans.BeanInfo
  **/
 
-public class IntrospectionIncubator {
-   Hashtable propertyMethods = new Hashtable();
-   Hashtable listenerMethods = new Hashtable();
-   Vector otherMethods = new Vector();
-
-   Class propertyStopClass;
-   Class eventStopClass;
-   Class methodStopClass;
-
-   public IntrospectionIncubator() {
-   }
-
-   /* Paving the way for automatic Introspection */
-   public void addMethod(Method method) {
-   if(Modifier.isPublic(method.getModifiers())) {
-   String name = ClassHelper.getTruncatedName(method.getName());
-   Class retType = method.getReturnType();
-   Class[] params = method.getParameterTypes();
-   boolean isVoid = retType.equals(java.lang.Void.TYPE);
-   Class methodClass = method.getDeclaringClass();
-   if(propertyStopClass == null || 
(propertyStopClass.isAssignableFrom(methodClass)  
!propertyStopClass.equals(methodClass))) {
-   if(name.startsWith(is)
-   retType.equals(java.lang.Boolean.TYPE)
-   params.length == 0) {
-   addToPropertyHash(name,method,IS);
-   } else if(name.startsWith(get)  !isVoid) {
-   if(params.length == 0) {
-   addToPropertyHash(name,method,GET);
-   } else if(params.length == 1  
params[0].equals(java.lang.Integer.TYPE)) {
-   addToPropertyHash(name,method,GET_I);
-   } else {
-   otherMethods.addElement(method);
-   }
-   } else if(name.startsWith(set)  isVoid) {
-   if(params.length == 1) {
-   addToPropertyHash(name,method,SET);
-   } else if(params.length == 2  
params[0].equals(java.lang.Integer.TYPE)) {
-   addToPropertyHash(name,method,SET_I);
-   } else {
-   otherMethods.addElement(method);
-   }
-   }
-   }
-   if(eventStopClass == null || 
(eventStopClass.isAssignableFrom(methodClass)  !eventStopClass.equals(methodClass))) 
{
-   if(name.startsWith(add)
-  isVoid
-  params.length == 1
-  
java.util.EventListener.class.isAssignableFrom(params[0])) {
-   addToListenerHash(name,method,ADD);
-   } else if(name.startsWith(remove)
-  isVoid
-  params.length == 1
-  
java.util.EventListener.class.isAssignableFrom(params[0])) {
-   addToListenerHash(name,method,REMOVE);
-   }
-   }
-   if(methodStopClass == null || 
(methodStopClass.isAssignableFrom(methodClass)  
!methodStopClass.equals(methodClass))) {
-   otherMethods.addElement(method);
-   }
-   }
-   }
-
-   public void addMethods(Method[] m) {
-   for(int