Re: Re: GCJ ------ file type not supported by system

2014-09-04 Thread Pekka Enberg
El jueves, 4 de septiembre de 2014, Pekka Enberg penb...@kernel.org escribió:
 No, it's really not unfair at all. You are basically saying Andrew is
 doing a crappy job as a maintainer

On Thu, Sep 4, 2014 at 10:29 PM, Guillermo Rodriguez Garcia
guille.rodrig...@gmail.com wrote:
 No, I am definitely NOT saying that, nothing even close. Please don't put
 your words in my mouth, thank you.

Of course you are saying that. Why else would you even bring up the
issue of finding a competent successor which implies that Andrew is
no longer interested in GNU Classpath and neglecting its maintenance?

El jueves, 4 de septiembre de 2014, Pekka Enberg penb...@kernel.org escribió:
 Once you answer the hypothetical question *who* should
 be the successor, you will understand why.

On Thu, Sep 4, 2014 at 10:29 PM, Guillermo Rodriguez Garcia
guille.rodrig...@gmail.com wrote:
 I see, so if I don't have the answer, the question makes no sense. Ok.

You didn't even try to answer the question, did you?

If Andrew actually needed a competent successor (he doesn't), what
is required of that person? The person needs to be an active
developer, needs to understand GNU Classpath well, and has to have
support from people who actually developed the project, right?

Are you able to make an educated guess who actually meets that criteria?

- Pekka



Re: GCJ ------ file type not supported by system

2014-09-04 Thread Pekka Enberg
On Thu, Sep 4, 2014 at 11:15 PM, Andrew Haley a...@redhat.com wrote:
 Everyone: let's have a proper discussion.  Is there something we can
 do with GNU Classpath that takes it further forward.  And, if so,
 what?  What would our goals be?

I think Guillermo is right that we need to update the GNU Classpath
web site. Right now, it gives the impression that the project is
abandoned...

- Pekka



Re: [cp-patches] [commit-cp] [SCM] UNNAMED PROJECT branch, gtk3, updated. 5a58f06dc8b6d190c3ef09aad49d0940f33f3ade

2013-09-19 Thread Pekka Enberg
On Thu, Sep 19, 2013 at 3:59 AM, Andrew John Hughes
gnu_and...@member.fsf.org wrote:
 This is an automated email from the git hooks/post-receive script. It was
 generated because a ref change was pushed to the repository containing
 the project UNNAMED PROJECT.

Where does the UNNAMED PROJECT thing come from? Are we missing
something from the git repository for that to be GNU Classpath?



Re: [commit-cp] [SCM] UNNAMED PROJECT branch, gtk3, updated. 5a58f06dc8b6d190c3ef09aad49d0940f33f3ade

2013-09-19 Thread Pekka Enberg
On Thu, Sep 19, 2013 at 3:59 AM, Andrew John Hughes
gnu_and...@member.fsf.org wrote:
 This is an automated email from the git hooks/post-receive script. It was
 generated because a ref change was pushed to the repository containing
 the project UNNAMED PROJECT.

Where does the UNNAMED PROJECT thing come from? Are we missing
something from the git repository for that to be GNU Classpath?



Re: Building classpath on Minix3

2013-04-08 Thread Pekka Enberg
On Mon, Apr 8, 2013 at 2:47 PM, Alexander Samilovskih
alexsamilovs...@gmail.com wrote:
 Trying to build
 ./autogen.sh

 configure.ac:505: warning: AC_LIB_PREPARE_PREFIX is m4_require'd but not

[snip]

 -
 Google said that problem related to gettext, but i have it installed
 gettext --version
 gettext (GNU gettext-runtime) 0.18.1
 Copyright (C) 1995-1997, 2000-2007 Free Software Foundation, Inc.
 License GPLv3+: GNU GPL version 3 or later
 http://gnu.org/licenses/gpl.html
 This is free software: you are free to change and redistribute it.
 There is NO WARRANTY, to the extent permitted by law.
 Written by Ulrich Drepper.

It's not enough that you have gettext installed, you also need to
make sure the following file exists:

/usr/share/aclocal/gettext.m4

On Fedora, for example, it's part of gettext-devel package that's not
installed by default.

Pekka



[cp-patches] [RFC/PATCH] Check for gettext m4 macros in autogen.sh

2013-03-12 Thread Pekka Enberg
If gettext-devel package is not installed on Fedora, autogen.sh fails as
follows:

  [penberg@tux classpath]$ sh autogen.sh
  configure.ac:505: warning: AC_LIB_PREPARE_PREFIX is m4_require'd but not 
m4_defun'd
  m4/iconv.m4:11: AM_ICONV_LINKFLAGS_BODY is expanded from...
  m4/iconv.m4:22: AM_ICONV_LINK is expanded from...
  m4/iconv.m4:77: AM_ICONV is expanded from...

Make the script more user fiendly by explicitly checking for the
presence of gettext.m4 in the system.

Cc: Andrew John Hughes  gnu_and...@member.fsf.org
Cc: Brian Jones cbjon...@gmail.com
Signed-off-by: Pekka Enberg penb...@kernel.org
---
 ChangeLog  |5 +
 autogen.sh |7 +++
 2 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 289a979..e26f627 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-03-12  Pekka Enberg penb...@kernel.org
+
+   * autogen.sh:
+   Check that gettext.m4 is installed.
+
 2013-03-09  Pekka Enberg penb...@kernel.org
 
* .gitignore: Exclude autogen-generated files.
diff --git a/autogen.sh b/autogen.sh
index adb8f0c..df0095f 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -34,6 +34,13 @@ if $have_libtool ; then : ; else
DIE=1
 fi
 
+if [ ! -e $(aclocal --print-ac-dir)/gettext.m4 ] ; then
+   echo
+   echo You must have gettext package and, if applicable to your
+   echo system, gettext-devel package installed to compile $PROJECT.
+   DIE=1
+fi
+
 if test $DIE -eq 1; then
exit 1
 fi
-- 
1.7.7.6




Re: Building GNU Classpath on Fedora 17

2013-03-12 Thread Pekka Enberg
Hi Brian,

On Mon, Mar 11, 2013 at 4:41 PM, Brian Jones cbjon...@gmail.com wrote:
 Add a configure check for whatever the dependency is...

I'm having difficult time figuring out what to check for... It seems
that gettext-devel package provides AC_LIB_PREPARE_PREFIX via
/usr/share/aclocal/lib-prefix.m4 that's automagically picked up by
autogen.sh. Surely I can't just go and check if the file exists?

Pekka



Re: Building GNU Classpath on Fedora 17

2013-03-12 Thread Pekka Enberg
On Tue, Mar 12, 2013 at 12:47 PM, Andrew Hughes gnu.and...@redhat.com wrote:
 Looking at rpm -ql gettext-devel on my RHEL system, it seems to add a slew
 of m4 files to /usr/share/aclocal.  Maybe if -e /usr/share/aclocal/gettext.m4
 in autogen.sh would be sufficient?

The attached patch works for me. Does it look OK to commit?


0001-Check-for-gettext-in-autogen.sh.patch
Description: Binary data


Re: [cp-patches] [RFC/PATCH] Add autogen-generated files to gitignore

2013-03-11 Thread Pekka Enberg
On Mon, Mar 11, 2013 at 3:20 PM, Andrew Hughes gnu.and...@redhat.com wrote:
 Fine by me.  I've been planning to commit the same, but there's always 
 something I'm working on.

I merged the variant suggested by Mark. Thanks!



Building GNU Classpath on Fedora 17

2013-03-11 Thread Pekka Enberg
Hello,

GNU Classpath build fails as follows with stock Fedora 17 libtools:

[penberg@golgotha classpath]$ sh autogen.sh
configure.ac:505: warning: AC_LIB_PREPARE_PREFIX is m4_require'd but
not m4_defun'd
m4/iconv.m4:11: AM_ICONV_LINKFLAGS_BODY is expanded from...
m4/iconv.m4:22: AM_ICONV_LINK is expanded from...
m4/iconv.m4:77: AM_ICONV is expanded from...
configure.ac:505: the top level
configure.ac:505: warning: AC_LIB_RPATH is m4_require'd but not m4_defun'd
m4/iconv.m4:11: AM_ICONV_LINKFLAGS_BODY is expanded from...
m4/iconv.m4:22: AM_ICONV_LINK is expanded from...
m4/iconv.m4:77: AM_ICONV is expanded from...
configure.ac:505: the top level
configure.ac:505: warning: AC_LIB_PREPARE_PREFIX is m4_require'd but
not m4_defun'd
m4/iconv.m4:11: AM_ICONV_LINKFLAGS_BODY is expanded from...
m4/iconv.m4:22: AM_ICONV_LINK is expanded from...
m4/iconv.m4:77: AM_ICONV is expanded from...
configure.ac:505: the top level
configure.ac:505: warning: AC_LIB_RPATH is m4_require'd but not m4_defun'd
m4/iconv.m4:11: AM_ICONV_LINKFLAGS_BODY is expanded from...
m4/iconv.m4:22: AM_ICONV_LINK is expanded from...
m4/iconv.m4:77: AM_ICONV is expanded from...
configure.ac:505: the top level
libtoolize: putting auxiliary files in `.'.
libtoolize: copying file `./ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4'.
libtoolize: copying file `m4/libtool.m4'
libtoolize: copying file `m4/ltoptions.m4'
libtoolize: copying file `m4/ltsugar.m4'
libtoolize: copying file `m4/ltversion.m4'
libtoolize: copying file `m4/lt~obsolete.m4'
configure.ac:505: warning: AC_LIB_PREPARE_PREFIX is m4_require'd but
not m4_defun'd
m4/iconv.m4:11: AM_ICONV_LINKFLAGS_BODY is expanded from...
m4/iconv.m4:22: AM_ICONV_LINK is expanded from...
m4/iconv.m4:77: AM_ICONV is expanded from...
configure.ac:505: the top level
configure.ac:505: warning: AC_LIB_RPATH is m4_require'd but not m4_defun'd
m4/iconv.m4:11: AM_ICONV_LINKFLAGS_BODY is expanded from...
m4/iconv.m4:22: AM_ICONV_LINK is expanded from...
m4/iconv.m4:77: AM_ICONV is expanded from...
configure.ac:505: the top level
configure.ac:505: warning: AC_LIB_PREPARE_PREFIX is m4_require'd but
not m4_defun'd
m4/iconv.m4:11: AM_ICONV_LINKFLAGS_BODY is expanded from...
m4/iconv.m4:22: AM_ICONV_LINK is expanded from...
m4/iconv.m4:77: AM_ICONV is expanded from...
configure.ac:505: the top level
configure.ac:505: warning: AC_LIB_RPATH is m4_require'd but not m4_defun'd
m4/iconv.m4:11: AM_ICONV_LINKFLAGS_BODY is expanded from...
m4/iconv.m4:22: AM_ICONV_LINK is expanded from...
m4/iconv.m4:77: AM_ICONV is expanded from...
configure.ac:505: the top level
configure:18624: error: possibly undefined macro: AC_LIB_PREPARE_PREFIX
  If this token and others are legitimate, please use m4_pattern_allow.
  See the Autoconf documentation.
configure:18625: error: possibly undefined macro: AC_LIB_RPATH
configure:18630: error: possibly undefined macro: AC_LIB_LINKFLAGS_BODY
configure:18638: error: possibly undefined macro: AC_LIB_APPENDTOVAR
autoreconf: /usr/bin/autoconf failed with exit status: 1

Is there any reason we depend on an older version of libtool?

Pekka



Re: Building GNU Classpath on Fedora 17

2013-03-11 Thread Pekka Enberg
Hello,

On Mon, Mar 11, 2013 at 3:20 PM, Andrew Hughes gnu.and...@redhat.com wrote:
 I wasn't aware we did.

 What version of libtool does F17 have?  I build with 2.4.2 at present.

Oh dear. I was missing gettext-devel package again! How can we add
some magic to autogen.sh to be more friendly to the user? I keep
hitting the same problem every time I try to build GNU Classpath on a
fresh installation... :-/

Pekka



[cp-patches] [RFC/PATCH] Add autogen-generated files to gitignore

2013-03-09 Thread Pekka Enberg
Make sure git status does not show up files after autogen.sh has been
run.

Signed-off-by: Pekka Enberg penb...@kernel.org
---
 .gitignore |5 +
 ChangeLog  |4 
 2 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/.gitignore b/.gitignore
index 817e215..1b3d546 100644
--- a/.gitignore
+++ b/.gitignore
@@ -21,3 +21,8 @@ install-sh
 missing
 mkinstalldirs
 INSTALL
+m4/libtool.m4
+m4/ltoptions.m4
+m4/ltsugar.m4
+m4/ltversion.m4
+m4/lt~obsolete.m4
diff --git a/ChangeLog b/ChangeLog
index b08c5af..289a979 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2013-03-09  Pekka Enberg penb...@kernel.org
+
+   * .gitignore: Exclude autogen-generated files.
+
 2013-03-04  Andrew John Hughes  gnu_and...@member.fsf.org
 
* gnu/classpath/Pair.java:
-- 
1.7.7.6




[cp-patches] [RFC/PATCH] AnnotationInvocationHandler type parametrization

2013-03-09 Thread Pekka Enberg
Type parametrize uses of generic types in AnnotationInvocationHandler.

Signed-off-by: Pekka Enberg penb...@kernel.org
---
 ChangeLog  |   10 +++
 .../annotation/AnnotationInvocationHandler.java|   28 ++--
 2 files changed, 24 insertions(+), 14 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 289a979..08f2d6e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
 2013-03-09  Pekka Enberg penb...@kernel.org
 
+   * sun/reflect/annotation/AnnotationInvocationHandler.java:
+   (AnnotationInvocationHandler(Class, Map)): Add type parameters.
+   (create(Class, Map)): Add type parameters.
+   (equals(Class, Map)): Add type parameters.
+   (hashCode(Class, Map)): Add type parameters.
+   (toString(Class, Map)): Add type parameters.
+   (getBoxedReturnType(Method)): Add type parameters.
+
+2013-03-09  Pekka Enberg penb...@kernel.org
+
* .gitignore: Exclude autogen-generated files.
 
 2013-03-04  Andrew John Hughes  gnu_and...@member.fsf.org
diff --git a/sun/reflect/annotation/AnnotationInvocationHandler.java 
b/sun/reflect/annotation/AnnotationInvocationHandler.java
index 909e7ae..7494967 100644
--- a/sun/reflect/annotation/AnnotationInvocationHandler.java
+++ b/sun/reflect/annotation/AnnotationInvocationHandler.java
@@ -62,21 +62,21 @@ public final class AnnotationInvocationHandler
   implements InvocationHandler, Serializable
 {
 private static final long serialVersionUID = 6182022883658399397L;
-private final Class type;
-private final Map memberValues;
+private final Class? extends Annotation type;
+private final MapString, Object memberValues;
 
 /**
  * Construct a new invocation handler for an annotation proxy.
  * Note that the VM is responsible for filling the memberValues map
  * with the default values of all the annotation members.
  */
-public AnnotationInvocationHandler(Class type, Map memberValues)
+public AnnotationInvocationHandler(Class? extends Annotation type, 
MapString, Object memberValues)
 {
 this.type = type;
 this.memberValues = memberValues;
 }
 
-public static Annotation create(Class type, Map memberValues)
+public static Annotation create(Class? extends Annotation type, 
MapString, Object memberValues)
 {
   for (Method m : type.getDeclaredMethods())
 {
@@ -90,7 +90,7 @@ public final class AnnotationInvocationHandler
   AnnotationInvocationHandler handler
 = new AnnotationInvocationHandler(type, memberValues);
   return (Annotation) Proxy.newProxyInstance(type.getClassLoader(),
- new Class[] { type },
+ new Class?[] { type },
  handler);
 }
 
@@ -106,7 +106,7 @@ public final class AnnotationInvocationHandler
  * (can) use different representations of annotations that reuse this
  * method.
  */
-public static boolean equals(Class type, Map memberValues, Object other)
+public static boolean equals(Class? extends Annotation type, MapString, 
Object memberValues, Object other)
 {
 if (type.isInstance(other))
 {
@@ -217,13 +217,13 @@ public final class AnnotationInvocationHandler
  * (can) use different representations of annotations that reuse this
  * method.
  */
-public static int hashCode(Class type, Map memberValues)
+public static int hashCode(Class? extends Annotation type, MapString, 
Object memberValues)
 {
 int h = 0;
-Iterator iter = memberValues.keySet().iterator();
+IteratorString iter = memberValues.keySet().iterator();
 while (iter.hasNext())
 {
-Object key = iter.next();
+String key = iter.next();
 Object val = memberValues.get(key);
 h += deepHashCode(val) ^ 127 * key.hashCode();
 }
@@ -267,15 +267,15 @@ public final class AnnotationInvocationHandler
  * (can) use different representations of annotations that reuse this
  * method.
  */
-public static String toString(Class type, Map memberValues)
+public static String toString(Class? extends Annotation type, 
MapString, Object memberValues)
 {
 StringBuffer sb = new StringBuffer();
 sb.append('@').append(type.getName()).append('(');
 String sep = ;
-Iterator iter = memberValues.keySet().iterator();
+IteratorString iter = memberValues.keySet().iterator();
 while (iter.hasNext())
 {
-Object key = iter.next();
+String key = iter.next();
 Object val = memberValues.get(key);
 sb.append(sep).append(key).append('=').append(deepToString(val));
 sep = , ;
@@ -284,9 +284,9 @@ public final class AnnotationInvocationHandler
 return sb.toString();
 }
 
-private

Re: [cp-patches] [RFC/PATCH] AnnotationInvocationHandler type parametrization

2013-03-09 Thread Pekka Enberg
Hello Mark,

On Sat, Mar 09, 2013 at 11:36:13AM +0200, Pekka Enberg wrote:
 Type parametrize uses of generic types in AnnotationInvocationHandler.

On Sat, Mar 9, 2013 at 12:09 PM, Mark Wielaard m...@klomp.org wrote:
 Generally we avoided generics for VM interface files, so VMs can ignore
 any modern class format extensions in their bootstrap classes.

It shouldn't make any difference to the VM classloader because of type
erasure. What am I missing?

Pekka



Re: [cp-patches] tagging classpath for GCC import

2012-12-03 Thread Pekka Enberg
On Mon, Dec 3, 2012 at 12:04 PM, Mark Wielaard m...@klomp.org wrote:
 There is the classpath git tree at
 http://icedtea.classpath.org/mirror/git/classpath/classpath/
 which does have all that. But it only has the CVS part of the history.
 The trick now is to figure out how to merge that git tree with the
 official GNU Classpath git tree on savannah. Sadly my git foo isn't
 strong enough to figure that out :{
 So any hints or tips from some more experienced git users appreciated.

The mirror git tree is where we branched off our current development
tree. You should be able to just push the tags to the tree on
Savannah. Andi?



Re: [cp-patches] Patch fixing bugs in several StrictMath methods

2012-11-07 Thread Pekka Enberg
Hi Ivan,

On Sat, Oct 27, 2012 at 6:10 PM, Ivan Maidanski iv...@mail.ru wrote:
 To continue pushing the patches, I've cherry-picked 2 patches (to
 https://github.com/ivmai/classpath/tree/ivmai4review-v3) containing
 StrictMath fixes and the corresponding tests:
 https://github.com/ivmai/classpath/commit/b0103d175bb012fcec411cc9e76257f3f257c39d
 (StrictMath changes)
 https://github.com/ivmai/classpath/commit/214c8bab72dc4689edf7ae1cd49e3a109c0746d7
 (StrictMath test)

 Some notes:
 - In the 1st patch I've removed several trailing spaces at EOLn in ChangeLog
 - I think it is ok not to post this as a separate patch
 - In the 2nd patch I've also fixed java.lang.reflect/ArrayTest (a one-line
 fix - I've commented out loadLibrary call but it might be better to remove
 this line at all)

I'm afraid I'll have to leave StrictMath reviewing for Andrew. I
really have no clue what that code is supposed to be doing. ;-)

Pekka



Object classinfo Mauve tests failing under GNU Classpath

2012-11-07 Thread Pekka Enberg
Hi Pavel,

I noticed two issues with your current Mauve classinfo test cases with
GNU Classpath.

  - I need the attached patch to make the Object classinfo tests run
with JamVM/GNU Classpath; otherwise I see syntax errors while Mauve
is trying to compile the test classes.

  - The tests in getMethods and getDeclaredMethods test cases are
incompatible with GNU Classpath for two reasons: GNU Classpath has
IllegalMonitorStateException in classfiles (which is arguably wrong)
and methods are not native in GNU Classpath like they are with
OpenJDK.

P.S. Can we migrate Mauve source code to a git repository, please?
Working with CVS is PITA.

Pekka


0001-Annotate-test-cases-that-require-JDK-1.5.patch
Description: Binary data


Re: [cp-patches] GNU Classpath

2012-10-17 Thread Pekka Enberg
On Wed, Oct 17, 2012 at 5:59 AM, Andrew Hughes gnu.and...@redhat.com wrote:
 No.  Updating the ChangeLog is a requirement.

Ivan, I highly recommend setting up git-merge-changelog as per Mark's
instructions which makes git merge and git cherry-pick work properly
again.



Re: [cp-patches] [RFC PATCH 1/7] Fix java/lang/reflect/Member.getDeclaringClass() return type

2012-10-17 Thread Pekka Enberg
Hi Andrew,

Sun, 14 Oct 2012 17:02:52 -0400 (EDT) от Andrew Hughes ahug...@redhat.com:
 Because he actually wants them to be included in GNU Classpath.

On Tue, 16 Oct 2012, Ivan Maidanski wrote:
 Can't understand. There are GNU Classpath development branches?

I guess what Andrew is trying to say here is that I work against GNU 
Classpath master and submit changes for review and inclusion very 
aggressively.

That pretty much avoids the problem you're having with a huge backlog of 
unreviewed changes. ;-)

Pekka

Re: [cp-patches] Fwd: Patch replacing all remaining .cvsignore with .gitignore

2012-10-15 Thread Pekka Enberg
On Mon, Oct 15, 2012 at 12:02 AM, Andrew Hughes ahug...@redhat.com wrote:
  1. Replace all .cvsignore files with .gitignore -
  https://github.com/ivmai/classpath/commit/78f20cb718daad4164da4ceac9be54185d9c78ff

 This seems ok.

I fixed up ChangeLog rejects and pushed that to master.

On Mon, Oct 15, 2012 at 12:02 AM, Andrew Hughes ahug...@redhat.com wrote:
  2. Remove duplicate entries in .gitignore; remove empty .gitignore
  files -
  https://github.com/ivmai/classpath/commit/6479ffea252e06fd2a6c4cac024cb2696091a850

 This:

 +.deps/
 +.dirstamp
 +.libs/
 +*.la
 +*.lo

 is wrong.  .gitignore should not hide build artifacts.  Those from autogen.sh 
 are ok.

Okay, why do we care about build artifacts? I've used to git status
only showing files that are versioned or should be versioned.



Re: [cp-patches] GNU Classpath

2012-10-15 Thread Pekka Enberg
On Sun, Oct 14, 2012 at 11:55 PM, Andrew Hughes gnu.and...@redhat.com wrote:
 May be it's time to change the policy of patch acceptance from
 please find a person who reviews (among 1 or 2 guys) your code to
 if signed FSF paper, and you have patches, post them to ML, commit
 to some feature development branch and, if no objections within 2-3
 weeks, merge the branch to master, in case of further objections
 revert the patches.

 No, I don't think this is suitable.

And more importantly, not really necessary now that we're using Git.
That said, we really need to do something with ChangeLog because it
causes unnecessary rejects when merging from one git tree to another.
Can we drop it or did someone have some Git magic to deal with it?

Pekka



Re: [cp-patches] [RFC PATCH] Bump up Java source and target version to 1.6

2012-10-15 Thread Pekka Enberg
On Sat, 13 Oct 2012, Ivan Maidanski wrote:
 If you could show the community that upgrading to 1.7 brings some 
 benefit (e.g., like above) then it is ok to upgrade to 1.7 directly 
 (thus eliminating Classpath VM implementors efforts to verify with 1.6).

Java 1.7 has some nice language changes:

http://docs.oracle.com/javase/7/docs/technotes/guides/language/enhancements.html#javase7

and more importantly, invokedynamic, that's heavily used by upcoming JRuby 
1.7. IIRC, Scala 2.10 will no longer run on Java 1.5 either.

Pekka



[cp-patches] [RFC PATCH 2/4] Optimize emptySet/Map/List() in Collections class.

2012-10-15 Thread Pekka Enberg
From: Ivan Maidanski iv...@mail.ru

2011-07-20  Ivan Maidanski  iv...@mail.ru

* java/util/Collections.java:
(emptySet(), EmptySet.iterator(), emptyList(), emptyMap(),
EmptyMap.entrySet(), EmptyMap.keySet(), EmptyMap.values(),
SingletonList.subList(int, int)): Suppress unchecked warnings.
(emptySet(), emptyList(), emptyMap()): Don't create new instance (use
the corresponding immutable container instance); remove FIXME.
(EmptySet.equals(Object), EmptyList.equals(Object),
EmptyMap.entrySet(), EmptyMap.equals(Object), EmptyMap.keySet(),
EmptyMap.values(), SingletonList.subList(int, int)): Add generic
typing.
(SynchronizedCollection.toArray(T[])): Rename T type to E (to
suppress compiler warning about type hiding).
---
 ChangeLog  |   15 +++
 java/util/Collections.java |   33 +++--
 2 files changed, 34 insertions(+), 14 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index c0d84cd..5690754 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,20 @@
 2011-07-20  Ivan Maidanski  iv...@mail.ru
 
+   * java/util/Collections.java:
+   (emptySet(), EmptySet.iterator(), emptyList(), emptyMap(),
+   EmptyMap.entrySet(), EmptyMap.keySet(), EmptyMap.values(),
+   SingletonList.subList(int, int)): Suppress unchecked warnings.
+   (emptySet(), emptyList(), emptyMap()): Don't create new instance (use
+   the corresponding immutable container instance); remove FIXME.
+   (EmptySet.equals(Object), EmptyList.equals(Object),
+   EmptyMap.entrySet(), EmptyMap.equals(Object), EmptyMap.keySet(),
+   EmptyMap.values(), SingletonList.subList(int, int)): Add generic
+   typing.
+   (SynchronizedCollection.toArray(T[])): Rename T type to E (to
+   suppress compiler warning about type hiding).
+
+2011-07-20  Ivan Maidanski  iv...@mail.ru
+
* native/jni/java-util/java_util_VMTimeZone.c:
Include jcl.h file.
(Java_java_util_VMTimeZone_getSystemTimeZoneId): Throw
diff --git a/java/util/Collections.java b/java/util/Collections.java
index 828c6ec..e7e7056 100644
--- a/java/util/Collections.java
+++ b/java/util/Collections.java
@@ -120,10 +120,10 @@ public class Collections
* @return an empty parameterized set.
* @since 1.5
*/
+  @SuppressWarnings(unchecked)
   public static final T SetT emptySet()
   {
-/* FIXME: Could this be optimized? */
-return new EmptySetT();
+return (SetT) EMPTY_SET;
   }
 
   /**
@@ -161,6 +161,7 @@ public class Collections
  * @return A non-iterating iterator.
  */
 // This is really cheating! I think it's perfectly valid, though.
+@SuppressWarnings(unchecked)
 public IteratorT iterator()
 {
   return (IteratorT) EMPTY_LIST.iterator();
@@ -196,7 +197,7 @@ public class Collections
  */
 public boolean equals(Object o)
 {
-  return o instanceof Set  ((Set) o).isEmpty();
+  return o instanceof Set?  ((Set?) o).isEmpty();
 }
 
 /**
@@ -288,10 +289,10 @@ public class Collections
* @return an empty parameterized list.
* @since 1.5
*/
+  @SuppressWarnings(unchecked)
   public static final T ListT emptyList()
   {
-/* FIXME: Could this be optimized? */
-return new EmptyListT();
+return (ListT) EMPTY_LIST;
   }
 
   /**
@@ -369,7 +370,7 @@ public class Collections
  */
 public boolean equals(Object o)
 {
-  return o instanceof List  ((List) o).isEmpty();
+  return o instanceof List?  ((List?) o).isEmpty();
 }
 
 /**
@@ -480,10 +481,10 @@ public class Collections
* @return an empty parameterized map.
* @since 1.5
*/
+  @SuppressWarnings(unchecked)
   public static final K,V MapK,V emptyMap()
   {
-/* FIXME: Could this be optimized? */
-return new EmptyMapK,V();
+return (MapK,V) EMPTY_MAP;
   }
 
   /**
@@ -511,9 +512,10 @@ public class Collections
  * There are no entries.
  * @return The empty set.
  */
+@SuppressWarnings(unchecked)
 public SetMap.EntryK, V entrySet()
 {
-  return EMPTY_SET;
+  return (SetMap.EntryK, V) EMPTY_SET;
 }
 
 // The remaining methods are optional, but provide a performance
@@ -546,7 +548,7 @@ public class Collections
  */
 public boolean equals(Object o)
 {
-  return o instanceof Map  ((Map) o).isEmpty();
+  return o instanceof Map?,?  ((Map?,?) o).isEmpty();
 }
 
 /**
@@ -572,9 +574,10 @@ public class Collections
  * No entries.
  * @return The empty set.
  */
+@SuppressWarnings(unchecked)
 public SetK keySet()
 {
-  return EMPTY_SET;
+  return (SetK) EMPTY_SET;
 }
 
 /**
@@ -601,9 +604,10 @@ public class Collections
  * Collection, will work. Besides, that's what the JDK uses!
  * @return The empty set.
  */
+@SuppressWarnings(unchecked)
 public CollectionV values()
 {
-  return EMPTY_SET;

[cp-patches] [RFC PATCH 1/4] Handle malloc() failure in java_util_VMTimeZone.c file.

2012-10-15 Thread Pekka Enberg
From: Ivan Maidanski iv...@mail.ru

2011-07-20  Ivan Maidanski  iv...@mail.ru

* native/jni/java-util/java_util_VMTimeZone.c:
Include jcl.h file.
(Java_java_util_VMTimeZone_getSystemTimeZoneId): Throw
OutOfMemoryException in case of malloc() failure.
---
 ChangeLog   |7 +++
 native/jni/java-util/java_util_VMTimeZone.c |7 +++
 2 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 18b6c03..c0d84cd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2011-07-20  Ivan Maidanski  iv...@mail.ru
+
+   * native/jni/java-util/java_util_VMTimeZone.c:
+   Include jcl.h file.
+   (Java_java_util_VMTimeZone_getSystemTimeZoneId): Throw
+   OutOfMemoryException in case of malloc() failure.
+
 2012-06-10  Ivan Maidanski  iv...@mail.ru
 
* compat/.gitignore,
diff --git a/native/jni/java-util/java_util_VMTimeZone.c 
b/native/jni/java-util/java_util_VMTimeZone.c
index a3a986d..1c4c0cf 100644
--- a/native/jni/java-util/java_util_VMTimeZone.c
+++ b/native/jni/java-util/java_util_VMTimeZone.c
@@ -53,6 +53,7 @@ exception statement from your version. */
 #include stdlib.h
 
 #include jni.h
+#include jcl.h
 
 #include java_util_VMTimeZone.h
 
@@ -170,6 +171,12 @@ Java_java_util_VMTimeZone_getSystemTimeZoneId (JNIEnv * 
env,
   tz2_len = strlen (tz2);
   tzoff_len = jint_to_charbuf (tzoff + 11, tzoffset);
   tzid = (char *) malloc (tz1_len + tz2_len + tzoff_len + 1);  /* FIXME alloc 
*/
+  if (tzid == NULL) {
+JCL_ThrowException (env, java/lang/OutOfMemoryError,
+malloc() failed);
+return 0;
+  }
+
   memcpy (tzid, tz1, tz1_len);
   memcpy (tzid + tz1_len, tzoff + 11 - tzoff_len, tzoff_len);
   memcpy (tzid + tz1_len + tzoff_len, tz2, tz2_len);
-- 
1.7.7.6




[cp-patches] [RFC PATCH 3/4] Fix NPE in java/util/Formatter.format() method

2012-10-15 Thread Pekka Enberg
This patch fixes NPE for the following Malva test cases:

  assertEquals(false, String.format(%b, (Object[])null));
  assertEquals(null, String.format(%h, (Object[])null));
  assertEquals(null, String.format(%s, (Object[])null));
  assertEquals(null, String.format(%c, (Object[])null));
  assertEquals(null, String.format(%d, (Object[])null));
  assertEquals(null, String.format(%o, (Object[])null));
  assertEquals(null, String.format(%x, (Object[])null));

Signed-off-by: Pekka Enberg penb...@kernel.org
---
 ChangeLog|5 +
 java/util/Formatter.java |   21 ++---
 2 files changed, 23 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 5690754..5a75061 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2012-03-15  Pekka Enberg  penb...@kernel.org
+
+   * java/util/Formatter.java:
+   (format): Fix NPE errors.
+
 2011-07-20  Ivan Maidanski  iv...@mail.ru
 
* java/util/Collections.java:
diff --git a/java/util/Formatter.java b/java/util/Formatter.java
index 62f6845..466fab5 100644
--- a/java/util/Formatter.java
+++ b/java/util/Formatter.java
@@ -678,6 +678,12 @@ public final class Formatter
conversion);
 noPrecision(precision);
 
+if (arg == null)
+  {
+genericFormat(null, flags, width, precision);
+return;
+  }
+
 int theChar;
 if (arg instanceof Character)
   theChar = ((Character) arg).charValue();
@@ -748,6 +754,12 @@ public final class Formatter
   int radix, char conversion)
   {
 assert radix == 8 || radix == 10 || radix == 16;
+
+if (arg == null)
+  {
+return new CPStringBuilder(null);
+  }
+
 noPrecision(precision);
 
 // Some error checking.
@@ -1353,9 +1365,12 @@ public final class Formatter
   argumentIndex = previousArgumentIndex;
 // Argument indices start at 1 but array indices at 0.
 --argumentIndex;
-if (argumentIndex  0 || argumentIndex = args.length)
-  throw new 
MissingFormatArgumentException(format.substring(start, index));
-argument = args[argumentIndex];
+if (args != null)
+  {
+if (argumentIndex  0 || argumentIndex = args.length)
+  throw new 
MissingFormatArgumentException(format.substring(start, index));
+argument = args[argumentIndex];
+  }
   }
 
 switch (conversion)
-- 
1.7.7.6




Re: [cp-patches] [RFC PATCH 1/4] Handle malloc() failure in java_util_VMTimeZone.c file.

2012-10-15 Thread Pekka Enberg
On Mon, Oct 15, 2012 at 12:59 PM, Andrew Hughes ahug...@redhat.com wrote:
 @@ -170,6 +171,12 @@ Java_java_util_VMTimeZone_getSystemTimeZoneId
 (JNIEnv * env,
tz2_len = strlen (tz2);
tzoff_len = jint_to_charbuf (tzoff + 11, tzoffset);
tzid = (char *) malloc (tz1_len + tz2_len + tzoff_len + 1);/*
FIXME alloc */
 +  if (tzid == NULL) {
 +JCL_ThrowException (env, java/lang/OutOfMemoryError,
 +malloc() failed);
 +return 0;
 +  }
 +
memcpy (tzid, tz1, tz1_len);
memcpy (tzid + tz1_len, tzoff + 11 - tzoff_len, tzoff_len);
memcpy (tzid + tz1_len + tzoff_len, tz2, tz2_len);

 Can the FIXME now be dropped?

Fixed.



[cp-patches] [RFC PATCH v2] Fix NPE in java/util/Formatter.format() method

2012-10-15 Thread Pekka Enberg
This patch fixes NPE for the following Malva test cases:

  assertEquals(false, String.format(%b, (Object[])null));
  assertEquals(null, String.format(%h, (Object[])null));
  assertEquals(null, String.format(%s, (Object[])null));
  assertEquals(null, String.format(%c, (Object[])null));
  assertEquals(null, String.format(%d, (Object[])null));
  assertEquals(null, String.format(%o, (Object[])null));
  assertEquals(null, String.format(%x, (Object[])null));

Signed-off-by: Pekka Enberg penb...@kernel.org
---
 ChangeLog|   10 ++
 java/util/Formatter.java |   21 ++---
 2 files changed, 28 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 384918b..746a1f7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
 2012-03-15  Pekka Enberg  penb...@kernel.org
 
+   * java/util/Formatter.java:
+   (icharacterFormat(Object,int,int,int,char):
+   Fix NullPointerException for null characters.
+   (basicIntegralConversion(Object, int, int, int, int, char):
+   Fix NullPointerException for null integers.
+   (format(Locale, String, Object...)):
+   Fix NullPointerException for null object.
+
+2012-03-15  Pekka Enberg  penb...@kernel.org
+
* java/lang/String.java:
(codePointAt(int))): Fix exception type.
(codePointBefore(int)): Fix exception type.
diff --git a/java/util/Formatter.java b/java/util/Formatter.java
index 62f6845..466fab5 100644
--- a/java/util/Formatter.java
+++ b/java/util/Formatter.java
@@ -678,6 +678,12 @@ public final class Formatter
conversion);
 noPrecision(precision);
 
+if (arg == null)
+  {
+genericFormat(null, flags, width, precision);
+return;
+  }
+
 int theChar;
 if (arg instanceof Character)
   theChar = ((Character) arg).charValue();
@@ -748,6 +754,12 @@ public final class Formatter
   int radix, char conversion)
   {
 assert radix == 8 || radix == 10 || radix == 16;
+
+if (arg == null)
+  {
+return new CPStringBuilder(null);
+  }
+
 noPrecision(precision);
 
 // Some error checking.
@@ -1353,9 +1365,12 @@ public final class Formatter
   argumentIndex = previousArgumentIndex;
 // Argument indices start at 1 but array indices at 0.
 --argumentIndex;
-if (argumentIndex  0 || argumentIndex = args.length)
-  throw new 
MissingFormatArgumentException(format.substring(start, index));
-argument = args[argumentIndex];
+if (args != null)
+  {
+if (argumentIndex  0 || argumentIndex = args.length)
+  throw new 
MissingFormatArgumentException(format.substring(start, index));
+argument = args[argumentIndex];
+  }
   }
 
 switch (conversion)
-- 
1.7.7.6




[cp-patches] [RFC PATCH 3/7] Add missing Java 1.7 compare() API methods to java/lang classes

2012-10-04 Thread Pekka Enberg
Signed-off-by: Pekka Enberg penb...@kernel.org
---
 ChangeLog|   15 +++
 java/lang/Boolean.java   |   15 +++
 java/lang/Byte.java  |   17 +
 java/lang/Character.java |   17 +
 java/lang/Integer.java   |   17 +
 java/lang/Long.java  |   17 +
 java/lang/Short.java |   17 +
 7 files changed, 115 insertions(+), 0 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 75081f3..c6a0b65 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,20 @@
 2012-03-12  Pekka Enberg  penb...@kernel.org
 
+   * java/lang/Boolean.java:
+   (compare): Add missing method.
+   * java/lang/Byte.java:
+   (compare): Add missing method.
+   * java/lang/Character.java:
+   (compare): Add missing method.
+   * java/lang/Integer.java:
+   (compare): Add missing method.
+   * java/lang/Long.java:
+   (compare): Add missing method.
+   * java/lang/Short.java:
+   (compare): Add missing method.
+
+2012-03-12  Pekka Enberg  penb...@kernel.org
+
* java/lang/System.java:
(lineSeparator): Add missing method.
 
diff --git a/java/lang/Boolean.java b/java/lang/Boolean.java
index f2eaf41..0e4afa8 100644
--- a/java/lang/Boolean.java
+++ b/java/lang/Boolean.java
@@ -237,6 +237,21 @@ public final class Boolean implements Serializable, 
ComparableBoolean
   }
 
   /**
+   * Compares two unboxed boolean values.
+   *
+   * @param x First value to compare.
+   * @param y Second value to compare.
+   * @return 0 if both Booleans represent the same value, a positive number
+   * if this Boolean represents true and the other false, and a negative
+   * number otherwise.
+   * @since 1.7
+   */
+  public static int compare(boolean x, boolean y)
+  {
+return Boolean.valueOf(x).compareTo(Boolean.valueOf(y));
+  }
+
+  /**
* If the String argument is true, ignoring case, return true.
* Otherwise, return false.
*
diff --git a/java/lang/Byte.java b/java/lang/Byte.java
index a1536e1..01e0e03 100644
--- a/java/lang/Byte.java
+++ b/java/lang/Byte.java
@@ -370,4 +370,21 @@ public final class Byte extends Number implements 
ComparableByte
 return value - b.value;
   }
 
+  /**
+   * Compares two unboxed byte values.
+   * The result is positive if the first is greater, negative if the second
+   * is greater, and 0 if the two are equal.
+   *
+   * @param x First value to compare.
+   * @param y Second value to compare.
+   *
+   * @return positive int if the first value is greater, negative if the second
+   * is greater, and 0 if the two are equal.
+   * @since 1.7
+   */
+  public static int compare(byte x, byte y)
+  {
+return Byte.valueOf(x).compareTo(Byte.valueOf(y));
+  }
+
 }
diff --git a/java/lang/Character.java b/java/lang/Character.java
index 05e641c..f87cde6 100644
--- a/java/lang/Character.java
+++ b/java/lang/Character.java
@@ -4200,6 +4200,23 @@ public final class Character implements Serializable, 
ComparableCharacter
   }
 
   /**
+   * Compares two unboxed char values.
+   * The result is positive if the first is greater, negative if the second
+   * is greater, and 0 if the two are equal.
+   *
+   * @param x First value to compare.
+   * @param y Second value to compare.
+   *
+   * @return positive int if the first value is greater, negative if the second
+   * is greater, and 0 if the two are equal.
+   * @since 1.7
+   */
+  public static int compare(char x, char y)
+  {
+return Character.valueOf(x).compareTo(Character.valueOf(y));
+  }
+
+  /**
* Returns an codeCharacter/code object wrapping the value.
* In contrast to the codeCharacter/code constructor, this method
* will cache some values.  It is used by boxing conversion.
diff --git a/java/lang/Integer.java b/java/lang/Integer.java
index f379795..25eb5d5 100644
--- a/java/lang/Integer.java
+++ b/java/lang/Integer.java
@@ -586,6 +586,23 @@ public final class Integer extends Number implements 
ComparableInteger
   }
 
   /**
+   * Compares two unboxed int values.
+   * The result is positive if the first is greater, negative if the second
+   * is greater, and 0 if the two are equal.
+   *
+   * @param x First value to compare.
+   * @param y Second value to compare.
+   *
+   * @return positive int if the first value is greater, negative if the second
+   * is greater, and 0 if the two are equal.
+   * @since 1.7
+   */
+  public static int compare(int x, int y)
+  {
+return Integer.valueOf(x).compareTo(Integer.valueOf(y));
+  }
+
+  /**
* Return the number of bits set in x.
* @param x value to examine
* @since 1.5
diff --git a/java/lang/Long.java b/java/lang/Long.java
index e7579d8..6f31dfa 100644
--- a/java/lang/Long.java
+++ b/java/lang/Long.java
@@ -585,6 +585,23 @@ public final class Long extends Number implements 
ComparableLong
   }
 
   /**
+   * Compares two unboxed long values.
+   * The result is positive if the first is greater

[cp-patches] [RFC PATCH 2/7] Add missing java/lang/System.lineSeparator() method

2012-10-04 Thread Pekka Enberg
Signed-off-by: Pekka Enberg penb...@kernel.org
---
 ChangeLog |5 +
 java/lang/System.java |   12 
 2 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 8282cfe..75081f3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2012-03-12  Pekka Enberg  penb...@kernel.org
 
+   * java/lang/System.java:
+   (lineSeparator): Add missing method.
+
+2012-03-12  Pekka Enberg  penb...@kernel.org
+
* java/lang/reflect/Member.java:
(getDeclaringClass): Fix return type.
 
diff --git a/java/lang/System.java b/java/lang/System.java
index 51b3259..9d86991 100644
--- a/java/lang/System.java
+++ b/java/lang/System.java
@@ -97,6 +97,8 @@ public final class System
*/
   public static final PrintStream out = VMSystem.makeStandardOutputStream();
 
+  private static final String LINE_SEPARATOR = 
SystemProperties.getProperty(line.separator);
+
   /**
* The standard output PrintStream.  This is assigned at startup and
* starts its life perfectly valid. Although it is marked final, you can
@@ -713,6 +715,16 @@ public final class System
   }
 
   /**
+   * Returns the system-dependent line separator.
+   *
+   * @return the system-dependent line separator.
+   */
+  public static String lineSeparator()
+  {
+return LINE_SEPARATOR;
+  }
+
+  /**
* This is a specialised codeCollection/code, providing
* the necessary provisions for the collections used by the
* environment variable map.  Namely, it prevents
-- 
1.7.7.6




[cp-patches] [RFC PATCH 6/7] Add missing Java 1.7 java/lang/reflect/Modifier methods

2012-10-04 Thread Pekka Enberg
Signed-off-by: Pekka Enberg penb...@kernel.org
---
 ChangeLog   |9 
 java/lang/reflect/Modifier.java |   42 ++-
 2 files changed, 50 insertions(+), 1 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index beb6e0e..73be859 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2012-03-12  Pekka Enberg  penb...@kernel.org
 
+   * java/lang/reflect/Modifier.java:
+   (classModifiers): Add missing method.
+   (interfaceModifiers): Add missing method.
+   (constructorModifiers): Add missing method.
+   (methodModifiers): Add missing method.
+   (fieldModifiers): Add missing method.
+
+2012-03-12  Pekka Enberg  penb...@kernel.org
+
* java/lang/ClassNotFoundException,
* java/lang/IllegalAccessException.java,
* java/lang/InstantiationException.java,
diff --git a/java/lang/reflect/Modifier.java b/java/lang/reflect/Modifier.java
index 15bad05..c75f7b8 100644
--- a/java/lang/reflect/Modifier.java
+++ b/java/lang/reflect/Modifier.java
@@ -1,5 +1,5 @@
 /* java.lang.reflect.Modifier
-   Copyright (C) 1998, 1999, 2001, 2002, 2005, 2008  Free Software Foundation, 
Inc.
+   Copyright (C) 1998, 1999, 2001, 2002, 2005, 2008, 2012  Free Software 
Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -300,6 +300,46 @@ public class Modifier
   }
 
   /**
+   * @since 1.7
+   */
+  public static int classModifiers()
+  {
+return PUBLIC | PROTECTED | PRIVATE | STATIC | ABSTRACT | FINAL | STRICT;
+  }
+
+  /**
+   * @since 1.7
+   */
+  public static int interfaceModifiers()
+  {
+return PUBLIC | PROTECTED | PRIVATE | STATIC | ABSTRACT | STRICT;
+  }
+
+  /**
+   * @since 1.7
+   */
+  public static int constructorModifiers()
+  {
+return PUBLIC | PROTECTED | PRIVATE;
+  }
+
+  /**
+   * @since 1.7
+   */
+  public static int methodModifiers()
+  {
+return PUBLIC | PROTECTED | PRIVATE | STATIC | ABSTRACT | FINAL | STRICT | 
SYNCHRONIZED | NATIVE;
+  }
+
+  /**
+   * @since 1.7
+   */
+  public static int fieldModifiers()
+  {
+return PUBLIC | PROTECTED | PRIVATE | STATIC | FINAL | TRANSIENT | 
VOLATILE;
+  }
+
+  /**
* Get a string representation of all the modifiers represented by the
* given int. The keywords are printed in this order:
* codelt;public|protected|privategt; abstract static final transient
-- 
1.7.7.6




Re: [cp-patches] Patch replacing all remaining .cvsignore with .gitignore

2012-07-16 Thread Pekka Enberg
Hello Andrew,

On Mon, Jul 16, 2012 at 3:00 PM, Andrew Hughes ahug...@redhat.com wrote:
 I'm not keen on the addition of files that would be removed by make clean, as 
 seems to be
 added by 3.

Why is that? Generally speaking, .gitignore should exclude all
non-generated files so that you can get meaningful git status even
after a build.

Pekka



Re: [cp-patches] Assertions and System Assertions in GNU Classpath

2012-04-24 Thread Pekka Enberg
On Tue, Apr 24, 2012 at 9:40 PM, Josef Eisl
zaps...@complang.tuwien.ac.at wrote:
 Attached is a patch that enables GNU Classpath to distinguish between
 normal assertions and assertions for system classes (i.e. null
 classloader) as discussed on the Classpath mailing list [1].

Acked-by: Pekka Enberg penb...@kernel.org

On Tue, Apr 24, 2012 at 9:40 PM, Josef Eisl
zaps...@complang.tuwien.ac.at wrote:
 Note that the new method
 'java/lang/VMClassLoader.getSystemAssertionStatus()' must be implemented
 otherwise an exception will occur.

Sure, but only for VMs that override GNU Classpath VM native classes.
Jato, for example, doesn't.



Re: [cp-patches] [commit-cp] classpath ChangeLog native/jni/java-io/java_io_...

2012-03-29 Thread Pekka Enberg
On Thu, Mar 29, 2012 at 6:07 PM, Andrew Haley a...@redhat.com wrote:
 Why are we using yet another VCS, anyway?  We can pretty much
 guarantee that free Java devs are used to Mercural and maybe
 Subversion, but git?

FWIW, I voted for git because that's what I know. I have never used
Mercurial for real work.

   Pekka



Re: [cp-patches] [commit-cp] classpath ChangeLog native/jni/java-io/java_io_...

2012-03-29 Thread Pekka Enberg
On Thu, Mar 29, 2012 at 6:40 PM, Andrew Haley a...@redhat.com wrote:
 zebedee:classpath $ git push ssh://git.savannah.gnu.org/cgit/classpath.git/
 fatal: '/cgit/classpath.git' does not appear to be a git repository
 fatal: The remote end hung up unexpectedly

 Any idea what git wants to do the push?

Git wants the remote name. For example, I have:

penberg@jaguar:~/src/classpath$ git remote -v
icedtea git://icedtea.classpath.org/mirror/git/classpath/classpath (fetch)
icedtea git://icedtea.classpath.org/mirror/git/classpath/classpath (push)
origin  g...@github.com:penberg/classpath.git (fetch)
origin  g...@github.com:penberg/classpath.git (push)
savannahssh://git.sv.gnu.org/srv/git/classpath.git (fetch)
savannahssh://git.sv.gnu.org/srv/git/classpath.git (push)

so I use

  git push savannah master

You can add a new remote with

  git remote add savannah ssh://git.sv.gnu.org/srv/git/classpath.git

HTH

Pekka



Re: Weirdness in native/jni/java-io/java_io_VMConsole.c

2012-03-29 Thread Pekka Enberg
On Thu, Mar 29, 2012 at 12:47 PM, Andrew Haley a...@redhat.com wrote:
 There's a very odd comment in this file: it clearly refers to some
 method in another file.  But what was it for, anyway?  Surely the
 name of a method and its signature is contained in the code.  I'd just
 delete it.

 /*
  * Class:     java_io_VMConsole
  * Method:    echo
  * Signature: (Z)Z
  */
 JNIEXPORT jstring JNICALL
 Java_java_io_VMConsole_readPassword (JNIEnv * env,
                                     jclass clazz
                                     __attribute__ ((__unused__)),
                                     jobject con)
 {

It's a copy-paste goof by me and I'm fine with dropping it. I only
added it to follow existing style.



Re: [cp-patches] Fix libjava bootstrap failure around IUCLC

2012-03-26 Thread Pekka Enberg
On Mon, Mar 26, 2012 at 1:11 PM, Mark Wielaard m...@klomp.org wrote:
 On Mon, 2012-03-26 at 10:01 +0100, Andrew Haley wrote:
 On 03/25/2012 05:08 PM, Gerald Pfeifer wrote:
  2012-03-25  Gerald Pfeifer  ger...@pfeifer.com
 
          PR libgcj/52694
          * java/io/natVMConsole.cc (IUCLC): Define, if undefined.

 Sure.  WTF is IUCLC anyway?  :-)

 (map) Input (characters) UpperCase (to) Lower Case.
 It is a non-posix termios extension.

 patch should also go into upstream classpath.

Yes, please.

Btw, why are people not fixing GNU Classpath upstream-first?



Re: [cp-patches] Fix libjava bootstrap failure around IUCLC

2012-03-26 Thread Pekka Enberg
On Mon, Mar 26, 2012 at 1:50 PM, Andrew Haley a...@redhat.com wrote:
 Btw, why are people not fixing GNU Classpath upstream-first?

 Because, I guess, no-one is using it. At least, if they were, this
 bug would have been noticed.

Right. I'm developing and testing with Fedora and Ubuntu on x86 and I
verify GNU Classpath bootstrap on Darwin at times. I guess Buildbot
would help here.

Pekka



Re: GNU Classpath 0.99 Released!

2012-03-21 Thread Pekka Enberg
On Fri, Mar 16, 2012 at 9:50 PM, Dr Andrew John Hughes
ahug...@redhat.com wrote:
 We are proud to announce the release of GNU Classpath 0.99.

The web site doesn't mention the new release yet. How can we update it?



Re: GNU Classpath version control migration after .99?

2012-03-20 Thread Pekka Enberg
On Tue, Mar 20, 2012 at 12:28 AM, Andrew Hughes ahug...@redhat.com wrote:
 As the deadline has now passed, I've populated the git repository on Savannah:

 http://git.savannah.gnu.org/cgit/classpath.git

 This is now the active development repository and the old CVS repository is 
 obsolete.

Yay! :-)



[cp-patches] [PATCH] Fix NPE in java/util/Formatter.format() method

2012-03-15 Thread Pekka Enberg
This patch fixes NPE for the following Malva test cases:

  assertEquals(false, String.format(%b, (Object[])null));
  assertEquals(null, String.format(%h, (Object[])null));
  assertEquals(null, String.format(%s, (Object[])null));
  assertEquals(null, String.format(%c, (Object[])null));
  assertEquals(null, String.format(%d, (Object[])null));
  assertEquals(null, String.format(%o, (Object[])null));
  assertEquals(null, String.format(%x, (Object[])null));

Signed-off-by: Pekka Enberg penb...@kernel.org
---
 ChangeLog|5 +
 java/util/Formatter.java |   21 ++---
 2 files changed, 23 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 48af956..cce9803 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2012-03-15  Pekka Enberg  penb...@kernel.org
+
+   * java/util/Formatter.java:
+   (format): Fix NPE errors.
+
 2012-03-12  Pekka Enberg  penb...@kernel.org
 
* gnu/java/nio/FileLockImpl.java,
diff --git a/java/util/Formatter.java b/java/util/Formatter.java
index 62f6845..466fab5 100644
--- a/java/util/Formatter.java
+++ b/java/util/Formatter.java
@@ -678,6 +678,12 @@ public final class Formatter
conversion);
 noPrecision(precision);
 
+if (arg == null)
+  {
+genericFormat(null, flags, width, precision);
+return;
+  }
+
 int theChar;
 if (arg instanceof Character)
   theChar = ((Character) arg).charValue();
@@ -748,6 +754,12 @@ public final class Formatter
   int radix, char conversion)
   {
 assert radix == 8 || radix == 10 || radix == 16;
+
+if (arg == null)
+  {
+return new CPStringBuilder(null);
+  }
+
 noPrecision(precision);
 
 // Some error checking.
@@ -1353,9 +1365,12 @@ public final class Formatter
   argumentIndex = previousArgumentIndex;
 // Argument indices start at 1 but array indices at 0.
 --argumentIndex;
-if (argumentIndex  0 || argumentIndex = args.length)
-  throw new 
MissingFormatArgumentException(format.substring(start, index));
-argument = args[argumentIndex];
+if (args != null)
+  {
+if (argumentIndex  0 || argumentIndex = args.length)
+  throw new 
MissingFormatArgumentException(format.substring(start, index));
+argument = args[argumentIndex];
+  }
   }
 
 switch (conversion)
-- 
1.7.6.5




[cp-patches] [PATCH] Fix java/lang/String.codePoint{At|Before} exception types

2012-03-15 Thread Pekka Enberg
OpenJDK throws StringIndexOutOfBoundsException and so should we.

Signed-off-by: Pekka Enberg penb...@kernel.org
---
 ChangeLog |6 ++
 java/lang/String.java |4 
 2 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index cce9803..0a867cc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2012-03-15  Pekka Enberg  penb...@kernel.org
 
+   * java/lang/String.java:
+   (codePointAt): Fix exception type.
+   (codePointBefore): Fix exception type.
+
+2012-03-15  Pekka Enberg  penb...@kernel.org
+
* java/util/Formatter.java:
(format): Fix NPE errors.
 
diff --git a/java/lang/String.java b/java/lang/String.java
index 45c0daf..eb713ce 100644
--- a/java/lang/String.java
+++ b/java/lang/String.java
@@ -705,6 +705,8 @@ public final class String
*/
   public synchronized int codePointAt(int index)
   {
+if (index  0 || index = count)
+  throw new StringIndexOutOfBoundsException(index);
 // Use the CharSequence overload as we get better range checking
 // this way.
 return Character.codePointAt(this, index);
@@ -722,6 +724,8 @@ public final class String
*/
   public synchronized int codePointBefore(int index)
   {
+if (index  0 || index = count)
+  throw new StringIndexOutOfBoundsException(index);
 // Use the CharSequence overload as we get better range checking
 // this way.
 return Character.codePointBefore(this, index);
-- 
1.7.6.5




Re: [cp-patches] [RFC/PATCH 2/2] Add missing Java 1.5 java/net methods

2012-03-14 Thread Pekka Enberg
On Wed, Mar 14, 2012 at 8:22 PM, Andrew Hughes ahug...@redhat.com wrote:
 I don't see how this is better than just not having these APIs.  Shouldn't
 they at least delegate to VM level?

That's what the API does with OpenJDK too! Also, the VM is not really
involved for networking code so I don't see why we'd need to delegate
anything.



Re: [cp-patches] [RFC/PATCH] Add missing Java 1.6 java/lang/Math.getExponent() methods

2012-03-13 Thread Pekka Enberg
On Tue, Mar 13, 2012 at 4:02 PM, Andrew Hughes ahug...@redhat.com wrote:
 Couple of questions:

 1.  What is the reason for the removal of frexp?

That was a leftover which I've dropped locally.

 2.  How are you compiling this?  IcedTea contains a patch
 which was required to make things like MIN/MAX_VALUE with hex
 digits work on ecj + Classpath:

 --- openjdk-ecj.orig/jdk/src/share/classes/java/lang/Double.java        
 2010-05-26 09:32:38.0 +0100
 +++ openjdk-ecj/jdk/src/share/classes/java/lang/Double.java     2010-05-26 
 15:02:51.0 +0100
 @@ -76,7 +76,7 @@
      * {@code 0x1.fP+1023} and also equal to
      * {@code Double.longBitsToDouble(0x7fefL)}.
      */
 -    public static final double MAX_VALUE = 0x1.fP+1023; // 
 1.7976931348623157e+308
 +    public static final double MAX_VALUE = 1.7976931348623157e+308;

 We don't want to be in a situation where we can't compile ourselves!

Good point. I'm building with OpenJDK + ECJ because Ubuntu no longer
ships GNU Classpath. I'll convert all of them to non-hex constants.

 Pekka



What APIs are missing from GNU Classpath?

2012-03-13 Thread Pekka Enberg
Hi,

I went through japitools results that compared GNU Classpath to Oracle
JDK and noticed that the following APIs are missing:

Java 1.5

- Lots of java.net APIs
- Pack200 format support

Java 1.6

- JDBC 4.0 API

Java 1.7

- NIO2 API
- Invokedynamic API

Anything else that I didn't spot?

Pekka



[cp-patches] [RFC/PATCH 1/6] Fix java/lang/reflect/Member.getDeclaringClass() return type

2012-03-12 Thread Pekka Enberg
Signed-off-by: Pekka Enberg penb...@kernel.org
---
 java/lang/reflect/Member.java |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/java/lang/reflect/Member.java b/java/lang/reflect/Member.java
index fed962c..945fbf6 100644
--- a/java/lang/reflect/Member.java
+++ b/java/lang/reflect/Member.java
@@ -79,7 +79,7 @@ public interface Member
*
* @return the class that declared this member
*/
-  Class getDeclaringClass();
+  Class? getDeclaringClass();
 
   /**
* Gets the simple name of this member. This will be a valid Java
-- 
1.7.6.5




[cp-patches] [RFC/PATCH 5/6] Add missing Java 1.7 ReflectiveOperationException class

2012-03-12 Thread Pekka Enberg
Signed-off-by: Pekka Enberg penb...@kernel.org
---
 java/lang/ClassNotFoundException.java|6 +-
 java/lang/IllegalAccessException.java|6 +-
 java/lang/InstantiationException.java|6 +-
 java/lang/NoSuchFieldException.java  |6 +-
 java/lang/NoSuchMethodException.java |6 +-
 java/lang/ReflectiveOperationException.java  |   88 ++
 java/lang/reflect/InvocationTargetException.java |6 +-
 7 files changed, 106 insertions(+), 18 deletions(-)
 create mode 100644 java/lang/ReflectiveOperationException.java

diff --git a/java/lang/ClassNotFoundException.java 
b/java/lang/ClassNotFoundException.java
index 142bc5d..fe1424d 100644
--- a/java/lang/ClassNotFoundException.java
+++ b/java/lang/ClassNotFoundException.java
@@ -1,5 +1,5 @@
 /* ClassNotFoundException.java -- thrown when class definition cannot be found
-   Copyright (C) 1998, 2002, 2005  Free Software Foundation, Inc.
+   Copyright (C) 1998, 2002, 2005, 2012  Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -47,9 +47,9 @@ package java.lang;
  * @see Class#forName(String)
  * @see ClassLoader#findSystemClass(String)
  * @see ClassLoader#loadClass(String, boolean)
- * @status updated to 1.4
+ * @status updated to 1.7
  */
-public class ClassNotFoundException extends Exception
+public class ClassNotFoundException extends ReflectiveOperationException
 {
   /**
* Compatible with JDK 1.0+.
diff --git a/java/lang/IllegalAccessException.java 
b/java/lang/IllegalAccessException.java
index a352c8b..2574f66 100644
--- a/java/lang/IllegalAccessException.java
+++ b/java/lang/IllegalAccessException.java
@@ -1,6 +1,6 @@
 /* IllegalAccessException.java -- thrown on attempt to reflect on
inaccessible data
-   Copyright (C) 1998, 1999, 2001, 2002, 2005  Free Software Foundation, Inc.
+   Copyright (C) 1998, 1999, 2001, 2002, 2005, 2012  Free Software Foundation, 
Inc.
 
 This file is part of GNU Classpath.
 
@@ -71,9 +71,9 @@ import java.lang.reflect.Method;
  * @see Field#getDouble(Object)
  * @see Method#invoke(Object, Object[])
  * @see Constructor#newInstance(Object[])
- * @status updated to 1.4
+ * @status updated to 1.7
  */
-public class IllegalAccessException extends Exception
+public class IllegalAccessException extends ReflectiveOperationException
 {
   /**
* Compatible with JDK 1.0+.
diff --git a/java/lang/InstantiationException.java 
b/java/lang/InstantiationException.java
index 367b14b..cb2cad1 100644
--- a/java/lang/InstantiationException.java
+++ b/java/lang/InstantiationException.java
@@ -1,6 +1,6 @@
 /* InstantiationException.java -- thrown when reflection cannot create an
instance
-   Copyright (C) 1998, 1999, 2001, 2002, 2005  Free Software Foundation, Inc.
+   Copyright (C) 1998, 1999, 2001, 2002, 2005, 2012  Free Software Foundation, 
Inc.
 
 This file is part of GNU Classpath.
 
@@ -46,9 +46,9 @@ package java.lang;
  * @author Brian Jones
  * @author Warren Levy (warr...@cygnus.com)
  * @see Class#newInstance()
- * @status updated to 1.4
+ * @status updated to 1.7
  */
-public class InstantiationException extends Exception
+public class InstantiationException extends ReflectiveOperationException
 {
   /**
* Compatible with JDK 1.0+.
diff --git a/java/lang/NoSuchFieldException.java 
b/java/lang/NoSuchFieldException.java
index 74d52d1..b43b532 100644
--- a/java/lang/NoSuchFieldException.java
+++ b/java/lang/NoSuchFieldException.java
@@ -1,5 +1,5 @@
 /* NoSuchFieldException.java -- thrown when reflecting a non-existant field
-   Copyright (C) 1998, 1999, 2001, 2002, 2005  Free Software Foundation, Inc.
+   Copyright (C) 1998, 1999, 2001, 2002, 2005, 2012  Free Software Foundation, 
Inc.
 
 This file is part of GNU Classpath.
 
@@ -45,9 +45,9 @@ package java.lang;
  * @author Brian Jones
  * @author Warren Levy (warr...@cygnus.com)
  * @since 1.1
- * @status updated to 1.4
+ * @status updated to 1.7
  */
-public class NoSuchFieldException extends Exception
+public class NoSuchFieldException extends ReflectiveOperationException
 {
   /**
* Compatible with JDK 1.1+.
diff --git a/java/lang/NoSuchMethodException.java 
b/java/lang/NoSuchMethodException.java
index e423efb..1162382 100644
--- a/java/lang/NoSuchMethodException.java
+++ b/java/lang/NoSuchMethodException.java
@@ -1,5 +1,5 @@
 /* NoSuchMethodException.java -- thrown when reflecting a non-existant method
-   Copyright (C) 1998, 1999, 2001, 2002, 2005  Free Software Foundation, Inc.
+   Copyright (C) 1998, 1999, 2001, 2002, 2005, 2012  Free Software Foundation, 
Inc.
 
 This file is part of GNU Classpath.
 
@@ -44,9 +44,9 @@ package java.lang;
  *
  * @author Brian Jones
  * @author Warren Levy (warr...@cygnus.com)
- * @status updated to 1.4
+ * @status updated to 1.7
  */
-public class NoSuchMethodException extends Exception
+public class NoSuchMethodException extends ReflectiveOperationException
 {
   /**
* Compatible with JDK 1.0+.
diff --git

[cp-patches] [RFC/PATCH 6/6] Add missing Java 1.7 java/lang/reflect/Modifier methods

2012-03-12 Thread Pekka Enberg
Signed-off-by: Pekka Enberg penb...@kernel.org
---
 java/lang/reflect/Modifier.java |   42 ++-
 1 files changed, 41 insertions(+), 1 deletions(-)

diff --git a/java/lang/reflect/Modifier.java b/java/lang/reflect/Modifier.java
index 15bad05..c75f7b8 100644
--- a/java/lang/reflect/Modifier.java
+++ b/java/lang/reflect/Modifier.java
@@ -1,5 +1,5 @@
 /* java.lang.reflect.Modifier
-   Copyright (C) 1998, 1999, 2001, 2002, 2005, 2008  Free Software Foundation, 
Inc.
+   Copyright (C) 1998, 1999, 2001, 2002, 2005, 2008, 2012  Free Software 
Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -300,6 +300,46 @@ public class Modifier
   }
 
   /**
+   * @since 1.7
+   */
+  public static int classModifiers()
+  {
+return PUBLIC | PROTECTED | PRIVATE | STATIC | ABSTRACT | FINAL | STRICT;
+  }
+
+  /**
+   * @since 1.7
+   */
+  public static int interfaceModifiers()
+  {
+return PUBLIC | PROTECTED | PRIVATE | STATIC | ABSTRACT | STRICT;
+  }
+
+  /**
+   * @since 1.7
+   */
+  public static int constructorModifiers()
+  {
+return PUBLIC | PROTECTED | PRIVATE;
+  }
+
+  /**
+   * @since 1.7
+   */
+  public static int methodModifiers()
+  {
+return PUBLIC | PROTECTED | PRIVATE | STATIC | ABSTRACT | FINAL | STRICT | 
SYNCHRONIZED | NATIVE;
+  }
+
+  /**
+   * @since 1.7
+   */
+  public static int fieldModifiers()
+  {
+return PUBLIC | PROTECTED | PRIVATE | STATIC | FINAL | TRANSIENT | 
VOLATILE;
+  }
+
+  /**
* Get a string representation of all the modifiers represented by the
* given int. The keywords are printed in this order:
* codelt;public|protected|privategt; abstract static final transient
-- 
1.7.6.5




[cp-patches] [RFC/PATCH 4/6] Add missing Java 1.7 constructors to java/lang classes

2012-03-12 Thread Pekka Enberg
Signed-off-by: Pekka Enberg penb...@kernel.org
---
 java/lang/AssertionError.java |   14 +-
 java/lang/LinkageError.java   |   17 +++--
 2 files changed, 28 insertions(+), 3 deletions(-)

diff --git a/java/lang/AssertionError.java b/java/lang/AssertionError.java
index 778eb58..cf953f4 100644
--- a/java/lang/AssertionError.java
+++ b/java/lang/AssertionError.java
@@ -1,5 +1,5 @@
 /* AssertionError.java -- indication of a failed assertion
-   Copyright (C) 2002, 2005  Free Software Foundation, Inc.
+   Copyright (C) 2002, 2005, 2012  Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -145,4 +145,16 @@ public class AssertionError extends Error
   {
 super(Double.toString(msg));
   }
+
+  /**
+   * Construct an AssertionError with detail message and cause.
+   *
+   * @param msg Detail message.
+   * @param cause The cause of this exception, may be null
+   * @since 1.7
+   */
+  public AssertionError(String msg, Throwable cause)
+  {
+super(msg, cause);
+  }
 }
diff --git a/java/lang/LinkageError.java b/java/lang/LinkageError.java
index 0287020..34b0725 100644
--- a/java/lang/LinkageError.java
+++ b/java/lang/LinkageError.java
@@ -1,6 +1,6 @@
 /* LinkageError.java -- thrown when classes valid at separate compile times
cannot be linked to each other
-   Copyright (C) 1998, 1999, 2001, 2002, 2005  Free Software Foundation, Inc.
+   Copyright (C) 1998, 1999, 2001, 2002, 2005, 2012  Free Software Foundation, 
Inc.
 
 This file is part of GNU Classpath.
 
@@ -46,7 +46,7 @@ package java.lang;
  *
  * @author Brian Jones
  * @author Tom Tromey (tro...@cygnus.com)
- * @status updated to 1.4
+ * @status updated to 1.7
  */
 public class LinkageError extends Error
 {
@@ -71,4 +71,17 @@ public class LinkageError extends Error
   {
 super(s);
   }
+
+  /**
+   * Construct an LinkageError with detail message and cause.
+   *
+   * @param msg Detail message.
+   * @param cause The cause of this exception, may be null
+   * @since 1.7
+   */
+  public LinkageError(String msg, Throwable cause)
+  {
+super(msg, cause);
+  }
+
 }
-- 
1.7.6.5




[cp-patches] [RFC/PATCH 3/6] Add missing Java 1.7 compare() API methods to java/lang classes

2012-03-12 Thread Pekka Enberg
Signed-off-by: Pekka Enberg penb...@kernel.org
---
 java/lang/Boolean.java   |   15 +++
 java/lang/Byte.java  |   17 +
 java/lang/Character.java |   17 +
 java/lang/Integer.java   |   17 +
 java/lang/Long.java  |   17 +
 java/lang/Short.java |   17 +
 6 files changed, 100 insertions(+), 0 deletions(-)

diff --git a/java/lang/Boolean.java b/java/lang/Boolean.java
index f2eaf41..0e4afa8 100644
--- a/java/lang/Boolean.java
+++ b/java/lang/Boolean.java
@@ -237,6 +237,21 @@ public final class Boolean implements Serializable, 
ComparableBoolean
   }
 
   /**
+   * Compares two unboxed boolean values.
+   *
+   * @param x First value to compare.
+   * @param y Second value to compare.
+   * @return 0 if both Booleans represent the same value, a positive number
+   * if this Boolean represents true and the other false, and a negative
+   * number otherwise.
+   * @since 1.7
+   */
+  public static int compare(boolean x, boolean y)
+  {
+return Boolean.valueOf(x).compareTo(Boolean.valueOf(y));
+  }
+
+  /**
* If the String argument is true, ignoring case, return true.
* Otherwise, return false.
*
diff --git a/java/lang/Byte.java b/java/lang/Byte.java
index a1536e1..01e0e03 100644
--- a/java/lang/Byte.java
+++ b/java/lang/Byte.java
@@ -370,4 +370,21 @@ public final class Byte extends Number implements 
ComparableByte
 return value - b.value;
   }
 
+  /**
+   * Compares two unboxed byte values.
+   * The result is positive if the first is greater, negative if the second
+   * is greater, and 0 if the two are equal.
+   *
+   * @param x First value to compare.
+   * @param y Second value to compare.
+   *
+   * @return positive int if the first value is greater, negative if the second
+   * is greater, and 0 if the two are equal.
+   * @since 1.7
+   */
+  public static int compare(byte x, byte y)
+  {
+return Byte.valueOf(x).compareTo(Byte.valueOf(y));
+  }
+
 }
diff --git a/java/lang/Character.java b/java/lang/Character.java
index 05e641c..f87cde6 100644
--- a/java/lang/Character.java
+++ b/java/lang/Character.java
@@ -4200,6 +4200,23 @@ public final class Character implements Serializable, 
ComparableCharacter
   }
 
   /**
+   * Compares two unboxed char values.
+   * The result is positive if the first is greater, negative if the second
+   * is greater, and 0 if the two are equal.
+   *
+   * @param x First value to compare.
+   * @param y Second value to compare.
+   *
+   * @return positive int if the first value is greater, negative if the second
+   * is greater, and 0 if the two are equal.
+   * @since 1.7
+   */
+  public static int compare(char x, char y)
+  {
+return Character.valueOf(x).compareTo(Character.valueOf(y));
+  }
+
+  /**
* Returns an codeCharacter/code object wrapping the value.
* In contrast to the codeCharacter/code constructor, this method
* will cache some values.  It is used by boxing conversion.
diff --git a/java/lang/Integer.java b/java/lang/Integer.java
index f379795..25eb5d5 100644
--- a/java/lang/Integer.java
+++ b/java/lang/Integer.java
@@ -586,6 +586,23 @@ public final class Integer extends Number implements 
ComparableInteger
   }
 
   /**
+   * Compares two unboxed int values.
+   * The result is positive if the first is greater, negative if the second
+   * is greater, and 0 if the two are equal.
+   *
+   * @param x First value to compare.
+   * @param y Second value to compare.
+   *
+   * @return positive int if the first value is greater, negative if the second
+   * is greater, and 0 if the two are equal.
+   * @since 1.7
+   */
+  public static int compare(int x, int y)
+  {
+return Integer.valueOf(x).compareTo(Integer.valueOf(y));
+  }
+
+  /**
* Return the number of bits set in x.
* @param x value to examine
* @since 1.5
diff --git a/java/lang/Long.java b/java/lang/Long.java
index e7579d8..6f31dfa 100644
--- a/java/lang/Long.java
+++ b/java/lang/Long.java
@@ -585,6 +585,23 @@ public final class Long extends Number implements 
ComparableLong
   }
 
   /**
+   * Compares two unboxed long values.
+   * The result is positive if the first is greater, negative if the second
+   * is greater, and 0 if the two are equal.
+   *
+   * @param x First value to compare.
+   * @param y Second value to compare.
+   *
+   * @return positive int if the first value is greater, negative if the second
+   * is greater, and 0 if the two are equal.
+   * @since 1.7
+   */
+  public static int compare(long x, long y)
+  {
+return Long.valueOf(x).compareTo(Long.valueOf(y));
+  }
+
+  /**
* Return the number of bits set in x.
* @param x value to examine
* @since 1.5
diff --git a/java/lang/Short.java b/java/lang/Short.java
index ec87f93..fae9fe7 100644
--- a/java/lang/Short.java
+++ b/java/lang/Short.java
@@ -373,6 +373,23 @@ public final class Short extends Number implements 
ComparableShort

[cp-patches] [RFC/PATCH 2/6] Add missing java/lang/System.lineSeparator() method

2012-03-12 Thread Pekka Enberg
Signed-off-by: Pekka Enberg penb...@kernel.org
---
 java/lang/System.java |   12 
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/java/lang/System.java b/java/lang/System.java
index 51b3259..9d86991 100644
--- a/java/lang/System.java
+++ b/java/lang/System.java
@@ -97,6 +97,8 @@ public final class System
*/
   public static final PrintStream out = VMSystem.makeStandardOutputStream();
 
+  private static final String LINE_SEPARATOR = 
SystemProperties.getProperty(line.separator);
+
   /**
* The standard output PrintStream.  This is assigned at startup and
* starts its life perfectly valid. Although it is marked final, you can
@@ -713,6 +715,16 @@ public final class System
   }
 
   /**
+   * Returns the system-dependent line separator.
+   *
+   * @return the system-dependent line separator.
+   */
+  public static String lineSeparator()
+  {
+return LINE_SEPARATOR;
+  }
+
+  /**
* This is a specialised codeCollection/code, providing
* the necessary provisions for the collections used by the
* environment variable map.  Namely, it prevents
-- 
1.7.6.5




GNU Classpath version control migration after .99?

2012-03-12 Thread Pekka Enberg
Hello,

0.99 is almost out of the door so I'd like to begin the discussion on
version control migration. AFAICT, we've all agreed that we'll dump
CVS but left the decision open to which tool we'll migrate.

What I'd personally like to see is that once 0.99 is out, we shut down
CVS, convert the git mirrors to read-write git repositories:

http://icedtea.classpath.org/mirror/git

and keep the existing Mercurial mirroring scripts in place.

Thoughts?

Pekka



Re: GNU Classpath version control migration after .99?

2012-03-12 Thread Pekka Enberg
On Mon, Mar 12, 2012 at 10:00 PM, Andrew Hughes ahug...@redhat.com wrote:
 Well, you probably know from

 http://developer.classpath.org/pipermail/classpath/2012-March/003180.html

 that I'm in favour of a move to git sooner rather than later.

 How about we give it a week from now (say Monday 19th, 16h00 UTC), and if 
 there
 are no objections, we push the existing IcedTea mirror to the Classpath 
 Savannah
 project and start using that?

I'm obviously happy with that.

Pekka



Re: 0.99 Release

2012-02-01 Thread Pekka Enberg
On Wed, Feb 1, 2012 at 6:33 PM, Andrew Hughes ahug...@redhat.com wrote:
 There are a lot of unreleased fixes in there, including these latest locale
 improvements.

JRuby and Jython won't even start up with .98 so I'm definitely for .99 release!



[commit-cp] classpath ChangeLog include/Makefile.am java/la...

2012-01-08 Thread Pekka Enberg
CVSROOT:/sources/classpath
Module name:classpath
Changes by: Pekka Enberg penberg  12/01/08 12:35:54

Modified files:
.  : ChangeLog 
include: Makefile.am 
java/lang  : System.java 
native/jni/java-io: Makefile.am 
Added files:
java/io: Console.java 
native/jni/java-io: java_io_VMConsole.c 
vm/reference/java/io: VMConsole.java 

Log message:
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-07  Pekka Enberg  penb...@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 penb...@kernel.org

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/classpath/ChangeLog?cvsroot=classpathr1=1.9835r2=1.9836
http://cvs.savannah.gnu.org/viewcvs/classpath/include/Makefile.am?cvsroot=classpathr1=1.89r2=1.90
http://cvs.savannah.gnu.org/viewcvs/classpath/java/io/Console.java?cvsroot=classpathrev=1.1
http://cvs.savannah.gnu.org/viewcvs/classpath/java/lang/System.java?cvsroot=classpathr1=1.65r2=1.66
http://cvs.savannah.gnu.org/viewcvs/classpath/native/jni/java-io/Makefile.am?cvsroot=classpathr1=1.26r2=1.27
http://cvs.savannah.gnu.org/viewcvs/classpath/native/jni/java-io/java_io_VMConsole.c?cvsroot=classpathrev=1.1
http://cvs.savannah.gnu.org/viewcvs/classpath/vm/reference/java/io/VMConsole.java?cvsroot=classpathrev=1.1



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

2012-01-06 Thread Pekka Enberg
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  penb...@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 penb...@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 +++
 vm/reference/java/io/VMConsole.java|   44 
 6 files changed, 269 insertions(+), 2 deletions(-)
 create mode 100644 java/io/Console.java
 create mode 100644 native/jni/java-io/java_io_VMConsole.c
 create mode 100644 vm/reference/java/io/VMConsole.java

diff --git a/include/Makefile.am b/include/Makefile.am
index 1656c5c..37be91d 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -144,6 +144,7 @@ gnu_java_nio_VMSelector.h \
 gnu_java_nio_charset_iconv_IconvEncoder.h \
 gnu_java_nio_charset_iconv_IconvDecoder.h \
 gnu_java_lang_management_VMOperatingSystemMXBeanImpl.h \
+java_io_VMConsole.h \
 java_io_VMFile.h \
 java_io_VMObjectInputStream.h \
 java_io_VMObjectStreamClass.h \
@@ -384,6 +385,8 @@ gnu_java_nio_VMSelector.h: 
$(top_srcdir)/vm/reference/gnu/java/nio/VMSelector.ja
$(JAVAH) -o $@ gnu.java.nio.VMSelector
 gnu_java_lang_management_VMOperatingSystemMXBeanImpl.h: 
$(top_srcdir)/vm/reference/gnu/java/lang/management/VMOperatingSystemMXBeanImpl.java
$(JAVAH) -o $@ gnu.java.lang.management.VMOperatingSystemMXBeanImpl
+java_io_VMConsole.h: $(top_srcdir)/vm/reference/java/io/VMConsole.java
+   $(JAVAH) -o $@ java.io.VMConsole
 java_io_VMFile.h: $(top_srcdir)/vm/reference/java/io/VMFile.java
$(JAVAH) -o $@ java.io.VMFile
 java_io_VMObjectInputStream.h: 
$(top_srcdir)/vm/reference/java/io/VMObjectInputStream.java
diff --git a/java/io/Console.java b/java/io/Console.java
new file mode 100644
index 000..5434b02
--- /dev/null
+++ b/java/io/Console.java
@@ -0,0 +1,122 @@
+/* Console.java -- A character-based console device
+   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.
+
+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 java.io;
+
+/**
+ * @since 1.6
+ */
+public final class Console implements Flushable
+{
+  private static Console console = new Console();
+
+  public static Console console()
+  {
+return console;
+  }
+
+  private Console()
+  {
+  }
+
+  public PrintWriter writer()
+  {
+return new PrintWriter(new OutputStreamWriter(System.out));
+  }
+
+  public Reader reader()
+  {
+return new InputStreamReader(System.in);
+  }
+
+  public Console format(String fmt, Object... args)
+  {
+System.out.printf(fmt, args);
+
+return this;
+  }
+
+  public Console printf(String fmt, Object... args)
+  {
+return format(fmt

[commit-cp] classpath ChangeLog java/io/IOError.java

2012-01-06 Thread Pekka Enberg
CVSROOT:/sources/classpath
Module name:classpath
Changes by: Pekka Enberg penberg  12/01/06 14:11:23

Modified files:
.  : ChangeLog 
Added files:
java/io: IOError.java 

Log message:
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  penb...@kernel.org

* java/io/IOError:
Add new class.

Signed-off-by: Pekka Enberg penb...@kernel.org

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/classpath/ChangeLog?cvsroot=classpathr1=1.9834r2=1.9835
http://cvs.savannah.gnu.org/viewcvs/classpath/java/io/IOError.java?cvsroot=classpathrev=1.1



[cp-patches] [RFC/PATCH] Add java.io.IOError class

2012-01-05 Thread Pekka Enberg
This patch adds a missing IOError class to GNU Classpath that was introduced in
Java 1.6.

2012-01-05  Pekka Enberg  penb...@kernel.org

* java/io/IOError:
Add new class.

Signed-off-by: Pekka Enberg penb...@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 000..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.
+
+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 java.io;
+
+/**
+ * Throw when unrecoverable I/O error happens.
+ *
+ * @since 1.6
+ */
+public class IOError extends Error
+{
+  private static final long serialVersionUID = 67100927991680413L;
+
+  public IOError(String cause)
+  {
+super(cause);
+  }
+}
-- 
1.7.4.1




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

2012-01-05 Thread Pekka Enberg
This patch adds a missing IOError class to GNU Classpath that was introduced in
Java 1.6.

2012-01-05  Pekka Enberg  penb...@kernel.org

* java/io/IOError:
Add new class.

Signed-off-by: Pekka Enberg penb...@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 000..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.
+
+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 java.io;
+
+/**
+ * Throw when unrecoverable I/O error happens.
+ *
+ * @since 1.6
+ */
+public class IOError extends Error
+{
+  private static final long serialVersionUID = 67100927991680413L;
+
+  public IOError(Throwable cause)
+  {
+super(cause);
+  }
+}
-- 
1.7.4.1




[cp-patches] [RFC/PATCH 2/2] Add java/io/Console class and java/lang/System.console() method

2012-01-05 Thread Pekka Enberg
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-05  Pekka Enberg  penb...@kernel.org

* java/io/Console:
Add new class.

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

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

Signed-off-by: Pekka Enberg penb...@kernel.org
---
 java/io/Console.java|  126 +++
 java/lang/System.java   |   11 +++-
 vm/reference/java/io/VMConsole.java |   44 
 3 files changed, 180 insertions(+), 1 deletions(-)
 create mode 100644 java/io/Console.java
 create mode 100644 vm/reference/java/io/VMConsole.java

diff --git a/java/io/Console.java b/java/io/Console.java
new file mode 100644
index 000..53dca64
--- /dev/null
+++ b/java/io/Console.java
@@ -0,0 +1,126 @@
+/* Console.java -- A character-based console device
+   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.
+
+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 java.io;
+
+/**
+ * @since 1.6
+ */
+public final class Console implements Flushable
+{
+  private static Console console = new Console();
+
+  public static Console console()
+  {
+return console;
+  }
+
+  private Console()
+  {
+  }
+
+  public PrintWriter writer()
+  {
+return new PrintWriter(new OutputStreamWriter(System.out));
+  }
+
+  public Reader reader()
+  {
+return new InputStreamReader(System.in);
+  }
+
+  public Console format(String fmt, Object... args)
+  {
+System.out.printf(fmt, args);
+
+return this;
+  }
+
+  public Console printf(String fmt, Object... args)
+  {
+return format(fmt, args);
+  }
+
+  public String readLine(String fmt, Object... args)
+  {
+format(fmt, args);
+return readLine();
+  }
+
+  public String readLine()
+  {
+String result = null;
+try
+  {
+result = new BufferedReader(reader()).readLine();
+  }
+catch (IOException e)
+  {
+throw new IOError(e);
+  }
+return result;
+  }
+
+  public char[] readPassword(String fmt, Object... args)
+  {
+format(fmt, args);
+return readPassword();
+  }
+
+  public char[] readPassword()
+  {
+String s;
+
+VMConsole.echo(false);
+
+s = readLine();
+
+VMConsole.echo(true);
+
+if (s == null)
+  {
+return null;
+  }
+return s.toCharArray();
+  }
+
+  public void flush() throws IOException
+  {
+System.out.flush();
+  }
+}
diff --git a/java/lang/System.java b/java/lang/System.java
index 39d6da2..51b3259 100644
--- a/java/lang/System.java
+++ b/java/lang/System.java
@@ -1,5 +1,5 @@
 /* System.java -- useful methods to interface with the system
-   Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007
+   Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2012
Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
@@ -45,6 +45,7 @@ import gnu.classpath.VMStackWalker;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.PrintStream;
+import java.io.Console;
 import java.nio.channels.Channel;
 import java.nio.channels.spi.SelectorProvider;
 import java.util.AbstractCollection;
@@ -703,6 +704,14 @@ public final class System
 return

[ANNOUNCE] Jato 0.3

2012-01-04 Thread Pekka Enberg
-removal
  jit: Fix bug in insert_list
  jit: Compute natural loops
  jit: Enable SSA only when abc elimination needed
  Documentation: Add SSA documentation

Ankit Laddha (38):
  arm: Add stub methods so 'make check' links
  arm: Fix unit tests on ARM
  arm: Add stubs required for IC and SSA projects
  arm: Framework so arm porting can start
  arm: conversion of EXPR_VALUE to LIR
  arm: Stubs required for SSA project
  arm: Convert EXPR_LOCAL to LIR
  arm: Encoding of reg_imm_insn and reg_memlocal_insn
  arm: Framework so that bytecode-test run on arm
  arm: fix the broken unit test
  arm: Add stubs required for SSA project
  arm: Fix encoding of reg_memlocal_insn
  arm: Convert STMT_RETURN and VOID_RETURN to LIR
  arm: Fix the flow of process of encoding insns
  arm: Encode INSN_MOV_REG_REG
  arm: Encode INSN_UNCOND_BRANCH
  arm: Change memory read function
  arm: Emit the prolog of a function
  arm: Emit epilog of a function
  arm: Implement functions for liveness analysis
  arm: Emission of trampoline started
  arm: Funtion implementation for register allocation
  arm: Configured IC calls for ARM
  arm: set the text alignment in the execution pages
  arm: Full trampoline support emitted
  arm: Fix bug in trampoline emission
  arm: Initial support for bytecode tests
  arm: Some more bytecode-tests running successfully
  arm: change one LIR instruction
  arm: LIR conversion for STMT_STORE
  arm: Emit INSN_STORE_MEMLOCAL_REG
  arm: fixup instruction mnemonics
  arm: Support for negative integers
  arm: Add support for addition of integers
  arm: Add more rules to insn selector
  arm: Support for subtraction
  arm: Pass more bytecode tests
  test, integration: reordering the test cases

Balagopal (10):
  jit: Support for multiple entry points to methods.
  x86: Inline cache with clean and monomorphic states for INVOKEVIRTUAL.
  x86: Inline cache cleanups
  x86: Fix compile errors on x86_64
  x86: Megamorphic inline cache on x86_32
  test/functional: Modify invokevirtual test for better coverage.
  x86: Add dummy ic_vcall_stub for x86_64
  Makefile: Framework to generate asm-offsets
  test: Added microbenchmark for measuring Inline cache performance.
  jit: Added -Xnoic to disable inline caching

Joonas Reynders (4):
  vm: Convert classloader trace level to use pthread API
  vm, gc: Convert gc safepoint flag to use pthread API
  Converts trace_buffer from __thread to pthread API
  Convert signal register_state variable from __thread to pthread API

Nikhil Sarda (5):
  reflection: Fix parameter annotation test
  jit: Make check was failing with a SIGSEGV.
  test/integration: Added some more bytecode tests.
  test/integration: Added bytecode tests for istore, lstore, fstore and 
dstore.
  vm, gc: Improved error handling.

Pekka Enberg (219):
  vm: Fix VM launcher help text
  test/functional: Fix broken IsInstanceOf JNI test case
  test/functional: Disable parameter annotation tests
  Makefile: Fix 'tags' target to include sys directory
  arm: Fix 'make check' error caused by missing target
  test/integration: Fix printf format string error
  vm: Fix current_exec_env_key definition
  lib: Add arena memory allocator
  jit: Use arena allocator for struct var_info and friends
  x86: Fix do_native_call() miscompilation with '-O3'
  Makefile: Use GCC '-O3' optimization level
  Makefile: Use -fno-tree-vectorize on x86-64
  jit: Optimize interval_expire_ranges_before() and interval_range_at()
  vm: Optimize vm_class_is_assignable_from()
  vm: Make subtype checking faster
  test, unit: Fix compilation error
  Revert vm: Make subtype checking faster
  Makefile: Revert back to -Os for 32-bit
  vm: Add '-XX:+PrintCompilation' command line option
  test/functional: Rename FieldTest to FieldAccessorsTest
  runtime: Fix VMClass accessor method compatibility issues
  test/functional: Enable more test cases in FieldAccessorsTest
  runtime: Use java_lang_reflect_VMField prefix for native functions
  vm, runtime: Move VMField functions to runtime/java_lang_reflect_VMField.c
  reflection: Fix VMField.get() from superclasses
  jit: Fix uninitialized variable use in analyze_control_flow()
  vm: Merge 'enum thread_state' to 'enum vm_thread_state'
  jit: Cleanup jit/compilation-unit.c
  vm: Add interpreter for OPC_NOP and OPC_RETURN
  x86: Fix printf format on 64-bit
  x86-64: Kill broken OP_CMP rule from insn selector
  x86-64: Fix EXPR_FLOAT_CLASS_FIELD args on stack
  x86: Fix asm-offsets.c
  x86-64: Fix STMT_STORE args on stack
  x86-64: Fix STMT_ARRAY_STORE_CHECK args on stack
  x86-64: Enable ArrayExceptionsTest
  Revert x86-64: Enable

[commit-cp] classpath ChangeLog java/util/HashMap.java

2011-10-30 Thread Pekka Enberg
CVSROOT:/sources/classpath
Module name:classpath
Changes by: Pekka Enberg penberg  11/10/30 07:36:39

Modified files:
.  : ChangeLog 
java/util  : HashMap.java 

Log message:
Stefan Ring reports that commit f154af6 (Fix HashMap.put() to check for
hashCode equality before equals()) breaks running the CACAO test 
suite.  The
breakage 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)
 at org.junit.runner.JUnitCore.run(JUnitCore.java:107)
 at org.junit.runner.JUnitCore.runMain(JUnitCore.java:88)
 at org.junit.runner.JUnitCore.runMainAndExit(JUnitCore.java:54)
 at org.junit.runner.JUnitCore.main(JUnitCore.java:46)

  FAILURES!!!
  Tests run: 1,  Failures: 1

Looking at the code, it's obviously broken for HashMap.put() with a 
null key.

2011-10-24  Pekka Enberg  penb...@kernel.org

* java/util/HashMap.java:
(put): Fix NullPointerException for null keys.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/classpath/ChangeLog?cvsroot=classpathr1=1.9832r2=1.9833
http://cvs.savannah.gnu.org/viewcvs/classpath/java/util/HashMap.java?cvsroot=classpathr1=1.37r2=1.38



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

2011-10-24 Thread Pekka Enberg
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)
 at org.junit.runner.JUnitCore.run(JUnitCore.java:107)
 at org.junit.runner.JUnitCore.runMain(JUnitCore.java:88)
 at org.junit.runner.JUnitCore.runMainAndExit(JUnitCore.java:54)
 at org.junit.runner.JUnitCore.main(JUnitCore.java:46)

  FAILURES!!!
  Tests run: 1,  Failures: 1

Looking at the code, it's obviously broken for HashMap.put() with a null key.

Signed-off-by: Pekka Enberg penb...@kernel.org
---
 java/util/HashMap.java |5 -
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/java/util/HashMap.java b/java/util/HashMap.java
index 9d64fec..4e92731 100644
--- a/java/util/HashMap.java
+++ b/java/util/HashMap.java
@@ -345,7 +345,10 @@ public class HashMapK, V extends AbstractMapK, V
 
 while (e != null)
   {
-if ((key.hashCode() == e.key.hashCode())  equals(key, e.key))
+int hash1 = key == null ? 0 : key.hashCode();
+int hash2 = e.key == null ? 0 : e.key.hashCode();
+
+if ((hash1 == hash2)  equals(key, e.key))
   {
 e.access(); // Must call this for bookkeeping in LinkedHashMap.
 V r = e.value;
-- 
1.7.6.4




Re: [cp-patches] [RFC/PATCH] Fix NPE in HashMap.put()

2011-10-24 Thread Pekka Enberg
On Mon, Oct 24, 2011 at 11:24 AM, Mark Wielaard m...@klomp.org wrote:
 On Mon, 2011-10-24 at 10:11 +0300, Pekka Enberg wrote:
 Looking at the code, it's obviously broken for HashMap.put() with a null key.

 Urgh yes.

 @@ -345,7 +345,10 @@ public class HashMapK, V extends AbstractMapK, V

      while (e != null)
        {
 -        if ((key.hashCode() == e.key.hashCode())  equals(key, e.key))
 +        int hash1 = key == null ? 0 : key.hashCode();
 +        int hash2 = e.key == null ? 0 : e.key.hashCode();
 +
 +        if ((hash1 == hash2)  equals(key, e.key))
            {
              e.access(); // Must call this for bookkeeping in LinkedHashMap.
              V r = e.value;

 Are you sure that is right?
 What about a key which isn't null but has a hashCode() of zero?

Does that matter? The hashCode check will be a false positive but
equals() should catch it, right?



Re: [cp-patches] [PATCH] Fix raw type references in AnnotationInvocationHandler

2011-10-12 Thread Pekka Enberg
On Wed, Oct 12, 2011 at 1:28 AM, Dr Andrew John Hughes
ahug...@redhat.com wrote:
 We can't do this.  This class is part of the VM interface and the VM
 interface is meant to work with  1.5.

Would it be OK to use @SuppressWarnings here? I'd like to make builds
less verbose.

On Wed, Oct 12, 2011 at 1:28 AM, Dr Andrew John Hughes
ahug...@redhat.com wrote:
 If we're going to change that, it should happen after the next release
 and with plenty of discussion / heads up for VMs.

Right. I guess I could send patches for JamVM, CACAO, and Jato as
well. Are there other VMs we care about?

Pekka



[cp-patches] [PATCH] Fix raw type references in AnnotationInvocationHandler

2011-10-11 Thread Pekka Enberg
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 penb...@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  penb...@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  ahug...@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
+++ b/sun/reflect/annotation/AnnotationInvocationHandler.java
@@ -62,21 +62,23 @@ public final class AnnotationInvocationHandler
   implements InvocationHandler, Serializable
 {
 private static final long serialVersionUID = 6182022883658399397L;
-private final Class type;
-private final Map memberValues;
+private final Class? extends Annotation type;
+private final MapString, Object memberValues;
 
 /**
  * Construct a new invocation handler for an annotation proxy.
  * Note that the VM is responsible for filling the memberValues map
  * with the default values of all the annotation members.
  */
-public AnnotationInvocationHandler(Class type, Map memberValues)
+public AnnotationInvocationHandler(Class? extends Annotation type,
+   MapString, Object memberValues)
 {
 this.type = type;
 this.memberValues = memberValues;
 }
 
-public static Annotation create(Class type, Map memberValues)
+public static Annotation create(Class? extends Annotation type,
+MapString, Object memberValues)
 {
   for (Method m : type.getDeclaredMethods())
 {
@@ -106,7 +108,8 @@ public final class AnnotationInvocationHandler
  * (can) use different representations of annotations that reuse this
  * method.
  */
-public static boolean equals(Class type, Map memberValues, Object other)
+public static boolean equals(Class? extends Annotation type,
+ MapString, Object memberValues, Object 
other)
 {
 if (type.isInstance(other))
 {
@@ -217,13 +220,14 @@ public final class AnnotationInvocationHandler
  * (can) use different representations of annotations that reuse this
  * method.
  */
-public static int hashCode(Class type, Map memberValues)
+public static int hashCode(Class? extends Annotation type,
+   MapString, Object memberValues)
 {
 int h = 0;
-Iterator iter = memberValues.keySet().iterator();
+IteratorString iter = memberValues.keySet().iterator();
 while (iter.hasNext())
 {
-Object key = iter.next();
+String key = iter.next();
 Object val = memberValues.get(key);
 h += deepHashCode(val) ^ 127 * key.hashCode();
 }
@@ -267,15 +271,16 @@ public final class AnnotationInvocationHandler
  * (can) use different representations of annotations that reuse this
  * method.
  */
-public static String toString(Class type, Map memberValues)
+public static String toString(Class? extends Annotation type,
+  MapString, Object memberValues)
 {
 StringBuffer sb = new StringBuffer();
 sb.append('@').append(type.getName()).append('(');
 String sep = ;
-Iterator iter = memberValues.keySet().iterator();
+IteratorString iter = memberValues.keySet().iterator();
 while (iter.hasNext())
 {
-Object key = iter.next();
+String key = iter.next();
 Object val = memberValues.get(key);
 sb.append(sep).append(key).append('=').append(deepToString(val));
 sep = , ;
@@ -284,9 +289,9 @@ public final class AnnotationInvocationHandler
 return sb.toString();
 }
 
-private static Class getBoxedReturnType(Method method)
+private static Class? getBoxedReturnType(Method method)
 {
-Class returnType = method.getReturnType();
+Class? returnType = method.getReturnType();
 
 if (returnType == boolean.class)
 return Boolean.class;
-- 
1.7.6.4




Re: Experimental GNU Classpath and Mauve mercurial and git mirrors

2011-10-10 Thread Pekka Enberg
On Mon, Oct 10, 2011 at 12:04 PM, Mark Wielaard m...@klomp.org wrote:
 Thanks to Pekka Enberg there are now experimental hg and git mirrors of
 all the GNU Classpath and Mauve CVS repository modules on icedtea:
 http://icedtea.classpath.org/mirror/hg/
 http://icedtea.classpath.org/mirror/git/

 They should sync each hour and update.

Yay! Thanks for setting this up, Mark.



Re: [problem] GNU Classpath build problems on Fedora 15

2011-09-29 Thread Pekka Enberg
 On Tue, 2011-09-27 at 15:31 +0300, Pekka Enberg wrote:
 I'm seeing this on Fedora 15:

 [penberg@tux classpath.cvs]$ sh autogen.sh
 configure.ac:505: warning: AC_LIB_PREPARE_PREFIX is m4_require'd but
 not m4_defun'd
 m4/iconv.m4:11: AM_ICONV_LINKFLAGS_BODY is expanded from...
 m4/iconv.m4:22: AM_ICONV_LINK is expanded from...
 m4/iconv.m4:77: AM_ICONV is expanded from...
 configure.ac:505: the top level
 configure.ac:505: warning: AC_LIB_RPATH is m4_require'd but not m4_defun'd
 m4/iconv.m4:11: AM_ICONV_LINKFLAGS_BODY is expanded from...
 m4/iconv.m4:22: AM_ICONV_LINK is expanded from...
 m4/iconv.m4:77: AM_ICONV is expanded from...
 configure.ac:505: the top level

On Thu, Sep 29, 2011 at 12:52 PM, Mark Wielaard m...@klomp.org wrote:
 I don't have my F15 setup handy, but I think this is missing
 iconv/gettext m4 macros. Try installing gettext-devel which should
 provide /usr/share/aclocal/lib-prefix.m4

Gee, it's that again. Yeah, it helped. Thanks!

 If that helps we should probably update the INSTALL and/or autogen.sh
 checks.

I'll do that. I guess we can just do:

+if [ -e /usr/share/aclocal/lib-prefix.m4 ] ; then
+   have_gettext=true
+fi

right?

Pekka



Re: [problem] GNU Classpath build problems on Fedora 15

2011-09-29 Thread Pekka Enberg
On Thu, Sep 29, 2011 at 2:54 PM, Mark Wielaard m...@klomp.org wrote:
 It seems gnulib also provides lib-prefix.m4 in the havelib module. Maybe
 we should just incorporate it from there and not depend on gettext-devel
 to be installed (I am a bit fuzzy on why we have the
 gettext-devel/lib-prefix.m4 dependency, we only really need iconv
 support, but there was some dependency on gettext anyway)?

It seems we had lib-prefix-m4 in the tree but Andrew dropped it:

2010-01-30  Andrew John Hughes  ahug...@redhat.com

* autogen.sh:
Allow libtool 2.* through.
* configure.ac:
Updated via autoupdate.
* m4/lib-ld.m4,
* m4/lib-link.m4,
* m4/lib-prefix.m4:
Drop old libtool macros which
result in build failure.

Hmmh?

Pekka



[problem] GNU Classpath build problems on Fedora 15

2011-09-27 Thread Pekka Enberg
Hi all,

I'm seeing this on Fedora 15:

[penberg@tux classpath.cvs]$ sh autogen.sh
configure.ac:505: warning: AC_LIB_PREPARE_PREFIX is m4_require'd but
not m4_defun'd
m4/iconv.m4:11: AM_ICONV_LINKFLAGS_BODY is expanded from...
m4/iconv.m4:22: AM_ICONV_LINK is expanded from...
m4/iconv.m4:77: AM_ICONV is expanded from...
configure.ac:505: the top level
configure.ac:505: warning: AC_LIB_RPATH is m4_require'd but not m4_defun'd
m4/iconv.m4:11: AM_ICONV_LINKFLAGS_BODY is expanded from...
m4/iconv.m4:22: AM_ICONV_LINK is expanded from...
m4/iconv.m4:77: AM_ICONV is expanded from...
configure.ac:505: the top level
configure.ac:505: warning: AC_LIB_PREPARE_PREFIX is m4_require'd but
not m4_defun'd
m4/iconv.m4:11: AM_ICONV_LINKFLAGS_BODY is expanded from...
m4/iconv.m4:22: AM_ICONV_LINK is expanded from...
m4/iconv.m4:77: AM_ICONV is expanded from...
configure.ac:505: the top level
configure.ac:505: warning: AC_LIB_RPATH is m4_require'd but not m4_defun'd
m4/iconv.m4:11: AM_ICONV_LINKFLAGS_BODY is expanded from...
m4/iconv.m4:22: AM_ICONV_LINK is expanded from...
m4/iconv.m4:77: AM_ICONV is expanded from...
configure.ac:505: the top level
libtoolize: putting auxiliary files in `.'.
libtoolize: copying file `./ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4'.
libtoolize: copying file `m4/libtool.m4'
libtoolize: copying file `m4/ltoptions.m4'
libtoolize: copying file `m4/ltsugar.m4'
libtoolize: copying file `m4/ltversion.m4'
libtoolize: copying file `m4/lt~obsolete.m4'
configure.ac:505: warning: AC_LIB_PREPARE_PREFIX is m4_require'd but
not m4_defun'd
m4/iconv.m4:11: AM_ICONV_LINKFLAGS_BODY is expanded from...
m4/iconv.m4:22: AM_ICONV_LINK is expanded from...
m4/iconv.m4:77: AM_ICONV is expanded from...
configure.ac:505: the top level
configure.ac:505: warning: AC_LIB_RPATH is m4_require'd but not m4_defun'd
m4/iconv.m4:11: AM_ICONV_LINKFLAGS_BODY is expanded from...
m4/iconv.m4:22: AM_ICONV_LINK is expanded from...
m4/iconv.m4:77: AM_ICONV is expanded from...
configure.ac:505: the top level
configure.ac:505: warning: AC_LIB_PREPARE_PREFIX is m4_require'd but
not m4_defun'd
m4/iconv.m4:11: AM_ICONV_LINKFLAGS_BODY is expanded from...
m4/iconv.m4:22: AM_ICONV_LINK is expanded from...
m4/iconv.m4:77: AM_ICONV is expanded from...
configure.ac:505: the top level
configure.ac:505: warning: AC_LIB_RPATH is m4_require'd but not m4_defun'd
m4/iconv.m4:11: AM_ICONV_LINKFLAGS_BODY is expanded from...
m4/iconv.m4:22: AM_ICONV_LINK is expanded from...
m4/iconv.m4:77: AM_ICONV is expanded from...
configure.ac:505: the top level
configure:18566: error: possibly undefined macro: AC_LIB_PREPARE_PREFIX
  If this token and others are legitimate, please use m4_pattern_allow.
  See the Autoconf documentation.
configure:18567: error: possibly undefined macro: AC_LIB_RPATH
configure:18572: error: possibly undefined macro: AC_LIB_LINKFLAGS_BODY
configure:18580: error: possibly undefined macro: AC_LIB_APPENDTOVAR
autoreconf: /usr/bin/autoconf failed with exit status: 1

Has anyone built GNU Classpath on Fedora 15 successfully?

   Pekka



Re: Using ASM for invokedynamic bytecode generation

2011-09-09 Thread Pekka Enberg
Hi Mark,

On Thu, Sep 8, 2011 at 10:33 PM, Mark Wielaard m...@klomp.org wrote:
 I don't know much about what is needed for invoke dynamic byte code
 generation. Note that java/lang/reflect/Proxy.java for example also can
 generate byte code, but just does it by hand. Is such an approach
 possible?

It's possible, sure. I was thinking of using ASM because I suspect the
generated bytecode won't be trivial. I'll see how quickly I hit limitations
with generating bytecode by hand. Is a light-weight GNU Classpath
specific bytecode helper API totally out of the question?

Pekka



Using ASM for invokedynamic bytecode generation

2011-09-07 Thread Pekka Enberg
Hi all,

I started hacking on invokedynamic again:

https://github.com/penberg/classpath/commit/21c457f4928678bb5709dfc5a992b80f0d02c4b8

https://github.com/penberg/jato/commits/indy

I'm planning to use ASM for generating bytecode for method handle
chains. Does that sound like a reasonable thing to do? We already
carry the ASM code under tools/external/asm/. Can I just move that
under external/ and rename the package so that it doesn't clash with
the upstream project?

Pekka



[cp-patches] [PATCH] Fix clock_gettime() support check for Darwin

2011-07-05 Thread Pekka Enberg
Darwin doesn't support clock_gettime() but has _POSIX_MONOTONIC_CLOCK defined
so use a more strict check with _POSIX_TIMERS.

This fixes the following compilation error:

  java_lang_VMSystem.c: In function ‘Java_java_lang_VMSystem_nanoTime’:
  java_lang_VMSystem.c:148: warning: implicit declaration of function 
‘clock_gettime’
  java_lang_VMSystem.c:148: error: ‘CLOCK_MONOTONIC’ undeclared (first use in 
this function)
  java_lang_VMSystem.c:148: error: (Each undeclared identifier is reported only 
once
  java_lang_VMSystem.c:148: error: for each function it appears in.)

Signed-off-by: Pekka Enberg penb...@kernel.org
---
 native/jni/java-lang/java_lang_VMSystem.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/native/jni/java-lang/java_lang_VMSystem.c 
b/native/jni/java-lang/java_lang_VMSystem.c
index 047c2b3..5c4a65b 100644
--- a/native/jni/java-lang/java_lang_VMSystem.c
+++ b/native/jni/java-lang/java_lang_VMSystem.c
@@ -141,7 +141,7 @@ Java_java_lang_VMSystem_nanoTime
   (JNIEnv * env,
jclass thisClass __attribute__ ((__unused__)))
 {
-#ifdef _POSIX_MONOTONIC_CLOCK
+#if _POSIX_TIMERS  0  defined(_POSIX_MONOTONIC_CLOCK)
   jlong result;
   struct timespec tp;
 
-- 
1.7.4.1




[cp-patches] [PATCH v2] Fix clock_gettime() support check for Darwin

2011-07-05 Thread Pekka Enberg
Darwin doesn't support clock_gettime() but has _POSIX_MONOTONIC_CLOCK defined
so use a more strict check with HAVE_CLOCK_GETTIME.

This fixes the following compilation error:

  java_lang_VMSystem.c: In function ‘Java_java_lang_VMSystem_nanoTime’:
  java_lang_VMSystem.c:148: warning: implicit declaration of function 
‘clock_gettime’
  java_lang_VMSystem.c:148: error: ‘CLOCK_MONOTONIC’ undeclared (first use in 
this function)
  java_lang_VMSystem.c:148: error: (Each undeclared identifier is reported only 
once
  java_lang_VMSystem.c:148: error: for each function it appears in.)

Signed-off-by: Pekka Enberg penb...@kernel.org
---
v1 - v2: Use HAVE_CLOCK_GETTIME

 configure.ac  |4 +++-
 native/jni/java-lang/java_lang_VMSystem.c |2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index f9105e9..a106e11 100644
--- a/configure.ac
+++ b/configure.ac
@@ -440,13 +440,15 @@ if test x${COMPILE_JNI} = xyes; then
   AC_EGREP_HEADER(u_int32_t, sys/types.h, AC_DEFINE(HAVE_BSD_INT32_DEFINED, 1, 
[Define to 1 if you have BSD u_int32_t]))
   AC_EGREP_HEADER(u_int32_t, sys/config.h, AC_DEFINE(HAVE_BSD_INT32_DEFINED, 
1, [Define to 1 if you have BSD u_int32_t]))
 
+  AC_SEARCH_LIBS([clock_gettime], [rt])
   AC_SEARCH_LIBS([inet_pton],[nsl])
   AC_CHECK_LIB([socket], [gethostname]) 
+
   AC_CHECK_FUNCS([ftruncate fsync select \
  gethostname socket strerror fork pipe execve open close \
  lseek fstat read readv write writev htonl memset htons 
connect \
  getsockname getpeername bind listen accept \
- recvfrom send sendto setsockopt getsockopt time mktime \
+ recvfrom send sendto setsockopt getsockopt time mktime 
clock_gettime \
  gethostbyname_r localtime_r \
  strerror_r \
   fcntl \
diff --git a/native/jni/java-lang/java_lang_VMSystem.c 
b/native/jni/java-lang/java_lang_VMSystem.c
index 047c2b3..f623857 100644
--- a/native/jni/java-lang/java_lang_VMSystem.c
+++ b/native/jni/java-lang/java_lang_VMSystem.c
@@ -141,7 +141,7 @@ Java_java_lang_VMSystem_nanoTime
   (JNIEnv * env,
jclass thisClass __attribute__ ((__unused__)))
 {
-#ifdef _POSIX_MONOTONIC_CLOCK
+#if defined(HAVE_CLOCK_GETTIME)  defined(_POSIX_MONOTONIC_CLOCK)
   jlong result;
   struct timespec tp;
 
-- 
1.7.4.1




[PROBLEM] Building GNU Classpath on Darwin

2011-07-05 Thread Pekka Enberg
Hi,

I'm trying to build GNU Classpath CVS HEAD on Mac OS X 10.6.7. I
followed these instructions to satisfy the autoconf 2.65 requirement:

http://www.mattvsworld.com/blog/2010/02/install-the-latest-autoconf-and-automake-on-mac-os-10-6/

However, when I try to run 'autogen.sh' I get the following error:

$ sh autogen.sh
configure.ac:503: warning: AC_LIB_PREPARE_PREFIX is m4_require'd but
not m4_defun'd
m4/iconv.m4:11: AM_ICONV_LINKFLAGS_BODY is expanded from...
m4/iconv.m4:22: AM_ICONV_LINK is expanded from...
m4/iconv.m4:77: AM_ICONV is expanded from...
configure.ac:503: the top level
configure.ac:503: warning: AC_LIB_RPATH is m4_require'd but not m4_defun'd
configure.ac:503: warning: AC_LIB_PREPARE_PREFIX is m4_require'd but
not m4_defun'd
m4/iconv.m4:11: AM_ICONV_LINKFLAGS_BODY is expanded from...
m4/iconv.m4:22: AM_ICONV_LINK is expanded from...
m4/iconv.m4:77: AM_ICONV is expanded from...
configure.ac:503: the top level
configure.ac:503: warning: AC_LIB_RPATH is m4_require'd but not m4_defun'd
libtoolize: putting auxiliary files in `.'.
libtoolize: copying file `./ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4'.
libtoolize: copying file `m4/libtool.m4'
libtoolize: copying file `m4/ltoptions.m4'
libtoolize: copying file `m4/ltsugar.m4'
libtoolize: copying file `m4/ltversion.m4'
libtoolize: copying file `m4/lt~obsolete.m4'
configure.ac:503: warning: AC_LIB_PREPARE_PREFIX is m4_require'd but
not m4_defun'd
m4/iconv.m4:11: AM_ICONV_LINKFLAGS_BODY is expanded from...
m4/iconv.m4:22: AM_ICONV_LINK is expanded from...
m4/iconv.m4:77: AM_ICONV is expanded from...
configure.ac:503: the top level
configure.ac:503: warning: AC_LIB_RPATH is m4_require'd but not m4_defun'd
configure.ac:503: warning: AC_LIB_PREPARE_PREFIX is m4_require'd but
not m4_defun'd
m4/iconv.m4:11: AM_ICONV_LINKFLAGS_BODY is expanded from...
m4/iconv.m4:22: AM_ICONV_LINK is expanded from...
m4/iconv.m4:77: AM_ICONV is expanded from...
configure.ac:503: the top level
configure.ac:503: warning: AC_LIB_RPATH is m4_require'd but not m4_defun'd
configure:17858: error: possibly undefined macro: AC_LIB_PREPARE_PREFIX
  If this token and others are legitimate, please use m4_pattern_allow.
  See the Autoconf documentation.
configure:17859: error: possibly undefined macro: AC_LIB_RPATH
configure:17864: error: possibly undefined macro: AC_LIB_LINKFLAGS_BODY
configure:17872: error: possibly undefined macro: AC_LIB_APPENDTOVAR
autoreconf: /usr/local/bin/autoconf failed with exit status: 1

Any ideas what's going wrong here?

   Pekka



Re: [PROBLEM] Building GNU Classpath on Darwin

2011-07-05 Thread Pekka Enberg
On Tue, Jul 5, 2011 at 12:53 PM, Mark Wielaard m...@klomp.org wrote:
 Hi Pekka,

 On Tue, 2011-07-05 at 12:28 +0300, Pekka Enberg wrote:
 I'm trying to build GNU Classpath CVS HEAD on Mac OS X 10.6.7. I
 followed these instructions to satisfy the autoconf 2.65 requirement:

 http://www.mattvsworld.com/blog/2010/02/install-the-latest-autoconf-and-automake-on-mac-os-10-6/

 However, when I try to run 'autogen.sh' I get the following error:

 $ sh autogen.sh
 configure.ac:503: warning: AC_LIB_PREPARE_PREFIX is m4_require'd but
 not m4_defun'd
 m4/iconv.m4:11: AM_ICONV_LINKFLAGS_BODY is expanded from...
 m4/iconv.m4:22: AM_ICONV_LINK is expanded from...
 m4/iconv.m4:77: AM_ICONV is expanded from...
 configure.ac:503: the top level
 [...]
 autoreconf: /usr/local/bin/autoconf failed with exit status: 1

 Any ideas what's going wrong here?

 I am not sure, but you might be missing gettext, and our configure picks
 up the local m4/iconv.m4. We don't actually use gettext, but we try to
 use iconv. See the installation instructions at
 http://www.gnu.org/software/libiconv/ which has a little section on
 iconv.m4. So try installing gettext, or find an updated version of the
 libiconv iconv.m4 and install that under the classpath/m4/ directory.
 Please let us know if that helps or not.

I had gettext installed but I had to do 'brew link' on it:

  sudo brew link gettext

for it to become visible in PATH. After I did that, autogen.sh started
working. I wonder why the error message is so darn cryptic, though...
;-)

Anyway, thanks!



[commit-cp] classpath ChangeLog configure.ac native/jni/jav...

2011-07-05 Thread Pekka Enberg
CVSROOT:/sources/classpath
Module name:classpath
Changes by: Pekka Enberg penberg  11/07/05 18:52:47

Modified files:
.  : ChangeLog configure.ac 
native/jni/java-lang: java_lang_VMSystem.c 

Log message:
Fix clock_gettime() support check for Darwin

Darwin doesn't support clock_gettime() but has _POSIX_MONOTONIC_CLOCK 
defined
so use a more strict check with HAVE_CLOCK_GETTIME.

This fixes the following compilation error:

  java_lang_VMSystem.c: In function 
‘Java_java_lang_VMSystem_nanoTime’:
  java_lang_VMSystem.c:148: warning: implicit declaration of function 
‘clock_gettime’
  java_lang_VMSystem.c:148: error: ‘CLOCK_MONOTONIC’ undeclared 
(first use in this function)
  java_lang_VMSystem.c:148: error: (Each undeclared identifier is 
reported only once
  java_lang_VMSystem.c:148: error: for each function it appears in.)

2011-07-05  Pekka Enberg  penb...@kernel.org

   * configure.ac:
   Check for clock_gettime().
   native/jni/java-lang/java_lang_VMSystem.c:
   (Java_java_lang_VMSystem_nanoTime):
   Fix compile error on systems that don't have clock_gettime().

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/classpath/ChangeLog?cvsroot=classpathr1=1.9828r2=1.9829
http://cvs.savannah.gnu.org/viewcvs/classpath/configure.ac?cvsroot=classpathr1=1.248r2=1.249
http://cvs.savannah.gnu.org/viewcvs/classpath/native/jni/java-lang/java_lang_VMSystem.c?cvsroot=classpathr1=1.18r2=1.19



[commit-cp] classpath ChangeLog lib/Makefile.am

2011-05-29 Thread Pekka Enberg
CVSROOT:/sources/classpath
Module name:classpath
Changes by: Pekka Enberg penberg  11/05/29 09:07:07

Modified files:
.  : ChangeLog 
lib: Makefile.am 

Log message:
Generate META-INF/INDEX.LIST file for glibj.zip

This patch changes the glibj.zip packaging so that META-INF/INDEX.LIST 
is
generated to the file. This is needed for 
VMClassLoader.getBootPackages() to
work correctly:

  private static String[] getBootPackages()
  {
URL indexList = getResource(META-INF/INDEX.LIST);
if (indexList != null)
  {

NOTE! This problem is only seen with Jato currently as it's the only VM 
I'm
aware of that doesn't override any of the classes in vm/reference. 
CACAO and
JamVM override the whole classloading parts themselves.

I asked about this on IRC and Mark Wielaard explained background on the 
issue:

   mjw 2006-04-19  Olivier Jolly  olivier.jo...@pcedev.com
   mjw* vm/reference/java/lang/VMClassLoader.java 
(getBootPackages): Loads
   mjwboot packages list from the META-INF/INDEX.LIST file if it 
exists.
   mjw 
http://developer.classpath.org/pipermail/classpath-patches/2006-April/001704.html
   mjw the patch to support the -i option should be incorporated 
soon and we'll be able to add the creation of the index to the glibj.zip by 
default.
   mjw soon just happens the be  5 years...

2011-05-29  Pekka Enberg  penb...@kernel.org

* lib/Makefile.am:
Generate META-INF/INDEX.LST for glibj.zip.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/classpath/ChangeLog?cvsroot=classpathr1=1.9826r2=1.9827
http://cvs.savannah.gnu.org/viewcvs/classpath/lib/Makefile.am?cvsroot=classpathr1=1.149r2=1.150



[cp-patches] [RFC/PATCH] Generate META-INF/INDEX.LIST file for glibj.zip

2011-05-26 Thread Pekka Enberg
This patch changes the glibj.zip packaging so that META-INF/INDEX.LIST is
generated to the file. This is needed for VMClassLoader.getBootPackages() to
work correctly:

  private static String[] getBootPackages()
  {
URL indexList = getResource(META-INF/INDEX.LIST);
if (indexList != null)
  {

NOTE! This problem is only seen with Jato currently as it's the only VM I'm
aware of that doesn't override any of the classes in vm/reference. CACAO and
JamVM override the whole classloading parts themselves.

I asked about this on IRC and Mark Wielaard explained background on the issue:

   mjw 2006-04-19  Olivier Jolly  olivier.jo...@pcedev.com
   mjw* vm/reference/java/lang/VMClassLoader.java (getBootPackages): Loads
   mjwboot packages list from the META-INF/INDEX.LIST file if it exists.
   mjw 
http://developer.classpath.org/pipermail/classpath-patches/2006-April/001704.html
   mjw the patch to support the -i option should be incorporated soon and 
we'll be able to add the creation of the index to the glibj.zip by default.
   mjw soon just happens the be  5 years...

Signed-off-by: Pekka Enberg penb...@kernel.org
---
 lib/Makefile.am |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lib/Makefile.am b/lib/Makefile.am
index 8104ee7..50d1baa 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -71,7 +71,7 @@ glibj.zip:
 else
 
 if WITH_JAR
-CREATE_GLIBJ_ZIP=$(JAR) cf glibj.zip gnu java javax org sun META-INF
+CREATE_GLIBJ_ZIP=$(JAR) cf glibj.zip gnu java javax org sun META-INF  $(JAR) 
i glibj.zip
 else
 CREATE_GLIBJ_ZIP=$(ZIP) -r -D glibj.zip gnu java javax org sun META-INF  
/dev/null
 endif
-- 
1.7.4.1




Re: [cp-patches] [RFC/PATCH] Generate META-INF/INDEX.LIST file for glibj.zip

2011-05-26 Thread Pekka Enberg
Hi Andrew,

On Fri, May 27, 2011 at 6:45 AM, Dr Andrew John Hughes
ahug...@redhat.com wrote:
  if WITH_JAR
 -CREATE_GLIBJ_ZIP=$(JAR) cf glibj.zip gnu java javax org sun META-INF
 +CREATE_GLIBJ_ZIP=$(JAR) cf glibj.zip gnu java javax org sun META-INF  
 $(JAR) i glibj.zip
  else
  CREATE_GLIBJ_ZIP=$(ZIP) -r -D glibj.zip gnu java javax org sun META-INF  
 /dev/null
  endif

 My only concern with the patch (as I think Mark also raised on IRC) is that 
 it means
 the index is only generated if WITH_JAR is set and not if $(ZIP) is used.

 Should we just drop the $(ZIP) option and require jar to be available?  I 
 suspect
 the reason we haven't done this is a bootstrapping issue.  Does anyone have 
 any
 thoughts?

I think requiring jar is reasonable in 2011 and we should drop zip support. ;-)

Pekka



[ANNOUNCE] Jato v0.2 - a JIT-only virtual machine for Java

2011-05-24 Thread Pekka Enberg
Hi all!

Jato 0.2 release is now available!

Jato is an open source, JIT-only virtual machine for Java that aims to support
the latest JVM specification. It can currently run many Java applications on
32-bit x86 Linux machines such as Eclipse.

What's new in this release:

  - Jython and JRuby start up under the VM (requires GNU Classpath CVS HEAD)

  - Annotation support (Pekka Enberg, Nikhil Sarda)

  - More missing JNI APIs implemented (Joonas Reynders, Nikhil Sarda)

  - More missing reflection APIs implemented (Nikhil Sarda)

  - Linux/x86-64 port fixes (Eduard - Gabriel Munteanu, Sergey Mashkov, Pekka 
Enberg)

  - Linux/i386 bug fixes (Tomek Grabiec, Vegard Nossum)

  - SSA form bug fixes (Ana-Maria Farcasi)

  - Darwin port fixes (Michael Tremel)

NOTE NOTE NOTE! You're strongly encouraged to use GNU Classpath CVS HEAD
because it has important Jython and JRuby compatibility fixes that are not part
of any release.

There's a Github mirrof the GNU Classpath here for people who don't want to use
CVS:

  https://github.com/penberg/classpath

The source code for Jato is available for download here:

   http://www.kernel.org/pub/software/java/jato/jato-0.2.tar.bz2

You can also get the latest sources from the git repository:

   git clone git://git.kernel.org/pub/scm/java/jato/jato.git

If you have questions, comments, or suggestions, feel free to drop by at #jato
on irc.freenode.net or send an email to our mailing list at:

   http://groups.google.com/group/jatovm?hl=en

You can also report problems on Github:

  https://github.com/penberg/jato/issues

For more information, please check out the Jato home page:

   http://www.jatovm.org/

Pekka
---

Changes from v0.1.1 to v0.2: 


Ana Farcasi (3):
  jit: fix initialization of a compilation unit
  test/unit: Added test for dominance frontier sets
  arch/x86: Fix print_jmp_memindex

Ankit Laddha (1):
  arm: Add dummy functions to make Jato link on ARM

Balagopal (1):
  vm: Add option -Xtrace:vtable for tracing all vtables

Eduard - Gabriel Munteanu (9):
  x86-64: fix unwind emitter
  Add DEBUG option to the build system.
  New section on GDB support in Documentation/debugging.txt
  Discover GNU Classpath 0.98 on Gentoo
  x86-64: handle 32-bit imm movs
  x86-64: set the vm_type in args_map_assign()
  x86-64: fix regparm allocation for JNI arguments
  x86-64: fix float / double returns
  x86-64: fix invoke result propagation for float / double

Farcasi Ana-Maria (4):
  jit: Fix crash in do_compute_dfns()
  vm: Fix -Xssa command line option parsing
  jit: Add tracing for SSA data structures
  x86: fix print_jmp_membase

Joonas Reynders (36):
  runtime: Implement VMRuntime#traceMethodCalls
  tests: Introduce JNI test case
  Added JNI roundtrip tests for basic types. Float and double fail
  jni,test: Add basic instance roundtrip test to JNITest
  jni,test: Add JNI array types and roundtrip tests
  jni: Convert part of the JNI API to correspond the JNI spec
  JNI refactoring, jnienv methods 26-34
  JNI CallXxxMethod-function names refactored to spec
  JNI CallNonvirtualXxxMethod-function names refactored to spec
  jni get and set field method names refactored according to spec
  JNI call static method function names refactored according to spec
  jni: JNI_{Get|Set}Static*Field API refactoring
  JNI function names 164-175 refactored according to spec
  Refactor the remaining JNI 1.1 function names
  JNI 1.2 and forward function names refactored according to spec
  Final refactoring of JNI functions, jvalue and const fixes
  jni: Refactor java_vm to JavaVM as per JNI specification
  Functional test for JNI GetVersion
  vm,jni: Moved Java and JNI version constants to java-version.h
  Remove unused JNI guard page mechanism
  vm: Fix defaultJNIEnv initialization and add test
  vm,jni: JNI_DefineClass implementation and test
  test/functional: Fixed java formatting
  test/functional: Add JNI FindClass tests
  Add a simple functional test for broken class files
  vm: Add debug printing functions
  runtime: java.lang.reflect.Method support for ToReflectedMethod and 
FromReflectedMethod
  runtime: java.lang.reflect.Field support for JNI ToReflectedField and 
FromReflectedField
  vm: java.lang.Object support for debug printing
  runtime: Move struct vm_method helpers to reflection.c
  runtime: Refactor vm_field to java.lang.reflect.Field wrapping
  jni: JNI GetSuperclass implementation and tests
  test/functional: Add tests for JNI isAssignableFrom
  test/functional: Add tests for JNI Throw function
  test/functional: Add tests for JNI ThrowNew function
  test/functional: Add tests for JNI ExceptionOccurred and ExceptionClear 
functions

Karim Osman (1):
  Update README file

Michael Tremel (2):
  vm

[cp-patches] FYI: [PATCH] Add Matcher.quoteReplacement() API method

2011-04-25 Thread Pekka Enberg
Signed-off-by: Pekka Enberg penb...@kernel.org
---
 java/util/regex/Matcher.java |   23 +++
 1 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/java/util/regex/Matcher.java b/java/util/regex/Matcher.java
index 2d058fb..8d033d5 100644
--- a/java/util/regex/Matcher.java
+++ b/java/util/regex/Matcher.java
@@ -614,4 +614,27 @@ public final class Matcher implements MatchResult
 return snapshot;
   }
 
+  /**
+   * Returns a literalized string of s where characters {@code $} and {@code
+   * \\} are escaped.
+   *
+   * @param s the string to literalize.
+   * @return the literalized string.
+   * @since 1.5
+   */
+  public static String quoteReplacement(String s)
+  {
+if (s == null)
+  throw new NullPointerException();
+CPStringBuilder sb = new CPStringBuilder();
+for (int i = 0; i  s.length(); i++)
+{
+  char ch = s.charAt(i);
+  if (ch == '$' || ch == '\\')
+sb.append('\\');
+  sb.append(ch);
+}
+return sb.toString();
+  }
+
 }
-- 
1.7.1




[commit-cp] classpath ChangeLog java/util/regex/Matcher.java

2011-04-25 Thread Pekka Enberg
CVSROOT:/sources/classpath
Module name:classpath
Changes by: Pekka Enberg penberg  11/04/25 11:36:14

Modified files:
.  : ChangeLog 
java/util/regex: Matcher.java 

Log message:
Add Matcher.quoteReplacement API method

2011-04-25  Pekka Enberg  penb...@kernel.org

* java/util/regex/Matcher.java:
(quoteReplacement): Implement missing Java 1.5 API method.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/classpath/ChangeLog?cvsroot=classpathr1=1.9825r2=1.9826
http://cvs.savannah.gnu.org/viewcvs/classpath/java/util/regex/Matcher.java?cvsroot=classpathr1=1.26r2=1.27



[cp-patches] FYI: [PATCH] Fix Java_java_nio_VMDirectByteBuffer_allocate() for negative capacity

2011-03-17 Thread Pekka Enberg
JavaDocs clearly state that ByteBuffer.allocateDirect() must throw
IllegalArgumentException if capacity is negative.

2011-03-17  Pekka Enberg  penb...@kernel.org

* native/jni/java-nio/java_nio_VMDirectByteBuffer.c:
(Java_java_nio_VMDirectByteBuffer_allocate): Check for negative
capacity.

---
 native/jni/java-nio/java_nio_VMDirectByteBuffer.c |7 +++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/native/jni/java-nio/java_nio_VMDirectByteBuffer.c 
b/native/jni/java-nio/java_nio_VMDirectByteBuffer.c
index bfee7e9..7325c5b 100644
--- a/native/jni/java-nio/java_nio_VMDirectByteBuffer.c
+++ b/native/jni/java-nio/java_nio_VMDirectByteBuffer.c
@@ -51,6 +51,13 @@ Java_java_nio_VMDirectByteBuffer_allocate
 {
   void *buffer;
 
+  if (capacity  0)
+{
+  JCL_ThrowException (env, java/lang/IllegalArgumentException,
+ negative capacity);
+  return 0;
+}
+
   buffer = malloc (capacity);
 
   if (buffer == NULL)
-- 
1.7.1




[commit-cp] classpath native/jni/java-nio/java_nio_VMDirect...

2011-03-17 Thread Pekka Enberg
CVSROOT:/sources/classpath
Module name:classpath
Changes by: Pekka Enberg penberg  11/03/17 19:52:21

Modified files:
native/jni/java-nio: java_nio_VMDirectByteBuffer.c 
.  : ChangeLog 

Log message:
Fix Java_java_nio_VMDirectByteBuffer_allocate() for negative capacity

JavaDocs clearly state that ByteBuffer.allocateDirect() must throw
IllegalArgumentException if capacity is negative.

2011-03-17  Pekka Enberg  penb...@kernel.org

* native/jni/java-nio/java_nio_VMDirectByteBuffer.c:
(Java_java_nio_VMDirectByteBuffer_allocate): Check for negative
capacity.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/classpath/native/jni/java-nio/java_nio_VMDirectByteBuffer.c?cvsroot=classpathr1=1.15r2=1.16
http://cvs.savannah.gnu.org/viewcvs/classpath/ChangeLog?cvsroot=classpathr1=1.9823r2=1.9824



Re: [cp-patches] [PATCH] Fix Use ArrayList.add() in StyleSheet.resolveStyle

2011-03-15 Thread Pekka Enberg
Hi Andrew,

On Tue, Mar 15, 2011 at 12:47 PM, Dr Andrew John Hughes
ahug...@redhat.com wrote:
 Please just make it clear what you're asking for.  If it's a fix
 you're sure about, then just post to the patches
 list with the FYI: subject prefix and commit straight away.  If not,
 prefix the subject with RFC: and wait
 for feedback.

 With this one, it was unclear whether you wanted feedback or not and
 the commit wasn't immediate, but delayed by two days.

Oh, sorry about that - I'm still in my 'other project' mindset. I was
thought the fix was obvious enough but delayed the commit by few days
so people could take a look at the patch to see if you wanted me to
fix it in some other way.

/me goes to re-read the GNU Classpath Hacker's Guide...

Pekka



Re: [cp-patches] [PATCH] Fix Use ArrayList.add() in StyleSheet.resolveStyle

2011-03-14 Thread Pekka Enberg
Hi Andrew!

On Mon, Mar 14, 2011 at 11:46 PM, Dr Andrew John Hughes
ahug...@redhat.com wrote:
 Thanks for catching this bug.  I was going to approve it but you seem to have 
 already committed
 it -- why???

I thought that'd be OK since the fix was pretty simple and I was able
to work out why the regression was there. Would you prefer that I wait
for an explicit ACKs in the future?

Pekka



[commit-cp] classpath javax/swing/text/html/StyleSheet.java...

2011-03-14 Thread Pekka Enberg
CVSROOT:/sources/classpath
Module name:classpath
Changes by: Pekka Enberg penberg  11/03/14 19:35:50

Modified files:
javax/swing/text/html: StyleSheet.java 
.  : ChangeLog 

Log message:
Fix Use ArrayList.set() in StyleSheet.resolveStyle

The following cleanup patch:

More warning fixes.

2009-03-09  Andrew John Hughes  ahug...@redhat.com

[snip]

* javax/swing/text/html/StyleSheet.java:
Add generic typing.

changed the code to do ArrayList.set() on an instance thats allocated 
like this:

ListMapString,String attributes =
  new ArrayListMapString,String(count);

This is, however, broken as ArrayList constructor only ensures capacity 
but
doesn't allow you to set() elements outside of ArrayList.size(). This 
causes
the following exception to happen upon JPC start-up:

penberg@jaguar:~/testing/jato$ /usr/local/jamvm/bin/jamvm -jar 
JPCApplication.jar
Exception in thread main java.lang.ExceptionInInitializerError
   at java.lang.VMClass.forName(Native Method)
   at java.lang.Class.forName(Class.java:233)
   at jamvm.java.lang.JarLauncher.main(JarLauncher.java:46)
Caused by: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
   at java.util.ArrayList.raiseBoundsError(ArrayList.java:504)
   at java.util.ArrayList.checkBoundExclusive(ArrayList.java:490)
   at java.util.ArrayList.set(ArrayList.java:323)
   at javax.swing.text.html.StyleSheet.resolveStyle(StyleSheet.java:417)
   at 
javax.swing.text.html.StyleSheet.getResolvedStyle(StyleSheet.java:376)
   at javax.swing.text.html.StyleSheet.getRule(StyleSheet.java:358)
   at 
javax.swing.text.html.ViewAttributeSet.init(ViewAttributeSet.java:112)
   at 
javax.swing.text.html.StyleSheet.getViewAttributes(StyleSheet.java:562)

[snip]

Fix that up.

2011-03-14  Pekka Enberg  penb...@kernel.org

* javax/swing/text/html/StyleSheet.java:
(resolveStyle()): Fix misuse of ArrayList.set().

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/classpath/javax/swing/text/html/StyleSheet.java?cvsroot=classpathr1=1.30r2=1.31
http://cvs.savannah.gnu.org/viewcvs/classpath/ChangeLog?cvsroot=classpathr1=1.9820r2=1.9821



[cp-patches] [PATCH] Fix Use ArrayList.add() in StyleSheet.resolveStyle

2011-03-10 Thread Pekka Enberg
The following cleanup patch:

More warning fixes.

2009-03-09  Andrew John Hughes  ahug...@redhat.com

[snip]

* javax/swing/text/html/StyleSheet.java:
Add generic typing.

changed the code to do ArrayList.set() on an instance thats allocated like this:

ListMapString,String attributes =
  new ArrayListMapString,String(count);

This is, however, broken as ArrayList constructor only ensures capacity but
doesn't allow you to set() elements outside of ArrayList.size(). This causes
the following exception to happen upon JPC start-up:

penberg@jaguar:~/testing/jato$ /usr/local/jamvm/bin/jamvm -jar 
JPCApplication.jar
Exception in thread main java.lang.ExceptionInInitializerError
   at java.lang.VMClass.forName(Native Method)
   at java.lang.Class.forName(Class.java:233)
   at jamvm.java.lang.JarLauncher.main(JarLauncher.java:46)
Caused by: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
   at java.util.ArrayList.raiseBoundsError(ArrayList.java:504)
   at java.util.ArrayList.checkBoundExclusive(ArrayList.java:490)
   at java.util.ArrayList.set(ArrayList.java:323)
   at javax.swing.text.html.StyleSheet.resolveStyle(StyleSheet.java:417)
   at javax.swing.text.html.StyleSheet.getResolvedStyle(StyleSheet.java:376)
   at javax.swing.text.html.StyleSheet.getRule(StyleSheet.java:358)
   at javax.swing.text.html.ViewAttributeSet.init(ViewAttributeSet.java:112)
   at javax.swing.text.html.StyleSheet.getViewAttributes(StyleSheet.java:562)
   at javax.swing.text.html.ParagraphView.getAttributes(ParagraphView.java:117)
   at 
javax.swing.text.html.ParagraphView.setPropertiesFromAttributes(ParagraphView.java:131)
   at javax.swing.text.html.ParagraphView.setParent(ParagraphView.java:106)
   at javax.swing.text.CompositeView.replace(CompositeView.java:214)
   at javax.swing.text.BoxView.replace(BoxView.java:232)
   at javax.swing.text.html.BlockView.replace(BlockView.java:665)
   at javax.swing.text.CompositeView.loadChildren(CompositeView.java:123)
   at javax.swing.text.CompositeView.setParent(CompositeView.java:138)
   at javax.swing.text.html.BlockView.setParent(BlockView.java:187)
   at javax.swing.text.CompositeView.replace(CompositeView.java:214)
   at javax.swing.text.BoxView.replace(BoxView.java:232)
   at javax.swing.text.html.BlockView.replace(BlockView.java:665)
   at javax.swing.text.CompositeView.loadChildren(CompositeView.java:123)
   at javax.swing.text.CompositeView.setParent(CompositeView.java:138)
   at javax.swing.text.html.BlockView.setParent(BlockView.java:187)
   at javax.swing.plaf.basic.BasicTextUI$RootView.setView(BasicTextUI.java:322)
   at javax.swing.plaf.basic.BasicTextUI.setView(BasicTextUI.java:1499)
   at javax.swing.plaf.basic.BasicTextUI.modelChanged(BasicTextUI.java:1522)
   at 
javax.swing.plaf.basic.BasicTextUI$Handler.propertyChange(BasicTextUI.java:210)
   at 
java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:388)
   at 
java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:332)
   at java.awt.Component.firePropertyChange(Component.java:5236)
   at javax.swing.text.JTextComponent.setDocument(JTextComponent.java:1343)
   at javax.swing.JEditorPane.setEditorKit(JEditorPane.java:1081)
   at javax.swing.JEditorPane.init(JEditorPane.java:715)
   at org.jpc.j2se.JPCApplication.clinit(JPCApplication.java:55)
   at java.lang.VMClass.forName(Native Method)
   ...2 more

Signed-off-by: Pekka Enberg penb...@kernel.org
---
 javax/swing/text/html/StyleSheet.java |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/javax/swing/text/html/StyleSheet.java 
b/javax/swing/text/html/StyleSheet.java
index 5cf015b..31879b2 100644
--- a/javax/swing/text/html/StyleSheet.java
+++ b/javax/swing/text/html/StyleSheet.java
@@ -414,11 +414,12 @@ public class StyleSheet extends StyleContext
   tags[i] = t.toString();
 else
   tags[i] = null;
-attributes.set(i, attributeSetToMap(atts));
+attributes.add(attributeSetToMap(atts));
   }
 else
   {
 tags[i] = null;
+attributes.add(null);
   }
   }
 tags[0] = tag.toString();
-- 
1.7.1




[cp-patches] [PATCH] Fix Matcher.find() infinite loop bug

2011-03-02 Thread Pekka Enberg
This patch fixes a problem in Match.find() where the following piece of code
would enter an infinite loop:

Pattern p = Pattern.compile(\u);
Matcher m = p.matcher(hello, world);
System.out.println(m.find());

Signed-off-by: Pekka Enberg penb...@kernel.org
---
 ChangeLog|5 +
 java/util/regex/Matcher.java |6 ++
 2 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 05aa794..2b9cb5c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2011-03-02  Pekka Enberg  penb...@kernel.org
+
+   * java/util/regex/Matcher:
+   (find): Make sure match is within input data limits.
+
 2011-02-22  Pekka Enberg  penb...@kernel.org
 
* java/util/HashMap:
diff --git a/java/util/regex/Matcher.java b/java/util/regex/Matcher.java
index be57471..86c4873 100644
--- a/java/util/regex/Matcher.java
+++ b/java/util/regex/Matcher.java
@@ -169,6 +169,12 @@ public final class Matcher implements MatchResult
 if (match != null)
   {
 int endIndex = match.getEndIndex();
+// Is the match within input limits?
+if (endIndex = input.length())
+  {
+match = null;
+return false;
+  }
 // Are we stuck at the same position?
 if (!first  endIndex == position)
   {
-- 
1.7.1




[commit-cp] classpath ChangeLog java/util/regex/Matcher.java

2011-03-02 Thread Pekka Enberg
CVSROOT:/sources/classpath
Module name:classpath
Changes by: Pekka Enberg penberg  11/03/02 19:40:13

Modified files:
.  : ChangeLog 
java/util/regex: Matcher.java 

Log message:
Fix Matcher.find() infinite loop bug

This patch fixes a problem in Match.find() where the following piece of 
code
would enter an infinite loop:

System.out.println(hello, world.split(\u);

The root cause is that Matcher.find() returns true for the following 
snippet:

Pattern p = Pattern.compile(\u);
Matcher m = p.matcher(hello, world);
System.out.println(m.find());

2011-03-02  Pekka Enberg  penb...@kernel.org

* java/util/regex/Matcher:
(find): Make sure match is within input data limits.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/classpath/ChangeLog?cvsroot=classpathr1=1.9818r2=1.9819
http://cvs.savannah.gnu.org/viewcvs/classpath/java/util/regex/Matcher.java?cvsroot=classpathr1=1.25r2=1.26



[cp-patches] [PATCH] Bump up HashMap default initial capacity

2011-02-22 Thread Pekka Enberg
While debugging Jython bootstrap issues with GNU Classpath, I noticed that
HashMap.DEFAULT_CAPACITY is set to 11 although 1.4 Javadocs, for example,

define it to be 16.  Signed-off-by: Pekka Enberg penb...@kernel.org
---
 ChangeLog  |6 ++
 java/util/HashMap.java |5 ++---
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index f1c7c31..7eeacf0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2011-02-22  Pekka Enberg  penb...@kernel.org
+
+   * java/util/HashMap:
+   (DEFAULT_CAPACITY): Make default initial capacity 16 as it is
+   defined in official Javadocs.
+
 2010-02-16  Pekka Enberg  penb...@kernel.org
 
* java/util/Formatter.java:
diff --git a/java/util/HashMap.java b/java/util/HashMap.java
index 55d81c6..108bf25 100644
--- a/java/util/HashMap.java
+++ b/java/util/HashMap.java
@@ -100,11 +100,10 @@ public class HashMapK, V extends AbstractMapK, V
   implements MapK, V, Cloneable, Serializable
 {
   /**
-   * Default number of buckets. This is the value the JDK 1.3 uses. Some
-   * early documentation specified this value as 101. That is incorrect.
+   * Default number of buckets; this is explicitly specified by the spec.
* Package visible for use by HashSet.
*/
-  static final int DEFAULT_CAPACITY = 11;
+  static final int DEFAULT_CAPACITY = 16;
 
   /**
* The default load factor; this is explicitly specified by the spec.
-- 
1.7.1




[cp-patches] [PATCH] Fix HashMap.put() to check for hashCode equality before equals()

2011-02-22 Thread Pekka Enberg
This patch is needed to run Jython 2.5.2 RC 4 under JamVM and GNU Classpath CVS
HEAD. It turns out Jythin bootstrap is bit hairy and assumes HashMap.put()
checks for hashCode equality before invoking Object.equals().

Signed-off-by: Pekka Enberg penb...@kernel.org
---
 ChangeLog  |6 ++
 java/util/HashMap.java |2 +-
 2 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 7eeacf0..05aa794 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,12 @@
 2011-02-22  Pekka Enberg  penb...@kernel.org
 
* java/util/HashMap:
+   (put): Check for key hashCode equality before invoking
+   Object.equals() to fix compatibility issue with Jython.
+
+2011-02-22  Pekka Enberg  penb...@kernel.org
+
+   * java/util/HashMap:
(DEFAULT_CAPACITY): Make default initial capacity 16 as it is
defined in official Javadocs.
 
diff --git a/java/util/HashMap.java b/java/util/HashMap.java
index 108bf25..2f56932 100644
--- a/java/util/HashMap.java
+++ b/java/util/HashMap.java
@@ -345,7 +345,7 @@ public class HashMapK, V extends AbstractMapK, V
 
 while (e != null)
   {
-if (equals(key, e.key))
+if ((key.hashCode() == e.key.hashCode())  equals(key, e.key))
   {
 e.access(); // Must call this for bookkeeping in LinkedHashMap.
 V r = e.value;
-- 
1.7.1




[commit-cp] classpath java/util/HashMap.java ChangeLog

2011-02-22 Thread Pekka Enberg
CVSROOT:/sources/classpath
Module name:classpath
Changes by: Pekka Enberg penberg  11/02/22 16:09:42

Modified files:
java/util  : HashMap.java 
.  : ChangeLog 

Log message:
Bump up HashMap default initial capacity

While debugging Jython bootstrap issues with GNU Classpath, I noticed 
that
HashMap.DEFAULT_CAPACITY is set to 11 although Java 1.4 has it as 16.

2011-02-22  Pekka Enberg  penb...@kernel.org

* java/util/HashMap:
(DEFAULT_CAPACITY): Make default initial capacity 16 as it is
defined in official Javadocs.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/classpath/java/util/HashMap.java?cvsroot=classpathr1=1.35r2=1.36
http://cvs.savannah.gnu.org/viewcvs/classpath/ChangeLog?cvsroot=classpathr1=1.9816r2=1.9817



[commit-cp] classpath java/util/HashMap.java ChangeLog

2011-02-22 Thread Pekka Enberg
CVSROOT:/sources/classpath
Module name:classpath
Changes by: Pekka Enberg penberg  11/02/22 16:10:18

Modified files:
java/util  : HashMap.java 
.  : ChangeLog 

Log message:
Fix HashMap.put() to check for hashCode equality before equals()

This patch is needed to run Jython 2.5.2 RC 4 under JamVM and GNU 
Classpath CVS
HEAD. It turns out Jythin bootstrap is bit hairy and assumes 
HashMap.put()
checks for hashCode equality before invoking Object.equals().

2011-02-22  Pekka Enberg  penb...@kernel.org

* java/util/HashMap:
(put): Check for key hashCode equality before invoking
Object.equals() to fix compatibility issue with Jython.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/classpath/java/util/HashMap.java?cvsroot=classpathr1=1.36r2=1.37
http://cvs.savannah.gnu.org/viewcvs/classpath/ChangeLog?cvsroot=classpathr1=1.9817r2=1.9818



[cp-patches] [PATCH] Fix Formatter.parseInt() wrt. leading zeroes

2011-02-16 Thread Pekka Enberg
The following test case:

  public class StringTest {
public static void main(String[] args) {
  System.out.println(String.format(%08x, 1234));
}
  }

produces the following error:

Exception in thread main java.lang.NumberFormatException: invalid character 
at position 2 in 08
   at java.lang.Integer.parseInt(Integer.java:837)
   at java.lang.Integer.decode(Integer.java:568)
   at java.util.Formatter.parseInt(Formatter.java:1191)
   at java.util.Formatter.parseArgumentIndex(Formatter.java:1212)
   at java.util.Formatter.format(Formatter.java:1326)
   at java.util.Formatter.format(Formatter.java:1442)
   at java.lang.String.format(String.java:1984)
   at java.lang.String.format(String.java:1990)
   at StringTest.main(StringTest.java:3)

This patch fixes the issue by switching to Integer.parseInt() in
java.util.Formatter.parseInt().

Signed-off-by: Pekka Enberg penb...@kernel.org
---
 ChangeLog|7 +++
 java/util/Formatter.java |2 +-
 2 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index a575fb9..f1c7c31 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2010-02-16  Pekka Enberg  penb...@kernel.org
+
+   * java/util/Formatter.java:
+   (parseInt): Use Integer.parseInt() insted of Integer.decode()
+   because the latter doesn't work with leading zeros which are
+   used in String.format() formatting, for example.
+
 2010-07-02  Ivan Maidanski  iv...@mail.ru
 
* java/util/regex/Pattern.java:
diff --git a/java/util/Formatter.java b/java/util/Formatter.java
index 04ae805..62f6845 100644
--- a/java/util/Formatter.java
+++ b/java/util/Formatter.java
@@ -1188,7 +1188,7 @@ public final class Formatter
   advance();
 if (start == index)
   return -1;
-return Integer.decode(format.substring(start, index));
+return Integer.parseInt(format.substring(start, index));
   }
 
   /**
-- 
1.7.1




[commit-cp] classpath ChangeLog java/util/Formatter.java

2011-02-16 Thread Pekka Enberg
CVSROOT:/sources/classpath
Module name:classpath
Changes by: Pekka Enberg penberg  11/02/16 19:44:29

Modified files:
.  : ChangeLog 
java/util  : Formatter.java 

Log message:
Fix Formatter.parseInt() wrt. leading zeroes

The following test case:

  public class StringTest {
public static void main(String[] args) {
  System.out.println(String.format(%08x, 1234));
}
  }

produces the following error:

Exception in thread main java.lang.NumberFormatException: invalid 
character at position 2 in 08
   at java.lang.Integer.parseInt(Integer.java:837)
   at java.lang.Integer.decode(Integer.java:568)
   at java.util.Formatter.parseInt(Formatter.java:1191)
   at java.util.Formatter.parseArgumentIndex(Formatter.java:1212)
   at java.util.Formatter.format(Formatter.java:1326)
   at java.util.Formatter.format(Formatter.java:1442)
   at java.lang.String.format(String.java:1984)
   at java.lang.String.format(String.java:1990)
   at StringTest.main(StringTest.java:3)

This patch fixes the issue by switching to Integer.parseInt() in
java.util.Formatter.parseInt().

Reviewed-by: Dr Andrew John Hughes gnu_and...@member.fsf.org

2010-02-16  Pekka Enberg  penb...@kernel.org

   * java/util/Formatter.java:
   (parseInt): Use Integer.parseInt() insted of Integer.decode()
   because the latter doesn't work with leading zeros which are
   used in String.format() formatting, for example.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/classpath/ChangeLog?cvsroot=classpathr1=1.9815r2=1.9816
http://cvs.savannah.gnu.org/viewcvs/classpath/java/util/Formatter.java?cvsroot=classpathr1=1.7r2=1.8



Re: [RFC/PATCH] Invokedynamic API stubs

2011-02-08 Thread Pekka Enberg
Hi Mark,

On Mon, 2011-02-07 at 15:24 +0100, Dr Andrew John Hughes wrote:
   I guess I could keep it on my Github mirror until I have something
   concrete enough to be merged to trunk.
  
  I'd prefer to have it in HEAD as long as it's clearly marked as stubs
  (the NotImplementedException I mentioned) and there is work actively
  taking place.
  Then there's always the (slim) possibility someone else can work on it :-)

On Mon, 2011-02-07 at 22:01 +0200, Pekka Enberg wrote:
 That was my original thinking as well. Does the included patch look
 better to you? Mark, what do you think about this?

On Tue, Feb 8, 2011 at 2:28 PM, Mark Wielaard m...@klomp.org wrote:
 I admit to still just not like stubs, however they are setup.
 If creating branches wasn't such a pain with CVS I would really
 recommend doing all this on a branch and only merge when ready and it
 can actually be used with some VM. I guess it is just time to bite the
 bullet and create some time to move to mercurial and setup some rules
 about how to create working branches. I won't veto getting this in right
 now if that is really what you and Andrew want, but I am not
 particularly excited either.

Well, I'd like to keep everyone involved excited so maybe Mercural
branch is the way to go here?

Pekka



Re: [RFC/PATCH] Invokedynamic API stubs

2011-02-07 Thread Pekka Enberg
Hi!

On Thu, 2011-02-03 at 16:47 +0200, Pekka Enberg wrote:
 I'd like to check in these simple invokedynamic API stubs into CVS HEAD.
 The APIs are not final but I think now is as good time as any to start
 working on them especially as it needs work on the VM side. Furthermore,
 there's already open source projects such as JRuby out there that use
 invokedynamic so I think GNU Classpath probably needs to support it at
 some point anyway.

 The classes don't do anything useful yet and don't even contain all
 the specified methods.

On Fri, Feb 4, 2011 at 10:11 AM, Mark Wielaard m...@klomp.org wrote:
 I have to admit that I don't like putting in stubs. In the past we have
 decided to just leave things really unimplemented if we don't support
 it. And as you say it needs a bit more design thinking. So I would
 suggest you do this on a branch first (grmbl CVS...) and/or first try to
 spec it out against a jato VM implementation.

Sure, I want to start looking at implementing invokedynamic for Jato
which is why I implemented these stubs in the first place. I expect
that to take some time so the question is where to put the
work-in-progress implementation. I don't see any reason to keep it
stashed on my local hard disk but I have to admit I'm not entirely
happy with the idea of using CVS branches for it either...

I guess I could keep it on my Github mirror until I have something
concrete enough to be merged to trunk.

On Fri, Feb 4, 2011 at 10:11 AM, Mark Wielaard m...@klomp.org wrote:
 BTW. John Rose has lots of background material online:
 http://cr.openjdk.java.net/~jrose/pres/

Thanks!

Pekka



Re: [RFC/PATCH] Invokedynamic API stubs

2011-02-07 Thread Pekka Enberg
On Mon, 2011-02-07 at 15:24 +0100, Dr Andrew John Hughes wrote:
  I guess I could keep it on my Github mirror until I have something
  concrete enough to be merged to trunk.
 
 I'd prefer to have it in HEAD as long as it's clearly marked as stubs
 (the NotImplementedException I mentioned) and there is work actively
 taking place.
 Then there's always the (slim) possibility someone else can work on it :-)

That was my original thinking as well. Does the included patch look
better to you? Mark, what do you think about this?

Pekka

From 81362427a842e815bfe354036cd4201ee781880a Mon Sep 17 00:00:00 2001
From: Pekka Enberg penb...@kernel.org
Date: Thu, 3 Feb 2011 16:29:15 +0200
Subject: [PATCH] Invokedynamic API stubs

This patch implements the work-in-progress invokedynamic API stubs described
here:

  http://download.oracle.com/javase/7/docs/api/java/dyn/package-summary.html

The classes don't do anything useful yet and don't even contain all the
specified methods.

Signed-off-by: Pekka Enberg penb...@kernel.org
---
 java/dyn/BootstrapMethod.java |   52 
 java/dyn/CallSite.java|   60 
 java/dyn/ClassValue.java  |   45 +
 java/dyn/ConstantCallSite.java|   46 +
 java/dyn/InvokeDynamic.java   |   49 +++
 java/dyn/InvokeDynamicBootstrapError.java |   47 ++
 java/dyn/Linkage.java |   45 +
 java/dyn/LinkagePermission.java   |   56 ++
 java/dyn/MethodHandle.java|   62 +
 java/dyn/MethodHandleProvider.java|   52 
 java/dyn/MethodHandles.java   |   52 
 java/dyn/MethodType.java  |   50 +++
 java/dyn/NoAccessException.java   |   47 ++
 java/dyn/WrongMethodTypeException.java|   47 ++
 14 files changed, 710 insertions(+), 0 deletions(-)
 create mode 100644 java/dyn/BootstrapMethod.java
 create mode 100644 java/dyn/CallSite.java
 create mode 100644 java/dyn/ClassValue.java
 create mode 100644 java/dyn/ConstantCallSite.java
 create mode 100644 java/dyn/InvokeDynamic.java
 create mode 100644 java/dyn/InvokeDynamicBootstrapError.java
 create mode 100644 java/dyn/Linkage.java
 create mode 100644 java/dyn/LinkagePermission.java
 create mode 100644 java/dyn/MethodHandle.java
 create mode 100644 java/dyn/MethodHandleProvider.java
 create mode 100644 java/dyn/MethodHandles.java
 create mode 100644 java/dyn/MethodType.java
 create mode 100644 java/dyn/NoAccessException.java
 create mode 100644 java/dyn/WrongMethodTypeException.java

diff --git a/java/dyn/BootstrapMethod.java b/java/dyn/BootstrapMethod.java
new file mode 100644
index 000..d2ec24a
--- /dev/null
+++ b/java/dyn/BootstrapMethod.java
@@ -0,0 +1,52 @@
+/* BootstrapMethod.java --
+   Copyright (C) 2011 Free Software Foundation
+
+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 java.dyn;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+import static java.lang.annotation.RetentionPolicy.SOURCE;
+import static

[RFC/PATCH] Invokedynamic API stubs

2011-02-03 Thread Pekka Enberg
Hi!

I'd like to check in these simple invokedynamic API stubs into CVS HEAD.
The APIs are not final but I think now is as good time as any to start
working on them especially as it needs work on the VM side. Furthermore,
there's already open source projects such as JRuby out there that use
invokedynamic so I think GNU Classpath probably needs to support it at
some point anyway.

Pekka

From 6dca9b60d6c2380164920e40302f08616a6874b6 Mon Sep 17 00:00:00 2001
From: Pekka Enberg penb...@kernel.org
Date: Thu, 3 Feb 2011 16:47:15 +0200
Subject: [PATCH] Invokedynamic API stubs

This patch implements the work-in-progress invokedynamic API stubs described
here:

  http://download.oracle.com/javase/7/docs/api/java/dyn/package-summary.html

The classes don't do anything useful yet and don't even contain all the
specified methods.

Signed-off-by: Pekka Enberg penb...@kernel.org
---
 java/lang/dyn/BootstrapMethod.java |   52 +
 java/lang/dyn/CallSite.java|   57 +++
 java/lang/dyn/ClassValue.java  |   45 ++
 java/lang/dyn/ConstantCallSite.java|   46 ++
 java/lang/dyn/InvokeDynamic.java   |   49 
 java/lang/dyn/InvokeDynamicBootstrapError.java |   47 +++
 java/lang/dyn/Linkage.java |   45 ++
 java/lang/dyn/LinkagePermission.java   |   55 ++
 java/lang/dyn/MethodHandle.java|   59 
 java/lang/dyn/MethodHandleProvider.java|   52 +
 java/lang/dyn/MethodHandles.java   |   52 +
 java/lang/dyn/MethodType.java  |   50 
 java/lang/dyn/NoAccessException.java   |   47 +++
 java/lang/dyn/WrongMethodTypeException.java|   47 +++
 14 files changed, 703 insertions(+), 0 deletions(-)
 create mode 100644 java/lang/dyn/BootstrapMethod.java
 create mode 100644 java/lang/dyn/CallSite.java
 create mode 100644 java/lang/dyn/ClassValue.java
 create mode 100644 java/lang/dyn/ConstantCallSite.java
 create mode 100644 java/lang/dyn/InvokeDynamic.java
 create mode 100644 java/lang/dyn/InvokeDynamicBootstrapError.java
 create mode 100644 java/lang/dyn/Linkage.java
 create mode 100644 java/lang/dyn/LinkagePermission.java
 create mode 100644 java/lang/dyn/MethodHandle.java
 create mode 100644 java/lang/dyn/MethodHandleProvider.java
 create mode 100644 java/lang/dyn/MethodHandles.java
 create mode 100644 java/lang/dyn/MethodType.java
 create mode 100644 java/lang/dyn/NoAccessException.java
 create mode 100644 java/lang/dyn/WrongMethodTypeException.java

diff --git a/java/lang/dyn/BootstrapMethod.java 
b/java/lang/dyn/BootstrapMethod.java
new file mode 100644
index 000..d2ec24a
--- /dev/null
+++ b/java/lang/dyn/BootstrapMethod.java
@@ -0,0 +1,52 @@
+/* BootstrapMethod.java --
+   Copyright (C) 2011 Free Software Foundation
+
+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 java.dyn;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+import static java.lang.annotation.RetentionPolicy.SOURCE;
+import static java.lang.annotation.ElementType.*;
+
+/**
+ * @since 1.7

  1   2   >