Return-Path:
Delivered-To: apmail-harmony-commits-archive@www.apache.org
Received: (qmail 86882 invoked from network); 23 Jul 2007 05:52:02 -0000
Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2)
by minotaur.apache.org with SMTP; 23 Jul 2007 05:52:02 -0000
Received: (qmail 44505 invoked by uid 500); 23 Jul 2007 05:52:03 -0000
Delivered-To: apmail-harmony-commits-archive@harmony.apache.org
Received: (qmail 44488 invoked by uid 500); 23 Jul 2007 05:52:03 -0000
Mailing-List: contact commits-help@harmony.apache.org; run by ezmlm
Precedence: bulk
List-Help:
List-Unsubscribe:
List-Post:
List-Id:
Reply-To: dev@harmony.apache.org
Delivered-To: mailing list commits@harmony.apache.org
Received: (qmail 44479 invoked by uid 99); 23 Jul 2007 05:52:03 -0000
Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133)
by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 22 Jul 2007 22:52:03 -0700
X-ASF-Spam-Status: No, hits=-99.5 required=10.0
tests=ALL_TRUSTED,NO_REAL_NAME
X-Spam-Check-By: apache.org
Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3)
by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 22 Jul 2007 22:51:59 -0700
Received: by eris.apache.org (Postfix, from userid 65534)
id C54C21A981D; Sun, 22 Jul 2007 22:51:38 -0700 (PDT)
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: svn commit: r558609 [1/2] - in
/harmony/enhanced/classlib/branches/java6/modules: awt/
awt/src/main/java/common/java/awt/dnd/
awt/src/main/java/common/org/apache/harmony/awt/gl/
awt/src/main/java/common/org/apache/harmony/awt/internal/nls/ awt/src/main...
Date: Mon, 23 Jul 2007 05:51:37 -0000
To: commits@harmony.apache.org
From: pyang@apache.org
X-Mailer: svnmailer-1.1.0
Message-Id: <20070723055138.C54C21A981D@eris.apache.org>
X-Virus-Checked: Checked by ClamAV on apache.org
Author: pyang
Date: Sun Jul 22 22:51:34 2007
New Revision: 558609
URL: http://svn.apache.org/viewvc?view=rev&rev=558609
Log:
Merge updates from classlib trunk@558482 since r557505
Added:
harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/fontlib/windows/FontLibExports.cpp
- copied unchanged from r558482, harmony/enhanced/classlib/trunk/modules/awt/src/main/native/fontlib/windows/FontLibExports.cpp
harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/fontlib/windows/FontLibExports.h
- copied unchanged from r558482, harmony/enhanced/classlib/trunk/modules/awt/src/main/native/fontlib/windows/FontLibExports.h
harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/SwingAbstractButtonPersistenceDelegate.java
- copied unchanged from r558482, harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/SwingAbstractButtonPersistenceDelegate.java
harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/SwingBoxPersistenceDelegate.java
- copied unchanged from r558482, harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/SwingBoxPersistenceDelegate.java
harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/SwingDefaultComboBoxModelPersistenceDelegate.java
- copied unchanged from r558482, harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/SwingDefaultComboBoxModelPersistenceDelegate.java
harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/SwingJFramePersistenceDelegate.java
- copied unchanged from r558482, harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/SwingJFramePersistenceDelegate.java
harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/SwingJTabbedPanePersistenceDelegate.java
- copied unchanged from r558482, harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/SwingJTabbedPanePersistenceDelegate.java
harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/SwingToolTipManagerPersistenceDelegate.java
- copied unchanged from r558482, harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/SwingToolTipManagerPersistenceDelegate.java
harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/UtilListPersistenceDelegate.java
- copied unchanged from r558482, harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/UtilListPersistenceDelegate.java
harmony/enhanced/classlib/branches/java6/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/FakeFox04.java
- copied unchanged from r558482, harmony/enhanced/classlib/trunk/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/FakeFox04.java
harmony/enhanced/classlib/branches/java6/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/FakeFox041.java
- copied unchanged from r558482, harmony/enhanced/classlib/trunk/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/FakeFox041.java
harmony/enhanced/classlib/branches/java6/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/FakeFox0411.java
- copied unchanged from r558482, harmony/enhanced/classlib/trunk/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/FakeFox0411.java
harmony/enhanced/classlib/branches/java6/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/MockNullSubClass.java
- copied unchanged from r558482, harmony/enhanced/classlib/trunk/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/MockNullSubClass.java
harmony/enhanced/classlib/branches/java6/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/MockNullSubClassBeanInfo.java
- copied unchanged from r558482, harmony/enhanced/classlib/trunk/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/MockNullSubClassBeanInfo.java
harmony/enhanced/classlib/branches/java6/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/MockNullSuperClass.java
- copied unchanged from r558482, harmony/enhanced/classlib/trunk/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/MockNullSuperClass.java
harmony/enhanced/classlib/branches/java6/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/MockNullSuperClassBeanInfo.java
- copied unchanged from r558482, harmony/enhanced/classlib/trunk/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/MockNullSuperClassBeanInfo.java
Modified:
harmony/enhanced/classlib/branches/java6/modules/awt/build.xml
harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/java/awt/dnd/DropTarget.java
harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/org/apache/harmony/awt/gl/CommonGraphics2DFactory.java
harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/org/apache/harmony/awt/internal/nls/messages.properties
harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/org/apache/harmony/awt/wtk/GraphicsFactory.java
harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/windows/org/apache/harmony/awt/gl/font/NativeFont.java
harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/windows/org/apache/harmony/awt/gl/font/WindowsFont.java
harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/windows/org/apache/harmony/awt/gl/windows/WinGraphics2DFactory.java
harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/fontlib/windows/makefile
harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/winfont/windows/include/org_apache_harmony_awt_gl_font_NativeFont.h
harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/winfont/windows/makefile
harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/winfont/windows/winFont.cpp
harmony/enhanced/classlib/branches/java6/modules/beans/META-INF/MANIFEST.MF
harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/Encoder.java
harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/EventSetDescriptor.java
harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/PropertyChangeSupport.java
harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/XMLDecoder.java
harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/XMLEncoder.java
harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/beancontext/BeanContextServicesSupport.java
harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/beancontext/BeanContextSupport.java
harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/org/apache/harmony/beans/editors/FontEditor.java
harmony/enhanced/classlib/branches/java6/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/EventSetDescriptorTest.java
harmony/enhanced/classlib/branches/java6/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/IntrospectorTest.java
harmony/enhanced/classlib/branches/java6/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/PersistenceDelegateTest.java
harmony/enhanced/classlib/branches/java6/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/FakeFox01BeanInfo.java
harmony/enhanced/classlib/branches/java6/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/FakeFox03.java
harmony/enhanced/classlib/branches/java6/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/FakeFox031.java
harmony/enhanced/classlib/branches/java6/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/FakeFox031BeanInfo.java
harmony/enhanced/classlib/branches/java6/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/FakeFox03BeanInfo.java
harmony/enhanced/classlib/branches/java6/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/MockBean4StaticField.java
harmony/enhanced/classlib/branches/java6/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/MockInterfaceBeanInfo.java
harmony/enhanced/classlib/branches/java6/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/MockJavaBean.java
harmony/enhanced/classlib/branches/java6/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/MockSubClassBeanInfo.java
harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/GregorianCalendar.java
harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/Hashtable.java
harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/util/GregorianCalendarTest.java
Modified: harmony/enhanced/classlib/branches/java6/modules/awt/build.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/awt/build.xml?view=diff&rev=558609&r1=558608&r2=558609
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/awt/build.xml (original)
+++ harmony/enhanced/classlib/branches/java6/modules/awt/build.xml Sun Jul 22 22:51:34 2007
@@ -138,7 +138,9 @@
+ depends="-build-native-common,-build-native-unix,-build-native-windows" />
+
+
Modified: harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/java/awt/dnd/DropTarget.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/java/awt/dnd/DropTarget.java?view=diff&rev=558609&r1=558608&r2=558609
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/java/awt/dnd/DropTarget.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/java/awt/dnd/DropTarget.java Sun Jul 22 22:51:34 2007
@@ -35,6 +35,7 @@
import org.apache.harmony.awt.datatransfer.DTK;
import org.apache.harmony.awt.internal.nls.Messages;
+import org.apache.harmony.luni.util.NotImplementedException;
public class DropTarget implements DropTargetListener, Serializable {
@@ -49,17 +50,14 @@
point = p;
}
- protected void stop() {
- // TODO implement
+ protected void stop() throws NotImplementedException{
}
- protected void updateLocation(Point newLocn) {
+ protected void updateLocation(Point newLocn) throws NotImplementedException {
point = (Point)newLocn.clone();
- // TODO implement
}
- public void actionPerformed(ActionEvent e) {
- // TODO implement
+ public void actionPerformed(ActionEvent e) throws NotImplementedException{
}
}
@@ -112,12 +110,11 @@
return new DropTargetAutoScroller(c, p);
}
- public void removeNotify(ComponentPeer peer) {
+ public void removeNotify(ComponentPeer peer) throws NotImplementedException{
context.removeNotify();
- // TODO: implement
}
- public void addNotify(ComponentPeer peer) {
+ public void addNotify(ComponentPeer peer) throws NotImplementedException {
if(component == null) {
return;
}
@@ -125,7 +122,6 @@
DTK dtk = DTK.getDTK();
DropTargetContextPeer dtp = dtk.createDropTargetContextPeer(context);
context.addNotify(dtp);
- // TODO: implement
}
public synchronized void removeDropTargetListener(DropTargetListener dtl) {
Modified: harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/org/apache/harmony/awt/gl/CommonGraphics2DFactory.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/org/apache/harmony/awt/gl/CommonGraphics2DFactory.java?view=diff&rev=558609&r1=558608&r2=558609
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/org/apache/harmony/awt/gl/CommonGraphics2DFactory.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/org/apache/harmony/awt/gl/CommonGraphics2DFactory.java Sun Jul 22 22:51:34 2007
@@ -24,6 +24,8 @@
import java.awt.FontMetrics;
import java.awt.peer.FontPeer;
+import java.io.IOException;
+
import org.apache.harmony.awt.wtk.GraphicsFactory;
/**
@@ -46,6 +48,6 @@
* @param fontFilePath path to the font file
* @return Font object that was created from the file.
*/
- public abstract Font embedFont(String fontFilePath);
+ public abstract Font embedFont(String fontFilePath) throws IOException;
}
Modified: harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/org/apache/harmony/awt/internal/nls/messages.properties
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/org/apache/harmony/awt/internal/nls/messages.properties?view=diff&rev=558609&r1=558608&r2=558609
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/org/apache/harmony/awt/internal/nls/messages.properties (original)
+++ harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/org/apache/harmony/awt/internal/nls/messages.properties Sun Jul 22 22:51:34 2007
@@ -487,6 +487,7 @@
awt.296=can't allocate memory on video card to create new display list
awt.297=Invalid keyLocation
awt.298=dataBuffer is too small
+awt.299=Font file can not be read
awt.err.00=file dialog {0} error!
awt.err.01=error: {0}
Modified: harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/org/apache/harmony/awt/wtk/GraphicsFactory.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/org/apache/harmony/awt/wtk/GraphicsFactory.java?view=diff&rev=558609&r1=558608&r2=558609
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/org/apache/harmony/awt/wtk/GraphicsFactory.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/org/apache/harmony/awt/wtk/GraphicsFactory.java Sun Jul 22 22:51:34 2007
@@ -25,6 +25,7 @@
import java.awt.Graphics2D;
import java.awt.GraphicsEnvironment;
import java.awt.peer.FontPeer;
+import java.io.IOException;
import org.apache.harmony.awt.gl.MultiRectArea;
import org.apache.harmony.awt.gl.font.FontManager;
@@ -71,5 +72,5 @@
// Font methods
FontManager getFontManager();
FontPeer getFontPeer(Font font);
- Font embedFont(String fontFilePath);
+ Font embedFont(String fontFilePath) throws IOException;
}
Modified: harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/windows/org/apache/harmony/awt/gl/font/NativeFont.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/windows/org/apache/harmony/awt/gl/font/NativeFont.java?view=diff&rev=558609&r1=558608&r2=558609
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/windows/org/apache/harmony/awt/gl/font/NativeFont.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/windows/org/apache/harmony/awt/gl/font/NativeFont.java Sun Jul 22 22:51:34 2007
@@ -21,10 +21,13 @@
package org.apache.harmony.awt.gl.font;
import java.awt.Font;
+import java.io.IOException;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.Hashtable;
+import org.apache.harmony.awt.internal.nls.Messages;
+
public class NativeFont {
/**
@@ -70,7 +73,7 @@
*
* @param absolutePath String that represent absolute path to the font resource.
*/
- public static native boolean embedFontNative(String absolutePath);
+ public static native String embedFontNative(String absolutePath);
/**
* Initialize native GDI font object and return font handle, also sets font
@@ -463,9 +466,12 @@
*
* @param absolutePath absolute path to the font resource file
*/
- public static Font embedFont(String absolutePath){
- // TODO: implement method
- return null;
+ public static Font embedFont(String absolutePath) throws IOException {
+ String familyName = embedFontNative(absolutePath);
+ if (familyName == null)
+ throw new IOException(Messages.getString("awt.299"));
+
+ return new Font(familyName, Font.PLAIN, 1);
}
/**
Modified: harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/windows/org/apache/harmony/awt/gl/font/WindowsFont.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/windows/org/apache/harmony/awt/gl/font/WindowsFont.java?view=diff&rev=558609&r1=558608&r2=558609
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/windows/org/apache/harmony/awt/gl/font/WindowsFont.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/windows/org/apache/harmony/awt/gl/font/WindowsFont.java Sun Jul 22 22:51:34 2007
@@ -30,6 +30,7 @@
import java.awt.image.IndexColorModel;
import java.awt.image.Raster;
import java.awt.image.WritableRaster;
+import java.io.IOException;
import java.util.Hashtable;
import java.util.Locale;
@@ -340,7 +341,7 @@
/**
* Return Font object if it was successfully embedded in the system.
*/
- public static Font embedFont(String absolutePath){
+ public static Font embedFont(String absolutePath) throws IOException {
return NativeFont.embedFont(absolutePath);
}
Modified: harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/windows/org/apache/harmony/awt/gl/windows/WinGraphics2DFactory.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/windows/org/apache/harmony/awt/gl/windows/WinGraphics2DFactory.java?view=diff&rev=558609&r1=558608&r2=558609
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/windows/org/apache/harmony/awt/gl/windows/WinGraphics2DFactory.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/windows/org/apache/harmony/awt/gl/windows/WinGraphics2DFactory.java Sun Jul 22 22:51:34 2007
@@ -22,6 +22,8 @@
import java.awt.*;
+import java.io.IOException;
+
import org.apache.harmony.awt.gl.CommonGraphics2DFactory;
import org.apache.harmony.awt.gl.MultiRectArea;
import org.apache.harmony.awt.gl.opengl.OGLGraphics2D;
@@ -70,7 +72,7 @@
}
@Override
- public Font embedFont(String fontFilePath) {
+ public Font embedFont(String fontFilePath) throws IOException {
return WindowsFont.embedFont(fontFilePath);
}
Modified: harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/fontlib/windows/makefile
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/fontlib/windows/makefile?view=diff&rev=558609&r1=558608&r2=558609
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/fontlib/windows/makefile (original)
+++ harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/fontlib/windows/makefile Sun Jul 22 22:51:34 2007
@@ -35,7 +35,8 @@
$(SHAREDSUB)T1Glyph.obj \
$(SHAREDSUB)TTCurve.obj \
$(SHAREDSUB)TTFont.obj \
- $(SHAREDSUB)TypeDefinition.obj
+ $(SHAREDSUB)TypeDefinition.obj \
+ FontLibExports.obj
VIRTFILES = $(LIBBASE).res
SYSLIBFILES = ws2_32.lib Iphlpapi.lib
Modified: harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/winfont/windows/include/org_apache_harmony_awt_gl_font_NativeFont.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/winfont/windows/include/org_apache_harmony_awt_gl_font_NativeFont.h?view=diff&rev=558609&r1=558608&r2=558609
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/winfont/windows/include/org_apache_harmony_awt_gl_font_NativeFont.h (original)
+++ harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/winfont/windows/include/org_apache_harmony_awt_gl_font_NativeFont.h Sun Jul 22 22:51:34 2007
@@ -63,7 +63,7 @@
/*
* Method: org.apache.harmony.awt.gl.font.NativeFont.embedFontNative(Ljava/lang/String;)Z
*/
-JNIEXPORT jboolean JNICALL
+JNIEXPORT jstring JNICALL
Java_org_apache_harmony_awt_gl_font_NativeFont_embedFontNative(JNIEnv *, jclass,
jstring);
Modified: harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/winfont/windows/makefile
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/winfont/windows/makefile?view=diff&rev=558609&r1=558608&r2=558609
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/winfont/windows/makefile (original)
+++ harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/winfont/windows/makefile Sun Jul 22 22:51:34 2007
@@ -22,15 +22,15 @@
LIBNAME=$(LIBPATH)$(LIBBASE).lib
HYLDFLAGS = $(HYLDFLAGS) -def:$(LIBBASE).def
-HYCFLAGS = $(HYCFLAGS) /Iinclude /I..\..\gl\windows\include \
+HYCFLAGS = $(HYCFLAGS) /Iinclude /I..\..\gl\windows\include /I..\..\fontlib\shared /I..\..\fontlib\windows \
-DUNICODE -D_UNICODE
BUILDFILES = winFont.obj
VIRTFILES = $(LIBBASE).res
-SYSLIBFILES = ws2_32.lib Iphlpapi.lib gdi32.lib GdiPlus.lib advapi32.lib
+SYSLIBFILES = ws2_32.lib Iphlpapi.lib gdi32.lib GdiPlus.lib advapi32.lib
-MDLLIBFILES = $(MDLLIBFILES) $(LIBPATH)hypool$(HY_LINKLIB_SUFFIX) $(LIBPATH)vmi$(HY_LINKLIB_SUFFIX)
+MDLLIBFILES = $(MDLLIBFILES) $(LIBPATH)hypool$(HY_LINKLIB_SUFFIX) $(LIBPATH)vmi$(HY_LINKLIB_SUFFIX) $(LIBPATH)FL$(HY_LINKLIB_SUFFIX)
DLLBASE=0x13300000
COMMENT=/comment:"Win32 Font native code. (c) Copyright 2005 - 2006 The Apache Software Foundation or its licensors, as applicable."
Modified: harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/winfont/windows/winFont.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/winfont/windows/winFont.cpp?view=diff&rev=558609&r1=558608&r2=558609
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/winfont/windows/winFont.cpp (original)
+++ harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/winfont/windows/winFont.cpp Sun Jul 22 22:51:34 2007
@@ -33,6 +33,8 @@
#include "org_apache_harmony_awt_gl_font_WinGlyph.h"
#include "exceptions.h"
+#include // Font file tables parsing routines for embedFontNative method
+
static LCIDS lcidTable;
static FontRecords fonts; /* Cached system fonts data */
static int famSize = 256; /* Size of families array */
@@ -457,7 +459,7 @@
* Signature: (Ljava/lang/String;)Z
* Description: Returns TRUE if Font resource from font file added successfully to a system.
*/
-JNIEXPORT jboolean JNICALL
+JNIEXPORT jstring JNICALL
Java_org_apache_harmony_awt_gl_font_NativeFont_embedFontNative(JNIEnv *env, jclass obj, jstring absPath) {
jboolean iscopy;
@@ -465,12 +467,24 @@
const TCHAR * path;
path = (TCHAR *)(env->GetStringCritical(absPath, &iscopy));
- fontAdded = AddFontResource(path);
+ fontAdded = AddFontResourceEx(path, FR_PRIVATE, 0);
+
+ fwchar_t *familyName = 0;
+
+ if (fontAdded) {
+ getFontFamilyName((fwchar_t *)path, &familyName);
+ }
- // message to other applications about installed font
- // SendMessage(HWND_BROADCAST, WM_FONTCHANGE, 0, 0);
env->ReleaseStringCritical(absPath, (const jchar *)path);
- return fontAdded;
+
+ jstring res = 0;
+ if (fontAdded && familyName) {
+ int len = wcslen(familyName);
+ res = env->NewString((jchar *)familyName, len);
+ delete familyName;
+ }
+
+ return res;
}
/*
Modified: harmony/enhanced/classlib/branches/java6/modules/beans/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/beans/META-INF/MANIFEST.MF?view=diff&rev=558609&r1=558608&r2=558609
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/beans/META-INF/MANIFEST.MF (original)
+++ harmony/enhanced/classlib/branches/java6/modules/beans/META-INF/MANIFEST.MF Sun Jul 22 22:51:34 2007
@@ -29,6 +29,8 @@
java.util.regex;resolution:=optional,
javax.accessibility;resolution:=optional,
javax.swing,
+ javax.swing.plaf.basic,
+ javax.swing.tree,
javax.xml.parsers,
org.apache.harmony.kernel.vm,
org.apache.harmony.testframework.serialization;hy_usage=test;resolution:=optional,
Modified: harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/Encoder.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/Encoder.java?view=diff&rev=558609&r1=558608&r2=558609
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/Encoder.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/Encoder.java Sun Jul 22 22:51:34 2007
@@ -26,6 +26,8 @@
import java.util.Map;
import java.util.Hashtable;
+import javax.swing.*;
+
import org.apache.harmony.beans.*;
/**
@@ -102,6 +104,12 @@
delegates.put(SystemColor.class, new AwtSystemColorPersistenceDelegate());
delegates.put(TextAttribute.class, new AwtFontTextAttributePersistenceDelegate());
+ delegates.put(Box.class, new SwingBoxPersistenceDelegate());
+ delegates.put(JFrame.class, new SwingJFramePersistenceDelegate());
+ delegates.put(JTabbedPane.class, new SwingJTabbedPanePersistenceDelegate());
+ delegates.put(DefaultComboBoxModel.class, new SwingDefaultComboBoxModelPersistenceDelegate());
+ delegates.put(ToolTipManager.class, new SwingToolTipManagerPersistenceDelegate());
+
}
private ExceptionListener listener = defaultExListener;
@@ -188,6 +196,10 @@
if (registeredPD != null) {
return registeredPD;
}
+
+ if (java.util.List.class.isAssignableFrom(type)) {
+ return new UtilListPersistenceDelegate();
+ }
if (Collection.class.isAssignableFrom(type)) {
return new UtilCollectionPersistenceDelegate();
Modified: harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/EventSetDescriptor.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/EventSetDescriptor.java?view=diff&rev=558609&r1=558608&r2=558609
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/EventSetDescriptor.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/EventSetDescriptor.java Sun Jul 22 22:51:34 2007
@@ -112,7 +112,7 @@
Method method = null;
Method[] methods = listenerType.getMethods();
for (Method m : methods) {
- if (m.getName().equals(listenerMethodName)) {
+ if (listenerMethodName.equals(m.getName())) {
Class[] paramTypes = m.getParameterTypes();
if (paramTypes.length == 1
&& paramTypes[0].getName().endsWith("Event")) {
Modified: harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/PropertyChangeSupport.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/PropertyChangeSupport.java?view=diff&rev=558609&r1=558608&r2=558609
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/PropertyChangeSupport.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/PropertyChangeSupport.java Sun Jul 22 22:51:34 2007
@@ -36,6 +36,8 @@
private Object source;
+ @SuppressWarnings("unused")
+ // for serialization compatibility
private int propertyChangeSupportSerializedDataVersion = 1;
public PropertyChangeSupport(Object sourceBean) {
Modified: harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/XMLDecoder.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/XMLDecoder.java?view=diff&rev=558609&r1=558608&r2=558609
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/XMLDecoder.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/XMLDecoder.java Sun Jul 22 22:51:34 2007
@@ -55,7 +55,7 @@
boolean inJavaElem = false;
- HashMap idObjMap = new HashMap();
+ HashMap idObjMap = new HashMap();
public void characters(char[] ch, int start, int length)
throws SAXException {
@@ -289,7 +289,7 @@
private Object executeCommon(Elem elem) throws Exception {
// pop args
- ArrayList args = new ArrayList(5);
+ ArrayList
*
*/
protected class BCSSChild extends BeanContextSupport.BCSChild {
- private static final long serialVersionUID = -3263851306889194873L;
+ private static final long serialVersionUID = -3263851306889194873L;
- transient ArrayList serviceRecords;
+ transient ArrayList serviceRecords;
BCSSChild(Object child, Object proxyPeer) {
super(child, proxyPeer);
@@ -92,13 +93,14 @@
}
/**
- * This class implements the BeanContextServiceProvider
+ * This class implements the BeanContextServiceProvider
* interface by wrapping a BeanContextServices. All services
- * registered in the BeanContextServices are accessible
- * via this wrapper service provider.
+ * registered in the BeanContextServices are accessible via
+ * this wrapper service provider.
*
* This class is used by BeanContextServicesSupport to access
- * services provided by its parent context (if there is one).
+ * services provided by its parent context (if there is one).
+ *
*
*/
protected class BCSSProxyServiceProvider implements
@@ -178,11 +180,12 @@
}
/**
- * Every servie registered in this context is companied with a
- * BCSSServiceProvider instance. It can hold implementation
+ * Every servie registered in this context is companied with a
+ * BCSSServiceProvider instance. It can hold implementation
* specific information about each registered service.
*
- * This class holds a reference to the service provider of the service.
+ * This class holds a reference to the service provider of the service.
+ *
*
*/
protected static class BCSSServiceProvider implements Serializable {
@@ -212,11 +215,11 @@
static final long serialVersionUID = -8494482757288719206L;
/**
- * A map of all registered services - key is service class, value is
- * BCSSServiceProvider object.
- * All access to this object should be synchronized on itself.
+ * A map of all registered services - key is service class, value is
+ * BCSSServiceProvider object. All access to this object
+ * should be synchronized on itself.
*/
- protected transient HashMap services;
+ protected transient HashMap services;
/**
* The number of serializable service providers currently registered.
@@ -224,16 +227,16 @@
protected transient int serializable;
/**
- * A proxy service provider that delegates service requests to the
- * parent context.
+ * A proxy service provider that delegates service requests to the parent
+ * context.
*/
protected transient BCSSProxyServiceProvider proxy;
/**
- * A list of registered BeanContextServicesListeners.
- * All access to this object should be synchronized on itself.
+ * A list of registered BeanContextServicesListeners. All
+ * access to this object should be synchronized on itself.
*/
- protected transient ArrayList bcsListeners;
+ protected transient ArrayList bcsListeners;
/**
* Constructs a standload BeanContextServicesSupport.
@@ -243,33 +246,39 @@
}
/**
- * Constructs a BeanContextServicesSupport which is a delegate
- * of the given peer.
+ * Constructs a BeanContextServicesSupport which is a
+ * delegate of the given peer.
*
- * @param peer the peer of this context
+ * @param peer
+ * the peer of this context
*/
public BeanContextServicesSupport(BeanContextServices peer) {
super(peer);
}
/**
- * Constructs a BeanContextServicesSupport which is a delegate
- * of the given peer.
+ * Constructs a BeanContextServicesSupport which is a
+ * delegate of the given peer.
*
- * @param peer the peer of this context
- * @param locale the locale of this context
+ * @param peer
+ * the peer of this context
+ * @param locale
+ * the locale of this context
*/
public BeanContextServicesSupport(BeanContextServices peer, Locale locale) {
super(peer, locale);
}
/**
- * Constructs a BeanContextServicesSupport which is a delegate
- * of the given peer.
+ * Constructs a BeanContextServicesSupport which is a
+ * delegate of the given peer.
*
- * @param peer the peer of this context
- * @param locale the locale of this context
- * @param designTime whether in design mode or not
+ * @param peer
+ * the peer of this context
+ * @param locale
+ * the locale of this context
+ * @param designTime
+ * whether in design mode or not
*/
public BeanContextServicesSupport(BeanContextServices peer, Locale locale,
boolean designTime) {
@@ -277,20 +286,26 @@
}
/**
- * Constructs a BeanContextServicesSupport which is a delegate
- * of the given peer.
+ * Constructs a BeanContextServicesSupport which is a
+ * delegate of the given peer.
*
- * @param peer the peer of this context
- * @param locale the locale of this context
- * @param designTime whether in design mode or not
- * @param okToUseGui whether GUI is usable or not
+ * @param peer
+ * the peer of this context
+ * @param locale
+ * the locale of this context
+ * @param designTime
+ * whether in design mode or not
+ * @param okToUseGui
+ * whether GUI is usable or not
*/
public BeanContextServicesSupport(BeanContextServices peer, Locale locale,
boolean designTime, boolean okToUseGui) {
super(peer, locale, designTime, okToUseGui);
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see java.beans.beancontext.BeanContextServices#addBeanContextServicesListener(java.beans.beancontext.BeanContextServicesListener)
*/
public void addBeanContextServicesListener(
@@ -306,9 +321,11 @@
/**
* Add a service to this context.
*
- * Delegate to addService(serviceClass, provider, true).
+ * Delegate to addService(serviceClass, provider, true).
+ *
*
- * @see java.beans.beancontext.BeanContextServices#addService(java.lang.Class, java.beans.beancontext.BeanContextServiceProvider)
+ * @see java.beans.beancontext.BeanContextServices#addService(java.lang.Class,
+ * java.beans.beancontext.BeanContextServiceProvider)
*/
public boolean addService(Class serviceClass,
BeanContextServiceProvider provider) {
@@ -319,12 +336,17 @@
* Add a service to this context.
*
* If the service already exists in the context, simply return false.
- * Otherwise, the service is added and event is fired if required.
+ * Otherwise, the service is added and event is fired if required.
+ *
*
- * @param serviceClass the service class
- * @param provider the provider of the service
- * @param fireEvent the flag indicating to fire event or not
- * @return true if the service is added; or false if the context already has this service
+ * @param serviceClass
+ * the service class
+ * @param provider
+ * the provider of the service
+ * @param fireEvent
+ * the flag indicating to fire event or not
+ * @return true if the service is added; or false if the context already has
+ * this service
*/
protected boolean addService(Class serviceClass,
BeanContextServiceProvider provider, boolean fireEvent) {
@@ -366,12 +388,13 @@
}
/**
- * Deserializes all serializable services and their providers
- * before the children of this context is deserialized.
+ * Deserializes all serializable services and their providers before the
+ * children of this context is deserialized.
*
* First a int is read, indicating the number of services to
- * read. Then pairs of service class and service provider are read one
- * by one.
+ * read. Then pairs of service class and service provider are read one by
+ * one.
+ *
*
* @see java.beans.beancontext.BeanContextSupport#bcsPreDeserializationHook(java.io.ObjectInputStream)
*/
@@ -385,18 +408,20 @@
for (int i = 0; i < serializable; i++) {
Object serviceClass = ois.readObject();
Object bcssProvider = ois.readObject();
- services.put(serviceClass, bcssProvider);
+ services.put((Class) serviceClass,
+ (BCSSServiceProvider) bcssProvider);
}
}
}
/**
- * Serializes all serializable services and their providers
- * before the children of this context is serialized.
+ * Serializes all serializable services and their providers before the
+ * children of this context is serialized.
*
- * First a int is writtern, indicating the number of
- * serializable services. Then pairs of service class and service
- * provider are writtern one by one.
+ * First a int is writtern, indicating the number of
+ * serializable services. Then pairs of service class and service provider
+ * are writtern one by one.
+ *
*
* @see java.beans.beancontext.BeanContextSupport#bcsPreSerializationHook(java.io.ObjectOutputStream)
*/
@@ -421,9 +446,11 @@
/**
* This method is called everytime a child is removed from this context.
*
- * The implementation releases all services requested by the child.
+ * The implementation releases all services requested by the child.
+ *
*
- * @see java.beans.beancontext.BeanContextSupport#childJustRemovedHook(java.lang.Object, java.beans.beancontext.BeanContextSupport.BCSChild)
+ * @see java.beans.beancontext.BeanContextSupport#childJustRemovedHook(java.lang.Object,
+ * java.beans.beancontext.BeanContextSupport.BCSChild)
*/
protected void childJustRemovedHook(Object child, BCSChild bcsChild) {
if (bcsChild instanceof BCSSChild) {
@@ -434,8 +461,10 @@
/**
* Release all services requested by the given child.
*
- * @param bcssChild a child
- * @param delegatedServices only release services that are delegated to parent context
+ * @param bcssChild
+ * a child
+ * @param delegatedServices
+ * only release services that are delegated to parent context
*/
private void releaseServicesForChild(BCSSChild bcssChild,
boolean delegatedServices) {
@@ -463,17 +492,21 @@
/**
* Creates a BCSSChild object to company the given child.
*
- * @see java.beans.beancontext.BeanContextSupport#createBCSChild(java.lang.Object, java.lang.Object)
+ * @see java.beans.beancontext.BeanContextSupport#createBCSChild(java.lang.Object,
+ * java.lang.Object)
*/
protected BCSChild createBCSChild(Object child, Object proxyPeer) {
return new BCSSChild(child, proxyPeer);
}
/**
- * Creates a BCSSServiceProvider to company the given service.
+ * Creates a BCSSServiceProvider to company the given
+ * service.
*
- * @param serviceClass the service class
- * @param provider the service provider
+ * @param serviceClass
+ * the service class
+ * @param provider
+ * the service provider
* @return a BCSSServiceProvider to company the given service
*/
protected BCSSServiceProvider createBCSSServiceProvider(Class serviceClass,
@@ -482,10 +515,11 @@
}
/**
- * Fires a BeanContextServiceAvailableEvent to registered
+ * Fires a BeanContextServiceAvailableEvent to registered
* BeanContextServicesListeners.
*
- * @param serviceClass the service that has been added
+ * @param serviceClass
+ * the service that has been added
*/
protected final void fireServiceAdded(Class serviceClass) {
fireServiceAdded(new BeanContextServiceAvailableEvent(this,
@@ -493,10 +527,11 @@
}
/**
- * Fires a BeanContextServiceAvailableEvent to registered
+ * Fires a BeanContextServiceAvailableEvent to registered
* BeanContextServicesListeners.
*
- * @param event the event
+ * @param event
+ * the event
*/
protected final void fireServiceAdded(BeanContextServiceAvailableEvent event) {
Object listeners[];
@@ -510,11 +545,13 @@
}
/**
- * Fires a BeanContextServiceRevokedEvent to registered
+ * Fires a BeanContextServiceRevokedEvent to registered
* BeanContextServicesListeners.
*
- * @param serviceClass the service that has been revoked
- * @param revokeNow whether to terminate service immediately
+ * @param serviceClass
+ * the service that has been revoked
+ * @param revokeNow
+ * whether to terminate service immediately
*/
protected final void fireServiceRevoked(Class serviceClass,
boolean revokeNow) {
@@ -523,10 +560,11 @@
}
/**
- * Fires a BeanContextServiceRevokedEvent to registered
+ * Fires a BeanContextServiceRevokedEvent to registered
* BeanContextServicesListeners.
*
- * @param event the event
+ * @param event
+ * the event
*/
protected final void fireServiceRevoked(BeanContextServiceRevokedEvent event) {
Object listeners[];
@@ -540,33 +578,38 @@
}
/**
- * Returns the peer of this context casted as BeanContextServices.
+ * Returns the peer of this context casted as
+ * BeanContextServices.
*
- * @return the peer of this context casted as BeanContextServices
+ * @return the peer of this context casted as
+ * BeanContextServices
*/
public BeanContextServices getBeanContextServicesPeer() {
return (BeanContextServices) beanContextChildPeer;
}
/**
- * Returns the given child casted to BeanContextServicesListener,
- * or null if it does not implements the interface.
- *
- * @param child a child
- * @return the given child casted to BeanContextServicesListener,
- * or null if it does not implements the interface
+ * Returns the given child casted to
+ * BeanContextServicesListener, or null if it does not
+ * implements the interface.
+ *
+ * @param child
+ * a child
+ * @return the given child casted to
+ * BeanContextServicesListener, or null if it does
+ * not implements the interface
*/
protected static final BeanContextServicesListener getChildBeanContextServicesListener(
Object child) {
if (child instanceof BeanContextServicesListener) {
return (BeanContextServicesListener) child;
}
- return null;
+ return null;
}
/**
- * Returns an iterator of all registered service classes,
- * with removed() disabled.
+ * Returns an iterator of all registered service classes, with
+ * removed() disabled.
*
* @return an iterator of all registered service classes
* @see java.beans.beancontext.BeanContextServices#getCurrentServiceClasses()
@@ -598,24 +641,33 @@
if (bcssProvider != null) {
return bcssProvider.getServiceProvider();
}
- return null;
+ return null;
}
}
/**
- * Get a service instance on behalf of the specified child of this
- * context, by calling the registered service provider, or by delegating
- * to the parent context.
+ * Get a service instance on behalf of the specified child of this context,
+ * by calling the registered service provider, or by delegating to the
+ * parent context.
*
- * @param child the child that request service
- * @param requestor the requestor object
- * @param serviceClass the service class
- * @param serviceSelector the service selectors
- * @param bcsrl the BeanContextServiceRevokedListener
- * @return a service instance on behalf of the specified child of this context
- * @throws IllegalArgumentException if child is not a child of this context
+ * @param child
+ * the child that request service
+ * @param requestor
+ * the requestor object
+ * @param serviceClass
+ * the service class
+ * @param serviceSelector
+ * the service selectors
+ * @param bcsrl
+ * the BeanContextServiceRevokedListener
+ * @return a service instance on behalf of the specified child of this
+ * context
+ * @throws IllegalArgumentException
+ * if child is not a child of this context
* @throws TooManyListenersException
- * @see java.beans.beancontext.BeanContextServices#getService(java.beans.beancontext.BeanContextChild, java.lang.Object, java.lang.Class, java.lang.Object, java.beans.beancontext.BeanContextServiceRevokedListener)
+ * @see java.beans.beancontext.BeanContextServices#getService(java.beans.beancontext.BeanContextChild,
+ * java.lang.Object, java.lang.Class, java.lang.Object,
+ * java.beans.beancontext.BeanContextServiceRevokedListener)
*/
public Object getService(BeanContextChild child, Object requestor,
Class serviceClass, Object serviceSelector,
@@ -661,7 +713,7 @@
// save record
synchronized (child) {
if (bcssChild.serviceRecords == null) {
- bcssChild.serviceRecords = new ArrayList();
+ bcssChild.serviceRecords = new ArrayList();
}
bcssChild.serviceRecords.add(new ServiceRecord(provider, child,
requestor, serviceClass, bcsrl, service, isDelegate));
@@ -672,10 +724,11 @@
}
/**
- * Checks whether a service is registed in this context or the
- * parent context.
+ * Checks whether a service is registed in this context or the parent
+ * context.
*
- * @param serviceClass the service class
+ * @param serviceClass
+ * the service class
* @return true if the service is registered
* @see java.beans.beancontext.BeanContextServices#hasService(java.lang.Class)
*/
@@ -695,28 +748,30 @@
return has;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see java.beans.beancontext.BeanContextSupport#initialize()
*/
public void initialize() {
super.initialize();
- services = new HashMap();
+ services = new HashMap();
serializable = 0;
proxy = null;
- bcsListeners = new ArrayList();
+ bcsListeners = new ArrayList();
}
/**
- * Called after the parent context is updated. The implementation
- * checks if the parent context is a BeanContextServices.
- * If it is, then a BCSSProxyServiceProvider is created
- * to delegate service requests to the parent context.
+ * Called after the parent context is updated. The implementation checks if
+ * the parent context is a BeanContextServices. If it is,
+ * then a BCSSProxyServiceProvider is created to delegate
+ * service requests to the parent context.
*
* @see java.beans.beancontext.BeanContextChildSupport#initializeBeanContextResources()
*/
protected void initializeBeanContextResources() {
super.initializeBeanContextResources();
-
+
BeanContext context = getBeanContext();
if (context instanceof BeanContextServices) {
proxy = new BCSSProxyServiceProvider((BeanContextServices) context);
@@ -726,14 +781,14 @@
}
/**
- * Called before the parent context is updated. The implementation
- * releases any service that is currently provided by the parent context.
+ * Called before the parent context is updated. The implementation releases
+ * any service that is currently provided by the parent context.
*
* @see java.beans.beancontext.BeanContextChildSupport#releaseBeanContextResources()
*/
protected void releaseBeanContextResources() {
super.releaseBeanContextResources();
-
+
releaseAllDelegatedServices();
proxy = null;
}
@@ -749,10 +804,14 @@
/**
* Release a service which has been requested previously.
*
- * @param child the child that request the service
- * @param requestor the requestor object
- * @param service the service instance
- * @throws IllegalArgumentException if child is not a child of this context
+ * @param child
+ * the child that request the service
+ * @param requestor
+ * the requestor object
+ * @param service
+ * the service instance
+ * @throws IllegalArgumentException
+ * if child is not a child of this context
*/
public void releaseService(BeanContextChild child, Object requestor,
Object service) {
@@ -805,7 +864,9 @@
}
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see java.beans.beancontext.BeanContextServices#removeBeanContextServicesListener(java.beans.beancontext.BeanContextServicesListener)
*/
public void removeBeanContextServicesListener(
@@ -821,15 +882,19 @@
/**
* Revokes a service in this bean context.
*
- * The given service provider is unregistered and a
- * BeanContextServiceRevokedEvent is fired.
- * All registered service listeners and current service users get
- * notified.
- *
- * @param serviceClass the service class
- * @param serviceProvider the service provider
- * @param revokeCurrentServicesNow true if service should be terminated immediantly
- * @see java.beans.beancontext.BeanContextServices#revokeService(java.lang.Class, java.beans.beancontext.BeanContextServiceProvider, boolean)
+ * The given service provider is unregistered and a
+ * BeanContextServiceRevokedEvent is fired. All registered
+ * service listeners and current service users get notified.
+ *
+ *
+ * @param serviceClass
+ * the service class
+ * @param serviceProvider
+ * the service provider
+ * @param revokeCurrentServicesNow
+ * true if service should be terminated immediantly
+ * @see java.beans.beancontext.BeanContextServices#revokeService(java.lang.Class,
+ * java.beans.beancontext.BeanContextServiceProvider, boolean)
*/
public void revokeService(Class serviceClass,
BeanContextServiceProvider serviceProvider,
@@ -910,7 +975,7 @@
}
/**
- * Notify all listeners and children that implements
+ * Notify all listeners and children that implements
* BeanContextServices of the event.
*
* @see java.beans.beancontext.BeanContextServicesListener#serviceAvailable(java.beans.beancontext.BeanContextServiceAvailableEvent)
@@ -919,8 +984,8 @@
if (null == event) {
throw new NullPointerException(Messages.getString("beans.1C")); //$NON-NLS-1$
}
- if(services.containsKey(event.serviceClass)) {
- return;
+ if (services.containsKey(event.serviceClass)) {
+ return;
}
fireServiceAdded(event);
Object childs[] = copyChildren();
@@ -932,7 +997,7 @@
}
/**
- * Notify all listeners and children that implements
+ * Notify all listeners and children that implements
* BeanContextServices of the event.
*
* @see java.beans.beancontext.BeanContextServiceRevokedListener#serviceRevoked(java.beans.beancontext.BeanContextServiceRevokedEvent)
@@ -941,8 +1006,8 @@
if (null == event) {
throw new NullPointerException(Messages.getString("beans.1C")); //$NON-NLS-1$
}
- if(services.containsKey(event.serviceClass)) {
- return;
+ if (services.containsKey(event.serviceClass)) {
+ return;
}
fireServiceRevoked(event);
Object childs[] = copyChildren();
@@ -962,8 +1027,10 @@
*
*
*
- * @param oos the object output stream
- * @throws IOException if I/O exception occurs
+ * @param oos
+ * the object output stream
+ * @throws IOException
+ * if I/O exception occurs
*/
private void writeObject(ObjectOutputStream oos) throws IOException {
@@ -983,9 +1050,12 @@
*
*
*
- * @param ois the object input stream
- * @throws IOException if I/O error occurs
- * @throws ClassNotFoundException if class of read object is not found
+ * @param ois
+ * the object input stream
+ * @throws IOException
+ * if I/O error occurs
+ * @throws ClassNotFoundException
+ * if class of read object is not found
*/
private void readObject(ObjectInputStream ois) throws IOException,
ClassNotFoundException {
@@ -998,5 +1068,3 @@
}
}
-
-
Modified: harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/beancontext/BeanContextSupport.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/beancontext/BeanContextSupport.java?view=diff&rev=558609&r1=558608&r2=558609
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/beancontext/BeanContextSupport.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/beancontext/BeanContextSupport.java Sun Jul 22 22:51:34 2007
@@ -103,7 +103,7 @@
* A list of registered membership listeners.
* All access to this object should be synchronized on itself.
*/
- transient protected ArrayList bcmListeners;
+ transient protected ArrayList bcmListeners;
/**
* A map of children - key is child instance, value is BCSChild instance.
@@ -214,6 +214,7 @@
* @throws IllegalStateException if the child is not valid to add
* @see java.util.Collection#add(java.lang.Object)
*/
+ @SuppressWarnings("unchecked")
public boolean add(Object child) {
if (child == null) {
throw new IllegalArgumentException("null child");
@@ -460,6 +461,7 @@
* @return true if given objects are children of this context
* @see java.util.Collection#containsAll(java.util.Collection)
*/
+ @SuppressWarnings("unchecked")
public boolean containsAll(Collection collection) {
synchronized (children) {
return children.keySet().containsAll(collection);
@@ -511,6 +513,7 @@
* @throws IOException if I/O exception occurs
* @throws ClassNotFoundException if class of any read object is not found
*/
+ @SuppressWarnings("unchecked")
protected final void deserialize(ObjectInputStream ois,
Collection collection) throws IOException, ClassNotFoundException {
int size = ois.readInt();
@@ -726,7 +729,7 @@
*/
protected void initialize() {
// init transient fields
- bcmListeners = new ArrayList();
+ bcmListeners = new ArrayList();
children = new HashMap();
serializing = false;
inNeedsGui = false;
@@ -865,6 +868,7 @@
* @throws ClassNotFoundException
* if class of read object is not found
*/
+ @SuppressWarnings("unchecked")
public final void readChildren(ObjectInputStream ois) throws IOException,
ClassNotFoundException {
synchronized (children) {
@@ -1125,6 +1129,7 @@
* @return an array of children of this context
* @see java.util.Collection#toArray(java.lang.Object[])
*/
+ @SuppressWarnings("unchecked")
public Object[] toArray(Object[] array) {
synchronized (children) {
return children.keySet().toArray(array);
Modified: harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/org/apache/harmony/beans/editors/FontEditor.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/org/apache/harmony/beans/editors/FontEditor.java?view=diff&rev=558609&r1=558608&r2=558609
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/org/apache/harmony/beans/editors/FontEditor.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/org/apache/harmony/beans/editors/FontEditor.java Sun Jul 22 22:51:34 2007
@@ -29,6 +29,7 @@
import java.util.Iterator;
import java.util.List;
+@SuppressWarnings("serial")
public class FontEditor extends Panel implements PropertyEditor {
List listeners = new ArrayList();
Modified: harmony/enhanced/classlib/branches/java6/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/EventSetDescriptorTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/EventSetDescriptorTest.java?view=diff&rev=558609&r1=558608&r2=558609
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/EventSetDescriptorTest.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/EventSetDescriptorTest.java Sun Jul 22 22:51:34 2007
@@ -275,8 +275,8 @@
listenerMethodName);
fail("Should throw NullPointerException.");
} catch (NullPointerException e) {
+ // expected
}
-
}
/*
@@ -463,8 +463,16 @@
listenerMethodNames, addMethod, removeMethod);
fail("Should throw NullPointerException.");
} catch (NullPointerException e) {
+ // expected
+ }
+
+ try {
+ new EventSetDescriptor(sourceClass, eventSetName, listenerType,
+ new String[] { null }, addMethod, removeMethod);
+ fail("Should throw NullPointerException.");
+ } catch (NullPointerException e) {
+ // expected
}
-
}
/*
Modified: harmony/enhanced/classlib/branches/java6/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/IntrospectorTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/IntrospectorTest.java?view=diff&rev=558609&r1=558608&r2=558609
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/IntrospectorTest.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/IntrospectorTest.java Sun Jul 22 22:51:34 2007
@@ -54,6 +54,8 @@
import org.apache.harmony.beans.tests.support.mock.FakeFox01BeanInfo;
import org.apache.harmony.beans.tests.support.mock.FakeFox02;
import org.apache.harmony.beans.tests.support.mock.FakeFox031;
+import org.apache.harmony.beans.tests.support.mock.FakeFox041;
+import org.apache.harmony.beans.tests.support.mock.FakeFox0411;
import org.apache.harmony.beans.tests.support.mock.MockButton;
import org.apache.harmony.beans.tests.support.mock.MockFoo;
import org.apache.harmony.beans.tests.support.mock.MockFooButton;
@@ -62,6 +64,7 @@
import org.apache.harmony.beans.tests.support.mock.MockFooSub;
import org.apache.harmony.beans.tests.support.mock.MockFooSubSub;
import org.apache.harmony.beans.tests.support.mock.MockJavaBean;
+import org.apache.harmony.beans.tests.support.mock.MockNullSubClass;
import org.apache.harmony.beans.tests.support.mock.MockSubClass;
/**
@@ -1317,6 +1320,17 @@
}
assertTrue(eventFound);
}
+
+ public void testGetBeanInfoExplicitNull() throws Exception {
+ Introspector.flushCaches();
+ BeanInfo subinfo = Introspector.getBeanInfo(MockNullSubClass.class);
+ assertNotNull(subinfo.getPropertyDescriptors());
+ assertNotNull(subinfo.getEventSetDescriptors());
+ assertNotNull(subinfo.getMethodDescriptors());
+ assertEquals(-1, subinfo.getDefaultEventIndex());
+ assertEquals(-1, subinfo.getDefaultPropertyIndex());
+ }
+
static class FakeFoxInfo {
public int getProp6(boolean i) {
@@ -2068,6 +2082,31 @@
assertFalse(pd.isPreferred());
}
assertEquals(2, info.getPropertyDescriptors().length);
+
+ BeanInfo dummyInfo = Introspector.getBeanInfo(FakeFox041.class);
+ PropertyDescriptor[] p = dummyInfo.getPropertyDescriptors();
+ assertFalse(p[0].isBound());
+ assertFalse(p[0].isConstrained());
+ assertFalse(p[1].isBound());
+ assertFalse(p[1].isConstrained());
+ assertTrue(p[2].isBound());
+ assertTrue(p[2].isConstrained());
+
+ dummyInfo = Introspector.getBeanInfo(FakeFox0411.class);
+ p = dummyInfo.getPropertyDescriptors();
+ assertFalse(p[0].isBound());
+ assertFalse(p[0].isConstrained());
+ assertFalse(p[1].isBound());
+ assertFalse(p[1].isConstrained());
+ assertTrue(p[2].isBound());
+ assertFalse(p[2].isConstrained());
+ assertTrue(p[3].isBound());
+ assertTrue(p[3].isConstrained());
+
+ dummyInfo = Introspector.getBeanInfo(FakeFox0411.class, FakeFox041.class);
+ p = dummyInfo.getPropertyDescriptors();
+ assertFalse(p[0].isBound());
+ assertFalse(p[0].isConstrained());
}
public void testDefaultEvent() throws IntrospectionException {
@@ -2114,6 +2153,7 @@
a = i;
}
}
+
static class MockClassForDefaultEvent {
public void addPropertyChangeListener(PropertyChangeListener a) {
}
Modified: harmony/enhanced/classlib/branches/java6/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/PersistenceDelegateTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/PersistenceDelegateTest.java?view=diff&rev=558609&r1=558608&r2=558609
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/PersistenceDelegateTest.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/PersistenceDelegateTest.java Sun Jul 22 22:51:34 2007
@@ -21,28 +21,15 @@
import java.awt.event.*;
import java.awt.font.TextAttribute;
import java.awt.dnd.DropTarget;
-import java.beans.Encoder;
-import java.beans.Expression;
-import java.beans.PersistenceDelegate;
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-import java.beans.Statement;
-import java.beans.XMLDecoder;
-import java.beans.XMLEncoder;
-import java.io.BufferedOutputStream;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.DataInputStream;
-import java.io.IOException;
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.util.EmptyStackException;
-import java.util.LinkedList;
-import java.util.Locale;
-import java.util.Stack;
-import java.util.TreeMap;
+import java.beans.*;
+import java.io.*;
+import java.lang.reflect.*;
+import java.util.*;
import javax.swing.*;
+import javax.swing.plaf.basic.BasicComboBoxUI;
+import javax.swing.plaf.basic.BasicComboBoxUI.ListDataHandler;
+import javax.swing.tree.DefaultMutableTreeNode;
import junit.framework.TestCase;
@@ -659,7 +646,7 @@
XMLEncoder encoder = new XMLEncoder(new BufferedOutputStream(
byteArrayOutputStream));
- java.awt.List list = new List();
+ java.awt.List list = new java.awt.List();
list.setBounds(0, 0, 10, 10);
list.add(new PopupMenu("popupMenu"));
list.add("1");
@@ -670,7 +657,7 @@
DataInputStream stream = new DataInputStream(new ByteArrayInputStream(
byteArrayOutputStream.toByteArray()));
XMLDecoder decoder = new XMLDecoder(stream);
- List aList = (List) decoder.readObject();
+ java.awt.List aList = (java.awt.List) decoder.readObject();
assertEquals(list.getItem(0), aList.getItem(0));
assertEquals(list.getHeight(), aList.getHeight());
assertEquals(list.getBackground(), aList.getBackground());
@@ -817,6 +804,174 @@
TreeMap aMap = (TreeMap) decoder.readObject();
assertEquals(map.size(), aMap.size());
assertEquals(map.get(10), aMap.get(10));
+ }
+
+ public void test_writeObject_java_util_List() {
+ ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
+ XMLEncoder encoder = new XMLEncoder(new BufferedOutputStream(
+ byteArrayOutputStream));
+ Vector vector = new Vector();
+ vector.add("test");
+ vector.add(1);
+
+ encoder.writeObject(vector);
+ encoder.close();
+ DataInputStream stream = new DataInputStream(new ByteArrayInputStream(
+ byteArrayOutputStream.toByteArray()));
+ XMLDecoder decoder = new XMLDecoder(stream);
+ Vector aVector = (Vector) decoder.readObject();
+ assertEquals(vector, aVector);
+ assertEquals(2, aVector.size());
+ assertEquals(vector.get(0), aVector.get(0));
+ assertEquals(1, aVector.get(1));
+
+ Vector v = new Vector();
+ v.add("The first item.");
+ v.add("The second item.");
+ Vector v2 = new Vector();
+ v2.add("A nested item.");
+ v.add(v2);
+
+ byteArrayOutputStream = new ByteArrayOutputStream();
+ encoder = new XMLEncoder(byteArrayOutputStream);
+ encoder.writeObject(v);
+ encoder.flush();
+ encoder.close();
+
+ stream = new DataInputStream(new ByteArrayInputStream(
+ byteArrayOutputStream.toByteArray()));
+ decoder = new XMLDecoder(stream);
+ aVector = (Vector) decoder.readObject();
+ assertEquals(v, aVector);
+ assertEquals(3, aVector.size());
+ assertEquals(v.get(0), aVector.get(0));
+ assertEquals(v.get(2), aVector.get(2));
+ }
+
+ public void test_writeObject_java_util_AbstractList(){
+ ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
+ XMLEncoder encoder = new XMLEncoder(new BufferedOutputStream(
+ byteArrayOutputStream));
+ ArrayList arrayList = new ArrayList();
+ arrayList.add(10);
+
+ encoder.writeObject(arrayList);
+ encoder.close();
+ DataInputStream stream = new DataInputStream(new ByteArrayInputStream(
+ byteArrayOutputStream.toByteArray()));
+ XMLDecoder decoder = new XMLDecoder(stream);
+ ArrayList aList = (ArrayList) decoder.readObject();
+ assertEquals(arrayList.size(), aList.size());
+ assertEquals(arrayList.get(0), arrayList.get(0));
+ }
+
+ public void test_writeObject_java_util_AbstractMap() {
+ ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
+ XMLEncoder encoder = new XMLEncoder(new BufferedOutputStream(
+ byteArrayOutputStream));
+
+ HashMap hMap = new HashMap();
+ hMap.put(1, "1");
+ hMap.put(2, "test");
+
+ encoder.writeObject(hMap);
+ encoder.close();
+ DataInputStream stream = new DataInputStream(new ByteArrayInputStream(
+ byteArrayOutputStream.toByteArray()));
+ XMLDecoder decoder = new XMLDecoder(stream);
+ HashMap aHmap = (HashMap) decoder.readObject();
+ assertEquals(hMap.size(), aHmap.size());
+ assertEquals(hMap.get(1), aHmap.get(1));
+ assertEquals("test", aHmap.get(2));
+ }
+
+ public void test_writeObject_javax_swing_JFrame() {
+ ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
+ XMLEncoder encoder = new XMLEncoder(new BufferedOutputStream(
+ byteArrayOutputStream));
+
+ JFrame frame = new JFrame("JFrame");
+ frame.setAlwaysOnTop(true);
+ frame.setBounds(1, 1, 100, 100);
+ frame.add(new JMenu("JMenu"));
+ encoder.writeObject(frame);
+ encoder.close();
+ DataInputStream stream = new DataInputStream(new ByteArrayInputStream(
+ byteArrayOutputStream.toByteArray()));
+ XMLDecoder decoder = new XMLDecoder(stream);
+ JFrame aFrame = (JFrame) decoder.readObject();
+ assertEquals(frame.getTitle(), aFrame.getTitle());
+ assertEquals(frame.getBounds(), aFrame.getBounds());
+ }
+
+ public void test_writeObject_javax_swing_DefaultListModel() {
+ ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
+ XMLEncoder encoder = new XMLEncoder(new BufferedOutputStream(
+ byteArrayOutputStream));
+
+ DefaultListModel model = new DefaultListModel();
+ model.add(0, 1);
+ model.add(1, 2);
+ ListDataHandler listDataHandler = new BasicComboBoxUI().new ListDataHandler();
+ model.addListDataListener(listDataHandler);
+
+ encoder.writeObject(model);
+ encoder.close();
+ DataInputStream stream = new DataInputStream(new ByteArrayInputStream(
+ byteArrayOutputStream.toByteArray()));
+ XMLDecoder decoder = new XMLDecoder(stream);
+ DefaultListModel aModel = (DefaultListModel) decoder.readObject();
+ assertEquals(model.getSize(), aModel.getSize());
+ }
+
+ public void test_writeObject_javax_swing_DefaultComboBoxModel() {
+ ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
+ XMLEncoder encoder = new XMLEncoder(new BufferedOutputStream(
+ byteArrayOutputStream));
+ Object a[] = {1, 2};
+ DefaultComboBoxModel model = new DefaultComboBoxModel(a);
+
+ encoder.writeObject(model);
+ encoder.close();
+ DataInputStream stream = new DataInputStream(new ByteArrayInputStream(
+ byteArrayOutputStream.toByteArray()));
+ XMLDecoder decoder = new XMLDecoder(stream);
+ DefaultComboBoxModel aModel = (DefaultComboBoxModel) decoder.readObject();
+ assertEquals(model.getSize(), aModel.getSize());
+ assertEquals(model.getElementAt(0), aModel.getElementAt(0));
+ assertEquals(model.getElementAt(1), aModel.getElementAt(1));
+ }
+
+ public void test_writeObject_javax_swing_tree_DefaultMutableTreeNode() {
+ ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
+ XMLEncoder encoder = new XMLEncoder(new BufferedOutputStream(
+ byteArrayOutputStream));
+ DefaultMutableTreeNode node = new DefaultMutableTreeNode(1);
+
+ encoder.writeObject(node);
+ encoder.close();
+ DataInputStream stream = new DataInputStream(new ByteArrayInputStream(
+ byteArrayOutputStream.toByteArray()));
+ XMLDecoder decoder = new XMLDecoder(stream);
+ DefaultMutableTreeNode aNode = (DefaultMutableTreeNode) decoder.readObject();
+ assertEquals(node.getUserObject(), aNode.getUserObject());
+ }
+
+ public void test_writeObject_javax_swing_ToolTipManager() {
+ ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
+ XMLEncoder encoder = new XMLEncoder(new BufferedOutputStream(
+ byteArrayOutputStream));
+ ToolTipManager manager = ToolTipManager.sharedInstance();
+ manager.setDismissDelay(10);
+
+ encoder.writeObject(manager);
+ encoder.close();
+ DataInputStream stream = new DataInputStream(new ByteArrayInputStream(
+ byteArrayOutputStream.toByteArray()));
+ XMLDecoder decoder = new XMLDecoder(stream);
+ ToolTipManager aManager = (ToolTipManager) decoder.readObject();
+ assertEquals(manager, aManager);
+ assertEquals(manager.getDismissDelay(), aManager.getDismissDelay());
}
// <--
Modified: harmony/enhanced/classlib/branches/java6/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/FakeFox01BeanInfo.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/FakeFox01BeanInfo.java?view=diff&rev=558609&r1=558608&r2=558609
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/FakeFox01BeanInfo.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/FakeFox01BeanInfo.java Sun Jul 22 22:51:34 2007
@@ -58,7 +58,7 @@
getDesc.setDisplayName(getDesc.getDisplayName() + suffix);
MethodDescriptor setDesc = new MethodDescriptor(set);
setDesc.setDisplayName(setDesc.getDisplayName() + suffix);
- return new MethodDescriptor[] { getDesc, setDesc };
+ return new MethodDescriptor[] { setDesc, getDesc };
}
@Override
Modified: harmony/enhanced/classlib/branches/java6/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/FakeFox03.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/FakeFox03.java?view=diff&rev=558609&r1=558608&r2=558609
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/FakeFox03.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/FakeFox03.java Sun Jul 22 22:51:34 2007
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package org.apache.harmony.beans.tests.support.mock;
public class FakeFox03 {
Modified: harmony/enhanced/classlib/branches/java6/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/FakeFox031.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/FakeFox031.java?view=diff&rev=558609&r1=558608&r2=558609
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/FakeFox031.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/FakeFox031.java Sun Jul 22 22:51:34 2007
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package org.apache.harmony.beans.tests.support.mock;
public class FakeFox031 {
Modified: harmony/enhanced/classlib/branches/java6/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/FakeFox031BeanInfo.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/FakeFox031BeanInfo.java?view=diff&rev=558609&r1=558608&r2=558609
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/FakeFox031BeanInfo.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/FakeFox031BeanInfo.java Sun Jul 22 22:51:34 2007
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package org.apache.harmony.beans.tests.support.mock;
import java.beans.BeanDescriptor;
Modified: harmony/enhanced/classlib/branches/java6/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/FakeFox03BeanInfo.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/FakeFox03BeanInfo.java?view=diff&rev=558609&r1=558608&r2=558609
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/FakeFox03BeanInfo.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/FakeFox03BeanInfo.java Sun Jul 22 22:51:34 2007
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package org.apache.harmony.beans.tests.support.mock;
import java.awt.Image;