[cp-patches] Fix for Eclipse transformer bug
I committed the attached patch to fix a problem with the transformer closing a stream which Eclipse did not expect to be closed. 2005-11-20 Chris Burdess [EMAIL PROTECTED] * gnu/xml/transform/TransformerImpl.java: Ensure that output stream is not closed if provided in the StreamResult. -- Chris Burdess ? gnu/xml/transform/TeeInputStream.java Index: gnu/xml/transform/TransformerImpl.java === RCS file: /cvsroot/classpath/classpath/gnu/xml/transform/TransformerImpl.java,v retrieving revision 1.6 diff -u -r1.6 TransformerImpl.java --- gnu/xml/transform/TransformerImpl.java 30 Sep 2005 07:17:04 - 1.6 +++ gnu/xml/transform/TransformerImpl.java 20 Nov 2005 12:02:48 - @@ -487,6 +487,7 @@ throws IOException { OutputStream out = null; +boolean created = false; try { out = sr.getOutputStream(); @@ -523,6 +524,7 @@ URL url = new URL(systemId); out = new FileOutputStream(url.getPath()); } +created = true; } out = new BufferedOutputStream(out); StreamSerializer serializer = @@ -539,7 +541,7 @@ { try { -if (out != null) +if (out != null created) { out.close(); } ___ Classpath-patches mailing list Classpath-patches@gnu.org http://lists.gnu.org/mailman/listinfo/classpath-patches
[cp-patches] FileChannel fd experiment
Hi list, Inspired by the recent gcc merge, the study on JNI warnings posted by Christian and the proposed VM interface for the net sockets I experimented a bit with the FileChannelImpl and rewrite it to not fetch the fd from an instance field, but just pass it to the jni method directly. Patch attached. This didn't give a real speedup with jamvm. Interesting enough a quick test with around 1000 small files reading/writing was a little quicker for the buffered case, but didn't show any change for the unbuffered case (where I had expected it). This patch isn't really meant as a real proposal. I will look into the vm interface for this class hopefully later when I go over the libgcj/classpath divergence again. But I thought I post it anyway so people could have a look/do some experiments themselves. Cheers, Mark Index: gnu/java/nio/channels/FileChannelImpl.java === RCS file: /cvsroot/classpath/classpath/gnu/java/nio/channels/FileChannelImpl.java,v retrieving revision 1.19 diff -u -r1.19 FileChannelImpl.java --- gnu/java/nio/channels/FileChannelImpl.java 11 Sep 2005 19:29:24 - 1.19 +++ gnu/java/nio/channels/FileChannelImpl.java 20 Nov 2005 17:49:42 - @@ -77,8 +77,6 @@ public static FileChannelImpl out; public static FileChannelImpl err; - private static native void init(); - static { if (Configuration.INIT_LOAD_LIBRARY) @@ -86,8 +84,6 @@ System.loadLibrary(javanio); } -init(); - in = new FileChannelImpl(0, READ); out = new FileChannelImpl(1, WRITE); err = new FileChannelImpl(2, WRITE); @@ -159,16 +155,36 @@ private native int open (String path, int mode) throws FileNotFoundException; - public native int available () throws IOException; - private native long implPosition () throws IOException; - private native void seek (long newPosition) throws IOException; - private native void implTruncate (long size) throws IOException; + public int available() throws IOException + { +return channelAvailable(fd); + } + private native int channelAvailable(int fd); + + private native long channelPosition(int fd) throws IOException; + + private native void channelSeek(int fd, long newPosition) throws IOException; + + private native void channelTruncate(int fd, long size) throws IOException; - public native void unlock (long pos, long len) throws IOException; + public void unlock(long pos, long len) throws IOException + { +channelUnlock(fd, pos, len); + } + private native void channelUnlock(int fd, long pos, long len) +throws IOException; - public native long size () throws IOException; + public long size() throws IOException + { +return channelSize(fd); + } + private native long channelSize(int fd); - protected native void implCloseChannel() throws IOException; + protected void implCloseChannel() throws IOException + { +channelClose(fd); + } + private native void channelClose(int fd) throws IOException; /** * Makes sure the Channel is properly closed. @@ -197,7 +213,7 @@ { if (position 0) throw new IllegalArgumentException (position: + position); -long oldPosition = implPosition (); +long oldPosition = channelPosition(fd); position (position); int result = read(dst); position (oldPosition); @@ -205,10 +221,18 @@ return result; } - public native int read () -throws IOException; + public int read () throws IOException + { +return channelReadByte(fd); + } + private native int channelReadByte(int fd) throws IOException; - public native int read (byte[] buffer, int offset, int length) + public int read(byte[] buffer, int offset, int length) throws IOException + { +return channelReadBytes(fd, buffer, offset, length); + } + private native int channelReadBytes(int fd, byte[] buffer, + int offset, int length) throws IOException; public long read (ByteBuffer[] dsts, int offset, int length) @@ -258,18 +282,27 @@ int result; long oldPosition; -oldPosition = implPosition (); -seek (position); +oldPosition = channelPosition(fd); +channelSeek(fd, position); result = write(src); -seek (oldPosition); +channelSeek(fd, oldPosition); return result; } - public native void write (byte[] buffer, int offset, int length) + public void write (byte[] buffer, int offset, int length) throws IOException + { +channelWriteBytes(fd, buffer, offset, length); + } + private native void channelWriteBytes(int fd, byte[] buffer, + int offset, int length) throws IOException; - public native void write (int b) throws IOException; + public void write (int b) throws IOException + { +channelWriteByte(fd, b); + } + private native void channelWriteByte(int fd, int b) throws IOException; public long write(ByteBuffer[] srcs, int offset, int length) throws IOException @@ -284,7
Re: Kerberos
Hi Jeff, Am Samstag, den 19.11.2005, 23:09 -0500 schrieb Jeff Bailey: Hi! I sent in a patch to implement the KerberosPrincipal class. Cool! What I was thinking is that there should probably really be three implementations of the Kerberos stuff. The first two are glue code around MIT Kerberos and Heimdal Kerberos. That way if you have a user who's already got a ticket, it continues to be useful in their Java environment. I think this is important for distribution integration. Yeah, I think this would be extremely helpful. The third is a native implementation so that people don't need to install Kerberos in order to have classpath installed. I don't know if this is necessary or even desirable. I think (as with many other areas too, like imageio vs imagemagick) having an own implementation would also be very desirable. GNU Classpath is not only targetted to be used in Linux-Distros, but also in Embedded Systems or at least systems that are completely different from Linux (think of all the platforms that kaffe runs on). Also I don't think a 'native' implementation makes much sense, I would prefer a Java-only solutions for as much stuff as possible, since native code is always a little harder to port to strange platforms. But maybe you mean with 'native' something like 'our own implementation'? Or is there something in Kerberos that can't be done Java-only? Cheers, Roman signature.asc Description: Dies ist ein digital signierter Nachrichtenteil ___ Classpath mailing list Classpath@gnu.org http://lists.gnu.org/mailman/listinfo/classpath
Re: Kerberos
On dim, 2005-11-20 at 20:42 +0100, Roman Kennke wrote: The third is a native implementation so that people don't need to install Kerberos in order to have classpath installed. I don't know if this is necessary or even desirable. I think (as with many other areas too, like imageio vs imagemagick) having an own implementation would also be very desirable. GNU Classpath is not only targetted to be used in Linux-Distros, but also in Embedded Systems or at least systems that are completely different from Linux (think of all the platforms that kaffe runs on). Also I don't think a 'native' implementation makes much sense, I would prefer a Java-only solutions for as much stuff as possible, since native code is always a little harder to port to strange platforms. But maybe you mean with 'native' something like 'our own implementation'? Or is there something in Kerberos that can't be done Java-only? Sorry, I chose my words poorly there. By 'native' I meant Done in Java. Is there a better word that means that? =) Tks, Jeff Bailey signature.asc Description: This is a digitally signed message part ___ Classpath mailing list Classpath@gnu.org http://lists.gnu.org/mailman/listinfo/classpath
Re: Kerberos
Jeff Bailey wrote: Sorry, I chose my words poorly there. By 'native' I meant Done in Java. Is there a better word that means that? =) Pure Java... ? -Archie __ Archie Cobbs *CTO, Awarix* http://www.awarix.com ___ Classpath mailing list Classpath@gnu.org http://lists.gnu.org/mailman/listinfo/classpath
Re: Kerberos
Archie Cobbs wrote: Jeff Bailey wrote: Sorry, I chose my words poorly there. By 'native' I meant Done in Java. Is there a better word that means that? =) Pure Java... ? Nice, but I think it may be (tm) Sun Microsystems, Inc. ___ Classpath mailing list Classpath@gnu.org http://lists.gnu.org/mailman/listinfo/classpath
JamVM 1.4.0 released
Hi, I'm pleased to announce the release of JamVM 1.4.0 (http://jamvm.sourceforge.net). This release adds support for Soft/Weak/Phantom references, along with GC-optimisations, and several bug-fixes. The full list of changes are here: http://sourceforge.net/project/shownotes.php?release_id=372551 Thanks, Rob. ___ Classpath mailing list Classpath@gnu.org http://lists.gnu.org/mailman/listinfo/classpath
[commit-cp] classpath ./ChangeLog gnu/xml/transform/Transfo...
CVSROOT:/cvsroot/classpath Module name:classpath Branch: Changes by: Chris Burdess [EMAIL PROTECTED] 05/11/20 12:08:35 Modified files: . : ChangeLog gnu/xml/transform: TransformerImpl.java Log message: 2005-11-20 Chris Burdess [EMAIL PROTECTED] * gnu/xml/transform/TransformerImpl.java: Ensure that output stream is not closed if provided in the StreamResult. CVSWeb URLs: http://savannah.gnu.org/cgi-bin/viewcvs/classpath/classpath/ChangeLog.diff?tr1=1.5677tr2=1.5678r1=textr2=text http://savannah.gnu.org/cgi-bin/viewcvs/classpath/classpath/gnu/xml/transform/TransformerImpl.java.diff?tr1=1.6tr2=1.7r1=textr2=text
[commit-cp] classpath ./ChangeLog java/awt/datatransfer/Dat...
CVSROOT:/cvsroot/classpath Module name:classpath Branch: Changes by: Jan Roehrich [EMAIL PROTECTED]05/11/21 01:58:27 Modified files: . : ChangeLog java/awt/datatransfer: DataFlavor.java Log message: 2005-11-21 Jan Roehrich [EMAIL PROTECTED] * java/awt/datatransfer/DataFlavor.java: fixed code formatting issues CVSWeb URLs: http://savannah.gnu.org/cgi-bin/viewcvs/classpath/classpath/ChangeLog.diff?tr1=1.5678tr2=1.5679r1=textr2=text http://savannah.gnu.org/cgi-bin/viewcvs/classpath/classpath/java/awt/datatransfer/DataFlavor.java.diff?tr1=1.25tr2=1.26r1=textr2=text