Andrew John Hughes | 10 Dec 2008 23:18
Picon
Gravatar

FYI: Minimal fix for PR38473

When attempting to obtain a GlyphVector for a font, our Gtk+
peer calls FT_Outline_Decompose on the outline of the font's glyph.
However, this fails, causing a segmentation fault, if the font
is a bitmap font.  This patch adds a check to ensure the outline
is valid before using it.  For a full fix, we should really return
some form of outline for a bitmapped font.

ChangeLog:

2008-12-09  Andrew John Hughes  <gnu_andrew <at> member.fsf.org>

	PR classpath/38473:
	* native/jni/gtk-peer/gnu_java_awt_peer_gtk_FreetypeGlyphVector.c:
	(Java_gnu_java_awt_peer_gtk_FreetypeGlyphVector_getGlyphOutlineNative):
	Check that the glyph is an outline before calling
	FT_Outline_Decompose.

--

-- 
Andrew :)

Support Free Java!
Contribute to GNU Classpath and the OpenJDK
http://www.gnu.org/software/classpath
http://openjdk.java.net
PGP Key: 94EFD9D8 (http://subkeys.pgp.net)
Fingerprint = F8EF F1EA 401E 2E60 15FA  7927 142C 2591 94EF D9D8
Index: native/jni/gtk-peer/gnu_java_awt_peer_gtk_FreetypeGlyphVector.c
===================================================================
(Continue reading)

Andrew John Hughes | 18 Dec 2008 01:42
Picon
Gravatar

FYI: Bug fix to last patch

This is a bug fix for my last patch; forgot to add the null terminator
needed for C strings...

2008-12-18  Andrew John Hughes  <gnu_andrew <at> member.fsf.org>

	* native/jni/gtk-peer/gnu_java_awt_peer_gtk_FreetypeGlyphVector.c:
	Include '\0' in the string.

-- 
Andrew :)

Support Free Java!
Contribute to GNU Classpath and the OpenJDK
http://www.gnu.org/software/classpath
http://openjdk.java.net
PGP Key: 94EFD9D8 (http://subkeys.pgp.net)
Fingerprint = F8EF F1EA 401E 2E60 15FA  7927 142C 2591 94EF D9D8
Index: native/jni/gtk-peer/gnu_java_awt_peer_gtk_FreetypeGlyphVector.c
===================================================================
RCS file: /sources/classpath/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_FreetypeGlyphVector.c,v
retrieving revision 1.11
diff -u -u -r1.11 gnu_java_awt_peer_gtk_FreetypeGlyphVector.c
--- native/jni/gtk-peer/gnu_java_awt_peer_gtk_FreetypeGlyphVector.c	10 Dec 2008 22:19:27 -0000	1.11
+++ native/jni/gtk-peer/gnu_java_awt_peer_gtk_FreetypeGlyphVector.c	16 Dec 2008 18:09:41 -0000
 <at>  <at>  -392,12 +392,13  <at>  <at> 
     }
   else
     {
(Continue reading)

Robin Garner | 19 Dec 2008 04:20
Picon
Picon

ThreadLocalMap.clear() leaves map in an inconsistent state

The clear() method of ThreadLocalMap leaves the map in an inconsistent 
state, causing errors during thread deletion in JikesRVM.  Reported as 
Bug #38576 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38576>. This 
patch amends the clear() method to put the map back in a consistent but 
empty state.

--
Robin Garner

Attachment (ThreadLocalMap.patch): text/x-diff, 426 bytes
Mark Wielaard | 19 Dec 2008 10:51
Favicon
Gravatar

Re: ThreadLocalMap.clear() leaves map in an inconsistent state

Hi Robin

On Fri, 2008-12-19 at 14:20 +1100, Robin Garner wrote:
> The clear() method of ThreadLocalMap leaves the map in an inconsistent 
> state, causing errors during thread deletion in JikesRVM.  Reported as 
> Bug #38576 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38576>. This 
> patch amends the clear() method to put the map back in a consistent but 
> empty state.

I assume this happens because JikesRVM still has some ThreadLocals it
accesses itself after Thread dead. Or is there a way in which this could
show up (assuming the VM itself isn't using ThreadLocals to keep state)?

Some nitpicks going over the ThreadLocalMap (nothing seems super
important and we can certainly apply your patch as is, but if you are
cleaning up anyway...):

- Maybe let the constructor now call clear()
  since they now share the same code and intention.
- Why not use new Entry[0]?
- You could even make a private static noEntries = new Entry[0];
  And make clear say entries = noEntries; So there is only ever one
  instance in case there are lots of threads in the program.
- Using 0 would also make the test in overflow for entries.length more
  natural (by testing for zero instead of one).
- If entries can never be null now the null check for oldEntries becomes
  redundant.

Cheers,

(Continue reading)

Andrew John Hughes | 23 Dec 2008 03:04
Picon
Gravatar

FYI: Add missing 1.6 methods to String

This adds a few simple methods that were added to String in 1.6.

ChangeLog:

2008-12-22  Andrew John Hughes  <gnu_andrew <at> member.fsf.org>

	* java/lang/String.java:
	(byte[],int,int,String): Call new Charset method.
	(stringToCharset(String)): Private method added to
	handle exception conversion.
	(byte[],int,int,Charset): Implemented.
	(byte[], Charset): Likewise.
	(getBytes(String)): Call new Charset method.
	(getBytes(Charset)): Implemented.

--

-- 
Andrew :)

Support Free Java!
Contribute to GNU Classpath and the OpenJDK
http://www.gnu.org/software/classpath
http://openjdk.java.net
PGP Key: 94EFD9D8 (http://subkeys.pgp.net)
Fingerprint = F8EF F1EA 401E 2E60 15FA  7927 142C 2591 94EF D9D8
Index: java/lang/String.java
===================================================================
RCS file: /sources/classpath/classpath/java/lang/String.java,v
retrieving revision 1.90
(Continue reading)

Andrew John Hughes | 31 Dec 2008 02:40
Picon
Gravatar

FYI: Fix regression in SimpleDateFormat

The standard characters set in SimpleDateFormat should match
the length of the localised characters obtained from our locale
data.

ChangeLog:

2008-12-30  Andrew John Hughes  <gnu_andrew <at> member.fsf.org>

	* java/text/SimpleDateFormat.java:
	(standardChars): Use standard characters from CLDR.
	(RFC822_TIMEZONE_FIELD): Fixed to match new standard
	characters.

--

-- 
Andrew :)

Support Free Java!
Contribute to GNU Classpath and the OpenJDK
http://www.gnu.org/software/classpath
http://openjdk.java.net
PGP Key: 94EFD9D8 (http://subkeys.pgp.net)
Fingerprint = F8EF F1EA 401E 2E60 15FA  7927 142C 2591 94EF D9D8
Index: java/text/SimpleDateFormat.java
===================================================================
RCS file: /sources/classpath/classpath/java/text/SimpleDateFormat.java,v
retrieving revision 1.60
diff -u -u -r1.60 SimpleDateFormat.java
--- java/text/SimpleDateFormat.java	5 May 2008 18:42:07 -0000	1.60
(Continue reading)

Andrew John Hughes | 31 Dec 2008 09:26
Picon
Gravatar

FYI: Cleanup of java.text classes #01

This fixes a number of warnings in some java.text classes
and adds a few minor optimisations (use of final fields,
ArrayLists in place of Vectors where synchronisation is not needed).

ChangeLog:

2008-12-31  Andrew John Hughes  <gnu_andrew <at> member.fsf.org>

	* java/text/MessageFormat.java:
	Convert variables to use generic types, use
	CPStringBuilder in place of StringBuilder.
	(Field()): Suppress warning due to only being used by
	deserialization.
	(scanFormat(String,int,CPStringBuilder,List,Locale)):
	Use ArrayList instead of Vector as no synchronisation needed.
	(parse(String,ParsePosition)): Likewise.
	* java/text/NumberFormat.java:
	(Field()): Suppress warning due to only being used by
	deserialization.
	* java/text/RuleBasedCollator.java:
	Convert variables to use generic types.
	(CollationElement): Make fields final.
	(CollationSorter): Likewise.
	(CollationSorter(int,String,int,boolean)): New constructor.
	* java/text/SimpleDateFormat.java,
	Convert variables to use generic types.
	(applyPattern(String)): Clear list rather than creating a new instance.

--

-- 
Andrew :)
(Continue reading)

Andrew Haley | 31 Dec 2008 10:58
Picon
Favicon

Re: FYI: Fix regression in SimpleDateFormat

Andrew John Hughes wrote:
> The standard characters set in SimpleDateFormat should match
> the length of the localised characters obtained from our locale
> data.
> 
> ChangeLog:
> 
> 2008-12-30  Andrew John Hughes  <gnu_andrew <at> member.fsf.org>
> 
> 	* java/text/SimpleDateFormat.java:
> 	(standardChars): Use standard characters from CLDR.
> 	(RFC822_TIMEZONE_FIELD): Fixed to match new standard
> 	characters.
> 
> 

Surely this

+  private static final int RFC822_TIMEZONE_FIELD = 23;

is

   private static final int RFC822_TIMEZONE_FIELD = standardChars.indexOf("Z")

And this

 <at>  <at>  -576,6 +576,7  <at>  <at> 
 	    int j = oldChars.indexOf(ch);
 	    if (j >= 0)
 	      ch = newChars.charAt(j);
(Continue reading)

Andrew John Hughes | 31 Dec 2008 11:24
Picon
Gravatar

Re: FYI: Fix regression in SimpleDateFormat

2008/12/31 Andrew Haley <aph <at> redhat.com>:
> Andrew John Hughes wrote:
>> The standard characters set in SimpleDateFormat should match
>> the length of the localised characters obtained from our locale
>> data.
>>
>> ChangeLog:
>>
>> 2008-12-30  Andrew John Hughes  <gnu_andrew <at> member.fsf.org>
>>
>>       * java/text/SimpleDateFormat.java:
>>       (standardChars): Use standard characters from CLDR.
>>       (RFC822_TIMEZONE_FIELD): Fixed to match new standard
>>       characters.
>>
>>
>
> Surely this
>
> +  private static final int RFC822_TIMEZONE_FIELD = 23;
>
> is
>
>   private static final int RFC822_TIMEZONE_FIELD = standardChars.indexOf("Z")
>

        case RFC822_TIMEZONE_FIELD:
             ^^^^^^^^^^^^^^^^^^^^^
case expressions must be constant expressions

(Continue reading)

Andrew John Hughes | 31 Dec 2008 12:30
Picon
Gravatar

FYI: Emulate Vector.setSize() in MessageFormat

ArrayList has no equivalent of Vector.setSize() which pads
a collection to a specified size.  MessageFormat was relying on this
behaviour to produce a sparsely-populated results array (filling
only the specified slots using set rather than appending to the end).
We emulate it by simply looping until the specified size is achieved
by adding null values to the end.

ChangeLog:

2008-12-31  Andrew John Hughes  <gnu_andrew <at> member.fsf.org>

	* java/text/MessageFormat.java:
	(parse(String,ParsePosition)): Emulate behaviour
	of Vector's setSize() which was being implicitly relied on.
--

-- 
Andrew :)

Support Free Java!
Contribute to GNU Classpath and the OpenJDK
http://www.gnu.org/software/classpath
http://openjdk.java.net
PGP Key: 94EFD9D8 (http://subkeys.pgp.net)
Fingerprint = F8EF F1EA 401E 2E60 15FA  7927 142C 2591 94EF D9D8
Index: java/text/MessageFormat.java
===================================================================
RCS file: /sources/classpath/classpath/java/text/MessageFormat.java,v
retrieving revision 1.28
diff -u -u -r1.28 MessageFormat.java
(Continue reading)


Gmane