[Patch] gnu.java.beans.ExplicitBeanInfo

Michael Koch konqueror@gmx.de
Sat Oct 16 17:49:00 GMT 2004


Hi list,


I just merged the attach from GNU classpath.


Michael


2004-10-16  Michael Koch  <konqueror@gmx.de>

	* gnu/java/beans/ExplicitBeanInfo.java:
	Explicitely import java.awt.Image.
	(getIcon): Fixed off-by-one error.

-------------- next part --------------
Index: gnu/java/beans/ExplicitBeanInfo.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/gnu/java/beans/ExplicitBeanInfo.java,v
retrieving revision 1.3
diff -u -r1.3 ExplicitBeanInfo.java
--- gnu/java/beans/ExplicitBeanInfo.java	29 Jul 2004 08:59:38 -0000	1.3
+++ gnu/java/beans/ExplicitBeanInfo.java	16 Oct 2004 17:48:44 -0000
@@ -1,5 +1,5 @@
-/* gnu.java.beans.ExplicitBeanInfo
-   Copyright (C) 1998 Free Software Foundation, Inc.
+/* ExplicitBeanInfo.java --
+   Copyright (C) 1998, 2004  Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -38,6 +38,7 @@
 
 package gnu.java.beans;
 
+import java.awt.Image;
 import java.beans.BeanDescriptor;
 import java.beans.BeanInfo;
 import java.beans.EventSetDescriptor;
@@ -84,7 +85,7 @@
 	protected BeanInfo[] additionalBeanInfo;
 
 	/** The set of icons. **/
-	protected java.awt.Image[] icons;
+	protected Image[] icons;
 
 	public ExplicitBeanInfo(BeanDescriptor beanDescriptor,
 	                        BeanInfo[] additionalBeanInfo,
@@ -93,7 +94,7 @@
 	                        EventSetDescriptor[] eventSetDescriptors,
 				int defaultEventIndex,
 	                        MethodDescriptor[] methodDescriptors,
-				java.awt.Image[] icons) {
+				Image[] icons) {
 		this.beanDescriptor = beanDescriptor;
 		this.additionalBeanInfo = additionalBeanInfo;
 		this.propertyDescriptors = propertyDescriptors;
@@ -142,7 +143,7 @@
 	/** Get Bean icons.
 	 ** @param iconType the type of icon
 	 **/
-	public java.awt.Image getIcon(int iconType) {
-		return icons != null ? icons[iconType] : null;
+	public Image getIcon(int iconType) {
+		return icons != null ? icons[iconType - 1] : null;
 	}
 }


More information about the Java-patches mailing list