[cp-patches] FYI: Updgrading CORBA interceptor system to CORBA 3.0.3 (jdk 1.5)
This patch introduces IORInterceptor_3_0.java that appears from jdk 1.5 and implements changes, required for this class to work. 2005-11-11 Audrius Meskauskas [EMAIL PROTECTED] * org/omg/PortableInterceptor/IORInterceptor_3_0.java, org/omg/PortableInterceptor/IORInterceptor_3_0Helper.java, org/omg/PortableInterceptor/IORInterceptor_3_0Holder.java, org/omg/PortableInterceptor/IORInterceptor_3_0Operations.java, org/omg/PortableInterceptor/_IORInterceptor_3_0Stub.java: New files. * gnu/CORBA/Interceptor/IORInterceptors.java, gnu/CORBA/Interceptor/gnuIorInfo.java, gnu/CORBA/OrbRestricted.java, gnu/CORBA/Poa/AOM.java, gnu/CORBA/Poa/ORB_1_4.java, gnu/CORBA/Poa/gnuPOA.java, gnu/CORBA/Poa/gnuPOAManager.java, org/omg/PortableInterceptor/IORInfoOperations.java, org/omg/PortableInterceptor/IORInterceptorOperations.java, org/omg/PortableInterceptor/ORBInitInfoOperations.java, org/omg/PortableInterceptor/ObjectReferenceFactoryOperations.java: Rewritten to support the IORInterceptor_3_0. Interceptors5.tar.gz Description: GNU Zip compressed data ___ Classpath-patches mailing list Classpath-patches@gnu.org http://lists.gnu.org/mailman/listinfo/classpath-patches
[cp-patches] FYI: Fix for SocketChannelImpl.read()
John Zigman spotted a typo in SocketChannelImpl.read() where we could put too much bytes into the destination ByteBufffer. This fixes it as he suggested. 2005-11-11 Mark Wielaard [EMAIL PROTECTED] Reported by [EMAIL PROTECTED] as bug #24608. * gnu/java/nio/SocketChannelImpl.java (read): Put readBytes in destination ByteBuffer when it doesn't have an array instead of len bytes. Committed, Mark diff -u -r1.27 SocketChannelImpl.java --- gnu/java/nio/SocketChannelImpl.java 2 Jul 2005 20:32:13 - 1.27 +++ gnu/java/nio/SocketChannelImpl.java 11 Nov 2005 11:59:58 - @@ -258,7 +258,7 @@ } else { - dst.put (data, offset, len); + dst.put (data, offset, readBytes); } return readBytes; signature.asc Description: This is a digitally signed message part ___ Classpath-patches mailing list Classpath-patches@gnu.org http://lists.gnu.org/mailman/listinfo/classpath-patches
Re: [cp-patches] FYI: Swing text fixlets
Hi Roman, On Fri, 2005-11-04 at 15:42 +0100, Mark Wielaard wrote: On Fri, 2005-11-04 at 11:33 +, Roman Kennke wrote: This adds the getMinimumSize() method to the BasicTextUI and replaces a 'should never happen' comment with an assert statement. [...] catch (BadLocationException e) { - // This should never happen. - text = ; +assert false : e.toString(); +text = ; } Please chain the exception before throwing the assert. I fixed this for you as follows: 2005-11-11 Mark Wielaard [EMAIL PROTECTED] * javax/swing/text/FieldView.java (getPreferredSpan): Chain BadLocationException when throwing assertion. Committed, Mark diff -u -r1.9 FieldView.java --- javax/swing/text/FieldView.java 4 Nov 2005 11:32:05 - 1.9 +++ javax/swing/text/FieldView.java 11 Nov 2005 12:46:13 - @@ -130,8 +130,10 @@ } catch (BadLocationException e) { -assert false : e.toString(); -text = ; + // Should never happen + AssertionError ae = new AssertionError(); + ae.initCause(e); + throw ae; } return fm.stringWidth(text); signature.asc Description: This is a digitally signed message part ___ Classpath-patches mailing list Classpath-patches@gnu.org http://lists.gnu.org/mailman/listinfo/classpath-patches
[cp-patches] RFC: Container fix
I made this change because I found in some case events were not being dispatched properly. If in the MOUSE_CLICKED event we find that the candidate (for mouseEventTarget) and the pressedComponent are not equal, null is returned for the mouseEventTarget. In this case, I think that pressCount should be reset to 0, since MOUSE_PRESSED and MOUSE_RELEASED events are not going to be dispatched for this component. Also, pressedComponent will be reset to something else when MOUSE_PRESSED is dispatched the next time (and pressCount will be incremented appropriately). I don't want to commit this patch until it gets approved from someone (I may be overlooking something). Thanks! 2005-11-11 Lillian Angel [EMAIL PROTECTED] * java/awt/Container.java (LightweightDispatcher.acquireComponentForMouseEvent): If the event is not being dispatched, the pressCount should be reset. Index: java/awt/Container.java === RCS file: /cvsroot/classpath/classpath/java/awt/Container.java,v retrieving revision 1.67 diff -u -r1.67 Container.java --- java/awt/Container.java 8 Nov 2005 13:25:30 - 1.67 +++ java/awt/Container.java 10 Nov 2005 22:56:00 - @@ -2166,7 +2166,10 @@ // Don't dispatch CLICKED events whose target is not the same as the // target for the original PRESSED event. if (candidate != pressedComponent) - mouseEventTarget = null; + { +mouseEventTarget = null; +pressCount = 0; + } else if (pressCount == 0) pressedComponent = null; } ___ Classpath-patches mailing list Classpath-patches@gnu.org http://lists.gnu.org/mailman/listinfo/classpath-patches
Re: [cp-patches] Patch: Container fix
This looks fine to me. Tom Committed. Thanks. ___ Classpath-patches mailing list Classpath-patches@gnu.org http://lists.gnu.org/mailman/listinfo/classpath-patches
Re: [cp-patches] RFC: new VM interface for Socket impls
Hi, On Wed, 2005-11-09 at 21:16 +, Roman Kennke wrote: Ingo has abstracted out the native code from gnu.java.net.PlainSocketImpl and gnu.java.net.PlainDatagramSocketImpl into a new VM interface. This allows VM implementors to provide a different implementation for the native parts of these classes if they wish. Is this ok to commit as it is? Do you have any suggestions/improvements to the interface? We would like to have a stable VM interface for this area, so maybe it would be helpful to discuss this with other VM implementors... Great idea! This is one area where there is a large divergence between classpath and libgcj because we never had VMClasses here. IKVM also has a completely different implementation of these classes. So I hope Jeroen also can take a look. I have attached just the VM files to give others an idea what we want to use. I'll comment some more after I have looked at the libgcj sources. A first comment is that for the VM reference implementation I would just make all methods native directly, no need to chain them to some helper method here. Is there a reason that only nativeLeave() is synchronized? After we agree on this VM interface (and I think it is good, I just want to try it out first) we can discuss the rest of the patch. Just one quick nitpick now already: please keep the boilerplate at the top of the file intact, some of the files in the patch have the old FSF address. Cheers, Mark /* VMPlainSocketImpl.java -- VM interface for default socket implementation Copyright (C) 2005 Free Software Foundation, Inc. This file is part of GNU Classpath. GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GNU Classpath; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package gnu.java.net; import java.io.InputStream; import java.io.IOException; import java.io.OutputStream; import java.net.InetAddress; import java.net.InetSocketAddress; import java.net.SocketAddress; import java.net.SocketException; import java.net.SocketImpl; import java.net.SocketOptions; import gnu.classpath.Configuration; /** * The VM interface for [EMAIL PROTECTED] gnu.java.net.PlainSocketImpl}. * * @author Ingo Proetel ([EMAIL PROTECTED]) */ public final class VMPlainSocketImpl { // Static initializer to load native library. static { if (Configuration.INIT_LOAD_LIBRARY) { System.loadLibrary(javanet); } } /** * Sets the specified option on a socket to the passed in object. For * options that take an integer argument, the passed in object is an * Integer. The option_id parameter is one of the defined constants in * this interface. * * @param option_id The identifier of the option * @param val The value to set the option to * * @exception SocketException If an error occurs */ static void setOption(PlainSocketImpl socket, int optID, Object value) throws SocketException { nativeSetOption(socket, optID, value); } private static native void nativeSetOption(PlainSocketImpl socket,int optID, Object value) throws SocketException; /** * Returns the current setting of the specified option. The Object returned * will be an Integer for options that have integer values. The option_id * is one of the defined constants in this interface. * * @param option_id The option identifier * * @return The current value of the option * * @exception SocketException If an
[cp-patches] Fix for autogen.sh
I've checked in this fix for autogen.sh on FreeBSD. 2005-11-11 Archie Cobbs [EMAIL PROTECTED] * autogen.sh: Fix broken libtool version detection on FreeBSD. -Archie __ Archie Cobbs *CTO, Awarix* http://www.awarix.com Index: autogen.sh === RCS file: /cvsroot/classpath/classpath/autogen.sh,v retrieving revision 1.13 diff -u -r1.13 autogen.sh --- autogen.sh 3 Sep 2005 20:32:04 - 1.13 +++ autogen.sh 11 Nov 2005 17:44:31 - @@ -16,7 +16,7 @@ have_libtool=false if ${LIBTOOLIZE} --version /dev/null /dev/null 21 ; then - libtool_version=`${LIBTOOLIZE} --version | sed 's/^[^0-9]*\([0-9.][0-9.]*\).*/\1/'` + libtool_version=`${LIBTOOLIZE} --version | sed 's/^.*[^0-9.]\([0-9]\{1,\}\.[0-9.]\{1,\}\).*/\1/'` case $libtool_version in 1.5*) have_libtool=true ___ Classpath-patches mailing list Classpath-patches@gnu.org http://lists.gnu.org/mailman/listinfo/classpath-patches
[cp-patches] Patch: BasicSplitPaneUI fix
Small fix for the split pane. 2005-11-11 Lillian Angel [EMAIL PROTECTED] * javax/swing/plaf/basic/BasicSplitPaneUI.java (getMinimumDividerLocation): Fixed to use the minimum size of the correct component. Also, removed call to getAvailableSize, this is not needed for the minimum location. Index: javax/swing/plaf/basic/BasicSplitPaneUI.java === RCS file: /cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicSplitPaneUI.java,v retrieving revision 1.20 diff -u -r1.20 BasicSplitPaneUI.java --- javax/swing/plaf/basic/BasicSplitPaneUI.java 18 Oct 2005 22:10:32 - 1.20 +++ javax/swing/plaf/basic/BasicSplitPaneUI.java 11 Nov 2005 20:35:19 - @@ -1361,11 +1361,9 @@ */ public int getMinimumDividerLocation(JSplitPane jc) { -int value = layoutManager.getInitialLocation(jc.getInsets()) -- layoutManager.getAvailableSize(jc.getSize(), jc.getInsets()) -+ splitPane.getDividerSize(); -if (layoutManager.components[1] != null) - value += layoutManager.minimumSizeOfComponent(1); +int value = layoutManager.getInitialLocation(jc.getInsets()); +if (layoutManager.components[0] != null) + value -= layoutManager.minimumSizeOfComponent(0); return value; } ___ Classpath-patches mailing list Classpath-patches@gnu.org http://lists.gnu.org/mailman/listinfo/classpath-patches
Re: [cp-patches] FYI: BasicListUI
On Fri, 2005-11-11 at 16:09 -0500, Lillian Angel wrote: On Thu, 2005-11-10 at 20:35 +, Roman Kennke wrote: Hi, I fixed some buggies in the BasicListUI. The fixed cell height and width should now correctly be recognized. In addition to that I optimized the painting so that only the cells within the clip bounds are painted. This greatly improved performance when scrolling. This is really smooth now. I'll implement a similar optimization for JTable, JTree and the text components soon. 2005-11-10 Roman Kennke [EMAIL PROTECTED] * javax/swing/plaf/basic/BasicListUI.java (valueChanged): Repaint list when selection changed. (updateLayoutState): Reworked to correctly respect fixed cell sizes. (installListeners): Create component listener before adding it. (paint): Optimized to only draw the cells in the clip. Also, attached is the same test case with a simple change. I put the list inside a JScrollPane. When you scroll, your patch works, but the painting is not reliable- the list disappears sometimes when scrolling. Lillian import java.awt.*; import javax.swing.*; public class MyList extends JFrame { private JList list; private JButton m_addButton; public MyList() { setTitle(Scrollable JList); Object[] items = {aa, aaa, , a, a, aa, aaa, , a, a, b, bb, bbb, , b, bb, bbb}; list = new JList(items); JScrollPane scrollPane = new JScrollPane(list); getContentPane().add(scrollPane, BorderLayout.CENTER); pack(); show(); } public static void main(String[] args) { new MyList(); } } ___ Classpath-patches mailing list Classpath-patches@gnu.org http://lists.gnu.org/mailman/listinfo/classpath-patches
Re: [cp-patches] Patch: use StringBuilder for reading/writing property files
On Wed, 2005-11-02 at 11:31 +0100, Christian Thalinger wrote: On Tue, 2005-11-01 at 22:16 +0100, Mark Wielaard wrote: That seems like an significant improvement. Could you test with a larger dataset (or just run the test in a loop 10 times)? I still haven't tried with gcj. If someone could test, that would be super. I believe gcj has really slow monitor enter and exit support so the speedup should be significant there. But without testing... In a 10 times loop (fastest of 3 runs): w/o: 13.92user w/: 10.14user And I finally tested against gcj. Before: 0m3.765s After: 0m2.370s (Best of 3 for reading all classpath property files 4 times) So this seems like a nice optimization and I am checking it in as: 2005-11-11 Mark Wielaard [EMAIL PROTECTED] Anthony Green [EMAIL PROTECTED] * java/util/Properties.java (load): Short-circuit parsing when key or value doesn't contain escape character. Use StringBuilder instead of StringBuffer. (store): Use StringBuilder instead of StringBuffer. (formatForOutput): Likewise. Cheers, Mark Index: java/util/Properties.java === RCS file: /cvsroot/classpath/classpath/java/util/Properties.java,v retrieving revision 1.34 diff -u -r1.34 Properties.java --- java/util/Properties.java 23 Oct 2005 21:56:31 - 1.34 +++ java/util/Properties.java 30 Oct 2005 11:09:05 - @@ -219,12 +219,15 @@ // The characters up to the next Whitespace, ':', or '=' // describe the key. But look for escape sequences. -StringBuffer key = new StringBuffer(); + // Try to short-circuit when there is no escape char. + int start = pos; + boolean needsEscape = line.indexOf('\\', pos) != -1; +StringBuilder key = needsEscape ? new StringBuilder() : null; while (pos line.length() ! Character.isWhitespace(c = line.charAt(pos++)) c != '=' c != ':') { -if (c == '\\') +if (needsEscape c == '\\') { if (pos == line.length()) { @@ -268,11 +271,20 @@ } } } -else +else if (needsEscape) key.append(c); } boolean isDelim = (c == ':' || c == '='); + + String keyString; + if (needsEscape) + keyString = key.toString(); + else if (isDelim || Character.isWhitespace(c)) + keyString = line.substring(start, pos - 1); + else + keyString = line.substring(start, pos); + while (pos line.length() Character.isWhitespace(c = line.charAt(pos))) pos++; @@ -285,7 +297,15 @@ pos++; } -StringBuffer element = new StringBuffer(line.length() - pos); + // Short-circuit if no escape chars found. + if (!needsEscape) + { + put(keyString, line.substring(pos)); + continue; + } + + // Escape char found so iterate through the rest of the line. +StringBuilder element = new StringBuilder(line.length() - pos); while (pos line.length()) { c = line.charAt(pos++); @@ -341,7 +361,7 @@ else element.append(c); } -put(key.toString(), element.toString()); +put(keyString, element.toString()); } } @@ -405,7 +425,7 @@ Iterator iter = entrySet ().iterator (); int i = size (); -StringBuffer s = new StringBuffer (); // Reuse the same buffer. +StringBuilder s = new StringBuilder (); // Reuse the same buffer. while (--i = 0) { Map.Entry entry = (Map.Entry) iter.next (); @@ -548,7 +568,7 @@ *leading spaces must be escaped for the value * @see #store(OutputStream, String) */ - private void formatForOutput(String str, StringBuffer buffer, boolean key) + private void formatForOutput(String str, StringBuilder buffer, boolean key) { if (key) { signature.asc Description: This is a digitally signed message part ___ Classpath-patches mailing list Classpath-patches@gnu.org http://lists.gnu.org/mailman/listinfo/classpath-patches