Christopher Friedt | 7 Feb 16:05
Picon
Gravatar

integer fd filedescriptor / mapping special files

Hi list -

I've been using this patch for years to a) allow access to the integer
file descriptor in jni as in [1], and b) to use the FileChannel.map()
method to map special files under linux using jamvm / classpath-0.98
(e.g. /dev/fb0).

Thought I would submit it to the list for inclusion in any new releases.

Feedback from any people wanting to validate is welcome.

If I recall correctly, one shortcoming is that the returned mapped
byte buffer is not 'direct'. Getting a direct map would require some
manipulation of fields in an underlying byte[] somewhere. Obviously, a
direct-mapped byte buffer would be more ideal. I think that requires
using some kind of Unsafe class somewhere, and I stopped at that
point. I don't mind doing the legwork for a direct mapped byte buffer
too, to make it for inclusion in the next release.

C

[1] http://www.kfu.com/~nsayer/Java/jni-filedesc.html
diff --git a/gnu/java/nio/FileChannelImpl.java b/gnu/java/nio/FileChannelImpl.java
index d4a374b..06fa205 100644
--- a/gnu/java/nio/FileChannelImpl.java
+++ b/gnu/java/nio/FileChannelImpl.java
@@ -176,7 +176,7 @@ public final class FileChannelImpl extends FileChannel
    *
(Continue reading)

Andrew Hughes | 31 Jan 16:41
Picon
Favicon

FYI: Improving Locale Support

I'm currently committing a series of patches to both cp-tools and
Classpath to improve our locale support.  The Mauve test described here:

http://sourceware.org/ml/mauve-patches/2012/msg00000.html

was created in response to a Fedora bug:

https://bugzilla.redhat.com/show_bug.cgi?id=712013

which identified holes in our locale data.

An initial fix was already applied:

http://developer.classpath.org/pipermail/classpath-patches/2012-January/006634.html

which fixes the initial bug, but there are still a number of issues
with cp-tools picking up the wrong data.  I've recently applied the following fixes:

1. https://lists.gnu.org/archive/html/commit-classpath/2012-01/msg00003.html to make cp-tools
use generics, avoiding a mass of warnings.
2. https://lists.gnu.org/archive/html/commit-classpath/2012-01/msg00004.htm to refactor
cp-tools, specifically making ListDataElement use modern collections and private fields.
3. https://lists.gnu.org/archive/html/commit-classpath/2012-01/msg00005.html removes
JavaGenerator, a dead class which is causing unnecessary
extra work.
4. https://lists.gnu.org/archive/html/commit-classpath/2012-01/msg00006.html makes the output
property files sorted by key so they can be compared.
5. https://lists.gnu.org/archive/html/commit-classpath/2012-01/msg00007.html is the
corresponding commit of sorted property files to Classpath
6. https://lists.gnu.org/archive/html/commit-classpath/2012-01/msg00009.html prevents the
(Continue reading)

Picon
Favicon

FYI: RH712013: pdftk crashes with java.lang.ArrayIndexOutOfBoundsException

I've just committed what is the first part of a larger fix for:

https://bugzilla.redhat.com/show_bug.cgi?id=712013

As explained in the bug report, this massively reduces the amount of
incorrect locale data (and avoids the exception), but there are still
some errors.  Fixing this requires changing the locale data, which
I'll do in a series of separate patches.

2011-12-12  Andrew John Hughes  <ahughes <at> redhat.com>

	RH712013: pdftk crashes with java.lang.ArrayIndexOutOfBoundsException
	* java/text/DateFormatSymbols.java:
	(getStringArray(List<ResourceBundle>, String, int)):
	Calls getStringArray(list,string,int,null).
	(getStringArray(List<ResourceBundle>, String, int, String[])):
	Populate a String array with locale data.  The data
	used is the first non-null non-empty element found
	as we traverse the locale hierarchy. May be supplemented
	by fallback data.
	(DateFormatSymbols(Locale)): Get a list of all bundles up the
	locale hierarchy, rather than just using the one specific locale.
	Use the improved getStringArray method to populate the arrays,
	supplying existing data where "sideways" inheritance takes place.

--

-- 
Andrew :)

Free Java Software Engineer
Red Hat, Inc. (http://www.redhat.com)
(Continue reading)

Pekka Enberg | 6 Jan 20:57
Favicon
Gravatar

[RFC/PATCH v2] Add java/io/Console class and java/lang/System.console() method

This patch implements java/io/Console and adds a console() method to
java/lang/System. The implementation is lame but it works reasonably well.

2012-01-06  Pekka Enberg  <penberg <at> kernel.org>

	* include/Makefile.am:
	Add java_io_VMConsole.h.

	* java/io/Console:
	Add Java 1.6 java/io/Console API.

	* java/lang/System.java:
	(console): Add Java 1.6 console() API.

	* vm/reference/java/io/VMConsole:
	Add new class.

	* native/jni/java-io/Makefile.am:
	Add java_io_VMConsole.c.

	* native/jni/java-io/java_io_VMConsole.c:
	Add native helpers for java/io/Console.

Signed-off-by: Pekka Enberg <penberg <at> kernel.org>
---
 include/Makefile.am                    |    3 +
 java/io/Console.java                   |  122 ++++++++++++++++++++++++++++++++
 java/lang/System.java                  |   11 +++-
 native/jni/java-io/Makefile.am         |    3 +-
 native/jni/java-io/java_io_VMConsole.c |   88 +++++++++++++++++++++++
(Continue reading)

Pekka Enberg | 5 Jan 20:14
Favicon
Gravatar

[RFC/PATCH v2 1/2] Add java.io.IOError class

This patch adds a missing IOError class to GNU Classpath that was introduced in
Java 1.6.

2012-01-05  Pekka Enberg  <penberg <at> kernel.org>

        * java/io/IOError:
        Add new class.

Signed-off-by: Pekka Enberg <penberg <at> kernel.org>
---
 java/io/IOError.java |   54 ++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 54 insertions(+), 0 deletions(-)
 create mode 100644 java/io/IOError.java

diff --git a/java/io/IOError.java b/java/io/IOError.java
new file mode 100644
index 0000000..176b4bd
--- /dev/null
+++ b/java/io/IOError.java
@@ -0,0 +1,54 @@
+/* IOError.java -- Throw when unrecoverable I/O error happens.
+   Copyright (C) 2012  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.
+
(Continue reading)

Pekka Enberg | 5 Jan 18:25
Favicon
Gravatar

[RFC/PATCH] Add java.io.IOError class

This patch adds a missing IOError class to GNU Classpath that was introduced in
Java 1.6.

2012-01-05  Pekka Enberg  <penberg <at> kernel.org>

        * java/io/IOError:
        Add new class.

Signed-off-by: Pekka Enberg <penberg <at> kernel.org>
---
 java/io/IOError.java |   54 ++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 54 insertions(+), 0 deletions(-)
 create mode 100644 java/io/IOError.java

diff --git a/java/io/IOError.java b/java/io/IOError.java
new file mode 100644
index 0000000..3ad9f37
--- /dev/null
+++ b/java/io/IOError.java
@@ -0,0 +1,54 @@
+/* IOError.java -- Throw when unrecoverable I/O error happens.
+   Copyright (C) 2012  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.
+
(Continue reading)

Andreas Tobler | 28 Nov 20:37
Picon

[patch] update FreeBSD 10 configury changes

Hi,

the below patch makes sure that FreeBSD-10 and up gets properly detected 
in config.rpath.

Ok?

I'm going to apply the same patch on gcc trunk and gcc-4.6.

Thanks,
Andreas

2011-11-28  Andreas Tobler  <andreast <at> fgznet.ch>

	* config.rpath (ld_shlibs): Fix detection of FreeBSD-10 and up.
	(libname_spec): Likewise.

Index: config.rpath
===================================================================
--- config.rpath	(revision 181783)
+++ config.rpath	(working copy)
@@ -361,7 +361,7 @@
        hardcode_libdir_flag_spec='-R$libdir'
        hardcode_direct=yes
        ;;
-    freebsd2*)
+    freebsd2.*)
        hardcode_direct=yes
        hardcode_minus_L=yes
        ;;
(Continue reading)

Pekka Enberg | 24 Oct 09:11
Favicon
Gravatar

[RFC/PATCH] Fix NPE in HashMap.put()

Stefan Ring reports that commit f154af6 ("Fix HashMap.put() to check for
hashCode equality before equals()") breaks running the CACAO test suite for me.
It looks like this:

  LD_LIBRARY_PATH=../../../src/cacao/.libs ../../../src/cacao/cacao
-Xbootclasspath:../../../src/classes/classes:/home/sr/classpathcvs/share/classpath/glibj.zip
-classpath /usr/share/java/junit4.jar:. org.junit.runner.JUnitCore All
  JUnit version 4.5
  .E
  Time: 0.003
  There was 1 failure:
  1) initializationError(All)
  java.lang.NullPointerException
     at java.util.HashMap.put(HashMap.java:348)
     at java.util.HashSet.add(HashSet.java:151)
     at org.junit.runners.model.RunnerBuilder.addParent(RunnerBuilder.java:64)
     at org.junit.runners.model.RunnerBuilder.runners(RunnerBuilder.java:81)
     at org.junit.runners.Suite.<init>(Suite.java:88)
     at org.junit.runners.Suite.<init>(Suite.java:54)
     at java.lang.reflect.VMConstructor.construct(Native Method)
     at java.lang.reflect.Constructor.newInstance(Constructor.java:318)
     at org.junit.internal.builders.AnnotatedBuilder.buildRunner(AnnotatedBuilder.java:35)
     at org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:24)
     at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:57)
     at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:29)
     at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:57)
     at org.junit.runners.model.RunnerBuilder.runners(RunnerBuilder.java:93)
     at org.junit.runners.model.RunnerBuilder.runners(RunnerBuilder.java:84)
     at org.junit.runners.Suite.<init>(Suite.java:66)
     at org.junit.runner.Request.classes(Request.java:68)
(Continue reading)

Pekka Enberg | 11 Oct 23:00
Favicon
Gravatar

[PATCH] Fix raw type references in AnnotationInvocationHandler

This patch converts AnnotationInvoncationHandler to use parametrized types for
Class, Map, and Iterator which kills few compilation warnings during build.

Signed-off-by: Pekka Enberg <penberg <at> kernel.org>
---
 ChangeLog                                          |   10 ++++++
 .../annotation/AnnotationInvocationHandler.java    |   31 +++++++++++--------
 2 files changed, 28 insertions(+), 13 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 7f57a9e..cf728f4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2011-10-11  Pekka Enberg  <penberg <at> kernel.org>
+
+	* sun/reflect/annotation/AnnotationInvocationHandler.java:
+	(AnnotationInvocationHandler): Parametrize raw types.
+	(create): Parametrize raw types.
+	(equals): Parametrize raw types.
+	(hashCode): Parametrize raw types.
+	(toString): Parametrize raw types.
+	(getBoxedReturnType): Parametrize raw types.
+
 2011-09-09  Andrew John Hughes  <ahughes <at> redhat.com>

 	PR classpath/45526: Produce header files for
diff --git a/sun/reflect/annotation/AnnotationInvocationHandler.java b/sun/reflect/annotation/AnnotationInvocationHandler.java
index 909e7ae..7d585a9 100644
--- a/sun/reflect/annotation/AnnotationInvocationHandler.java
(Continue reading)

Picon
Favicon

FYI: PR45526: Produce header files for inner classes

This patch makes gjavah have the same behaviour as OpenJDK's javah
in producing header files for any inner classes found in the classes
being parsed.

ChangeLog:

2011-09-09  Andrew John Hughes  <ahughes <at> redhat.com>

	PR classpath/45526: Produce header files for
	any inner classes found.
	* tools/gnu/classpath/tools/javah/Main.java:
	(parsed): Set of class names that have been parsed.
	(writeHeader(Map,Printer)): Take a general Map
	rather than a specific HashMap.
	(parseClasses(Iterator<Object>)): Factor out
	the parsing of class files into a separate
	method so it can be called recursively for
	inner classes.
	(getClass(String)): Remove redundant cast.

--

-- 
Andrew :)

Free Java Software Engineer
Red Hat, Inc. (http://www.redhat.com)

Support Free Java!
Contribute to GNU Classpath and IcedTea
http://www.gnu.org/software/classpath
http://icedtea.classpath.org
(Continue reading)

Picon
Favicon

FYI: Fix javah issues

I've applied a couple of patches (attached) to fix some long standing
javah issues:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40188
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45527

These fixes allow gjavah to generate header files during the OpenJDK
build in the same way as the OpenJDK javah.

ChangeLog:

2011-07-07  Andrew John Hughes  <ahughes <at> redhat.com>

	PR classpath/45527
	* tools/gnu/classpath/tools/javah/JniHelper.java:
	(mangle(String)): Replace '$' with '_' rather than
	encoding it as hex.

2011-07-07  Andrew John Hughes  <ahughes <at> redhat.com>

	PR classpath/40188
	* tools/gnu/classpath/tools/javah/JniIncludePrinter.java:
	(writeFields(ClassWrapper,JniPrintStream)): Retain a
	reference to the original class and use it in naming
	fields, as opposed to the class in which it occurs.

--

-- 
Andrew :)

Free Java Software Engineer
(Continue reading)


Gmane