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